5 releases

0.1.4 Feb 20, 2024
0.1.3 Jan 29, 2024
0.1.2 Jan 11, 2024
0.1.1 Jan 11, 2024
0.1.0 Jan 11, 2024

#215 in HTTP client

25 downloads per month

MIT license

94KB
2K SLoC

Rust bindings for the Valorant Assets API

This crate provides Rust bindings for the Valorant Assets API.

Installation

Install this crate with cargo add valorant-assets-api or add it to your Cargo.toml.

Usage

use valorant_assets_api::agents::{get_agent, get_agents};
use valorant_assets_api::models::language::Language;

#[tokio::main]
async fn main() {
    // Create a reqwest::Client, which is used to send HTTP requests.
    let client = reqwest::Client::new();

    // Get a list of agents from the Valorant API. (language is optional)
    let agents = get_agents(&client, Some(Language::DeDe), None)
        .await
        .expect("Failed to get agents");

    println!(
        "Agents: {:?}",
        agents
            .iter()
            .map(|x| x.display_name.clone())
            .collect::<Vec<_>>()
    );

    println!(
        "Single Agent: {:#?}",
        agents.first()
    );
}

Dependencies

~5–18MB
~271K SLoC