1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::fmt;
use serde::{Deserialize, Serialize};

#[derive(PartialEq, PartialOrd, Copy, Clone, Debug, Serialize, Deserialize)]
#[repr(u32)]
pub enum WorkerState {
    Unassigned = 1,
    Assigned = 2,
    Inactive = 3,
    Active = 4,
}

impl fmt::Display for WorkerState {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", format!("{:?}", self).to_lowercase())
    }
}