pub struct MemoFrame(/* private fields */);
Implementations§
Source§impl MemoFrame
impl MemoFrame
Sourcepub fn cache<Key, Value, ValueFn>(&self, key: Key, value_fn: ValueFn) -> Value
pub fn cache<Key, Value, ValueFn>(&self, key: Key, value_fn: ValueFn) -> 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 Freeze for MemoFrame
impl !RefUnwindSafe for MemoFrame
impl !Send for MemoFrame
impl !Sync for MemoFrame
impl Unpin for MemoFrame
impl !UnwindSafe for MemoFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more