pub struct Timer {
pub paused: bool,
pub data: TimerData,
}
Expand description
A countdown timer
Fields§
§paused: bool
§data: TimerData
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn pause_or_resume(&mut self)
pub fn pause_or_resume(&mut self)
Pause or resume the timer. (If paused, resume, and vice versa.)
pub fn pause_or_resume_at(&mut self, moment: DateTime<Local>)
pub fn pause_at(&mut self, moment: DateTime<Local>)
pub fn resume_at(&mut self, moment: DateTime<Local>)
Sourcepub fn stop(&mut self) -> TimerData
pub fn stop(&mut self) -> TimerData
Stop the timer, return the data, and reset the timer with the previously set duration.
pub fn stop_at(&mut self, moment: DateTime<Local>) -> TimerData
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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