pub trait Trie<L>where
L: TrieLayout,{
// Required methods
fn root(&self) -> &<<L as TrieLayout>::Hash as Hasher>::Out;
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>;
fn iter<'a>(
&'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>>>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn contains(
&self,
key: &[u8],
) -> Result<bool, Box<TrieError<<<L as TrieLayout>::Hash as Hasher>::Out, <<L as TrieLayout>::Codec as NodeCodec>::Error>>> { ... }
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 { ... }
}Expand description
Various re-exports from the tetsy-trie-db crate.
A key-value datastore implemented as a database-backed modified Merkle tree.
Required Methods§
Sourcefn 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>>>
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>>>
Search for the key with the given query parameter. See the docs of the Query
trait for more details.
Sourcefn iter<'a>(
&'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>>>
fn iter<'a>( &'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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.