Skip to main content

leodos_protocols/transport/cfdp/pdu/tlv/
flow_label.rs

1use zerocopy::FromBytes;
2use zerocopy::Immutable;
3use zerocopy::IntoBytes;
4use zerocopy::KnownLayout;
5use zerocopy::Unaligned;
6
7/// A zero-copy view of the Value of a Flow Label TLV.
8#[repr(C)]
9#[derive(Debug, FromBytes, IntoBytes, Unaligned, KnownLayout, Immutable)]
10pub struct TlvFlowLabel {
11    /// The variable-length flow label bytes.
12    rest: [u8],
13}
14
15impl TlvFlowLabel {
16    /// Returns the flow label bytes.
17    pub fn label(&self) -> &[u8] {
18        &self.rest
19    }
20}