pub struct ProbeState {
pub liveness_failures: u32,
pub readiness_failures: u32,
pub readiness_successes: u32,
pub is_live: bool,
pub is_ready: bool,
}Expand description
Tracks consecutive probe results for threshold-based decisions.
Fields§
§liveness_failures: u32Consecutive liveness failures.
readiness_failures: u32Consecutive readiness failures.
readiness_successes: u32Consecutive readiness successes (for recovery).
is_live: boolWhether the service is currently considered live.
is_ready: boolWhether the service is currently considered ready.
Implementations§
Source§impl ProbeState
impl ProbeState
Sourcepub fn record_liveness(
&mut self,
result: &ProbeResult,
config: &ProbeConfig,
) -> bool
pub fn record_liveness( &mut self, result: &ProbeResult, config: &ProbeConfig, ) -> bool
Record a liveness probe result.
Returns true if the service should be restarted (failures >= threshold).
Sourcepub fn record_readiness(
&mut self,
result: &ProbeResult,
config: &ProbeConfig,
) -> Option<bool>
pub fn record_readiness( &mut self, result: &ProbeResult, config: &ProbeConfig, ) -> Option<bool>
Record a readiness probe result.
Returns the readiness state change:
Some(false)if service should be removed from registrySome(true)if service should be re-added (recovered)Noneif no state change
Trait Implementations§
Source§impl Clone for ProbeState
impl Clone for ProbeState
Source§impl Debug for ProbeState
impl Debug for ProbeState
Auto Trait Implementations§
impl Freeze for ProbeState
impl RefUnwindSafe for ProbeState
impl Send for ProbeState
impl Sync for ProbeState
impl Unpin for ProbeState
impl UnsafeUnpin for ProbeState
impl UnwindSafe for ProbeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more