pub struct HealthChecker { /* private fields */ }Expand description
Health checker for system and component health monitoring
Implementations§
Source§impl HealthChecker
impl HealthChecker
Sourcepub fn with_config(config: HealthConfig) -> Self
pub fn with_config(config: HealthConfig) -> Self
Create a new health checker with configuration
Sourcepub async fn initialize(&mut self) -> Result<(), HealthError>
pub async fn initialize(&mut self) -> Result<(), HealthError>
Initialize the health checker
Sourcepub async fn shutdown(&mut self) -> Result<(), HealthError>
pub async fn shutdown(&mut self) -> Result<(), HealthError>
Shutdown the health checker
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the system is initialized
Sourcepub async fn add_health_check(
&self,
name: String,
health_check: HealthCheck,
) -> Result<(), HealthError>
pub async fn add_health_check( &self, name: String, health_check: HealthCheck, ) -> Result<(), HealthError>
Add a health check
Sourcepub async fn remove_health_check(&self, name: &str) -> Result<(), HealthError>
pub async fn remove_health_check(&self, name: &str) -> Result<(), HealthError>
Remove a health check
Sourcepub async fn run_health_check(
&self,
name: &str,
) -> Result<HealthCheckResult, HealthError>
pub async fn run_health_check( &self, name: &str, ) -> Result<HealthCheckResult, HealthError>
Run a specific health check
Sourcepub async fn check_all(&self) -> Result<Vec<HealthCheckResult>, HealthError>
pub async fn check_all(&self) -> Result<Vec<HealthCheckResult>, HealthError>
Run all health checks
Sourcepub async fn get_health_check_result(
&self,
name: &str,
) -> Result<Option<HealthCheckResult>, HealthError>
pub async fn get_health_check_result( &self, name: &str, ) -> Result<Option<HealthCheckResult>, HealthError>
Get health check result
Sourcepub async fn get_all_results(
&self,
) -> Result<HashMap<String, HealthCheckResult>, HealthError>
pub async fn get_all_results( &self, ) -> Result<HashMap<String, HealthCheckResult>, HealthError>
Get all health check results
Sourcepub async fn get_system_health(&self) -> Result<SystemHealth, HealthError>
pub async fn get_system_health(&self) -> Result<SystemHealth, HealthError>
Get overall system health
Trait Implementations§
Source§impl Clone for HealthChecker
impl Clone for HealthChecker
Source§fn clone(&self) -> HealthChecker
fn clone(&self) -> HealthChecker
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 HealthChecker
impl !RefUnwindSafe for HealthChecker
impl Send for HealthChecker
impl Sync for HealthChecker
impl Unpin for HealthChecker
impl !UnwindSafe for HealthChecker
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