Skip to main content

TorrentConfig

Struct TorrentConfig 

Source
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: u16

TCP listen port for incoming peer connections.

§max_peers: usize

Maximum number of peer connections per torrent.

§target_request_queue: usize

Number of outstanding piece requests to maintain per peer.

§download_dir: PathBuf

Directory where downloaded files are stored.

§enable_dht: bool

Enable DHT for peer discovery.

§enable_pex: bool

Enable Peer Exchange (BEP 11) for peer discovery.

§enable_fast: bool

Enable 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: bool

In end game mode, cancel duplicate requests when a piece completes.

§upload_rate_limit: u64

Upload rate limit in bytes/sec (0 = unlimited).

§download_rate_limit: u64

Download rate limit in bytes/sec (0 = unlimited).

§max_uploads_per_torrent: i32

M224: 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: EncryptionMode

Connection encryption mode (MSE/PE).

§enable_utp: bool

Enable uTP (micro Transport Protocol) for peer connections.

§enable_web_seed: bool

Enable HTTP/web seeding (BEP 19, BEP 17).

§enable_holepunch: bool

Enable BEP 55 holepunch extension for NAT traversal.

§enable_bep40_eviction: bool

Enable BEP 40 canonical peer priority for connection eviction.

§max_web_seeds: usize

Maximum concurrent web seed connections.

§web_seed_retry_base_secs: u64

M186: Base delay (seconds) for web seed exponential backoff.

§web_seed_retry_factor: u64

M186: Multiplier for web seed exponential backoff.

§web_seed_retry_cap_secs: u64

M186: Maximum backoff (seconds) for web seed retry.

§web_seed_max_failures: u32

M186: Consecutive failures before permanently banning a web seed.

§super_seeding: bool

BEP 16: super seeding mode — reveal pieces one-per-peer for maximum diversity.

§upload_only_announce: bool

BEP 21: advertise upload-only status via extension handshake when seeding.

§hashing_threads: usize

Number of concurrent piece verifications during torrent checking.

§sequential_download: bool

Enable sequential (in-order) piece downloading.

§initial_picker_threshold: u32

Completed piece count below which the picker uses random selection to promote diversity.

§whole_pieces_threshold: u32

Seconds below which a fast peer downloads a whole piece; if under this, picker grants exclusive assignment (no block splitting).

§snub_timeout_secs: u32

Seconds without data from a peer before marking it as snubbed.

§readahead_pieces: u32

Number of pieces ahead of the streaming cursor to prioritize.

§streaming_timeout_escalation: bool

When true, escalate streaming piece requests that exceed the mean RTT.

§max_concurrent_stream_reads: usize

Maximum concurrent file stream readers per torrent.

§proxy: ProxyConfig

Proxy configuration for outbound peer connections.

§anonymous_mode: bool

Anonymous mode: suppress client identity in peer handshakes.

§share_mode: bool

Share mode: relay pieces in memory without writing to disk. Requires enable_fast for RejectRequest when evicting pieces.

§enable_i2p: bool

Whether this torrent should use I2P for peer connections.

§allow_i2p_mixed: bool

Whether to allow mixing I2P and clearnet peers.

§ssl_listen_port: u16

SSL listen port for SSL torrent connections (0 = disabled).

§seed_choking_algorithm: SeedChokingAlgorithm

Algorithm for ranking peers during seed-mode choking.

§choking_algorithm: ChokingAlgorithm

Algorithm for determining the number of unchoke slots.

§piece_extent_affinity: bool

Prefer grouping piece requests within the same 4 MiB disk extent.

§suggest_mode: bool

Enable sending SuggestPiece messages for cached pieces.

§max_suggest_pieces: usize

Maximum number of pieces to suggest per peer.

§predictive_piece_announce_ms: u64

Delay (ms) before announcing Have for a piece still being written to disk (0 = disabled).

§mixed_mode_algorithm: MixedModeAlgorithm

