[][src]Trait evaluator::RcEvaluator

pub trait RcEvaluator {
    type Output;
    fn eval(&mut self) -> Rc<Self::Output>;
}

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.

Loading content...

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.

Loading content...

Implementors

impl<Out, Cl> RcEvaluator for RcEval<Out, Cl> where
    Cl: FnMut() -> Out, 
[src]

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.

Loading content...