Skip to main content

Module data_stream

Module data_stream 

Source
Expand description

Draft-11 data stream header encoding and decoding.

Changes from draft-09/10:

  • Datagram stream type IDs: 0x00 (no ext), 0x01 (with ext), 0x02 (status, no ext), 0x03 (status, with ext)
  • Subgroup stream types: 0x08-0x0D (6 variants based on subgroup_id encoding and extensions)
  • Fetch stream type: 0x05 (request_id only in header)
  • Object within subgroup: object_id + [ext_headers_length + extensions] + payload_length
    • [object_status if payload_length=0]

Re-exportsยง

use super::types::ObjectStatus; ๐Ÿ”’
use crate::error::CodecError; ๐Ÿ”’
use crate::object_properties::parse_object_properties; ๐Ÿ”’
use crate::object_properties::ObjectProperty; ๐Ÿ”’
use crate::object_properties::PropertyValue; ๐Ÿ”’
use crate::types::read_bytes; ๐Ÿ”’
use crate::varint::VarInt; ๐Ÿ”’
use crate::version::DraftVersion; ๐Ÿ”’
use bytes::Buf; ๐Ÿ”’
use bytes::BufMut; ๐Ÿ”’

Structsยง

DatagramHeader
Datagram header (draft-11, types 0x00/0x01).
DatagramStatusHeader
Datagram status header (draft-11, types 0x02/0x03).
FetchGaps
The Prior Group ID Gap conditions of draft-11 Section 10.1 that one fetch stream shows.
FetchHeader
Fetch stream header (draft-11, type 0x05).
FetchObjectHeader
Object within a fetch stream (draft-11).
ObjectHeader
Object within a subgroup stream (draft-11).
PriorGaps
The Prior Group ID Gap values one Object carries.
SubgroupGaps
The Prior Group ID Gap values the Objects of one subgroup stream carried.
SubgroupHeader
Subgroup stream header (unified across all 6 stream type variants).

Enumsยง

Datagram
One datagram, of whichever shape its type field names.
StreamType
Stream type IDs for draft-11 data streams.

Constantsยง

PRIOR_GROUP_ID_GAP
Prior Group ID Gap, Extension Header Type 0x40 (draft-11 Section 10.1).

Functionsยง

check_extensions_against_status ๐Ÿ”’
Hold an object to the rule that a non-existent object carries no extensions.
datagram_type_error ๐Ÿ”’
Which failure a leading datagram type that is not one a reader wants is.
read_extension_bytes ๐Ÿ”’
stream_type_error ๐Ÿ”’
Which failure a leading unidirectional stream type that is not the one a reader wants is.