Struct serenity::http::ratelimiting::GLOBAL []

pub struct GLOBAL { /* fields omitted */ }

The global mutex is a mutex unlocked and then immediately re-locked prior to every request, to abide by Discord's global ratelimit.

The global ratelimit is the total number of requests that may be made across the entirity of the API within an amount of time. If this is reached, then the global mutex is unlocked for the amount of time present in the "Retry-After" header.

While locked, all requests are blocked until each request can acquire the lock.

The only reason that you would need to use the global mutex is to block requests yourself. This has the side-effect of potentially blocking many of your event handlers or framework commands.

Methods from __Deref<Target = Arc<Mutex<()>>>

Trait Implementations

impl __Deref for GLOBAL

The resulting type after dereferencing.

Dereferences the value.

impl LazyStatic for GLOBAL