use serde::{Deserialize, Serialize};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum ServiceMode {
#[default]
Normal,
Independent,
Inspection,
Manual,
}
impl ServiceMode {
#[must_use]
pub const fn is_dispatch_excluded(self) -> bool {
matches!(self, Self::Independent | Self::Manual)
}
}
impl std::fmt::Display for ServiceMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Normal => write!(f, "Normal"),
Self::Independent => write!(f, "Independent"),
Self::Inspection => write!(f, "Inspection"),
Self::Manual => write!(f, "Manual"),
}
}
}