hyper::rt

Trait Timer

source
pub trait Timer {
    // Required methods
    fn sleep(&self, duration: Duration) -> Pin<Box<dyn Sleep>>;
    fn sleep_until(&self, deadline: Instant) -> Pin<Box<dyn Sleep>>;

    // Provided method
    fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) { ... }
}
Expand description

A timer which provides timer-like functions.

Required Methods§

source

fn sleep(&self, duration: Duration) -> Pin<Box<dyn Sleep>>

Return a future that resolves in duration time.

source

fn sleep_until(&self, deadline: Instant) -> Pin<Box<dyn Sleep>>

Return a future that resolves at deadline.

Provided Methods§

source

fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant)

Reset a future to resolve at new_deadline instead.

Implementors§