steamroom_client/lib.rs
1//! High-level Steam depot download orchestration and delta patching.
2//!
3//! Built on [`steamroom`] for protocol-level operations, this crate handles the
4//! full download lifecycle:
5//!
6//! - **[`download`]** -- Pipelined chunk fetching with concurrent I/O, backpressure,
7//! retry with exponential backoff, and ordered file assembly
8//! - **[`download::FileFilter`]** -- Filter files by literal paths, regex, or
9//! `regex:`-prefixed filelist entries (compatible with DepotDownloader format)
10//! - **[`download::CdnChunkFetcher`]** -- CDN fetcher with automatic server rotation
11//! and rate-limit awareness via [`steamroom::cdn::CdnServerPool`]
12//! - **[`depot_config`]** -- Track installed manifests and depot keys for delta updates
13//! - **[`event`]** -- [`DownloadEvent`](event::DownloadEvent) stream for progress reporting
14//! - **[`manifest`]** -- Manifest cache for avoiding redundant CDN downloads
15//!
16//! # Example
17//!
18//! ```rust,no_run
19//! use steamroom::depot::{DepotId, DepotKey};
20//! use steamroom::cdn::{CdnClient, CdnServerPool};
21//! use steamroom::cdn::server::CdnServer;
22//! use steamroom_client::download::{CdnChunkFetcher, DepotJob};
23//! use steamroom_client::event::DownloadEvent;
24//!
25//! # async fn example(
26//! # depot_key: DepotKey,
27//! # cdn_servers: Vec<CdnServer>,
28//! # manifest: steamroom::depot::manifest::DepotManifest,
29//! # ) -> Result<(), Box<dyn std::error::Error>> {
30//! let (event_tx, mut event_rx) = tokio::sync::mpsc::unbounded_channel();
31//!
32//! let job = DepotJob::builder()
33//! .depot_id(DepotId(481))
34//! .depot_key(depot_key)
35//! .install_dir("/tmp/spacewar".into())
36//! .verify(true)
37//! .event_sender(event_tx)
38//! .build()
39//! .expect("missing required fields");
40//!
41//! let fetcher = CdnChunkFetcher::new(
42//! CdnClient::new().expect("http client"),
43//! CdnServerPool::new(cdn_servers),
44//! None,
45//! );
46//!
47//! let stats = job.download(&manifest, std::sync::Arc::new(fetcher)).await
48//! .expect("download failed");
49//! println!("downloaded {} files ({} bytes)", stats.files_completed, stats.bytes_downloaded);
50//! # Ok(())
51//! # }
52//! ```
53
54/// Saved login token storage.
55pub mod credentials;
56/// Installed depot/manifest tracking for delta updates.
57pub mod depot_config;
58/// Pipelined download orchestration, file filtering, and retry logic.
59pub mod download;
60/// Download progress events for UI integration.
61pub mod event;
62/// Manifest cache to avoid redundant CDN fetches.
63pub mod manifest;
64
65#[cfg(test)]
66mod depot_config_tests;
67#[cfg(test)]
68mod download_tests;