pub struct RateLimiterConfig {
pub per_identity_max: f64,
pub per_identity_rate: f64,
pub per_tool_max: f64,
pub per_tool_rate: f64,
pub max_entries: usize,
pub entry_ttl_secs: u64,
pub global_limit: Option<(f64, f64)>,
}Expand description
Configuration for rate limit defaults.
Fields§
§per_identity_max: f64Max tokens (burst) for per-identity buckets.
per_identity_rate: f64Refill rate (tokens/sec) for per-identity buckets.
per_tool_max: f64Max tokens (burst) for per-tool buckets.
per_tool_rate: f64Refill rate (tokens/sec) for per-tool buckets.
max_entries: usizeMaximum number of entries in the DashMap before cleanup triggers.
entry_ttl_secs: u64Time-to-live for idle bucket entries (in seconds).
global_limit: Option<(f64, f64)>Optional global rate limit (burst, rate). If set, all requests share this single bucket checked before per-identity/per-tool checks.
Trait Implementations§
Source§impl Clone for RateLimiterConfig
impl Clone for RateLimiterConfig
Source§fn clone(&self) -> RateLimiterConfig
fn clone(&self) -> RateLimiterConfig
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 RateLimiterConfig
impl Debug for RateLimiterConfig
Auto Trait Implementations§
impl Freeze for RateLimiterConfig
impl RefUnwindSafe for RateLimiterConfig
impl Send for RateLimiterConfig
impl Sync for RateLimiterConfig
impl Unpin for RateLimiterConfig
impl UnsafeUnpin for RateLimiterConfig
impl UnwindSafe for RateLimiterConfig
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