pub enum RetryErrorPredicate {
All,
HttpErrors,
Custom(fn(&Error) -> bool),
}Expand description
Error type predicate for retry logic.
This enum allows specifying which error types should trigger a retry.
Variants§
All
Retry on all errors (default).
HttpErrors
Retry only on HTTP/API errors.
Custom(fn(&Error) -> bool)
Retry only on specific error variants using a custom predicate.
Implementations§
Source§impl RetryErrorPredicate
impl RetryErrorPredicate
Sourcepub fn should_retry(&self, error: &Error) -> bool
pub fn should_retry(&self, error: &Error) -> bool
Check if the given error should trigger a retry.
Trait Implementations§
Source§impl Clone for RetryErrorPredicate
impl Clone for RetryErrorPredicate
Source§fn clone(&self) -> RetryErrorPredicate
fn clone(&self) -> RetryErrorPredicate
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 RetryErrorPredicate
impl Debug for RetryErrorPredicate
Source§impl Default for RetryErrorPredicate
impl Default for RetryErrorPredicate
Source§fn default() -> RetryErrorPredicate
fn default() -> RetryErrorPredicate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetryErrorPredicate
impl RefUnwindSafe for RetryErrorPredicate
impl Send for RetryErrorPredicate
impl Sync for RetryErrorPredicate
impl Unpin for RetryErrorPredicate
impl UnwindSafe for RetryErrorPredicate
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