Struct UpdaterEffect
pub struct UpdaterEffect<T, I, C, U> { /* private fields */ }Expand description
Internal updater effect handle. Prefer the associated constructors over the free functions.
Implementations§
§impl UpdaterEffect<(), (), (), ()>
Create an effect updater that runs on_change when any signals that subscribe during the
run of compute are updated. compute is immediately run only once, and its value is returned
from UpdaterEffect::new.
impl UpdaterEffect<(), (), (), ()>
Create an effect updater that runs on_change when any signals that subscribe during the
run of compute are updated. compute is immediately run only once, and its value is returned
from UpdaterEffect::new.
pub fn new<R>(
compute: impl Fn() -> R + 'static,
on_change: impl Fn(R) + 'static,
) -> Rwhere
R: 'static,
pub fn new<R>(
compute: impl Fn() -> R + 'static,
on_change: impl Fn(R) + 'static,
) -> Rwhere
R: 'static,
Create an effect updater that runs on_change when any signals that subscribe during the
run of compute are updated. compute is immediately run only once, and its value is returned
from UpdaterEffect::new.
pub fn new_stateful<T, R>(
compute: impl Fn(Option<T>) -> (R, T) + 'static,
on_change: impl Fn(R, T) -> T + 'static,
) -> Rwhere
T: Any + 'static,
R: 'static,
pub fn new_stateful<T, R>(
compute: impl Fn(Option<T>) -> (R, T) + 'static,
on_change: impl Fn(R, T) -> T + 'static,
) -> Rwhere
T: Any + 'static,
R: 'static,
Create an effect updater that runs on_change when any signals within compute subscribe to
changes. compute is immediately run and its return value is returned.
Trait Implementations§
§impl<T, I, C, U> Drop for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> Drop for UpdaterEffect<T, I, C, U>
§impl<T, I, C, U> EffectTrait for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> EffectTrait for UpdaterEffect<T, I, C, U>
Auto Trait Implementations§
impl<T, I, C, U> !Freeze for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> !RefUnwindSafe for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> Send for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> !Sync for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> Unpin for UpdaterEffect<T, I, C, U>
impl<T, I, C, U> UnwindSafe for UpdaterEffect<T, I, C, U>
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
§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.