pub struct UpdaterEffect<T, I, C, U> { /* private fields */ }Expand description
Internal updater effect handle. Prefer the associated constructors over the free functions.
Implementations§
Source§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 the call to create_updater.
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 the call to create_updater.
Sourcepub 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 the call to create_updater.
Sourcepub 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§
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