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
impl EitCollector
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty EIT collector with the default cap
(DEFAULT_MAX_LOGICAL_KEYS).
Sourcepub fn with_max_logical_keys(self, max_logical_keys: usize) -> Self
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.
Sourcepub fn push_section(
&mut self,
bytes: impl AsRef<[u8]>,
) -> CollectResult<Option<CompletedEit>>
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.
Sourcepub fn push_section_with_pid(
&mut self,
pid: Option<u16>,
bytes: impl AsRef<[u8]>,
) -> CollectResult<Option<CompletedEit>>
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.
Sourcepub fn clear(&mut self)
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.
Sourcepub fn retain_logical<F>(&mut self, keep: F)
pub fn retain_logical<F>(&mut self, keep: F)
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.
Sourcepub fn section_set_len(&self) -> usize
pub fn section_set_len(&self) -> usize
Number of retained EIT section-set states.
Sourcepub fn schedule_len(&self) -> usize
pub fn schedule_len(&self) -> usize
Number of retained EIT logical schedule states.