pub struct TorrentConfig {Show 87 fields
pub listen_port: u16,
pub max_peers: usize,
pub target_request_queue: usize,
pub download_dir: PathBuf,
pub enable_dht: bool,
pub enable_pex: bool,
pub enable_fast: bool,
pub seed_ratio_limit: Option<f64>,
pub seed_time_limit_secs: Option<u64>,
pub inactive_seed_time_limit_secs: Option<u64>,
pub strict_end_game: bool,
pub upload_rate_limit: u64,
pub download_rate_limit: u64,
pub max_uploads_per_torrent: i32,
pub encryption_mode: EncryptionMode,
pub enable_utp: bool,
pub enable_web_seed: bool,
pub enable_holepunch: bool,
pub enable_bep40_eviction: bool,
pub max_web_seeds: usize,
pub web_seed_retry_base_secs: u64,
pub web_seed_retry_factor: u64,
pub web_seed_retry_cap_secs: u64,
pub web_seed_max_failures: u32,
pub super_seeding: bool,
pub upload_only_announce: bool,
pub hashing_threads: usize,
pub sequential_download: bool,
pub initial_picker_threshold: u32,
pub whole_pieces_threshold: u32,
pub snub_timeout_secs: u32,
pub readahead_pieces: u32,
pub streaming_timeout_escalation: bool,
pub max_concurrent_stream_reads: usize,
pub proxy: ProxyConfig,
pub anonymous_mode: bool,
pub share_mode: bool,
pub enable_i2p: bool,
pub allow_i2p_mixed: bool,
pub ssl_listen_port: u16,
pub seed_choking_algorithm: SeedChokingAlgorithm,
pub choking_algorithm: ChokingAlgorithm,
pub piece_extent_affinity: bool,
pub suggest_mode: bool,
pub max_suggest_pieces: usize,
pub predictive_piece_announce_ms: u64,
pub mixed_mode_algorithm: MixedModeAlgorithm,
pub auto_sequential: bool,
pub storage_mode: StorageMode,
pub preallocate_mode: Option<PreallocateMode>,
pub block_request_timeout_secs: u32,
pub enable_lsd: bool,
pub force_proxy: bool,
pub steal_threshold_ratio: f64,
pub steal_threshold_endgame: f64,
pub peer_read_timeout_secs: u64,
pub peer_write_timeout_secs: u64,
pub data_contribution_timeout_secs: u64,
pub pass0_grace_secs: u64,
pub proactive_evictions_per_minute_limit: u32,
pub eviction_ban_duration_secs: u64,
pub eviction_ban_set_cap: usize,
pub choke_rotation_max_evictions: u32,
pub max_concurrent_connects: u16,
pub connect_soft_timeout: u64,
pub dispatch_backlog_cap: usize,
pub event_backlog_cap: usize,
pub use_actor_dispatch: bool,
pub web_seed_progress_throttle_ms: u64,
pub url_security: UrlSecurityConfig,
pub peer_connect_timeout: u64,
pub peer_dscp: u8,
pub initial_queue_depth: usize,
pub max_request_queue_depth: usize,
pub request_queue_time: f64,
pub max_metadata_size: u64,
pub max_message_size: usize,
pub max_piece_length: u64,
pub max_outstanding_requests: usize,
pub max_in_flight_pieces: usize,
pub use_block_stealing: bool,
pub steal_stale_piece_secs: u64,
pub fixed_pipeline_depth: usize,
pub lock_warn_threshold_ms: u64,
pub filesystem_direct_io: bool,
pub category: Option<String>,
pub tags: Vec<String>,
}Expand description
Configurable parameters for a torrent session.
Fields§
§listen_port: u16TCP listen port for incoming peer connections.
max_peers: usizeMaximum number of peer connections per torrent.
target_request_queue: usizeNumber of outstanding piece requests to maintain per peer.
download_dir: PathBufDirectory where downloaded files are stored.
enable_dht: boolEnable DHT for peer discovery.
enable_pex: boolEnable Peer Exchange (BEP 11) for peer discovery.
enable_fast: boolEnable Fast Extension (BEP 6) for reject/suggest/allowed-fast messages.
seed_ratio_limit: Option<f64>Stop seeding after reaching this upload/download ratio (None = unlimited).
seed_time_limit_secs: Option<u64>M171: Stop seeding after this many cumulative seeding seconds (None = no limit). Mirrors qBt’s “Maximum seeding time” preference.
inactive_seed_time_limit_secs: Option<u64>M171: Stop seeding after this many seconds of inactivity while in the Seeding state (None = no limit). Mirrors qBt’s “Maximum inactive seeding time” preference.
strict_end_game: boolIn end game mode, cancel duplicate requests when a piece completes.
upload_rate_limit: u64Upload rate limit in bytes/sec (0 = unlimited).
download_rate_limit: u64Download rate limit in bytes/sec (0 = unlimited).
max_uploads_per_torrent: i32M224: Maximum unchoked upload slots per torrent (-1 = unlimited).
Mirrors Settings.max_uploads_per_torrent; caps the choker’s regular
unchoke set when n >= 1. -1 falls back to the historical default
of 4 regular slots.
encryption_mode: EncryptionModeConnection encryption mode (MSE/PE).
enable_utp: boolEnable uTP (micro Transport Protocol) for peer connections.
enable_web_seed: boolEnable HTTP/web seeding (BEP 19, BEP 17).
enable_holepunch: boolEnable BEP 55 holepunch extension for NAT traversal.
enable_bep40_eviction: boolEnable BEP 40 canonical peer priority for connection eviction.
max_web_seeds: usizeMaximum concurrent web seed connections.
web_seed_retry_base_secs: u64M186: Base delay (seconds) for web seed exponential backoff.
web_seed_retry_factor: u64M186: Multiplier for web seed exponential backoff.
web_seed_retry_cap_secs: u64M186: Maximum backoff (seconds) for web seed retry.
web_seed_max_failures: u32M186: Consecutive failures before permanently banning a web seed.
super_seeding: boolBEP 16: super seeding mode — reveal pieces one-per-peer for maximum diversity.
upload_only_announce: boolBEP 21: advertise upload-only status via extension handshake when seeding.
hashing_threads: usizeNumber of concurrent piece verifications during torrent checking.
sequential_download: boolEnable sequential (in-order) piece downloading.
initial_picker_threshold: u32Completed piece count below which the picker uses random selection to promote diversity.
whole_pieces_threshold: u32Seconds below which a fast peer downloads a whole piece; if under this, picker grants exclusive assignment (no block splitting).
snub_timeout_secs: u32Seconds without data from a peer before marking it as snubbed.
readahead_pieces: u32Number of pieces ahead of the streaming cursor to prioritize.
streaming_timeout_escalation: boolWhen true, escalate streaming piece requests that exceed the mean RTT.
max_concurrent_stream_reads: usizeMaximum concurrent file stream readers per torrent.
proxy: ProxyConfigProxy configuration for outbound peer connections.
anonymous_mode: boolAnonymous mode: suppress client identity in peer handshakes.
Share mode: relay pieces in memory without writing to disk.
Requires enable_fast for RejectRequest when evicting pieces.
enable_i2p: boolWhether this torrent should use I2P for peer connections.
allow_i2p_mixed: boolWhether to allow mixing I2P and clearnet peers.
ssl_listen_port: u16SSL listen port for SSL torrent connections (0 = disabled).
seed_choking_algorithm: SeedChokingAlgorithmAlgorithm for ranking peers during seed-mode choking.
choking_algorithm: ChokingAlgorithmAlgorithm for determining the number of unchoke slots.
piece_extent_affinity: boolPrefer grouping piece requests within the same 4 MiB disk extent.
suggest_mode: boolEnable sending SuggestPiece messages for cached pieces.
max_suggest_pieces: usizeMaximum number of pieces to suggest per peer.
predictive_piece_announce_ms: u64Delay (ms) before announcing Have for a piece still being written to disk (0 = disabled).
mixed_mode_algorithm: MixedModeAlgorithmMixed-mode TCP/uTP bandwidth allocation algorithm.
auto_sequential: boolEnable automatic sequential mode switching on partial-piece explosion.
storage_mode: StorageModeStorage allocation mode for disk I/O.
preallocate_mode: Option<PreallocateMode>Override pre-allocation strategy. None = derive from storage_mode.
block_request_timeout_secs: u32Block request timeout in seconds before re-issuing (0 = disabled).
enable_lsd: boolEnable Local Service Discovery (BEP 14) for this torrent.
force_proxy: boolForce all connections through the configured proxy.
steal_threshold_ratio: f64Steal blocks from peers this many times slower than the requesting peer (0.0 = disabled).
steal_threshold_endgame: f64M149: Steal threshold multiplier when >90% complete.
peer_read_timeout_secs: u64M133: Seconds without any wire message before disconnecting a peer (0 = disabled).
peer_write_timeout_secs: u64M133: Seconds before a stalled outgoing write disconnects a peer (0 = disabled).
data_contribution_timeout_secs: u64M137: Seconds without Piece data before disconnecting a peer (0 = disabled).
pass0_grace_secs: u64v0.187.3 / OV2 / 12A: post-handshake grace before Pass 0 eviction (zero-throughput) can fire (0 = disable grace, legacy v0.187.2 behaviour).
proactive_evictions_per_minute_limit: u32v0.187.3 / 3A: sliding-window cap on proactive evictions per torrent in any rolling 60s window.
eviction_ban_duration_secs: u64v0.187.3: how long Pass 0 victims stay banned from reconnection.
eviction_ban_set_cap: usizev0.187.3 / OV4: FIFO cap on the banned-peer set.
choke_rotation_max_evictions: u32M138: Maximum peers to evict per choke rotation tick (0 = disabled).
max_concurrent_connects: u16M138: Maximum concurrent outbound peer connections.
connect_soft_timeout: u64M147: Seconds without TCP SYN-ACK before soft reap disconnects.
dispatch_backlog_cap: usizeM182: dispatch-channel reader-side spill cap (default 8).
event_backlog_cap: usizeM182: event-channel reader-side spill cap (default 32).
use_actor_dispatch: boolM187 A/B: use actor-centralised dispatch (true) or per-peer CAS dispatch (false).
web_seed_progress_throttle_ms: u64v0.186.1: when true, snapshot publishes that overflow the
dispatch channel disconnect the peer fatally (regression mode).
M178: Per-URL minimum interval between PeerEvent::WebSeedProgress
emissions. 0 disables the throttle (every chunk emits).
url_security: UrlSecurityConfigURL security configuration for SSRF mitigation and IDNA checking.
peer_connect_timeout: u64Timeout in seconds for outbound TCP peer connections (0 = OS default).
peer_dscp: u8DSCP (Differentiated Services Code Point) value for peer traffic sockets.
initial_queue_depth: usizeFixed per-peer request queue depth for the lifetime of the connection.
max_request_queue_depth: usizeMaximum per-peer request queue depth.
request_queue_time: f64Deprecated — unused in the fixed-depth pipeline model. Retained for API compatibility; was formerly used to scale BDP-based queue depth.
max_metadata_size: u64Maximum BEP 9 metadata size in bytes accepted from peers.
max_message_size: usizeMaximum wire protocol message size in bytes for the codec.
max_piece_length: u64Maximum accepted piece length when adding a torrent.
max_outstanding_requests: usizeMaximum outstanding incoming requests per peer.
max_in_flight_pieces: usizeMaximum number of pieces simultaneously in-flight (downloaded but not yet verified).
use_block_stealing: boolM103: Enable block-level stealing for partially-downloaded pieces.
steal_stale_piece_secs: u64M132: Seconds between steal-queue population scans (0 = disabled).
fixed_pipeline_depth: usizeM104: Fixed per-peer pipeline depth (concurrent requests per peer).
lock_warn_threshold_ms: u64M120: Lock timing warning threshold in milliseconds (0 = disabled).
filesystem_direct_io: boolM127: Enable direct I/O for filesystem storage (O_DIRECT / F_NOCACHE).
category: Option<String>M170: Per-torrent category label (qBt-compat). None = uncategorised.
Resolved at add-time from the category registry; stored here so the
TorrentActor can surface it through TorrentStats.
M171: Per-torrent tags (qBt-compat). Multi-valued, free-form. Stored
here so that TorrentStats.tags and resume-data persistence both read
from the same source of truth.
Trait Implementations§
Source§impl Clone for TorrentConfig
impl Clone for TorrentConfig
Source§fn clone(&self) -> TorrentConfig
fn clone(&self) -> TorrentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more