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