Skip to main content

AnyDatagramMeta

Struct AnyDatagramMeta 

Source
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: u64

Track alias identifying the subscription this datagram answers.

§group_id: u64

Group ID.

§object_id: u64

Object 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

Source§

fn clone(&self) -> AnyDatagramMeta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AnyDatagramMeta

Source§

impl Debug for AnyDatagramMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AnyDatagramMeta

Source§

impl PartialEq for AnyDatagramMeta

Source§

fn eq(&self, other: &AnyDatagramMeta) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AnyDatagramMeta

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.