Trait revm::db::components::state::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: FixedBytes<32>
    ) -> Result<Bytecode, Self::Error>;
    fn storage(
        &mut self,
        address: Address,
        index: Uint<256, 4>
    ) -> Result<Uint<256, 4>, 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: FixedBytes<32> ) -> Result<Bytecode, Self::Error>

Get account code by its hash

source

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

Get storage value of address at index.

Implementations on Foreign Types§

source§

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

§

type Error = <T as State>::Error

source§

fn basic( &mut self, address: Address ) -> Result<Option<AccountInfo>, <&'a mut T as State>::Error>

source§

fn code_by_hash( &mut self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <&'a mut T as State>::Error>

source§

fn storage( &mut self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <&'a mut T as State>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

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

source§

fn code_by_hash( &mut self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <&T as State>::Error>

source§

fn storage( &mut self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <&T as State>::Error>

source§

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

§

type Error = <T as State>::Error

source§

fn basic( &mut self, address: Address ) -> Result<Option<AccountInfo>, <Box<T> as State>::Error>

source§

fn code_by_hash( &mut self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <Box<T> as State>::Error>

source§

fn storage( &mut self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <Box<T> as State>::Error>

source§

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

§

type Error = <T as StateRef>::Error

source§

fn basic( &mut self, address: Address ) -> Result<Option<AccountInfo>, <Arc<T> as State>::Error>

source§

fn code_by_hash( &mut self, code_hash: FixedBytes<32> ) -> Result<Bytecode, <Arc<T> as State>::Error>

source§

fn storage( &mut self, address: Address, index: Uint<256, 4> ) -> Result<Uint<256, 4>, <Arc<T> as State>::Error>

Implementors§