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::Error>, Spec = Self::Spec, BlockEnv = Self::BlockEnv, Precompiles = Self::Precompiles, Inspector = I>;
type Context<DB: Database>: ContextTr<Db = DB, 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 + Hash + Eq + Send + Sync + Default + 'static;
type BlockEnv: BlockEnvironment;
type Precompiles;
// Required methods
fn create_evm<DB: Database>(
&self,
db: DB,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Self::Evm<DB, NoOpInspector>;
fn create_evm_with_inspector<DB: Database, I: Inspector<Self::Context<DB>>>(
&self,
db: DB,
input: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::Evm<DB, I>;
}Expand description
A type responsible for creating instances of an ethereum virtual machine given a certain input.
Required Associated Types§
Sourcetype Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<DB::Error>, Spec = Self::Spec, BlockEnv = Self::BlockEnv, Precompiles = Self::Precompiles, Inspector = I>
type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<DB::Error>, Spec = Self::Spec, BlockEnv = Self::BlockEnv, Precompiles = Self::Precompiles, Inspector = I>
The EVM type that this factory creates.
Sourcetype Context<DB: Database>: ContextTr<Db = DB, Journal: JournalExt>
type Context<DB: Database>: ContextTr<Db = DB, Journal: JournalExt>
The EVM context for inspectors
Sourcetype HaltReason: HaltReasonTr + Send + Sync + 'static
type HaltReason: HaltReasonTr + Send + Sync + 'static
Halt reason. See Evm::HaltReason.
Sourcetype Spec: Debug + Copy + Hash + Eq + Send + Sync + Default + 'static
type Spec: Debug + Copy + Hash + Eq + Send + Sync + Default + 'static
The EVM specification identifier, see Evm::Spec.
Sourcetype BlockEnv: BlockEnvironment
type BlockEnv: BlockEnvironment
Block environment used by the EVM. See Evm::BlockEnv.
Sourcetype Precompiles
type Precompiles
Precompiles used by the EVM.
Required Methods§
Sourcefn create_evm<DB: Database>(
&self,
db: DB,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Self::Evm<DB, NoOpInspector>
fn create_evm<DB: Database>( &self, db: DB, evm_env: EvmEnv<Self::Spec, Self::BlockEnv>, ) -> Self::Evm<DB, NoOpInspector>
Creates a new instance of an EVM.
Sourcefn create_evm_with_inspector<DB: Database, I: Inspector<Self::Context<DB>>>(
&self,
db: DB,
input: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::Evm<DB, I>
fn create_evm_with_inspector<DB: Database, I: Inspector<Self::Context<DB>>>( &self, db: DB, input: EvmEnv<Self::Spec, Self::BlockEnv>, 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.