pub struct NotifyHandle { /* private fields */ }
Expand description
Struct that enables functionality like waiting to be notified
when the count of a crate::Counter
or crate::WeakCounter
changes.
Implementations§
Source§impl NotifyHandle
impl NotifyHandle
Sourcepub fn wait_until_condition(
&self,
condition: impl Fn(usize) -> bool,
) -> Result<(), NotifyError>
pub fn wait_until_condition( &self, condition: impl Fn(usize) -> bool, ) -> Result<(), NotifyError>
Block the current thread until the condition is true. This is different than spin-looping since the current thread will use channels internally to be notified when the counter changes.
Sourcepub fn wait_until_condition_timeout(
&self,
condition: impl Fn(usize) -> bool,
timeout: Duration,
) -> Result<(), NotifyTimeoutError>
pub fn wait_until_condition_timeout( &self, condition: impl Fn(usize) -> bool, timeout: Duration, ) -> Result<(), NotifyTimeoutError>
NotifyHandle::wait_until_condition
with a timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NotifyHandle
impl RefUnwindSafe for NotifyHandle
impl Send for NotifyHandle
impl !Sync for NotifyHandle
impl Unpin for NotifyHandle
impl UnwindSafe for NotifyHandle
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