[][src]Struct r6stats_client::Client

pub struct Client { /* fields omitted */ }

Client for the R6Stats-API.

Use this client to send authenticated requests to the r6stats-api.

Ratelimiting

The API is (normally) ratelimited to 60 requests per minute. To prevent HTTP 429 errors, ratelimits are enforced prior to sending requests by Ratelimit.

Implementations

impl Client[src]

pub fn new(token: &str) -> Result<Self, Error>[src]

Creates a new client with default ratelimiting.

Args

  • token - The API key for authentication with the endpoint

pub fn with_ratelimit<F>(token: &str, op: F) -> Result<Self, Error> where
    F: FnOnce(RatelimitBuilder) -> RatelimitBuilder
[src]

Creates a new client with custom ratelimit settings.

Args

  • token - The API key for authentication with the endpoint
  • op - Closure for building the Ratelimit

pub fn stats(&self) -> &StatsClient[src]

Returns the client for requests to the stats endpoint.

pub fn leaderboard(&self) -> &LeaderboardClient[src]

Returns the client for requests to the leaderboard endpoint.

pub async fn ratelimit<'_>(&'_ self) -> Ratelimit[src]

Returns the current ratelimit.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl !Send for Client

impl !Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.