Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/Common/ServiceInfo/
ServiceState.rs

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