Skip to main content

irontide_session/
lib.rs

1#![warn(missing_docs)]
2//! BitTorrent session management: peers, torrents, and piece selection.
3
4pub mod alert;
5mod error;
6pub(crate) mod metadata;
7pub(crate) mod metadata_resolver;
8pub(crate) mod peer_state;
9mod settings;
10mod types;
11// These will be added as they're implemented:
12pub(crate) mod ban;
13pub(crate) mod blocking_spawner;
14pub(crate) mod buffer_pool;
15pub(crate) mod choker;
16#[allow(dead_code)] // M73: retained for endgame pathway and future use
17pub(crate) mod chunk_mask;
18/// Disk I/O manager: configuration, handles, and statistics.
19pub mod disk;
20/// Pluggable disk I/O backend trait and implementations.
21pub mod disk_backend;
22#[allow(dead_code)] // Wired in during Task 2 (DSCP wiring to session/torrent actors).
23pub(crate) mod dscp;
24pub(crate) mod end_game;
25pub mod extension;
26pub mod hash_pool;
27/// io_uring disk I/O backend (Linux-only, feature-gated).
28#[cfg(all(target_os = "linux", feature = "io-uring"))]
29pub(crate) mod io_uring_backend;
30/// IOCP disk I/O backend (Windows-only, feature-gated).
31#[cfg(all(target_os = "windows", feature = "iocp"))]
32pub(crate) mod iocp_backend;
33// have_buffer removed in M118 — replaced by broadcast channel
34pub mod i2p;
35pub(crate) mod ip_filter;
36#[allow(dead_code)] // Wired in during Task 2 (session.rs integration).
37pub(crate) mod listener;
38pub(crate) mod lsd;
39pub(crate) mod lt_trackers;
40pub(crate) mod peer;
41pub(crate) mod peer_adder;
42pub(crate) mod peer_codec;
43pub(crate) mod peer_connection;
44#[allow(dead_code)] // Wired in during Task 2 (BEP 40 peer eviction integration).
45pub(crate) mod peer_priority;
46pub(crate) mod peer_shared;
47pub(crate) mod peer_states;
48pub(crate) mod peer_tasks;
49mod persistence;
50pub(crate) mod pex;
51pub(crate) mod piece_reservation;
52#[allow(dead_code)] // M73: retained for endgame pathway and future use
53pub(crate) mod piece_selector;
54pub(crate) mod pipeline;
55#[allow(dead_code)] // Wired in during Step 5 (proxy integration).
56pub(crate) mod proxy;
57pub(crate) mod queue;
58pub(crate) mod rate_limiter;
59/// Resume file persistence: serialize, deserialize, atomic write, and directory helpers.
60pub mod resume_file;
61mod session;
62pub(crate) mod slot_tuner;
63#[allow(dead_code)] // Wired in during Phase 3c (session SSL integration).
64pub(crate) mod ssl_manager;
65pub mod stats;
66pub mod streaming;
67pub(crate) mod super_seed;
68pub(crate) mod timed_lock;
69mod torrent;
70mod torrent_dispatch;
71pub(crate) mod torrent_peer_handler;
72mod torrent_peers;
73mod torrent_state;
74mod torrent_verify;
75pub(crate) mod tracker_manager;
76pub mod transport;
77pub(crate) mod url_guard;
78pub(crate) mod utp_routing;
79pub(crate) mod vectored_io;
80pub(crate) mod web_seed;
81
82pub use crate::piece_selector::build_wanted_pieces;
83pub use crate::tracker_manager::{TrackerInfo, TrackerStatus};
84pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
85pub use ban::BanConfig;
86pub use choker::{ChokingAlgorithm, SeedChokingAlgorithm};
87pub use disk::{DiskConfig, DiskHandle, DiskJobFlags, DiskManagerHandle, DiskStats};
88pub use disk_backend::{DisabledDiskIo, DiskIoBackend, DiskIoStats};
89pub use error::{Error, Result};
90pub use extension::ExtensionPlugin;
91pub use hash_pool::{HashJob, HashPool, HashResult};
92pub use i2p::{I2pDestination, I2pDestinationError};
93pub use ip_filter::{IpFilter, IpFilterError, PortFilter, parse_dat, parse_p2p};
94pub use peer_state::PeerSource;
95pub use peer_states::PeerPipelineSnapshot;
96pub use persistence::{DhtNodeEntry, PeerStrikeEntry, SessionState, validate_resume_bitfield};
97pub use proxy::{ProxyConfig, ProxyType};
98pub use rate_limiter::MixedModeAlgorithm;
99pub use resume_file::{ResumeFileError, default_resume_dir};
100pub use session::{ResumeLoadResult, SessionHandle};
101pub use settings::Settings;
102pub use stats::{
103    MetricKind, NUM_METRICS, SessionCounters, SessionStatsMetric, session_stats_metrics,
104};
105pub use streaming::FileStream;
106pub use torrent::TorrentHandle;
107pub use transport::{BoxedStream, NetworkFactory, TransportListener};
108pub use types::{
109    FileInfo, FileMode, FileStatus, PartialPieceInfo, PeerInfo, SessionStats, StorageFactory,
110    TorrentConfig, TorrentFlags, TorrentInfo, TorrentState, TorrentStats, TorrentSummary,
111};