pub struct RateLimitConfig {
pub requests_per_minute: u32,
pub burst_limit: u32,
pub retry_on_rate_limit: bool,
pub max_retries: u32,
pub base_delay_ms: u64,
}Expand description
Rate limit configuration.
Fields§
§requests_per_minute: u32Maximum requests per minute.
burst_limit: u32Burst limit.
retry_on_rate_limit: boolWhether to retry on rate limit.
max_retries: u32Maximum retry attempts.
base_delay_ms: u64Base delay for exponential backoff in milliseconds.
Implementations§
Source§impl RateLimitConfig
impl RateLimitConfig
Sourcepub fn new() -> RateLimitConfig
pub fn new() -> RateLimitConfig
Create new rate limit configuration.
Sourcepub fn requests_per_minute(self, rpm: u32) -> RateLimitConfig
pub fn requests_per_minute(self, rpm: u32) -> RateLimitConfig
Set requests per minute.
Sourcepub fn burst_limit(self, limit: u32) -> RateLimitConfig
pub fn burst_limit(self, limit: u32) -> RateLimitConfig
Set burst limit.
Sourcepub fn retry_on_rate_limit(self, retry: bool) -> RateLimitConfig
pub fn retry_on_rate_limit(self, retry: bool) -> RateLimitConfig
Enable or disable retry on rate limit.
Sourcepub fn max_retries(self, retries: u32) -> RateLimitConfig
pub fn max_retries(self, retries: u32) -> RateLimitConfig
Set maximum retries.
Sourcepub fn base_delay_ms(self, delay: u64) -> RateLimitConfig
pub fn base_delay_ms(self, delay: u64) -> RateLimitConfig
Set base delay for exponential backoff in milliseconds.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§fn clone(&self) -> RateLimitConfig
fn clone(&self) -> RateLimitConfig
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 RateLimitConfig
impl Debug for RateLimitConfig
Source§impl Default for RateLimitConfig
impl Default for RateLimitConfig
Source§fn default() -> RateLimitConfig
fn default() -> RateLimitConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RateLimitConfig
impl RefUnwindSafe for RateLimitConfig
impl Send for RateLimitConfig
impl Sync for RateLimitConfig
impl Unpin for RateLimitConfig
impl UnwindSafe for RateLimitConfig
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