pub struct Queue { /* private fields */ }
Expand description
A timer queue, with items integrated into tasks.
Implementations§
Source§impl Queue
impl Queue
Sourcepub fn schedule_wake(&mut self, at: u64, waker: &Waker) -> bool
pub fn schedule_wake(&mut self, at: u64, waker: &Waker) -> bool
Schedules a task to run at a specific time.
If this function returns true
, the called should find the next expiration time and set
a new alarm for that time.
Sourcepub fn next_expiration(&mut self, now: u64) -> u64
pub fn next_expiration(&mut self, now: u64) -> u64
Dequeues expired timers and returns the next alarm time.
The provided callback will be called for each expired task. Tasks that never expire will be removed, but the callback will not be called.
Auto Trait Implementations§
impl !Freeze for Queue
impl !RefUnwindSafe for Queue
impl Send for Queue
impl !Sync for Queue
impl Unpin for Queue
impl !UnwindSafe for Queue
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