pub struct ReactiveHealthCheck { /* private fields */ }
Expand description
Basic implementation of CheckHealth
trait that can be updated using a matching HealthUpdater
.
Implementations§
Source§impl ReactiveHealthCheck
impl ReactiveHealthCheck
Sourcepub fn new(name: &'static str) -> (Self, HealthUpdater)
pub fn new(name: &'static str) -> (Self, HealthUpdater)
Creates a health check together with an updater that can be used to update it.
The check will return HealthStatus::NotReady
initially.
Sourcepub async fn wait_for(
&mut self,
condition: impl FnMut(&Health) -> bool,
) -> Health
pub async fn wait_for( &mut self, condition: impl FnMut(&Health) -> bool, ) -> Health
Waits until the specified condition
is true for the tracked Health
, and returns health.
Mostly useful for testing.
If the health updater associated with this check is dropped, this method can wait indefinitely.
Trait Implementations§
Source§impl CheckHealth for ReactiveHealthCheck
impl CheckHealth for ReactiveHealthCheck
Source§impl Clone for ReactiveHealthCheck
impl Clone for ReactiveHealthCheck
Source§fn clone(&self) -> ReactiveHealthCheck
fn clone(&self) -> ReactiveHealthCheck
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ReactiveHealthCheck
impl !RefUnwindSafe for ReactiveHealthCheck
impl Send for ReactiveHealthCheck
impl Sync for ReactiveHealthCheck
impl Unpin for ReactiveHealthCheck
impl !UnwindSafe for ReactiveHealthCheck
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more