Struct trie_db::Lookup

source ·
pub struct Lookup<'a, 'cache, L: TrieLayout, Q: Query<L::Hash>> {
    pub db: &'a dyn HashDBRef<L::Hash, DBValue>,
    pub query: Q,
    pub hash: TrieHash<L>,
    pub cache: Option<&'cache mut dyn TrieCache<L::Codec>>,
    pub recorder: Option<&'cache mut dyn TrieRecorder<TrieHash<L>>>,
}
Expand description

Trie lookup helper object.

Fields§

§db: &'a dyn HashDBRef<L::Hash, DBValue>

database to query from.

§query: Q

Query object to record nodes and transform data.

§hash: TrieHash<L>

Hash to start at

§cache: Option<&'cache mut dyn TrieCache<L::Codec>>

Optional cache that should be used to speed up the lookup.

§recorder: Option<&'cache mut dyn TrieRecorder<TrieHash<L>>>

Optional recorder that will be called to record all trie accesses.

Implementations§

Look up the given nibble_key.

If the value is found, it will be passed to the given function to decode or copy.

The given full_key should be the full key to the data that is requested. This will be used when there is a cache to potentially speed up the lookup.

Look up the value hash for the given nibble_key.

The given full_key should be the full key to the data that is requested. This will be used when there is a cache to potentially speed up the lookup.

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.