pub struct T2miPump { /* private fields */ }Expand description
Feed-and-iterate T2-MI pump.
Supports two operating modes:
-
TS-encapsulated (most common): construct with
T2miPump::new, passing the 13-bit PID carrying T2-MI (from the PMT). Feed 188-byte MPEG-TS packets withT2miPump::feed_ts. The pump filters by PID, strips the TS header per ISO/IEC 13818-1 §2.4.3.2, and forwards the payload to the internalPacketReassembler(ETSI TS 102 773 §6.1.1). -
Raw (un-encapsulated): construct with
T2miPump::raw. Feed arbitrary byte slices withT2miPump::feed_raw. The pump buffers bytes and emits events once a full packet (determined by the header’spayload_len_bits) is available.
§PID note
PIDs are 13-bit values (0x0000–0x1FFF per ISO/IEC 13818-1 §2.4.3.2).
This type uses u16 directly; no newtype is introduced. Values above
0x1FFF are accepted without error — the PID filter simply never matches.
Implementations§
Source§impl T2miPump
impl T2miPump
Sourcepub fn new(pid: u16) -> Self
pub fn new(pid: u16) -> Self
Create a TS-encapsulated pump that filters to pid.
pid is the 13-bit T2-MI PID from the PMT (e.g. 0x0006 for data
piping).
§PID range
Valid MPEG-TS PIDs are 13-bit (0x0000–0x1FFF); this parameter is u16.
No newtype is introduced to keep the API lightweight.
Sourcepub fn raw() -> Self
pub fn raw() -> Self
Create an un-encapsulated raw-stream pump.
Use T2miPump::feed_raw to supply bytes. The pump buffers internally
and emits events by packet boundary, not by call boundary — a packet
split across two feed_raw calls produces exactly one event.
Sourcepub fn feed_ts(&mut self, packet: &[u8]) -> impl Iterator<Item = T2miEvent> + '_
pub fn feed_ts(&mut self, packet: &[u8]) -> impl Iterator<Item = T2miEvent> + '_
Feed one 188-byte MPEG-TS packet. Infallible: malformed packets are
counted in Stats::malformed_packets and discarded.
Packets on the wrong PID are silently ignored (only Stats::ts_packets
is incremented).
Returns a draining iterator over any T2-MI events completed by this feed.
Sourcepub fn feed_raw(&mut self, data: &[u8]) -> impl Iterator<Item = T2miEvent> + '_
pub fn feed_raw(&mut self, data: &[u8]) -> impl Iterator<Item = T2miEvent> + '_
Feed raw T2-MI bytes (un-encapsulated mode).
The slice may contain a partial packet; bytes are buffered internally.
A packet split across two feed_raw calls produces exactly one event.
Returns a draining iterator over any T2-MI events completed by this feed.