pub enum SubgroupIdEncoding {
Zero,
SameAsPrior,
PriorPlusOne,
Present,
}Expand description
How a draft-15 fetch object carries its Subgroup ID.
The two least significant bits of the Serialization Flags are one field, not two independent flags: draft-15 Section 10.4.4, Table 7 gives all four of their values a meaning, and only one of them puts a Subgroup ID on the wire. Reading either bit on its own gets the wrong answer for half the values.
Variants§
Zero
0x00: the Subgroup ID is zero, whatever the preceding object’s was.
SameAsPrior
0x01: the Subgroup ID is the prior object’s.
PriorPlusOne
0x02: the Subgroup ID is the prior object’s plus one.
Present
0x03: the Subgroup ID follows as a varint.
Implementations§
Source§impl SubgroupIdEncoding
impl SubgroupIdEncoding
Sourcepub fn from_flags(flags: u8) -> Self
pub fn from_flags(flags: u8) -> Self
Read the two-bit field out of a Serialization Flags byte.
Sourcepub fn as_bits(self) -> u8
pub fn as_bits(self) -> u8
The bit pattern this encoding occupies in a Serialization Flags byte.
Sourcepub fn references_prior(self) -> bool
pub fn references_prior(self) -> bool
Whether resolving a Subgroup ID under this encoding needs the object before it on the stream.
SubgroupIdEncoding::Zero does not, which is what makes it the one
implicit form a stream’s first object may use.
Trait Implementations§
Source§impl Clone for SubgroupIdEncoding
impl Clone for SubgroupIdEncoding
Source§fn clone(&self) -> SubgroupIdEncoding
fn clone(&self) -> SubgroupIdEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more