Skip to main content

QuicHeader

Struct QuicHeader 

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

Raw-preserving QUIC header placeholder.

Implementations§

Source§

impl QuicHeader

Source

pub fn new() -> Self

Create an empty placeholder header.

Source

pub fn from_decoded_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>

Preserve raw header bytes recovered from the wire.

Source

pub fn first_byte(self, first_byte: u8) -> Self

Pin the first header byte explicitly.

Source

pub fn header_form(self, form: QuicHeaderForm) -> Self

Set the invariant header form bit while preserving every other bit.

Source

pub fn fixed_bit(self, fixed: bool) -> Self

Set the QUIC fixed bit while preserving every other bit.

Source

pub fn grease_quic_bit(self) -> Self

Clear the QUIC bit explicitly for RFC 9287 greasing.

Source

pub fn long_packet_type_bits(self, bits: u8) -> Self

Set the v1/v2 long-header packet type bits while preserving other bits.

Source

pub fn long_reserved_bits(self, bits: u8) -> Self

Set the v1/v2 long-header reserved bits while preserving other bits.

Source

pub fn short_spin_bit(self, spin: bool) -> Self

Set the short-header spin bit while preserving every other bit.

Source

pub fn short_reserved_bits(self, bits: u8) -> Self

Set the v1/v2 short-header reserved bits while preserving other bits.

Source

pub fn short_key_phase(self, key_phase: bool) -> Self

Set the short-header key-phase bit while preserving every other bit.

Source

pub fn packet_number_len_bits(self, bits: u8) -> Self

Set raw packet-number length bits while preserving every other bit.

Source

pub fn packet_number_len(self, encoded_len: usize) -> Result<Self>

Set packet-number length bits from a 1, 2, 3, or 4-byte length.

Source

pub fn first_byte_value(&self) -> Option<u8>

Stored first-byte value, if one has been supplied or decoded.

Source

pub fn first_byte_state(&self) -> FieldState

State of the first-byte field.

Source

pub fn header_form_value(&self) -> Option<QuicHeaderForm>

Invariant header form, if byte 0 is present.

Source

pub fn is_long_header(&self) -> Option<bool>

Return true when byte 0 identifies a long header.

Source

pub fn is_short_header(&self) -> Option<bool>

Return true when byte 0 identifies a short header.

Source

pub fn fixed_bit_value(&self) -> Option<bool>

QUIC/fixed bit value, if byte 0 is present.

Source

pub fn quic_bit_status_value(&self) -> Option<QuicFixedBitStatus>

RFC 9287 QUIC bit status, if byte 0 is present.

Source

pub fn quic_bit_label_value(&self) -> Option<&'static str>

RFC 9287 QUIC bit label, if byte 0 is present.

Source

pub fn long_packet_type_bits_value(&self) -> Option<u8>

Raw v1/v2 long-header packet type bits, if byte 0 is present.

Source

pub fn long_reserved_bits_value(&self) -> Option<u8>

Raw v1/v2 long-header reserved bits, if byte 0 is present.

Source

pub fn short_spin_bit_value(&self) -> Option<bool>

Short-header spin bit value, if byte 0 is present.

Source

pub fn short_reserved_bits_value(&self) -> Option<u8>

Raw v1/v2 short-header reserved bits, if byte 0 is present.

Source

pub fn short_key_phase_value(&self) -> Option<bool>

Short-header key-phase bit value, if byte 0 is present.

Source

pub fn packet_number_len_bits_value(&self) -> Option<u8>

Raw packet-number length bits, if byte 0 is present.

Source

pub fn packet_number_len_value(&self) -> Option<usize>

Decoded packet-number length in bytes, if byte 0 is present.

Source

pub fn destination_connection_id_field_present(&self) -> Option<bool>

Return whether this header form carries a Destination Connection ID field.

Long headers encode the field length after the version. Short headers carry the field immediately after byte 0, but the length is contextual.

Source

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

Borrow the preserved raw header bytes.

Trait Implementations§

Source§

impl Clone for QuicHeader

Source§

fn clone(&self) -> QuicHeader

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 QuicHeader

Source§

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

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

impl Default for QuicHeader

Source§

fn default() -> QuicHeader

Returns the “default value” for a type. Read more
Source§

impl Eq for QuicHeader

Source§

impl PartialEq for QuicHeader

Source§

fn eq(&self, other: &QuicHeader) -> 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 QuicHeader

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.