pub struct RetryConfig {
pub max_retries: Option<u32>,
pub initial_backoff: Duration,
pub max_backoff: Duration,
pub retry_on_status: Vec<u16>,
pub respect_retry_after: bool,
}Expand description
Configuration for retry behavior.
Fields§
§max_retries: Option<u32>Maximum number of retry attempts (None = infinite)
initial_backoff: DurationInitial backoff duration
max_backoff: DurationMaximum backoff duration
retry_on_status: Vec<u16>HTTP status codes that trigger a retry
respect_retry_after: boolWhether to respect the Retry-After header
Implementations§
Source§impl RetryConfig
impl RetryConfig
pub fn new() -> Self
pub fn no_retry() -> Self
pub fn with_max_retries(self, max: u32) -> Self
pub fn with_initial_backoff(self, duration: Duration) -> Self
pub fn with_max_backoff(self, duration: Duration) -> Self
pub fn with_retry_on_status(self, status: u16) -> Self
pub fn with_respect_retry_after(self, respect: bool) -> Self
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
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 RetryConfig
impl Debug for RetryConfig
Auto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnwindSafe for RetryConfig
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