Skip to main content

AncContent

Struct AncContent 

Source
pub struct AncContent {
    pub did: u16,
    pub sdid: u16,
    pub data_count: u16,
    pub user_data_words: Vec<u16>,
    pub checksum: u16,
}
Expand description

One ST 291-1 ANC data packet’s content: DID/SDID/Data_Count/ User_Data_Words/Checksum_Word, every value the raw 10-bit wire word (including the ST 291-1 parity bits) stored verbatim — parity/checksum are not computed or validated here (docs/anc_packet_291.md scope note).

Identical across ST 2038 (MPEG-2 TS/PES) and RFC 8331 (RTP) carriage; see the module doc for why this type is always compiled.

Fields§

§did: u16

DID (10-bit raw, incl. ST 291-1 parity bits).

§sdid: u16

SDID (10-bit raw). For a “Type 1” ANC packet this word actually carries the data block number (DBN).

§data_count: u16

Data_Count (10-bit raw). The User_Data_Words loop counter uses only the low 8 bits (data_count & 0xFF).

§user_data_words: Vec<u16>

User_Data_Words (each 10-bit raw). Length is data_count & 0xFF.

§checksum: u16

Checksum_Word (10-bit raw, ST 291-1 checksum — not validated here).

Implementations§

Source§

impl AncContent

Source

pub fn udw_loop_count(&self) -> usize

The User_Data_Words loop count actually used on the wire: the low 8 bits of data_count, independent of the stored Vec’s length.

Trait Implementations§

Source§

impl Clone for AncContent

Source§

fn clone(&self) -> AncContent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AncContent

Source§

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

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

impl Eq for AncContent

Source§

impl PartialEq for AncContent

Source§

fn eq(&self, other: &AncContent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AncContent

Available on crate feature serde only.
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 AncContent

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.