Function prelate_rs::global_games

source ·
pub fn global_games() -> GlobalGamesQuery
Expand description

Returns a GlobalGamesQuery. Used to query the /games endpoint.

§Examples

§List Ranked 1v1 Games

In the following example, we collect the 100 most recent ranked 1v1 games into a Vec:

use prelate_rs::{futures::StreamExt, global_games, types::games::GameKind};

let stream = global_games()
    .with_leaderboard(Some(vec![GameKind::Rm1v1]))
    .get(100)
    .await
    .expect("query should succeed");
let games = stream.collect::<Vec<_>>().await;

for game in games {
    // Do something with each game.
}