pub struct TreeBuildOutput {
pub root_hash: [u8; 32],
pub root_bytes: Vec<u8>,
pub root_depth: u8,
pub total_bytes: u64,
pub chunk_count: u64,
pub trailing_nodes: Vec<ClosedNode>,
}Expand description
Output of TreeBuilder::finalize. The root node lives in
root_hash + root_bytes + root_depth; every other node
closed during finalize is in trailing_nodes and must be
persisted before the BlobRef::Tree
is published.
Nodes closed during streaming (via TreeBuilder::push_chunk)
are returned by that call directly; trailing_nodes carries
only the cascade-on-finalize closures.
Fields§
§root_hash: [u8; 32]BLAKE3 of the root TreeNode.
root_bytes: Vec<u8>Postcard-encoded root TreeNode bytes. Empty Vec
signals “already in chunk store; skip persist” — used
by the finalize-time streamed-child peel when the root
was promoted from a streamed ClosedNode that the
streaming-store caller has already persisted. Callers
MUST check root_bytes.is_empty() before invoking
store_chunk(&root_hash, &root_bytes) and skip the
store when empty (the bytes are already content-addressed
at root_hash from streaming).
root_depth: u8Total tree depth — 1 for a single-leaf tree (root IS
the leaf), increasing by one per additional internal
level. Capped at MAX_TREE_DEPTH.
total_bytes: u64Sum of every leaf chunk’s size across the whole tree.
chunk_count: u64Number of chunks accumulated across all leaves.
trailing_nodes: Vec<ClosedNode>Non-root nodes closed during finalize, in deepest-first
order. The caller persists each before publishing the
final BlobRef::Tree.
Trait Implementations§
Source§impl Clone for TreeBuildOutput
impl Clone for TreeBuildOutput
Source§fn clone(&self) -> TreeBuildOutput
fn clone(&self) -> TreeBuildOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TreeBuildOutput
impl Debug for TreeBuildOutput
Source§impl PartialEq for TreeBuildOutput
impl PartialEq for TreeBuildOutput
Source§fn eq(&self, other: &TreeBuildOutput) -> bool
fn eq(&self, other: &TreeBuildOutput) -> bool
self and other values to be equal, and is used by ==.impl Eq for TreeBuildOutput
impl StructuralPartialEq for TreeBuildOutput
Auto Trait Implementations§
impl Freeze for TreeBuildOutput
impl RefUnwindSafe for TreeBuildOutput
impl Send for TreeBuildOutput
impl Sync for TreeBuildOutput
impl Unpin for TreeBuildOutput
impl UnsafeUnpin for TreeBuildOutput
impl UnwindSafe for TreeBuildOutput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.