pub enum RetryPredicate {
Default,
Replace(fn(&OdosError) -> bool),
DefaultExcept(fn(&OdosError) -> bool),
}Expand description
How a caller-supplied predicate composes with the SDK’s default retry decision tree.
The default decision tree is OdosError::is_retryable gated by
RetryConfig::retry_server_errors. Each variant chooses how a custom
predicate interacts with that tree:
RetryPredicate::Defaultuses only the built-in tree.RetryPredicate::Replacereplaces the tree entirely; the predicate is the sole authority on whether to retry.RetryPredicate::DefaultExceptruns the built-in tree but vetoes retries when the predicate returnstrue. Useful for blacklisting specific error shapes without reimplementing the default policy.
max_retries and the rate-limit / 429 hard-gate apply to every variant.
Variants§
Default
Use the SDK’s built-in decision tree.
Replace(fn(&OdosError) -> bool)
Replace the default decision tree entirely. The predicate is the sole
authority on whether to retry. The RetryConfig::retry_server_errors
flag is bypassed under this variant.
DefaultExcept(fn(&OdosError) -> bool)
Run the default decision tree, but veto retries when the predicate
returns true. Equivalent to
!veto(err) && default_should_retry(err).
Trait Implementations§
Source§impl Clone for RetryPredicate
impl Clone for RetryPredicate
Source§fn clone(&self) -> RetryPredicate
fn clone(&self) -> RetryPredicate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RetryPredicate
impl Debug for RetryPredicate
Source§impl Default for RetryPredicate
impl Default for RetryPredicate
Source§fn default() -> RetryPredicate
fn default() -> RetryPredicate
Returns the “default value” for a type. Read more
impl Copy for RetryPredicate
Auto Trait Implementations§
impl Freeze for RetryPredicate
impl RefUnwindSafe for RetryPredicate
impl Send for RetryPredicate
impl Sync for RetryPredicate
impl Unpin for RetryPredicate
impl UnsafeUnpin for RetryPredicate
impl UnwindSafe for RetryPredicate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more