Skip to main content

Delay

Trait Delay 

Source
pub trait Delay {
    // Required method
    async fn delay(&mut self, duration: Duration);
}
Expand description

An async delay.

This is the async counterpart to hdmi_hal::time::Delay. The contract is identical; only the method signature gains async.

Infallible: a timer that cannot wait leaves the caller nothing to recover with.

§Cancellation

The future may be dropped before it completes, for example when the caller races the delay against an event. A dropped delay has done nothing that needs undoing, and the implementation is ready for the next call.

Required Methods§

Source

async fn delay(&mut self, duration: Duration)

Wait at least duration, rounding up to the implementation’s own tick; never less, so a minimum wait holds whatever the timer.

Measured on the platform’s Clock: now() read after delay(d) completes is at least d later than now() read before it. A test double whose delay does not advance its clock breaks this.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> Delay for T
where T: SendDelay,