Struct trie_db::sectriedbmut::SecTrieDBMut
source · [−]pub struct SecTrieDBMut<'db, L> where
L: TrieLayout, { /* private fields */ }
Expand description
A mutable Trie
implementation which hashes keys and uses a generic HashDB
backing database.
Use it as a Trie
or TrieMut
trait object. You can use raw()
to get the backing TrieDBMut
object.
Implementations
sourceimpl<'db, L> SecTrieDBMut<'db, L> where
L: TrieLayout,
impl<'db, L> SecTrieDBMut<'db, L> where
L: TrieLayout,
sourcepub fn new(
db: &'db mut dyn HashDB<L::Hash, DBValue>,
root: &'db mut TrieHash<L>
) -> Self
pub fn new(
db: &'db mut dyn HashDB<L::Hash, DBValue>,
root: &'db mut TrieHash<L>
) -> Self
Create a new trie with the backing database db
and empty root
Initialise to the state entailed by the genesis block.
This guarantees the trie is built correctly.
Trait Implementations
sourceimpl<'db, L> TrieMut<L> for SecTrieDBMut<'db, L> where
L: TrieLayout,
impl<'db, L> TrieMut<L> for SecTrieDBMut<'db, L> where
L: TrieLayout,
sourcefn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
Does the trie contain a given key?
sourcefn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, TrieHash<L>, CError<L>> where
'a: 'key,
fn get<'a, 'key>(
&'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?
Auto Trait Implementations
impl<'db, L> !RefUnwindSafe for SecTrieDBMut<'db, L>
impl<'db, L> Send for SecTrieDBMut<'db, L>
impl<'db, L> Sync for SecTrieDBMut<'db, L>
impl<'db, L> Unpin for SecTrieDBMut<'db, L> where
<<L as TrieLayout>::Hash as Hasher>::Out: Unpin,
impl<'db, L> !UnwindSafe for SecTrieDBMut<'db, L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more