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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HealthResponse
impl Debug for HealthResponse
Source§impl<'de> Deserialize<'de> for HealthResponse
impl<'de> Deserialize<'de> for HealthResponse
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 PartialEq for HealthResponse
impl PartialEq for HealthResponse
Source§impl Serialize for HealthResponse
impl Serialize for HealthResponse
impl StructuralPartialEq for HealthResponse
Auto Trait Implementations§
impl Freeze for HealthResponse
impl RefUnwindSafe for HealthResponse
impl Send for HealthResponse
impl Sync for HealthResponse
impl Unpin for HealthResponse
impl UnsafeUnpin for HealthResponse
impl UnwindSafe for HealthResponse
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