Trait ripin::evaluate::Evaluate [] [src]

pub trait Evaluate<T> {
    type Err;
    fn operands_needed(&self) -> usize;
    fn operands_generated(&self) -> usize;
    fn evaluate(self, stack: &mut Stack<T>) -> Result<(), Self::Err>;
}

The main Trait allowing evaluation of operations on Operands.

Associated Types

The type returned in the event of an evaluation error.

Required Methods

Returns the number of operand this Evaluator needs and will pop() from the stack.

Returns the number of operand this Evaluator will generate and will push() in the stack.

Execute the evaluation with the given stack, returns the Evaluation error if something goes wrong.

Implementors