Skip to main content

Healthcheck

Trait Healthcheck 

Source
pub trait Healthcheck:
    Send
    + Sync
    + 'static {
    // Required method
    fn name(&self) -> &'static str;

    // Provided method
    fn check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = HealthcheckResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Readiness probe implemented by a gear.

name must be an explicit human-readable id (no type paths); it is exposed on /health. check must be cancellation-safe and should not leak secrets in its message (the registry sanitises anyway); panics and per-check timeouts are caught and mapped to HealthcheckStatus::Unhealthy. Default check returns healthy.

Required Methods§

Source

fn name(&self) -> &'static str

Human-readable check name, exposed verbatim in /health JSON.

Provided Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§