Skip to main content

DownloadConfig

Struct DownloadConfig 

Source
#[non_exhaustive]
pub struct DownloadConfig {
Show 17 fields pub dir: PathBuf, pub connections: usize, pub per_host: usize, pub per_host_active: usize, pub global: usize, pub rate_limit: Option<u64>, pub per_host_rate_limit: Option<u64>, pub file_jobs: usize, pub content_cache: bool, pub content_cache_dir: Option<PathBuf>, pub disk_space_check: bool, pub segment_size: u64, pub resume: bool, pub verify: VerifyMode, pub extract: bool, pub extract_dir: Option<PathBuf>, pub delete_archive: bool,
}
Expand description

Defaults for how files are downloaded, resumed, verified and extracted.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§dir: PathBuf

Default destination directory.

§connections: usize

Default number of parallel connections per task.

§per_host: usize

Maximum number of idle connections kept per host in the HTTP pool.

§per_host_active: usize

Maximum number of active HTTP file-transfer requests per host across all tasks.

§global: usize

Maximum number of active HTTP file-transfer requests across all tasks.

§rate_limit: Option<u64>

Global bandwidth limit in bytes per second. None or 0 means unlimited. Direct HTTP and Hub file transfers share this limit.

§per_host_rate_limit: Option<u64>

Additional bandwidth cap per destination host in bytes per second. None or 0 means unlimited.

§file_jobs: usize

Number of files downloaded concurrently within one multi-file task.

§content_cache: bool

Reuse verified downloads through the content-addressed cache.

§content_cache_dir: Option<PathBuf>

Override for the content-addressed cache root.

§disk_space_check: bool

Refuse a task before transfer when the destination filesystem has less free space than the known remaining size.

§segment_size: u64

Size in bytes of each ranged HTTP segment.

§resume: bool

Resume interrupted downloads from checkpoints by default.

§verify: VerifyMode

Default checksum verification policy.

§extract: bool

Extract archives after download by default.

§extract_dir: Option<PathBuf>

Default extraction directory; None extracts under the destination.

§delete_archive: bool

Delete archives after successful extraction by default.

Trait Implementations§

Source§

impl Clone for DownloadConfig

Source§

fn clone(&self) -> Self

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 DownloadConfig

Source§

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

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

impl Default for DownloadConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for DownloadConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DownloadConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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