pub struct HealthCheck { /* private fields */ }Expand description
Health check aggregator
Implementations§
Source§impl HealthCheck
impl HealthCheck
Sourcepub fn register_component(&self, name: impl Into<String>, status: HealthStatus)
pub fn register_component(&self, name: impl Into<String>, status: HealthStatus)
Register a component health status
Sourcepub fn register_component_with_message(
&self,
name: impl Into<String>,
status: HealthStatus,
message: Option<String>,
)
pub fn register_component_with_message( &self, name: impl Into<String>, status: HealthStatus, message: Option<String>, )
Register a component with message
Sourcepub fn get_status(&self) -> HealthStatus
pub fn get_status(&self) -> HealthStatus
Get overall health status
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if service is healthy
Sourcepub fn export_json(&self) -> Value
pub fn export_json(&self) -> Value
Export health status as JSON
Sourcepub fn get_component(&self, name: &str) -> Option<ComponentHealth>
pub fn get_component(&self, name: &str) -> Option<ComponentHealth>
Get component health
Sourcepub fn remove_component(&self, name: &str)
pub fn remove_component(&self, name: &str)
Remove component
Trait Implementations§
Source§impl Clone for HealthCheck
impl Clone for HealthCheck
Source§fn clone(&self) -> HealthCheck
fn clone(&self) -> HealthCheck
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HealthCheck
impl !RefUnwindSafe for HealthCheck
impl Send for HealthCheck
impl Sync for HealthCheck
impl Unpin for HealthCheck
impl !UnwindSafe for HealthCheck
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