pub struct TicketNotifier(/* private fields */);
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TicketNotifier
impl !RefUnwindSafe for TicketNotifier
impl Send for TicketNotifier
impl Sync for TicketNotifier
impl Unpin for TicketNotifier
impl !UnwindSafe for TicketNotifier
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more