pub trait Sleeper {
// Required methods
fn snooze(self: Pin<&mut Self>, duration: Duration) -> bool;
fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>;
}Expand description
A dyn-compatible interface for polling one sleep Future at a time.
Required Methods§
fn snooze(self: Pin<&mut Self>, duration: Duration) -> bool
fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".