Skip to main content

Module section_stream

Module section_stream 

Source
Expand description

SectionStream — async futures_core::Stream of owned SI section events.

Wraps dvb_si::demux::SiDemux over any tokio::io::AsyncRead source, yielding one dvb_si::demux::SectionEvent per changed complete section. Events are already owned (bytes::Bytes internally) and therefore 'static, Clone, and Send + Sync — no yoke wrapping is required.

§Usage

use futures_core::Stream;
use std::pin::Pin;

// Stream from a file:
// let f = tokio::fs::File::open("stream.ts").await?;
// let mut s = dvb_stream::SectionStream::new(f);
// while let Some(event) = futures_util::StreamExt::next(&mut s).await { ... }

§Cancellation

Dropping the SectionStream cancels cleanly — no internal tasks are spawned. Any pending I/O is abandoned; partially reassembled sections are discarded.

Structs§

SectionStream
Async Stream of SectionEvents from a raw TS byte source.
UdpReader
A thin AsyncRead adapter over a tokio::net::UdpSocket.