pub struct PureEvaluator;
Expand description
An Evaluator
whose Value
type is the same as its Term
type, and whose operators
are pure functions on that type that return Result<Term, E>
Trait Implementations§
Source§impl<Idx, B, U, T, E> Evaluator<Idx, B, U, T> for PureEvaluator
impl<Idx, B, U, T, E> Evaluator<Idx, B, U, T> for PureEvaluator
type Value = T
type Error = E
fn evaluate_binary_operator( &mut self, _span: Span<Idx>, operator: B, lhs: Self::Value, rhs: Self::Value, ) -> Result<Self::Value, Self::Error>
fn evaluate_unary_operator( &mut self, _span: Span<Idx>, operator: U, argument: Self::Value, ) -> Result<Self::Value, Self::Error>
fn evaluate_term( &mut self, _span: Span<Idx>, term: T, ) -> Result<Self::Value, Self::Error>
fn evaluate<I>(&mut self, input: I) -> Result<Self::Value, Self::Error>where
I: IntoIterator<Item = Expression<Idx, B, U, T>>,
Auto Trait Implementations§
impl Freeze for PureEvaluator
impl RefUnwindSafe for PureEvaluator
impl Send for PureEvaluator
impl Sync for PureEvaluator
impl Unpin for PureEvaluator
impl UnwindSafe for PureEvaluator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more