Skip to main content

AddHealthCheckServiceExt

Trait AddHealthCheckServiceExt 

Source
pub trait AddHealthCheckServiceExt {
    // Required methods
    fn add_health_check_service<T>(&mut self) -> &mut Self
       where T: Service<Handle = Arc<T>> + HealthCheck + 'static;
    fn has_health_check_service<T>(&self) -> bool
       where T: Service<Handle = Arc<T>> + HealthCheck + 'static;
}
Expand description

Registers health checks resolved from the dependency-injection container.

The check type T is a Service, built by the container and registered as a HealthCheck. The service is added automatically if not already present.

Required Methods§

Source

fn add_health_check_service<T>(&mut self) -> &mut Self
where T: Service<Handle = Arc<T>> + HealthCheck + 'static,

Registers the Service T as a health check on the control server.

§Panics

Panics if T is already registered as a health-check service. Building the App additionally panics if T is registered both as a service and as an instance via AddHealthCheckExt::add_health_check.

Source

fn has_health_check_service<T>(&self) -> bool
where T: Service<Handle = Arc<T>> + HealthCheck + 'static,

Returns whether T is registered as a health-check service.

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 AddHealthCheckServiceExt for AppBuilder

Source§

fn add_health_check_service<T>(&mut self) -> &mut Self
where T: Service<Handle = Arc<T>> + HealthCheck + 'static,

Source§

fn has_health_check_service<T>(&self) -> bool
where T: Service<Handle = Arc<T>> + HealthCheck + 'static,

Implementors§