pub struct QuicProtectedLongPacket<'a> { /* private fields */ }Expand description
A borrowed QUIC v1 or v2 protected Initial, 0-RTT, or Handshake packet.
This view bounds the packet using its unprotected length field but deliberately leaves packet number length, protected payload, and all cryptographic interpretation opaque.
Implementations§
Source§impl<'a> QuicProtectedLongPacket<'a>
impl<'a> QuicProtectedLongPacket<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), QuicPacketParseError>
pub fn parse(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), QuicPacketParseError>
Parses one exact protected Initial, 0-RTT, or Handshake packet and returns its suffix.
Sourcepub const fn header(self) -> QuicLongHeader<'a>
pub const fn header(self) -> QuicLongHeader<'a>
Returns the accepted invariant long-header prefix.
Sourcepub const fn version(self) -> QuicVersion
pub const fn version(self) -> QuicVersion
Returns the supported QUIC version.
Sourcepub const fn packet_type(self) -> QuicLongPacketType
pub const fn packet_type(self) -> QuicLongPacketType
Returns the semantic Initial, 0-RTT, or Handshake type.
Sourcepub const fn token_length(self) -> Option<QuicVarInt<'a>>
pub const fn token_length(self) -> Option<QuicVarInt<'a>>
Returns the exact Initial token-length representation, if this is an Initial packet.
Sourcepub const fn token(self) -> Option<&'a [u8]>
pub const fn token(self) -> Option<&'a [u8]>
Returns the exact Initial token, including an empty token, if this is an Initial packet.
Sourcepub const fn length(self) -> QuicVarInt<'a>
pub const fn length(self) -> QuicVarInt<'a>
Returns the exact protected packet-length representation.
Sourcepub const fn packet_number_offset(self) -> usize
pub const fn packet_number_offset(self) -> usize
Returns the absolute offset of the protected packet number from packet start.
Sourcepub const fn protected_remainder(self) -> &'a [u8]
pub const fn protected_remainder(self) -> &'a [u8]
Returns the exact bounded packet-number-and-protected-payload region.