#[non_exhaustive]pub struct NetOptions {
pub compression: Compression,
pub inactivity_timeout: Duration,
pub total_timeout: Option<Duration>,
pub retry_policy: RetryPolicy,
pub is_insecure: bool,
pub pool_max_idle_per_host: usize,
pub body_queue_capacity: usize,
pub body_queue_resume_at: usize,
pub byte_pool: Option<SharedPool<32, Vec<u8>>>,
pub impersonate: ImpersonatePreset,
}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.compression: CompressionAccept-Encoding algorithms the client offers and auto-decodes.
Defaults to all four (gzip | deflate | brotli | zstd); narrow it
when an upstream rejects the full set (anti-bot WAFs that
fingerprint on the exact Accept-Encoding string are a common
reason).
inactivity_timeout: DurationMaximum allowed inactivity between consecutive read operations.
Maps to reqwest::ClientBuilder::read_timeout (documented as
“The timeout applies to each read operation, and resets after a
successful read”) and also drives the Downloader-layer
BodyStream chunk-inactivity guard for the same semantics one
layer down.
Protects against zombie connections that send headers but then stop streaming bytes. Does not cap the total request lifetime; a legitimately slow stream that keeps delivering chunks (even one byte every few seconds) is not aborted. Default 30s is sized to absorb realistic mobile-network stalls (TCP retransmits, captive-portal warm-up, server-side TTFB spikes) without aborting valid slow streams — the player’s contract is “wait for the segment, regardless of connection speed”, and a 10s cap raced real fixtures.
total_timeout: Option<Duration>Hard cap on total request lifetime. Maps to
reqwest::RequestBuilder::timeout. None lets streaming
downloads run indefinitely as long as inactivity_timeout is
satisfied — required for the player to honour “wait for the
segment, regardless of connection speed”. Default Some(2 min)
keeps a safety net against pathological cases (server stuck in
mid-body without ever closing) while not racing realistic
slow-network seeks.
retry_policy: RetryPolicy§is_insecure: boolAccept invalid TLS certificates (self-signed, expired, wrong hostname). Security risk — use only for local development and test servers.
pool_max_idle_per_host: usizeMax idle connections per host. Enables HTTP keep-alive connection
reuse, reducing TIME_WAIT accumulation under high request volume.
Set to 0 to disable pooling.
body_queue_capacity: usizeApple NSURLSession streaming body queue capacity, measured in
delivered data chunks waiting for Rust consumption. Set to 0 to disable
URLSession task suspension for queued body chunks.
body_queue_resume_at: usizeQueue length at or below which a suspended Apple streaming task resumes.
Values greater than or equal to Self::body_queue_capacity are valid:
they resume as soon as the consumer drains one chunk.
byte_pool: Option<SharedPool<32, Vec<u8>>>Shared byte buffer pool used by backends that must copy platform-owned response buffers before handing bytes to Rust consumers.
impersonate: ImpersonatePresetBrowser TLS+HTTP2 fingerprint the native client-wreq backend
impersonates. Defaults to Safari. Ignored by the client-reqwest
backend and on wasm32 (no emulation there).
Implementations§
Source§impl NetOptions
impl NetOptions
Sourcepub fn builder() -> NetOptionsBuilder
pub fn builder() -> NetOptionsBuilder
Create an instance of NetOptions using the builder syntax
Trait Implementations§
Source§impl Clone for NetOptions
impl Clone for NetOptions
Source§fn clone(&self) -> NetOptions
fn clone(&self) -> NetOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetOptions
impl Debug for NetOptions
Source§impl Default for NetOptions
impl Default for NetOptions
Source§fn default() -> NetOptions
fn default() -> NetOptions
Source§fn build(
options: NetOptions,
byte_pool: Option<SharedPool<32, Vec<u8>>>,
) -> NetOptions
fn build( options: NetOptions, byte_pool: Option<SharedPool<32, Vec<u8>>>, ) -> NetOptions
Self from value and the construction parameters params.Auto Trait Implementations§
impl Freeze for NetOptions
impl RefUnwindSafe for NetOptions
impl Send for NetOptions
impl Sync for NetOptions
impl Unpin for NetOptions
impl UnsafeUnpin for NetOptions
impl UnwindSafe for NetOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.