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