pub enum FetchEnd {
Object(u64),
EntireGroup,
}Expand description
Where a FETCH’s range ends, said once in a way no draft can read two ways.
The drafts do not agree about what a number in an “end object” field means,
and the disagreement is silent: draft-19 Section 10.13 defines End Location as “the last Object, plus 1; or 0 to indicate the entire Group”,
while draft-20 Sections 5.1.2 and 10.13 make the LOCATION_FILTER range
“inclusive” at both ends and delete both conventions without a note in the
change log. The same end_object = 10 therefore asks for objects 0 through
9 on one draft and 0 through 10 on the other, and nothing on the wire says
which was meant.
So this enum, not a number. FetchEnd::Object is the last Object the
fetch covers and the range holds it; FetchEnd::EntireGroup is
draft-19’s 0 spelled out. AnyConnection::fetch converts to whichever
the negotiated draft writes.
Variants§
Object(u64)
Through this Object ID, inclusive — it is the last Object the fetch covers, and the range holds it.
Object(0) is a range ending at Object 0, one object long if it also
starts there. It is not “the whole group”; that is
FetchEnd::EntireGroup.
EntireGroup
Through the last Object of the end Group, however many it turns out to hold.
Drafts 14-19 write this as End Location.Object = 0. Draft-20 writes it
as a three-field LOCATION_FILTER, which Section 5.1.2 defines as
covering all Objects in the end Group.