pub struct TorrentConfig {Show 73 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 strict_end_game: bool,
pub upload_rate_limit: u64,
pub download_rate_limit: u64,
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 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 choke_rotation_max_evictions: u32,
pub max_concurrent_connects: u16,
pub connect_soft_timeout: 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 min_pipeline_depth: u32,
pub max_pipeline_depth: u32,
pub target_buffer_secs: f64,
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,
}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).
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).
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.
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).
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.
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).
min_pipeline_depth: u32M149: Minimum per-peer pipeline depth (requests in flight).
max_pipeline_depth: u32M149: Maximum per-peer pipeline depth (requests in flight).
target_buffer_secs: f64M149: Seconds of data to buffer in the pipeline per peer.
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).
Trait Implementations§
Source§impl Clone for TorrentConfig
impl Clone for TorrentConfig
Source§fn clone(&self) -> TorrentConfig
fn clone(&self) -> TorrentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more