#[non_exhaustive]pub enum ExtensionHeader {
Optional {
h_len: u8,
h_type: u8,
body: Vec<u8>,
},
Mandatory {
h_type: u8,
body: Vec<u8>,
},
}Expand description
A single ULE extension header in a chain (RFC 4326 §5).
Each variant carries the H-Type/H-LEN implicitly; the body bytes that
follow the introducing Type field are stored typed where the spec defines a
layout, else as opaque bytes for forward compatibility.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Optional
Optional header (H-LEN = 1..=5), opaque body of 2 * h_len - 2 bytes.
Covers TimeStamp, Extension-Padding and any unrecognised optional header: the body is preserved verbatim so the chain round-trips.
Fields
Mandatory
Mandatory header (H-LEN = 0) whose body consumes the remainder of the
SNDU payload up to (but excluding) the CRC.
Test SNDU / Bridged-Frame / TS-Concat / PDU-Concat are all of this form;
their inner structure is preserved as opaque bytes (the SNDU Length
and CRC give the boundary).
Implementations§
Source§impl ExtensionHeader
impl ExtensionHeader
Sourcepub fn type_field(&self) -> TypeField
pub fn type_field(&self) -> TypeField
The introducing TypeField for this header.
Sourcepub fn is_mandatory(&self) -> bool
pub fn is_mandatory(&self) -> bool
true if this is a mandatory (H-LEN = 0) extension header.
Sourcepub fn mandatory_h_type(&self) -> Option<MandatoryHType>
pub fn mandatory_h_type(&self) -> Option<MandatoryHType>
The typed MandatoryHType for a Mandatory header, or None if this
is an Optional header.
Sourcepub fn optional_h_type(&self) -> Option<OptionalHType>
pub fn optional_h_type(&self) -> Option<OptionalHType>
The typed OptionalHType for an Optional header, or None if this
is a Mandatory header.
Trait Implementations§
Source§impl Clone for ExtensionHeader
impl Clone for ExtensionHeader
Source§fn clone(&self) -> ExtensionHeader
fn clone(&self) -> ExtensionHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExtensionHeader
impl Debug for ExtensionHeader
Source§impl Display for ExtensionHeader
impl Display for ExtensionHeader
impl Eq for ExtensionHeader
Source§impl PartialEq for ExtensionHeader
impl PartialEq for ExtensionHeader
Source§fn eq(&self, other: &ExtensionHeader) -> bool
fn eq(&self, other: &ExtensionHeader) -> bool
self and other values to be equal, and is used by ==.