[][src]Struct hls_m3u8::tags::ExtXDateRange

pub struct ExtXDateRange {
    pub duration: Option<Duration>,
    pub planned_duration: Option<Duration>,
    pub end_on_next: bool,
    pub client_attributes: BTreeMap<String, Value>,
    // some fields omitted
}

The ExtXDateRange tag associates a date range (i.e., a range of time defined by a starting and ending date) with a set of attribute/value pairs.

Fields

duration: Option<Duration>

The duration of the ExtXDateRange. A single instant in time (e.g., crossing a finish line) should be represented with a duration of 0.

Note

This field is optional.

planned_duration: Option<Duration>

This field indicates the expected duration of an ExtXDateRange, whose actual duration is not yet known.

Note

This field is optional.

end_on_next: bool

This field indicates that the ExtXDateRange::end_date is equal to the ExtXDateRange::start_date of the following range.

The following range is the ExtXDateRange with the same class, that has the earliest start date after the start date of the range in question.

Note

This field is optional.

client_attributes: BTreeMap<String, Value>

The "X-" prefix defines a namespace reserved for client-defined attributes.

A client-attribute can only consist of uppercase characters (A-Z), numbers (0-9) and -.

Clients should use a reverse-dns naming scheme, when defining their own attribute names to avoid collisions.

An example of a client-defined attribute is X-COM-EXAMPLE-AD-ID="XYZ123".

Note

This field is optional.

Methods

impl ExtXDateRange[src]

#[must_use]pub fn id(&self) -> &String[src]

A string that uniquely identifies an ExtXDateRange in the playlist.

Note

This field is required.

pub fn set_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

A string that uniquely identifies an ExtXDateRange in the playlist.

Note

This field is required.

#[must_use]pub fn class(&self) -> Option<&String>[src]

A client-defined string that specifies some set of attributes and their associated value semantics. All ExtXDateRanges with the same class attribute value must adhere to these semantics.

Note

This field is optional.

pub fn set_class<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

A client-defined string that specifies some set of attributes and their associated value semantics. All ExtXDateRanges with the same class attribute value must adhere to these semantics.

Note

This field is optional.

#[must_use]pub fn start_date(&self) -> Option<&String>[src]

The date at which the ExtXDateRange begins.

Note

This field is required by the spec wording, but optional in examples elsewhere in the same document. Some implementations omit it in practise (e.g. for SCTE 'explicit-IN' markers) so it is optional here.

pub fn set_start_date<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

The date at which the ExtXDateRange begins.

Note

This field is required by the spec wording, but optional in examples elsewhere in the same document. Some implementations omit it in practise (e.g. for SCTE 'explicit-IN' markers) so it is optional here.

#[must_use]pub fn end_date(&self) -> Option<&String>[src]

The date at which the ExtXDateRange ends. It must be equal to or later than the value of the start-date field.

Note

This field is optional.

pub fn set_end_date<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

The date at which the ExtXDateRange ends. It must be equal to or later than the value of the start-date field.

Note

This field is optional.

#[must_use]pub fn scte35_cmd(&self) -> Option<&String>[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

pub fn set_scte35_cmd<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

#[must_use]pub fn scte35_out(&self) -> Option<&String>[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

pub fn set_scte35_out<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

#[must_use]pub fn scte35_in(&self) -> Option<&String>[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

pub fn set_scte35_in<VALUE: Into<String>>(
    &mut self,
    value: Option<VALUE>
) -> &mut Self
[src]

SCTE-35 (ANSI/SCTE 35 2013) is a joint ANSI/Society of Cable and Telecommunications Engineers standard that describes the inline insertion of cue tones in mpeg-ts streams.

SCTE-35 was originally used in the US to signal a local ad insertion opportunity in the transport streams, and in Europe to insert local TV programs (e.g. local news transmissions). It is now used to signal all kinds of program and ad events in linear transport streams and in newer ABR delivery formats such as HLS and DASH.

https://en.wikipedia.org/wiki/SCTE-35

Note

This field is optional.

#[must_use]pub fn insert_client_attributes(
    &mut self,
    value_0: String,
    value_1: Value
) -> &mut Self
[src]

The "X-" prefix defines a namespace reserved for client-defined attributes.

A client-attribute can only consist of uppercase characters (A-Z), numbers (0-9) and -.

Clients should use a reverse-dns naming scheme, when defining their own attribute names to avoid collisions.

An example of a client-defined attribute is X-COM-EXAMPLE-AD-ID="XYZ123".

Note

This field is optional.

impl ExtXDateRange[src]

#[must_use]pub fn new<T: Into<String>, I: Into<String>>(id: T, start_date: I) -> Self[src]

Makes a new ExtXDateRange tag.

Example

let date_range = ExtXDateRange::new("id", "2010-02-19T14:54:23.031+08:00");

#[must_use]pub fn builder() -> ExtXDateRangeBuilder[src]

Returns a builder for ExtXDateRange.

Example

use std::time::Duration;
use hls_m3u8::types::Float;

let date_range = ExtXDateRange::builder()
    .id("test_id")
    .class("test_class")
    .start_date("2014-03-05T11:15:00Z")
    .end_date("2014-03-05T11:16:00Z")
    .duration(Duration::from_secs_f64(60.1))
    .planned_duration(Duration::from_secs_f64(59.993))
    .insert_client_attribute("X-CUSTOM", Float::new(45.3))
    .scte35_cmd("0xFC002F0000000000FF2")
    .scte35_out("0xFC002F0000000000FF0")
    .scte35_in("0xFC002F0000000000FF1")
    .end_on_next(true)
    .build()?;

Trait Implementations

impl Clone for ExtXDateRange[src]

impl Debug for ExtXDateRange[src]

impl Display for ExtXDateRange[src]

impl Eq for ExtXDateRange[src]

impl FromStr for ExtXDateRange[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for ExtXDateRange[src]

impl Ord for ExtXDateRange[src]

impl PartialEq<ExtXDateRange> for ExtXDateRange[src]

impl PartialOrd<ExtXDateRange> for ExtXDateRange[src]

impl StructuralEq for ExtXDateRange[src]

impl StructuralPartialEq for ExtXDateRange[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.