pub struct QuicUnprotectedLongHeader<'packet, 'unprotected> { /* private fields */ }Expand description
A checked caller-unprotected overlay of an accepted QUIC v1 or v2 protected long packet.
The supplied packet-number bytes may be external unmasking output in separate storage. This view verifies only their width and physical capacity in the protected packet; it neither authenticates the bytes nor requires them to alias the protected packet.
Implementations§
Source§impl<'packet, 'unprotected> QuicUnprotectedLongHeader<'packet, 'unprotected>
impl<'packet, 'unprotected> QuicUnprotectedLongHeader<'packet, 'unprotected>
Sourcepub fn new(
protected_packet: QuicProtectedLongPacket<'packet>,
unprotected_first_byte: u8,
unprotected_packet_number: &'unprotected [u8],
) -> Result<Self, QuicUnprotectedHeaderError>
pub fn new( protected_packet: QuicProtectedLongPacket<'packet>, unprotected_first_byte: u8, unprotected_packet_number: &'unprotected [u8], ) -> Result<Self, QuicUnprotectedHeaderError>
Associates externally unmasked long-header material with an accepted protected packet.
This validates preserved first-byte bits, supplied packet-number width, and physical packet-number capacity in that order. It performs no cryptographic operation.
Sourcepub const fn protected_packet(self) -> QuicProtectedLongPacket<'packet>
pub const fn protected_packet(self) -> QuicProtectedLongPacket<'packet>
Returns the accepted protected long packet.
Sourcepub const fn unprotected_first_byte(self) -> u8
pub const fn unprotected_first_byte(self) -> u8
Returns the caller-supplied unprotected first byte.
Sourcepub const fn packet_number(self) -> QuicTruncatedPacketNumber<'unprotected>
pub const fn packet_number(self) -> QuicTruncatedPacketNumber<'unprotected>
Returns the exact caller-supplied truncated packet number.
Sourcepub const fn raw_reserved_bits(self) -> u8
pub const fn raw_reserved_bits(self) -> u8
Returns the raw unprotected long-header reserved bits without validating them.