pub struct AnyFetchObject {
pub group_id: u64,
pub subgroup_id: Option<u64>,
pub object_id: u64,
pub payload: Vec<u8>,
pub status: Option<u64>,
pub end_of_range: Option<u64>,
}Expand description
One object on a fetch stream, in the terms every draft shares.
AnyObject’s twin, and it needs three fields that one does not, because a
fetch stream is not a subgroup stream with a different header on it. A
subgroup stream’s header names the Group and the Subgroup once and every
object on it belongs to them; a fetch stream carries a whole range, so each
object states its own Location — and from draft-15 it states it by
inheritance, leaving fields off the wire that the object before it
supplies. Every value here is resolved: what a caller gets is where the
object is, never what the wire happened to write down.
Fields§
§group_id: u64The Group this object belongs to, resolved.
subgroup_id: Option<u64>The Subgroup, resolved, and None where the draft lets an object on a
fetch stream have none.
Drafts 07 through 15 always carry it. From draft-16 an object whose Forwarding Preference is Datagram omits it — draft-16 Section 10.2.1 — and so does an end-of-range marker, which is a span rather than an object.
object_id: u64The Object ID, resolved. Drafts 15 and later may encode it as a step from the object before it on the stream, and the reader has undone that.
payload: Vec<u8>The payload. Empty when status is Some, and empty on every
end-of-range marker.
status: Option<u64>The Object Status wire code, on the same terms as AnyObject::status:
Some exactly when the object carried no payload, because the two
occupy the same position on the wire.
Always None from draft-16 on, and that is the drafts talking
rather than this type giving up: draft-16 deleted the Object Status
field from a fetch object and put Self::end_of_range in its place.
The pair covers one question between them — is this an object, or a
statement about objects that are not here — and which of the two answers
it depends on the draft.
end_of_range: Option<u64>The end-of-range marker’s own wire code, where this “object” is one.
Drafts 16 through 20 end a fetch that cannot serve part of its range
with a marker rather than with silence, and the marker covers the whole
span from the last serialized object to this Location inclusive:
0x8C for a span known not to exist, 0x10C for one whose status is
unknown, and draft-20 adds 0x20C for one the publisher abandoned.
A number rather than an enum for the reason crate::dispatch’s
neighbours are: the code is the fingerprint, and a fifteenth draft
assigning a fourth marker should widen a report rather than fail to
parse. None on drafts 07 through 15, which have no such marker — there
the same news arrives, when it arrives at all, as a Self::status.