pub trait DelayMs {
type Delay;
type Error;
// Required methods
fn start(&mut self, ms: Self::Delay) -> Result<(), Self::Error>;
fn poll_delay_ms(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>;
fn cancel(&mut self) -> Result<(), Self::Error>;
// Provided methods
fn poll_delay_ms_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
where Self: Unpin { ... }
fn delay_ms(&mut self, ms: Self::Delay) -> DelayMsFuture<'_, Self> ⓘ
where Self: Unpin { ... }
}
The type of duration to delay for.
The error returned on failure.
Poll a delay of ms milliseconds.
Attempt to cancel a delay in progress.
Delay for ms milliseconds.
Starts a new delay and returns a Future that completes when either the timer expires.
The returned future also implements [Stream] if this delay is Periodic.
When dropped, this future will attempt to cancel the current delay.