pub trait TrieMut<L: TrieLayout> {
// Required methods
fn root(&mut self) -> &TrieHash<L>;
fn is_empty(&self) -> bool;
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
where 'a: 'key;
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<Value<L>>, TrieHash<L>, CError<L>>;
fn remove(
&mut self,
key: &[u8]
) -> Result<Option<Value<L>>, TrieHash<L>, CError<L>>;
// Provided method
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>> { ... }
}
Expand description
A key-value datastore implemented as a database-backed modified Merkle tree.
Required Methods§
sourcefn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>where
'a: 'key,
fn get<'a, 'key>(
&'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?