pub struct Memo<ValueType>where
ValueType: 'static,{ /* private fields */ }Expand description
Zero-overhead Copy handle to a lazy, glitch-free memoized reactive computation.
Implementations§
Source§impl<ValueType> Memo<ValueType>
Core reactive memoization operations for Memo<T>.
impl<ValueType> Memo<ValueType>
Core reactive memoization operations for Memo<T>.
Sourcepub fn new<CallbackFn>(compute: CallbackFn) -> Selfwhere
CallbackFn: FnMut() -> ValueType + 'static,
pub fn new<CallbackFn>(compute: CallbackFn) -> Selfwhere
CallbackFn: FnMut() -> ValueType + 'static,
Sourcepub fn try_with_ref<ReaderFn, ReturnValue>(
&self,
reader: ReaderFn,
) -> Option<ReturnValue>where
ReaderFn: FnOnce(&ValueType) -> ReturnValue,
pub fn try_with_ref<ReaderFn, ReturnValue>(
&self,
reader: ReaderFn,
) -> Option<ReturnValue>where
ReaderFn: FnOnce(&ValueType) -> ReturnValue,
Sourcepub fn with_ref<ReaderFn, ReturnValue>(&self, reader: ReaderFn) -> ReturnValuewhere
ReaderFn: FnOnce(&ValueType) -> ReturnValue,
pub fn with_ref<ReaderFn, ReturnValue>(&self, reader: ReaderFn) -> ReturnValuewhere
ReaderFn: FnOnce(&ValueType) -> ReturnValue,
Trait Implementations§
Source§impl<ValueType> Clone for Memo<ValueType>where
ValueType: 'static,
Manual Clone implementation so Memo<T> is always Copy.
impl<ValueType> Clone for Memo<ValueType>where
ValueType: 'static,
Manual Clone implementation so Memo<T> is always Copy.
impl<ValueType> Copy for Memo<ValueType>where
ValueType: 'static,
Marker Copy implementation for Memo<T>.
impl<ValueType> Eq for Memo<ValueType>where
ValueType: 'static,
Reflexive equality for Memo<T>.
Auto Trait Implementations§
impl<ValueType> Forget for Memo<ValueType>
impl<ValueType> Freeze for Memo<ValueType>
impl<ValueType> Move for Memo<ValueType>
impl<ValueType> RefUnwindSafe for Memo<ValueType>
impl<ValueType> Send for Memo<ValueType>
impl<ValueType> Sync for Memo<ValueType>
impl<ValueType> Unpin for Memo<ValueType>
impl<ValueType> UnsafeUnpin for Memo<ValueType>
impl<ValueType> UnwindSafe for Memo<ValueType>
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