Struct EtableInterpreter

Source
pub struct EtableInterpreter<'etable, ES: EtableSet> { /* private fields */ }

Implementations§

Source§

impl<'etable, ES> EtableInterpreter<'etable, ES>
where ES: EtableSet,

Source

pub const fn position(&self) -> usize

Return a reference of the program counter.

Source

pub fn new(machine: Machine<ES::State>, etable: &'etable ES) -> Self

Source

pub fn deconstruct(self) -> Machine<ES::State>

Source

pub fn exit(&mut self)

Explicit exit of the machine. Further step will return error.

Source

pub fn inspect(&self) -> Option<(Opcode, &Stack)>

Inspect the machine’s next opcode and current stack.

Source

pub fn perform<R, F: FnOnce(&mut Self) -> Result<R, ExitError>>( &mut self, f: F, ) -> Result<R, ExitError>

Perform any operation. If the operation fails, then set the machine status to already exited.

Source

pub fn peek_opcode(&self) -> Option<Opcode>

Pick the next opcode.

Source

pub fn advance(&mut self)

Methods from Deref<Target = Machine<ES::State>>§

Source

pub fn code(&self) -> &[u8]

Machine code.

Source

pub fn is_empty(&self) -> bool

Whether the machine has empty code.

Trait Implementations§

Source§

impl<'etable, ES: EtableSet> AsMachine for EtableInterpreter<'etable, ES>

Source§

type State = <ES as EtableSet>::State

Source§

fn as_machine(&self) -> &Machine<Self::State>

Source§

impl<'etable, ES: EtableSet> AsMachineMut for EtableInterpreter<'etable, ES>

Source§

fn as_machine_mut(&mut self) -> &mut Machine<Self::State>

Source§

impl<'etable, ES: EtableSet> Deref for EtableInterpreter<'etable, ES>

Source§

type Target = Machine<<ES as EtableSet>::State>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Machine<ES::State>

Dereferences the value.
Source§

impl<'etable, ES: EtableSet> DerefMut for EtableInterpreter<'etable, ES>

Source§

fn deref_mut(&mut self) -> &mut Machine<ES::State>

Mutably dereferences the value.
Source§

impl<'etable, H, ES: EtableSet<Handle = H>> FeedbackInterpreter<H, CallFeedback> for EtableInterpreter<'etable, ES>

Source§

fn feedback( &mut self, feedback: CallFeedback, _handler: &mut H, ) -> Result<(), ExitError>

Source§

impl<'etable, H, ES: EtableSet<Handle = H>> FeedbackInterpreter<H, CreateFeedback> for EtableInterpreter<'etable, ES>

Source§

fn feedback( &mut self, feedback: CreateFeedback, _handler: &mut H, ) -> Result<(), ExitError>

Source§

impl<'etable, H, ES: EtableSet<Handle = H>> Interpreter<H> for EtableInterpreter<'etable, ES>

Source§

type State = <ES as EtableSet>::State

Source§

type Trap = <ES as EtableSet>::Trap

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<'etable, H, ES: EtableSet<Handle = H>> StepInterpreter<H> for EtableInterpreter<'etable, ES>

Source§

fn step(&mut self, handle: &mut H) -> Result<(), Capture<ExitResult, ES::Trap>>

Auto Trait Implementations§

§

impl<'etable, ES> Freeze for EtableInterpreter<'etable, ES>
where <ES as EtableSet>::State: Freeze,

§

impl<'etable, ES> RefUnwindSafe for EtableInterpreter<'etable, ES>

§

impl<'etable, ES> !Send for EtableInterpreter<'etable, ES>

§

impl<'etable, ES> !Sync for EtableInterpreter<'etable, ES>

§

impl<'etable, ES> Unpin for EtableInterpreter<'etable, ES>
where <ES as EtableSet>::State: Unpin,

§

impl<'etable, ES> UnwindSafe for EtableInterpreter<'etable, ES>
where <ES as EtableSet>::State: UnwindSafe, ES: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TrapConsume<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V