pub struct Effect { /* private fields */ }Expand description
Reactive effect executing side-effects when subscribed signals mutate.
Implementations§
Source§impl Effect
impl Effect
pub fn new<F, R>(effect_fn: F) -> Effectwhere
F: FnMut() -> R + 'static,
R: IntoEffectCleanup,
pub fn dispose(&self)
Sourcepub fn into_guard(self) -> EffectGuard
pub fn into_guard(self) -> EffectGuard
Converts the effect into an RAII guard that disposes the effect when dropped.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Effect
impl !Send for Effect
impl !Sync for Effect
impl !UnwindSafe for Effect
impl Forget for Effect
impl Freeze for Effect
impl Move for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
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