Trait LoopControl

Source
pub trait LoopControl {
    // Required methods
    fn is_not_end(&self) -> bool;
    fn reset_action(&mut self);
    fn set_action(&mut self, action: InterpreterAction);
    fn action(&mut self) -> &mut Option<InterpreterAction>;

    // Provided methods
    fn is_end(&self) -> bool { ... }
    fn instruction_result(&mut self) -> Option<InstructionResult> { ... }
}
Expand description

Trait controls execution of the loop.

Required Methods§

Source

fn is_not_end(&self) -> bool

Returns true if the loop should continue.

Source

fn reset_action(&mut self)

Sets the end flag internally. Action should be taken after.

Source

fn set_action(&mut self, action: InterpreterAction)

Set return action.

Source

fn action(&mut self) -> &mut Option<InterpreterAction>

Returns the current action.

Provided Methods§

Source

fn is_end(&self) -> bool

Is end of the loop.

Source

fn instruction_result(&mut self) -> Option<InstructionResult>

Returns instruction result

Implementors§