Skip to main content

token_bucket/error/
enum.rs

1/// Configuration validation errors returned by rate-limiter constructors.
2#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3pub enum RateLimitError {
4    /// Configured rate or refill token count was zero.
5    ZeroRate,
6    /// Configured burst size was zero.
7    ZeroBurst,
8    /// Configured period, window, or emission interval was zero.
9    ZeroPeriod,
10    /// Configured limit was zero or exceeded the lock-free 32-bit bound.
11    InvalidLimit,
12    /// Configured token-bucket capacity was zero or exceeded the lock-free 32-bit bound.
13    InvalidCapacity,
14    /// Configured keyed limiter entry capacity was zero.
15    ZeroCapacity,
16    /// Intermediate nanosecond calculation overflowed `u64`.
17    Overflow,
18}