#[non_exhaustive]pub enum RetryAction {
NoActionIndicated,
RetryIndicated(RetryReason),
RetryForbidden,
}
client
only.Expand description
The result of running a ClassifyRetry
on a InterceptorContext
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoActionIndicated
When a classifier can’t run or has no opinion, this action is returned.
For example, if a classifier requires a parsed response and response parsing failed, this action is returned. If all classifiers return this action, no retry should be attempted.
RetryIndicated(RetryReason)
When a classifier runs and thinks a response should be retried, this action is returned.
RetryForbidden
When a classifier runs and decides a response must not be retried, this action is returned.
This action stops retry classification immediately, skipping any following classifiers.
Implementations§
Source§impl RetryAction
impl RetryAction
Sourcepub fn retryable_error(kind: ErrorKind) -> Self
pub fn retryable_error(kind: ErrorKind) -> Self
Create a new RetryAction
indicating that a retry is necessary.
Sourcepub fn retryable_error_with_explicit_delay(
kind: ErrorKind,
retry_after: Duration,
) -> Self
pub fn retryable_error_with_explicit_delay( kind: ErrorKind, retry_after: Duration, ) -> Self
Create a new RetryAction
indicating that a retry is necessary after an explicit delay.
Sourcepub fn transient_error() -> Self
pub fn transient_error() -> Self
Create a new RetryAction
indicating that a retry is necessary because of a transient error.
Sourcepub fn throttling_error() -> Self
pub fn throttling_error() -> Self
Create a new RetryAction
indicating that a retry is necessary because of a throttling error.
Sourcepub fn server_error() -> Self
pub fn server_error() -> Self
Create a new RetryAction
indicating that a retry is necessary because of a server error.
Sourcepub fn client_error() -> Self
pub fn client_error() -> Self
Create a new RetryAction
indicating that a retry is necessary because of a client error.
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Check if a retry is indicated.
Trait Implementations§
Source§impl Clone for RetryAction
impl Clone for RetryAction
Source§fn clone(&self) -> RetryAction
fn clone(&self) -> RetryAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RetryAction
impl Debug for RetryAction
Source§impl Default for RetryAction
impl Default for RetryAction
Source§fn default() -> RetryAction
fn default() -> RetryAction
Source§impl Display for RetryAction
impl Display for RetryAction
Source§impl PartialEq for RetryAction
impl PartialEq for RetryAction
impl Eq for RetryAction
impl StructuralPartialEq for RetryAction
Auto Trait Implementations§
impl Freeze for RetryAction
impl RefUnwindSafe for RetryAction
impl Send for RetryAction
impl Sync for RetryAction
impl Unpin for RetryAction
impl UnwindSafe for RetryAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
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>
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