Mixed-mode TCP/uTP bandwidth allocation algorithm.

§auto_sequential: bool

Enable automatic sequential mode switching on partial-piece explosion.

§storage_mode: StorageMode

Storage allocation mode for disk I/O.

§preallocate_mode: Option<PreallocateMode>

Override pre-allocation strategy. None = derive from storage_mode.

§block_request_timeout_secs: u32

Block request timeout in seconds before re-issuing (0 = disabled).

§enable_lsd: bool

Enable Local Service Discovery (BEP 14) for this torrent.

§force_proxy: bool

Force all connections through the configured proxy.

§steal_threshold_ratio: f64

Steal blocks from peers this many times slower than the requesting peer (0.0 = disabled).

§steal_threshold_endgame: f64

M149: Steal threshold multiplier when >90% complete.

§peer_read_timeout_secs: u64

M133: Seconds without any wire message before disconnecting a peer (0 = disabled).

§peer_write_timeout_secs: u64

M133: Seconds before a stalled outgoing write disconnects a peer (0 = disabled).

§data_contribution_timeout_secs: u64

M137: Seconds without Piece data before disconnecting a peer (0 = disabled).

§pass0_grace_secs: u64

v0.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: u32

v0.187.3 / 3A: sliding-window cap on proactive evictions per torrent in any rolling 60s window.

§eviction_ban_duration_secs: u64

v0.187.3: how long Pass 0 victims stay banned from reconnection.

§eviction_ban_set_cap: usize

v0.187.3 / OV4: FIFO cap on the banned-peer set.

§choke_rotation_max_evictions: u32

M138: Maximum peers to evict per choke rotation tick (0 = disabled).

§max_concurrent_connects: u16

M138: Maximum concurrent outbound peer connections.

§connect_soft_timeout: u64

M147: Seconds without TCP SYN-ACK before soft reap disconnects.

§dispatch_backlog_cap: usize

M182: dispatch-channel reader-side spill cap (default 8).

§event_backlog_cap: usize

M182: event-channel reader-side spill cap (default 32).

§use_actor_dispatch: bool

M187 A/B: use actor-centralised dispatch (true) or per-peer CAS dispatch (false).

§web_seed_progress_throttle_ms: u64

v0.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: UrlSecurityConfig

URL security configuration for SSRF mitigation and IDNA checking.

§peer_connect_timeout: u64

Timeout in seconds for outbound TCP peer connections (0 = OS default).

§peer_dscp: u8

DSCP (Differentiated Services Code Point) value for peer traffic sockets.

§initial_queue_depth: usize

Fixed per-peer request queue depth for the lifetime of the connection.

§max_request_queue_depth: usize

Maximum per-peer request queue depth.

§request_queue_time: f64

Deprecated — unused in the fixed-depth pipeline model. Retained for API compatibility; was formerly used to scale BDP-based queue depth.

§max_metadata_size: u64

Maximum BEP 9 metadata size in bytes accepted from peers.

§max_message_size: usize

Maximum wire protocol message size in bytes for the codec.

§max_piece_length: u64

Maximum accepted piece length when adding a torrent.

§max_outstanding_requests: usize

Maximum outstanding incoming requests per peer.

§max_in_flight_pieces: usize

Maximum number of pieces simultaneously in-flight (downloaded but not yet verified).

§use_block_stealing: bool

M103: Enable block-level stealing for partially-downloaded pieces.

§steal_stale_piece_secs: u64

M132: Seconds between steal-queue population scans (0 = disabled).

§fixed_pipeline_depth: usize

M104: Fixed per-peer pipeline depth (concurrent requests per peer).

§lock_warn_threshold_ms: u64

M120: Lock timing warning threshold in milliseconds (0 = disabled).

§filesystem_direct_io: bool

M127: 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.

§tags: Vec<String>

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

Source§

fn clone(&self) -> TorrentConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TorrentConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TorrentConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<&Settings> for TorrentConfig

Source§

fn from(s: &Settings) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more