pub struct T2miEvent { /* private fields */ }Expand description
One complete, CRC-valid T2-MI packet. Owns its bytes — 'static, cheap clone.
Only constructed after CRC-32 validation (ETSI TS 102 773 Annex A).
T2miEvent::header and T2miEvent::payload are lazy: they borrow from
the owned Bytes on demand.
Implementations§
Source§impl T2miEvent
impl T2miEvent
Sourcepub fn packet_type(&self) -> u8
pub fn packet_type(&self) -> u8
The raw packet_type byte (byte 0 of the T2-MI header per §5.1).
Never panics — events are only built for CRC-valid packets which are at
least 6 (header) + 4 (CRC) = 10 bytes.
Sourcepub fn header(&self) -> Result<Header>
pub fn header(&self) -> Result<Header>
Parse the 6-byte T2-MI packet header (lazy, borrows this event’s bytes).
§Errors
Propagates crate::Error from dvb_common::Parse::parse on Header.
Sourcepub fn payload(&self) -> Result<AnyPayload<'_>>
pub fn payload(&self) -> Result<AnyPayload<'_>>
Parse the payload by dispatching on packet_type.
Parses the 6-byte header to obtain payload_len_bytes, slices
bytes[6..6+payload_len_bytes], and calls
AnyPayload::dispatch. Unrecognised packet types produce
AnyPayload::Unknown with the raw payload bytes.
§Errors
Returns crate::Error from parsing the Header or from the typed
payload parser.