revm_database_interface::async_db

Trait DatabaseAsyncRef

Source
pub trait DatabaseAsyncRef {
    type Error: Send + DBErrorMarker;

    // Required methods
    fn basic_async_ref(
        &self,
        address: Address,
    ) -> impl Future<Output = Result<Option<AccountInfo>, Self::Error>> + Send;
    fn code_by_hash_async_ref(
        &self,
        code_hash: B256,
    ) -> impl Future<Output = Result<Bytecode, Self::Error>> + Send;
    fn storage_async_ref(
        &self,
        address: Address,
        index: U256,
    ) -> impl Future<Output = Result<U256, Self::Error>> + Send;
    fn block_hash_async_ref(
        &self,
        number: u64,
    ) -> impl Future<Output = Result<B256, Self::Error>> + Send;
}
Expand description

The async EVM database interface.

Contains the same methods as DatabaseRef, but it returns Future type instead.

Use WrapDatabaseAsync to provide DatabaseRef implementation for a type that only implements this trait.

Required Associated Types§

Source

type Error: Send + DBErrorMarker

The database error type.

Required Methods§

Source

fn basic_async_ref( &self, address: Address, ) -> impl Future<Output = Result<Option<AccountInfo>, Self::Error>> + Send

Get basic account information.

Source

fn code_by_hash_async_ref( &self, code_hash: B256, ) -> impl Future<Output = Result<Bytecode, Self::Error>> + Send

Get account code by its hash.

Source

fn storage_async_ref( &self, address: Address, index: U256, ) -> impl Future<Output = Result<U256, Self::Error>> + Send

Get storage value of address at index.

Source

fn block_hash_async_ref( &self, number: u64, ) -> impl Future<Output = Result<B256, Self::Error>> + Send

Get block hash by block number.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§