Trait InstructionHandler

Source
pub trait InstructionHandler
where Self: Sized,
{ type Context; type Err; // Required methods fn create_vm(initial_context: Self::Context) -> VM<Self>; fn process_instruction( vm_state: &mut VMState, context: &mut Self::Context, instruction: Instruction, ) -> Result<(), Self::Err>; }
Expand description

An instruction handler interface.

Required Associated Types§

Source

type Context

Handler context.

Source

type Err

Err return type after processing instructions. TODO: Convert Err into std::ops::Try once it is stabilized

Required Methods§

Source

fn create_vm(initial_context: Self::Context) -> VM<Self>

Source

fn process_instruction( vm_state: &mut VMState, context: &mut Self::Context, instruction: Instruction, ) -> Result<(), Self::Err>

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§