Trait Interpreter

Source
pub trait Interpreter<H> {
    type State;
    type Trap;

    // Required methods
    fn deconstruct(self) -> (Self::State, Vec<u8>);
    fn state(&self) -> &Self::State;
    fn state_mut(&mut self) -> &mut Self::State;
    fn run(&mut self, handle: &mut H) -> Capture<ExitResult, Self::Trap>;
}
Expand description

An interpreter.

Required Associated Types§

Source

type State

Interpreter state.

Source

type Trap

Interpreter trap.

Required Methods§

Source

fn deconstruct(self) -> (Self::State, Vec<u8>)

Deconstruct the interpreter.

Source

fn state(&self) -> &Self::State

Get a reference to the internal state.

Source

fn state_mut(&mut self) -> &mut Self::State

Get a mutable reference to the internal state.

Source

fn run(&mut self, handle: &mut H) -> Capture<ExitResult, Self::Trap>

Run the interpreter.

Implementors§

Source§

impl<'etable, S, H, ES: Etable<H, State = S>> Interpreter<H> for EtableInterpreter<'etable, S, ES>

Source§

type State = S

Source§

type Trap = <ES as Etable<H>>::Trap