MakeDelay

Trait MakeDelay 

Source
pub trait MakeDelay {
    type Delay: Future<Output = ()> + Send;

    // Required method
    fn delay_until(&self, at: Instant) -> Self::Delay;

    // Provided method
    fn delay(&self, duration: Duration) -> Self::Delay { ... }
}
Expand description

A trait for creating delay futures.

Required Associated Types§

Source

type Delay: Future<Output = ()> + Send

The future returned by the delay/delay_until method.

Required Methods§

Source

fn delay_until(&self, at: Instant) -> Self::Delay

Create a future that completes at the specified instant.

Provided Methods§

Source

fn delay(&self, duration: Duration) -> Self::Delay

Create a future that completes after the specified duration.

Implementors§