pub struct HealthResponseV2 {
pub schema_version: u16,
pub state: ReadinessState,
pub category: Option<HealthCategory>,
pub message: Option<String>,
pub snapshot: Option<StatusSnapshotV2>,
}Expand description
Health and readiness response for schema version 2.
Fields§
§schema_version: u16Daemon schema version, always SCHEMA_VERSION_V2.
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<StatusSnapshotV2>Cached v2 snapshot, present only when state == Ready.
Implementations§
Source§impl HealthResponseV2
impl HealthResponseV2
Sourcepub fn ready(snapshot: StatusSnapshotV2) -> Self
pub fn ready(snapshot: StatusSnapshotV2) -> Self
A Ready response wrapping the supplied v2 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 HealthResponseV2
impl Clone for HealthResponseV2
Source§fn clone(&self) -> HealthResponseV2
fn clone(&self) -> HealthResponseV2
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 HealthResponseV2
impl Debug for HealthResponseV2
Source§impl<'de> Deserialize<'de> for HealthResponseV2
impl<'de> Deserialize<'de> for HealthResponseV2
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 HealthResponseV2
impl PartialEq for HealthResponseV2
Source§impl Serialize for HealthResponseV2
impl Serialize for HealthResponseV2
impl StructuralPartialEq for HealthResponseV2
Auto Trait Implementations§
impl Freeze for HealthResponseV2
impl RefUnwindSafe for HealthResponseV2
impl Send for HealthResponseV2
impl Sync for HealthResponseV2
impl Unpin for HealthResponseV2
impl UnsafeUnpin for HealthResponseV2
impl UnwindSafe for HealthResponseV2
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