Skip to main content

Module data_dispatch

Module data_dispatch 

Source
Expand description

Draft-neutral object framing for MoQT data streams.

AnySubgroupObjectReader, AnySubgroupObjectWriter, AnyFetchObjectReader and AnyFetchObjectWriter present one API over fourteen drafts’ object encodings. The values they produce — AnySubgroupObject, AnySubgroupObjectMeta, AnyFetchObject, AnyFetchObjectMeta — are plain structs of primitives, so a caller can address objects without naming a draftNN type. All of them are also re-exported from crate::dispatch.

Objects on drafts 07-13 are standalone: absolute Object IDs, and (on drafts 11-13) an extension block whose presence is fixed by the stream type. Drafts 14-20 delta-encode Object IDs against the previous object on the stream. Both are constructed from the stream’s header and read one object at a time, so the difference stays inside this module.

Fetch streams split the same way, at a different draft. Through draft-14 a fetch object spells out its Group ID, Subgroup ID, Object ID and Publisher Priority on every object, so each one stands alone. Drafts 15-20 put a Serialization Flags field first and let it leave any of those four off the wire, meaning “the prior object’s” — and from draft-18 the two ID fields that remain are differences rather than values. So a fetch object on those drafts is only meaningful in stream order, and AnyFetchObjectReader carries the running state that resolves it. The values it produces are absolute on every draft.

§Partial buffers

Reader state after an error is unspecified. A caller that may be handed an incomplete object clones the reader, decodes against the clone, and overwrites the real reader only once the decode succeeds.

Modules§

conv 🔒
Conversions shared by the per-draft glue below. Unused when no draft feature is enabled.
fo07 🔒
fo08 🔒
fo09 🔒
fo10 🔒
fo11 🔒
fo12 🔒
fo13 🔒
fo14 🔒
fo15 🔒
fo16 🔒
fo17 🔒
fo18 🔒
fo19 🔒
fo20 🔒
sg07 🔒
sg08 🔒
sg09 🔒
sg10 🔒
sg11 🔒
sg12 🔒
sg13 🔒
sg14 🔒
sg15 🔒
sg16 🔒
sg17 🔒
sg18 🔒
sg19 🔒
sg20 🔒

Macros§

fetch_glue 🔒
Generates the conversion glue for one draft’s fetch objects.
legacy_subgroup_glue 🔒
Generates the conversion glue between one draft’s standalone ObjectHeader and the draft-neutral object types.
modern_subgroup_glue 🔒
Generates the conversion glue between one draft’s stateful SubgroupObjectReader and the draft-neutral object types.
subgroup_extensions_fn 🔒
Generates the subgroup stream-type check drafts 11-13 share: the header’s stream type must be a subgroup type, and it decides whether objects carry an extension block.

Structs§

AnyFetchFrame
One fetch frame, in the form re-encoding it takes.
AnyFetchObject
One frame read from a fetch data stream, normalised across drafts.
AnyFetchObjectMeta
The framing of one fetch frame, without its payload.
AnyFetchObjectReader
Stateful reader for the frames on a fetch data stream, for any enabled draft.
AnyFetchObjectWriter
Re-emitter for the frames of a fetch data stream, for any enabled draft.
AnySubgroupObject
One object read from a subgroup data stream, normalised across drafts.
AnySubgroupObjectMeta
The framing of one subgroup object, without its payload.
AnySubgroupObjectReader
Stateful reader for the objects on a subgroup data stream, for any enabled draft.
AnySubgroupObjectWriter
Serializer for the objects on a subgroup data stream, for any enabled draft.
Resolved 🔒
A drafts-16-to-19 fetch frame’s identity once the fields its Serialization Flags left off the wire have been filled in.

Enums§

AnyFetchEndOfRange
What an End of Range indicator asserts about the Locations it covers.
AnyFetchGroupOrder
The order a fetch response’s groups arrive in.
FetchFrameShape 🔒
Per-draft capture of the shape one fetch frame arrived in.
FetchReaderState 🔒
Per-draft fetch reader state. Fetch objects are self-describing on drafts 07-14, so those variants carry none; drafts 15-20 let an object take fields from the one before it, so each owns the running state that resolves them.
FetchReemit
What AnyFetchObjectWriter::reemit_object had to do.
FetchWriterState 🔒
Per-draft writer state, mirroring FetchReaderState.
Reemit
What reemit_subgroup_object had to do.
SubgroupReaderState 🔒
Per-draft reader state. Drafts 07-10 need none, drafts 11-13 need the stream type’s extensions-present flag, drafts 14-20 own a stateful per-draft reader that tracks the Object ID delta.
SubgroupWriterState 🔒
Per-draft writer state. Mirrors SubgroupReaderState; drafts 14-20 reuse each draft’s SubgroupObjectReader, which owns both directions of the delta state. Drafts 07-13 encode absolute IDs, so nothing on the wire forces them to increase and they carry a prev_object_id of their own — see advance_absolute_id.

Constants§

DEFAULT_PUBLISHER_PRIORITY 🔒
The Publisher Priority a fetch frame that states none is read under.

Functions§

advance_absolute_id 🔒
Enforce the strictly-increasing Object ID rule on the drafts that encode IDs absolutely.
delta_encodes_object_ids 🔒
true on the drafts whose subgroup objects encode the Object ID as id - prev - 1 rather than absolutely.
put_reframed 🔒
Write a re-encoded frame out: the new framing, then every byte that stood behind the old one.
reemit_subgroup_object
Re-emit a subgroup object whose wire bytes are already known, adjusting only this draft’s encoding of its identity.
reject_unrepresentable_extensions 🔒
A stream whose header says objects carry no extension block cannot encode one, so refuse rather than drop the bytes.
subgroup_extensions_11 🔒
subgroup_extensions_12 🔒
subgroup_extensions_13 🔒