pub struct Effect { /* private fields */ }Expand description
Effect hook that runs a callback and optionally cleans up.
Implementations§
Source§impl Effect
impl Effect
Sourcepub fn deps_changed(&self, new_deps: &[u64]) -> bool
pub fn deps_changed(&self, new_deps: &[u64]) -> bool
Check if dependencies changed.
Sourcepub fn run(&mut self, new_deps: Option<&[u64]>) -> bool
pub fn run(&mut self, new_deps: Option<&[u64]>) -> bool
Run the effect if dependencies changed.
Sourcepub fn has_cleanup(&self) -> bool
pub fn has_cleanup(&self) -> bool
Check if the effect has a pending cleanup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Effect
impl !RefUnwindSafe for Effect
impl Send for Effect
impl !Sync for Effect
impl Unpin for Effect
impl !UnwindSafe 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more