pub enum RetryOn {
Default,
Predicate(Arc<dyn Fn(&Error) -> bool + Send + Sync>),
}Expand description
Which errors a RetryPolicy considers retryable.
Variants§
Default
The built-in default predicate (see RetryPolicy docs for the exact
rule): retries HTTP 408/429/5xx (Error::ServiceStatus) and
transport-ish Error::Service failures (timeouts / connection
errors). Never retries Error::ServiceInvalidAuth,
Error::ServiceInvalidRequest, or Error::ServiceContentFilter —
authentication/authorization failures, malformed requests, and
content-filter refusals are non-transient, so retrying would just
repeat the same rejection.
Predicate(Arc<dyn Fn(&Error) -> bool + Send + Sync>)
A fully custom predicate deciding, per error, whether to retry.
Implementations§
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