maitake::time

Struct Turn

Source
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

Source

pub fn ticks_to_next_deadline(&self) -> Option<u64>

Returns the number of ticks until the deadline at which the next Sleep future expires, or None if no sleep futures are currently scheduled.

Source

pub fn time_to_next_deadline(&self) -> Option<Duration>

Returns the Duration from the current time to the deadline of the next Sleep future, or None if no sleep futures are currently scheduled.

Source

pub fn elapsed(&self) -> Duration

Returns the total elapsed time since this timer wheel started running.

Source

pub fn has_remaining(&self) -> bool

Returns true if there are currently pending Sleep futures scheduled in this timer wheel.

Trait Implementations§

Source§

impl Debug for Turn

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.