pub struct StatusPolicy { /* private fields */ }Expand description
Policy controlling which status codes trigger a retry.
Implementations§
Source§impl StatusPolicy
impl StatusPolicy
Sourcepub fn new(statuses: impl IntoIterator<Item = u16>) -> Self
pub fn new(statuses: impl IntoIterator<Item = u16>) -> Self
Create a status policy with the given codes.
Sourcepub fn default_empty() -> Self
pub fn default_empty() -> Self
Create an empty status policy (no retryable statuses).
Sourcepub fn add_status(&mut self, status: u16)
pub fn add_status(&mut self, status: u16)
Add a status code to the retryable set.
Sourcepub fn is_retryable(&self, status: u16) -> bool
pub fn is_retryable(&self, status: u16) -> bool
Returns true if the status code is retryable.
Trait Implementations§
Source§impl Clone for StatusPolicy
impl Clone for StatusPolicy
Source§impl Debug for StatusPolicy
impl Debug for StatusPolicy
Auto Trait Implementations§
impl Freeze for StatusPolicy
impl RefUnwindSafe for StatusPolicy
impl Send for StatusPolicy
impl Sync for StatusPolicy
impl Unpin for StatusPolicy
impl UnsafeUnpin for StatusPolicy
impl UnwindSafe for StatusPolicy
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