pub struct Health {
pub name: String,
pub status: HealthStatus,
pub message: Option<String>,
}Expand description
Health report from a single component.
Fields§
§name: StringComponent name as returned by crate::Component::name.
status: HealthStatusOverall health status of the component.
message: Option<String>Optional human-readable explanation for non-healthy status.
Implementations§
Source§impl Health
impl Health
Sourcepub fn healthy(name: impl Into<String>) -> Health
pub fn healthy(name: impl Into<String>) -> Health
Create a healthy report for the named component.
Sourcepub fn degraded(name: impl Into<String>, msg: impl Into<String>) -> Health
pub fn degraded(name: impl Into<String>, msg: impl Into<String>) -> Health
Create a degraded report with an explanatory message.
Sourcepub fn unhealthy(name: impl Into<String>, msg: impl Into<String>) -> Health
pub fn unhealthy(name: impl Into<String>, msg: impl Into<String>) -> Health
Create an unhealthy report with an explanatory message.
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Returns true if the status is HealthStatus::Healthy.
Trait Implementations§
Source§impl Serialize for Health
impl Serialize for Health
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Health
Auto Trait Implementations§
impl Freeze for Health
impl RefUnwindSafe for Health
impl Send for Health
impl Sync for Health
impl Unpin for Health
impl UnsafeUnpin for Health
impl UnwindSafe for Health
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