pub struct EtableInterpreter<'etable, S, ES> { /* private fields */ }
Expand description
Interpreter that uses Etable.
Implementations§
Source§impl<'etable, S, ES> EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> EtableInterpreter<'etable, S, ES>
Sourcepub fn new(machine: Machine<S>, etable: &'etable ES) -> Self
pub fn new(machine: Machine<S>, etable: &'etable ES) -> Self
Create a new interpreter from the machine state and etable.
Sourcepub fn deconstruct(self) -> Machine<S>
pub fn deconstruct(self) -> Machine<S>
Deconstruct the interpreter to get the underlying machine state.
Sourcepub fn inspect(&self) -> Option<(Opcode, &Stack)>
pub fn inspect(&self) -> Option<(Opcode, &Stack)>
Inspect the machine’s next opcode and current stack.
Sourcepub fn perform<R, F: FnOnce(&mut Self) -> Result<R, ExitError>>(
&mut self,
f: F,
) -> Result<R, ExitError>
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.
Sourcepub fn peek_opcode(&self) -> Option<Opcode>
pub fn peek_opcode(&self) -> Option<Opcode>
Pick the next opcode.
Trait Implementations§
Source§impl<'etable, S, ES> AsMut<Machine<S>> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> AsMut<Machine<S>> for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, ES> AsRef<Machine<S>> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> AsRef<Machine<S>> for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, ES> Deref for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> Deref for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, ES> DerefMut for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> DerefMut for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, H, ES: Etable<H, State = S>> FeedbackInterpreter<H, CallFeedback> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, H, ES: Etable<H, State = S>> FeedbackInterpreter<H, CallFeedback> for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, H, ES: Etable<H, State = S>> FeedbackInterpreter<H, CreateFeedback> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, H, ES: Etable<H, State = S>> FeedbackInterpreter<H, CreateFeedback> for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, H, ES: Etable<H, State = S>> Interpreter<H> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, H, ES: Etable<H, State = S>> Interpreter<H> for EtableInterpreter<'etable, S, ES>
Source§impl<'etable, S, H, ES: Etable<H, State = S>> StepInterpreter<H> for EtableInterpreter<'etable, S, ES>
impl<'etable, S, H, ES: Etable<H, State = S>> StepInterpreter<H> for EtableInterpreter<'etable, S, ES>
Auto Trait Implementations§
impl<'etable, S, ES> Freeze for EtableInterpreter<'etable, S, ES>where
S: Freeze,
impl<'etable, S, ES> RefUnwindSafe for EtableInterpreter<'etable, S, ES>where
S: RefUnwindSafe,
ES: RefUnwindSafe,
impl<'etable, S, ES> !Send for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> !Sync for EtableInterpreter<'etable, S, ES>
impl<'etable, S, ES> Unpin for EtableInterpreter<'etable, S, ES>where
S: Unpin,
impl<'etable, S, ES> UnwindSafe for EtableInterpreter<'etable, S, ES>where
S: UnwindSafe,
ES: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> TrapConsume<T> for T
impl<T> TrapConsume<T> for T
Source§type Rest = Infallible
type Rest = Infallible
Rest type.
Source§fn consume(self) -> Result<T, Infallible>
fn consume(self) -> Result<T, Infallible>
Consume
T
to get Rest
.