pub struct SessionKey<'a> { /* private fields */ }Expand description
Corresponds to the #EXT-X-SESSION-KEY tag.
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-18#section-4.4.6.5
Implementations§
Source§impl<'a> SessionKey<'a>
impl<'a> SessionKey<'a>
Sourcepub fn builder() -> SessionKeyBuilder<'a, SessionKeyMethodNeedsToBeSet, SessionKeyUriNeedsToBeSet>
pub fn builder() -> SessionKeyBuilder<'a, SessionKeyMethodNeedsToBeSet, SessionKeyUriNeedsToBeSet>
Starts a builder for producing Self.
For example, we could construct a SessionKey as such:
let session_key = SessionKey::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 AND uri.
Each of the following fail to compile:
let session_key = SessionKey::builder().finish();let session_key = SessionKey::builder().method(Method::SampleAes).finish();let session_key = SessionKey::builder().with_uri("skd://1234").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) -> &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 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 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)
Unset 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)
Unset 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)
Unset the KEYFORMATVERSIONS attribute (sets it to None).
See Self for a link to the HLS documentation for this attribute.
Trait Implementations§
Source§impl<'a> Clone for SessionKey<'a>
impl<'a> Clone for SessionKey<'a>
Source§fn clone(&self) -> SessionKey<'a>
fn clone(&self) -> SessionKey<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for SessionKey<'a>
impl<'a> Debug for SessionKey<'a>
Source§impl<'a, Custom> From<SessionKey<'a>> for HlsLine<'a, Custom>where
Custom: CustomTag<'a>,
impl<'a, Custom> From<SessionKey<'a>> for HlsLine<'a, Custom>where
Custom: CustomTag<'a>,
Source§fn from(tag: SessionKey<'a>) -> Self
fn from(tag: SessionKey<'a>) -> Self
Source§impl<'a> IntoInnerTag<'a> for SessionKey<'a>
impl<'a> IntoInnerTag<'a> for SessionKey<'a>
Source§fn into_inner(self) -> TagInner<'a>
fn into_inner(self) -> TagInner<'a>
self and provide TagInner.