pub struct TimerQueue<T> { /* private fields */ }
Expand description

Stores values to be yielded at specific times in the future

Time is expressed as a bare u64 representing an absolute point in time. The caller may use any consistent unit, e.g. milliseconds, and any consistent definition of time zero. Larger units limit resolution but make polling over the same real-time interval proportionately faster, whereas smaller units improve resolution, limit total range, and reduce poll performance.

Implementations

Create an empty queue starting at time 0

Create a queue for which at least n calls to insert will not require a reallocation

Returns a timer that has expired by now, if any

now must be at least the largest previously passed value

Lower bound on when the next timer will expire, if any

Register a timer that will yield value at timeout

Adjust timer to expire at timeout

Cancel timer

Iterate over all scheduled timers

Borrow the value associated with timer

Uniquely borrow the value associated with timer

Number of scheduled timers

Whether no timers are scheduled

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.