[][src]Struct futures_ticker::Ticker

pub struct Ticker { /* fields omitted */ }

Yields the current time in regular intervals.

Tickers are an asynchronous notification mechanism which deliver the "current" time in regular intervals (a "tick"). In case any ticks were missed, they will be skipped, and only the nearest upcoming tick is delivered.

Implementations

impl Ticker[src]

pub fn new(interval: Duration) -> Ticker[src]

Constructs a ticker that goes off once per interval. It is scheduled to deliver the first tick at interval from now.

pub fn new_with_next(interval: Duration, first_in: Duration) -> Ticker[src]

Constructs a ticker that goes off once per interval. The first tick is scheduled to arrive after first_in elapses.

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

Returns the next Instant at which the Ticker will be ready.

pub fn next_tick_from(&self, now: Instant) -> Instant[src]

Answers the hypothetical question, "at Instant now, when would the next tick go off?"

This function is useful mainly for tests. Use Ticker::next_tick for real use cases instead.

Trait Implementations

impl Stream for Ticker[src]

type Item = Instant

Values yielded by the stream.

Auto Trait Implementations

impl !RefUnwindSafe for Ticker

impl Send for Ticker

impl Sync for Ticker

impl Unpin for Ticker

impl !UnwindSafe for Ticker

Blanket Implementations

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

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

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

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

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

impl<T> StreamExt for T where
    T: Stream + ?Sized
[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.