Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
garhow committed Jan 28, 2025
1 parent aa5062b commit dad63b9
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 14 deletions.
16 changes: 12 additions & 4 deletions ENDPOINTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ The following is a list of interfaces and endpoints that are currently supported
Interfaces that are prefixed with ✓ are fully implemented!

## ✓ IEconService
- [ ] FlushAssetAppearanceCache **(requires publisher key)**
- [ ] FlushContextCache **(requires publisher key)**
- [ ] FlushInventoryCache **(requires publisher key)**
- [x] GetTradeHistory
- [x] GetTradeOffers
- [x] GetTradeOffer
- [x] GetTradeOffersSummary
## IGameServersService
- [ ] GetAccountList
- [x] GetAccountList
- [ ] CreateAccount
- [ ] SetMemo
- [ ] ResetLoginToken
- [ ] DeleteAccount
- [ ] GetAccountPublicInfo
- [ ] QueryLoginToken
- [ ] GetServerSteamIDsByIP
- [x] GetAccountPublicInfo
- [x] QueryLoginToken
- [x] GetServerSteamIDsByIP
- [ ] GetServerIPsBySteamID
## ✓ IPlayerService
- [x] GetOwnedGames
Expand All @@ -40,8 +43,13 @@ Interfaces that are prefixed with ✓ are fully implemented!
## ✓ ISteamNews
- [x] GetNewsForApp
## ✓ ISteamRemoteStorage
- [ ] EnumerateUserSubscribedFiles **(requires publisher key)**
- [x] GetCollectionDetails
- [x] GetPublishedFileDetails
- [ ] GetUGCFileDetails
- [ ] SetUGCUsedByGC **(requires publisher key)**
- [ ] SubscribePublishedFile **(requires publisher key)**
- [ ] UnsubscribePublishedFile **(requires publisher key)**
## ISteamUser
- [ ] CheckAppOwnership **(requires publisher key)**
- [ ] GetAppPriceInfo **(requires publisher key)**
Expand Down
13 changes: 13 additions & 0 deletions src/econ_service/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
//! # Implements the `IEconService` interface
//!
//! Additional Steam Economy methods that provide access to Steam Trading.
//!
//! **Note:** This implementation is incomplete! The following endpoints are currently unimplemented
//!
//! - FlushAssetAppearanceCache (requires publisher key)
//! - FlushContextCache (requires publisher key)
//! - FlushInventoryCache (requires publisher key)
//!
//! Endpoints that require a publisher key are not likely to be
//! implemented in the near future, as they cannot be tested by developers.
pub mod get_trade_history;
pub mod get_trade_offer;
pub mod get_trade_offers;
Expand Down
2 changes: 1 addition & 1 deletion src/game_servers_service/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # Implements the IGameServersService interface
//! # Implements the `IGameServersService` interface
//!
//! Provides addtional methods for administration of Steam Game Servers
//! It's worth noting that steam ids aren't just for user accounts, servers also have steam ids
Expand Down
33 changes: 28 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
//! # steam-rs: Safe bindings for the Steam Web API
//! # steam-rs
//!
//! The `steam-rs` crate provides convenient Rust bindings for the Steam Web API.
//! This crate provides safe and convenient Rust bindings for the Steam Web API.
//! Safe and convenient Rust bindings for the Steam Web API.
//!
//! ### Warning!
//! 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!**
//! **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**.
//!
//! 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.
//!
//! ```
//! // Retrieve the Steam API key from an environment variable.
//! let steam_api_key = &std::env::var("STEAM_API_KEY").expect("Missing an API key");
//!
//! // Initialize the Steam API client.
//! let steam = Steam::new(steam_api_key);
//! ```
//!
//! 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.
//!
//! ```
//! let steam_ids = vec![
//! SteamId::new(76561198136162943),
//! SteamId(76561197960435530),
//! ];
//!
//! // Request the player summaries of SteamIDs `76561198136162943` and `76561197960435530`.
//! let player_summaries = steam.get_player_summaries(steam_ids).await.unwrap();
//! ```
//!
//! [^1]: Not all API endpoints require an API key, and in that case providing one is optional.
//! [^2]: Specifically, [`SteamId`](`steam_id::SteamId`) represents a SteamID64 type, but more types, such as SteamID and SteamID3 are planned in future releases.
pub mod econ_service;
pub mod game_servers_service;
Expand Down
4 changes: 2 additions & 2 deletions src/steam_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use serde::{Deserialize, Deserializer, Serialize};
///
/// # Conversions
///
/// You can convert a `SteamId` to a `u64` using the `into()` method:
/// You can convert a `u64` to a `SteamId` using the `into()` method:
/// ```
/// use steam_rs::steam_id::SteamId;
///
/// let steam_id: SteamId = 76561197960287930.into();
/// println!("SteamId as u64: {}", steam_id);
/// println!("SteamId from u64: {}", steam_id);
/// ```
///
/// # Formatting
Expand Down
19 changes: 17 additions & 2 deletions src/steam_remote_storage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
pub mod get_collection_details;
pub mod get_published_file;
//! # Implements the `ISteamRemoteStorage` interface
//!
//! Primary interface for interacting with the Steam Workshop and User Generated Content (UGC).
//!
//! **Note:** This implementation is incomplete! The following endpoints are currently unimplemented
//!
//! - EnumerateUserSubscribedFiles (requires publisher key)
//! - GetUGCFileDetails
//! - SetUGCUsedByGC (requires publisher key)
//! - SubscribePublishedFile (requires publisher key)
//! - UnsubscribePublishedFile (requires publisher key)
//!
//! Endpoints that require a publisher key are not likely to be
//! implemented in the near future, as they cannot be tested by developers.
const INTERFACE: &str = "ISteamRemoteStorage";

pub mod get_collection_details;
pub mod get_published_file;

0 comments on commit dad63b9

Please sign in to comment.