pub struct DownloadOptions {Show 39 fields
pub split: Option<u16>,
pub max_connection_per_server: Option<u16>,
pub max_download_limit: Option<u64>,
pub max_upload_limit: Option<u64>,
pub dir: Option<String>,
pub out: Option<String>,
pub file_allocation: Option<String>,
pub mmap_threshold: Option<u64>,
pub secure_falloc: bool,
pub seed_time: Option<u64>,
pub seed_ratio: Option<f64>,
pub checksum: Option<(String, String)>,
pub cookie_file: Option<String>,
pub cookies: Option<String>,
pub bt_force_encrypt: bool,
pub bt_require_crypto: bool,
pub enable_dht: bool,
pub dht_listen_port: Option<u16>,
pub dht_entry_point: Option<Vec<String>>,
pub enable_public_trackers: bool,
pub bt_piece_selection_strategy: String,
pub bt_endgame_threshold: u32,
pub max_retries: u32,
pub retry_wait: u64,
pub http_proxy: Option<String>,
pub all_proxy: Option<String>,
pub https_proxy: Option<String>,
pub ftp_proxy: Option<String>,
pub no_proxy: Option<String>,
pub dht_file_path: Option<String>,
pub bt_max_upload_slots: Option<u32>,
pub bt_optimistic_unchoke_interval: Option<u64>,
pub bt_snubbed_timeout: Option<u64>,
pub bt_prioritize_piece: String,
pub enable_utp: bool,
pub utp_listen_port: Option<u16>,
pub header: Vec<String>,
pub user_agent: Option<String>,
pub referer: Option<String>,
}Fields§
§split: Option<u16>§max_connection_per_server: Option<u16>§max_download_limit: Option<u64>§max_upload_limit: Option<u64>§dir: Option<String>§out: Option<String>§file_allocation: Option<String>File allocation strategy: “none”, “prealloc”, “falloc”, “trunc”, or “mmap”.
When “mmap”, MmapDiskWriter is used for files above mmap_threshold.
mmap_threshold: Option<u64>File size threshold (bytes) above which mmap writes are used when
file_allocation = "mmap". Default: 256 MiB.
secure_falloc: boolZero-fill allocated blocks after fallocate on platforms that don’t
zero-fill (macOS F_PREALLOCATE, Windows SetFileValidData).
Prevents exposure of residual disk data at a performance cost.
Has no effect on Linux. Defaults to false (matches
constants::DEFAULT_SECURE_FALLOC).
seed_time: Option<u64>§seed_ratio: Option<f64>§checksum: Option<(String, String)>§bt_force_encrypt: bool§bt_require_crypto: bool§enable_dht: bool§dht_listen_port: Option<u16>§dht_entry_point: Option<Vec<String>>§enable_public_trackers: bool§bt_piece_selection_strategy: String§bt_endgame_threshold: u32§max_retries: u32§retry_wait: u64§http_proxy: Option<String>§all_proxy: Option<String>§https_proxy: Option<String>§ftp_proxy: Option<String>§no_proxy: Option<String>§dht_file_path: Option<String>§bt_max_upload_slots: Option<u32>Maximum number of peers to unchoke simultaneously during seeding. Default: 4. Set to enable the choking algorithm.
bt_optimistic_unchoke_interval: Option<u64>Interval in seconds between optimistic unchokes. Default: 30.
bt_snubbed_timeout: Option<u64>Timeout in seconds after which a peer is considered snubbed (not sending data). Default: 60.
bt_prioritize_piece: StringPiece selection priority: “rarest” (default), “head” (sequential from start), “tail” (sequential from end).
enable_utp: boolEnable uTP (UDP Transport Protocol) for BitTorrent connections. This implements BEP 29 and is an experimental feature not in original aria2. Default: false.
utp_listen_port: Option<u16>UDP port for uTP connections. 0 = auto-assign. Experimental feature not in original aria2.
header: Vec<String>Custom HTTP request headers as "Name: Value" strings.
Applied to both HEAD probes and range GETs.
user_agent: Option<String>Override User-Agent header. Also injected into the header list by
DownloadOptions::parsed_headers when set.
referer: Option<String>Override Referer header. Also injected into the header list by
DownloadOptions::parsed_headers when set.
Implementations§
Source§impl DownloadOptions
impl DownloadOptions
Sourcepub fn parsed_headers(&self) -> Vec<(String, String)>
pub fn parsed_headers(&self) -> Vec<(String, String)>
Parse the raw header list into (name, value) pairs, splitting each
"Name: Value" entry on the first :. When user_agent or referer
are set, they are appended as User-Agent / Referer pairs (unless an
entry with the same name already exists), so callers only need to handle
a single header list.
Trait Implementations§
Source§impl Clone for DownloadOptions
impl Clone for DownloadOptions
Source§fn clone(&self) -> DownloadOptions
fn clone(&self) -> DownloadOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more