Enum ripin::evaluate::IntEvaluator
[−]
[src]
pub enum IntEvaluator<T: PrimInt + Signed> { Add, Sub, Mul, Div, Rem, Neg, Pow, Swap, Zero, One, // some variants omitted }
Variants
Add
"+"
will pop 2
operands and push 1
.
Sub
"-"
will pop 2
operands and push 1
.
Mul
"*"
will pop 2
operands and push 1
.
Div
"/"
will pop 2
operands and push 1
.
Rem
"%"
will pop 2
operands and push 1
.
Neg
"neg"
will pop 1
operand and push 1
.
Pow
"pow"
will pop 2
operands and push 1
.
Swap
"swap"
will pop 2
operands and push 2
.
Zero
"zero"
will pop 0
operand and push 1
.
One
"zero"
will pop 0
operand and push 1
.
Trait Implementations
impl<T: Debug + PrimInt + Signed> Debug for IntEvaluator<T>
[src]
impl<T: Copy + PrimInt + Signed> Copy for IntEvaluator<T>
[src]
impl<T: Clone + PrimInt + Signed> Clone for IntEvaluator<T>
[src]
fn clone(&self) -> IntEvaluator<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: PrimInt + Signed> Evaluate<T> for IntEvaluator<T>
[src]
type Err = IntEvaluateErr<T>
The type returned in the event of an evaluation error.
fn operands_needed(&self) -> usize
Returns the number of operand this Evaluator
needs and will pop()
from the stack
. Read more
fn operands_generated(&self) -> usize
Returns the number of operand this Evaluator
will generate and will push()
in the stack
. Read more
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. Read more
impl<'a, T: PrimInt + Signed> TryFromRef<&'a str> for IntEvaluator<T>
[src]
type Err = IntErr<'a>
The type returned in the event of a conversion error.
fn try_from_ref(expr: &&'a str) -> Result<Self, Self::Err>
Performs the conversion.