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§
Required Methods§
Sourcefn delay_until(&self, at: Instant) -> Self::Delay
fn delay_until(&self, at: Instant) -> Self::Delay
Create a future that completes at the specified instant.