Trait Etable

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

    // Required method
    fn eval(
        &self,
        machine: &mut Machine<Self::State>,
        handle: &mut H,
        position: usize,
    ) -> Control<Self::Trap>;
}
Expand description

An etable “set” that can be evaluated. This is the generic trait to support all types of dispatching strategies (via match or an actual etable array).

Required Associated Types§

Source

type State

Etable state.

Source

type Trap

Etable trap.

Required Methods§

Source

fn eval( &self, machine: &mut Machine<Self::State>, handle: &mut H, position: usize, ) -> Control<Self::Trap>

Evaluate the etable.

§Safety

The interpreter guarantee that the byte at position exists.

Implementors§

Source§

impl<S, H, Tr, E1, E2> Etable<H> for Chained<E1, E2>
where E1: Etable<H, State = S, Trap = Tr>, E2: Etable<H, State = S, Trap = Tr>,

Source§

type State = S

Source§

type Trap = Tr

Source§

impl<S, H, Tr, EPre, E, EPost> Etable<H> for Tracing<EPre, E, EPost>
where EPre: Etable<H, State = S, Trap = Tr>, E: Etable<H, State = S, Trap = Tr>, EPost: Etable<H, State = S, Trap = Tr>,

Source§

type State = S

Source§

type Trap = Tr

Source§

impl<S, H, Tr, F> Etable<H> for DispatchEtable<S, H, Tr, F>
where F: Fn(&mut Machine<S>, &mut H, usize) -> Control<Tr>,

Source§

type State = S

Source§

type Trap = Tr

Source§

impl<S, H, Tr, F> Etable<H> for MultiEtable<S, H, Tr, F>
where F: Fn(&mut Machine<S>, &mut H, usize) -> Control<Tr>,

Source§

type State = S

Source§

type Trap = Tr

Source§

impl<S, H, Tr, F> Etable<H> for Single<S, H, Tr, F>
where F: Fn(&mut Machine<S>, &mut H, usize) -> Control<Tr>,

Source§

type State = S

Source§

type Trap = Tr