pub enum DistributedAlgorithm {
TokenBucket,
SlidingWindow,
}Expand description
The rate-limiting algorithm a backend must apply for a key.
This mirrors the algorithm selection in RateLimitConfig but is expressed
as an explicit, Copy value so backends do not need to depend on the full
configuration struct when performing atomic arithmetic.
Variants§
TokenBucket
Token bucket: tokens refill continuously at rate up to burst.
SlidingWindow
Sliding window: at most rate * window events within window seconds.
Trait Implementations§
Source§impl Clone for DistributedAlgorithm
impl Clone for DistributedAlgorithm
impl Copy for DistributedAlgorithm
Source§impl Debug for DistributedAlgorithm
impl Debug for DistributedAlgorithm
impl Eq for DistributedAlgorithm
Source§impl PartialEq for DistributedAlgorithm
impl PartialEq for DistributedAlgorithm
impl StructuralPartialEq for DistributedAlgorithm
Auto Trait Implementations§
impl Freeze for DistributedAlgorithm
impl RefUnwindSafe for DistributedAlgorithm
impl Send for DistributedAlgorithm
impl Sync for DistributedAlgorithm
impl Unpin for DistributedAlgorithm
impl UnsafeUnpin for DistributedAlgorithm
impl UnwindSafe for DistributedAlgorithm
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