#[non_exhaustive]pub enum QuicVersion {
V1,
V2,
Draft(u8),
Other(u32),
}Available on crate feature
quic only.Expand description
QUIC version, decoded from the long-header version field. RFC-named versions get dedicated variants; IETF drafts and unknowns preserve the raw u32 for forensics.
Why a typed enum: routing decisions on
“is this RFC 9000 v1 traffic vs RFC 9369 v2 vs a
draft” are stronger than version == 0x00000001
magic-number checks at consumer call sites.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
V1
QUIC v1 — RFC 9000 (0x00000001).
V2
QUIC v2 — RFC 9369 (0x6b3343cf).
Draft(u8)
IETF draft version (0xff000000..=0xff00007f).
Carries the draft number (raw & 0xFF).
Other(u32)
Any other version. Raw u32 preserved.
Implementations§
Source§impl QuicVersion
impl QuicVersion
Trait Implementations§
Source§impl Clone for QuicVersion
impl Clone for QuicVersion
impl Copy for QuicVersion
Source§impl Debug for QuicVersion
impl Debug for QuicVersion
Source§impl<'de> Deserialize<'de> for QuicVersion
Available on crate feature serde only.
impl<'de> Deserialize<'de> for QuicVersion
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for QuicVersion
impl Display for QuicVersion
impl Eq for QuicVersion
Source§impl From<QuicVersion> for u32
impl From<QuicVersion> for u32
Source§fn from(value: QuicVersion) -> Self
fn from(value: QuicVersion) -> Self
Converts to this type from the input type.
Source§impl From<u32> for QuicVersion
impl From<u32> for QuicVersion
Source§impl Hash for QuicVersion
impl Hash for QuicVersion
Source§impl PartialEq for QuicVersion
impl PartialEq for QuicVersion
Source§impl Serialize for QuicVersion
Available on crate feature serde only.
impl Serialize for QuicVersion
Available on crate feature
serde only.impl StructuralPartialEq for QuicVersion
Auto Trait Implementations§
impl Freeze for QuicVersion
impl RefUnwindSafe for QuicVersion
impl Send for QuicVersion
impl Sync for QuicVersion
impl Unpin for QuicVersion
impl UnsafeUnpin for QuicVersion
impl UnwindSafe for QuicVersion
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.