[−][src]Struct clock_core::timer::Timer
A countdown timer
Fields
paused: bool
data: 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(&mut self)
[src]
Pause the timer (suggest using pause_or_resume
instead.)
pub fn resume(&mut self)
[src]
Resume the timer (suggest using pause_or_resume
instead.)
pub fn stop(&mut self) -> TimerData
[src]
Stop the timer, return the data, and reset the timer with the previously set duration.
Trait Implementations
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]
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> 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>,