pub struct ClientConfig {
pub retry: RetryConfig,
pub rate_limit: RateLimitConfig,
pub operational_delays: OperationalDelayConfig,
}Expand description
Unified configuration for retry behavior and rate limiting
Fields§
§retry: RetryConfigRetry configuration
rate_limit: RateLimitConfigRate limit detection configuration
operational_delays: OperationalDelayConfigOperational delay configuration
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn with_retries_disabled() -> Self
pub fn with_retries_disabled() -> Self
Create config with retries disabled
Sourcepub fn with_rate_limiting_disabled() -> Self
pub fn with_rate_limiting_disabled() -> Self
Create config with rate limit detection disabled
Sourcepub fn for_testing() -> Self
pub fn for_testing() -> Self
Create config optimized for testing (rate limit detection enabled, retries enabled but no delays)
Sourcepub fn with_retry_config(self, retry_config: RetryConfig) -> Self
pub fn with_retry_config(self, retry_config: RetryConfig) -> Self
Set custom retry configuration
Sourcepub fn with_rate_limit_config(self, rate_limit_config: RateLimitConfig) -> Self
pub fn with_rate_limit_config(self, rate_limit_config: RateLimitConfig) -> Self
Set custom rate limit configuration
Sourcepub fn with_operational_delays(
self,
operational_delays: OperationalDelayConfig,
) -> Self
pub fn with_operational_delays( self, operational_delays: OperationalDelayConfig, ) -> Self
Set custom operational delay configuration
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Set custom retry count
Sourcepub fn with_retry_delays(self, base_delay: u64, max_delay: u64) -> Self
pub fn with_retry_delays(self, base_delay: u64, max_delay: u64) -> Self
Set custom retry delays
Sourcepub fn with_custom_rate_limit_patterns(self, patterns: Vec<String>) -> Self
pub fn with_custom_rate_limit_patterns(self, patterns: Vec<String>) -> Self
Add custom rate limit patterns
Sourcepub fn with_status_detection(self, enabled: bool) -> Self
pub fn with_status_detection(self, enabled: bool) -> Self
Enable/disable HTTP status code rate limit detection
Sourcepub fn with_pattern_detection(self, enabled: bool) -> Self
pub fn with_pattern_detection(self, enabled: bool) -> Self
Enable/disable response pattern rate limit detection
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
Source§fn default() -> ClientConfig
fn default() -> ClientConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for ClientConfig
impl PartialEq for ClientConfig
impl Eq for ClientConfig
impl StructuralPartialEq for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.