climer/timer/state.rs
1#[derive(Clone, PartialEq, Eq)]
2pub enum TimerState {
3 Stopped,
4 Running,
5 Paused,
6 Finished,
7}
8
9impl TimerState {
10 pub fn is_stopped(&self) -> bool {
11 *self == TimerState::Stopped
12 }
13
14 pub fn is_running(&self) -> bool {
15 *self == TimerState::Running
16 }
17
18 pub fn is_paused(&self) -> bool {
19 *self == TimerState::Paused
20 }
21
22 pub fn is_finished(&self) -> bool {
23 *self == TimerState::Finished
24 }
25}