[−][src]Trait trie_db::TrieMut
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
fn root(&mut self) -> &H::Out
Return the root of the trie.
fn is_empty(&self) -> bool
Is the trie empty?
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
What is the value of the given key in this trie?
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
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.
fn remove(&mut self, key: &[u8]) -> Result<Option<DBValue>, H::Out, C::Error>
Remove a key
from the trie. Equivalent to making it equal to the empty
value. Returns the old value associated with this key, if it existed.
Provided methods
Loading content...Implementors
impl<'a, H, C> TrieMut<H, C> for TrieDBMut<'a, H, C> where
H: Hasher,
C: NodeCodec<H>,
[src]
H: Hasher,
C: NodeCodec<H>,
fn root(&mut self) -> &H::Out
[src]
fn is_empty(&self) -> bool
[src]
fn get<'x, 'key>(
&'x self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'x: 'key,
[src]
&'x self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'x: 'key,
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
[src]
&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>
[src]
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
[src]
impl<'db, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
[src]
H: Hasher,
C: NodeCodec<H>,
fn root(&mut self) -> &H::Out
[src]
fn is_empty(&self) -> bool
[src]
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
[src]
&'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>
[src]
&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>
[src]
impl<'db, H, C> TrieMut<H, C> for FatDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
[src]
H: Hasher,
C: NodeCodec<H>,
fn root(&mut self) -> &H::Out
[src]
fn is_empty(&self) -> bool
[src]
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
[src]
&'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>
[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>