[−][src]Struct trie_db::sectriedbmut::SecTrieDBMut
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.
Methods
impl<'db, H, C> SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
[src]
H: Hasher,
C: NodeCodec<H>,
pub fn new(db: &'db mut dyn HashDB<H, DBValue>, root: &'db mut H::Out) -> Self
[src]
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.
pub fn from_existing(
db: &'db mut dyn HashDB<H, DBValue>,
root: &'db mut H::Out
) -> Result<Self, H::Out, C::Error>
[src]
db: &'db mut dyn HashDB<H, DBValue>,
root: &'db mut H::Out
) -> Result<Self, H::Out, C::Error>
Create a new trie with the backing database db
and root
.
Returns an error if root does not exist.
pub fn db(&self) -> &dyn HashDB<H, DBValue>
[src]
Get the backing database.
pub fn db_mut(&mut self) -> &mut dyn HashDB<H, DBValue>
[src]
Get the backing database.
Trait Implementations
impl<'db, H, C> TrieMut<H, C> for SecTrieDBMut<'db, H, C> where
H: Hasher,
C: NodeCodec<H>,
[src]
H: Hasher,
C: NodeCodec<H>,
fn root(&mut self) -> &H::Out
[src]
fn is_empty(&self) -> bool
[src]
fn contains(&self, key: &[u8]) -> Result<bool, H::Out, C::Error>
[src]
fn get<'a, 'key>(
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
[src]
&'a self,
key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
'a: 'key,
fn insert(
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
[src]
&mut self,
key: &[u8],
value: &[u8]
) -> Result<Option<DBValue>, H::Out, C::Error>
fn remove(&mut self, key: &[u8]) -> Result<Option<DBValue>, H::Out, C::Error>
[src]
Auto Trait Implementations
impl<'db, H, C> Send for SecTrieDBMut<'db, H, C> where
C: Send,
<H as Hasher>::Out: Send,
C: Send,
<H as Hasher>::Out: Send,
impl<'db, H, C> Sync for SecTrieDBMut<'db, H, C> where
C: Sync,
<H as Hasher>::Out: Sync,
C: Sync,
<H as Hasher>::Out: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,