[][src]Struct health::PeriodicChecker

pub struct PeriodicChecker<C> { /* fields omitted */ }

A health reporter that periodically updates its status based on the result an underlying Checkable resource

Implementations

impl<C: Checkable> PeriodicChecker<C>[src]

pub fn new(checkable: C, config: Config) -> Self[src]

Creates a new health check for the Checkable resource

pub async fn run(self) -> ![src]

Begins the health check loop and never returns

This function consumes the checker and begins executing periodic checks on the underlying Checkable. The returned Future should not be .awaited, as it never completes. Instead, the Future should be spawned onto an executor, which will continuously poll the Future and drive it to work.

As this function consumes the PeriodicChecker<C>, it will be cloned prior to being passed in so that it can also be passed to some sort of reporting function.

Trait Implementations

impl<C> Clone for PeriodicChecker<C>[src]

impl<C> Debug for PeriodicChecker<C>[src]

impl<C: Checkable> Reporter for PeriodicChecker<C>[src]

fn raw_status(&self) -> Status[src]

The current health status without consideration for when the health status was last updated

fn status(&self) -> Option<Status>[src]

The current health status or None if the health check hasn't updated its internal state within the leeway time

fn last_check(&self) -> Check[src]

The result of the most recent health check

Auto Trait Implementations

impl<C> !RefUnwindSafe for PeriodicChecker<C>

impl<C> Send for PeriodicChecker<C> where
    C: Send + Sync

impl<C> Sync for PeriodicChecker<C> where
    C: Send + Sync

impl<C> Unpin for PeriodicChecker<C>

impl<C> !UnwindSafe for PeriodicChecker<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.