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
Auto Trait Implementations§
impl Forget for TimerState
impl Freeze for TimerState
impl Move for TimerState
impl RefUnwindSafe for TimerState
impl Send for TimerState
impl Sync for TimerState
impl Unpin for TimerState
impl UnsafeUnpin 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