Expand description
§twilight-http-ratelimiting
Ratelimiting functionality for HTTP requests.
Discord ratelimits requests to the HTTP API both globally and per-route. For more information on the specifics, please take a look at Discord’s documentation.
This crate provides a common Ratelimiter
trait that all ratelimiter
implementations need to implement.
It also ships a default implementation, InMemoryRatelimiter
, that manages
the bucket states in memory.
Re-exports§
pub use self::headers::RatelimitHeaders;
pub use self::in_memory::InMemoryRatelimiter;
pub use self::request::Method;
pub use self::request::Path;
Modules§
- Parse typed headers from a response.
- In-memory based default
Ratelimiter
implementation used intwilight-http
. - Request parameters for ratelimiting.
- Flow for managing ratelimit tickets.
Structs§
- A bucket containing ratelimiting information for a
Path
.
Traits§
- An implementation of a ratelimiter for the Discord REST API.
Type Aliases§
- A generic error type that implements
Error
. - Future returned by
Ratelimiter::bucket
. - Future returned by
Ratelimiter::ticket
. - Future returned by
Ratelimiter::has
. - Future returned by
Ratelimiter::is_globally_locked
. - Future returned by
Ratelimiter::wait_for_ticket
.