token_bucket/keyed/enum.rs
1use super::*;
2
3/// Unified rate-limiting algorithm policy applied to every key in a `KeyedRateLimiter`.
4#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
5pub enum RateLimitPolicy {
6 /// Generic Cell Rate Algorithm (smooth leaky-bucket arrival scheduling).
7 Gcra(GcraConfig),
8 /// Lock-free packed fixed-window counter.
9 FixedWindow(FixedWindowConfig),
10 /// Lock-free packed token bucket with discrete or smooth refill steps.
11 TokenBucket(TokenBucketConfig),
12}