revm_primitives::db::components::state

Trait State

Source
pub trait State {
    type Error;

    // Required methods
    fn basic(
        &mut self,
        address: Address,
    ) -> Result<Option<AccountInfo>, Self::Error>;
    fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>;
    fn storage(
        &mut self,
        address: Address,
        index: U256,
    ) -> Result<U256, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Get basic account information.

Source

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Get account code by its hash

Source

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Get storage value of address at index.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + State + ?Sized> State for &'a mut T

Source§

type Error = <T as State>::Error

Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Source§

impl<T> State for &T
where T: StateRef,

Source§

type Error = <T as StateRef>::Error

Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Source§

impl<T> State for Arc<T>
where T: StateRef,

Source§

type Error = <T as StateRef>::Error

Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Source§

impl<T: State + ?Sized> State for Box<T>

Source§

type Error = <T as State>::Error

Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>

Source§

fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>

Source§

fn storage( &mut self, address: Address, index: U256, ) -> Result<U256, Self::Error>

Implementors§