Struct AdaptationField

Source
pub struct AdaptationField<'buf> { /* private fields */ }
Expand description

A collection of fields that may optionally appear within the header of a transport stream Packet.

As returned by Packet::adaptation_field()

Implementations§

Source§

impl<'buf> AdaptationField<'buf>

Source

pub fn new(buf: &'buf [u8]) -> AdaptationField<'buf>

Create a new structure to parse the adaptation field data held within the given slice.

Panics if the slice is empty.

Source

pub fn discontinuity_indicator(&self) -> bool

Get the value of the discontinuity_indicator field which might have been written into the transport stream by some ‘upstream’ processor on discovering that there was a break in the data.

Source

pub fn random_access_indicator(&self) -> bool

Get the value of the random_access_indicator field.

Source

pub fn elementary_stream_priority_indicator(&self) -> u8

Get the value of the elementary_stream_priority_indicator field.

Source

pub fn pcr(&self) -> Result<ClockRef, AdaptationFieldError>

Get the Program Clock Reference field, or AdaptationFieldError::FieldNotPresent if absent

Source

pub fn opcr(&self) -> Result<ClockRef, AdaptationFieldError>

Returns the ‘Original Program Clock Reference’ value, or AdaptationFieldError::FieldNotPresent if absent

Source

pub fn splice_countdown(&self) -> Result<u8, AdaptationFieldError>

Get the value of the splice_countdown field, or AdaptationFieldError::FieldNotPresent if absent

Source

pub fn transport_private_data(&self) -> Result<&[u8], AdaptationFieldError>

Borrow a slice of the underlying buffer containing private data, or AdaptationFieldError::FieldNotPresent if absent

Source

pub fn adaptation_field_extension( &self, ) -> Result<AdaptationFieldExtension<'buf>, AdaptationFieldError>

Returns extended adaptation fields, or AdaptationFieldError::FieldNotPresent if absent

Trait Implementations§

Source§

impl<'buf> Debug for AdaptationField<'buf>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> Freeze for AdaptationField<'buf>

§

impl<'buf> RefUnwindSafe for AdaptationField<'buf>

§

impl<'buf> Send for AdaptationField<'buf>

§

impl<'buf> Sync for AdaptationField<'buf>

§

impl<'buf> Unpin for AdaptationField<'buf>

§

impl<'buf> UnwindSafe for AdaptationField<'buf>

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, 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.