pub struct RestartPolicy { /* private fields */ }Implementations§
Source§impl RestartPolicy
impl RestartPolicy
Sourcepub fn with_consecutive_failures(
self,
cap: u32,
cooldown: Duration,
) -> Result<Self, InvalidRestartPolicy>
pub fn with_consecutive_failures( self, cap: u32, cooldown: Duration, ) -> Result<Self, InvalidRestartPolicy>
Add a consecutive-failure cap on top of the rolling-window budget (HeardRight’s rule: a
replacement that never becomes ready is not retried at backoff speed forever). The rolling
budget still applies first: when it is spent the outcome is Exhausted whatever the cap says.
cap must be at least 1.
Sourcepub fn with_reset_budget_on_ready(self) -> Self
pub fn with_reset_budget_on_ready(self) -> Self
When a generation reports ready (RestartTracker::ready), also forget the restarts counted
in the rolling window, so the next crash starts again at the base backoff with a full budget.
Off by default: a crash loop that reaches ready each time is then still limited by the window.
pub fn consecutive_failures(&self) -> Option<ConsecutiveFailures>
pub fn resets_budget_on_ready(&self) -> bool
pub fn mode(&self) -> RestartMode
pub fn max_restarts(&self) -> u32
pub fn window(&self) -> Duration
pub fn base_backoff(&self) -> Duration
pub fn max_backoff(&self) -> Duration
Trait Implementations§
Source§impl Clone for RestartPolicy
impl Clone for RestartPolicy
impl Copy for RestartPolicy
Source§impl Debug for RestartPolicy
impl Debug for RestartPolicy
Source§impl Default for RestartPolicy
impl Default for RestartPolicy
impl Eq for RestartPolicy
Source§impl PartialEq for RestartPolicy
impl PartialEq for RestartPolicy
impl StructuralPartialEq for RestartPolicy
Auto Trait Implementations§
impl Freeze for RestartPolicy
impl RefUnwindSafe for RestartPolicy
impl Send for RestartPolicy
impl Sync for RestartPolicy
impl Unpin for RestartPolicy
impl UnsafeUnpin for RestartPolicy
impl UnwindSafe for RestartPolicy
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