Skip to main content

QuicLongHeaderPacket

Struct QuicLongHeaderPacket 

Source
pub struct QuicLongHeaderPacket { /* private fields */ }
Expand description

Decoded QUIC Initial, 0-RTT, or Handshake long-header packet.

Implementations§

Source§

impl QuicLongHeaderPacket

Source

pub fn initial_builder() -> QuicInitialBuilder

Start building a QUIC Initial packet.

Source

pub fn handshake_builder() -> QuicHandshakeBuilder

Start building a QUIC Handshake packet.

Source

pub fn zero_rtt_builder() -> QuicZeroRttBuilder

Start building a QUIC 0-RTT packet.

Source

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.

Source

pub const fn first_byte(&self) -> u8

Raw first byte, including protected packet-type-specific bits.

Source

pub const fn fixed_bit(&self) -> bool

QUIC/fixed bit value.

Source

pub const fn quic_bit_status(&self) -> QuicFixedBitStatus

RFC 9287 QUIC bit status.

Source

pub const fn version(&self) -> u32

QUIC version field.

Source

pub const fn packet_kind(&self) -> QuicLongPacketKind

Version-specific long-header packet kind.

Source

pub fn destination_connection_id(&self) -> &QuicConnectionId

Borrow the Destination Connection ID.

Source

pub fn source_connection_id(&self) -> &QuicConnectionId

Borrow the Source Connection ID.

Source

pub const fn token_length(&self) -> Option<QuicVarInt>

Decoded Initial Token Length field, when this is an Initial packet.

Source

pub const fn token_length_encoded_len(&self) -> Option<usize>

Encoded width of the Initial Token Length field, when present.

Source

pub fn token(&self) -> &[u8]

Borrow the Initial token bytes. Non-Initial packets return an empty slice.

Source

pub const fn length(&self) -> QuicVarInt

Decoded QUIC Length field value.

Source

pub const fn length_encoded_len(&self) -> usize

Encoded width of the QUIC Length field.

Source

pub const fn packet_number(&self) -> QuicPacketNumber

Decoded truncated packet-number value.

Source

pub fn packet_number_bytes(&self) -> &[u8]

Borrow the raw packet-number bytes.

Source

pub fn protected_payload(&self) -> &[u8]

Borrow the protected payload bytes after the packet number.

Source

pub fn as_bytes(&self) -> &[u8]

Borrow the preserved packet bytes.

Source

pub fn len(&self) -> usize

Packet length in bytes.

Source

pub fn is_empty(&self) -> bool

Return true when no packet bytes are present.

Source

pub fn summary(&self) -> String

One-line long-header summary.

Source

pub fn inspection_fields(&self) -> Vec<(&'static str, String)>

Stable field/value pairs for packet inspection.

Trait Implementations§

Source§

impl Clone for QuicLongHeaderPacket

Source§

fn clone(&self) -> QuicLongHeaderPacket

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuicLongHeaderPacket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for QuicLongHeaderPacket

Source§

impl PartialEq for QuicLongHeaderPacket

Source§

fn eq(&self, other: &QuicLongHeaderPacket) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for QuicLongHeaderPacket

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.