pub struct FlatTree<'a, T> { /* private fields */ }Expand description
Representation of a flat tree of element type T where the 'a is the life-time parameter of the underlying FlatStore.
At the moment the tree is append only, i.e. it can add new leave elements but not update or deletion.
Implementations§
Source§impl<'a, T: Merkleable> FlatTree<'a, T>
impl<'a, T: Merkleable> FlatTree<'a, T>
Sourcepub fn get(&self, leaf_index: u64) -> Option<T>
pub fn get(&self, leaf_index: u64) -> Option<T>
Return the value at a given leaf index if it exists.
Sourcepub fn local_path(&self, i: u64) -> LocalPathIterator<'_, T> ⓘ
pub fn local_path(&self, i: u64) -> LocalPathIterator<'_, T> ⓘ
Return the merkle path iterating from the leaf at the given index to one of the local roots.
Sourcepub fn full_path(&self, i: u64) -> FullPathIterator<'_, T> ⓘ
pub fn full_path(&self, i: u64) -> FullPathIterator<'_, T> ⓘ
Return the merkle path iterating from the leaf at the given index to top root.
Sourcepub fn full_path_from_node_index(&self, i: u64) -> FullPathIterator<'_, T> ⓘwhere
T: Clone,
pub fn full_path_from_node_index(&self, i: u64) -> FullPathIterator<'_, T> ⓘwhere
T: Clone,
Return the full path iterating from the given node index (either leaf or branch node) to top root.
Note that for leaf nodes, node_index = leaf_index * 2.
Auto Trait Implementations§
impl<'a, T> Freeze for FlatTree<'a, T>
impl<'a, T> !RefUnwindSafe for FlatTree<'a, T>
impl<'a, T> !Send for FlatTree<'a, T>
impl<'a, T> !Sync for FlatTree<'a, T>
impl<'a, T> Unpin for FlatTree<'a, T>
impl<'a, T> !UnwindSafe for FlatTree<'a, T>
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