Trait ContextTr

Source
pub trait ContextTr {
    type Block: Block;
    type Tx: Transaction;
    type Cfg: Cfg;
    type Db: Database;
    type Journal: JournalTr<Database = Self::Db>;
    type Chain;

    // Required methods
    fn tx(&self) -> &Self::Tx;
    fn block(&self) -> &Self::Block;
    fn cfg(&self) -> &Self::Cfg;
    fn journal(&mut self) -> &mut Self::Journal;
    fn journal_ref(&self) -> &Self::Journal;
    fn db(&mut self) -> &mut Self::Db;
    fn db_ref(&self) -> &Self::Db;
    fn chain(&mut self) -> &mut Self::Chain;
    fn error(
        &mut self,
    ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>;
    fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal);
}
Expand description

Trait that defines the context of the EVM execution.

This trait is used to access the environment and state of the EVM. It is used to access the transaction, block, configuration, database, journal, and chain. It is also used to set the error of the EVM.

Required Associated Types§

Source

type Block: Block

Block type

Source

type Tx: Transaction

Transaction type

Source

type Cfg: Cfg

Configuration type

Source

type Db: Database

Database type

Source

type Journal: JournalTr<Database = Self::Db>

Journal type

Source

type Chain

Chain type

Required Methods§

Source

fn tx(&self) -> &Self::Tx

Get the transaction

Source

fn block(&self) -> &Self::Block

Get the block

Source

fn cfg(&self) -> &Self::Cfg

Get the configuration

Source

fn journal(&mut self) -> &mut Self::Journal

Get the journal

Source

fn journal_ref(&self) -> &Self::Journal

Get the journal reference

Source

fn db(&mut self) -> &mut Self::Db

Get the database

Source

fn db_ref(&self) -> &Self::Db

Get the database reference

Source

fn chain(&mut self) -> &mut Self::Chain

Get the chain

Source

fn error( &mut self, ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>

Get the error

Source

fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal)

Get the transaction and journal. It is used to efficiently load access list into journal without copying them from transaction.

Implementations on Foreign Types§

Source§

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

Source§

type Block = <T as ContextTr>::Block

Source§

type Tx = <T as ContextTr>::Tx

Source§

type Cfg = <T as ContextTr>::Cfg

Source§

type Db = <T as ContextTr>::Db

Source§

type Journal = <T as ContextTr>::Journal

Source§

type Chain = <T as ContextTr>::Chain

Source§

fn tx(&self) -> &Self::Tx

Source§

fn block(&self) -> &Self::Block

Source§

fn cfg(&self) -> &Self::Cfg

Source§

fn journal(&mut self) -> &mut Self::Journal

Source§

fn journal_ref(&self) -> &Self::Journal

Source§

fn db(&mut self) -> &mut Self::Db

Source§

fn db_ref(&self) -> &Self::Db

Source§

fn chain(&mut self) -> &mut Self::Chain

Source§

fn error( &mut self, ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>

Source§

fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal)

Source§

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

Source§

type Block = <T as ContextTr>::Block

Source§

type Tx = <T as ContextTr>::Tx

Source§

type Cfg = <T as ContextTr>::Cfg

Source§

type Db = <T as ContextTr>::Db

Source§

type Journal = <T as ContextTr>::Journal

Source§

type Chain = <T as ContextTr>::Chain

Source§

fn tx(&self) -> &Self::Tx

Source§

fn block(&self) -> &Self::Block

Source§

fn cfg(&self) -> &Self::Cfg

Source§

fn journal(&mut self) -> &mut Self::Journal

Source§

fn journal_ref(&self) -> &Self::Journal

Source§

fn db(&mut self) -> &mut Self::Db

Source§

fn db_ref(&self) -> &Self::Db

Source§

fn chain(&mut self) -> &mut Self::Chain

Source§

fn error( &mut self, ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>

Source§

fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal)

Implementors§