Expand description
BitTorrent session management: peers, torrents, and piece selection.
Re-exports§
pub use alert::Alert;pub use alert::AlertCategory;pub use alert::AlertKind;pub use alert::AlertStream;pub use apply::ApplyError;pub use apply::Phase;pub use apply::ReconfigGuard;pub use apply::ReconfigInFlight;pub use apply::apply_phases_with_rollback;pub use category_manager::CategoryError;pub use category_manager::CategoryMetadata;pub use category_manager::CategoryRegistry;pub use category_manager::resolve_category_registry_path;pub use disk::DiskConfig;pub use disk::DiskHandle;pub use disk::DiskJobFlags;pub use disk::DiskManagerHandle;pub use disk::DiskStats;pub use disk_backend::DisabledDiskIo;pub use disk_backend::DiskIoBackend;pub use disk_backend::DiskIoStats;pub use extension::ExtensionPlugin;pub use hash_pool::HashJob;pub use hash_pool::HashPool;pub use hash_pool::HashResult;pub use i2p::I2pDestination;pub use i2p::I2pDestinationError;pub use resume_file::ResumeFileError;pub use resume_file::default_resume_dir;pub use save_path::ExpandSavePathError;pub use save_path::SimpleContentType;pub use save_path::TorrentSavePathContext;pub use save_path::expand_save_path_for_category;pub use save_path::expand_save_path_template;pub use stats::MetricKind;pub use stats::NUM_METRICS;pub use stats::SessionCounters;pub use stats::SessionStatsMetric;pub use stats::session_stats_metrics;pub use streaming::FileStream;pub use tag_manager::TagError;pub use tag_manager::TagRegistry;pub use tag_manager::resolve_tag_registry_path;pub use transport::BoxedStream;pub use transport::NetworkFactory;pub use transport::TransportListener;
Modules§
- alert
- Alert/event system for push-based notifications.
- apply
- Transactional
apply_settingsskeleton with phase-ordered rollback (M173 Lane B). Transactionalapply_settingsskeleton with phase-ordered rollback (M173 Lane B, B1). - category_
manager - qBt-compat category registry (M170). qBt-compat category registry (M170).
- disk
- Disk I/O manager: configuration, handles, and statistics.
- disk_
backend - Pluggable disk I/O backend trait and implementations. Pluggable disk I/O backend abstraction.
- extension
- Extension plugin interface for custom BEP 10 extensions.
- hash_
pool - Dedicated thread pool for CPU-bound piece hash verification (M96).
- i2p
- I2P support via the SAM v3.1 bridge protocol.
- notification
- M226: engine-side OS notification dispatcher
(completion + error toasts via
notify-rust/ zbus). M226: engine-side OS notification dispatcher. - resume_
file - Resume file persistence: serialize, deserialize, atomic write, and directory helpers. Resume file persistence: serialize, deserialize, atomic write, and directory helpers.
- save_
path - Save-path token expansion (M173 Lane A — Decision 5). Save-path token expansion (M173 Lane A — Decision 5).
- stats
- Session statistics metric registry and atomic counter array.
- streaming
- File streaming —
AsyncRead+AsyncSeekover individual torrent files. - tag_
manager - qBt-compat tag registry (M171). qBt-compat tag registry (M171).
- transport
- Network transport abstraction layer.
- url_
guard - URL security validation — SSRF mitigation, IDNA rejection, HTTPS enforcement.
- verify_
before_ download - Verify-Before-Download: fast file-size pre-scan (M205). Verify-Before-Download: fast file-size pre-scan (M205).
- watched_
folder - M226: engine-side watched-folder auto-add dispatcher
(notify-debouncer-full →
add_torrent). M226 Step 6: engine-side watched-folder subsystem.
Structs§
- AddTorrent
Params - Unified parameters for
SessionHandle::add_torrent(M170). - Applied
Settings - Classification of settings-patch fields into “took effect immediately” versus “requires session restart to apply”.
- BanConfig
- Configuration for smart banning behaviour.
- Debug
Dispatch State - Dispatch-level diagnostic counters (session-wide + per-torrent).
- Debug
Peer State - Per-peer debug state for diagnosing throughput issues.
- Debug
State - Top-level debug state snapshot for all torrents in the session.
- Debug
Torrent State - Per-torrent debug state including dispatch counters and peer details.
- DhtNode
Entry - A DHT bootstrap node entry for session persistence.
- File
Info - Info about a file within a torrent.
- File
Status - Status of a single file within a torrent.
- IpFilter
- IP address filter supporting both IPv4 and IPv6 ranges.
- Partial
Piece Info - In-flight piece download status for the download queue.
- Peer
Info - Per-peer details exported for client UI introspection.
- Peer
Pipeline Snapshot - Point-in-time snapshot of [
PeerPipelineStats]. - Peer
Strike Entry - A peer strike entry for session persistence.
- Port
Filter - Port range filter.
- Proxy
Config - Proxy connection settings.
- QbtCompat
Settings - qBittorrent
WebUIv2 compatibility layer configuration. - Resume
Load Result - Result of loading resume state from disk (M161 Phase 4).
- Session
Handle - Cloneable handle for interacting with a running session.
- Session
State - Persisted session state containing a DHT node cache and torrent resume data.
- Session
Stats - Aggregate statistics for the whole session.
- Settings
- Unified session settings (replaces
SessionConfig). - Torrent
Config - Configurable parameters for a torrent session.
- Torrent
Flags - Bitflag convenience wrapper for common torrent state flags.
- Torrent
Handle - Cloneable handle for interacting with a running torrent.
- Torrent
Info - Metadata about a torrent (available after metadata is fetched).
- Torrent
Stats - Aggregate statistics for a torrent.
- Torrent
Summary - Lightweight summary of a torrent for the HTTP API.
- Tracker
Info - Public info about a single tracker.
- WebSeed
Stats - Per-URL stats for a single web-seed source, surfaced to the qBt v2
/api/v2/torrents/webseedsendpoint and the GUI’s HTTP Sources tab.
Enums§
- AddSource
- Source for a torrent add (M170).
- Choking
Algorithm - Top-level choking algorithm variant.
- Error
- Errors that can occur during session operations.
- File
Mode - Whether a file in a torrent is open and its I/O access mode.
- IpFilter
Error - Errors from parsing IP filter files.
- MaxRatio
Action - M171: Action taken when a torrent’s seed ratio reaches its configured limit.
- Mixed
Mode Algorithm - Mixed-mode bandwidth allocation algorithm for TCP/uTP coexistence.
- Peer
Source - Origin of a peer address.
- Proxy
Type - Supported proxy protocols (matching libtorrent).
- QbtCredential
Migration - Outcome of a legacy-plaintext migration pass (M172a A3 / C2).
- QbtMigration
Error - Errors raised by
migrate_qbt_credentials. - Seed
Choking Algorithm - Choking algorithm used when we are seeding.
- Torrent
State - Current state of a torrent.
- Tracker
Status - Public tracker status (simplified view of internal
TrackerState). - WebSeed
State - Coarse state of a single web-seed source.
Constants§
- DEFAULT_
ADMINADMIN_ HASH - Argon2id PHC hash of the default “adminadmin” password (M172a A3).
Functions§
- build_
wanted_ pieces - Build a bitfield marking which pieces are wanted based on file priorities.
- hash_
qbt_ password - Hash
plaintextwith OWASP-recommended argon2id parameters and return the PHC-format encoded string (M172a). - migrate_
qbt_ credentials - One-shot legacy-plaintext → argon2id migration for
QbtCompatSettings. - parse_
dat - Parse an eMule
.datformat blocklist. - parse_
p2p - Parse a P2P plaintext format blocklist.
- validate_
resume_ bitfield - Returns
trueif thepiecesbitfield has the correct length fornum_piecespieces (i.e.ceil(num_pieces / 8)bytes).
Type Aliases§
- Result
- Convenience alias for
Result<T, Error>. - Storage
Factory - Type alias for a factory that creates per-torrent storage.