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