Skip to main content

DraftVersion

Enum DraftVersion 

Source
pub enum DraftVersion {
    Draft07,
    Draft08,
    Draft09,
    Draft10,
    Draft11,
    Draft12,
    Draft13,
    Draft14,
    Draft15,
    Draft16,
    Draft17,
}
Expand description

MoQT draft version for runtime codec selection.

Variants§

§

Draft07

draft-ietf-moq-transport-07.

§

Draft08

draft-ietf-moq-transport-08.

§

Draft09

draft-ietf-moq-transport-09.

§

Draft10

draft-ietf-moq-transport-10.

§

Draft11

draft-ietf-moq-transport-11.

§

Draft12

draft-ietf-moq-transport-12.

§

Draft13

draft-ietf-moq-transport-13.

§

Draft14

draft-ietf-moq-transport-14.

§

Draft15

draft-ietf-moq-transport-15.

§

Draft16

draft-ietf-moq-transport-16.

§

Draft17

draft-ietf-moq-transport-17.

Implementations§

Source§

impl DraftVersion

Source

pub fn version_varint(&self) -> VarInt

The MoQT version number announced in CLIENT_SETUP.

Format: 0xff000000 + draft_number. Draft-15+ use ALPN for version negotiation and may not include a version in CLIENT_SETUP at all.

Source

pub fn quic_alpn(&self) -> &'static [u8]

The ALPN protocol identifier for raw QUIC connections.

Drafts 07–14 all use moq-00 and negotiate the draft version in CLIENT_SETUP / SERVER_SETUP. Draft-15+ encode the draft number in the ALPN itself (moqt-<N>), per §3.1.2 of each spec.

Source

pub fn from_alpn(alpn: &[u8]) -> Option<DraftVersion>

Resolve an ALPN identifier to a specific draft version.

Returns Some for ALPNs that unambiguously identify a draft (moqt-15, moqt-16, moqt-17). Returns None for moq-00 — which covers drafts 07–14 and requires inspecting CLIENT_SETUP’s supported-versions list — and for any unrecognized ALPN.

Source

pub fn from_number(n: u8) -> Option<DraftVersion>

Resolve a draft number (e.g. 7..=17) to a DraftVersion.

Returns None for numbers outside the supported range.

Source

pub fn uses_fixed_length_framing(&self) -> bool

Whether this draft uses a 16-bit big-endian message length in control message framing (true) or a QUIC varint (false).

Draft-11 changed the framing from Length(i) to Length(16).

Source

pub fn number(&self) -> u8

The draft number (e.g. 7, 14, 17).

Trait Implementations§

Source§

impl Clone for DraftVersion

Source§

fn clone(&self) -> DraftVersion

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DraftVersion

Source§

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

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

impl Display for DraftVersion

Source§

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

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

impl Hash for DraftVersion

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DraftVersion

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Copy for DraftVersion

Source§

impl Eq for DraftVersion

Source§

impl StructuralPartialEq for DraftVersion

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.