keyper/app/
state.rs

1/// Represents the application state.
2#[derive(Clone, Copy, Debug, Eq, PartialEq)]
3pub enum AppState {
4    Running,
5    Halted,
6}
7
8impl AppState {
9    /// Creates a new [AppState].
10    pub const fn new() -> Self {
11        Self::Running
12    }
13
14    /// Gets whether the [AppState] is running.
15    pub const fn is_running(&self) -> bool {
16        matches!(self, Self::Running)
17    }
18}
19
20impl Default for AppState {
21    fn default() -> Self {
22        Self::new()
23    }
24}