pub struct Turn {
pub now: u64,
pub expired: usize,
/* private fields */
}
Expand description
Represents a single turn of the timer wheel.
Fields§
§now: u64
The total number of ticks elapsed since the first time this timer wheel was advanced.
expired: usize
The number of Sleep
futures that were woken up by this turn of the
timer wheel.
Implementations§
Source§impl Turn
impl Turn
Sourcepub fn ticks_to_next_deadline(&self) -> Option<u64>
pub fn ticks_to_next_deadline(&self) -> Option<u64>
Sourcepub fn time_to_next_deadline(&self) -> Option<Duration>
pub fn time_to_next_deadline(&self) -> Option<Duration>
Sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
Returns the total elapsed time since this timer wheel started running.
Sourcepub fn has_remaining(&self) -> bool
pub fn has_remaining(&self) -> bool
Returns true
if there are currently pending Sleep
futures
scheduled in this timer wheel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnwindSafe for Turn
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