pub struct Timer { /* private fields */ }Expand description
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn remaining_percent(&self) -> u16
pub fn remaining_percent(&self) -> u16
Calculate the remaining time as a percentage
Sourcepub fn update(&mut self, elapsed: Duration, dead_man_duration: u64)
pub fn update(&mut self, elapsed: Duration, dead_man_duration: u64)
Update the timer logic for switching from TimerType::Warning to
TimerType::DeadMan.
Sourcepub fn reset(&mut self, config: &Config)
pub fn reset(&mut self, config: &Config)
Reset the timer and promotes the timer type from TimerType::DeadMan
to TimerType::Warning, if applicable.
This is called when the user checks in.
Trait Implementations§
impl StructuralPartialEq for Timer
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