pub trait Clock {
// Required methods
fn now_ms(&self) -> u64;
fn sleep(&self, milliseconds: u64) -> LocalBoxFuture<'static, ()>;
// Provided method
fn now(&self) -> f64 { ... }
}Expand description
A monotonic local clock used for linger and lifecycle deadlines.
Required Methods§
Sourcefn sleep(&self, milliseconds: u64) -> LocalBoxFuture<'static, ()>
fn sleep(&self, milliseconds: u64) -> LocalBoxFuture<'static, ()>
Wait for a relative duration on the embedding clock.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".