pub type TrieDB<'a, 'cache, L> = TrieDB<'a, 'cache, L>;
Expand description
Persistent trie database read-access interface for a given hasher.
Aliased Type§
struct TrieDB<'a, 'cache, L> { /* private fields */ }
Implementations
source§impl<'db, 'cache, L> TrieDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> TrieDB<'db, 'cache, L>where
L: TrieLayout,
sourcepub fn db(&'db self) -> &'db dyn HashDBRef<<L as TrieLayout>::Hash, Vec<u8>>
pub fn db(&'db self) -> &'db dyn HashDBRef<<L as TrieLayout>::Hash, Vec<u8>>
Get the backing database.
sourcepub fn into_double_ended_iter(
&'db self,
) -> Result<TrieDBDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
pub fn into_double_ended_iter( &'db self, ) -> Result<TrieDBDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Create TrieDBDoubleEndedIterator
from TrieDB
.
sourcepub fn into_node_double_ended_iter(
&'db self,
) -> Result<TrieDBNodeDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
pub fn into_node_double_ended_iter( &'db self, ) -> Result<TrieDBNodeDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Create TrieDBNodeDoubleEndedIterator
from TrieDB
.
sourcepub fn into_key_double_ended_iter(
&'db self,
) -> Result<TrieDBKeyDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
pub fn into_key_double_ended_iter( &'db self, ) -> Result<TrieDBKeyDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
create TrieDBKeyDoubleEndedIterator
from TrieDB
.
sourcepub fn into_fat_double_ended_iter(
&'db self,
) -> Result<FatDBDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
pub fn into_fat_double_ended_iter( &'db self, ) -> Result<FatDBDoubleEndedIterator<'db, 'cache, L>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
create FatDBDoubleEndedIterator
from TrieDB
.
Trait Implementations
source§impl<'db, 'cache, L> Debug for TrieDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> Debug for TrieDB<'db, 'cache, L>where
L: TrieLayout,
source§impl<'db, 'cache, L> Trie<L> for TrieDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> Trie<L> for TrieDB<'db, 'cache, L>where
L: TrieLayout,
source§fn get_hash(
&self,
key: &[u8],
) -> Result<Option<<<L as TrieLayout>::Hash as Hasher>::Out>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn get_hash( &self, key: &[u8], ) -> Result<Option<<<L as TrieLayout>::Hash as Hasher>::Out>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Returns the hash of the value for
key
.source§fn get_with<Q>(
&self,
key: &[u8],
query: Q,
) -> Result<Option<<Q as Query<<L as TrieLayout>::Hash>>::Item>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn get_with<Q>( &self, key: &[u8], query: Q, ) -> Result<Option<<Q as Query<<L as TrieLayout>::Hash>>::Item>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Search for the key with the given query parameter. See the docs of the
Query
trait for more details.source§fn lookup_first_descendant(
&self,
key: &[u8],
) -> Result<Option<MerkleValue<<<L as TrieLayout>::Hash as Hasher>::Out>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn lookup_first_descendant( &self, key: &[u8], ) -> Result<Option<MerkleValue<<<L as TrieLayout>::Hash as Hasher>::Out>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Look up the
MerkleValue
of the node that is the closest descendant for the provided
key. Read moresource§fn iter<'a>(
&'a self,
) -> Result<Box<dyn TrieIterator<L, Item = Result<(Vec<u8>, Vec<u8>), Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>> + 'a>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn iter<'a>( &'a self, ) -> Result<Box<dyn TrieIterator<L, Item = Result<(Vec<u8>, Vec<u8>), Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>> + 'a>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Returns a depth-first iterator over the elements of trie.
source§fn key_iter<'a>(
&'a self,
) -> Result<Box<dyn TrieIterator<L, Item = Result<Vec<u8>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>> + 'a>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn key_iter<'a>( &'a self, ) -> Result<Box<dyn TrieIterator<L, Item = Result<Vec<u8>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>> + 'a>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Returns a depth-first iterator over the keys of elemets of trie.