pub enum QuicPacket<'a> {
ProtectedLong(QuicProtectedLongPacket<'a>),
VersionNegotiation(QuicVersionNegotiationPacket<'a>),
Retry(QuicRetryPacket<'a>),
Short(QuicShortHeader<'a>),
UnknownLong(QuicUnknownLongPacket<'a>),
}Expand description
One borrowed QUIC packet partitioned from a supplied UDP datagram.
Variants§
ProtectedLong(QuicProtectedLongPacket<'a>)
A length-delimited v1 or v2 protected Initial, 0-RTT, or Handshake packet.
VersionNegotiation(QuicVersionNegotiationPacket<'a>)
A Version Negotiation packet, which consumes the datagram remainder.
Retry(QuicRetryPacket<'a>)
A Retry packet, which consumes the datagram remainder.
Short(QuicShortHeader<'a>)
A short-header packet, which consumes the datagram remainder.
UnknownLong(QuicUnknownLongPacket<'a>)
An unknown nonzero-version long packet occupying the complete datagram remainder.
QUIC does not define a version-specific packet boundary for an unknown version, so
iteration stops here rather than guessing a suffix boundary. Self::as_bytes returns
the complete remaining datagram for this variant.
Implementations§
Source§impl<'a> QuicPacket<'a>
impl<'a> QuicPacket<'a>
Sourcepub const fn as_bytes(self) -> &'a [u8]
pub const fn as_bytes(self) -> &'a [u8]
Returns the exact complete packet bytes represented by this variant.
Sourcepub const fn first_byte(self) -> u8
pub const fn first_byte(self) -> u8
Returns the raw first byte.
Sourcepub const fn is_long_header(self) -> bool
pub const fn is_long_header(self) -> bool
Returns whether this packet uses the long-header form.