Struct twilight_http_ratelimiting::ticket::TicketNotifier
source · pub struct TicketNotifier(_);Expand description
Indicate to the ratelimit consumer that their ticket has been granted and they may now send a request.
Implementations§
source§impl TicketNotifier
impl TicketNotifier
sourcepub fn available(self) -> Option<TicketHeaders>
pub fn available(self) -> Option<TicketHeaders>
Signal to the ratelimiter consumer (an HTTP client) that a request may now be performed.
A receiver is returned. This must be stored and awaited so that ratelimiting backends can handle the headers that the API consumer will send back, thus completing the cycle.
Returns a None if the consumer has dropped their
TicketReceiver half. The ticket is considered canceled.