[][src]Struct clock_core::timer::Timer

pub struct Timer {
    pub paused: bool,
    pub data: TimerData,
}

A countdown timer

Fields

paused: booldata: TimerData

Implementations

impl Timer[src]

pub fn new(duration: Duration) -> Self[src]

Returns stopwatch reset to zero

pub fn read(&self) -> Duration[src]

Read the timer. Returns the duration passed.

pub fn pause_or_resume(&mut self)[src]

Pause or resume the timer. (If paused, resume, and vice versa.)

pub fn pause_or_resume_at(&mut self, moment: DateTime<Local>)[src]

pub fn pause(&mut self)[src]

Pause the timer (suggest using pause_or_resume instead.)

pub fn pause_at(&mut self, moment: DateTime<Local>)[src]

pub fn resume(&mut self)[src]

Resume the timer (suggest using pause_or_resume instead.)

pub fn resume_at(&mut self, moment: DateTime<Local>)[src]

pub fn stop(&mut self) -> TimerData[src]

Stop the timer, return the data, and reset the timer with the previously set duration.

pub fn stop_at(&mut self, moment: DateTime<Local>) -> TimerData[src]

Trait Implementations

impl Clone for Timer[src]

impl Debug for Timer[src]

Auto Trait Implementations

impl RefUnwindSafe for Timer

impl Send for Timer

impl Sync for Timer

impl Unpin for Timer

impl UnwindSafe for Timer

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.