#[non_exhaustive]pub enum Action {
FetchPlaylist {
url: String,
blocking: Option<BlockingReload>,
skip: bool,
},
FetchResource {
id: ResourceId,
url: String,
byte_range: Option<(u64, u64)>,
},
WaitMs(u64),
}Expand description
One unit of IO the caller must perform, in response to a
crate::client::HlsClient::poll call. The client core never touches a socket
or a clock itself — every Action names exactly what to fetch and, for a
playlist reload, how to shape the request.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FetchPlaylist
Fetch (or long-poll) the Media Playlist.
Fields
blocking: Option<BlockingReload>Some to add _HLS_msn/_HLS_part query parameters requesting a
Blocking Playlist Reload (RFC 8216bis §6.2.5.2); None for a
plain (non-blocking) GET — used when the last-seen playlist did
not advertise CAN-BLOCK-RELOAD support.
FetchResource
Fetch one resource (init/part/segment).
Fields
id: ResourceIdCorrelates the eventual crate::client::HlsClient::on_resource call.
WaitMs(u64)
A non-blocking-reload timing hint: wait about this many milliseconds
before issuing the next FetchPlaylist, derived from
#EXT-X-TARGETDURATION (RFC 8216 §4.3.3.1’s “SHOULD NOT … more
frequently than once every Target Duration” reload guidance, halved
for headroom) when the origin does not support blocking reload.
Implementations§
Source§impl Action
impl Action
Sourcepub fn playlist_request_url(&self) -> Option<String>
pub fn playlist_request_url(&self) -> Option<String>
For Action::FetchPlaylist, the fully query-augmented URL to fetch:
_HLS_msn/_HLS_part (RFC 8216bis §6.2.5.2) appended per
Self::FetchPlaylist’s blocking field, then _HLS_skip=YES
(RFC 8216bis §6.2.5.1) if skip is set. None for
Action::FetchResource/Action::WaitMs (nothing to augment —
use their url/byte-range fields directly).
This is a convenience for building the real HTTP request; the typed
blocking/skip fields remain the source of truth (e.g. for a
caller using a query-parameter API rather than string concatenation).