pub struct FatDB<'db, 'cache, L>where
L: TrieLayout,{ /* private fields */ }
Expand description
A Trie
implementation which hashes keys and uses a generic HashDB
backing database.
Additionaly it stores inserted hash-key mappings for later retrieval.
Use it as a Trie
or TrieMut
trait object.
Implementations§
source§impl<'db, 'cache, L> FatDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> FatDB<'db, 'cache, L>where L: TrieLayout,
Trait Implementations§
source§impl<'db, 'cache, L> Trie<L> for FatDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> Trie<L> for FatDB<'db, 'cache, L>where L: TrieLayout,
source§fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
Does the trie contain a given key?
source§fn get_hash(
&self,
key: &[u8]
) -> Result<Option<TrieHash<L>>, TrieHash<L>, CError<L>>
fn get_hash( &self, key: &[u8] ) -> Result<Option<TrieHash<L>>, TrieHash<L>, CError<L>>
Returns the hash of the value for
key
.source§fn get_with<Q: Query<L::Hash>>(
&self,
key: &[u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>>
fn get_with<Q: Query<L::Hash>>( &self, key: &[u8], query: Q ) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>>
Search for the key with the given query parameter. See the docs of the
Query
trait for more details.source§fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
fn iter<'a>( &'a self ) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
Returns a depth-first iterator over the elements of trie.