pub enum TrieKinds<'db, 'cache, L: TrieLayout> {
Generic(TrieDB<'db, 'cache, L>),
Secure(SecTrieDB<'db, 'cache, L>),
Fat(FatDB<'db, 'cache, L>),
}
Expand description
All different kinds of tries. This is used to prevent a heap allocation for every created trie.
Variants§
Generic(TrieDB<'db, 'cache, L>)
A generic trie db.
Secure(SecTrieDB<'db, 'cache, L>)
A secure trie db.
Fat(FatDB<'db, 'cache, L>)
A fat trie db.
Trait Implementations§
source§impl<'db, 'cache, L: TrieLayout> Trie<L> for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L: TrieLayout> Trie<L> for TrieKinds<'db, 'cache, L>
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 lookup_first_descendant(
&self,
key: &[u8],
) -> Result<Option<MerkleValue<TrieHash<L>>>, TrieHash<L>, CError<L>>
fn lookup_first_descendant( &self, key: &[u8], ) -> Result<Option<MerkleValue<TrieHash<L>>>, TrieHash<L>, CError<L>>
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 = 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.
Auto Trait Implementations§
impl<'db, 'cache, L> !Freeze for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L> !RefUnwindSafe for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L> !Send for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L> !Sync for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L> Unpin for TrieKinds<'db, 'cache, L>
impl<'db, 'cache, L> !UnwindSafe for TrieKinds<'db, 'cache, L>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more