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> IntoInnerTag<'a> for KnownTag<'a, Custom>where
Custom: WritableCustomTag<'a>,
impl<'a, Custom> IntoInnerTag<'a> for KnownTag<'a, Custom>where
Custom: WritableCustomTag<'a>,
Source§fn into_inner(self) -> TagInner<'a>
fn into_inner(self) -> TagInner<'a>
self and provide TagInner.