[][src]Struct serenity::http::ratelimiting::Ratelimit

pub struct Ratelimit { /* fields omitted */ }

A set of data containing information about the ratelimits for a particular Route, which is stored in Http.

See the Discord docs on ratelimits for more information.

Note: You should not mutate any of the fields, as this can help cause 429s.

Implementations

impl Ratelimit[src]

pub async fn pre_hook<'_, '_>(&'_ mut self, route: &'_ Route)[src]

pub async fn post_hook<'_, '_, '_>(
    &'_ mut self,
    response: &'_ Response,
    route: &'_ Route
) -> Result<bool>
[src]

pub fn limit(&self) -> i64[src]

The total number of requests that can be made in a period of time.

pub fn remaining(&self) -> i64[src]

The number of requests remaining in the period of time.

pub fn reset(&self) -> Option<SystemTime>[src]

The absolute time in milliseconds when the interval resets.

pub fn reset_after(&self) -> Option<Duration>[src]

The total time in milliseconds when the interval resets.

Trait Implementations

impl Debug for Ratelimit[src]

impl Default for Ratelimit[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]