pub struct RetryConfigBuilder { /* private fields */ }Expand description
Builder for RetryConfig.
Implementations§
Source§impl RetryConfigBuilder
impl RetryConfigBuilder
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sets the maximum number of retry attempts.
Sourcepub fn initial_delay_ms(self, initial_delay_ms: u64) -> Self
pub fn initial_delay_ms(self, initial_delay_ms: u64) -> Self
Sets the initial delay before the first retry (in milliseconds).
Sourcepub fn max_delay_ms(self, max_delay_ms: u64) -> Self
pub fn max_delay_ms(self, max_delay_ms: u64) -> Self
Sets the maximum delay between retries (in milliseconds).
Sourcepub fn exponential_base(self, base: f64) -> Self
pub fn exponential_base(self, base: f64) -> Self
Sets the base for exponential backoff.
Sourcepub fn jitter_factor(self, factor: f64) -> Self
pub fn jitter_factor(self, factor: f64) -> Self
Sets the jitter factor (0.0 to 1.0).
Sourcepub fn retryable_status_codes(
self,
codes: impl IntoIterator<Item = u16>,
) -> Self
pub fn retryable_status_codes( self, codes: impl IntoIterator<Item = u16>, ) -> Self
Sets the HTTP status codes that should trigger a retry.
Sourcepub fn add_retryable_status_code(self, code: u16) -> Self
pub fn add_retryable_status_code(self, code: u16) -> Self
Adds a status code to the set of retryable codes.
Sourcepub fn build(self) -> RetryConfig
pub fn build(self) -> RetryConfig
Builds the RetryConfig.
Trait Implementations§
Source§impl Clone for RetryConfigBuilder
impl Clone for RetryConfigBuilder
Source§fn clone(&self) -> RetryConfigBuilder
fn clone(&self) -> RetryConfigBuilder
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 RetryConfigBuilder
impl Debug for RetryConfigBuilder
Source§impl Default for RetryConfigBuilder
impl Default for RetryConfigBuilder
Source§fn default() -> RetryConfigBuilder
fn default() -> RetryConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetryConfigBuilder
impl RefUnwindSafe for RetryConfigBuilder
impl Send for RetryConfigBuilder
impl Sync for RetryConfigBuilder
impl Unpin for RetryConfigBuilder
impl UnwindSafe for RetryConfigBuilder
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