pub enum RestartPolicy {
Never,
OnFailure {
max_retries: usize,
backoff: Duration,
},
Always {
backoff: Duration,
},
}Expand description
Restart policy for nodes
Variants§
Never
Never restart failed nodes
OnFailure
Restart on failure with exponential backoff
Fields
Always
Always restart nodes with constant backoff
Implementations§
Source§impl RestartPolicy
impl RestartPolicy
Sourcepub fn should_restart(&self, attempt: usize) -> bool
pub fn should_restart(&self, attempt: usize) -> bool
Check if should restart based on attempt count
Sourcepub fn backoff_duration(&self, attempt: usize) -> Duration
pub fn backoff_duration(&self, attempt: usize) -> Duration
Calculate backoff duration for given attempt
Trait Implementations§
Source§impl Clone for RestartPolicy
impl Clone for RestartPolicy
Source§fn clone(&self) -> RestartPolicy
fn clone(&self) -> RestartPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RestartPolicy
impl RefUnwindSafe for RestartPolicy
impl Send for RestartPolicy
impl Sync for RestartPolicy
impl Unpin 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