pub struct QuicLongHeaderPacket { /* private fields */ }Expand description
Decoded QUIC Initial, 0-RTT, or Handshake long-header packet.
Implementations§
Source§impl QuicLongHeaderPacket
impl QuicLongHeaderPacket
Sourcepub fn initial_builder() -> QuicInitialBuilder
pub fn initial_builder() -> QuicInitialBuilder
Start building a QUIC Initial packet.
Sourcepub fn handshake_builder() -> QuicHandshakeBuilder
pub fn handshake_builder() -> QuicHandshakeBuilder
Start building a QUIC Handshake packet.
Sourcepub fn zero_rtt_builder() -> QuicZeroRttBuilder
pub fn zero_rtt_builder() -> QuicZeroRttBuilder
Start building a QUIC 0-RTT packet.
Sourcepub fn decode(bytes: impl AsRef<[u8]>) -> Result<Self>
pub fn decode(bytes: impl AsRef<[u8]>) -> Result<Self>
Decode a byte-complete Initial, 0-RTT, or Handshake long-header packet.
The QUIC Length field covers the packet-number bytes plus the protected payload. Bytes after that span belong to later coalesced packets and are not included in this packet’s preserved raw bytes.
Sourcepub const fn first_byte(&self) -> u8
pub const fn first_byte(&self) -> u8
Raw first byte, including protected packet-type-specific bits.
Sourcepub const fn quic_bit_status(&self) -> QuicFixedBitStatus
pub const fn quic_bit_status(&self) -> QuicFixedBitStatus
RFC 9287 QUIC bit status.
Sourcepub const fn packet_kind(&self) -> QuicLongPacketKind
pub const fn packet_kind(&self) -> QuicLongPacketKind
Version-specific long-header packet kind.
Sourcepub fn destination_connection_id(&self) -> &QuicConnectionId
pub fn destination_connection_id(&self) -> &QuicConnectionId
Borrow the Destination Connection ID.
Sourcepub fn source_connection_id(&self) -> &QuicConnectionId
pub fn source_connection_id(&self) -> &QuicConnectionId
Borrow the Source Connection ID.
Sourcepub const fn token_length(&self) -> Option<QuicVarInt>
pub const fn token_length(&self) -> Option<QuicVarInt>
Decoded Initial Token Length field, when this is an Initial packet.
Sourcepub const fn token_length_encoded_len(&self) -> Option<usize>
pub const fn token_length_encoded_len(&self) -> Option<usize>
Encoded width of the Initial Token Length field, when present.
Sourcepub fn token(&self) -> &[u8] ⓘ
pub fn token(&self) -> &[u8] ⓘ
Borrow the Initial token bytes. Non-Initial packets return an empty slice.
Sourcepub const fn length(&self) -> QuicVarInt
pub const fn length(&self) -> QuicVarInt
Decoded QUIC Length field value.
Sourcepub const fn length_encoded_len(&self) -> usize
pub const fn length_encoded_len(&self) -> usize
Encoded width of the QUIC Length field.
Sourcepub const fn packet_number(&self) -> QuicPacketNumber
pub const fn packet_number(&self) -> QuicPacketNumber
Decoded truncated packet-number value.
Sourcepub fn packet_number_bytes(&self) -> &[u8] ⓘ
pub fn packet_number_bytes(&self) -> &[u8] ⓘ
Borrow the raw packet-number bytes.
Sourcepub fn protected_payload(&self) -> &[u8] ⓘ
pub fn protected_payload(&self) -> &[u8] ⓘ
Borrow the protected payload bytes after the packet number.
Sourcepub fn inspection_fields(&self) -> Vec<(&'static str, String)>
pub fn inspection_fields(&self) -> Vec<(&'static str, String)>
Stable field/value pairs for packet inspection.
Trait Implementations§
Source§impl Clone for QuicLongHeaderPacket
impl Clone for QuicLongHeaderPacket
Source§fn clone(&self) -> QuicLongHeaderPacket
fn clone(&self) -> QuicLongHeaderPacket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuicLongHeaderPacket
impl Debug for QuicLongHeaderPacket
impl Eq for QuicLongHeaderPacket
Source§impl PartialEq for QuicLongHeaderPacket
impl PartialEq for QuicLongHeaderPacket
Source§fn eq(&self, other: &QuicLongHeaderPacket) -> bool
fn eq(&self, other: &QuicLongHeaderPacket) -> bool
self and other values to be equal, and is used by ==.