pub trait MKTreeLeafIndexer {
// Required methods
fn set_leaf_position(
&self,
pos: MKTreeLeafPosition,
leaf: Arc<MKTreeNode>,
) -> StdResult<()>;
fn get_leaf_position(&self, leaf: &MKTreeNode) -> Option<MKTreeLeafPosition>;
fn total_leaves(&self) -> usize;
fn leaves(&self) -> Vec<MKTreeNode>;
// Provided method
fn contains_leaf(&self, leaf: &MKTreeNode) -> bool { ... }
}
Expand description
The Merkle tree leaves indexer trait
Required Methods§
sourcefn set_leaf_position(
&self,
pos: MKTreeLeafPosition,
leaf: Arc<MKTreeNode>,
) -> StdResult<()>
fn set_leaf_position( &self, pos: MKTreeLeafPosition, leaf: Arc<MKTreeNode>, ) -> StdResult<()>
Get the position of the leaf in the Merkle tree
sourcefn get_leaf_position(&self, leaf: &MKTreeNode) -> Option<MKTreeLeafPosition>
fn get_leaf_position(&self, leaf: &MKTreeNode) -> Option<MKTreeLeafPosition>
Get the position of the leaf in the Merkle tree
sourcefn total_leaves(&self) -> usize
fn total_leaves(&self) -> usize
Number of leaves in the Merkle tree
sourcefn leaves(&self) -> Vec<MKTreeNode>
fn leaves(&self) -> Vec<MKTreeNode>
List of leaves with their positions in the Merkle tree
Provided Methods§
sourcefn contains_leaf(&self, leaf: &MKTreeNode) -> bool
fn contains_leaf(&self, leaf: &MKTreeNode) -> bool
Check if the Merkle tree contains the given leaf