Struct trie_db::sectriedbmut::SecTrieDBMut
source · [−]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, H, C> SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
impl<'db, H, C> SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
sourcepub fn new(db: &'db mut dyn HashDB<H, DBValue>, root: &'db mut H::Out) -> Self
pub fn new(db: &'db mut dyn HashDB<H, DBValue>, root: &'db mut H::Out) -> 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, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
impl<'db, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
sourcefn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
Does the trie contain a given key?
sourcefn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
What is the value of the given key in this trie?
Auto Trait Implementations
impl<'db, H, C> !RefUnwindSafe for SecTrieDBMut<'db, H, C>
impl<'db, H, C> Send for SecTrieDBMut<'db, H, C> where
C: Send,
impl<'db, H, C> Sync for SecTrieDBMut<'db, H, C> where
C: Sync,
impl<'db, H, C> Unpin for SecTrieDBMut<'db, H, C> where
C: Unpin,
<H as Hasher>::Out: Unpin,
impl<'db, H, C> !UnwindSafe for SecTrieDBMut<'db, H, C>
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