pub struct QuicLongHeader<'a> { /* private fields */ }Expand description
A borrowed RFC 8999 invariant QUIC long-header prefix.
as_bytes contains only the invariant prefix structurally owned by this view.
The following bytes are available separately through Self::version_specific and
are intentionally not interpreted as a payload by this version-independent layer.
Implementations§
Source§impl<'a> QuicLongHeader<'a>
impl<'a> QuicLongHeader<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self, QuicPacketParseError>
pub fn parse(bytes: &'a [u8]) -> Result<Self, QuicPacketParseError>
Parses exactly the RFC 8999 invariant long-header prefix.
Sourcepub const fn first_byte(self) -> u8
pub const fn first_byte(self) -> u8
Returns the raw first byte, including protected and version-specific bits.
Sourcepub const fn has_fixed_bit(self) -> bool
pub const fn has_fixed_bit(self) -> bool
Returns whether the raw fixed bit is set, without validating it.
Sourcepub const fn raw_type_bits(self) -> u8
pub const fn raw_type_bits(self) -> u8
Returns the two raw long-header type bits, without assigning unknown-version semantics.
Sourcepub const fn version(self) -> QuicVersion
pub const fn version(self) -> QuicVersion
Returns the raw QUIC version value.
Sourcepub const fn destination_connection_id(self) -> QuicConnectionId<'a>
pub const fn destination_connection_id(self) -> QuicConnectionId<'a>
Returns the exact destination connection ID.
Sourcepub const fn source_connection_id(self) -> QuicConnectionId<'a>
pub const fn source_connection_id(self) -> QuicConnectionId<'a>
Returns the exact source connection ID.
Sourcepub const fn as_bytes(self) -> &'a [u8]
pub const fn as_bytes(self) -> &'a [u8]
Returns the exact invariant-prefix bytes, excluding version-specific bytes.
Sourcepub const fn version_specific(self) -> &'a [u8]
pub const fn version_specific(self) -> &'a [u8]
Returns all bytes after the invariant prefix without interpreting them.
Sourcepub const fn long_packet_type(self) -> Option<QuicLongPacketType>
pub const fn long_packet_type(self) -> Option<QuicLongPacketType>
Returns the version-aware semantic packet type for QUIC v1 or v2 only.