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;
44pub(crate) mod lt_trackers;
45/// BEP 9 metadata download coordinator.
46pub mod metadata;
47pub(crate) mod peer;
48pub(crate) mod peer_adder;
49pub(crate) mod peer_backpressure;
50pub(crate) mod peer_connection;
51#[allow(dead_code)] // Wired in during Task 2 (BEP 40 peer eviction integration).
52pub(crate) mod peer_priority;
53pub(crate) mod peer_shared;
54/// Per-torrent peer pipeline state machine.
55pub mod peer_state;
56pub(crate) mod peer_states;
57pub(crate) mod peer_tasks;
58pub(crate) mod pex;
59pub(crate) mod piece_reservation;
60#[allow(dead_code)] // M73: retained for endgame pathway and future use
61pub(crate) mod piece_selector;
62pub(crate) mod pipeline;
63/// Proxy configuration (SOCKS5 / HTTP) for peer + tracker connections.
64#[allow(dead_code)] // Wired in during Step 5 (proxy integration).
65pub mod proxy;
66pub(crate) mod request_budget;
67/// SSL/TLS peer connection manager.
68#[allow(dead_code)] // Wired in during Phase 3c (session SSL integration).
69pub mod ssl_manager;
70/// Sequential / streaming file read surface.
71pub mod streaming;
72pub(crate) mod super_seed;
73pub(crate) mod timed_lock;
74/// The per-torrent actor handle and its command surface.
75pub mod torrent;
76pub(crate) mod torrent_dispatch;
77pub(crate) mod torrent_peer_handler;
78pub(crate) mod torrent_peers;
79pub(crate) mod torrent_state;
80pub(crate) mod torrent_verify;
81/// Per-torrent tracker manager: announce scheduling + status.
82pub mod tracker_manager;
83mod types;
84// M218: `url_guard` is `pub` so the GUI's URL-tab fetch can share the same SSRF
85// redirect policy / validators as the tracker + web-seed HTTP code.
86/// SSRF-safe URL validation + redirect policy for user-supplied URLs.
87pub mod url_guard;
88/// Verify-Before-Download: fast file-size pre-scan (M205).
89pub mod verify_before_download;
90pub(crate) mod web_seed;
91
92pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
93pub use choker::{ChokingAlgorithm, SeedChokingAlgorithm};
94pub use disk::{DiskConfig, DiskHandle, DiskJobFlags, DiskManagerHandle, DiskStats};
95pub use disk_backend::{DisabledDiskIo, DiskIoBackend, DiskIoStats};
96pub use error::{Error, Result};
97pub use extension::ExtensionPlugin;
98pub use hash_pool::{HashJob, HashPool, HashResult};
99pub use peer_state::PeerSource;
100pub use peer_states::PeerPipelineSnapshot;
101pub use piece_selector::build_wanted_pieces;
102pub use proxy::{ProxyConfig, ProxyType};
103pub use streaming::FileStream;
104pub use torrent::TorrentHandle;
105pub use tracker_manager::{TrackerInfo, TrackerStatus};
106pub use types::TorrentCommand;