#[non_exhaustive]pub enum RetryTrigger {
TransportError,
Timeout,
Status(u16),
NonRetryable,
}Expand description
Conditions that trigger a retry
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TransportError
Transport-level errors (connection refused, DNS failure, reset, etc.)
Timeout
Request timeout
Status(u16)
Specific HTTP status code
NonRetryable
Error that is never retryable (e.g., DeadlineExceeded, ServiceClosed)
Implementations§
Source§impl RetryTrigger
impl RetryTrigger
Sourcepub const TOO_MANY_REQUESTS: Self
pub const TOO_MANY_REQUESTS: Self
Create a trigger for HTTP 429 Too Many Requests
Sourcepub const REQUEST_TIMEOUT: Self
pub const REQUEST_TIMEOUT: Self
Create a trigger for HTTP 408 Request Timeout
Sourcepub const INTERNAL_SERVER_ERROR: Self
pub const INTERNAL_SERVER_ERROR: Self
Create a trigger for HTTP 500 Internal Server Error
Sourcepub const BAD_GATEWAY: Self
pub const BAD_GATEWAY: Self
Create a trigger for HTTP 502 Bad Gateway
Sourcepub const SERVICE_UNAVAILABLE: Self
pub const SERVICE_UNAVAILABLE: Self
Create a trigger for HTTP 503 Service Unavailable
Sourcepub const GATEWAY_TIMEOUT: Self
pub const GATEWAY_TIMEOUT: Self
Create a trigger for HTTP 504 Gateway Timeout
Trait Implementations§
Source§impl Clone for RetryTrigger
impl Clone for RetryTrigger
Source§fn clone(&self) -> RetryTrigger
fn clone(&self) -> RetryTrigger
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 RetryTrigger
impl Debug for RetryTrigger
Source§impl Hash for RetryTrigger
impl Hash for RetryTrigger
Source§impl PartialEq for RetryTrigger
impl PartialEq for RetryTrigger
impl Copy for RetryTrigger
impl Eq for RetryTrigger
impl StructuralPartialEq for RetryTrigger
Auto Trait Implementations§
impl Freeze for RetryTrigger
impl RefUnwindSafe for RetryTrigger
impl Send for RetryTrigger
impl Sync for RetryTrigger
impl Unpin for RetryTrigger
impl UnsafeUnpin for RetryTrigger
impl UnwindSafe for RetryTrigger
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension. Read more
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension, using
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses. Read more
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses, using
x-request-id as the header name. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
Intercept requests with over-sized payloads and convert them into
413 Payload Too Large responses. Read more