Skip to main content

steam_user/
lib.rs

1// TODO: visibility audit pending — many internals are still `pub mod`; tighten to `pub(crate)` in v0.2
2//! Steam Community web client for Rust.
3//!
4//! This crate provides HTTP-based interactions with Steam Community web
5//! endpoints, including mobile confirmations, profile management, market
6//! operations, and more.
7//!
8//! # Crate layout
9//!
10//! Users only need to depend on **`steam-user`**:
11//!
12//! ```toml
13//! [dependencies]
14//! steam-user = "0.1"
15//! ```
16//!
17//! The companion crate **`steam-user-impl`** holds the `#[steam_endpoint]`
18//! procedural macro and exists only because Rust requires proc-macros to live
19//! in a separate crate (the same reason `serde`/`serde_derive`,
20//! `tokio`/`tokio-macros`, and `thiserror`/`thiserror-impl` are split). The
21//! single macro it exports is re-exported here as
22//! [`endpoint::steam_endpoint`] under `#[doc(hidden)]`. **Do not depend on
23//! `steam-user-impl` directly** — its API is unstable and version-locked
24//! (`=X.Y.Z`) to this crate.
25//!
26//! # Overview
27//!
28//! This crate interacts with Steam via regular HTTP requests to
29//! steamcommunity.com endpoints. This is useful for:
30//!
31//! - Managing mobile trade confirmations
32//! - Two-factor authentication setup
33//! - Profile editing
34//! - Market and inventory operations
35//! - Group management
36//!
37//! # Example
38//!
39//! ```rust,no_run
40//! use steam_user::SteamUser;
41//!
42//! #[tokio::main]
43//! async fn main() -> Result<(), steam_user::SteamUserError> {
44//!     let mut community = SteamUser::new(&["steamLoginSecure=...", "sessionid=..."])?;
45//!
46//!     // Check if logged in
47//!     let logged_in = community.logged_in().await?;
48//!     println!("Logged in: {:?}", logged_in);
49//!
50//!     Ok(())
51//! }
52//! ```
53
54#[macro_use]
55mod api_registry;
56
57mod action;
58pub mod client;
59pub mod endpoint;
60mod error;
61pub mod limiter;
62mod retry;
63pub mod services;
64mod session;
65pub mod types;
66pub mod utils;
67
68pub mod steam_user_api;
69mod trait_impl;
70
71#[cfg(feature = "remote")]
72pub mod remote;
73
74pub mod fallback;
75#[cfg(feature = "gas")]
76pub mod gas;
77
78// Re-export main types
79pub use action::{ActionContext, ApiAction};
80pub use client::SteamUser;
81pub use error::SteamUserError;
82pub use fallback::FallbackSteamUser;
83pub use session::Session;
84pub use steam_user_api::SteamUserApi;
85// Re-export steamid for convenience
86pub use steamid::SteamID;
87// Re-export match history types
88pub use types::match_history::{Match, MatchHistoryResponse, MatchHistoryType, MatchPlayer, Team};
89// Re-export service types
90pub use types::{AliasEntry, AppDetail, AppPriceOverview, BanStatus, BoosterPackEntry, CsgoAccountStats, EconItem, FriendDetails, GameBanData, GemValue, GroupInfo, MarketItem, OwnedApp, PrivacySettings, PrivacyState, ProfileSettings, PublicProfileSummary, SteamGuardStatus, SteamProfile, TwoFactorResponse, UserComment};