pub struct RateLimitConfig {
pub detect_by_status: bool,
pub detect_by_patterns: bool,
pub patterns: Vec<String>,
pub custom_patterns: Vec<String>,
}Expand description
Configuration for rate limit detection behavior
Fields§
§detect_by_status: boolWhether to detect rate limits by HTTP status codes (429, 403)
detect_by_patterns: boolWhether to detect rate limits by response body patterns
patterns: Vec<String>Patterns to look for in response bodies (used when detect_by_patterns is true)
custom_patterns: Vec<String>Additional custom patterns to look for in response bodies
Implementations§
Source§impl RateLimitConfig
impl RateLimitConfig
Sourcepub fn status_only() -> Self
pub fn status_only() -> Self
Create config with only status code detection
Sourcepub fn patterns_only() -> Self
pub fn patterns_only() -> Self
Create config with only default pattern detection
Sourcepub fn custom_patterns_only(patterns: Vec<String>) -> Self
pub fn custom_patterns_only(patterns: Vec<String>) -> Self
Create config with custom patterns only (no default patterns)
Sourcepub fn with_custom_patterns(self, patterns: Vec<String>) -> Self
pub fn with_custom_patterns(self, patterns: Vec<String>) -> Self
Create config with both default and custom patterns
Sourcepub fn with_patterns(self, patterns: Vec<String>) -> Self
pub fn with_patterns(self, patterns: Vec<String>) -> Self
Create config with custom patterns (replaces built-in patterns)
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§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§impl PartialEq for RateLimitConfig
impl PartialEq for RateLimitConfig
impl Eq for RateLimitConfig
impl StructuralPartialEq for RateLimitConfig
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§
§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.