Skip to main content

QuicUnprotectedLongHeader

Struct QuicUnprotectedLongHeader 

Source
pub struct QuicUnprotectedLongHeader<'packet, 'unprotected> { /* private fields */ }
Expand description

A checked caller-unprotected overlay of an accepted QUIC v1 or v2 protected long packet.

The supplied packet-number bytes may be external unmasking output in separate storage. This view verifies only their width and physical capacity in the protected packet; it neither authenticates the bytes nor requires them to alias the protected packet.

Implementations§

Source§

impl<'packet, 'unprotected> QuicUnprotectedLongHeader<'packet, 'unprotected>

Source

pub fn new( protected_packet: QuicProtectedLongPacket<'packet>, unprotected_first_byte: u8, unprotected_packet_number: &'unprotected [u8], ) -> Result<Self, QuicUnprotectedHeaderError>

Associates externally unmasked long-header material with an accepted protected packet.

This validates preserved first-byte bits, supplied packet-number width, and physical packet-number capacity in that order. It performs no cryptographic operation.

Source

pub const fn protected_packet(self) -> QuicProtectedLongPacket<'packet>

Returns the accepted protected long packet.

Source

pub const fn unprotected_first_byte(self) -> u8

Returns the caller-supplied unprotected first byte.

Source

pub const fn packet_number(self) -> QuicTruncatedPacketNumber<'unprotected>

Returns the exact caller-supplied truncated packet number.

Source

pub const fn raw_reserved_bits(self) -> u8

Returns the raw unprotected long-header reserved bits without validating them.

Trait Implementations§

Source§

impl<'packet, 'unprotected> Clone for QuicUnprotectedLongHeader<'packet, 'unprotected>

Source§

fn clone(&self) -> Self

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<'packet, 'unprotected> Copy for QuicUnprotectedLongHeader<'packet, 'unprotected>

Source§

impl<'packet, 'unprotected> Debug for QuicUnprotectedLongHeader<'packet, 'unprotected>

Source§

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

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

impl<'packet, 'unprotected> Eq for QuicUnprotectedLongHeader<'packet, 'unprotected>

Source§

impl<'packet, 'unprotected> PartialEq for QuicUnprotectedLongHeader<'packet, 'unprotected>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'packet, 'unprotected> StructuralPartialEq for QuicUnprotectedLongHeader<'packet, 'unprotected>

Auto Trait Implementations§

§

impl<'packet, 'unprotected> Freeze for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> RefUnwindSafe for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> Send for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> Sync for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> Unpin for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> UnsafeUnpin for QuicUnprotectedLongHeader<'packet, 'unprotected>

§

impl<'packet, 'unprotected> UnwindSafe for QuicUnprotectedLongHeader<'packet, 'unprotected>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.