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 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§

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

Get the journal

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

Get the journal mutably

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

Get the database

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

Get the database mutably

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

Get the chain

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

Get the chain mutably

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

Get the local context

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

Get the local context mutably

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

Get the error

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.

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§

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

Get the journal reference

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

Get the database reference

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

Get the chain reference

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

Get the local context reference

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(&self) -> &<&'a mut T as ContextTr>::Journal

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

fn local_ref(&self) -> &<&'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( &mut self, ) -> (&<&'a mut T as ContextTr>::Tx, &mut <&'a mut T as ContextTr>::Journal)

§

fn tx_local_mut( &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(&self) -> &<Box<T> as ContextTr>::Journal

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

fn tx_local_mut( &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