Mountain/IPC/Common/ServiceInfo/ServiceState.rs
1
2//! Lifecycle state of a service. `IsOperational` covers the three
3//! states a caller can still send work to (Running / Degraded /
4//! Starting); the rest are terminal or transitional.
5
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
9pub enum Enum {
10 Running,
11
12 Degraded,
13
14 Stopped,
15
16 Error,
17
18 Starting,
19
20 ShuttingDown,
21}
22
23impl Enum {
24 pub fn IsOperational(&self) -> bool { matches!(self, Enum::Running | Enum::Degraded | Enum::Starting) }
25}