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>) -> Self
pub fn healthy(name: impl Into<String>) -> Self
Create a healthy report for the named component.
Sourcepub fn degraded(name: impl Into<String>, msg: impl Into<String>) -> Self
pub fn degraded(name: impl Into<String>, msg: impl Into<String>) -> Self
Create a degraded report with an explanatory message.
Sourcepub fn unhealthy(name: impl Into<String>, msg: impl Into<String>) -> Self
pub fn unhealthy(name: impl Into<String>, msg: impl Into<String>) -> Self
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§
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