pub struct RateLimitPolicy { /* private fields */ }Expand description
Configuration policy governing ShardedRateLimiter and RateLimitPlugin.
Implementations§
Source§impl RateLimitPolicy
Inherent fluent builders for RateLimitPolicy.
impl RateLimitPolicy
Inherent fluent builders for RateLimitPolicy.
Sourcepub fn with_burst(self, burst: u64) -> Self
pub fn with_burst(self, burst: u64) -> Self
Sourcepub fn with_algorithm(self, algorithm: RateLimitAlgorithm) -> Self
pub fn with_algorithm(self, algorithm: RateLimitAlgorithm) -> Self
Sourcepub fn with_max_keys(self, max_keys: usize) -> Self
pub fn with_max_keys(self, max_keys: usize) -> Self
Sourcepub fn with_include_headers(self, include_headers: bool) -> Self
pub fn with_include_headers(self, include_headers: bool) -> Self
Sourcepub fn with_exempt_paths<I, S>(self, paths: I) -> Self
pub fn with_exempt_paths<I, S>(self, paths: I) -> Self
Source§impl RateLimitPolicy
impl RateLimitPolicy
pub fn get_requests_per_window(&self) -> u64
pub fn get_mut_requests_per_window(&mut self) -> &mut u64
pub fn set_requests_per_window(&mut self, val: u64) -> &mut Self
pub fn get_window_ms(&self) -> u64
pub fn get_mut_window_ms(&mut self) -> &mut u64
pub fn set_window_ms(&mut self, val: u64) -> &mut Self
pub fn get_burst(&self) -> u64
pub fn get_mut_burst(&mut self) -> &mut u64
pub fn set_burst(&mut self, val: u64) -> &mut Self
pub fn get_algorithm(&self) -> RateLimitAlgorithm
pub fn get_mut_algorithm(&mut self) -> &mut RateLimitAlgorithm
pub fn set_algorithm(&mut self, val: RateLimitAlgorithm) -> &mut Self
pub fn get_max_keys(&self) -> usize
pub fn get_mut_max_keys(&mut self) -> &mut usize
pub fn set_max_keys(&mut self, val: usize) -> &mut Self
pub fn get_include_headers(&self) -> bool
pub fn get_mut_include_headers(&mut self) -> &mut bool
pub fn set_include_headers(&mut self, val: bool) -> &mut Self
pub fn get_exempt_paths(&self) -> &Vec<String>
pub fn get_mut_exempt_paths(&mut self) -> &mut Vec<String>
pub fn set_exempt_paths(&mut self, val: Vec<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for RateLimitPolicy
impl Clone for RateLimitPolicy
Source§impl Debug for RateLimitPolicy
impl Debug for RateLimitPolicy
Source§impl Default for RateLimitPolicy
Default construction for RateLimitPolicy.
impl Default for RateLimitPolicy
Default construction for RateLimitPolicy.
Source§fn default() -> Self
fn default() -> Self
Constructs a default RateLimitPolicy (100 req / 60 s, GCRA, 65 536 max keys).
impl Eq for RateLimitPolicy
Source§impl PartialEq for RateLimitPolicy
impl PartialEq for RateLimitPolicy
impl StructuralPartialEq for RateLimitPolicy
Auto Trait Implementations§
impl Forget for RateLimitPolicy
impl Freeze for RateLimitPolicy
impl Move for RateLimitPolicy
impl RefUnwindSafe for RateLimitPolicy
impl Send for RateLimitPolicywhere
RawVecInner: Send,
impl Sync for RateLimitPolicywhere
RawVecInner: Sync,
impl Unpin for RateLimitPolicy
impl UnsafeUnpin for RateLimitPolicy
impl UnwindSafe for RateLimitPolicywhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.