[−][src]Struct r6stats_client::Client
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]
F: FnOnce(RatelimitBuilder) -> RatelimitBuilder,
Creates a new client with custom ratelimit settings.
Args
token
- The API key for authentication with the endpointop
- Closure for building theRatelimit
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,