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
§impl<'db, 'cache, L> TrieDB<'db, 'cache, L>where
L: TrieLayout,
impl<'db, 'cache, L> TrieDB<'db, 'cache, L>where
L: TrieLayout,
pub 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.
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>>>
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
.
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>>>
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
.
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>>>
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
.
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>>>
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
§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,
§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,
§fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
Return the root of the trie.
§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
.§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.§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 more§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.
§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.
§fn contains(
&self,
key: &[u8],
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
fn contains( &self, key: &[u8], ) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
Does the trie contain a given key?