Trait trie_db::Trie [−][src]
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
fn root(&self) -> &TrieHash<L>
[src]
Return the root of the trie.
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
Search for the key with the given query parameter. See the docs of the Query
trait for more details.
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
[src]
&'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.
Provided methods
fn is_empty(&self) -> bool
[src]
Is the trie empty?
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
[src]
Does the trie contain a given key?
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key,
What is the value of the given key in this trie?
Implementors
impl<'db, L> Trie<L> for SecTrieDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &TrieHash<L>
[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
[src]
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
[src]
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
impl<'db, L> Trie<L> for FatDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &TrieHash<L>
[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
[src]
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
[src]
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
impl<'db, L> Trie<L> for TrieDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &TrieHash<L>
[src]
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
[src]
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
impl<'db, L: TrieLayout> Trie<L> for TrieKinds<'db, L>
[src]
fn root(&self) -> &TrieHash<L>
[src]
fn is_empty(&self) -> bool
[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
[src]
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn iter<'a>(
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>
[src]
&'a self
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>