pub struct HealthState {
pub status: HealthStatus,
pub consecutive_successes: u32,
pub consecutive_failures: u32,
}Fields§
§status: HealthStatus§consecutive_successes: u32§consecutive_failures: u32Implementations§
Source§impl HealthState
impl HealthState
Sourcepub fn record_success(&mut self, healthy_threshold: u32) -> bool
pub fn record_success(&mut self, healthy_threshold: u32) -> bool
Record a successful health check. Returns true if the backend transitioned to healthy.
Sourcepub fn record_failure(&mut self, unhealthy_threshold: u32) -> bool
pub fn record_failure(&mut self, unhealthy_threshold: u32) -> bool
Record a failed health check. Returns true if the backend transitioned to unhealthy.
pub fn is_healthy(&self) -> bool
Trait Implementations§
Source§impl Clone for HealthState
impl Clone for HealthState
Source§fn clone(&self) -> HealthState
fn clone(&self) -> HealthState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealthState
impl Debug for HealthState
Source§impl Default for HealthState
impl Default for HealthState
Source§impl PartialEq for HealthState
impl PartialEq for HealthState
Source§fn eq(&self, other: &HealthState) -> bool
fn eq(&self, other: &HealthState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HealthState
Auto Trait Implementations§
impl Freeze for HealthState
impl RefUnwindSafe for HealthState
impl Send for HealthState
impl Sync for HealthState
impl Unpin for HealthState
impl UnsafeUnpin for HealthState
impl UnwindSafe for HealthState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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