Struct bao_tree::io::outboard::PreOrderMemOutboard
source · pub struct PreOrderMemOutboard<T = Vec<u8>> {
pub data: T,
/* private fields */
}
Expand description
A pre order outboard that is optimized for memory storage.
Fields§
§data: T
hashes with length prefix
Implementations§
source§impl<T: AsRef<[u8]>> PreOrderMemOutboard<T>
impl<T: AsRef<[u8]>> PreOrderMemOutboard<T>
sourcepub fn new(
root: Hash,
tree: BaoTree,
outboard_data: T
) -> Result<Self, &'static str>
pub fn new( root: Hash, tree: BaoTree, outboard_data: T ) -> Result<Self, &'static str>
Create a new outboard from a root hash, tree, and existing outboard data.
This will just do a check that the data is the right size, but not check the actual hashes.
Note that if you have data with a length prefix, you have to remove the prefix first.
sourcepub fn map_data<F, U>(
self,
f: F
) -> Result<PreOrderMemOutboard<U>, &'static str>
pub fn map_data<F, U>( self, f: F ) -> Result<PreOrderMemOutboard<U>, &'static str>
Map the outboard data to a new type.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Get the inner data.
sourcepub fn flip(&self) -> PostOrderMemOutboard
pub fn flip(&self) -> PostOrderMemOutboard
Flip the outboard to a post order outboard.
Trait Implementations§
source§impl<T: Clone> Clone for PreOrderMemOutboard<T>
impl<T: Clone> Clone for PreOrderMemOutboard<T>
source§fn clone(&self) -> PreOrderMemOutboard<T>
fn clone(&self) -> PreOrderMemOutboard<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: AsMut<[u8]>> OutboardMut for PreOrderMemOutboard<T>
impl<T: AsMut<[u8]>> OutboardMut for PreOrderMemOutboard<T>
source§impl<T: AsMut<[u8]>> OutboardMut for PreOrderMemOutboard<T>
impl<T: AsMut<[u8]>> OutboardMut for PreOrderMemOutboard<T>
source§impl<T: PartialEq> PartialEq for PreOrderMemOutboard<T>
impl<T: PartialEq> PartialEq for PreOrderMemOutboard<T>
source§fn eq(&self, other: &PreOrderMemOutboard<T>) -> bool
fn eq(&self, other: &PreOrderMemOutboard<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq> Eq for PreOrderMemOutboard<T>
impl<T> StructuralPartialEq for PreOrderMemOutboard<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PreOrderMemOutboard<T>where
T: RefUnwindSafe,
impl<T> Send for PreOrderMemOutboard<T>where
T: Send,
impl<T> Sync for PreOrderMemOutboard<T>where
T: Sync,
impl<T> Unpin for PreOrderMemOutboard<T>where
T: Unpin,
impl<T> UnwindSafe for PreOrderMemOutboard<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more