pub struct Basic<H>(pub H);
Expand description
A basic backend. Just wraps the given database, directly inserting into and deleting from it. Doesn’t cache anything.
Tuple Fields
0: H
Trait Implementations
sourceimpl<H: AsHashDB<KeccakHasher, DBValue> + Send + Sync> Backend for Basic<H>
impl<H: AsHashDB<KeccakHasher, DBValue> + Send + Sync> Backend for Basic<H>
sourcefn as_hash_db(&self) -> &dyn HashDB<KeccakHasher, DBValue>
fn as_hash_db(&self) -> &dyn HashDB<KeccakHasher, DBValue>
Treat the backend as a read-only hashdb.
sourcefn as_hash_db_mut(&mut self) -> &mut dyn HashDB<KeccakHasher, DBValue>
fn as_hash_db_mut(&mut self) -> &mut dyn HashDB<KeccakHasher, DBValue>
Treat the backend as a writeable hashdb.
sourcefn add_to_account_cache(&mut self, _: Address, _: Option<Account>, _: bool)
fn add_to_account_cache(&mut self, _: Address, _: Option<Account>, _: bool)
t_nb 9.4 Add an account entry to the cache.
sourcefn cache_code(&self, _: H256, _: Arc<Vec<u8>>)
fn cache_code(&self, _: H256, _: Arc<Vec<u8>>)
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. Read more
sourcefn get_cached_account(&self, _: &Address) -> Option<Option<Account>>
fn get_cached_account(&self, _: &Address) -> Option<Option<Account>>
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. Read more
Auto Trait Implementations
impl<H> RefUnwindSafe for Basic<H> where
H: RefUnwindSafe,
impl<H> Send for Basic<H> where
H: Send,
impl<H> Sync for Basic<H> where
H: Sync,
impl<H> Unpin for Basic<H> where
H: Unpin,
impl<H> UnwindSafe for Basic<H> where
H: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more