[−][src]Struct health::PeriodicChecker
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 .await
ed, as it never completes. Instead, the Future
should be spawn
ed 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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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,
C: Send + Sync,
impl<C> Sync for PeriodicChecker<C> where
C: Send + Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,