[][src]Trait lc3::InstructionHandler

pub trait InstructionHandler where
    Self: Sized
{ type Context; type Err; 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>; }

An instruction handler interface.

Associated Types

type Context

Handler context.

type Err

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

Loading content...

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>

Loading content...

Implementors

impl InstructionHandler for TrivialHandler[src]

type Context = (Empty, Sink)

type Err = IOError

impl<R: Read, W: Write> InstructionHandler for IOStreamHandler<R, W>[src]

type Context = (R, W)

type Err = IOError

Loading content...