pub struct AnyDatagramMeta {
pub track_alias: u64,
pub group_id: u64,
pub object_id: u64,
pub publisher_priority: Option<u8>,
pub status: Option<u64>,
}Expand description
One datagram’s identity, resolved, without its payload.
The five fields a caller keys on, taken off whichever of the thirteen
per-draft datagram shapes this value holds. Produced by
AnyDatagramHeader::meta, and the reason it exists is that the shapes
disagree about far more than their field order: drafts 07 through 13 split
a payload datagram and a status datagram into two structs, draft-14 merges
them behind an optional status, and drafts 15 through 19 hang both the
status and the priority off bits in a type byte.
Every field is a primitive, so keying on a datagram never means naming a
per-draft codec type — the same contract
AnySubgroupObjectMeta holds for a subgroup object.
Fields§
§track_alias: u64Track alias identifying the subscription this datagram answers.
group_id: u64Group ID.
object_id: u64Object ID.
Always a value, on every draft, including the six whose type byte can
leave the field off the wire. Drafts 14 through 19 give the omission a
meaning rather than making the field absent — draft-16 Section 10.3.1:
“The ZERO_OBJECT_ID bit (0x04) indicates when the Object ID field is
present. When set to 1, the Object ID field is omitted and the Object
ID is 0.” So the zero behind an omitted field is the Object’s ID and
not a placeholder standing in for one, which is the opposite of what a
fetch object’s absent Subgroup ID means and is why this field is not an
Option.
publisher_priority: Option<u8>Publisher priority, or None where the datagram states none.
Absent only on drafts 15 through 19, whose type byte carries a default-priority bit; an Object that leaves it clear takes the priority the control message that established the subscription specified, which is not on this datagram and not knowable from it. Drafts 07 through 14 always carry the field.
status: Option<u64>The Object Status this datagram states, or None when it carries a
payload instead.
The framing decides which, and each cohort frames it differently: a declared payload length of zero on drafts 07 and 08, a separate status datagram on 08 through 13, an optional field on 14, and a status bit in the type byte from 15 on. Draft-08 appears in that list twice because it states a status both ways — it kept draft-07’s optional status field under a zero payload length and added OBJECT_DATAGRAM_STATUS beside it, and draft-09 is where the first of the two goes away. The code is always one the draft assigns, because every draft’s decoder refuses the values it does not.
Trait Implementations§
Source§impl Clone for AnyDatagramMeta
impl Clone for AnyDatagramMeta
Source§fn clone(&self) -> AnyDatagramMeta
fn clone(&self) -> AnyDatagramMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more