Struct AccountDBMut

Source
pub struct AccountDBMut<'db> { /* private fields */ }
Expand description

DB backend wrapper for Account trie

Implementations§

Source§

impl<'db> AccountDBMut<'db>

Source

pub fn from_hash( db: &'db mut dyn HashDB<KeccakHasher, DBValue>, address_hash: H256, ) -> Self

Create a new AccountDBMut from an address’ hash.

Source

pub fn immutable(&'db self) -> AccountDB<'db>

Create an AccountDB from an AccountDBMut (used in tests).

Trait Implementations§

Source§

impl<'db> AsHashDB<KeccakHasher, Vec<u8>> for AccountDBMut<'db>

Source§

fn as_hash_db(&self) -> &dyn HashDB<KeccakHasher, DBValue>

Perform upcast to HashDB for anything that derives from HashDB.
Source§

fn as_hash_db_mut(&mut self) -> &mut dyn HashDB<KeccakHasher, DBValue>

Perform mutable upcast to HashDB for anything that derives from HashDB.
Source§

impl<'db> HashDB<KeccakHasher, Vec<u8>> for AccountDBMut<'db>

Source§

fn get(&self, key: &H256, prefix: Prefix<'_>) -> Option<DBValue>

Look up a given hash into the bytes that hash to it, returning None if the hash is not known.
Source§

fn contains(&self, key: &H256, prefix: Prefix<'_>) -> bool

Check for the existence of a hash-key.
Source§

fn insert(&mut self, prefix: Prefix<'_>, value: &[u8]) -> H256

Insert a datum item into the DB and return the datum’s hash for a later lookup. Insertions are counted and the equivalent number of remove()s must be performed before the data is considered dead.
Source§

fn emplace(&mut self, key: H256, prefix: Prefix<'_>, value: DBValue)

Like insert(), except you provide the key and the data is all moved.
Source§

fn remove(&mut self, key: &H256, prefix: Prefix<'_>)

Remove a datum previously inserted. Insertions can be “owed” such that the same number of insert()s may happen without the data being eventually being inserted into the DB. It can be “owed” more than once.

Auto Trait Implementations§

§

impl<'db> Freeze for AccountDBMut<'db>

§

impl<'db> !RefUnwindSafe for AccountDBMut<'db>

§

impl<'db> Send for AccountDBMut<'db>

§

impl<'db> Sync for AccountDBMut<'db>

§

impl<'db> Unpin for AccountDBMut<'db>

§

impl<'db> !UnwindSafe for AccountDBMut<'db>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V