Crate twilight_http_ratelimiting

Source
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§

headers
Parse typed headers from a response.
in_memory
In-memory based default Ratelimiter implementation used in twilight-http.
request
Request parameters for ratelimiting.
ticket
Flow for managing ratelimit tickets.

Structs§

Bucket
A bucket containing ratelimiting information for a Path.

Traits§

Ratelimiter
An implementation of a ratelimiter for the Discord REST API.

Type Aliases§

GenericError
A generic error type that implements Error.
GetBucketFuture
Future returned by Ratelimiter::bucket.
GetTicketFuture
Future returned by Ratelimiter::ticket.
HasBucketFuture
Future returned by Ratelimiter::has.
IsGloballyLockedFuture
Future returned by Ratelimiter::is_globally_locked.
WaitForTicketFuture
Future returned by Ratelimiter::wait_for_ticket.