pub struct InMemoryRateLimiterConfig {
pub requests_per_second: f64,
pub check_every_n_seconds: f64,
pub max_bucket_size: f64,
}Expand description
Configuration for InMemoryRateLimiter.
Fields§
§requests_per_second: f64The number of tokens to add per second to the bucket. The tokens represent “credit” that can be used to make requests.
check_every_n_seconds: f64Check whether the tokens are available every this many seconds. Can be a float to represent fractions of a second.
max_bucket_size: f64The maximum number of tokens that can be in the bucket. Must be at least 1. Used to prevent bursts of requests.
Trait Implementations§
Source§impl Clone for InMemoryRateLimiterConfig
impl Clone for InMemoryRateLimiterConfig
Source§fn clone(&self) -> InMemoryRateLimiterConfig
fn clone(&self) -> InMemoryRateLimiterConfig
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 InMemoryRateLimiterConfig
impl Debug for InMemoryRateLimiterConfig
Auto Trait Implementations§
impl Freeze for InMemoryRateLimiterConfig
impl RefUnwindSafe for InMemoryRateLimiterConfig
impl Send for InMemoryRateLimiterConfig
impl Sync for InMemoryRateLimiterConfig
impl Unpin for InMemoryRateLimiterConfig
impl UnwindSafe for InMemoryRateLimiterConfig
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