Struct trie_db::FatDB [−][src]
pub struct FatDB<'db, L> where
L: TrieLayout, { /* fields omitted */ }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
impl<'db, L> FatDB<'db, L> where
L: TrieLayout, [src]
impl<'db, L> FatDB<'db, L> where
L: TrieLayout, [src]pub fn new(
db: &'db dyn HashDBRef<L::Hash, DBValue>,
root: &'db TrieHash<L>
) -> Result<Self, TrieHash<L>, CError<L>>[src]
db: &'db dyn HashDBRef<L::Hash, DBValue>,
root: &'db TrieHash<L>
) -> Result<Self, TrieHash<L>, CError<L>>
Create a new trie with the backing database db and empty root
Initialise to the state entailed by the genesis block.
This guarantees the trie is built correctly.
pub fn db(&self) -> &dyn HashDBRef<L::Hash, DBValue>[src]
Get the backing database.
Trait Implementations
impl<'db, L> Trie<L> for FatDB<'db, L> where
L: TrieLayout, [src]
impl<'db, L> Trie<L> for FatDB<'db, L> where
L: TrieLayout, [src]fn root(&self) -> &TrieHash<L>[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>[src]
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key, [src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>[src]
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
fn is_empty(&self) -> bool[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key, [src]
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key,