[−][src]Trait evaluator::Evaluator
An interface for immediate evaluation (without caching) for any types and cached (lazy) evaluation for types that implement Clone
, including those that implement Copy
, integers and floats being the simplest examples.
Associated Types
type Output
The type that the evaluator evaluates to.
Required methods
fn eval(&mut self) -> Self::Output
Evaluates and returns the result. Because evaluators may possibly involve caching, a mutable borrow of self
is required. Thus all evaluators must be mutable.
Panics
Panicking of this function is not defined or restricted. Refer to the documentation of implementing structs for more information.
Implementors
impl<Out> Evaluator for DummyEval<Out> where
Out: Clone,
[src]
Out: Clone,
type Output = Out
fn eval(&mut self) -> Self::Output
[src]
Evaluates and returns the result. This includes the overhead of cloning the value, because the fixed value must be preserved.
Because caching evaluators, as their name suggests, store the cached value inside themselves, a mutable borrow of self
is required.
Panics
May panic only if cloning of the inner value panics.
impl<Out, Cl> Evaluator for Eval<Out, Cl> where
Out: Clone,
Cl: FnMut() -> Out,
[src]
Out: Clone,
Cl: FnMut() -> Out,
type Output = Out
fn eval(&mut self) -> Self::Output
[src]
Evaluates and returns the result. This includes the overhead of cloning the value, because the internal cache must be preserved. If you need to move the result every time it is evaluated, use ImmEval
.
Because caching evaluators, as their name suggests, store the cached value inside themselves, a mutable borrow of self
is required.
Panics
Panicking of this function is not defined or restricted and depends on the closure.
impl<Out, Cl> Evaluator for ImmEval<Out, Cl> where
Cl: FnMut() -> Out,
[src]
Cl: FnMut() -> Out,
impl<Out, Cl> Evaluator for RcEval<Out, Cl> where
Out: Clone,
Cl: FnMut() -> Out,
[src]
Out: Clone,
Cl: FnMut() -> Out,
type Output = Out
fn eval(&mut self) -> Self::Output
[src]
Evaluates and returns the result. This includes the overhead of cloning the value, because the internal cache must be preserved. If you need to move the result every time it is evaluated, use ImmEval
.
Because caching evaluators, as their name suggests, store the cached value inside themselves, a mutable borrow of self
is required.
Panics
Panicking of this function is not defined or restricted and depends on the closure.