[][src]Trait sp_trie::Trie

pub trait Trie<L> where
    L: TrieLayout
{ pub fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out;
pub fn get_with<'a, 'key, Q>(
        &'a self,
        key: &'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>, Global>>
    where
        'a: 'key,
        Q: Query<<L as TrieLayout>::Hash>
;
pub fn iter(
        &'a self
    ) -> Result<Box<dyn TrieIterator<L, Item = Result<(Vec<u8, Global>, Vec<u8, Global>), Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>> + 'a, Global>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>; pub fn is_empty(&self) -> bool { ... }
pub fn contains(
        &self,
        key: &[u8]
    ) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>> { ... }
pub fn get<'a, 'key>(
        &'a self,
        key: &'key [u8]
    ) -> Result<Option<Vec<u8, Global>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>
    where
        'a: 'key
, { ... } }

Various re-exports from the trie-db crate. A key-value datastore implemented as a database-backed modified Merkle tree.

Required methods

pub fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out[src]

Return the root of the trie.

pub fn get_with<'a, 'key, Q>(
    &'a self,
    key: &'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>, Global>> where
    'a: 'key,
    Q: Query<<L as TrieLayout>::Hash>, 
[src]

Search for the key with the given query parameter. See the docs of the Query trait for more details.

pub fn iter(
    &'a self
) -> Result<Box<dyn TrieIterator<L, Item = Result<(Vec<u8, Global>, Vec<u8, Global>), Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>> + 'a, Global>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>
[src]

Returns a depth-first iterator over the elements of trie.

Loading content...

Provided methods

pub fn is_empty(&self) -> bool[src]

Is the trie empty?

pub fn contains(
    &self,
    key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>>
[src]

Does the trie contain a given key?

pub fn get<'a, 'key>(
    &'a self,
    key: &'key [u8]
) -> Result<Option<Vec<u8, Global>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>, Global>> where
    'a: 'key, 
[src]

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

Loading content...

Implementations on Foreign Types

impl<'db, L> Trie<L> for TrieDB<'db, L> where
    L: TrieLayout
[src]

impl<'db, L> Trie<L> for SecTrieDB<'db, L> where
    L: TrieLayout
[src]

impl<'db, L> Trie<L> for FatDB<'db, L> where
    L: TrieLayout
[src]

impl<'db, L> Trie<L> for TrieKinds<'db, L> where
    L: TrieLayout
[src]

Loading content...

Implementors

Loading content...