Skip to main content

QuicPacket

Enum QuicPacket 

Source
pub enum QuicPacket<'a> {
    ProtectedLong(QuicProtectedLongPacket<'a>),
    VersionNegotiation(QuicVersionNegotiationPacket<'a>),
    Retry(QuicRetryPacket<'a>),
    Short(QuicShortHeader<'a>),
    UnknownLong(QuicUnknownLongPacket<'a>),
}
Expand description

One borrowed QUIC packet partitioned from a supplied UDP datagram.

Variants§

§

ProtectedLong(QuicProtectedLongPacket<'a>)

A length-delimited v1 or v2 protected Initial, 0-RTT, or Handshake packet.

§

VersionNegotiation(QuicVersionNegotiationPacket<'a>)

A Version Negotiation packet, which consumes the datagram remainder.

§

Retry(QuicRetryPacket<'a>)

A Retry packet, which consumes the datagram remainder.

§

Short(QuicShortHeader<'a>)

A short-header packet, which consumes the datagram remainder.

§

UnknownLong(QuicUnknownLongPacket<'a>)

An unknown nonzero-version long packet occupying the complete datagram remainder.

QUIC does not define a version-specific packet boundary for an unknown version, so iteration stops here rather than guessing a suffix boundary. Self::as_bytes returns the complete remaining datagram for this variant.

Implementations§

Source§

impl<'a> QuicPacket<'a>

Source

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

Returns the exact complete packet bytes represented by this variant.

Source

pub const fn first_byte(self) -> u8

Returns the raw first byte.

Source

pub const fn is_long_header(self) -> bool

Returns whether this packet uses the long-header form.

Trait Implementations§

Source§

impl<'a> Clone for QuicPacket<'a>

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<'a> Copy for QuicPacket<'a>

Source§

impl<'a> Debug for QuicPacket<'a>

Source§

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

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

impl<'a> Eq for QuicPacket<'a>

Source§

impl<'a> PartialEq for QuicPacket<'a>

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<'a> StructuralPartialEq for QuicPacket<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for QuicPacket<'a>

§

impl<'a> RefUnwindSafe for QuicPacket<'a>

§

impl<'a> Send for QuicPacket<'a>

§

impl<'a> Sync for QuicPacket<'a>

§

impl<'a> Unpin for QuicPacket<'a>

§

impl<'a> UnsafeUnpin for QuicPacket<'a>

§

impl<'a> UnwindSafe for QuicPacket<'a>

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.