pub trait PacketFilter {
    type Ctx: DemuxContext;

    // Required method
    fn consume(&mut self, ctx: &mut Self::Ctx, pk: &Packet<'_>);
}
Expand description

Trait to which Demultiplex delegates handling of subsets of Transport Stream packets.

A packet filter can collaborate with the owning Demultiplex instance via the DemuxContext to which they will both be lent mutable access. For example, by making entries in the FilterChangeset owned by the DemuxContext, a PacketFilter implementation may alter the handling of subsequent packets in the Transport Stream.

Required Associated Types§

source

type Ctx: DemuxContext

The type of context-object used by the Demultiplex instance with which implementing PacketFilters will be collaborating.

Required Methods§

source

fn consume(&mut self, ctx: &mut Self::Ctx, pk: &Packet<'_>)

Implements filter-specific packet processing logic.

Implementors§

source§

impl<Ctx, E> PacketFilter for PesPacketFilter<Ctx, E>

§

type Ctx = Ctx

source§

impl<Ctx: DemuxContext> PacketFilter for NullPacketFilter<Ctx>

§

type Ctx = Ctx

source§

impl<Ctx: DemuxContext> PacketFilter for PatPacketFilter<Ctx>

§

type Ctx = Ctx

source§

impl<Ctx: DemuxContext> PacketFilter for PmtPacketFilter<Ctx>

§

type Ctx = Ctx