pub struct HttpStatusCodeClassifier { /* private fields */ }
Expand description
A retry classifier that will treat HTTP response with those status codes as retryable.
The Default
version will retry 500, 502, 503, and 504 errors.
Implementations§
Source§impl HttpStatusCodeClassifier
impl HttpStatusCodeClassifier
Sourcepub fn new_from_codes(
retryable_status_codes: impl Into<Cow<'static, [u16]>>,
) -> Self
pub fn new_from_codes( retryable_status_codes: impl Into<Cow<'static, [u16]>>, ) -> Self
Given a Vec<u16>
where the u16
s represent status codes, create a HttpStatusCodeClassifier
that will treat HTTP response with those status codes as retryable. The Default
version
will retry 500, 502, 503, and 504 errors.
Sourcepub fn priority() -> RetryClassifierPriority
pub fn priority() -> RetryClassifierPriority
Return the priority of this retry classifier.
Trait Implementations§
Source§impl ClassifyRetry for HttpStatusCodeClassifier
impl ClassifyRetry for HttpStatusCodeClassifier
Source§fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction
fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction
Run this classifier on the
InterceptorContext
to determine if the previous request
should be retried. Returns a RetryAction
.Source§fn priority(&self) -> RetryClassifierPriority
fn priority(&self) -> RetryClassifierPriority
The priority of this retry classifier. Read more
Source§impl Debug for HttpStatusCodeClassifier
impl Debug for HttpStatusCodeClassifier
Auto Trait Implementations§
impl Freeze for HttpStatusCodeClassifier
impl RefUnwindSafe for HttpStatusCodeClassifier
impl Send for HttpStatusCodeClassifier
impl Sync for HttpStatusCodeClassifier
impl Unpin for HttpStatusCodeClassifier
impl UnwindSafe for HttpStatusCodeClassifier
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> 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>
Creates a shared type from an unshared type.