pub struct Queue { /* private fields */ }
Expand description
A timer queue, with items integrated into tasks.
§Safety
This Queue is only safe when there is a single integrated queue in the system.
If there are multiple integrated queues, additional checks are necessary to ensure that a Waker is not attempted to be enqueued in multiple queues.
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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Queue
impl !RefUnwindSafe 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