[][src]Enum act_zero::timer::TimerState

pub enum TimerState {
    Inactive,
    Timeout {
        deadline: Instant,
    },
    Interval {
        deadline: Instant,
        interval: Duration,
    },
}

Timers will be in one of these states.

Variants

Inactive

The timer is inactive. This is the default state.

Timeout

The timer is configured to tick once, when the deadline is reached.

Fields of Timeout

deadline: Instant

When this timer will tick

Interval

The timer is configured to tick when the deadline is reached, and to repeat at a set interval.

Fields of Interval

deadline: Instant

When this timer will next tick

interval: Duration

Interval between ticks.

Implementations

impl TimerState[src]

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

Returns the point in time when this timer will next fire, or None if the timer is currently inactive.

pub fn interval(&self) -> Option<Duration>[src]

Returns the interval between ticks if the timer is active and set to repeat.

Trait Implementations

impl Clone for TimerState[src]

impl Copy for TimerState[src]

impl Debug for TimerState[src]

impl Default for TimerState[src]

impl Eq for TimerState[src]

impl Hash for TimerState[src]

impl Ord for TimerState[src]

impl PartialEq<TimerState> for TimerState[src]

impl PartialOrd<TimerState> for TimerState[src]

impl StructuralEq for TimerState[src]

impl StructuralPartialEq for TimerState[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.