Expand description
A token bucket implementation.
Structs§
- Claimed
Tokens 🔒 - A handle to a number of claimed tokens.
- Insufficient
Tokens 🔒Error - An operation was attempted to reduce the number of tokens, but the token bucket did not have enough tokens.
- Token
Bucket 🔒 - A token bucket.
- Token
Bucket 🔒Config - The refill rate and token max for a
TokenBucket.
Enums§
- Became
Empty 🔒 - The token bucket transitioned from “non-empty” to “empty”.
- Became
NonEmpty 🔒 - The token bucket transitioned from “empty” to “non-empty”.
- Never
Enough 🔒Tokens Error - The token bucket will never have the requested number of tokens.
Traits§
- Token
Bucket 🔒Instant - Any type implementing this must be represented as a measurement of a monotonically nondecreasing clock.