#[non_exhaustive]pub struct DownloaderConfig {
pub abr_settings: AbrSettings,
pub cancel: CancellationToken,
pub demand_throttle: Duration,
pub soft_timeout: Duration,
pub client: HttpClient,
pub runtime: Option<Handle>,
pub max_concurrent: usize,
}Expand description
Configuration for Downloader.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.abr_settings: AbrSettingsSettings for the shared ABR controller owned by the Downloader.
cancel: CancellationTokenCancellation token — when cancelled, the download loop exits.
demand_throttle: DurationThrottle delay for demand (low-priority) processing. Gives urgent work a chance to preempt before demand batch runs.
soft_timeout: DurationSoft timeout. When a fetch has not produced a response within
this duration, the Downloader publishes
DownloaderEvent::LoadSlow
on the peer’s bus (if any). The request itself is not aborted
— it keeps running until hard timeout fires.
client: HttpClientHTTP client used for all fetches. Cloned by the Downloader to
share the underlying reqwest::Client (and its connection pool)
with the caller. Pass a single shared HttpClient to multiple
Downloaders to share keep-alive sockets across them.
runtime: Option<Handle>Tokio runtime handle for the download loop.
Some(handle)— the loop runs as a task on this runtime.None— spawns as a task on the current runtime viatask::spawn.
max_concurrent: usizeMaximum number of concurrent in-flight fetch commands.
Implementations§
Source§impl DownloaderConfig
impl DownloaderConfig
Sourcepub fn builder() -> DownloaderConfigBuilder
pub fn builder() -> DownloaderConfigBuilder
Create an instance of DownloaderConfig using the builder syntax
Source§impl DownloaderConfig
impl DownloaderConfig
Sourcepub fn for_client(client: HttpClient) -> DownloaderConfigBuilder<SetClient>
pub fn for_client(client: HttpClient) -> DownloaderConfigBuilder<SetClient>
Start a builder with client already set. Mirrors the
ResourceConfig::for_src / HlsConfig::for_url pattern — the
one required field is pre-supplied so callers can chain only
the optional knobs they care about.
Trait Implementations§
Source§impl Clone for DownloaderConfig
impl Clone for DownloaderConfig
Source§fn clone(&self) -> DownloaderConfig
fn clone(&self) -> DownloaderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more