pub trait ProcessEncodedNode<HO> {
    fn process(
        &mut self,
        prefix: Prefix<'_>,
        encoded_node: Vec<u8>,
        is_root: bool
    ) -> ChildReference<HO>; fn process_inner_hashed_value(
        &mut self,
        prefix: Prefix<'_>,
        value: &[u8]
    ) -> HO; }
Expand description

Visitor trait to implement when using trie_visit.

Required Methods§

source

fn process(
    &mut self,
    prefix: Prefix<'_>,
    encoded_node: Vec<u8>,
    is_root: bool
) -> ChildReference<HO>

Function call with prefix, encoded value and a boolean indicating if the node is the root for each node of the trie.

Note that the returned value can change depending on implementation, but usually it should be the Hash of encoded node. This is not something direcly related to encoding but is here for optimisation purpose (builder hash_db does return this value).

source

fn process_inner_hashed_value(&mut self, prefix: Prefix<'_>, value: &[u8]) -> HO

Callback for hashed value in encoded node.

Implementors§

source§

impl<'a, T, DB> ProcessEncodedNode<<<T as TrieLayout>::Hash as Hasher>::Out> for TrieBuilder<'a, T, DB>where
    T: TrieLayout,
    DB: HashDB<T::Hash, DBValue>,

source§

impl<T: TrieLayout> ProcessEncodedNode<<<T as TrieLayout>::Hash as Hasher>::Out> for TrieRoot<T>

source§

impl<T: TrieLayout> ProcessEncodedNode<<<T as TrieLayout>::Hash as Hasher>::Out> for TrieRootPrint<T>

source§

impl<T: TrieLayout> ProcessEncodedNode<<<T as TrieLayout>::Hash as Hasher>::Out> for TrieRootUnhashed<T>