pub trait Clock:
Send
+ Sync
+ 'static {
// Required methods
fn now(&self) -> Duration;
fn schedule(&self, delay: Duration, job: Box<dyn FnOnce() + Send>);
}Expand description
A scheduler usable from any executor. A manual clock makes fault tests independent of sleep.
Required Methods§
fn now(&self) -> Duration
fn schedule(&self, delay: Duration, job: Box<dyn FnOnce() + Send>)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".