pub struct QuicHeader { /* private fields */ }Expand description
Raw-preserving QUIC header placeholder.
Implementations§
Source§impl QuicHeader
impl QuicHeader
Sourcepub fn from_decoded_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
pub fn from_decoded_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
Preserve raw header bytes recovered from the wire.
Sourcepub fn first_byte(self, first_byte: u8) -> Self
pub fn first_byte(self, first_byte: u8) -> Self
Pin the first header byte explicitly.
Sourcepub fn header_form(self, form: QuicHeaderForm) -> Self
pub fn header_form(self, form: QuicHeaderForm) -> Self
Set the invariant header form bit while preserving every other bit.
Sourcepub fn fixed_bit(self, fixed: bool) -> Self
pub fn fixed_bit(self, fixed: bool) -> Self
Set the QUIC fixed bit while preserving every other bit.
Sourcepub fn grease_quic_bit(self) -> Self
pub fn grease_quic_bit(self) -> Self
Clear the QUIC bit explicitly for RFC 9287 greasing.
Sourcepub fn long_packet_type_bits(self, bits: u8) -> Self
pub fn long_packet_type_bits(self, bits: u8) -> Self
Set the v1/v2 long-header packet type bits while preserving other bits.
Sourcepub fn long_reserved_bits(self, bits: u8) -> Self
pub fn long_reserved_bits(self, bits: u8) -> Self
Set the v1/v2 long-header reserved bits while preserving other bits.
Sourcepub fn short_spin_bit(self, spin: bool) -> Self
pub fn short_spin_bit(self, spin: bool) -> Self
Set the short-header spin bit while preserving every other bit.
Sourcepub fn short_reserved_bits(self, bits: u8) -> Self
pub fn short_reserved_bits(self, bits: u8) -> Self
Set the v1/v2 short-header reserved bits while preserving other bits.
Sourcepub fn short_key_phase(self, key_phase: bool) -> Self
pub fn short_key_phase(self, key_phase: bool) -> Self
Set the short-header key-phase bit while preserving every other bit.
Sourcepub fn packet_number_len_bits(self, bits: u8) -> Self
pub fn packet_number_len_bits(self, bits: u8) -> Self
Set raw packet-number length bits while preserving every other bit.
Sourcepub fn packet_number_len(self, encoded_len: usize) -> Result<Self>
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.
Sourcepub fn first_byte_value(&self) -> Option<u8>
pub fn first_byte_value(&self) -> Option<u8>
Stored first-byte value, if one has been supplied or decoded.
Sourcepub fn first_byte_state(&self) -> FieldState
pub fn first_byte_state(&self) -> FieldState
State of the first-byte field.
Sourcepub fn header_form_value(&self) -> Option<QuicHeaderForm>
pub fn header_form_value(&self) -> Option<QuicHeaderForm>
Invariant header form, if byte 0 is present.
Sourcepub fn is_long_header(&self) -> Option<bool>
pub fn is_long_header(&self) -> Option<bool>
Return true when byte 0 identifies a long header.
Sourcepub fn is_short_header(&self) -> Option<bool>
pub fn is_short_header(&self) -> Option<bool>
Return true when byte 0 identifies a short header.
Sourcepub fn fixed_bit_value(&self) -> Option<bool>
pub fn fixed_bit_value(&self) -> Option<bool>
QUIC/fixed bit value, if byte 0 is present.
Sourcepub fn quic_bit_status_value(&self) -> Option<QuicFixedBitStatus>
pub fn quic_bit_status_value(&self) -> Option<QuicFixedBitStatus>
RFC 9287 QUIC bit status, if byte 0 is present.
Sourcepub fn quic_bit_label_value(&self) -> Option<&'static str>
pub fn quic_bit_label_value(&self) -> Option<&'static str>
RFC 9287 QUIC bit label, if byte 0 is present.
Sourcepub fn long_packet_type_bits_value(&self) -> Option<u8>
pub fn long_packet_type_bits_value(&self) -> Option<u8>
Raw v1/v2 long-header packet type bits, if byte 0 is present.
Sourcepub fn long_reserved_bits_value(&self) -> Option<u8>
pub fn long_reserved_bits_value(&self) -> Option<u8>
Raw v1/v2 long-header reserved bits, if byte 0 is present.
Sourcepub fn short_spin_bit_value(&self) -> Option<bool>
pub fn short_spin_bit_value(&self) -> Option<bool>
Short-header spin bit value, if byte 0 is present.
Sourcepub fn short_reserved_bits_value(&self) -> Option<u8>
pub fn short_reserved_bits_value(&self) -> Option<u8>
Raw v1/v2 short-header reserved bits, if byte 0 is present.
Sourcepub fn short_key_phase_value(&self) -> Option<bool>
pub fn short_key_phase_value(&self) -> Option<bool>
Short-header key-phase bit value, if byte 0 is present.
Sourcepub fn packet_number_len_bits_value(&self) -> Option<u8>
pub fn packet_number_len_bits_value(&self) -> Option<u8>
Raw packet-number length bits, if byte 0 is present.
Sourcepub fn packet_number_len_value(&self) -> Option<usize>
pub fn packet_number_len_value(&self) -> Option<usize>
Decoded packet-number length in bytes, if byte 0 is present.
Sourcepub fn destination_connection_id_field_present(&self) -> Option<bool>
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.
Trait Implementations§
Source§impl Clone for QuicHeader
impl Clone for QuicHeader
Source§fn clone(&self) -> QuicHeader
fn clone(&self) -> QuicHeader
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 QuicHeader
impl Debug for QuicHeader
Source§impl Default for QuicHeader
impl Default for QuicHeader
Source§fn default() -> QuicHeader
fn default() -> QuicHeader
impl Eq for QuicHeader
Source§impl PartialEq for QuicHeader
impl PartialEq for QuicHeader
Source§fn eq(&self, other: &QuicHeader) -> bool
fn eq(&self, other: &QuicHeader) -> bool
self and other values to be equal, and is used by ==.