#[non_exhaustive]pub struct ReconnectPolicy {
pub enabled: bool,
pub reconnect_streamed: bool,
pub reconnect_at_eof: bool,
pub max_retries: u32,
pub max_delay: Duration,
pub max_total_delay: Duration,
pub respect_retry_after: bool,
pub retry_http_statuses: Vec<u16>,
pub require_validator: bool,
}Expand description
Application-level reconnect. Default matches FFmpeg reconnect=0.
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.enabled: boolWhen false, no application-level retry after a response has started.
reconnect_streamed: boolAllow reconnect on unknown-length non-seekable / live streams.
Seekable resources never use this path (Range resume or
TruncatedBody). A declared Content-Length without
Accept-Ranges is treated as VOD and also refuses a restart from
byte 0 — that would duplicate prefix bytes already given to FFmpeg.
reconnect_at_eof: boolReconnect after a clean EOF. For unknown-length live streams this re-GETs the resource; for known-length VOD it is a no-op (the body already ended).
max_retries: u32Maximum application retries.
max_delay: DurationCap on a single backoff delay.
max_total_delay: DurationCap on summed backoff. Zero means no total cap.
respect_retry_after: boolHonor a valid Retry-After when retrying.
retry_http_statuses: Vec<u16>HTTP statuses eligible for retry after enabled.
require_validator: boolSeekable reconnect / Range continuation requires ETag or Last-Modified. Default is true; set false only when the caller accepts an unverified splice.
Implementations§
Source§impl ReconnectPolicy
impl ReconnectPolicy
Sourcepub fn seekable_default() -> Self
pub fn seekable_default() -> Self
Conservative seekable-resource retry (still opt-in via enabled).
Sourcepub fn streamed_default() -> Self
pub fn streamed_default() -> Self
Live / unknown-length streamed retry (restart from the live edge).
Sets reconnect_streamed together with enabled and a non-zero
max_retries (5, matching seekable_default).
Setting reconnect_streamed = true on a hand-built policy without also
raising max_retries above the default 0 used to be a silent no-op:
every retry check consults the retry budget first. reconnect_at_eof
is on because live unknown-length streams typically want to re-GET
after a clean EOF.
Trait Implementations§
Source§impl Clone for ReconnectPolicy
impl Clone for ReconnectPolicy
Source§fn clone(&self) -> ReconnectPolicy
fn clone(&self) -> ReconnectPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more