Skip to main content

HealthCheck

Trait HealthCheck 

Source
pub trait HealthCheck: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = HealthResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn timeout(&self) -> Duration { ... }
    fn is_critical(&self) -> bool { ... }
}
Expand description

Individual health check trait

Required Methods§

Source

fn name(&self) -> &str

Name of this health check

Source

fn check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = HealthResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform the health check

Provided Methods§

Source

fn timeout(&self) -> Duration

Get the timeout for this health check

Source

fn is_critical(&self) -> bool

Check if this health check is critical for overall system health

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§