[−][src]Trait reference_trie::TrieMut
A key-value datastore implemented as a database-backed modified Merkle tree.
Required methods
fn root(&mut self) -> &<H as Hasher>::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<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::Error>>> where
'a: 'key,
&'a self,
key: &'key [u8]
) -> Result<Option<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::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<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::Error>>>
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::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<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::Error>>>
&mut self,
key: &[u8]
) -> Result<Option<ElasticArray128<u8>>, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::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
fn contains(
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::Error>>>
&self,
key: &[u8]
) -> Result<bool, Box<TrieError<<H as Hasher>::Out, <C as NodeCodec<H>>::Error>>>
Does the trie contain a given key?
Implementations on Foreign Types
impl<'db, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
C: NodeCodec<H>,
H: Hasher,
[src]
impl<'db, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
C: NodeCodec<H>,
H: Hasher,
fn root(&mut self) -> &<H as Hasher>::Out | [src] |
fn is_empty(&self) -> bool | [src] |
fn contains( | [src] |
fn get<'a, 'key>( | [src] |
fn insert( | [src] |
fn remove( | [src] |
impl<'db, H, C> TrieMut<H, C> for FatDBMut<'db, H, C> where
C: NodeCodec<H>,
H: Hasher,
[src]
impl<'db, H, C> TrieMut<H, C> for FatDBMut<'db, H, C> where
C: NodeCodec<H>,
H: Hasher,
fn root(&mut self) -> &<H as Hasher>::Out | [src] |
fn is_empty(&self) -> bool | [src] |
fn contains( | [src] |
fn get<'a, 'key>( | [src] |
fn insert( | [src] |
fn remove( | [src] |
impl<'a, H, C> TrieMut<H, C> for TrieDBMut<'a, H, C> where
C: NodeCodec<H>,
H: Hasher,
[src]
impl<'a, H, C> TrieMut<H, C> for TrieDBMut<'a, H, C> where
C: NodeCodec<H>,
H: Hasher,
fn root(&mut self) -> &<H as Hasher>::Out | [src] |
fn is_empty(&self) -> bool | [src] |
fn get<'x, 'key>( | [src] |
fn insert( | [src] |
fn remove( | [src] |
fn contains( | [src] |