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;
    type Local: LocalContextTr;

Show 18 methods // Required methods fn tx(&self) -> &Self::Tx; fn block(&self) -> &Self::Block; fn cfg(&self) -> &Self::Cfg; fn journal(&self) -> &Self::Journal; fn journal_mut(&mut self) -> &mut Self::Journal; fn db(&self) -> &Self::Db; fn db_mut(&mut self) -> &mut Self::Db; fn chain(&self) -> &Self::Chain; fn chain_mut(&mut self) -> &mut Self::Chain; fn local(&self) -> &Self::Local; fn local_mut(&mut self) -> &mut Self::Local; fn error( &mut self, ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>; fn tx_journal_mut(&mut self) -> (&Self::Tx, &mut Self::Journal); fn tx_local_mut(&mut self) -> (&Self::Tx, &mut Self::Local); // Provided methods fn journal_ref(&self) -> &Self::Journal { ... } fn db_ref(&self) -> &Self::Db { ... } fn chain_ref(&self) -> &Self::Chain { ... } fn local_ref(&self) -> &Self::Local { ... }
}
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.

All function has a *_mut variant except the function for ContextTr::tx and ContextTr::block.

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

Source

type Local: LocalContextTr

Local context 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(&self) -> &Self::Journal

Get the journal

Source

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

Get the journal mutably

Source

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

Get the database

Source

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

Get the database mutably

Source

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

Get the chain

Source

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

Get the chain mutably

Source

fn local(&self) -> &Self::Local

Get the local context

Source

fn local_mut(&mut self) -> &mut Self::Local

Get the local context mutably

Source

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

Get the error

Source

fn tx_journal_mut(&mut self) -> (&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.

Source

fn tx_local_mut(&mut self) -> (&Self::Tx, &mut Self::Local)

Get the transaction and local context. It is used to efficiently load initcode into local context without copying them from transaction.

Provided Methods§

Source

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

Get the journal reference

Source

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

Get the database reference

Source

fn chain_ref(&self) -> &Self::Chain

Get the chain reference

Source

fn local_ref(&self) -> &Self::Local

Get the local context reference

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§

type Local = <T as ContextTr>::Local

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn chain_ref(&self) -> &Self::Chain

Source§

fn local(&self) -> &Self::Local

Source§

fn local_mut(&mut self) -> &mut Self::Local

Source§

fn local_ref(&self) -> &Self::Local

Source§

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

Source§

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

Source§

fn tx_local_mut(&mut self) -> (&Self::Tx, &mut Self::Local)

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§

type Local = <T as ContextTr>::Local

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn chain_ref(&self) -> &Self::Chain

Source§

fn local(&self) -> &Self::Local

Source§

fn local_mut(&mut self) -> &mut Self::Local

Source§

fn local_ref(&self) -> &Self::Local

Source§

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

Source§

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

Source§

fn tx_local_mut(&mut self) -> (&Self::Tx, &mut Self::Local)

Implementors§