Skip to main content

Timer

Trait Timer 

Source
pub trait Timer {
    // Required method
    async fn sleep_until(&self, at: MonoNs);
}
Expand description

The host’s sleep. A host that runs a wait inline returns a future that is ready on its first poll (it slept already); an executor’s timer pends until its deadline.

Required Methods§

Source

async fn sleep_until(&self, at: MonoNs)

Resolves once the host clock reads at or later.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Timer for ManualTimer

Source§

impl Timer for StdClock

Available on crate feature std only.
Source§

impl Timer for TokioClock

Available on crate feature tokio only.
Source§

impl<C: Clock> Timer for Reactor<'_, C>