Struct wasm_timer::Interval[][src]

pub struct Interval { /* fields omitted */ }

A stream representing notifications at fixed interval

Intervals are created through the Interval::new or Interval::new_at methods indicating when a first notification should be triggered and when it will be repeated.

Note that intervals are not intended for high resolution timers, but rather they will likely fire some granularity after the exact instant that they’re otherwise indicated to fire at.

Implementations

impl Interval[src]

pub fn new(dur: Duration) -> Interval[src]

Creates a new interval which will fire at dur time into the future, and will repeat every dur interval after

The returned object will be bound to the default timer for this thread. The default timer will be spun up in a helper thread on first use.

pub fn new_at(at: Instant, dur: Duration) -> Interval[src]

Creates a new interval which will fire at the time specified by at, and then will repeat every dur interval after

The returned object will be bound to the default timer for this thread. The default timer will be spun up in a helper thread on first use.

pub fn new_handle(at: Instant, dur: Duration, handle: TimerHandle) -> Interval[src]

Creates a new interval which will fire at the time specified by at, and then will repeat every dur interval after

The returned object will be bound to the timer specified by handle.

Trait Implementations

impl Debug for Interval[src]

impl Stream for Interval[src]

type Item = ()

Values yielded by the stream.

Auto Trait Implementations

impl !RefUnwindSafe for Interval

impl Send for Interval

impl Sync for Interval

impl Unpin for Interval

impl !UnwindSafe for Interval

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.