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
54mod action;
55pub mod client;
56pub mod endpoint;
57mod error;
58pub mod limiter;
59mod retry;
60pub mod services;
61mod session;
62pub mod types;
63pub mod utils;
64
65pub mod steam_user_api;
66mod trait_impl;
67
68#[cfg(any(feature = "remote", feature = "gas"))]
69#[macro_use]
70mod passthrough_api_macro;
71
72#[cfg(feature = "remote")]
73pub mod remote;
74
75pub mod fallback;
76#[cfg(feature = "gas")]
77pub mod gas;
78
79// Re-export main types
80pub use action::{ActionContext, ApiAction};
81pub use client::SteamUser;
82pub use error::SteamUserError;
83pub use fallback::FallbackSteamUser;
84pub use session::Session;
85pub use steam_user_api::SteamUserApi;
86// Re-export steamid for convenience
87pub use steamid::SteamID;
88// Re-export match history types
89pub use types::match_history::{Match, MatchHistoryResponse, MatchHistoryType, MatchPlayer, Team};
90// Re-export service types
91pub use types::{AliasEntry, AppDetail, AppPriceOverview, BanStatus, BoosterPackEntry, CsgoAccountStats, EconItem, FriendDetails, GameBanData, GemValue, GroupInfo, MarketItem, OwnedApp, PrivacySettings, PrivacyState, ProfileSettings, PublicProfileSummary, SteamGuardStatus, SteamProfile, TwoFactorResponse, UserComment};