pub trait AsyncClock: Clock {
// Required method
fn sleep(&self, duration: Duration) -> impl Future<Output = ()> + Send;
}Expand description
Extension trait adding async sleep to Clock.
This is separate from the base Clock trait because async methods
cannot be in traits without additional machinery, and we want to keep
telltale-types dependency-free.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl AsyncClock for MockClock
Implement AsyncClock for MockClock.
Sleep immediately advances simulated time without blocking.