pub trait LoopControl {
// Required methods
fn is_end(&self) -> bool;
fn revert_to_previous_pointer(&mut self);
fn set_action(&mut self, action: InterpreterAction);
fn action(&mut self) -> &mut Option<InterpreterAction>;
// Provided method
fn is_not_end(&self) -> bool { ... }
}
Expand description
Trait controls execution of the loop.
Required Methods§
Sourcefn revert_to_previous_pointer(&mut self)
fn revert_to_previous_pointer(&mut self)
Reverts to previous instruction pointer.
After the loop is finished, the instruction pointer is set to the previous one.
Sourcefn set_action(&mut self, action: InterpreterAction)
fn set_action(&mut self, action: InterpreterAction)
Set return action and set instruction pointer to null. Preserve previous pointer
Previous pointer can be restored by calling LoopControl::revert_to_previous_pointer
.
Sourcefn action(&mut self) -> &mut Option<InterpreterAction>
fn action(&mut self) -> &mut Option<InterpreterAction>
Takes next action.
Provided Methods§
Sourcefn is_not_end(&self) -> bool
fn is_not_end(&self) -> bool
Returns true
if the loop should continue.