pub struct AnyFetchObject {
pub group_id: u64,
pub subgroup_id: u64,
pub has_subgroup_id: bool,
pub object_id: u64,
pub publisher_priority: u8,
pub extension_headers: Vec<u8>,
pub extension_count: Option<u64>,
pub status: Option<u64>,
pub end_of_range: Option<AnyFetchEndOfRange>,
pub payload: Vec<u8>,
}Expand description
One frame read from a fetch data stream, normalised across drafts.
Usually an object. On drafts 16-19 it may instead be an End of Range
indicator, which carries a Location and no content — Self::end_of_range
is what tells the two apart, and it is None for every object.
Fields§
§group_id: u64Absolute Group ID. Already resolved against the objects before it on drafts 15-19, whose fetch objects may omit the field or (on drafts 18-19) encode it as a difference; copied verbatim on drafts 07-14.
subgroup_id: u64Absolute Subgroup ID, resolved as Self::group_id is. Zero and
meaningless when Self::has_subgroup_id is false.
has_subgroup_id: boolWhether this frame has a Subgroup ID at all.
true on every draft 07-15, and for every End of Range indicator’s
predecessor. false in two cases drafts 16-19 add: an object whose
Forwarding Preference is Datagram, which has no Subgroup ID anywhere in
its framing, and an End of Range indicator, whose Location is a Group
and Object ID only.
Kept beside subgroup_id rather than folded into it because a relay
that writes this object onto another stream must not invent a Subgroup
ID of zero for an object that has none: on the receiving draft zero is a
real subgroup.
object_id: u64Absolute Object ID, resolved as Self::group_id is.
publisher_priority: u8Publisher Priority in force for this frame.
Drafts 15-19 let an object omit the field and take the previous object’s, and an End of Range indicator never carries one. Where nothing on the stream has stated a priority, this is 128 — the value every draft 15-19 gives a subscription whose Default Publisher Priority property is omitted (draft-19 Section 12.4).
extension_headers: Vec<u8>Extension/property block contents, excluding its prefix. Same
convention as AnySubgroupObject::extension_headers.
extension_count: Option<u64>Number of extensions; Some only on draft-08. Same convention as
AnySubgroupObject::extension_count.
status: Option<u64>Object Status wire code, present only when the payload is empty.
Always None on drafts 16-19: those drafts removed the field from
fetch objects entirely, stating that Object Status “is only present in
objects that are delivered via a SUBSCRIPTION, and is absent in Objects
delivered via a FETCH” (draft-19 Section 11.2.1.1). A zero-length fetch
object there is an object with no bytes, not a status object.
end_of_range: Option<AnyFetchEndOfRange>Which End of Range indicator this frame is, or None for an object.
An indicator has a Location and a payload length and nothing else: its
payload, extension_headers and status are empty, its
Self::has_subgroup_id is false, and its publisher_priority is
whatever was in force rather than anything it stated.
payload: Vec<u8>Object payload. Empty when status is Some.
Trait Implementations§
Source§impl Clone for AnyFetchObject
impl Clone for AnyFetchObject
Source§fn clone(&self) -> AnyFetchObject
fn clone(&self) -> AnyFetchObject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more