Crate r6stats_client

Source
Expand description

§r6stats Client

This crate provides a client for the r6stats API. It supports the /stats and the /leaderboard endpoint.

§Example

use r6stats_client::{Client, Platform, Region};
use std::env;

#[tokio::main]
async fn main() {
    // You need an API key to access the endpoints of r6stats.
    //
    // If you don't have one, you can request one from their support.
    let token = "<API KEY HERE>";
    let client = Client::new(token).unwrap();

    let leaderboard = client
        .leaderboard()
        .get(Platform::Pc, Some(Region::Emea))
        .await
        .unwrap();

    println!("{:#?}", leaderboard);
}

More examples can be found in the examples directory.

§Features

  • ratelimiting (default): Enables pre-ratelimiting before sending requests to prevent HTTP-429 Errors. Note: Ratelimits are enforced by the server either way.
  • threadsafe: Makes Client threadsafe (Send + Sync)

Modules§

http
HTTP module which provides functions for performing requests to the R6Stats endpoints.
leaderboard
The leaderboard endpoint of the api.
stats
The stats endpoint of the api.

Structs§

Client
Client for the r6stats API.

Enums§

Error
Enum containing all errors.
Platform
The platforms Rainbow 6 Siege can be played on.
Region
The regions the datacenters are grouped in.