Trait EvmFactory
pub trait EvmFactory {
type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<<DB as Database>::Error>, Spec = Self::Spec>;
type Context<DB: Database>: ContextTr<Db = DB>
where <Self::Context<DB> as ContextTr>::Journal: JournalExt;
type Tx: IntoTxEnv<Self::Tx>;
type Error<DBError: Error + Send + Sync + 'static>: EvmError;
type HaltReason: HaltReasonTr + Send + Sync + 'static;
type Spec: Debug + Copy + Send + Sync + 'static;
// Required methods
fn create_evm<DB>(
&self,
db: DB,
evm_env: EvmEnv<Self::Spec>,
) -> Self::Evm<DB, NoOpInspector>
where DB: Database;
fn create_evm_with_inspector<DB, I>(
&self,
db: DB,
input: EvmEnv<Self::Spec>,
inspector: I,
) -> Self::Evm<DB, I>
where DB: Database,
I: Inspector<Self::Context<DB>>;
}
Available on crate feature
evm
only.Expand description
A type responsible for creating instances of an ethereum virtual machine given a certain input.
Required Associated Types§
type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<<DB as Database>::Error>, Spec = Self::Spec>
type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<<DB as Database>::Error>, Spec = Self::Spec>
The EVM type that this factory creates.
type Context<DB: Database>: ContextTr<Db = DB>
where
<Self::Context<DB> as ContextTr>::Journal: JournalExt
type Context<DB: Database>: ContextTr<Db = DB> where <Self::Context<DB> as ContextTr>::Journal: JournalExt
The EVM context for inspectors
type HaltReason: HaltReasonTr + Send + Sync + 'static
type HaltReason: HaltReasonTr + Send + Sync + 'static
Halt reason. See Evm::HaltReason
.
Required Methods§
fn create_evm<DB>(
&self,
db: DB,
evm_env: EvmEnv<Self::Spec>,
) -> Self::Evm<DB, NoOpInspector>where
DB: Database,
fn create_evm<DB>(
&self,
db: DB,
evm_env: EvmEnv<Self::Spec>,
) -> Self::Evm<DB, NoOpInspector>where
DB: Database,
Creates a new instance of an EVM.
fn create_evm_with_inspector<DB, I>(
&self,
db: DB,
input: EvmEnv<Self::Spec>,
inspector: I,
) -> Self::Evm<DB, I>
fn create_evm_with_inspector<DB, I>( &self, db: DB, input: EvmEnv<Self::Spec>, inspector: I, ) -> Self::Evm<DB, I>
Creates a new instance of an EVM with an inspector.
Note: It is expected that the [Inspector
] is usually provided as &mut Inspector
so that
it remains owned by the call site when Evm::transact
is invoked.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.