pub struct HealthResponse {
pub schema_version: u16,
pub state: ReadinessState,
pub category: Option<HealthCategory>,
pub message: Option<String>,
pub snapshot: Option<StatusSnapshot>,
}Expand description
Health and readiness response served by the daemon.
The Ready variant carries a fresh snapshot. The other variants carry a
short human-readable message and a HealthCategory; they never include
filesystem paths, internal error chains, or platform-private structures.
Fields§
§schema_version: u16Daemon schema version, always
crate::SCHEMA_VERSION_V1.
state: ReadinessStateCurrent readiness state.
category: Option<HealthCategory>Coarse category for non-ready responses. None when state == Ready.
message: Option<String>Short human-readable message. Never includes filesystem paths or internal error chains.
snapshot: Option<StatusSnapshot>Cached snapshot, present only when state == Ready.
Implementations§
Source§impl HealthResponse
impl HealthResponse
Sourcepub fn ready(snapshot: StatusSnapshot) -> Self
pub fn ready(snapshot: StatusSnapshot) -> Self
A Ready response wrapping the supplied snapshot.
Callers must validate snapshot before constructing a ready response.
Sourcepub fn warming_with_message(message: impl Into<String>) -> Self
pub fn warming_with_message(message: impl Into<String>) -> Self
A Warming response with a custom message.
Sourcepub fn failed(category: HealthCategory, message: impl Into<String>) -> Self
pub fn failed(category: HealthCategory, message: impl Into<String>) -> Self
A Failed response with the given category and message.
Trait Implementations§
Source§impl Clone for HealthResponse
impl Clone for HealthResponse
Source§fn clone(&self) -> HealthResponse
fn clone(&self) -> HealthResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more