[−][src]Trait evaluator::RcEvaluator
An interface for cached (lazy) evaluation for types that do not implement Clone
(note that Clone
is a supertrait of Copy
).
Associated Types
type Output
The type that the evaluator evaluates to.
Required methods
fn eval(&mut self) -> Rc<Self::Output>
Evaluates and returns a reference counter to 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, Cl> RcEvaluator for RcEval<Out, Cl> where
Cl: FnMut() -> Out,
[src]
Cl: FnMut() -> Out,
type Output = Out
fn eval(&mut self) -> Rc<Self::Output>
[src]
Evaluates and returns an std::rc::Rc
to the result.
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.