dvb_t2mi/traits.rs
1//! T2-MI–specific traits. `Parse` / `Serialize` are provided by `dvb_common`
2//! and imported directly at call sites.
3
4/// Implemented by every typed T2-MI payload; drives
5/// [`crate::payload::AnyPayload`] dispatch.
6///
7/// `PACKET_TYPE` is the wire `packet_type` byte from the T2-MI header that
8/// this type parses. `NAME` is a diagnostic label in SCREAMING_SNAKE convention
9/// without any `_payload` suffix.
10pub trait PayloadDef<'a>: dvb_common::Parse<'a, Error = crate::error::Error> {
11 /// Wire `packet_type` byte (TS 102 773 Table 1) this type accepts.
12 const PACKET_TYPE: u8;
13 /// Diagnostic name. Convention (workspace-wide): SCREAMING_SNAKE,
14 /// suffix-free — `BBFRAME`, `L1_CURRENT`, `FEF_NULL`
15 /// (no `_payload` suffix).
16 const NAME: &'static str;
17}