#[non_exhaustive]pub enum ValidationError {
Show 34 variants
MissingExtM3U,
ExtM3UNotFirst,
DuplicateTag(String),
MixedPlaylistTypes,
MissingTargetDuration,
MissingVariantUri,
UnresolvedRenditionGroup {
attribute: String,
group_id: String,
},
InsufficientVersion {
tag: String,
required: u8,
actual: u8,
},
RemovedTag {
tag: String,
removed_in: u8,
},
SegmentDurationExceedsTarget {
duration: f64,
target_duration: u64,
},
InvalidVersion(u8),
InvalidDuration(f64),
InvalidTargetDuration(u64),
InvalidKeyMethod(String),
InvalidKeyAttributes(String),
InvalidMapUri,
InvalidProgramDateTime,
InvalidDateRangeId,
InvalidDateRangeStartDate,
InvalidDateRangeEndDate,
InvalidDateRangePlannedDuration(f64),
InvalidDateRangeAttributes(String),
MissingMediaFields,
InvalidMediaAttributes(String),
InvalidPreloadHintUri,
InvalidRenditionReportUri,
UnserializableTag(String),
OrphanUri(String),
DuplicateDateRangeId(String),
DuplicateSessionData {
id: String,
language: Option<String>,
},
MissingPartInf,
InvalidServerControl(String),
TagAfterFirstSegment(String),
InvalidByteRange(String),
}Expand description
Represents different types of validation errors that can occur when processing an M3U8 playlist.
This enum captures specific validation issues that may arise when checking the conformity of a playlist to the M3U8 specification. Each variant represents a distinct error, providing context for what went wrong during validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingExtM3U
Error indicating that the #EXTM3U tag is missing from the playlist.
ExtM3UNotFirst
Error indicating that #EXTM3U is not the first tag in the playlist.
DuplicateTag(String)
Error indicating that a tag that may occur only once is duplicated.
MixedPlaylistTypes
Error indicating that Master Playlist and Media Playlist tags are mixed.
MissingTargetDuration
Error indicating that a Media Playlist is missing EXT-X-TARGETDURATION.
MissingVariantUri
Error indicating that an EXT-X-STREAM-INF tag is not followed by a URI.
UnresolvedRenditionGroup
Error indicating that a stream rendition-group reference cannot be resolved.
InsufficientVersion
Error indicating that a tag requires a newer EXT-X-VERSION.
RemovedTag
Error indicating that a tag was removed in the playlist’s protocol version.
SegmentDurationExceedsTarget
Error indicating that a media segment exceeds EXT-X-TARGETDURATION.
InvalidVersion(u8)
Error indicating that the specified version is outside 1 through 12, the versions defined by draft-pantos-hls-rfc8216bis.
§Arguments
u8- The invalid version number that was encountered.
InvalidDuration(f64)
Error indicating that the duration specified is invalid.
§Arguments
f64- The invalid duration value that was encountered.
InvalidTargetDuration(u64)
Error indicating that the target duration specified is invalid.
§Arguments
u64- The invalid target duration value that was encountered.
InvalidKeyMethod(String)
Error indicating that an invalid key method was specified.
§Arguments
String- The invalid key method that was encountered.
InvalidKeyAttributes(String)
Error indicating that key attributes are inconsistent with the selected method.
InvalidMapUri
Error indicating that the URI specified in a map tag is invalid.
InvalidProgramDateTime
Error indicating that the program date and time specified is invalid.
InvalidDateRangeId
Error indicating that the ID specified in a date range is invalid.
InvalidDateRangeStartDate
Error indicating that the start date specified in a date range is invalid.
InvalidDateRangeEndDate
Error indicating that the end date specified in a date range is invalid.
InvalidDateRangePlannedDuration(f64)
Error indicating that the planned duration specified in a date range is invalid.
§Arguments
f64- The invalid planned duration value that was encountered in the date range.
InvalidDateRangeAttributes(String)
Error indicating incompatible EXT-X-DATERANGE attributes.
MissingMediaFields
Error indicating that a media tag is missing required fields.
InvalidMediaAttributes(String)
Error indicating that EXT-X-MEDIA attributes are inconsistent with its TYPE.
InvalidPreloadHintUri
Error indicating that a preload hint URI is invalid.
InvalidRenditionReportUri
Error indicating that a rendition report URI is invalid.
UnserializableTag(String)
Error indicating that a tag does not survive being written and read back, typically because a string contains a newline or a double quote that would alter the playlist’s structure. Holds the tag as it would be written.
OrphanUri(String)
Error indicating that a URI line is not preceded by EXTINF or EXT-X-STREAM-INF.
DuplicateDateRangeId(String)
Error indicating that an EXT-X-DATERANGE ID is used more than once.
DuplicateSessionData
Error indicating that two EXT-X-SESSION-DATA tags share a DATA-ID and LANGUAGE.
MissingPartInf
Error indicating that EXT-X-PART is used without EXT-X-PART-INF.
InvalidServerControl(String)
Error indicating that EXT-X-SERVER-CONTROL hold-back values are too short for the playlist’s target durations.
TagAfterFirstSegment(String)
Error indicating that a tag must precede the first media segment but follows it.
InvalidByteRange(String)
Error indicating that a segment’s EXT-X-BYTERANGE has no offset but does not follow a sub-range of the same resource. Holds the segment URI.