Trait trie_db::TrieMut [−][src]
pub trait TrieMut<L: TrieLayout> { 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<DBValue>, TrieHash<L>, CError<L>>; fn remove(
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>; fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>> { ... } }
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
fn root(&mut self) -> &TrieHash<L>[src]
Return the root of the trie.
fn is_empty(&self) -> bool[src]
Is the trie empty?
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key, [src]
&'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?
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
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>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
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
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>[src]
Does the trie contain a given key?
Implementors
impl<'a, L> TrieMut<L> for TrieDBMut<'a, L> where
L: TrieLayout, [src]
impl<'a, L> TrieMut<L> for TrieDBMut<'a, L> where
L: TrieLayout, [src]fn root(&mut self) -> &TrieHash<L>[src]
fn is_empty(&self) -> bool[src]
fn get<'x, 'key>(
&'x self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'x: 'key, [src]
&'x self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'x: 'key,
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
fn remove(
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
impl<'db, L> TrieMut<L> for SecTrieDBMut<'db, L> where
L: TrieLayout, [src]
impl<'db, L> TrieMut<L> for SecTrieDBMut<'db, L> where
L: TrieLayout, [src]fn root(&mut self) -> &TrieHash<L>[src]
fn is_empty(&self) -> bool[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key, [src]
&'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<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
fn remove(
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
impl<'db, L> TrieMut<L> for FatDBMut<'db, L> where
L: TrieLayout, [src]
impl<'db, L> TrieMut<L> for FatDBMut<'db, L> where
L: TrieLayout, [src]fn root(&mut self) -> &TrieHash<L>[src]
fn is_empty(&self) -> bool[src]
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key, [src]
&'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<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>
fn remove(
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>[src]
&mut self,
key: &[u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>>