pub struct PreOrderOutboard<D = Vec<u8>> {
pub root: Hash,
pub tree: BaoTree,
pub data: D,
}
Expand description
A generic outboard in pre order
All fields are public, so an outboard does not enforce any invariants. This is necessary since we want outboards to exist in an incomplete state where data does not match the root hash.
Caution: unlike the outboard implementation in the bao crate, this implementation does not assume an 8 byte size prefix.
Fields§
§root: Hash
root hash
tree: BaoTree
tree defining the data
data: D
hashes with length prefix
Trait Implementations§
Source§impl<D: Clone> Clone for PreOrderOutboard<D>
impl<D: Clone> Clone for PreOrderOutboard<D>
Source§fn clone(&self) -> PreOrderOutboard<D>
fn clone(&self) -> PreOrderOutboard<D>
Returns a duplicate 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<W: AsyncSliceWriter> CreateOutboard for PreOrderOutboard<W>
impl<W: AsyncSliceWriter> CreateOutboard for PreOrderOutboard<W>
Source§async fn create_sized(
data: impl AsyncStreamReader,
size: u64,
block_size: BlockSize,
) -> Result<Self>
async fn create_sized( data: impl AsyncStreamReader, size: u64, block_size: BlockSize, ) -> Result<Self>
create an outboard from a data source. This requires the outboard to
have a default implementation, which is the case for the memory
implementations.
Source§impl<W: WriteAt> CreateOutboard for PreOrderOutboard<W>
impl<W: WriteAt> CreateOutboard for PreOrderOutboard<W>
Source§fn create_sized(
data: impl Read,
size: u64,
block_size: BlockSize,
) -> Result<Self>
fn create_sized( data: impl Read, size: u64, block_size: BlockSize, ) -> Result<Self>
create an outboard from a data source. This requires the outboard to
have a default implementation, which is the case for the memory
implementations.
Source§impl<D: Debug> Debug for PreOrderOutboard<D>
impl<D: Debug> Debug for PreOrderOutboard<D>
Source§impl<R: Default> Default for PreOrderOutboard<R>
impl<R: Default> Default for PreOrderOutboard<R>
Source§impl<R: AsyncSliceReader> Outboard for PreOrderOutboard<R>
impl<R: AsyncSliceReader> Outboard for PreOrderOutboard<R>
Source§impl<R: ReadAt> Outboard for PreOrderOutboard<R>
impl<R: ReadAt> Outboard for PreOrderOutboard<R>
Source§impl<W: AsyncSliceWriter> OutboardMut for PreOrderOutboard<W>
impl<W: AsyncSliceWriter> OutboardMut for PreOrderOutboard<W>
Auto Trait Implementations§
impl<D> Freeze for PreOrderOutboard<D>where
D: Freeze,
impl<D> RefUnwindSafe for PreOrderOutboard<D>where
D: RefUnwindSafe,
impl<D> Send for PreOrderOutboard<D>where
D: Send,
impl<D> Sync for PreOrderOutboard<D>where
D: Sync,
impl<D> Unpin for PreOrderOutboard<D>where
D: Unpin,
impl<D> UnwindSafe for PreOrderOutboard<D>where
D: 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