Trait quinn::AsyncTimer

source ·
pub trait AsyncTimer: Send + Debug + 'static {
    // Required methods
    fn reset(self: Pin<&mut Self>, i: Instant);
    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>;
}
Expand description

Abstract implementation of an async timer for runtime independence

Required Methods§

source

fn reset(self: Pin<&mut Self>, i: Instant)

Update the timer to expire at i

source

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

Check whether the timer has expired, and register to be woken if not

Implementations on Foreign Types§

source§

impl AsyncTimer for Timer

source§

fn reset(self: Pin<&mut Self>, t: Instant)

source§

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

source§

impl AsyncTimer for Sleep

source§

fn reset(self: Pin<&mut Self>, t: Instant)

source§

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

Implementors§