pub struct FixedWindow;Expand description
Fixed Window rate limiting algorithm.
Simple counter that resets at fixed intervals. Fast but has “boundary burst” problem.
Implementations§
Source§impl FixedWindow
impl FixedWindow
Trait Implementations§
Source§impl Algorithm for FixedWindow
impl Algorithm for FixedWindow
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 FixedWindow
impl Clone for FixedWindow
Source§fn clone(&self) -> FixedWindow
fn clone(&self) -> FixedWindow
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 FixedWindow
impl Debug for FixedWindow
Source§impl Default for FixedWindow
impl Default for FixedWindow
Source§fn default() -> FixedWindow
fn default() -> FixedWindow
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FixedWindow
impl RefUnwindSafe for FixedWindow
impl Send for FixedWindow
impl Sync for FixedWindow
impl Unpin for FixedWindow
impl UnwindSafe for FixedWindow
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