pub struct PayloadHeaderFields { /* private fields */ }Expand description
A shared generic-payload-header field set every concrete payload layer embeds (RFC 7296 §3.2).
It carries the three caller-overridable generic-header fields — Next Payload,
the Critical flag, and Payload Length — as Fields so a builder setter can
pin any of them while compile() auto-fills the rest. A concrete payload
layer holds one of these alongside its body fields and forwards
PayloadHeaderFields::next_payload_override,
PayloadHeaderFields::payload_length_override, and
PayloadHeaderFields::critical into its IkePayload impl.
Implementations§
Source§impl PayloadHeaderFields
impl PayloadHeaderFields
Sourcepub fn new() -> Self
pub fn new() -> Self
A generic-header field set with builder defaults: Next Payload and Payload Length unset (auto-filled), Critical defaulted to clear.
Sourcepub fn set_next_payload(&mut self, next_payload: u8)
pub fn set_next_payload(&mut self, next_payload: u8)
Pin the generic-header Next Payload explicitly (RFC 7296 §3.2).
Sourcepub fn set_length(&mut self, length: u16)
pub fn set_length(&mut self, length: u16)
Pin the generic-header Payload Length explicitly (RFC 7296 §3.2).
Sourcepub fn set_critical(&mut self, critical: bool)
pub fn set_critical(&mut self, critical: bool)
Set the Critical (C) flag explicitly (RFC 7296 §3.2).
Sourcepub fn next_payload_override(&self) -> Option<u8>
pub fn next_payload_override(&self) -> Option<u8>
Caller-set Next Payload override, if any.
Sourcepub fn payload_length_override(&self) -> Option<u16>
pub fn payload_length_override(&self) -> Option<u16>
Caller-set Payload Length override, if any.
Trait Implementations§
Source§impl Clone for PayloadHeaderFields
impl Clone for PayloadHeaderFields
Source§fn clone(&self) -> PayloadHeaderFields
fn clone(&self) -> PayloadHeaderFields
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more