Trait DynDatabase
pub trait DynDatabase: NonStaticAny {
// Required methods
fn get_account(
&mut self,
address: &Address,
) -> Result<Option<AccountInfo>, DatabaseError>;
fn get_code_by_hash(
&mut self,
code_hash: &FixedBytes<32>,
) -> Result<Bytecode, DatabaseError>;
fn get_storage(
&mut self,
address: &Address,
key: &Uint<256, 4>,
) -> Result<Uint<256, 4>, DatabaseError>;
fn get_block_hash(
&mut self,
number: &Uint<256, 4>,
) -> Result<FixedBytes<32>, DatabaseError>;
}Expand description
Backing database view used to initialize mutable [super::State].
Required Methods§
fn get_account(
&mut self,
address: &Address,
) -> Result<Option<AccountInfo>, DatabaseError>
fn get_account( &mut self, address: &Address, ) -> Result<Option<AccountInfo>, DatabaseError>
Loads account information.
fn get_code_by_hash(
&mut self,
code_hash: &FixedBytes<32>,
) -> Result<Bytecode, DatabaseError>
fn get_code_by_hash( &mut self, code_hash: &FixedBytes<32>, ) -> Result<Bytecode, DatabaseError>
Loads bytecode by code hash.
fn get_storage(
&mut self,
address: &Address,
key: &Uint<256, 4>,
) -> Result<Uint<256, 4>, DatabaseError>
fn get_storage( &mut self, address: &Address, key: &Uint<256, 4>, ) -> Result<Uint<256, 4>, DatabaseError>
Loads a persistent storage slot.
fn get_block_hash(
&mut self,
number: &Uint<256, 4>,
) -> Result<FixedBytes<32>, DatabaseError>
fn get_block_hash( &mut self, number: &Uint<256, 4>, ) -> Result<FixedBytes<32>, DatabaseError>
Loads a historical block hash.
Callers only request numbers inside the BLOCKHASH window, so a hash the database cannot
provide is a database failure reported through the error, never a benign miss.
Trait Implementations§
§impl<'a> Deref for dyn DynDatabase + 'a
impl<'a> Deref for dyn DynDatabase + 'a
§impl<'a> DerefMut for dyn DynDatabase + 'a
impl<'a> DerefMut for dyn DynDatabase + 'a
§fn deref_mut(&mut self) -> &mut <dyn DynDatabase + 'a as Deref>::Target
fn deref_mut(&mut self) -> &mut <dyn DynDatabase + 'a as Deref>::Target
Mutably dereferences the value.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".