Trait account_state::backend::Backend[][src]

pub trait Backend: Send {
    fn as_hash_db(&self) -> &dyn HashDB<KeccakHasher, DBValue>;
fn as_hash_db_mut(&mut self) -> &mut dyn HashDB<KeccakHasher, DBValue>;
fn add_to_account_cache(
        &mut self,
        addr: Address,
        data: Option<Account>,
        modified: bool
    );
fn cache_code(&self, hash: H256, code: Arc<Vec<u8>>);
fn get_cached_account(&self, addr: &Address) -> Option<Option<Account>>;
fn get_cached<F, U>(&self, a: &Address, f: F) -> Option<U>
    where
        F: FnOnce(Option<&mut Account>) -> U
;
fn get_cached_code(&self, hash: &H256) -> Option<Arc<Vec<u8>>>;
fn note_non_null_account(&self, address: &Address);
fn is_known_null(&self, address: &Address) -> bool; }

State backend. See module docs for more details.

Required methods

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

Treat the backend as a read-only hashdb.

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

Treat the backend as a writeable hashdb.

fn add_to_account_cache(
    &mut self,
    addr: Address,
    data: Option<Account>,
    modified: bool
)
[src]

Add an account entry to the cache.

fn cache_code(&self, hash: H256, code: Arc<Vec<u8>>)[src]

Add a global code cache entry. This doesn’t need to worry about canonicality because it simply maps hashes to raw code and will always be correct in the absence of hash collisions.

fn get_cached_account(&self, addr: &Address) -> Option<Option<Account>>[src]

Get basic copy of the cached account. Not required to include storage. Returns ‘None’ if cache is disabled or if the account is not cached.

fn get_cached<F, U>(&self, a: &Address, f: F) -> Option<U> where
    F: FnOnce(Option<&mut Account>) -> U, 
[src]

Get value from a cached account. None is passed to the closure if the account entry cached is known not to exist. None is returned if the entry is not cached.

fn get_cached_code(&self, hash: &H256) -> Option<Arc<Vec<u8>>>[src]

Get cached code based on hash.

fn note_non_null_account(&self, address: &Address)[src]

Note that an account with the given address is non-null.

fn is_known_null(&self, address: &Address) -> bool[src]

Check whether an account is known to be empty. Returns true if known to be empty, false otherwise.

Loading content...

Implementors

impl Backend for ProofCheck[src]

impl<H: AsHashDB<KeccakHasher, DBValue> + Send + Sync> Backend for Basic<H>[src]

impl<H: AsHashDB<KeccakHasher, DBValue> + Send + Sync> Backend for Proving<H>[src]

Loading content...