pub struct RestartTracker { /* private fields */ }Implementations§
Source§impl RestartTracker
impl RestartTracker
pub fn new(policy: RestartPolicy) -> Self
pub fn started(&mut self, _at: Duration) -> Generation
pub fn exited(&mut self, generation: Generation, at: Duration) -> RestartOutcome
pub fn request_restart(&mut self, at: Duration) -> RestartOutcome
Sourcepub fn ready(&mut self, generation: Generation)
pub fn ready(&mut self, generation: Generation)
The running generation reported ready: the consecutive-failure count restarts from zero
and, when the policy says so (RestartPolicy::with_reset_budget_on_ready), so does the
rolling budget. A stale generation changes nothing.
Sourcepub fn consecutive_failures(&self) -> u32
pub fn consecutive_failures(&self) -> u32
Restarts granted in a row since the last Self::ready (diagnostics).
Sourcepub fn restarts_in_window(&self, at: Duration) -> u32
pub fn restarts_in_window(&self, at: Duration) -> u32
Restarts granted inside the rolling window ending at at (diagnostics).
Sourcepub fn reset_budget(&mut self)
pub fn reset_budget(&mut self)
Forget the restart budget (a user-initiated start after a terminal stop).
pub fn permit_valid(&self, permit: &RestartPermit, at: Duration) -> bool
pub fn shutdown(&mut self)
Trait Implementations§
Source§impl Clone for RestartTracker
impl Clone for RestartTracker
Auto Trait Implementations§
impl Freeze for RestartTracker
impl RefUnwindSafe for RestartTracker
impl Send for RestartTracker
impl Sync for RestartTracker
impl Unpin for RestartTracker
impl UnsafeUnpin for RestartTracker
impl UnwindSafe for RestartTracker
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