pub struct Key<'a> { /* private fields */ }Expand description
Corresponds to the #EXT-X-KEY tag.
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-18#section-4.4.4.4
Implementations§
Source§impl<'a> Key<'a>
impl<'a> Key<'a>
Sourcepub fn builder() -> KeyBuilder<'a, KeyMethodNeedsToBeSet>
pub fn builder() -> KeyBuilder<'a, KeyMethodNeedsToBeSet>
Starts a builder for producing Self.
For example, we could construct a Key as such:
let key = Key::builder()
.with_method(Method::SampleAes)
.with_uri("skd://1234")
.with_keyformat("com.apple.streamingkeydelivery")
.with_keyformatversions("1")
.finish();Note that the finish method is only callable if the builder has set method. The
following fail to compile:
let key = Key::builder().finish();Sourcepub fn method(&self) -> EnumeratedString<'_, Method>
pub fn method(&self) -> EnumeratedString<'_, Method>
Corresponds to the METHOD attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn uri(&self) -> Option<&str>
pub fn uri(&self) -> Option<&str>
Corresponds to the URI attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn iv(&self) -> Option<&str>
pub fn iv(&self) -> Option<&str>
Corresponds to the IV attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn keyformat(&self) -> &str
pub fn keyformat(&self) -> &str
Corresponds to the KEYFORMAT attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn keyformatversions(&self) -> Option<&str>
pub fn keyformatversions(&self) -> Option<&str>
Corresponds to the KEYFORMATVERSIONS attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_method(&mut self, method: impl Into<Cow<'a, str>>)
pub fn set_method(&mut self, method: impl Into<Cow<'a, str>>)
Sets the METHOD 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 unset_uri(&mut self)
pub fn unset_uri(&mut self)
Unsets the URI attribute (sets it to None).
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_iv(&mut self, iv: impl Into<Cow<'a, str>>)
pub fn set_iv(&mut self, iv: impl Into<Cow<'a, str>>)
Sets the IV attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn unset_iv(&mut self)
pub fn unset_iv(&mut self)
Unsets the IV attribute (sets it to None).
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_keyformat(&mut self, keyformat: impl Into<Cow<'a, str>>)
pub fn set_keyformat(&mut self, keyformat: impl Into<Cow<'a, str>>)
Sets the KEYFORMAT attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn unset_keyformat(&mut self)
pub fn unset_keyformat(&mut self)
Unsets the KEYFORMAT attribute (sets it to None).
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn set_keyformatversions(
&mut self,
keyformatversions: impl Into<Cow<'a, str>>,
)
pub fn set_keyformatversions( &mut self, keyformatversions: impl Into<Cow<'a, str>>, )
Sets the KEYFORMATVERSIONS attribute.
See Self for a link to the HLS documentation for this attribute.
Sourcepub fn unset_keyformatversions(&mut self)
pub fn unset_keyformatversions(&mut self)
Unsets the KEYFORMATVERSIONS 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 Key<'a>
impl<'a> IntoInnerTag<'a> for Key<'a>
Source§fn into_inner(self) -> TagInner<'a>
fn into_inner(self) -> TagInner<'a>
self and provide TagInner.