[][src]Struct time_me::Timer

pub struct Timer { /* fields omitted */ }

used to build a timer with different options: progress bar, duration, and notification

Implementations

impl Timer[src]

pub fn builder() -> TimerBuilder<((), (), (), ())>[src]

Create a builder for building Timer. On the builder, call .progress_bar_style(...)(optional), .duration(...)(optional), .task(...)(optional), .sticky_notification(...)(optional) to set the values of the fields (they accept Into values). Finally, call .build() to create the instance of Timer.

impl Timer[src]

pub fn start(&self)[src]

starts the timer this will show a progress bar while running a notification will be sent out after timer finishes

Example


Timer::builder()
    .duration(Duration::from_secs(1))
    .build()
    .start()
// waits 1 second
// sends "time!" -> notification

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.