pub trait EvmTr {
type Context: ContextTr;
type Instructions: InstructionProvider;
type Precompiles;
// Required methods
fn run_interpreter(
&mut self,
interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>,
) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output;
fn ctx(&mut self) -> &mut Self::Context;
fn ctx_ref(&self) -> &Self::Context;
fn ctx_instructions(
&mut self,
) -> (&mut Self::Context, &mut Self::Instructions);
fn ctx_precompiles(
&mut self,
) -> (&mut Self::Context, &mut Self::Precompiles);
}
Expand description
A trait that integrates context, instruction set, and precompiles to create an EVM struct.
In addition to execution capabilities, this trait provides getter methods for its component fields.
Required Associated Types§
Sourcetype Context: ContextTr
type Context: ContextTr
The context type that implements ContextTr to provide access to execution state
Sourcetype Instructions: InstructionProvider
type Instructions: InstructionProvider
The instruction set type that implements InstructionProvider to define available operations
Sourcetype Precompiles
type Precompiles
The type containing the available precompiled contracts
Required Methods§
Sourcefn run_interpreter(
&mut self,
interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>,
) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output
fn run_interpreter( &mut self, interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output
Executes the interpreter loop for the given interpreter instance. Returns either a completion status or the next interpreter action to take.
Sourcefn ctx_instructions(&mut self) -> (&mut Self::Context, &mut Self::Instructions)
fn ctx_instructions(&mut self) -> (&mut Self::Context, &mut Self::Instructions)
Returns mutable references to both the context and instruction set. This enables atomic access to both components when needed.
Sourcefn ctx_precompiles(&mut self) -> (&mut Self::Context, &mut Self::Precompiles)
fn ctx_precompiles(&mut self) -> (&mut Self::Context, &mut Self::Precompiles)
Returns mutable references to both the context and precompiles. This enables atomic access to both components when needed.