[][src]Struct climer::timer::Timer

pub struct Timer {
    pub running: bool,
    pub finished: bool,
    // some fields omitted
}

Fields

running: boolfinished: bool

Methods

impl Timer[src]

pub fn builder() -> TimerBuilder[src]

Returns a new TimerBuilder.

pub fn new<T, U>(
    time: T,
    format: Option<U>,
    output: Option<Output>
) -> ClimerResult<Self> where
    T: ToString,
    U: ToString
[src]

Create a new Timer with the given time (string) and optional format (string) and output (Output).

pub fn run(&mut self) -> ClimerResult[src]

Run the timer. This will lock the current thread until the time is up. If you want to update the timer yourself somewhere else, then don't call this method, instead call the update method to update the timer.

pub fn start(&mut self) -> ClimerResult[src]

Start the timer. Do not call this method directly if you are using the run method. Only call this method if you intend to update the timer manually by calling the update method.

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

Stops the timer, after it has been started using the start method.

pub fn update(&mut self) -> ClimerResult[src]

Updates the timer. This will also attempt to write the remaining time to stdout or to a file, using the Output of this Timer.

pub fn time_output(&self) -> Time[src]

Returns a Time with the passed time since the timer started.

Auto Trait Implementations

impl Sync for Timer

impl Unpin for Timer

impl Send for Timer

impl UnwindSafe for Timer

impl RefUnwindSafe for Timer

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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