Struct Memo
pub struct Memo<T>where
T: PartialEq + 'static,{ /* private fields */ }Expand description
A memoized derived value that only recomputes when one of its tracked dependencies changes, and only notifies dependents when its value changes.
Unlike the previous implementation, this is driven by dependency invalidation
rather than an Effect that eagerly recomputes.
Implementations§
Trait Implementations§
Source§impl<T> Res<T> for Memo<T>
impl<T> Res<T> for Memo<T>
Source§fn get_value(&self, _: &impl DataContext) -> T
fn get_value(&self, _: &impl DataContext) -> T
Returns the value of a resource by value.
fn set_or_bind<F>(self, cx: &mut Context, closure: F)
§impl<T> SignalTrack<T> for Memo<T>where
T: PartialEq + 'static,
impl<T> SignalTrack<T> for Memo<T>where
T: PartialEq + 'static,
§impl<T> SignalWith<T> for Memo<T>
impl<T> SignalWith<T> for Memo<T>
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
impl<T> Copy for Memo<T>where
T: PartialEq + 'static,
Auto Trait Implementations§
impl<T> Freeze for Memo<T>
impl<T> RefUnwindSafe for Memo<T>where
T: RefUnwindSafe,
impl<T> Send for Memo<T>where
T: Send,
impl<T> Sync for Memo<T>where
T: Sync,
impl<T> Unpin for Memo<T>where
T: Unpin,
impl<T> UnwindSafe for Memo<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, S> SignalMap<T> for Swhere
T: 'static,
S: SignalWith<T> + Copy + 'static,
impl<T, S> SignalMap<T> for Swhere
T: 'static,
S: SignalWith<T> + Copy + 'static,
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
Source§impl<T> ToStringLocalized for Twhere
T: ToString,
impl<T> ToStringLocalized for Twhere
T: ToString,
Source§fn to_string_local(&self, _cx: &impl DataContext) -> String
fn to_string_local(&self, _cx: &impl DataContext) -> String
Method for converting the current type to a
String via a translation using fluent.