pub enum SubscribeEnd {
Open,
EndOfGroup(u64),
ThroughObject {
end_group: u64,
end_object: u64,
},
}Expand description
Where a subscription’s range stops, said once in a way no draft can read two ways.
A SUBSCRIBE that names a start location may also name an end, and the
drafts spell that end three different ways. Draft-07 Section 6.4
gives the AbsoluteRange filter an End Group and an End Object, with
FETCH’s own conventions — “the end Object ID, plus 1. A value of 0 means the
entire group is requested.” Draft-08 deleted the End Object and redefined
the End Group as “the end Group ID, inclusive”, and drafts 09 through 19
kept it that way. Draft-20 Section 5.1.2 then brought an end Object back, as
the fourth field of a LOCATION_FILTER whose range is inclusive at both
ends with no plus one anywhere.
One end_object: u64 at this boundary would therefore have meant the last
Object on two drafts, the last Object plus one on one of them, and nothing
at all on the other eleven — which is FetchEnd’s problem a second time,
in a place where it is worse: there, every draft could at least carry the
field.
So SubscribeEnd::EndOfGroup is the end every draft with a range can
express, and SubscribeEnd::ThroughObject is the one only draft-07 and
drafts 20 and 21 can. The twelve drafts between them refuse it rather than
rounding it up to the whole group, because a subscription that quietly
covers more than it asked for is one whose extra objects look like a relay
ignoring the range.
Variants§
Open
No end at all — the AbsoluteStart filter. Every draft has it.
On draft-20 alone this is not expressible from the start location
{0, 0}; see SubscribeRange::location_filter_draft20 for the collision and
for the two ways round it.
EndOfGroup(u64)
Through the whole of this Group, however many Objects it turns out to hold. The Group is absolute on every draft, including the ones that put a delta on the wire.
ThroughObject
Through this Object of this Group, inclusive — it is the last Object the subscription covers, and the range holds it.
Expressible on draft-07 and draft-20 and on nothing between them. See
SubscribeEnd for why those two and not the twelve in the middle, and
SubscribeRange::inline_end_location for the plus one draft-07 needs
and draft-20 must not have.