pub struct Parts {
pub keys: Vec<String>,
pub values: Vec<Cid>,
pub subtrees: Vec<Option<Cid>>,
}Expand description
A node’s contents in the form the tree algorithms want them.
The encoding stores each key against the previous one, which is compact and useless to walk over. This is the same node with the keys rebuilt and the subtrees interleaved the way the protocol describes them:
keys: (0, 1, 2, 3)
values: (0, 1, 2, 3)
subtrees: (0, 1, 2, 3, 4)There is always exactly one more subtree than there are keys: the one
before the first key is the node’s l, and each entry’s t is the one
after it.
Fields§
§keys: Vec<String>The full keys, ascending.
values: Vec<Cid>The record each key names.
subtrees: Vec<Option<Cid>>The subtrees between and around the keys; always keys.len() + 1.
Trait Implementations§
impl Eq for Parts
impl StructuralPartialEq for Parts
Auto Trait Implementations§
impl Freeze for Parts
impl RefUnwindSafe for Parts
impl Send for Parts
impl Sync for Parts
impl Unpin for Parts
impl UnsafeUnpin for Parts
impl UnwindSafe for Parts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.