pub(crate) struct Deadline {
entry: Arc<Entry>,
}Expand description
A registered deadline. Cheap to clone (one Arc + one token clone).
Dropping every clone abandons the deadline: the wheel drops the slot at its own instant, or at the next sweep, whichever comes first. There is no unregister call.
Fields§
§entry: Arc<Entry>Implementations§
Source§impl Deadline
impl Deadline
Sourcepub(crate) fn token(&self) -> &CancellationToken
pub(crate) fn token(&self) -> &CancellationToken
The token the wheel cancels once Instant::now() >= at.
Level-triggered: awaiting it after the wheel has fired resolves
immediately, so the engine may create and drop token().cancelled()
on every select! iteration without a lost-wakeup race and without
re-registering with the wheel.
Sourcefn already_due() -> Self
fn already_due() -> Self
A deadline that has already passed. Allocates one token, never touches the wheel, never starts the release thread.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Deadline
impl RefUnwindSafe for Deadline
impl Send for Deadline
impl Sync for Deadline
impl Unpin for Deadline
impl UnsafeUnpin for Deadline
impl UnwindSafe for Deadline
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