Enum trie_db::TrieAccess
source · 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],
},
InlineValue {
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
The given NodeOwned
was accessed using its hash
.
EncodedNode
The given encoded_node
was accessed using its hash
.
Value
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.
InlineValue
A value was accessed that is stored inline a node.
As the value is stored inline there is no need to separately record the value as it is part
of a node. The given full_key
is the key to access this value in the trie.
Should map to RecordedForKey::Value
when checking the recorder.
Hash
The hash of the value for the given full_key
was accessed.
Should map to RecordedForKey::Hash
when checking the recorder.
NonExisting
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.