pub struct RetryPolicy { /* private fields */ }Expand description
How retries are scheduled and which errors trigger them.
The default policy retries up to 3 times with exponential backoff
(100ms → 200ms → 400ms, with jitter). The default predicate
only retries RunError::NonZeroExit whose stderr matches "stale" or
".lock" (jj working-copy staleness, git/jj lock-file contention).
RunError::Spawn and RunError::Timeout are never retried by the
default predicate — a missing binary doesn’t become available, and a hung
process retried is still hung. Users who want to retry either can supply
a custom predicate via RetryPolicy::when or Cmd::retry_when.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn with_backoff(backoff: ExponentialBuilder) -> RetryPolicy
pub fn with_backoff(backoff: ExponentialBuilder) -> RetryPolicy
Construct a policy with custom backoff and the default predicate.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl !RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl !UnwindSafe for RetryPolicy
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