token-bucket 11.0.0

Zero-dependency, lock-free atomic GCRA, Fixed-Window, Token-Bucket, and 64-way sharded bounded keyed rate-limiting engine.
Documentation
1
2
3
4
5
6
7
8
/// Maximum token-bucket capacity supported by single-atomic packed state.
pub const MAX_TOKEN_BUCKET_CAPACITY: u64 = u32::MAX as u64;

/// Total bit width of the packed atomic token-bucket state word.
pub(crate) const TOKEN_STATE_BITS: u32 = 64;

/// Nanoseconds in one second for per-second refill rate calculations.
pub(crate) const TOKEN_NANOS_PER_SEC: u64 = 1_000_000_000;