pub struct SubgroupObject {
pub object_id: VarInt,
pub extension_headers: Vec<u8>,
pub status: Option<ObjectStatus>,
pub payload: Vec<u8>,
}Expand description
One object within a subgroup stream, with the Object ID already resolved from its delta encoding.
Fields§
§object_id: VarIntResolved Object ID (delta decoded to an absolute value).
extension_headers: Vec<u8>Raw extension-header bytes. Empty when the stream type has
Extensions Present = No, or when present but the length was 0.
The content is a sequence of Key-Value-Pairs but is
left opaque here — relays and subscribers that do not understand
specific extensions must forward or ignore the bytes unchanged.
status: Option<ObjectStatus>Object Status when payload.is_empty() and the object was sent
with an explicit status code; None when a non-empty payload
follows (status is implicitly ObjectStatus::Normal).
payload: Vec<u8>Object payload. Empty when status is Some(..).
Implementations§
Source§impl SubgroupObject
impl SubgroupObject
Sourcepub fn status(&self) -> ObjectStatus
pub fn status(&self) -> ObjectStatus
The status this object resolves to.
The wire carries a status field only on an empty object, so an object
holding bytes is ObjectStatus::Normal whatever status says.
Sourcepub fn permits_payload(&self) -> bool
pub fn permits_payload(&self) -> bool
Whether this object’s status permits it a non-empty payload.
Answered from the status alone. payload is not consulted: on a status
that permits a payload it says only whether this particular object took
the offer, and on one that forbids a payload a non-empty payload is the
malformation this reports, not evidence about the rule.
Trait Implementations§
Source§impl Clone for SubgroupObject
impl Clone for SubgroupObject
Source§fn clone(&self) -> SubgroupObject
fn clone(&self) -> SubgroupObject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more