#[non_exhaustive]pub enum AnyTableSection<'a> {
Show 29 variants
PatSection(PatSection),
CatSection(CatSection<'a>),
PmtSection(PmtSection<'a>),
TsdtSection(TsdtSection<'a>),
DsmccSection(DsmccSection<'a>),
NitSection(NitSection<'a>),
SdtSection(SdtSection<'a>),
BatSection(BatSection<'a>),
UntSection(UntSection<'a>),
IntSection(IntSection<'a>),
SatSection(SatSection<'a>),
EitSection(EitSection<'a>),
TdtSection(TdtSection),
RstSection(RstSection),
StSection(StSection),
TotSection(TotSection<'a>),
AitSection(AitSection<'a>),
ContainerSection(ContainerSection<'a>),
RctSection(RctSection<'a>),
CitSection(CitSection<'a>),
MpeFecSection(MpeFecSection<'a>),
RntSection(RntSection<'a>),
MpeIfecSection(MpeIfecSection<'a>),
ProtectionMessage(ProtectionMessageSection<'a>),
DownloadableFontInfo(DownloadableFontInfoSection<'a>),
DitSection(DitSection),
SitSection(SitSection<'a>),
MpeDatagram(MpeDatagramSection<'a>),
Unknown {
table_id: u8,
raw: &'a [u8],
},
}Expand description
Every crate-implemented table-section parser, plus an Unknown
fallthrough.
serde uses external tagging with camelCase variant keys — a parsed
PAT section serializes as {"patSection": {…}}.
Variant names map 1:1 to section parser types; see each module for
the wire layout.
0x3E (datagram_section) is routed to DsmccSection by the
default dispatcher. The typed MPE view is reachable via
AnyTableSection::parse_as::<MpeDatagramSection> or
MpeDatagramSection::parse directly; the MpeDatagram variant
exists in this enum for API completeness but is never produced by
AnyTableSection::parse.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PatSection(PatSection)
CatSection(CatSection<'a>)
PmtSection(PmtSection<'a>)
TsdtSection(TsdtSection<'a>)
DsmccSection(DsmccSection<'a>)
NitSection(NitSection<'a>)
SdtSection(SdtSection<'a>)
BatSection(BatSection<'a>)
UntSection(UntSection<'a>)
IntSection(IntSection<'a>)
SatSection(SatSection<'a>)
EitSection(EitSection<'a>)
TdtSection(TdtSection)
RstSection(RstSection)
StSection(StSection)
TotSection(TotSection<'a>)
AitSection(AitSection<'a>)
ContainerSection(ContainerSection<'a>)
RctSection(RctSection<'a>)
CitSection(CitSection<'a>)
MpeFecSection(MpeFecSection<'a>)
RntSection(RntSection<'a>)
MpeIfecSection(MpeIfecSection<'a>)
ProtectionMessage(ProtectionMessageSection<'a>)
DownloadableFontInfo(DownloadableFontInfoSection<'a>)
DitSection(DitSection)
SitSection(SitSection<'a>)
MpeDatagram(MpeDatagramSection<'a>)
Unknown
table_id with no typed implementation; raw is the full
section bytes including the table_id header.
Implementations§
Source§impl<'a> AnyTableSection<'a>
impl<'a> AnyTableSection<'a>
Sourcepub const DISPATCHED_RANGES: &'static [(u8, u8)]
pub const DISPATCHED_RANGES: &'static [(u8, u8)]
All table_id ranges covered by the auto-dispatcher (excludes
@no_dispatch variants). Each entry is (lo, hi) inclusive.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Diagnostic name of the contained table — the type’s
TableDef::NAME
("EVENT_INFORMATION", "PROGRAM_ASSOCIATION", …);
"UNKNOWN" for AnyTableSection::Unknown.
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self>
pub fn parse(bytes: &'a [u8]) -> Result<Self>
Dispatch one complete section by its table_id (byte 0).
Returns Err(BufferTooShort) when bytes is empty.
Unknown table_ids produce Ok(AnyTableSection::Unknown { … }).
§Errors
crate::Error::BufferTooShort—bytesis empty.- Any parse error from the dispatched type.
Sourcepub fn parse_as<T>(bytes: &'a [u8]) -> Result<T>where
T: TableDef<'a>,
pub fn parse_as<T>(bytes: &'a [u8]) -> Result<T>where
T: TableDef<'a>,
Type-keyed parse: bypass the dispatcher and parse bytes
directly as T. Useful for types excluded from the default
dispatch, e.g.:
use dvb_si::tables::AnyTableSection;
use dvb_si::tables::mpe::MpeDatagramSection;
// A deliberately-too-short slice: parse_as propagates the
// BufferTooShort error from MpeDatagramSection::parse.
let err = AnyTableSection::parse_as::<MpeDatagramSection>(&[0x3E, 0x00]);
assert!(err.is_err());§Errors
Propagates T::parse errors.
Trait Implementations§
Source§impl<'a> Debug for AnyTableSection<'a>
impl<'a> Debug for AnyTableSection<'a>
Source§impl<'a> From<AitSection<'a>> for AnyTableSection<'a>
impl<'a> From<AitSection<'a>> for AnyTableSection<'a>
Source§fn from(t: AitSection<'a>) -> Self
fn from(t: AitSection<'a>) -> Self
Source§impl<'a> From<BatSection<'a>> for AnyTableSection<'a>
impl<'a> From<BatSection<'a>> for AnyTableSection<'a>
Source§fn from(t: BatSection<'a>) -> Self
fn from(t: BatSection<'a>) -> Self
Source§impl<'a> From<CatSection<'a>> for AnyTableSection<'a>
impl<'a> From<CatSection<'a>> for AnyTableSection<'a>
Source§fn from(t: CatSection<'a>) -> Self
fn from(t: CatSection<'a>) -> Self
Source§impl<'a> From<CitSection<'a>> for AnyTableSection<'a>
impl<'a> From<CitSection<'a>> for AnyTableSection<'a>
Source§fn from(t: CitSection<'a>) -> Self
fn from(t: CitSection<'a>) -> Self
Source§impl<'a> From<ContainerSection<'a>> for AnyTableSection<'a>
impl<'a> From<ContainerSection<'a>> for AnyTableSection<'a>
Source§fn from(t: ContainerSection<'a>) -> Self
fn from(t: ContainerSection<'a>) -> Self
Source§impl<'a> From<DitSection> for AnyTableSection<'a>
impl<'a> From<DitSection> for AnyTableSection<'a>
Source§fn from(t: DitSection) -> Self
fn from(t: DitSection) -> Self
Source§impl<'a> From<DownloadableFontInfoSection<'a>> for AnyTableSection<'a>
impl<'a> From<DownloadableFontInfoSection<'a>> for AnyTableSection<'a>
Source§fn from(t: DownloadableFontInfoSection<'a>) -> Self
fn from(t: DownloadableFontInfoSection<'a>) -> Self
Source§impl<'a> From<DsmccSection<'a>> for AnyTableSection<'a>
impl<'a> From<DsmccSection<'a>> for AnyTableSection<'a>
Source§fn from(t: DsmccSection<'a>) -> Self
fn from(t: DsmccSection<'a>) -> Self
Source§impl<'a> From<EitSection<'a>> for AnyTableSection<'a>
impl<'a> From<EitSection<'a>> for AnyTableSection<'a>
Source§fn from(t: EitSection<'a>) -> Self
fn from(t: EitSection<'a>) -> Self
Source§impl<'a> From<IntSection<'a>> for AnyTableSection<'a>
impl<'a> From<IntSection<'a>> for AnyTableSection<'a>
Source§fn from(t: IntSection<'a>) -> Self
fn from(t: IntSection<'a>) -> Self
Source§impl<'a> From<MpeDatagramSection<'a>> for AnyTableSection<'a>
impl<'a> From<MpeDatagramSection<'a>> for AnyTableSection<'a>
Source§fn from(t: MpeDatagramSection<'a>) -> Self
fn from(t: MpeDatagramSection<'a>) -> Self
Source§impl<'a> From<MpeFecSection<'a>> for AnyTableSection<'a>
impl<'a> From<MpeFecSection<'a>> for AnyTableSection<'a>
Source§fn from(t: MpeFecSection<'a>) -> Self
fn from(t: MpeFecSection<'a>) -> Self
Source§impl<'a> From<MpeIfecSection<'a>> for AnyTableSection<'a>
impl<'a> From<MpeIfecSection<'a>> for AnyTableSection<'a>
Source§fn from(t: MpeIfecSection<'a>) -> Self
fn from(t: MpeIfecSection<'a>) -> Self
Source§impl<'a> From<NitSection<'a>> for AnyTableSection<'a>
impl<'a> From<NitSection<'a>> for AnyTableSection<'a>
Source§fn from(t: NitSection<'a>) -> Self
fn from(t: NitSection<'a>) -> Self
Source§impl<'a> From<PatSection> for AnyTableSection<'a>
impl<'a> From<PatSection> for AnyTableSection<'a>
Source§fn from(t: PatSection) -> Self
fn from(t: PatSection) -> Self
Source§impl<'a> From<PmtSection<'a>> for AnyTableSection<'a>
impl<'a> From<PmtSection<'a>> for AnyTableSection<'a>
Source§fn from(t: PmtSection<'a>) -> Self
fn from(t: PmtSection<'a>) -> Self
Source§impl<'a> From<ProtectionMessageSection<'a>> for AnyTableSection<'a>
impl<'a> From<ProtectionMessageSection<'a>> for AnyTableSection<'a>
Source§fn from(t: ProtectionMessageSection<'a>) -> Self
fn from(t: ProtectionMessageSection<'a>) -> Self
Source§impl<'a> From<RctSection<'a>> for AnyTableSection<'a>
impl<'a> From<RctSection<'a>> for AnyTableSection<'a>
Source§fn from(t: RctSection<'a>) -> Self
fn from(t: RctSection<'a>) -> Self
Source§impl<'a> From<RntSection<'a>> for AnyTableSection<'a>
impl<'a> From<RntSection<'a>> for AnyTableSection<'a>
Source§fn from(t: RntSection<'a>) -> Self
fn from(t: RntSection<'a>) -> Self
Source§impl<'a> From<RstSection> for AnyTableSection<'a>
impl<'a> From<RstSection> for AnyTableSection<'a>
Source§fn from(t: RstSection) -> Self
fn from(t: RstSection) -> Self
Source§impl<'a> From<SatSection<'a>> for AnyTableSection<'a>
impl<'a> From<SatSection<'a>> for AnyTableSection<'a>
Source§fn from(t: SatSection<'a>) -> Self
fn from(t: SatSection<'a>) -> Self
Source§impl<'a> From<SdtSection<'a>> for AnyTableSection<'a>
impl<'a> From<SdtSection<'a>> for AnyTableSection<'a>
Source§fn from(t: SdtSection<'a>) -> Self
fn from(t: SdtSection<'a>) -> Self
Source§impl<'a> From<SitSection<'a>> for AnyTableSection<'a>
impl<'a> From<SitSection<'a>> for AnyTableSection<'a>
Source§fn from(t: SitSection<'a>) -> Self
fn from(t: SitSection<'a>) -> Self
Source§impl<'a> From<StSection> for AnyTableSection<'a>
impl<'a> From<StSection> for AnyTableSection<'a>
Source§impl<'a> From<TdtSection> for AnyTableSection<'a>
impl<'a> From<TdtSection> for AnyTableSection<'a>
Source§fn from(t: TdtSection) -> Self
fn from(t: TdtSection) -> Self
Source§impl<'a> From<TotSection<'a>> for AnyTableSection<'a>
impl<'a> From<TotSection<'a>> for AnyTableSection<'a>
Source§fn from(t: TotSection<'a>) -> Self
fn from(t: TotSection<'a>) -> Self
Source§impl<'a> From<TsdtSection<'a>> for AnyTableSection<'a>
impl<'a> From<TsdtSection<'a>> for AnyTableSection<'a>
Source§fn from(t: TsdtSection<'a>) -> Self
fn from(t: TsdtSection<'a>) -> Self
Source§impl<'a> From<UntSection<'a>> for AnyTableSection<'a>
impl<'a> From<UntSection<'a>> for AnyTableSection<'a>
Source§fn from(t: UntSection<'a>) -> Self
fn from(t: UntSection<'a>) -> Self
Source§impl<'a> Serialize for AnyTableSection<'a>
impl<'a> Serialize for AnyTableSection<'a>
Source§impl<'a> Yokeable<'a> for AnyTableSection<'static>
impl<'a> Yokeable<'a> for AnyTableSection<'static>
Source§type Output = AnyTableSection<'a>
type Output = AnyTableSection<'a>
Self with the 'static replaced with 'a, i.e. Self<'a>