pub struct SlidingWindow;Expand description
Sliding Window rate limiting algorithm.
Uses weighted combination of current and previous windows to eliminate the boundary burst problem.
Implementations§
Source§impl SlidingWindow
impl SlidingWindow
Trait Implementations§
Source§impl Algorithm for SlidingWindow
impl Algorithm for SlidingWindow
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 SlidingWindow
impl Clone for SlidingWindow
Source§fn clone(&self) -> SlidingWindow
fn clone(&self) -> SlidingWindow
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 SlidingWindow
impl Debug for SlidingWindow
Source§impl Default for SlidingWindow
impl Default for SlidingWindow
Source§fn default() -> SlidingWindow
fn default() -> SlidingWindow
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SlidingWindow
impl RefUnwindSafe for SlidingWindow
impl Send for SlidingWindow
impl Sync for SlidingWindow
impl Unpin for SlidingWindow
impl UnwindSafe for SlidingWindow
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