pub struct Event { /* private fields */ }
Expand description
An object that can receive or send notifications.
Implementations§
Source§impl Event
impl Event
Sourcepub fn notify(&self, n: usize)
pub fn notify(&self, n: usize)
Notify a number of awaiting events that the predicate should be checked.
If less events than requested are currently awaiting, then all awaiting event are notified.
Sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Notify one awaiting event (if any) that the predicate should be checked.
Sourcepub fn notify_all(&self)
pub fn notify_all(&self)
Notify all awaiting events that the predicate should be checked.
Sourcepub fn wait_until<F, T>(&self, predicate: F) -> WaitUntil<'_, F, T> ⓘ
pub fn wait_until<F, T>(&self, predicate: F) -> WaitUntil<'_, F, T> ⓘ
Returns a future that can be await
ed until the provided predicate is
satisfied.
Sourcepub fn wait_until_or_timeout<F, T, D>(
&self,
predicate: F,
deadline: D,
) -> WaitUntilOrTimeout<'_, F, T, D> ⓘ
pub fn wait_until_or_timeout<F, T, D>( &self, predicate: F, deadline: D, ) -> WaitUntilOrTimeout<'_, F, T, D> ⓘ
Returns a future that can be await
ed until the provided predicate is
satisfied or until the provided future completes.
The deadline is specified as a Future
that is expected to resolves to
()
after some duration, such as a tokio::time::Sleep
future.
Trait Implementations§
Auto Trait Implementations§
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