Trait EvmTr

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

Main trait that combines the context, instructions and precompiles and allows execution of interpreter.

Required Associated Types§

Required Methods§

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

Run the interpreter loop and returns the output that can be a return or a next action.

fn ctx(&mut self) -> &mut Self::Context

Get the context.

fn ctx_ref(&self) -> &Self::Context

Get the context reference.

fn ctx_instructions(&mut self) -> (&mut Self::Context, &mut Self::Instructions)

Get the context and instructions.

fn ctx_precompiles(&mut self) -> (&mut Self::Context, &mut Self::Precompiles)

Get the context and precompiles.

Implementations on Foreign Types§

§

impl<'a, T> EvmTr for &'a mut T
where T: 'a + EvmTr + ?Sized,

§

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

§

type Context = CTX

§

type Instructions = I

§

type Precompiles = P

§

fn run_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

§

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

§

fn ctx_ref(&self) -> &<OpEvm<CTX, INSP, I, P> as EvmTr>::Context

§

fn ctx_instructions( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Instructions)

§

fn ctx_precompiles( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Precompiles)

§

impl<T> EvmTr for Box<T>
where T: EvmTr + ?Sized,

§

type Context = <T as EvmTr>::Context

§

type Instructions = <T as EvmTr>::Instructions

§

type Precompiles = <T as EvmTr>::Precompiles

§

fn run_interpreter( &mut self, interpreter: &mut Interpreter<<<Box<T> as EvmTr>::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<<Box<T> as EvmTr>::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output

§

fn ctx(&mut self) -> &mut <Box<T> as EvmTr>::Context

§

fn ctx_ref(&self) -> &<Box<T> as EvmTr>::Context

§

fn ctx_instructions( &mut self, ) -> (&mut <Box<T> as EvmTr>::Context, &mut <Box<T> as EvmTr>::Instructions)

§

fn ctx_precompiles( &mut self, ) -> (&mut <Box<T> as EvmTr>::Context, &mut <Box<T> as EvmTr>::Precompiles)

Implementors§

§

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

§

type Context = CTX

§

type Instructions = I

§

type Precompiles = P