Trait ContextTr

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 13 methods // 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 chain_ref(&self) -> &Self::Chain; fn local(&mut self) -> &mut Self::Local; fn error( &mut self, ) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>; fn tx_journal(&mut self) -> (&Self::Tx, &mut Self::Journal); fn tx_local(&mut self) -> (&Self::Tx, &mut 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.

Required Associated Types§

type Block: Block

Block type

type Tx: Transaction

Transaction type

type Cfg: Cfg

Configuration type

type Db: Database

Database type

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

Journal type

type Chain

Chain type

type Local: LocalContextTr

Local context type

Required Methods§

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

Get the transaction

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

Get the block

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

Get the configuration

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

Get the journal

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

Get the journal reference

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

Get the database

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

Get the database reference

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

Get the chain

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

Get the chain reference

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

Get the local context

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

Get the error

fn tx_journal(&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.

fn tx_local(&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.

Implementations on Foreign Types§

§

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

§

type Block = <T as ContextTr>::Block

§

type Tx = <T as ContextTr>::Tx

§

type Cfg = <T as ContextTr>::Cfg

§

type Db = <T as ContextTr>::Db

§

type Journal = <T as ContextTr>::Journal

§

type Chain = <T as ContextTr>::Chain

§

type Local = <T as ContextTr>::Local

§

fn tx(&self) -> &<&'a mut T as ContextTr>::Tx

§

fn block(&self) -> &<&'a mut T as ContextTr>::Block

§

fn cfg(&self) -> &<&'a mut T as ContextTr>::Cfg

§

fn journal(&mut self) -> &mut <&'a mut T as ContextTr>::Journal

§

fn journal_ref(&self) -> &<&'a mut T as ContextTr>::Journal

§

fn db(&mut self) -> &mut <&'a mut T as ContextTr>::Db

§

fn db_ref(&self) -> &<&'a mut T as ContextTr>::Db

§

fn chain(&mut self) -> &mut <&'a mut T as ContextTr>::Chain

§

fn chain_ref(&self) -> &<&'a mut T as ContextTr>::Chain

§

fn local(&mut self) -> &mut <&'a mut T as ContextTr>::Local

§

fn error( &mut self, ) -> &mut Result<(), ContextError<<<&'a mut T as ContextTr>::Db as Database>::Error>>

§

fn tx_journal( &mut self, ) -> (&<&'a mut T as ContextTr>::Tx, &mut <&'a mut T as ContextTr>::Journal)

§

fn tx_local( &mut self, ) -> (&<&'a mut T as ContextTr>::Tx, &mut <&'a mut T as ContextTr>::Local)

§

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

§

type Block = <T as ContextTr>::Block

§

type Tx = <T as ContextTr>::Tx

§

type Cfg = <T as ContextTr>::Cfg

§

type Db = <T as ContextTr>::Db

§

type Journal = <T as ContextTr>::Journal

§

type Chain = <T as ContextTr>::Chain

§

type Local = <T as ContextTr>::Local

§

fn tx(&self) -> &<Box<T> as ContextTr>::Tx

§

fn block(&self) -> &<Box<T> as ContextTr>::Block

§

fn cfg(&self) -> &<Box<T> as ContextTr>::Cfg

§

fn journal(&mut self) -> &mut <Box<T> as ContextTr>::Journal

§

fn journal_ref(&self) -> &<Box<T> as ContextTr>::Journal

§

fn db(&mut self) -> &mut <Box<T> as ContextTr>::Db

§

fn db_ref(&self) -> &<Box<T> as ContextTr>::Db

§

fn chain(&mut self) -> &mut <Box<T> as ContextTr>::Chain

§

fn chain_ref(&self) -> &<Box<T> as ContextTr>::Chain

§

fn local(&mut self) -> &mut <Box<T> as ContextTr>::Local

§

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

§

fn tx_journal( &mut self, ) -> (&<Box<T> as ContextTr>::Tx, &mut <Box<T> as ContextTr>::Journal)

§

fn tx_local( &mut self, ) -> (&<Box<T> as ContextTr>::Tx, &mut <Box<T> as ContextTr>::Local)

Implementors§

Source§

impl<BLOCK: Block, TX: Transaction, DB: Database, CFG: Cfg, JOURNAL: JournalTr<Database = DB>, CHAIN, LOCAL: LocalContextTr> ContextTr for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL>

Source§

type Block = BLOCK

Source§

type Tx = TX

Source§

type Cfg = CFG

Source§

type Db = DB

Source§

type Journal = JOURNAL

Source§

type Chain = CHAIN

Source§

type Local = LOCAL