pub enum BaoChunk {
Parent {
is_root: bool,
right: bool,
left: bool,
node: TreeNode,
},
Leaf {
size: usize,
is_root: bool,
start_chunk: ChunkNum,
},
}
Expand description
A chunk describeds what to read or write next
Fields
This is the root, to be passed to parent_cv
Push the right hash to the stack, since it will be needed later
Push the left hash to the stack, since it will be needed later
The tree node, useful for error reporting
expect a 64 byte parent node.
To validate, use parent_cv using the is_root value
Fields
Size of the data to expect. Will be chunk_group_bytes for all but the last block.
This is the root, to be passed to hash_block
Start chunk, to be passed to hash_block
expect data of size size
To validate, use hash_block using the is_root and start_chunk values
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Returns the “default value” for a type.
Read more
This method tests for self and other values to be equal, and is used
by ==.
This method tests for !=. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.