pub struct Waiter { /* private fields */ }Expand description
A handle used to await the event. Cheap to clone; all clones share state.
Dropping the last Waiter makes Signaler::signal report NoReceivers.
Implementations§
Source§impl Waiter
impl Waiter
Sourcepub fn wait(&self) -> Wait<'_> ⓘ
pub fn wait(&self) -> Wait<'_> ⓘ
Return a future that resolves when the event fires (Ok(())) or when
every signaler is dropped first (Err(Disconnected)).
Sourcepub fn try_wait(&self) -> Result<(), TryWaitError>
pub fn try_wait(&self) -> Result<(), TryWaitError>
Non-blocking snapshot. Ok(()) if fired, Err(Pending) if still waiting,
Err(Disconnected) if no signal can ever arrive.
Sourcepub fn is_signaled(&self) -> bool
pub fn is_signaled(&self) -> bool
Whether the event has already fired.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Whether all signalers disconnected without firing.
Sourcepub fn signaler_count(&self) -> usize
pub fn signaler_count(&self) -> usize
Number of live Signaler handles (a snapshot).
Sourcepub fn waiter_count(&self) -> usize
pub fn waiter_count(&self) -> usize
Number of live Waiter handles (a snapshot).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Waiter
impl RefUnwindSafe for Waiter
impl Send for Waiter
impl Sync for Waiter
impl Unpin for Waiter
impl UnsafeUnpin for Waiter
impl UnwindSafe for Waiter
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