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