pub enum ServiceState {
Inactive,
Blocked {
waiting_on: Vec<String>,
},
Starting {
pid: u32,
},
Running {
pid: u32,
},
Stopping {
pid: u32,
},
Exited {
exit_code: Option<i32>,
},
Failed {
reason: FailureReason,
},
}Expand description
The state of a service in the supervisor.
Variants§
Inactive
Service has never been started.
Blocked
Service is waiting on dependencies.
Starting
Process has been spawned, waiting for health check or startup.
Running
Process is running and healthy.
Stopping
SIGTERM sent, waiting for process to exit.
Exited
Process exited cleanly.
Failed
Process failed.
Fields
§
reason: FailureReasonImplementations§
Source§impl ServiceState
impl ServiceState
Sourcepub fn is_satisfied(&self) -> bool
pub fn is_satisfied(&self) -> bool
Returns true if the service can satisfy a “requires” dependency. A service satisfies requires if it’s Running OR exited successfully (exit code 0). This allows oneshot services to satisfy dependencies after they complete.
Sourcepub fn can_attempt_start(&self) -> bool
pub fn can_attempt_start(&self) -> bool
Returns true if the service is in a state where start can be attempted. Note: Services that failed due to MissingDependency cannot be restarted because the dependency will never appear - it’s a permanent config error.
Trait Implementations§
Source§impl Clone for ServiceState
impl Clone for ServiceState
Source§fn clone(&self) -> ServiceState
fn clone(&self) -> ServiceState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceState
impl Debug for ServiceState
Source§impl Default for ServiceState
impl Default for ServiceState
Source§fn default() -> ServiceState
fn default() -> ServiceState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ServiceState
impl<'de> Deserialize<'de> for ServiceState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ServiceState
impl Display for ServiceState
Source§impl From<&ServiceState> for PersistedServiceState
impl From<&ServiceState> for PersistedServiceState
Source§fn from(state: &ServiceState) -> Self
fn from(state: &ServiceState) -> Self
Converts to this type from the input type.
Source§impl From<&ServiceState> for State
impl From<&ServiceState> for State
Source§fn from(state: &ServiceState) -> Self
fn from(state: &ServiceState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ServiceState
impl PartialEq for ServiceState
Source§impl Serialize for ServiceState
impl Serialize for ServiceState
impl Eq for ServiceState
impl StructuralPartialEq for ServiceState
Auto Trait Implementations§
impl Freeze for ServiceState
impl RefUnwindSafe for ServiceState
impl Send for ServiceState
impl Sync for ServiceState
impl Unpin for ServiceState
impl UnwindSafe for ServiceState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.