Trait mithril_common::crypto_helper::MKMapValue
source · pub trait MKMapValue<K: MKMapKey>: Clone + TryInto<MKTreeNode> {
// Required methods
fn compute_root(&self) -> StdResult<MKTreeNode>;
fn contains<T: Into<MKTreeNode> + Clone>(&self, leaf: &T) -> bool;
fn compute_proof<T: Into<MKTreeNode> + Clone>(
&self,
leaves: &[T]
) -> StdResult<Option<MKMapProof<K>>>;
}
Expand description
The trait implemented by the values of a MKMap
Required Methods§
sourcefn compute_root(&self) -> StdResult<MKTreeNode>
fn compute_root(&self) -> StdResult<MKTreeNode>
Get the root of the merkelized map value
sourcefn contains<T: Into<MKTreeNode> + Clone>(&self, leaf: &T) -> bool
fn contains<T: Into<MKTreeNode> + Clone>(&self, leaf: &T) -> bool
Check if the merkelized map value contains a leaf
sourcefn compute_proof<T: Into<MKTreeNode> + Clone>(
&self,
leaves: &[T]
) -> StdResult<Option<MKMapProof<K>>>
fn compute_proof<T: Into<MKTreeNode> + Clone>( &self, leaves: &[T] ) -> StdResult<Option<MKMapProof<K>>>
Compute the proof for a set of values of the merkelized map
Object Safety§
This trait is not object safe.