Enum trie_db::TrieKinds

source ·
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>

source§

fn root(&self) -> &TrieHash<L>

Return the root of the trie.
source§

fn is_empty(&self) -> bool

Is the trie empty?
source§

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>>

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>>

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>>

Look up the MerkleValue of the node that is the closest descendant for the provided key. Read more
source§

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.
source§

fn key_iter<'a>( &'a self ) -> Result<Box<dyn TrieIterator<L, Item = TrieKeyItem<TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>

Returns a depth-first iterator over the keys of elemets of trie.
source§

fn get(&self, key: &[u8]) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>

What is the value of the given key in this trie?

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.