[−][src]Trait sp_trie::Trie
Various re-exports from the trie-db
crate.
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
Return the root of the trie.
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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
&'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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
Search for the key with the given query parameter. See the docs of the Query
trait for more details.
fn iter(
&'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>>>
&'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.
Provided methods
fn is_empty(&self) -> bool
Is the trie empty?
fn contains(
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
&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?
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<Vec<u8>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>> where
'a: 'key,
&'a self,
key: &'key [u8]
) -> Result<Option<Vec<u8>>, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>> where
'a: 'key,
What is the value of the given key in this trie?
Implementations on Foreign Types
impl<'db, L> Trie<L> for TrieDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
[src]
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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
[src]
&'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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
fn iter(
&'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>>>
[src]
&'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>>>
impl<'db, L> Trie<L> for SecTrieDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
[src]
fn contains(
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
[src]
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
[src]
&'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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
fn iter(
&'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>>>
[src]
&'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>>>
impl<'db, L> Trie<L> for TrieKinds<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
[src]
fn is_empty(&self) -> bool
[src]
fn contains(
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
[src]
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
[src]
&'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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
fn iter(
&'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>>>
[src]
&'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>>>
impl<'db, L> Trie<L> for FatDB<'db, L> where
L: TrieLayout,
[src]
L: TrieLayout,
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out
[src]
fn contains(
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
[src]
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>>
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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
[src]
&'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>>> where
'a: 'key,
Q: Query<<L as TrieLayout>::Hash>,
fn iter(
&'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>>>
[src]
&'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>>>