Skip to main content

Module data_stream

Module data_stream 

Source
Expand description

Draft-17 data stream header encoding and decoding.

Subgroup header type byte: 0b00X1XXXX (bit 4 always set)

  • bit 0 (0x01): PROPERTIES
  • bits 1-2 (0x06): SUBGROUP_ID_MODE (0=zero, 1=first_obj, 2=explicit, 3=reserved)
  • bit 3 (0x08): END_OF_GROUP
  • bit 5 (0x20): DEFAULT_PRIORITY (no priority byte)

Datagram type byte: 0b00X0XXXX (bit 4 always 0)

  • bit 0 (0x01): PROPERTIES
  • bit 1 (0x02): END_OF_GROUP
  • bit 2 (0x04): ZERO_OBJECT_ID (object_id=0, field omitted)
  • bit 3 (0x08): DEFAULT_PRIORITY (no priority byte)
  • bit 5 (0x20): STATUS (status byte replaces payload)

Neither range is fully populated. Draft-17 Sections 10.4.2 and 10.3.1 each close with a list of type values an endpoint “MUST close the session with a PROTOCOL_VIOLATION” on receiving, and the two figures spell the surviving values out: 0x10..0x15 / 0x18..0x1D / 0x30..0x35 / 0x38..0x3D for a subgroup header, 0x00..0x0F / 0x20..0x21 / 0x24..0x25 / 0x28..0x29 / 0x2C..0x2D for a datagram. Both decoders refuse everything else, so a header this module hands back always describes a framing the draft defines.

Fetch header: stream type 0x05 + request_id, followed by objects whose fields are named by a Serialization Flags varint rather than all being present — see FetchObjectHeader.

Structs§

DatagramHeader
FetchHeader
FetchObject
One frame from a FETCH stream with the fields its Serialization Flags left off the wire filled in from the frames before it.
FetchObjectHeader
One object on a draft-17 fetch stream, without its payload.
FetchObjectReader
Resolves the elided fields of the frames on one FETCH stream.
FetchObjectWriter
Re-encodes resolved fetch frames onto one FETCH stream.
SubgroupHeader
SubgroupObject
One object within a draft-17 subgroup stream. Object IDs are delta-encoded and the presence of a “properties” block (the draft-17 equivalent of extension headers) is determined by the PROPERTIES bit on the enclosing SubgroupHeader. Use SubgroupObjectReader to encode/decode.
SubgroupObjectMeta
The framing of one draft-17 subgroup object, without its payload.
SubgroupObjectReader

Enums§

EndOfRange
The two Serialization Flags values that mark a range of Objects rather than carrying one, from draft-17 Section 10.4.4 Table 6 and Section 10.4.4.2.
PayloadPermission
Whether an object carrying a given status is allowed a non-empty payload.