pub trait Sleeper:
Send
+ Sync
+ 'static {
// Required method
fn sleep(&self, dur: Duration) -> BoxFuture<'static, ()>;
}Expand description
The timer the wake seam sleeps on, injected so this crate needs no runtime.
One method, deliberately: a wake needs to know that an interval passed, not what time it is. Anything richer (deadlines, cancellation tokens, an interval stream) would be an executor’s API smuggled back in through the trait.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".