pub enum DraftVersion {
Show 13 variants
Draft07,
Draft08,
Draft09,
Draft10,
Draft11,
Draft12,
Draft13,
Draft14,
Draft15,
Draft16,
Draft17,
Draft18,
Draft19,
}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.
Draft18
draft-ietf-moq-transport-18.
Draft19
draft-ietf-moq-transport-19.
Implementations§
Source§impl DraftVersion
impl DraftVersion
Sourcepub fn version_varint(&self) -> VarInt
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.
Sourcepub fn quic_alpn(&self) -> &'static [u8] ⓘ
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>), so version selection happens during the TLS
handshake rather than after it.
Sourcepub fn from_alpn(alpn: &[u8]) -> Option<DraftVersion>
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, moqt-18, moqt-19). Returns None
for moq-00 — which covers drafts 07–14 and requires inspecting
CLIENT_SETUP’s supported-versions list — and for any unrecognized
ALPN.
Sourcepub fn from_number(n: u8) -> Option<DraftVersion>
pub fn from_number(n: u8) -> Option<DraftVersion>
Resolve a draft number (e.g. 7..=18) to a DraftVersion.
Returns None for numbers outside the supported range.
Sourcepub fn uses_fixed_length_framing(&self) -> bool
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).
Sourcepub fn varint_encoding(&self) -> VarIntEncoding
pub fn varint_encoding(&self) -> VarIntEncoding
Which variable-length integer encoding this draft’s wire format uses.
Matched draft by draft rather than derived from the number. The series
has already changed encoding once mid-stream and revised it again a
draft later, so there is no rule to extrapolate from: adding a variant
to DraftVersion must fail to compile here until someone reads that
draft and says which encoding it uses.
Sourcepub fn uses_moqt_varint(&self) -> bool
pub fn uses_moqt_varint(&self) -> bool
Whether this draft uses one of MoQT’s own variable-length integers rather than RFC 9000’s.
Sourcepub fn varint_len(&self, first_byte: u8) -> usize
pub fn varint_len(&self, first_byte: u8) -> usize
The total encoded length of a variable-length integer, from its first byte, under this draft’s encoding.
Available without a buffer, because a reader needs it to know how many
bytes to wait for before it can decode at all. On draft-17 a first byte
of 11111100 reports 7 even though the draft forbids that length: the
reader waits for the whole field, then Self::decode_varint rejects
it.
Sourcepub fn decode_varint(&self, buf: &mut impl Buf) -> Result<VarInt, VarIntError>
pub fn decode_varint(&self, buf: &mut impl Buf) -> Result<VarInt, VarIntError>
Decode a variable-length integer under this draft’s encoding.
Sourcepub fn encode_varint(&self, value: VarInt, buf: &mut impl BufMut)
pub fn encode_varint(&self, value: VarInt, buf: &mut impl BufMut)
Encode a variable-length integer under this draft’s encoding.
Trait Implementations§
Source§impl Clone for DraftVersion
impl Clone for DraftVersion
Source§fn clone(&self) -> DraftVersion
fn clone(&self) -> DraftVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more