pub trait AsHashTree {
// Required methods
fn root_hash(&self) -> Hash;
fn hash_tree(&self) -> HashTree;
}
Expand description
Trait that is used to hash a leaf value of a [HashTree].
This trait should always be implemented on user-side.
See also SCertifiedBTreeMap
Required Methods§
Sourcefn root_hash(&self) -> Hash
fn root_hash(&self) -> Hash
Returns the root hash of the tree without constructing it. Must be equivalent to [HashTree::reconstruct].
Sourcefn hash_tree(&self) -> HashTree
fn hash_tree(&self) -> HashTree
Returns a [HashTree] of this value. Must be equivalent to AsHashTree::root_hash.