Skip to main content

irontide_session/
lib.rs

1#![warn(missing_docs)]
2//! `BitTorrent` session management: peers, torrents, and piece selection.
3
4// error / i2p / rate_limiter / slot_tuner / stats / transport live in
5// irontide-engine-support (M244b commit 1); re-exported at their old crate::
6// paths so the session orchestrator references resolve zero-churn.
7pub(crate) use irontide_engine_support::error;
8pub use irontide_engine_support::i2p;
9pub(crate) use irontide_engine_support::rate_limiter;
10pub(crate) use irontide_engine_support::slot_tuner;
11pub use irontide_engine_support::stats;
12pub use irontide_engine_support::transport;
13// ban + ip_filter live in irontide-session-types (M244a); re-exported so
14// crate::ban::* / crate::ip_filter::* resolve.
15pub(crate) use irontide_session_types::{ban, ip_filter};
16// M244b engine/session split: the per-torrent actor, the peer I/O loops, and
17// the non-leaf infra (alert / disk / tracker_manager / streaming / extension /
18// ssl_manager / hash_pool / …) moved to irontide-engine. Re-export the modules
19// session.rs reaches into, at their old crate:: paths, so the orchestrator
20// resolves zero-churn — `pub use` for the ones that were public (facade stays
21// byte-stable), `pub(crate) use` for the formerly crate-private ones.
22pub use irontide_engine::{
23    alert, disk, disk_backend, extension, hash_pool, streaming, url_guard, verify_before_download,
24};
25pub(crate) use irontide_engine::{
26    blocking_spawner, peer_state, proxy, ssl_manager, torrent, tracker_manager,
27};
28
29// M244c session-core split: the session machinery (registries, queue, resume,
30// apply, persistence, listeners, …) descended into irontide-session-core.
31// Re-export the modules session.rs / watched_folder reach, at their old crate::
32// paths and original visibilities, so the orchestrator resolves zero-churn and
33// the facade surface stays byte-stable.
34pub use irontide_session_core::{
35    apply, category_manager, notification, resume_file, save_path, tag_manager,
36};
37pub(crate) use irontide_session_core::{
38    listener, lsd, metadata_resolver, persistence, queue, settings_convert, types,
39};
40
41mod session;
42/// M226: engine-side watched-folder auto-add dispatcher
43/// (notify-debouncer-full → `add_torrent`).
44pub mod watched_folder;
45
46pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
47pub use apply::{ApplyError, Phase, ReconfigGuard, ReconfigInFlight, apply_phases_with_rollback};
48pub use category_manager::{
49    CategoryError, CategoryMetadata, CategoryRegistry, resolve_category_registry_path,
50};
51pub use disk::{DiskConfig, DiskHandle, DiskJobFlags, DiskManagerHandle, DiskStats};
52pub use disk_backend::{DisabledDiskIo, DiskIoBackend, DiskIoStats};
53pub use error::{Error, Result};
54pub use extension::ExtensionPlugin;
55pub use hash_pool::{HashJob, HashPool, HashResult};
56pub use i2p::{I2pDestination, I2pDestinationError};
57// M244b: re-exported from irontide-engine to preserve the public paths
58// `irontide_session::{TorrentHandle, ChokingAlgorithm, …}` (facade invariance).
59pub use irontide_core::validate_resume_bitfield;
60pub use irontide_core::{WebSeedState, WebSeedStats};
61pub use irontide_engine::{
62    ChokingAlgorithm, PeerPipelineSnapshot, PeerSource, ProxyConfig, ProxyType,
63    SeedChokingAlgorithm, TorrentHandle, TrackerInfo, TrackerStatus, build_wanted_pieces,
64};
65pub use irontide_session_types::ban::BanConfig;
66pub use irontide_session_types::ip_filter::{
67    IpFilter, IpFilterError, PortFilter, parse_dat, parse_p2p,
68};
69pub use irontide_settings::{
70    DEFAULT_ADMINADMIN_HASH, MaxRatioAction, QbtCompatSettings, QbtCredentialMigration,
71    QbtMigrationError, Settings, SettingsError, hash_qbt_password, migrate_qbt_credentials,
72};
73pub use persistence::{DhtNodeEntry, PeerStrikeEntry, SessionState};
74pub use rate_limiter::MixedModeAlgorithm;
75pub use resume_file::{ResumeFileError, default_resume_dir};
76pub use save_path::{
77    ExpandSavePathError, SimpleContentType, TorrentSavePathContext, expand_save_path_for_category,
78    expand_save_path_template,
79};
80pub use session::{
81    AddSource, AddTorrentParams, AppliedSettings, ResumeLoadResult, SessionHandle, SessionSnapshot,
82};
83pub use stats::{
84    MetricKind, NUM_METRICS, SessionCounters, SessionStatsMetric, session_stats_metrics,
85};
86pub use streaming::FileStream;
87pub use tag_manager::{TagError, TagRegistry, resolve_tag_registry_path};
88pub use transport::{BoxedStream, NetworkFactory, TransportListener};
89pub use types::{
90    DebugDispatchState, DebugPeerState, DebugState, DebugTorrentState, FileInfo, FileMode,
91    FileStatus, PartialPieceInfo, PeerInfo, SessionStats, StorageFactory, TorrentConfig,
92    TorrentFlags, TorrentInfo, TorrentState, TorrentStats, TorrentSummary,
93};