pub trait Timer:
Send
+ Sync
+ 'static {
// Required method
fn sleep(&self, duration: Duration) -> BoxFuture<()>;
}Expand description
A source of futures that complete after a delay.
Separate from Spawn because waiting and executing are different
capabilities: a caller that is already inside an async task needs the
timer, not the executor.