Trait InspectorEvmTr

pub trait InspectorEvmTr: EvmTr {
    type Inspector;

    // Required methods
    fn inspector(&mut self) -> &mut Self::Inspector;
    fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector);
    fn run_inspect_interpreter(
        &mut self,
        interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>,
    ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output;
}
Expand description

Inspector EVM trait. Extends the EvmTr trait with inspector related methods.

It contains execution of interpreter with crate::Inspector calls crate::Inspector::step and crate::Inspector::step_end calls.

It is used inside crate::InspectorHandler to extend evm with support for inspection.

Required Associated Types§

Required Methods§

fn inspector(&mut self) -> &mut Self::Inspector

Returns a mutable reference to the inspector.

fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector)

Returns a tuple of mutable references to the context and the inspector.

Useful when you want to allow inspector to modify the context.

fn run_inspect_interpreter( &mut self, interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output

Runs the inspector on the interpreter.

This function is called by the EVM when it needs to inspect the Interpreter loop. It is responsible for calling the inspector’s methods and instructions from table.

Implementations on Foreign Types§

§

impl<CTX, INSP, I, P> InspectorEvmTr for OpEvm<CTX, INSP, I, P>

§

type Inspector = INSP

§

fn inspector( &mut self, ) -> &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector

§

fn ctx_inspector( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector)

§

fn run_inspect_interpreter( &mut self, interpreter: &mut Interpreter<<<OpEvm<CTX, INSP, I, P> as EvmTr>::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<<OpEvm<CTX, INSP, I, P> as EvmTr>::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output

Implementors§

§

impl<CTX, INSP, I, P> InspectorEvmTr for Evm<CTX, INSP, I, P>

§

type Inspector = INSP