pub(crate) struct Sleepers {
pub(crate) count: usize,
pub(crate) wakers: Vec<(usize, Waker)>,
pub(crate) free_ids: Vec<usize>,
}Expand description
A list of sleeping tickers.
Fields§
§count: usizeNumber of sleeping tickers (both notified and unnotified).
wakers: Vec<(usize, Waker)>IDs and wakers of sleeping unnotified tickers.
A sleeping ticker is notified when its waker is missing from this list.
free_ids: Vec<usize>Reclaimed IDs.
Implementations§
Source§impl Sleepers
impl Sleepers
Sourcepub(crate) fn update(&mut self, id: usize, waker: &Waker) -> bool
pub(crate) fn update(&mut self, id: usize, waker: &Waker) -> bool
Re-inserts a sleeping ticker’s waker if it was notified.
Returns true if the ticker was notified.
Sourcepub(crate) fn remove(&mut self, id: usize) -> bool
pub(crate) fn remove(&mut self, id: usize) -> bool
Removes a previously inserted sleeping ticker.
Returns true if the ticker was notified.
Sourcepub(crate) fn is_notified(&self) -> bool
pub(crate) fn is_notified(&self) -> bool
Returns true if a sleeping ticker is notified or no tickers are sleeping.
Auto Trait Implementations§
impl Freeze for Sleepers
impl RefUnwindSafe for Sleepers
impl Send for Sleepers
impl Sync for Sleepers
impl Unpin for Sleepers
impl UnwindSafe for Sleepers
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