[][src]Trait fn_memo::FnMemo

pub trait FnMemo<Arg, Output> {
    fn call(&self, arg: Arg) -> Output;
fn clear_cache(&self); }

The memoized function.

Required methods

fn call(&self, arg: Arg) -> Output

Calls the function. If the result of arg is already cached, it will return the cached result, otherwise, it caculates the result and adds it to the cache.

fn clear_cache(&self)

Clears the cache.

Loading content...

Implementors

impl<C: Cache, F: RecurFn<C::Arg, C::Output>> FnMemo<<C as Cache>::Arg, <C as Cache>::Output> for fn_memo::sync::Memo<C, F> where
    C::Arg: Clone,
    C::Output: Clone
[src]

impl<C: Cache, F: RecurFn<C::Arg, C::Output>> FnMemo<<C as Cache>::Arg, <C as Cache>::Output> for fn_memo::unsync::Memo<C, F> where
    C::Arg: Clone,
    C::Output: Clone
[src]

Loading content...