pub struct LeakyBucket;Expand description
Leaky Bucket rate limiting algorithm.
Enforces a constant output rate regardless of input bursts. Requests that would overflow the bucket are rejected.
Implementations§
Source§impl LeakyBucket
impl LeakyBucket
Trait Implementations§
Source§impl Algorithm for LeakyBucket
impl Algorithm for LeakyBucket
Source§async fn check_and_record<S: Storage>(
&self,
storage: &S,
key: &str,
quota: &Quota,
) -> Result<Decision>
async fn check_and_record<S: Storage>( &self, storage: &S, key: &str, quota: &Quota, ) -> Result<Decision>
Check if a request is allowed AND record it atomically. Read more
Source§impl Clone for LeakyBucket
impl Clone for LeakyBucket
Source§fn clone(&self) -> LeakyBucket
fn clone(&self) -> LeakyBucket
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 LeakyBucket
impl Debug for LeakyBucket
Source§impl Default for LeakyBucket
impl Default for LeakyBucket
Source§fn default() -> LeakyBucket
fn default() -> LeakyBucket
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LeakyBucket
impl RefUnwindSafe for LeakyBucket
impl Send for LeakyBucket
impl Sync for LeakyBucket
impl Unpin for LeakyBucket
impl UnwindSafe for LeakyBucket
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