pub struct TimerState { /* private fields */ }Expand description
State for the countdown timer.
Implementations§
Source§impl TimerState
impl TimerState
Sourcepub fn new(duration: Duration) -> Self
pub fn new(duration: Duration) -> Self
Creates a new timer with the given countdown duration, initially stopped.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the timer to its original duration. Does not change running state.
Sourcepub fn set_duration(&mut self, duration: Duration)
pub fn set_duration(&mut self, duration: Duration)
Sets a new countdown duration and resets remaining time.
Trait Implementations§
Source§impl Clone for TimerState
impl Clone for TimerState
Source§fn clone(&self) -> TimerState
fn clone(&self) -> TimerState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TimerState
impl RefUnwindSafe for TimerState
impl Send for TimerState
impl Sync for TimerState
impl Unpin for TimerState
impl UnwindSafe for TimerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more