pub struct TrackNamespaceRules {
pub min_fields: usize,
pub reject_empty_field: bool,
pub max_namespace_bytes: Option<usize>,
}Expand description
What a MoQ Transport draft states about a Track Namespace in Section 2.4.1 “Track Naming”.
The rules arrive at different drafts and one of them is later withdrawn, so any single rule applied to all thirteen drafts is wrong somewhere:
-
At most 32 Track Namespace Fields. Stated by every draft from 07 on, and the only field-count rule drafts 17 and later state at all. It has never moved, so it is not carried here;
MAX_NAMESPACE_TUPLE_SIZEholds it and every reader applies it. -
At least one Track Namespace Field. Drafts 07 through 16 define a Track Namespace as “between 1 and 32”, and drafts 08 through 16 add “If an endpoint receives a Track Namespace tuple with an N of 0 or more than 32, it MUST close the session with a Protocol Violation” (draft-15 and later word it as “consisting of 0 or greater than 32 Track Namespace Fields”). Draft-17 redefines the type as “between 0 and 32” and drops that half of the sentence.
An individual message may lower the minimum below what Section 2.4.1 says. Draft-16 is the first to describe the SUBSCRIBE_NAMESPACE Track Namespace Prefix as “a Track Namespace structure as described in Section 2.4.1 with between 0 and 32 Track Namespace Fields”, and it drops the sentence that drafts 08 through 15 carry about a prefix of 0 fields closing the session.
min_fieldsis therefore a value a call site can lower, not a function of the draft alone. -
Each field at least one byte. Draft-16 is the first to say “Each Track Namespace Field Value MUST contain at least one byte. If an endpoint receives a Track Namespace Field with a Track Namespace Field Length of 0, it MUST close the session with a PROTOCOL_VIOLATION.” Drafts 07 through 15 say nothing about it, and refusing an empty field there would reject traffic those drafts permit.
-
A Track Namespace of at most 4,096 bytes. Draft-16 is the first to say “The length of a Track Namespace is the sum of the Track Namespace Field Length fields… If an endpoint receives a Track Namespace or a Full Track Name exceeding 4,096 bytes, it MUST close the session with a PROTOCOL_VIOLATION.” Drafts 11 through 15 cap only the Full Track Name, so on those a namespace is bounded only through the Track Name beside it and this reader cannot settle it alone. Drafts 07 through 10 state no cap.
Fields§
§min_fields: usizeFewest Track Namespace Fields this position accepts.
reject_empty_field: boolWhether a Track Namespace Field Length of 0 must be refused.
max_namespace_bytes: Option<usize>Cap on the sum of the Track Namespace Field Length fields, for the drafts that bound a Track Namespace on its own.
None where the draft bounds only the Full Track Name, which no reader
of the namespace alone can settle: the Track Name arrives beside it in
the message, and the two lengths are summed there.
Implementations§
Source§impl TrackNamespaceRules
impl TrackNamespaceRules
Sourcepub const fn for_draft(draft: u8) -> Self
pub const fn for_draft(draft: u8) -> Self
The rules MoQ Transport draft draft states for a Track Namespace.
draft is the draft number, 7 through 19. A larger number is answered
with the newest rules, which have not moved since draft-17.
This is the Section 2.4.1 answer, which is what a position accepts unless
the message that carries it says otherwise. A message that is looser
about the count — draft-16’s SUBSCRIBE_NAMESPACE prefix is — overrides
min_fields on the value returned here, so that the
content rules it does not restate still come from its own draft.
Trait Implementations§
Source§impl Clone for TrackNamespaceRules
impl Clone for TrackNamespaceRules
Source§fn clone(&self) -> TrackNamespaceRules
fn clone(&self) -> TrackNamespaceRules
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more