Expand description
This crate ensures rate limits and can return cached results instead.
Caching is an optional mechanism helping to avoid repeated expensive procedures, such as REST requests and calcuations, until certain time elapsed.
Nonetheless, as it’s an optional feature, one can simply use the rate limiter for nothing but throttling, e.g. bot commands, without using memory on caching.
Modules§
- multi_
bucket - A multi-bucket type uses groups of buckets. Each group represents a category, e.g. a command name or HTTP endpoint, which then contains buckets. The buckets represent individual identities, such as the command user’s ID or the endpoint parameters.
Structs§
- Bucket
- This type checks for rate limits on
Keys.
If caching is enabled, it will cache values. - Bucket
Builder - Builds a
Bucket. - Rate
Limit Info - Describes the rate limit encountered.
Enums§
- Rate
Limit Action - Action taken for the command invocation.