Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required method
    async fn sleep(&self, duration: Duration);
}
Expand description

Time for protocols: native timers, the browser’s setTimeout, or a virtual clock in tests.

Required Methods§

Source

async fn sleep(&self, duration: Duration)

Waits for duration.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§