Skip to main content

EitCollector

Struct EitCollector 

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

EIT-specific collector.

Present/following EITs complete as one normal section set. Schedule EITs complete only when every schedule table_id from the kind’s first table_id through the advertised last_table_id has completed its own section set.

§Memory bounds

The collector is bounded by DEFAULT_MAX_LOGICAL_KEYS (configurable via with_max_logical_keys). When the sections or schedules map is full, incoming sections for new keys are skipped until space frees — the same skip-until-space policy as crate::carousel::ModuleReassembler.

Implementations§

Source§

impl EitCollector

Source

pub fn new() -> Self

Create an empty EIT collector with the default cap (DEFAULT_MAX_LOGICAL_KEYS).

Source

pub fn with_max_logical_keys(self, max_logical_keys: usize) -> Self

Replace the logical-key cap (default DEFAULT_MAX_LOGICAL_KEYS). The cap is applied independently to the sections and schedules maps. Sections for new keys are skipped when the relevant map is full, until clear or retain_logical frees capacity.

Source

pub fn push_section( &mut self, bytes: impl AsRef<[u8]>, ) -> CollectResult<Option<CompletedEit>>

Push one complete EIT section.

Returns Some for a completed present/following table or a completed schedule table-id range.

§Errors

Returns a CollectError if the incoming section is malformed, inconsistent with already retained bytes, or not an EIT section. Treat the error as applying to this section only unless your application wants strict stream-fail behavior.

Source

pub fn push_section_with_pid( &mut self, pid: Option<u16>, bytes: impl AsRef<[u8]>, ) -> CollectResult<Option<CompletedEit>>

Push one complete EIT section with PID context.

Source

pub fn clear(&mut self)

Drop all retained EIT partial and completed schedule state.

Long-running receivers that collect EPG data continuously can call this at an application-defined carousel boundary if they do not need older schedule state.

Source

pub fn retain_logical<F>(&mut self, keep: F)
where F: FnMut(&EitLogicalKey) -> bool,

Retain only logical EIT keys accepted by keep.

This is the explicit pruning hook for long-running EIT schedule collection. Both in-progress section sets and completed schedule ranges for rejected keys are removed.

Source

pub fn section_set_len(&self) -> usize

Number of retained EIT section-set states.

Source

pub fn schedule_len(&self) -> usize

Number of retained EIT logical schedule states.

Trait Implementations§

Source§

impl Debug for EitCollector

Source§

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

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

impl Default for EitCollector

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.