Struct AccountDB

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

DB backend wrapper for Account trie Transforms trie node keys for the database

Implementations§

Source§

impl<'db> AccountDB<'db>

Source

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

Create a new AccountDB from an address’ hash.

Trait Implementations§

Source§

impl<'db> AsHashDB<KeccakHasher, Vec<u8>> for AccountDB<'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 AccountDB<'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 AccountDB<'db>

§

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

§

impl<'db> Send for AccountDB<'db>

§

impl<'db> Sync for AccountDB<'db>

§

impl<'db> Unpin for AccountDB<'db>

§

impl<'db> !UnwindSafe for AccountDB<'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