pub struct Header<'a> { /* private fields */ }Expand description
Borrowed received header. Successful header decoding makes no payload claim.
Numeric argument copies are wiped on drop. The received bytes remain owned by the caller, which must provide a zeroizing owner for sensitive input.
Implementations§
Source§impl<'a> Header<'a>
impl<'a> Header<'a>
Sourcepub const fn received_bytes(&self) -> &'a [u8] ⓘ
pub const fn received_bytes(&self) -> &'a [u8] ⓘ
Exact received header bytes, including any non-preferred width.
Sourcepub const fn major_type(&self) -> CodecGeneralCborMajorType
pub const fn major_type(&self) -> CodecGeneralCborMajorType
Inspect the major type.
Sourcepub const fn argument_width(&self) -> CodecGeneralCborArgumentWidth
pub const fn argument_width(&self) -> CodecGeneralCborArgumentWidth
Inspect the received argument or float-payload width.
Sourcepub fn argument(&self) -> Option<u64>
pub fn argument(&self) -> Option<u64>
Return an integer argument; floats, indefinite lengths, and breaks have none.
Sourcepub fn has_preferred_argument(&self) -> Option<bool>
pub fn has_preferred_argument(&self) -> Option<bool>
Observe shortest argument encoding independently of payload validation.
Floats, indefinite lengths, and breaks return None.
Sourcepub fn has_preferred_float(&self) -> Result<Option<bool>, CborError>
pub fn has_preferred_float(&self) -> Result<Option<bool>, CborError>
Observe whether a float uses the shortest width that holds its value
exactly, including NaN significands. Non-float headers return None.
Sourcepub const fn is_float(&self) -> bool
pub const fn is_float(&self) -> bool
Inspect whether this header carries IEEE floating-point bits.