pub trait Clock:
Send
+ Sync
+ Debug {
// Required methods
fn now(&self) -> Duration;
fn at(&self, at: Duration, job: Job);
}Expand description
A source of time that runs jobs at a given moment.
Times are offsets from the clock’s own start. Jobs due at the same moment run in the order they were given.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Clock for ManualClock
impl Clock for SystemClock
impl Clock for TokioClock
Available on crate feature
tokio only.