pub struct RetryConfig {
pub max_retry_count: Option<u32>,
pub retry_delay_secs: Option<u64>,
}Expand description
Configuration for HTTP request retry behavior
Fields§
§max_retry_count: Option<u32>Maximum number of retries on rate limit (None = infinite retries)
retry_delay_secs: Option<u64>Delay in seconds between retries (None = use default 10 seconds)
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new retry configuration with infinite retries and 10 second delay
Sourcepub fn infinite() -> Self
pub fn infinite() -> Self
Creates a new retry configuration with infinite retries
Uses RETRY_DELAY_SECS environment variable if set, otherwise defaults to 10 seconds.
Sourcepub fn with_max_retries(max_retries: u32) -> Self
pub fn with_max_retries(max_retries: u32) -> Self
Creates a new retry configuration with a maximum number of retries
Uses RETRY_DELAY_SECS environment variable if set, otherwise defaults to 10 seconds.
Sourcepub fn with_delay(delay_secs: u64) -> Self
pub fn with_delay(delay_secs: u64) -> Self
Creates a new retry configuration with custom delay
Sourcepub fn with_max_retries_and_delay(max_retries: u32, delay_secs: u64) -> Self
pub fn with_max_retries_and_delay(max_retries: u32, delay_secs: u64) -> Self
Creates a new retry configuration with both max retries and custom delay
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Gets the maximum retry count (0 = infinite)
Sourcepub fn delay_secs(&self) -> u64
pub fn delay_secs(&self) -> u64
Gets the retry delay in seconds (default: 10)
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetryConfig
impl Debug for RetryConfig
Source§impl Default for RetryConfig
impl Default for RetryConfig
Source§impl<'de> Deserialize<'de> for RetryConfig
impl<'de> Deserialize<'de> for RetryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for RetryConfig
impl Display 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.