valorant_assets_api/lib.rs
1//! # Rust bindings for the [Valorant Assets API](https://valorant-api.com/)
2//!
3//! This crate provides Rust bindings for the [Valorant Assets API](https://valorant-api.com/).
4//!
5//! ## Installation
6//!
7//! Install this crate with `cargo add valorant-assets-api` or add it to your `Cargo.toml`.
8//!
9//! ## Usage
10//!
11//! ```rust
12//! use valorant_assets_api::agents::{get_agent, get_agents};
13//! use valorant_assets_api::models::language::Language;
14//!
15//! #[tokio::main]
16//! async fn main() {
17//! // Create a reqwest::Client, which is used to send HTTP requests.
18//! let client = reqwest::Client::new();
19//!
20//! // Get a list of agents from the Valorant API. (language is optional)
21//! let agents = get_agents(&client, Some(Language::DeDe), None)
22//! .await
23//! .expect("Failed to get agents");
24//!
25//! println!(
26//! "Agents: {:?}",
27//! agents
28//! .iter()
29//! .map(|x| x.display_name.clone())
30//! .collect::<Vec<_>>()
31//! );
32//!
33//! println!(
34//! "Single Agent: {:#?}",
35//! agents.first()
36//! );
37//! }
38//! ```
39
40pub mod endpoints;
41pub mod models;
42
43pub use endpoints::*;