Trait ethcore::state::backend::Backend[][src]

pub trait Backend: Send {
    fn as_hashdb(&self) -> &HashDB<KeccakHasher>;
fn as_hashdb_mut(&mut self) -> &mut HashDB<KeccakHasher>;
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

Treat the backend as a read-only hashdb.

Treat the backend as a writeable hashdb.

Add an account entry to the cache.

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.

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.

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.

Get cached code based on hash.

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

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

Implementors