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.
Trait Implementations§
source§impl ClassifyRetry for HttpStatusCodeClassifier
impl ClassifyRetry for HttpStatusCodeClassifier
source§fn classify_retry(&self, ctx: &InterceptorContext) -> Option<RetryReason>
fn classify_retry(&self, ctx: &InterceptorContext) -> Option<RetryReason>
Run this classifier against an error to determine if it should be retried. Returns
Some(RetryKind)
if the error should be retried; Otherwise returns None
.source§impl Debug for HttpStatusCodeClassifier
impl Debug for HttpStatusCodeClassifier
Auto Trait Implementations§
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