#[non_exhaustive]pub enum AnyPayload<'a> {
Show 13 variants
Bbframe(BbframePayload<'a>),
AuxIq(AuxIqPayload<'a>),
ArbitraryCells(ArbitraryCellsPayload<'a>),
L1Current(L1CurrentPayload<'a>),
L1Future(L1FuturePayload<'a>),
P2Bias(P2BiasPayload),
Timestamp(T2TimestampPayload),
IndividualAddressing(IndividualAddressingPayload<'a>),
FefNull(FefNullPayload),
FefIq(FefIqPayload<'a>),
FefComposite(FefCompositePayload),
FefSubpart(FefSubPartPayload<'a>),
Unknown {
packet_type: u8,
body: &'a [u8],
},
}Expand description
Every crate-implemented T2-MI payload, plus an Unknown fallthrough.
serde uses external tagging with camelCase variant keys. Variant names map 1:1 to the payload modules; see each module for the wire layout.
§Dispatch contract
Use AnyPayload::dispatch with the payload bytes (post-header,
pre-CRC). See the module-level documentation for details.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bbframe(BbframePayload<'a>)
AuxIq(AuxIqPayload<'a>)
ArbitraryCells(ArbitraryCellsPayload<'a>)
L1Current(L1CurrentPayload<'a>)
L1Future(L1FuturePayload<'a>)
P2Bias(P2BiasPayload)
Timestamp(T2TimestampPayload)
IndividualAddressing(IndividualAddressingPayload<'a>)
FefNull(FefNullPayload)
FefIq(FefIqPayload<'a>)
FefComposite(FefCompositePayload)
FefSubpart(FefSubPartPayload<'a>)
Unknown
Packet type with no typed implementation; body contains the
raw payload bytes (post-header, pre-CRC).
Implementations§
Source§impl<'a> AnyPayload<'a>
impl<'a> AnyPayload<'a>
Sourcepub const DISPATCHED_TYPES: &'static [u8]
pub const DISPATCHED_TYPES: &'static [u8]
Every packet_type the generated dispatcher routes (excludes
AnyPayload::Unknown).
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Diagnostic name of the contained payload — the type’s
PayloadDef::NAME
("BBFRAME", "L1_CURRENT", …); "UNKNOWN" for
AnyPayload::Unknown.
Sourcepub fn dispatch(
packet_type: u8,
payload_bytes: &'a [u8],
) -> Option<Result<Self>>
pub fn dispatch( packet_type: u8, payload_bytes: &'a [u8], ) -> Option<Result<Self>>
Parse one payload by its packet_type.
payload_bytes must be the payload-only slice (bytes after
the 6-byte T2-MI header, before the 4-byte CRC trailer).
Returns None when packet_type has no typed implementation
(the caller turns that into AnyPayload::Unknown).
Returns Some(Err) on a typed parse failure for a recognised type.
See the module-level documentation for the dispatch contract (payload-only bytes, header and CRC excluded).