pub struct StandardHttpClassifier<B = ()> { /* private fields */ }Expand description
A standard HTTP response classifier.
Generally treats all client (4xx) and server (5xx) errors as retriable, with the exception of a few specific client errors that shouldn’t be retried:
- 400 Bad Request (likely a client-side bug)
- 401 Unauthorized (likely a client-side misconfiguration)
- 403 Forbidden (likely a client-side misconfiguration)
- 413 Payload Too Large (likely a client-side bug)
Additional HttpRetryPredicates can be registered via StandardHttpClassifier::with_predicate. A response is
retried if any predicate—including the default—returns true (OR semantics). This allows callers to
selectively unlock retries for status codes that the default predicate would not retry, without affecting other
status codes.
Implementations§
Source§impl<B: 'static> StandardHttpClassifier<B>
impl<B: 'static> StandardHttpClassifier<B>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new StandardHttpClassifier with the default status-code predicate installed.
Sourcepub fn with_predicate(self, predicate: HttpRetryPredicate<B>) -> Self
pub fn with_predicate(self, predicate: HttpRetryPredicate<B>) -> Self
Adds a predicate.
A response is retried if any predicate—including the default—returns true (OR semantics).
Trait Implementations§
Source§impl<B> Clone for StandardHttpClassifier<B>
impl<B> Clone for StandardHttpClassifier<B>
Source§impl<B: 'static> Default for StandardHttpClassifier<B>
impl<B: 'static> Default for StandardHttpClassifier<B>
Source§impl<B, Error> RetryClassifier<Response<B>, Error> for StandardHttpClassifier<B>
impl<B, Error> RetryClassifier<Response<B>, Error> for StandardHttpClassifier<B>
Auto Trait Implementations§
impl<B> Freeze for StandardHttpClassifier<B>
impl<B = ()> !RefUnwindSafe for StandardHttpClassifier<B>
impl<B> Send for StandardHttpClassifier<B>
impl<B> Sync for StandardHttpClassifier<B>
impl<B> Unpin for StandardHttpClassifier<B>
impl<B> UnsafeUnpin for StandardHttpClassifier<B>
impl<B = ()> !UnwindSafe for StandardHttpClassifier<B>
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 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>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more