Trait AsHashTree

Source
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§

Source

fn root_hash(&self) -> Hash

Returns the root hash of the tree without constructing it. Must be equivalent to [HashTree::reconstruct].

Source

fn hash_tree(&self) -> HashTree

Returns a [HashTree] of this value. Must be equivalent to AsHashTree::root_hash.

Implementations on Foreign Types§

Source§

impl AsHashTree for ()

Source§

fn root_hash(&self) -> Hash

Source§

fn hash_tree(&self) -> HashTree

Implementors§