Skip to main content

irontide_engine/
lib.rs

1//! `IronTide` engine runtime: the per-torrent actor, the per-peer I/O loops, and
2//! the non-leaf engine infrastructure (disk I/O, tracker management, alerts,
3//! streaming, extensions, SSL).
4//!
5//! Renamed from the ROADMAP's tentative `irontide-torrent-actor` at the M244b
6//! eng-review (Option 3 hybrid + rename). Sits above the pure leaves
7//! (`irontide-engine-support`, `irontide-session-types`, `irontide-peer-io`,
8//! `irontide-settings`) and below session-core (`irontide-session`), which
9//! consumes this crate's public surface via `irontide_engine::…`.
10
11// M244b engine split: the moved actor / peer / infra files reach the descended
12// leaves (`irontide-engine-support`, M244b commit 1) and the M244a session-type
13// vocabulary (`ban` / `ip_filter`) at their original `crate::` paths. Re-export
14// each at this crate root so those ~600 in-file references resolve zero-churn.
15// `error` is split out because the `pub use error::{…}` below consumes it.
16pub(crate) use irontide_engine_support::error;
17pub(crate) use irontide_engine_support::{i2p, rate_limiter, slot_tuner, stats, transport};
18pub(crate) use irontide_session_types::ban;
19// `ip_filter` is referenced only by engine's inline unit tests (production
20// code takes `irontide_session_types::SharedIpFilter` directly); gate the
21// re-export so the non-test lib build doesn't flag it unused under `-D warnings`.
22#[cfg(test)]
23pub(crate) use irontide_session_types::ip_filter;
24
25/// Session alert stream: categories, kinds, and the broadcast surface.
26pub mod alert;
27/// Blocking task spawner for disk + hashing offload.
28pub mod blocking_spawner;
29pub(crate) mod buffer_pool;
30pub(crate) mod choker;
31#[allow(dead_code)] // M73: retained for endgame pathway and future use
32pub(crate) mod chunk_mask;
33/// Disk I/O manager: configuration, handles, and statistics.
34pub mod disk;
35/// Pluggable disk I/O backend trait and implementations.
36pub mod disk_backend;
37#[allow(dead_code)] // Wired in during Task 2 (DSCP wiring to session/torrent actors).
38pub(crate) mod dscp;
39pub(crate) mod end_game;
40/// Extension-protocol (BEP 10) plugin surface.
41pub mod extension;
42/// Parallel SHA-1/SHA-256 piece-hashing pool.
43pub mod hash_pool;
44/// io_uring disk I/O backend (Linux-only, feature-gated).
45#[cfg(all(target_os = "linux", feature = "io-uring"))]
46pub(crate) mod io_uring_backend;
47/// IOCP disk I/O backend (Windows-only, feature-gated).
48#[cfg(all(target_os = "windows", feature = "iocp"))]
49pub(crate) mod iocp_backend;
50pub(crate) mod lt_trackers;
51/// BEP 9 metadata download coordinator.
52pub mod metadata;
53pub(crate) mod peer;
54pub(crate) mod peer_adder;
55pub(crate) mod peer_backpressure;
56pub(crate) mod peer_connection;
57#[allow(dead_code)] // Wired in during Task 2 (BEP 40 peer eviction integration).
58pub(crate) mod peer_priority;
59pub(crate) mod peer_shared;
60/// Per-torrent peer pipeline state machine.
61pub mod peer_state;
62pub(crate) mod peer_states;
63pub(crate) mod peer_tasks;
64pub(crate) mod pex;
65pub(crate) mod piece_reservation;
66#[allow(dead_code)] // M73: retained for endgame pathway and future use
67pub(crate) mod piece_selector;
68pub(crate) mod pipeline;
69/// Proxy configuration (SOCKS5 / HTTP) for peer + tracker connections.
70#[allow(dead_code)] // Wired in during Step 5 (proxy integration).
71pub mod proxy;
72/// SSL/TLS peer connection manager.
73#[allow(dead_code)] // Wired in during Phase 3c (session SSL integration).
74pub mod ssl_manager;
75/// Sequential / streaming file read surface.
76pub mod streaming;
77pub(crate) mod super_seed;
78pub(crate) mod timed_lock;
79/// The per-torrent actor handle and its command surface.
80pub mod torrent;
81pub(crate) mod torrent_dispatch;
82pub(crate) mod torrent_peer_handler;
83pub(crate) mod torrent_peers;
84pub(crate) mod torrent_state;
85pub(crate) mod torrent_verify;
86/// Per-torrent tracker manager: announce scheduling + status.
87pub mod tracker_manager;
88mod types;
89// M218: `url_guard` is `pub` so the GUI's URL-tab fetch can share the same SSRF
90// redirect policy / validators as the tracker + web-seed HTTP code.
91/// SSRF-safe URL validation + redirect policy for user-supplied URLs.
92pub mod url_guard;
93/// Verify-Before-Download: fast file-size pre-scan (M205).
94pub mod verify_before_download;
95pub(crate) mod web_seed;
96
97pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
98pub use choker::{ChokingAlgorithm, SeedChokingAlgorithm};
99pub use disk::{DiskConfig, DiskHandle, DiskJobFlags, DiskManagerHandle, DiskStats};
100pub use disk_backend::{DisabledDiskIo, DiskIoBackend, DiskIoStats};
101pub use error::{Error, Result};
102pub use extension::ExtensionPlugin;
103pub use hash_pool::{HashJob, HashPool, HashResult};
104pub use peer_state::PeerSource;
105pub use peer_states::PeerPipelineSnapshot;
106pub use piece_selector::build_wanted_pieces;
107pub use proxy::{ProxyConfig, ProxyType};
108pub use streaming::FileStream;
109pub use torrent::TorrentHandle;
110pub use tracker_manager::{TrackerInfo, TrackerStatus};
111pub use types::TorrentCommand;