Skip to main content

AddHealthCheckExt

Trait AddHealthCheckExt 

Source
pub trait AddHealthCheckExt {
    // Required methods
    fn add_health_check<T>(&self, health_check: impl Into<Arc<T>>)
       where T: HealthCheck + 'static;
    fn has_health_check<T>(&self) -> bool
       where T: HealthCheck + 'static;
}
Expand description

Registers concrete HealthCheck instances on the control server.

Lives on AppContext, so checks can be registered while configuring the AppBuilder or from within a plugin’s build. A check is identified by its type and is only ever run if ControlServerPlugin is added (it provides the registry and the HealthRouter that drives the checks).

Required Methods§

Source

fn add_health_check<T>(&self, health_check: impl Into<Arc<T>>)
where T: HealthCheck + 'static,

Registers health_check on the control server.

§Panics

Panics if a health check of type T is already registered. Guard with has_health_check when the same type may be registered more than once; to run several checks of the same kind, make the type itself aggregate them.

Source

fn has_health_check<T>(&self) -> bool
where T: HealthCheck + 'static,

Returns whether a health check of type T is registered.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AddHealthCheckExt for AppContext

Source§

fn add_health_check<T>(&self, health_check: impl Into<Arc<T>>)
where T: HealthCheck + 'static,

Source§

fn has_health_check<T>(&self) -> bool
where T: HealthCheck + 'static,

Implementors§