[][src]Struct tokio_timer::Delay

pub struct Delay { /* fields omitted */ }

A future that completes at a specified instant in time.

Instances of Delay perform no work and complete with () once the specified deadline has been reached.

Delay has a resolution of one millisecond and should not be used for tasks that require high-resolution timers.

Cancellation

Canceling a Delay is done by dropping the value. No additional cleanup or other work is required.

Methods

impl Delay[src]

pub fn deadline(&self) -> Instant[src]

Returns the instant at which the future will complete.

pub fn is_elapsed(&self) -> bool[src]

Returns true if the Delay has elapsed

A Delay is elapsed when the requested duration has elapsed.

pub fn reset(&mut self, deadline: Instant)[src]

Reset the Delay instance to a new deadline.

Calling this function allows changing the instant at which the Delay future completes without having to create new associated state.

This function can be called both before and after the future has completed.

Trait Implementations

impl Debug for Delay[src]

impl Future for Delay[src]

type Output = ()

The type of value produced on completion.

impl FusedFuture for Delay[src]

Auto Trait Implementations

impl Send for Delay

impl Unpin for Delay

impl Sync for Delay

impl !UnwindSafe for Delay

impl !RefUnwindSafe for Delay

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]