[][src]Trait health::Checkable

pub trait Checkable: Send + Sync + 'static {
    type Error: StdError + Send + Sync + 'static;
#[must_use]    fn check<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn name(&self) -> Cow<'_, str>; }

A resource whose health can be checked

Associated Types

type Error: StdError + Send + Sync + 'static

The error reported on a failed health check

Loading content...

Required methods

#[must_use]fn check<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

The action run to check the current health of the element

Ok(()) is interpreted as a passing result. Any Err(_) is interpreted as a failure.

fn name(&self) -> Cow<'_, str>

An identifier for the resource

Loading content...

Implementors

impl<F, E> Checkable for FnCheck<F> where
    F: Fn() -> Result<(), E> + Send + Sync + 'static,
    E: StdError + Send + Sync + 'static, 
[src]

type Error = E

impl<F, X, E> Checkable for FutureCheck<F> where
    F: Fn() -> X + Send + Sync + 'static,
    X: Future<Output = Result<(), E>> + Send + Sync + 'static,
    E: StdError + Send + Sync + 'static, 
[src]

type Error = E

Loading content...