Skip to main content

limes_proto/
lock.rs

1use std::fmt;
2
3/// Lock state as understood by UI frontends.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum LockState {
6    Unlocked,
7    Locking,
8    Locked,
9    Unlocking,
10}
11
12impl fmt::Display for LockState {
13    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14        match self {
15            Self::Unlocked => f.write_str("unlocked"),
16            Self::Locking => f.write_str("locking"),
17            Self::Locked => f.write_str("locked"),
18            Self::Unlocking => f.write_str("unlocking"),
19        }
20    }
21}