pub struct Part<'a> { /* private fields */ }Expand description
Corresponds to the #EXT-X-PART tag.
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-18#section-4.4.4.9
Implementations§
Source§impl<'a> Part<'a>
impl<'a> Part<'a>
Sourcepub fn builder() -> PartBuilder<'a, PartUriNeedsToBeSet, PartDurationNeedsToBeSet>
pub fn builder() -> PartBuilder<'a, PartUriNeedsToBeSet, PartDurationNeedsToBeSet>
Starts a builder for producing Self.
For example, we could construct a Part as such:
let part = Part::builder()
.with_uri("part.100.0.mp4")
.with_duration(0.5)
.with_independent()
.with_byterange(DecimalIntegerRange { length: 1024, offset: None })
.finish();Note that the finish method is only callable if the builder has set uri AND duration.
Each of the following fail to compile:
let part = Part::builder().finish();let part = Part::builder().with_uri("uri").finish();let part = Part::builder().with_duration(0.5).finish();Sourcepub fn uri(&self) -> &str
pub fn uri(&self) -> &str
Corresponds to the URI attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn duration(&self) -> f64
pub fn duration(&self) -> f64
Corresponds to the DURATION attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn independent(&self) -> bool
pub fn independent(&self) -> bool
Corresponds to the INDEPENDENT attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn byterange(&self) -> Option<DecimalIntegerRange>
pub fn byterange(&self) -> Option<DecimalIntegerRange>
Corresponds to the BYTERANGE attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn gap(&self) -> bool
pub fn gap(&self) -> bool
Corresponds to the GAP attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_uri(&mut self, uri: impl Into<Cow<'a, str>>)
pub fn set_uri(&mut self, uri: impl Into<Cow<'a, str>>)
Sets the URI attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_duration(&mut self, duration: f64)
pub fn set_duration(&mut self, duration: f64)
Sets the DURATION attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_independent(&mut self, independent: bool)
pub fn set_independent(&mut self, independent: bool)
Sets the INDEPENDENT attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_byterange(&mut self, byterange: DecimalIntegerRange)
pub fn set_byterange(&mut self, byterange: DecimalIntegerRange)
Sets the BYTERANGE attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn unset_byterange(&mut self)
pub fn unset_byterange(&mut self)
Unsets the BYTERANGE attribute (sets it to None).
See Self for a link to the HLS documentation for this attribute.
Trait Implementations§
Source§impl<'a> IntoInnerTag<'a> for Part<'a>
impl<'a> IntoInnerTag<'a> for Part<'a>
Source§fn into_inner(self) -> TagInner<'a>
fn into_inner(self) -> TagInner<'a>
self and provide TagInner.