Struct incrementalmerkletree::testing::complete_tree::CompleteTree
source · pub struct CompleteTree<H, C: Ord, const DEPTH: u8> { /* private fields */ }
Available on crate feature
test-dependencies
only.Implementations§
Trait Implementations§
source§impl<H: Clone, C: Clone + Ord, const DEPTH: u8> Clone for CompleteTree<H, C, DEPTH>
impl<H: Clone, C: Clone + Ord, const DEPTH: u8> Clone for CompleteTree<H, C, DEPTH>
source§fn clone(&self) -> CompleteTree<H, C, DEPTH>
fn clone(&self) -> CompleteTree<H, C, DEPTH>
Returns a copy 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<H: Hashable + PartialEq + Clone, C: Ord + Clone + Debug, const DEPTH: u8> Tree<H, C> for CompleteTree<H, C, DEPTH>
impl<H: Hashable + PartialEq + Clone, C: Ord + Clone + Debug, const DEPTH: u8> Tree<H, C> for CompleteTree<H, C, DEPTH>
source§fn append(&mut self, value: H, retention: Retention<C>) -> bool
fn append(&mut self, value: H, retention: Retention<C>) -> bool
Appends a new value to the tree at the next available slot.
Returns true if successful and false if the tree would exceed
the maximum allowed depth.
source§fn current_position(&self) -> Option<Position>
fn current_position(&self) -> Option<Position>
Returns the most recently appended leaf value.
source§fn marked_positions(&self) -> BTreeSet<Position>
fn marked_positions(&self) -> BTreeSet<Position>
Return a set of all the positions for which we have marked.
source§fn get_marked_leaf(&self, position: Position) -> Option<H>
fn get_marked_leaf(&self, position: Position) -> Option<H>
Returns the leaf at the specified position if the tree can produce
a witness for it.
source§fn root(&self, checkpoint_depth: usize) -> Option<H>
fn root(&self, checkpoint_depth: usize) -> Option<H>
Obtains the root of the Merkle tree at the specified checkpoint depth
by hashing against empty nodes up to the maximum height of the tree.
Returns
None
if there are not enough checkpoints available to reach the
requested checkpoint depth.source§fn witness(&self, position: Position, checkpoint_depth: usize) -> Option<Vec<H>>
fn witness(&self, position: Position, checkpoint_depth: usize) -> Option<Vec<H>>
Obtains a witness for the value at the specified leaf position, as of the tree state at the
given checkpoint depth. Returns
None
if there is no witness information for the requested
position or if no checkpoint is available at the specified depth.source§fn remove_mark(&mut self, position: Position) -> bool
fn remove_mark(&mut self, position: Position) -> bool
Marks the value at the specified position as a value we’re no longer
interested in maintaining a mark for. Returns true if successful and
false if we were already not maintaining a mark at this position.
source§fn checkpoint(&mut self, id: C) -> bool
fn checkpoint(&mut self, id: C) -> bool
Creates a new checkpoint for the current tree state. Read more
Auto Trait Implementations§
impl<H, C, const DEPTH: u8> Freeze for CompleteTree<H, C, DEPTH>
impl<H, C, const DEPTH: u8> RefUnwindSafe for CompleteTree<H, C, DEPTH>where
C: RefUnwindSafe,
H: RefUnwindSafe,
impl<H, C, const DEPTH: u8> Send for CompleteTree<H, C, DEPTH>
impl<H, C, const DEPTH: u8> Sync for CompleteTree<H, C, DEPTH>
impl<H, C, const DEPTH: u8> Unpin for CompleteTree<H, C, DEPTH>where
H: Unpin,
impl<H, C, const DEPTH: u8> UnwindSafe for CompleteTree<H, C, DEPTH>where
C: RefUnwindSafe,
H: 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