[−][src]Struct async_timer::delay::Delay
Future that resolves sometime in future
Implementation notes
When Future is created, timer is not yet started.
The actual timer will start only after future will be initally polled.
After timer expires, executor will be notified and next call to Future::poll shall
return Ready, after which all further calls to Future::poll result in Pending
without restarting timer.
Usage
use async_timer::Delay; use core::time; Delay::platform_new(time::Duration::from_secs(2));
Methods
impl Delay[src]
pub fn platform_new(timeout: Duration) -> Self[src]
Creates new instance using PlatformTimer
impl<T: Timer> Delay<T>[src]
pub fn new(timeout: Duration) -> Self[src]
Creates new instance with specified timeout
Requires to specify Timer type (e.g. Delay::<PlatformTimer>::new())
pub fn restart(&mut self, ctx: &Context)[src]
Restarts underlying Timer.
Comparing to creating Delay
the Timer will start counting immediately.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,