pub enum TrieAccess<'a, H> {
    NodeOwned {
        hash: H,
        node_owned: &'a NodeOwned<H>,
    },
    EncodedNode {
        hash: H,
        encoded_node: Cow<'a, [u8]>,
    },
    Value {
        hash: H,
        value: Cow<'a, [u8]>,
        full_key: &'a [u8],
    },
    Hash {
        full_key: &'a [u8],
    },
    NonExisting {
        full_key: &'a [u8],
    },
}
Expand description

Used to report the trie access to the TrieRecorder.

As the trie can use a TrieCache, there are multiple kinds of accesses. If a cache is used, [Self::Key] and Self::NodeOwned are possible values. Otherwise only Self::EncodedNode is a possible value.

Variants

NodeOwned

Fields

hash: H
node_owned: &'a NodeOwned<H>

The given NodeOwned was accessed using its hash.

EncodedNode

Fields

hash: H
encoded_node: Cow<'a, [u8]>

The given encoded_node was accessed using its hash.

Value

Fields

hash: H
value: Cow<'a, [u8]>
full_key: &'a [u8]

The given value was accessed using its hash.

The given full_key is the key to access this value in the trie.

Should map to RecordedForKey::Value when checking the recorder.

Hash

Fields

full_key: &'a [u8]

The hash of the value for the given full_key was accessed.

Should map to RecordedForKey::Hash when checking the recorder.

NonExisting

Fields

full_key: &'a [u8]

The value/hash for full_key was accessed, but it couldn’t be found in the trie.

Should map to RecordedForKey::Value when checking the recorder.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.