Expand description
Draft-15 data stream header encoding and decoding.
Draft-15 data streams differ significantly from draft-14:
- Subgroup stream types encode flags in the type byte. Section 10.4.2
Table 6 assigns twenty-four:
0x10-0x15,0x18-0x1D,0x30-0x35and0x38-0x3D. - Priority is absent when
type & 0x20, and the object then inherits the priority the subscription established type & 0x06decides how the Subgroup ID is carried: it is zero, it is the first objectโs ID, or it is a field on the wire. Table 6 states that as two columns โ Subgroup ID Field Present, and Subgroup ID Value โ not as a mode field, and the fourth combination is simply not a row in ittype & 0x08marks a stream whose last object ends its group- Extensions flag (
type & 0x01) affects per-object parsing - Fetch objects use serialization_flags for delta encoding
- Object IDs in subgroups use delta encoding (first=absolute, subsequent=delta+1)
Re-exportsยง
use super::types::ObjectStatus;๐use crate::error::CodecError;๐use crate::object_properties::ObjectProperty;๐use crate::object_properties::PropertyValue;๐use crate::varint::VarInt;๐use bytes::Buf;๐use bytes::BufMut;๐
Structsยง
- Datagram
Header - Datagram header for draft-15.
- Fetch
Gaps - The Prior Group ID Gap and Prior Object ID Gap conditions of draft-15 Section 11.1 and draft-15 Section 11.2 that one fetch stream shows.
- Fetch
Header - Fetch stream header for draft-15.
- Fetch
Object Header - One object on a draft-15 fetch stream, without its payload.
- Fetch
Object Reader - Stateful reader/writer for the objects on one draft-15 fetch stream.
- Fetch
Object Writer - Re-encodes resolved fetch Objects onto one FETCH stream.
- Prior
Fetch ๐Object - The fields a draft-15 fetch object leaves to its successor to inherit.
- Prior
Gaps - The Prior Group ID Gap and Prior Object ID Gap one Object carries.
- Subgroup
Header - Subgroup stream header for draft-15.
- Subgroup
Object - One object within a draft-15 subgroup stream with its Object ID already resolved from the delta encoding.
- Subgroup
Object Meta - The framing of one draft-15 subgroup object, without its payload.
- Subgroup
Object Reader - Stateful reader/writer for draft-15 subgroup objects.
Enumsยง
- Payload
Permission - Whether an object carrying a given status may hold a non-empty payload.
- Subgroup
IdEncoding - How a draft-15 fetch object carries its Subgroup ID.
Constantsยง
- FETCH_
STREAM_ ๐TYPE - The unidirectional stream type draft-15 Section 10.4.4 gives a fetch stream.
- PRIOR_
GROUP_ ID_ GAP - Prior Group ID Gap, Extension Header Type 0x3C (Section 11.1).
- PRIOR_
OBJECT_ ID_ GAP - Prior Object ID Gap, Extension Header Type 0x3E (Section 11.2).
Functionsยง
- check_
extensions_ ๐against_ status_ on_ encode - Refuse an object that would be written with extension headers beside a status other than Normal.
- collect_
gaps ๐ - datagram_
type_ ๐is_ assigned - Whether draft-15 Section 10.3.1 Table 5 assigns this datagram type.
- decoded_
status ๐ - Turn a wire Object Status code into the status draft-15 gives it, refusing any code the draft does not assign.
- skip ๐
- Advance
bufpastlenbytes without copying them. - stream_
type_ ๐error - Which failure a leading unidirectional stream type that is not the one a reader wants is.
- subgroup_
type_ ๐is_ assigned - Whether draft-15 Section 10.4.2 Table 6 assigns this subgroup stream type.