irontide-session-core 1.0.2

BitTorrent session machinery: registries, queue, resume, apply, persistence (base layer)
Documentation
#![warn(missing_docs)]
//! `IronTide` session machinery (base layer; M244c).
//!
//! Holds the supporting modules the session orchestrator (`irontide-session`'s
//! `session.rs`) builds on — registries, queue, resume, apply, persistence,
//! listeners, and the engine/support re-export shims — so the 12k-LOC
//! orchestrator compiles independently of this stable base.

// error / i2p / rate_limiter / slot_tuner / stats / transport live in
// irontide-engine-support (M244b); re-exported at their old crate:: paths so
// the machinery references resolve zero-churn.
pub(crate) use irontide_engine_support::error;
pub use irontide_engine_support::i2p;
pub(crate) use irontide_engine_support::rate_limiter;
pub use irontide_engine_support::stats;
pub use irontide_engine_support::transport;
// M244b engine/session split: the per-torrent actor + non-leaf infra moved to
// irontide-engine; re-export the modules the machinery reaches at their old
// crate:: paths so the moved files resolve zero-churn. `metadata` is the only
// engine crate-private shim the machinery (metadata_resolver) reaches — the
// rest (proxy / torrent / peer_state / …) are session.rs's and stay there.
pub(crate) use irontide_engine::metadata;
pub use irontide_engine::{
    alert, disk, disk_backend, extension, hash_pool, streaming, url_guard, verify_before_download,
};

// --- the session machinery (M244c: descended from irontide-session). All `pub`
// so irontide-session can re-export them at their old crate:: paths; the sibling
// narrows visibility per-module to keep its surface byte-stable. ---
/// Transactional `apply_settings` skeleton with phase-ordered rollback (M173 Lane B).
pub mod apply;
/// qBt-compat category registry (M170).
pub mod category_manager;
/// TCP/uTP listener polling, extracted from `SessionActor`'s main `select!` loop.
pub mod listener;
/// Local Service Discovery (LSD / BEP-14) announce + receive.
pub mod lsd;
/// Magnet metadata (BEP-9) resolution for off-actor adds.
pub mod metadata_resolver;
/// M226: engine-side OS notification dispatcher
/// (completion + error toasts via `notify-rust` / zbus).
pub mod notification;
/// Session-state persistence: peer-strike / DHT-node / resume snapshot types.
pub mod persistence;
/// Torrent queue + auto-management (active/seeding caps, FIFO position).
pub mod queue;
/// Shared helpers for TOML-backed user-facing registries (category/tag) — M171.
pub(crate) mod registry_common;
/// Resume file persistence: serialize, deserialize, atomic write, and directory helpers.
pub mod resume_file;
/// Save-path token expansion (M173 Lane A — Decision 5).
pub mod save_path;
/// `Settings` → runtime-config conversions, as a session-local extension trait (M242).
pub mod settings_convert;
/// qBt-compat tag registry (M171).
pub mod tag_manager;
/// Shared session payload + debug snapshot types.
pub mod types;
/// uTP routing helpers shared by the listener + LSD paths.
pub(crate) mod utp_routing;

// --- flattened re-exports preserved at the old crate:: paths (machinery uses
// these internally; irontide-session re-exports the public ones for the facade).
// The session-types line (AddSource/AddTorrentParams/… from session.rs) stays in
// irontide-session — session.rs did not move. ---
pub use alert::{Alert, AlertCategory, AlertKind, AlertStream};
pub use apply::{ApplyError, Phase, ReconfigGuard, ReconfigInFlight, apply_phases_with_rollback};
pub use category_manager::{
    CategoryError, CategoryMetadata, CategoryRegistry, resolve_category_registry_path,
};
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 irontide_core::validate_resume_bitfield;
pub use irontide_core::{WebSeedState, WebSeedStats};
pub use irontide_engine::{
    ChokingAlgorithm, PeerPipelineSnapshot, PeerSource, ProxyConfig, ProxyType,
    SeedChokingAlgorithm, TorrentHandle, TrackerInfo, TrackerStatus, build_wanted_pieces,
};
pub use irontide_session_types::ban::BanConfig;
pub use irontide_session_types::ip_filter::{
    IpFilter, IpFilterError, PortFilter, parse_dat, parse_p2p,
};
pub use irontide_settings::{
    DEFAULT_ADMINADMIN_HASH, MaxRatioAction, QbtCompatSettings, QbtCredentialMigration,
    QbtMigrationError, Settings, SettingsError, hash_qbt_password, migrate_qbt_credentials,
};
pub use persistence::{DhtNodeEntry, PeerStrikeEntry, SessionState};
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 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 transport::{BoxedStream, NetworkFactory, TransportListener};
pub use types::{
    DebugDispatchState, DebugPeerState, DebugState, DebugTorrentState, FileInfo, FileMode,
    FileStatus, PartialPieceInfo, PeerInfo, SessionStats, StorageFactory, TorrentConfig,
    TorrentFlags, TorrentInfo, TorrentState, TorrentStats, TorrentSummary,
};