|
1 | | -//! # steam-rs: Safe bindings for the Steam Web API |
| 1 | +//! # steam-rs |
2 | 2 | //! |
3 | | -//! The `steam-rs` crate provides convenient Rust bindings for the Steam Web API. |
4 | | -//! This crate provides safe and convenient Rust bindings for the Steam Web API. |
| 3 | +//! Safe and convenient Rust bindings for the Steam Web API. |
5 | 4 | //! |
6 | | -//! ### Warning! |
7 | | -//! This crate is currently a work in progress, so please expect breaking changes and instability. Please be careful when using this! **This is not production ready!** |
| 5 | +//! **Warning**: This crate is still a work in progress. Breaking changes and instability are to be expected. Use with caution—**this is not production-ready**. |
| 6 | +//! |
| 7 | +//! The core of this crate is the [`Steam`] struct, which interacts with the Steam Web API. It typically[^1] needs to be initialized with a valid Steam API key. |
| 8 | +//! |
| 9 | +//! ``` |
| 10 | +//! // Retrieve the Steam API key from an environment variable. |
| 11 | +//! let steam_api_key = &std::env::var("STEAM_API_KEY").expect("Missing an API key"); |
| 12 | +//! |
| 13 | +//! // Initialize the Steam API client. |
| 14 | +//! let steam = Steam::new(steam_api_key); |
| 15 | +//! ``` |
| 16 | +//! |
| 17 | +//! Another key component of this crate is the [`SteamId`](`steam_id::SteamId`) struct. It represents a Steam user ID[^2], which is often used when querying user data. |
| 18 | +//! |
| 19 | +//! ``` |
| 20 | +//! let steam_ids = vec![ |
| 21 | +//! SteamId::new(76561198136162943), |
| 22 | +//! SteamId(76561197960435530), |
| 23 | +//! ]; |
| 24 | +//! |
| 25 | +//! // Request the player summaries of SteamIDs `76561198136162943` and `76561197960435530`. |
| 26 | +//! let player_summaries = steam.get_player_summaries(steam_ids).await.unwrap(); |
| 27 | +//! ``` |
| 28 | +//! |
| 29 | +//! [^1]: Not all API endpoints require an API key, and in that case providing one is optional. |
| 30 | +//! [^2]: Specifically, [`SteamId`](`steam_id::SteamId`) represents a SteamID64 type, but more types, such as SteamID and SteamID3 are planned in future releases. |
8 | 31 |
|
9 | 32 | pub mod econ_service; |
10 | 33 | pub mod game_servers_service; |
|
0 commit comments