pub struct Counters { /* private fields */ }Expand description
The §6.4 state machine: one kind-tagged window plus a reported (not thresholded) respawn counter.
Implementations§
Source§impl Counters
impl Counters
Sourcepub fn record_failure(
&self,
kind: FailureKind,
limits: &LimitsSection,
) -> Option<QuarantineReason>
pub fn record_failure( &self, kind: FailureKind, limits: &LimitsSection, ) -> Option<QuarantineReason>
Records a window-counted failure: push now(), drop entries
older than the window, trip quarantine at the threshold. A
success (any well-formed reply) clears the deque — the failures
are consecutive by definition (§6.4).
Sourcepub fn record_success(&self)
pub fn record_success(&self)
A well-formed reply clears the consecutive-failure window.
Sourcepub fn record_restart(&self) -> u64
pub fn record_restart(&self) -> u64
Counts an actual respawn — reported, never thresholded (§6.4).
pub fn restarts(&self) -> u64
pub fn window_len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Counters
impl Forget for Counters
impl Move for Counters
impl RefUnwindSafe for Counters
impl Send for Counters
impl Sync for Counters
impl Unpin for Counters
impl UnsafeUnpin for Counterswhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Instant, FailureKind)>: UnsafeUnpin,
Align8<u64>: UnsafeUnpin,
impl UnwindSafe for Counters
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