pub struct ClientConfig {
pub retry: RetryConfig,
pub rate_limit: RateLimitConfig,
}Expand description
Unified configuration for retry behavior and rate limiting
Fields§
§retry: RetryConfigRetry configuration
rate_limit: RateLimitConfigRate limit detection 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 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_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 · 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 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
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§
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