Expand description
Location filters and fill fetch streams, the two things draft-20 asks a subscriber to build that no earlier draft has.
Draft-20 moved the range of a FETCH out of the message and into the
LOCATION_FILTER message parameter (Section 5.1.2), and added
FILL_PARAMETERS (Section 10.2.15) — a parameter whose presence on a
SUBSCRIBE or a REQUEST_UPDATE asks the publisher to open a fill fetch
stream, and whose value is a nested parameter block that overrides the
subscription’s own settings for that fill alone.
Both are parameter values a caller has to construct byte by byte, which is why they are here rather than left to the caller: the two encodings are the places draft-20 is least explicit, and getting either wrong desynchronises the whole parameter list rather than producing a recognisable error.
§What this module decides, and where the draft is silent
- A
LOCATION_FILTER’s shape comes from how manyvi64fields its value holds, not from the byte length. SeeLocationFilter. - A
FILL_PARAMETERSvalue begins with aNumber of Parameterscount, and itsType Deltachain restarts at 0. SeeFillParameters. - A fill fetch stream with no
GROUP_ORDERanywhere is read Ascending. Seegroup_order.
Every value this module builds is handed to the codec’s own decoder before it is returned, so a disagreement between the two is an error here rather than a frame on the wire.
§Ranges are inclusive
Draft-19’s fetch end was “the last Object, plus 1; or 0 to indicate the entire Group”. Draft-20 Sections 5.1.2 and 10.13 both say the Location filter “specifies an inclusive range of Locations”, and both draft-19 conventions are gone. Nothing in this module adds or subtracts one from an end location, and a caller porting draft-19 arithmetic forward fetches one object too many.
Structs§
- Fill
Parameters - A draft-20
FILL_PARAMETERS(Parameter Type 0x23), Section 10.2.15. - Location
Filter - A draft-20
LOCATION_FILTER(Parameter Type 0x21), Section 5.1.2.
Enums§
- Fill
Error - Errors from building a
LOCATION_FILTERor aFILL_PARAMETERSvalue.
Constants§
- FILL_
PARAMETERS_ 🔒ALLOWED - The parameter types draft-20 Section 10.2.15, Table 6 permits inside a
FILL_PARAMETERSvalue, in ascending order. - GROUP_
ORDER GROUP_ORDER, Parameter Type 0x22 (Section 10.2.8).- GROUP_
ORDER_ 🔒ASCENDING - The
GROUP_ORDERvalue Section 10.2.8 assigns to Ascending. - GROUP_
ORDER_ 🔒DESCENDING - The
GROUP_ORDERvalue Section 10.2.8 assigns to Descending.
Functions§
- check_
end_ 🔒group - encode_
group_ 🔒order - The Section 10.2.8 value for a Group Order.
- encode_
nested_ 🔒value - Write one nested parameter’s value in the shape its type names.
- group_
order - The Group Order a fill fetch stream’s Objects arrive in, given the parameters of the SUBSCRIBE (or REQUEST_UPDATE) that asked for the fill.
- insert_
parameter - Put
parameterintoparametersat the position ascending type order requires. - is_
length_ 🔒prefixed - Whether a Table 6 parameter’s value carries its own length prefix.
- is_
uint8 🔒 - Whether a Table 6 parameter’s value is a single raw byte rather than a varint or a length-prefixed block.
- may_
repeat 🔒 - The five Range Filters, of which four may be nested. Only these may repeat.
- read_
group_ 🔒order - The
GROUP_ORDERin one parameter list, orNoneif it holds none.