Session

Struct Session 

Source
pub struct Session {
    pub content_id: Option<String>,
    pub playback_rate: Option<f64>,
    pub streaming_format: Option<StreamingFormat>,
    pub session_id: Option<String>,
    pub stream_type: Option<StreamType>,
    pub version: Option<i64>,
}
Expand description

An CMCD-Session Header contains keys whose values are expected to be invariant over the life of the session.

Fields§

§content_id: Option<String>

Key: cid

Header: CMCD-Session

Type & Unit: String

A unique string identifying the current content. Maximum length is 64 characters. This value is consistent across multiple different sessions and devices and is defined and updated at the discretion of the service provider.

§playback_rate: Option<f64>

Key: pr

Header: CMCD-Session

Type & Unit: Decimal

1 if real-time, 2 if double speed, 0 if not playing. SHOULD only be sent if not equal to 1

§streaming_format: Option<StreamingFormat>

Key: sf

Header: CMCD-Session

Type & Unit: Token

The streaming format that defines the current request.

d = MPEG DASH

h = HTTP Live Streaming (HLS)

s = Smooth Streaming

o = other

If the streaming format being requested is unknown, then this key MUST NOT be used.

StreamingFormat

§session_id: Option<String>

Key: sid

Header: CMCD-Session

Type & Unit: String

A GUID identifying the current playback session. A playback session typically ties together segments belonging to a single media asset. Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID specification RFC4122.

§stream_type: Option<StreamType>

Key: st

Header: CMCD-Session

Type & Unit: Token

v = all segments are available – e.g., VOD

l = segments become available over time – e.g., LIVE

StreamType

§version: Option<i64>

Key: v

Header: CMCD-Session

Type & Unit: Integer

The version of this specification used for interpreting the defined key names and values. If this key is omitted, the client and server MUST interpret the values as being defined by version 1. Client SHOULD omit this field if the version is 1.

Trait Implementations§

Source§

impl Debug for Session

Source§

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

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

impl Default for Session

Source§

fn default() -> Session

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Session

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encoder for Session

Source§

fn header_key() -> String

The Header Key returned by this trait.
Source§

fn to_arguments(&self) -> Vec<String>

Parses the data fields into stringified key value pair.
Source§

fn to_query_string(&self) -> String

Converts the data fields to an URL encoded string.
Source§

fn to_header(&self, custom: Option<&Vec<String>>) -> (String, String)

Encodes the data fields to the header key and value. Read more
Source§

impl PartialEq for Session

Source§

fn eq(&self, other: &Session) -> 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 Serialize for Session

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Session

Auto Trait Implementations§

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> 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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,