TableSyntaxHeader

Struct TableSyntaxHeader 

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

Represents the fields that appear within table sections that use the common ‘section syntax’.

This will only be used for a table section if the section_syntax_indicator field in the SectionCommonHeader of the section is true.

Implementations§

Source§

impl<'buf> TableSyntaxHeader<'buf>

Source

pub const SIZE: usize = 5usize

The size of the header; 5 bytes

Source

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

Constructs a new TableSyntaxHeader, wrapping the given slice, which will all parsing of the header’s fields.

Panics if the given slice is less than TableSyntaxHeader::SIZE bytes long.

Source

pub fn id(&self) -> u16

The initial 16-bit field within a ‘section syntax’ PSI table (which immediately follows the section_length field). 13818-1 refers to this field as,

  • transport_stream_id when it appears within a Program Association Section
  • part of the reserved field when it appears within a Conditional Access Section
  • program_number when it appears within a Program Map Section
  • table_id_extension when it appears within a Private Section
Source

pub fn version(&self) -> u8

A 5-bit value that can be used to quickly check if this table has changed since the last time it was periodically inserted within the transport stream being read.

Source

pub fn current_next_indicator(&self) -> CurrentNext

Is this table applicable now, or will it become applicable at some future time. NB I’ve not seen sample data that uses anything other than CurrentNext::Current, so handling of tables with ‘future’ applicability may not actually work properly.

Source

pub fn section_number(&self) -> u8

The number of this section, within a potentially multi-section table.

It is common for only one section to appear within any PSI table, in which case this value will always be 0 within a given stream. The value of last_section_number() can be used to tell if multiple sections are expected.

Source

pub fn last_section_number(&self) -> u8

Indicates the value of section_number() that will appear within the last section within a table. In many streams, this value is always 0, however multiple table sections may need be used if the table needs to carry a large number of entries.

Trait Implementations§

Source§

impl<'buf> Debug for TableSyntaxHeader<'buf>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> Freeze for TableSyntaxHeader<'buf>

§

impl<'buf> RefUnwindSafe for TableSyntaxHeader<'buf>

§

impl<'buf> Send for TableSyntaxHeader<'buf>

§

impl<'buf> Sync for TableSyntaxHeader<'buf>

§

impl<'buf> Unpin for TableSyntaxHeader<'buf>

§

impl<'buf> UnwindSafe for TableSyntaxHeader<'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.