Skip to main content

KnownTag

Enum KnownTag 

Source
pub enum KnownTag<'a, Custom = NoCustomTag>
where Custom: CustomTag<'a>,
{ Hls(Tag<'a>), Custom(CustomTagAccess<'a, Custom>), }
Expand description

Represents a HLS tag that is known to the library.

Known tags are split into two cases, those which are defined by the library, and those that are custom defined by the user. The library makes an effort to reflect in types what is specified via the latest draft-pantos-hls-rfc8216 specification. The HLS specification also allows for unknown tags which are intended to be ignored by clients; however, using that, special custom implementations can be built up. Some notable examples are the #EXT-X-SCTE35 tag defined in SCTE 35 standard (which has been superceded by the SCTE35 attributes on #EXT-X-DATERANGE), the #EXT-X-IMAGE-STREAM-INF tag (and associated tags) defined via Roku Developers, the #EXT-X-PREFETCH tag defined by LHLS, and there are many more. We find that this flexibility is a useful trait of HLS and so aim to support it here. For use cases where there is no need for any custom tag parsing, the NoCustomTag implementation of CustomTag exists, and is the default implementation of the generic Custom parameter in this enum.

Variants§

§

Hls(Tag<'a>)

Indicates that the tag found was one of the 32 known tags defined in the HLS specification that are supported here in this library (and that were not ignored by crate::config::ParsingOptions). See hls::Tag for a more complete documentation of all of the known tag types.

§

Custom(CustomTagAccess<'a, Custom>)

Indicates that the tag found was one matching the CustomTag definition that the user of the library has defined. The tag is wrapped in a CustomTagAccess struct (see that struct documentation for reasoning on why the wrapping exists) and can be borrowed via the CustomTagAccess::as_ref method or mutably borrowed via the CustomTagAccess::as_mut method. Refer to CustomTag for more information on how to define a custom tag.

Trait Implementations§

Source§

impl<'a, Custom> Clone for KnownTag<'a, Custom>
where Custom: CustomTag<'a> + Clone,

Source§

fn clone(&self) -> KnownTag<'a, Custom>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, Custom> Debug for KnownTag<'a, Custom>
where Custom: CustomTag<'a> + Debug,

Source§

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

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

impl<'a, Custom> IntoInnerTag<'a> for KnownTag<'a, Custom>
where Custom: WritableCustomTag<'a>,

Source§

fn into_inner(self) -> TagInner<'a>

Consume self and provide TagInner.
Source§

impl<'a, Custom> PartialEq for KnownTag<'a, Custom>
where Custom: CustomTag<'a> + PartialEq,

Source§

fn eq(&self, other: &KnownTag<'a, Custom>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, Custom> TryFrom<UnknownTag<'a>> for KnownTag<'a, Custom>
where Custom: CustomTag<'a>,

Source§

type Error = ValidationError

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

fn try_from(tag: UnknownTag<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, Custom> StructuralPartialEq for KnownTag<'a, Custom>
where Custom: CustomTag<'a>,

Auto Trait Implementations§

§

impl<'a, Custom> Freeze for KnownTag<'a, Custom>
where Custom: Freeze,

§

impl<'a, Custom> RefUnwindSafe for KnownTag<'a, Custom>
where Custom: RefUnwindSafe,

§

impl<'a, Custom> Send for KnownTag<'a, Custom>
where Custom: Send,

§

impl<'a, Custom> Sync for KnownTag<'a, Custom>
where Custom: Sync,

§

impl<'a, Custom> Unpin for KnownTag<'a, Custom>
where Custom: Unpin,

§

impl<'a, Custom> UnsafeUnpin for KnownTag<'a, Custom>
where Custom: UnsafeUnpin,

§

impl<'a, Custom> UnwindSafe for KnownTag<'a, Custom>
where Custom: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.