Struct silkenweb_reactive::memo::MemoFrame [−][src]
pub struct MemoFrame(_);
Implementations
impl MemoFrame
[src]
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]
Key: 'static + Eq + Hash,
Value: 'static + Clone,
ValueFn: FnOnce() -> Value,
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
Auto Trait Implementations
impl !RefUnwindSafe for MemoFrame
impl !RefUnwindSafe for MemoFrame
impl !UnwindSafe for MemoFrame
impl !UnwindSafe for MemoFrame