pub trait Sleep {
    // Required methods
    fn reset(self: Pin<&mut Self>, timeout: Duration);
    fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>;
}
Expand description

A sleep future

Required Methods§

source

fn reset(self: Pin<&mut Self>, timeout: Duration)

Set the future to time out in timeout from now

source

fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>

Wait for the timeout to expire

Implementations on Foreign Types§

source§

impl Sleep for Timer

source§

fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>

source§

fn reset(self: Pin<&mut Self>, timeout: Duration)

source§

impl Sleep for Sleep

source§

fn poll_sleep(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>

source§

fn reset(self: Pin<&mut Self>, timeout: Duration)

Implementors§