pub trait Trie<L: TrieLayout> {
// Required methods
fn root(&self) -> &TrieHash<L>;
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;
fn iter<'a>(
&'a self,
) -> Result<Box<dyn TrieIterator<L, Item = TrieItem<'_, TrieHash<L>, CError<L>>> + 'a>, TrieHash<L>, CError<L>>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>> { ... }
fn get<'a, 'key>(
&'a self,
key: &'key [u8],
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
where 'a: 'key { ... }
}Expand description
A key-value datastore implemented as a database-backed modified Merkle tree.
Required Methods§
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.