Struct silkenweb::memo::MemoFrame[][src]

pub struct MemoFrame(_);

A MemoFrame represents the scope of a frame for the MemoCache.

Implementations

impl MemoFrame[src]

pub fn cache<Key, Value, ValueFn>(&self, key: Key, value_fn: ValueFn) -> Value where
    Key: 'static + Eq + Hash,
    Value: 'static + Clone,
    ValueFn: FnOnce() -> Value, 
[src]

Lookup a value in the cache.

If a value is not there, it will be generated using value_fn. All functional dependencies of value_fn should be included in key.

The value will be cached for the next frame, whether it’s new or existing.

It is up to the client to use a key that uniquely identifies the functional dependencies of variables captured by value_fn.

Trait Implementations

impl Drop for MemoFrame[src]

Auto Trait Implementations

impl !RefUnwindSafe for MemoFrame

impl !Send for MemoFrame

impl !Sync for MemoFrame

impl Unpin for MemoFrame

impl !UnwindSafe for MemoFrame

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.