LoopControl

Trait LoopControl 

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§

fn is_not_end(&self) -> bool

Returns true if the loop should continue.

fn reset_action(&mut self)

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

fn set_action(&mut self, action: InterpreterAction)

Set return action.

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

Returns the current action.

Provided Methods§

fn is_end(&self) -> bool

Is end of the loop.

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

Returns instruction result

Implementors§