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
ObjectHeaderand the draft-neutral object types. - modern_
subgroup_ 🔒glue - Generates the conversion glue between one draft’s stateful
SubgroupObjectReaderand 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§
- AnyFetch
Frame - One fetch frame, in the form re-encoding it takes.
- AnyFetch
Object - One frame read from a fetch data stream, normalised across drafts.
- AnyFetch
Object Meta - The framing of one fetch frame, without its payload.
- AnyFetch
Object Reader - Stateful reader for the frames on a fetch data stream, for any enabled draft.
- AnyFetch
Object Writer - Re-emitter for the frames of a fetch data stream, for any enabled draft.
- AnySubgroup
Object - One object read from a subgroup data stream, normalised across drafts.
- AnySubgroup
Object Meta - The framing of one subgroup object, without its payload.
- AnySubgroup
Object Reader - Stateful reader for the objects on a subgroup data stream, for any enabled draft.
- AnySubgroup
Object Writer - 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§
- AnyFetch
EndOf Range - What an End of Range indicator asserts about the Locations it covers.
- AnyFetch
Group Order - The order a fetch response’s groups arrive in.
- Fetch
Frame 🔒Shape - Per-draft capture of the shape one fetch frame arrived in.
- Fetch
Reader 🔒State - 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.
- Fetch
Reemit - What
AnyFetchObjectWriter::reemit_objecthad to do. - Fetch
Writer 🔒State - Per-draft writer state, mirroring
FetchReaderState. - Reemit
- What
reemit_subgroup_objecthad to do. - Subgroup
Reader 🔒State - 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.
- Subgroup
Writer 🔒State - Per-draft writer state. Mirrors
SubgroupReaderState; drafts 14-20 reuse each draft’sSubgroupObjectReader, 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 aprev_object_idof their own — seeadvance_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 trueon the drafts whose subgroup objects encode the Object ID asid - prev - 1rather 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