pub enum AttemptError {
Transport(String),
Status5xx {
code: u16,
body: String,
},
Timeout(Duration),
NonRetryable(String),
}Expand description
A classification of one attempt’s failure.
Transport, Status5xx, and Timeout are retryable — the failover
loop moves to the next provider. NonRetryable aborts the loop
and is returned to the caller wrapped in the outcome.
Variants§
Transport(String)
Network-level failure before/while receiving a response.
Examples: DNS resolution failure, connection refused, TLS error,
socket reset mid-stream. String is a short human description
suitable for audit.
Status5xx
Provider returned a 5xx response. Carries the actual status code (e.g. 502, 503, 504) and a short body excerpt.
Timeout(Duration)
Per-request deadline elapsed before completion.
NonRetryable(String)
Authoritative error that must NOT trigger failover. Examples: 4xx auth failure (wrong API key), 4xx quota exhausted on the account level, content-policy refusal, malformed response we cannot recover from. The kernel returns immediately when it sees this — there is no value in asking another provider when the request itself is bad.
Implementations§
Source§impl AttemptError
impl AttemptError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error should trigger advancement to the next provider.
Trait Implementations§
Source§impl Clone for AttemptError
impl Clone for AttemptError
Source§fn clone(&self) -> AttemptError
fn clone(&self) -> AttemptError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttemptError
impl Debug for AttemptError
Source§impl Display for AttemptError
impl Display for AttemptError
Source§impl PartialEq for AttemptError
impl PartialEq for AttemptError
Source§fn eq(&self, other: &AttemptError) -> bool
fn eq(&self, other: &AttemptError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AttemptError
Auto Trait Implementations§
impl Freeze for AttemptError
impl RefUnwindSafe for AttemptError
impl Send for AttemptError
impl Sync for AttemptError
impl Unpin for AttemptError
impl UnsafeUnpin for AttemptError
impl UnwindSafe for AttemptError
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§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request