halo_api 0.3.0

Unofficial Halo Infinite REST API client for Rust (CSR, service record, match history, and more).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Prints the logged-in player's match-history privacy settings.

mod common;

use halo_api::clients::hi::Player;

#[tokio::main]
async fn main() -> Result<(), common::ExampleError> {
    let (xbox, halo) = common::halo_infinite_client()?;
    let (gamertag, xuid) = common::logged_in_player(&xbox).await?;
    let privacy = halo.matches_privacy(&Player::from(&xuid)).await?;

    println!("{gamertag}");
    println!("  matchmade games: {:?}", privacy.matchmade_setting());
    println!("  other games:     {:?}", privacy.other_setting());
    Ok(())
}