pub struct SectionEvent { /* private fields */ }Expand description
One complete, changed SI section. Owns its bytes — 'static, cheap clone.
A SectionEvent is only ever constructed for a section that
(a) is at least 3 bytes long, and (b) if it carries a CRC, passed CRC
validation. So SectionEvent::crc_ok is always true and
SectionEvent::table_id never panics.
Implementations§
Source§impl SectionEvent
impl SectionEvent
Sourcepub fn bytes(&self) -> &Bytes
pub fn bytes(&self) -> &Bytes
The full section bytes (header included, CRC included if present).
Sourcepub fn table_id(&self) -> u8
pub fn table_id(&self) -> u8
The table_id (byte 0). Never panics — events are only built for
sections of at least 3 bytes.
Sourcepub fn version(&self) -> Option<u8>
pub fn version(&self) -> Option<u8>
5-bit version_number, or None for short-form sections (which carry
no version field). Note the TOT, despite being short-form, has no
version field either, so this is None for it.
Sourcepub fn table_id_extension(&self) -> Option<u16>
pub fn table_id_extension(&self) -> Option<u16>
16-bit table_id_extension, or None for short-form sections.
Sourcepub fn section_number(&self) -> Option<u8>
pub fn section_number(&self) -> Option<u8>
section_number, or None for short-form sections.
Sourcepub fn crc_ok(&self) -> bool
pub fn crc_ok(&self) -> bool
Always true: events are emitted only after CRC validation (or for
CRC-less short-form sections, where there is nothing to validate).
Trait Implementations§
Source§impl Clone for SectionEvent
impl Clone for SectionEvent
Source§fn clone(&self) -> SectionEvent
fn clone(&self) -> SectionEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more