pub enum TransientError {
Network,
RateLimit(Option<u64>),
ServerError,
ServiceUnavailable,
GatewayTimeout,
TooManyRequests,
Timeout,
}Expand description
Transient errors that should trigger a retry
Variants§
Network
Network connectivity issues
RateLimit(Option<u64>)
Rate limit exceeded (with optional retry-after seconds)
ServerError
Server error (5xx)
Service unavailable (503)
GatewayTimeout
Gateway timeout (504)
TooManyRequests
Too many requests (429)
Timeout
Request timeout
Implementations§
Source§impl TransientError
impl TransientError
Sourcepub fn from_reqwest_error(err: &Error) -> Option<Self>
pub fn from_reqwest_error(err: &Error) -> Option<Self>
Check if a reqwest error represents a transient error
Sourcepub fn from_source_error(err: &SourceError) -> Option<Self>
pub fn from_source_error(err: &SourceError) -> Option<Self>
Check if a SourceError represents a transient error
Sourcepub fn recommended_delay(&self) -> Duration
pub fn recommended_delay(&self) -> Duration
Get the recommended delay for this error
Trait Implementations§
Source§impl Clone for TransientError
impl Clone for TransientError
Source§fn clone(&self) -> TransientError
fn clone(&self) -> TransientError
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 TransientError
impl Debug for TransientError
Source§impl PartialEq for TransientError
impl PartialEq for TransientError
impl StructuralPartialEq for TransientError
Auto Trait Implementations§
impl Freeze for TransientError
impl RefUnwindSafe for TransientError
impl Send for TransientError
impl Sync for TransientError
impl Unpin for TransientError
impl UnwindSafe for TransientError
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