irontide-session 1.0.1

BitTorrent session management: peers, torrents, and piece selection
Documentation
#![warn(missing_docs)]
//! `BitTorrent` session management: peers, torrents, and piece selection.

pub mod alert;
/// Transactional `apply_settings` skeleton with phase-ordered rollback (M173 Lane B).
pub mod apply;
/// qBt-compat category registry (M170).
pub mod category_manager;
mod error;
pub(crate) mod metadata;
pub(crate) mod metadata_resolver;
/// M226: engine-side OS notification dispatcher
/// (completion + error toasts via `notify-rust` / zbus).
pub mod notification;
/// M226: engine-side watched-folder auto-add dispatcher
/// (notify-debouncer-full → `add_torrent`).
pub mod watched_folder;
pub(crate) mod peer_state;
/// Shared helpers for TOML-backed user-facing registries (category/tag) — M171.
pub(crate) mod registry_common;
/// Save-path token expansion (M173 Lane A — Decision 5).
pub mod save_path;
mod settings;
/// qBt-compat tag registry (M171).
pub mod tag_manager;
mod types;
// These will be added as they're implemented:
pub(crate) mod ban;
pub(crate) mod blocking_spawner;
pub(crate) mod buffer_pool;
pub(crate) mod choker;
#[allow(dead_code)] // M73: retained for endgame pathway and future use
pub(crate) mod chunk_mask;
/// Disk I/O manager: configuration, handles, and statistics.
pub mod disk;
/// Pluggable disk I/O backend trait and implementations.
pub mod disk_backend;
#[allow(dead_code)] // Wired in during Task 2 (DSCP wiring to session/torrent actors).
pub(crate) mod dscp;
pub(crate) mod end_game;
pub mod extension;
pub mod hash_pool;
/// io_uring disk I/O backend (Linux-only, feature-gated).
#[cfg(all(target_os = "linux", feature = "io-uring"))]
pub(crate) mod io_uring_backend;
/// IOCP disk I/O backend (Windows-only, feature-gated).
#[cfg(all(target_os = "windows", feature = "iocp"))]
pub(crate) mod iocp_backend;
// have_buffer removed in M118 — replaced by broadcast channel
pub mod i2p;
pub(crate) mod ip_filter;
#[allow(dead_code)] // Wired in during Task 2 (session.rs integration).
pub(crate) mod listener;
pub(crate) mod lsd;
pub(crate) mod lt_trackers;
pub(crate) mod peer;
pub(crate) mod peer_adder;
pub(crate) mod peer_backpressure;
pub(crate) mod peer_codec;
pub(crate) mod peer_connection;
#[allow(dead_code)] // Wired in during Task 2 (BEP 40 peer eviction integration).
pub(crate) mod peer_priority;
pub(crate) mod peer_shared;
pub(crate) mod peer_states;
pub(crate) mod peer_tasks;
mod persistence;
pub(crate) mod pex;
pub(crate) mod piece_reservation;
#[allow(dead_code)] // M73: retained for endgame pathway and future use
pub(crate) mod piece_selector;
pub(crate) mod pipeline;
#[allow(dead_code)] // Wired in during Step 5 (proxy integration).
pub(crate) mod proxy;
pub(crate) mod queue;
pub(crate) mod rate_limiter;
/// Resume file persistence: serialize, deserialize, atomic write, and directory helpers.
pub mod resume_file;
mod session;
pub(crate) mod slot_tuner;
#[allow(dead_code)] // Wired in during Phase 3c (session SSL integration).
pub(crate) mod ssl_manager;
pub mod stats;
pub mod streaming;
pub(crate) mod super_seed;
pub(crate) mod timed_lock;
mod torrent;
mod torrent_dispatch;
pub(crate) mod torrent_peer_handler;
mod torrent_peers;
mod torrent_state;
mod torrent_verify;
pub(crate) mod tracker_manager;
pub mod transport;
// M218: was `pub(crate)`. Promoted to `pub` so the GUI's URL-tab fetch can
// share the same SSRF redirect policy / validators as tracker + web-seed
// HTTP code. Only the four items below are exported from the module —
// internal helpers remain unreachable to external callers.
pub mod url_guard;
pub(crate) mod utp_routing;
pub(crate) mod vectored_io;
/// Verify-Before-Download: fast file-size pre-scan (M205).
pub mod verify_before_download;
pub(crate) mod web_seed;

pub use crate::piece_selector::build_wanted_pieces;
pub use crate::tracker_manager::{TrackerInfo, TrackerStatus};
pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
pub use apply::{ApplyError, Phase, ReconfigGuard, ReconfigInFlight, apply_phases_with_rollback};
pub use ban::BanConfig;
pub use category_manager::{
    CategoryError, CategoryMetadata, CategoryRegistry, resolve_category_registry_path,
};
pub use choker::{ChokingAlgorithm, SeedChokingAlgorithm};
pub use disk::{DiskConfig, DiskHandle, DiskJobFlags, DiskManagerHandle, DiskStats};
pub use disk_backend::{DisabledDiskIo, DiskIoBackend, DiskIoStats};
pub use error::{Error, Result};
pub use extension::ExtensionPlugin;
pub use hash_pool::{HashJob, HashPool, HashResult};
pub use i2p::{I2pDestination, I2pDestinationError};
pub use ip_filter::{IpFilter, IpFilterError, PortFilter, parse_dat, parse_p2p};
pub use irontide_core::{WebSeedState, WebSeedStats};
pub use peer_state::PeerSource;
pub use peer_states::PeerPipelineSnapshot;
pub use persistence::{DhtNodeEntry, PeerStrikeEntry, SessionState, validate_resume_bitfield};
pub use proxy::{ProxyConfig, ProxyType};
pub use rate_limiter::MixedModeAlgorithm;
pub use resume_file::{ResumeFileError, default_resume_dir};
pub use save_path::{
    ExpandSavePathError, SimpleContentType, TorrentSavePathContext, expand_save_path_for_category,
    expand_save_path_template,
};
pub use session::{AddSource, AddTorrentParams, AppliedSettings, ResumeLoadResult, SessionHandle};
pub use settings::{
    DEFAULT_ADMINADMIN_HASH, MaxRatioAction, QbtCompatSettings, QbtCredentialMigration,
    QbtMigrationError, Settings, hash_qbt_password, migrate_qbt_credentials,
};
pub use stats::{
    MetricKind, NUM_METRICS, SessionCounters, SessionStatsMetric, session_stats_metrics,
};
pub use streaming::FileStream;
pub use tag_manager::{TagError, TagRegistry, resolve_tag_registry_path};
pub use torrent::TorrentHandle;
pub use transport::{BoxedStream, NetworkFactory, TransportListener};
pub use types::{
    DebugDispatchState, DebugPeerState, DebugState, DebugTorrentState, FileInfo, FileMode,
    FileStatus, PartialPieceInfo, PeerInfo, SessionStats, StorageFactory, TorrentConfig,
    TorrentFlags, TorrentInfo, TorrentState, TorrentStats, TorrentSummary,
};