pub struct ExtTime {
pub sct_high: Option<u32>,
pub sct_low: Option<u32>,
pub ert: Option<u32>,
pub slc: Option<u32>,
pub pi_specific: u8,
}Expand description
A decoded EXT_TIME header extension (RFC 5651 §5.2.2, HET = 2).
Carries 0..4 32-bit time values selected by the 16-bit Use bit field. When
present they appear in the fixed order SCT-High, SCT-Low, ERT, SLC; each
Some value contributes one 32-bit word. The PI-specific low 8 bits of the
Use field are preserved verbatim in pi_specific.
Fields§
§sct_high: Option<u32>Sender Current Time, MS 32 bits (NTP seconds).
sct_low: Option<u32>Sender Current Time, LS 32 bits (NTP fraction). If set, sct_high MUST
also be set.
ert: Option<u32>Expected Residual Time, seconds.
slc: Option<u32>Session Last Changed time, seconds.
pi_specific: u8PI-specific low 8 bits of the Use field (out of scope of RFC 5651).
Implementations§
Source§impl ExtTime
impl ExtTime
Sourcepub fn use_field(&self) -> u16
pub fn use_field(&self) -> u16
Build the 16-bit Use field from the present values + PI-specific byte.
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Total serialized length in bytes (first word + 4 bytes per value).
Sourcepub fn parse(content: &[u8]) -> Result<Self>
pub fn parse(content: &[u8]) -> Result<Self>
Decode an EXT_TIME from the content of a HeaderExtension whose HET
is HET_EXT_TIME (the content is everything after HET+HEL: the 2-byte
Use field followed by the time values).
Sourcepub fn to_content(&self) -> Vec<u8> ⓘ
pub fn to_content(&self) -> Vec<u8> ⓘ
Encode the EXT_TIME content (Use field + present time values) into a
freshly allocated buffer suitable for HeaderExtension::content.
Sourcepub fn to_extension<'a>(&self, scratch: &'a mut Vec<u8>) -> HeaderExtension<'a>
pub fn to_extension<'a>(&self, scratch: &'a mut Vec<u8>) -> HeaderExtension<'a>
Build a generic HeaderExtension (HET = 2) carrying this EXT_TIME,
borrowing from scratch (which must outlive the returned extension).