Skip to main content

CarryOverExtractor

Struct CarryOverExtractor 

Source
pub struct CarryOverExtractor { /* private fields */ }
Expand description

Stateful UP extractor that carries partial user packets across BBFrame boundaries — a single UP can span multiple frames, especially in HEM where stride=187 bytes.

Use feed_nm / feed_hem per received frame; the returned Vec holds whichever 188-byte TS packets completed during that frame.

Implementations§

Source§

impl CarryOverExtractor

Source

pub fn new() -> Self

Create a fresh extractor with no carried-over state.

Source

pub fn feed_hem( &mut self, bbheader_bytes: &[u8; 10], data_field: &[u8], npd: bool, ) -> Vec<[u8; 188]>

Feed a HEM BBFrame’s header + data field. Returns any TS packets that completed during this frame.

npd is the MATYPE-1 NPD flag for the frame — when true the stream would additionally carry DNP bytes between UPs. NPD reinsertion is NOT YET implemented here; callers must not pass npd=true until the DNP path lands.

Source

pub fn feed_nm( &mut self, bbheader_bytes: &[u8; 10], data_field: &[u8], ) -> Vec<[u8; 188]>

Feed an NM BBFrame. Stride=188, byte[0] of each UP is the CRC-8 of the previous UP and gets replaced with 0x47.

Trait Implementations§

Source§

impl Default for CarryOverExtractor

Source§

fn default() -> Self

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

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> ErasedDestructor for T
where T: 'static,

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.