polkavm_common::program

Trait OpcodeVisitor

Source
pub trait OpcodeVisitor: Copy {
    type State;
    type ReturnTy;
    type InstructionSet: InstructionSet;

    // Required methods
    fn instruction_set(self) -> Self::InstructionSet;
    fn dispatch(
        self,
        state: &mut Self::State,
        opcode: usize,
        chunk: u128,
        offset: u32,
        skip: u32,
    ) -> Self::ReturnTy;
}
Expand description

The lowest level visitor; dispatches directly on opcode numbers.

Required Associated Types§

Required Methods§

Source

fn instruction_set(self) -> Self::InstructionSet

Source

fn dispatch( self, state: &mut Self::State, opcode: usize, chunk: u128, offset: u32, skip: u32, ) -> Self::ReturnTy

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.

Implementors§