dvb_si/descriptors/
mod.rs1pub mod ac3;
14pub mod bouquet_name;
15pub mod ca;
16pub mod cable_delivery_system;
17pub mod component;
18pub mod content;
19pub mod content_identifier;
20pub mod data_stream_alignment;
21pub mod default_authority;
22pub mod enhanced_ac3;
23pub mod extended_event;
24pub mod frequency_list;
25pub mod iso_639_language;
26pub mod linkage;
27pub mod local_time_offset;
28pub mod logical_channel;
29pub mod network_name;
30pub mod parental_rating;
31pub mod private_data_indicator;
32pub mod registration;
33pub mod s2_satellite_delivery_system;
34pub mod satellite_delivery_system;
35pub mod service;
36pub mod service_list;
37pub mod short_event;
38pub mod stream_identifier;
39pub mod subtitling;
40pub mod teletext;
41pub mod terrestrial_delivery_system;
42
43pub use ca::CaDescriptor;
44pub use data_stream_alignment::DataStreamAlignmentDescriptor;
45pub use private_data_indicator::PrivateDataIndicatorDescriptor;
46pub use registration::RegistrationDescriptor;
47
48#[derive(Debug, Clone, PartialEq, Eq)]
50#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
51#[non_exhaustive]
52pub enum Descriptor<'a> {
53 Ca(CaDescriptor<'a>),
55 DataStreamAlignment(DataStreamAlignmentDescriptor),
57 PrivateDataIndicator(PrivateDataIndicatorDescriptor),
59 Registration(RegistrationDescriptor<'a>),
61 Unknown {
63 tag: u8,
65 #[cfg_attr(feature = "serde", serde(borrow))]
67 bytes: &'a [u8],
68 },
69}
70
71impl<'a> Descriptor<'a> {
72 #[must_use]
74 pub const fn tag(&self) -> u8 {
75 match self {
76 Self::Ca(_) => ca::TAG,
77 Self::DataStreamAlignment(_) => data_stream_alignment::TAG,
78 Self::PrivateDataIndicator(_) => private_data_indicator::TAG,
79 Self::Registration(_) => registration::TAG,
80 Self::Unknown { tag, .. } => *tag,
81 }
82 }
83}