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
type Err
The type returned in the event of an evaluation error.
Required Methods
fn operands_needed(&self) -> usize
Returns the number of operand this Evaluator
needs
and will pop()
from the stack
.
fn operands_generated(&self) -> usize
Returns the number of operand this Evaluator
will generate
and will push()
in the stack
.
fn evaluate(self, stack: &mut Stack<T>) -> Result<(), Self::Err>
Execute the evaluation with the given stack
,
returns the Evaluation
error if something goes wrong.
Implementors
impl<T: Float> Evaluate<T> for FloatEvaluator<T>
impl<T: PrimInt + Signed> Evaluate<T> for IntEvaluator<T>