pub enum RetryOn {
AllErrors,
TransientErrors,
Custom(Arc<dyn Fn(&str) -> bool + Send + Sync>),
}Expand description
Determines which errors should trigger a retry.
Variants§
AllErrors
Retry on any error.
TransientErrors
Retry only on transient errors (rate limits, timeouts, server errors). Specifically: HTTP 429, 500, 502, 503, 504 and timeout errors.
Custom(Arc<dyn Fn(&str) -> bool + Send + Sync>)
Retry only when a custom predicate returns true.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RetryOn
impl !UnwindSafe for RetryOn
impl Freeze for RetryOn
impl Send for RetryOn
impl Sync for RetryOn
impl Unpin for RetryOn
impl UnsafeUnpin for RetryOn
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