pub struct Timer<'a, Type, State, Clock: Clock, Dur: Duration> { /* fields omitted */ }
Expand description
A Timer
counts toward an expiration, can be polled for elapsed and remaining time, and can be
one-shot or continuous/periodic.
Construct a new, OneShot
Timer
Change timer type to one-shot
Change timer type into periodic
Start the timer from this instant
Returns the Duration
of time elapsed since it was started
The duration is truncated, not rounded.
The units of the Duration
are the same as that used to construct the Timer
.
Returns the Duration
until the expiration of the timer
The duration is truncated, not rounded.
The units of the Duration
are the same as that used to construct the Timer
.
Block until the timer has expired
Check whether the timer has expired
The timer is not restarted
Block until the timer has expired
The timer is restarted
Check whether a periodic timer has elapsed
The timer is restarted if it has elapsed.
Formats the value using the given formatter. Read more
impl<'a, Type, State, Clock, Dur> Send for Timer<'a, Type, State, Clock, Dur> where
Clock: Sync,
Dur: Send,
State: Send,
Type: Send,
<Clock as Clock>::T: Send,
impl<'a, Type, State, Clock, Dur> Sync for Timer<'a, Type, State, Clock, Dur> where
Clock: Sync,
Dur: Sync,
State: Sync,
Type: Sync,
<Clock as Clock>::T: Sync,
impl<'a, Type, State, Clock, Dur> Unpin for Timer<'a, Type, State, Clock, Dur> where
Dur: Unpin,
State: Unpin,
Type: Unpin,
<Clock as Clock>::T: Unpin,
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.