pub trait TrieMut<H: Hasher, C: NodeCodec<H>> {
fn root(&mut self) -> &H::Out;
fn is_empty(&self) -> bool;
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
where
'a: 'key;
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>;
fn remove(
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>;
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error> { ... }
}
Expand description
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
What is the value of the given key in this trie?
Insert a key
/value
pair into the trie. An empty value is equivalent to removing
key
from the trie. Returns the old value associated with this key, if it existed.