[−][src]Struct clock_cli::core::stopwatch::StopWatch
A stopwatch that mimics iOS's stopwatch
ⓘThis example is not tested
lap lap lap
start start | | start |
o--------x o-----------x o-----------x
pause pause pause(end)Fields
elapsed: Durationlap_elapsed: Durationpause_moments: Vec<DateTime<Local>>start_moments: Vec<DateTime<Local>>lap_moments: Vec<DateTime<Local>>laps: Vec<Duration>paused: boolImplementations
impl StopWatch[src]
pub fn new() -> Self[src]
Returns stopwatch reset to zero
pub fn last_start(&self) -> DateTime<Local>[src]
pub fn last_lap(&self) -> DateTime<Local>[src]
pub fn pause(&mut self)[src]
pub fn resume(&mut self)[src]
pub fn pause_or_resume(&mut self)[src]
pub fn lap(&mut self) -> Option<Duration>[src]
pub fn read(&self) -> Duration[src]
Read the total time elapsed
pub fn read_lap_elapsed(&self, moment: DateTime<Local>) -> Duration[src]
Read the time elapsed in the current lap
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for StopWatch
impl Send for StopWatch
impl Sync for StopWatch
impl Unpin for StopWatch
impl UnwindSafe for StopWatch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Erased for T
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.