pub struct SlidingLog;Expand description
Sliding Log rate limiting algorithm.
Stores timestamp of every request for highest precision. Best for accuracy-critical applications.
Implementations§
Source§impl SlidingLog
impl SlidingLog
Trait Implementations§
Source§impl Algorithm for SlidingLog
impl Algorithm for SlidingLog
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 SlidingLog
impl Clone for SlidingLog
Source§fn clone(&self) -> SlidingLog
fn clone(&self) -> SlidingLog
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 SlidingLog
impl Debug for SlidingLog
Source§impl Default for SlidingLog
impl Default for SlidingLog
Source§fn default() -> SlidingLog
fn default() -> SlidingLog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SlidingLog
impl RefUnwindSafe for SlidingLog
impl Send for SlidingLog
impl Sync for SlidingLog
impl Unpin for SlidingLog
impl UnwindSafe for SlidingLog
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