pub struct T2miEventStream<R> { /* private fields */ }Expand description
Async Stream of T2miEvents from a raw TS byte source.
Feed any tokio::io::AsyncRead byte source and receive one T2miEvent
per complete, CRC-valid T2-MI packet.
The adapter performs 188-byte TS packet alignment using the same resync
logic as SectionStream (see crate::resync).
§Cancellation
Drop the stream. No internal tasks are spawned.
Implementations§
Source§impl<R: AsyncRead + Unpin> T2miEventStream<R>
impl<R: AsyncRead + Unpin> T2miEventStream<R>
Sourcepub fn new(reader: R, pid: u16) -> Self
pub fn new(reader: R, pid: u16) -> Self
Create a T2miEventStream from a TS-encapsulated source on pid.
pid is the 13-bit T2-MI PID from the PMT (e.g. 0x0006).
Sourcepub fn with_pump(reader: R, pump: T2miPump) -> Self
pub fn with_pump(reader: R, pump: T2miPump) -> Self
Create a T2miEventStream with an already-constructed T2miPump.
Sourcepub fn resync_stats(&self) -> ResyncStats
pub fn resync_stats(&self) -> ResyncStats
Access the resync statistics.
Source§impl T2miEventStream<UdpReader>
UDP/multicast convenience constructor — enabled by the udp feature.
impl T2miEventStream<UdpReader>
UDP/multicast convenience constructor — enabled by the udp feature.
Sourcepub async fn bind_multicast(
bind_addr: SocketAddrV4,
multicast_addr: Ipv4Addr,
pid: u16,
) -> Result<Self>
pub async fn bind_multicast( bind_addr: SocketAddrV4, multicast_addr: Ipv4Addr, pid: u16, ) -> Result<Self>
Bind a UDP socket to bind_addr and join multicast_addr.
pid is the 13-bit T2-MI PID from the PMT.
§Errors
Returns a std::io::Error if binding or joining the multicast group
fails.