Trait Sleep

Source
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§