Trait Timer
pub trait Timer
A timer which provides timer-like functions.
Required Methods
fn sleep(&self, duration: Duration) -> Pin<Box<dyn Sleep>>Return a future that resolves in
durationtime.fn sleep_until(&self, deadline: Instant) -> Pin<Box<dyn Sleep>>Return a future that resolves at
deadline.
Provided Methods
fn now(&self) -> InstantReturn an
Instantrepresenting the current time.The default implementation returns [
Instant::now()].fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant)Reset a future to resolve at
new_deadlineinstead.