backon

Trait Sleeper

Source
pub trait Sleeper: 'static {
    type Sleep: Future<Output = ()>;

    // Required method
    fn sleep(&self, dur: Duration) -> Self::Sleep;
}
Expand description

A sleeper is used to generate a future that completes after a specified duration.

Required Associated Types§

Source

type Sleep: Future<Output = ()>

The future returned by the sleep method.

Required Methods§

Source

fn sleep(&self, dur: Duration) -> Self::Sleep

Create a future that completes after a set period.

Implementors§

Source§

impl<F: Fn(Duration) -> Fut + 'static, Fut: Future<Output = ()>> Sleeper for F

All Fn(Duration) -> impl Future<Output = ()> implements Sleeper.

Source§

type Sleep = Fut