Skip to main content

ValidationError

Enum ValidationError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§attribute: String
§group_id: String
§

InsufficientVersion

Error indicating that a tag requires a newer EXT-X-VERSION.

Fields

§required: u8
§actual: u8
§

RemovedTag

Error indicating that a tag was removed in the playlist’s protocol version.

Fields

§removed_in: u8
§

SegmentDurationExceedsTarget

Error indicating that a media segment exceeds EXT-X-TARGETDURATION.

Fields

§duration: f64
§target_duration: u64
§

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.

Fields

§language: Option<String>
§

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.

Trait Implementations§

Source§

impl Debug for ValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ValidationError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.