Skip to main content

check_location_range

Function check_location_range 

Source
pub fn check_location_range(
    start_group: u64,
    start_object: u64,
    end_group: u64,
    end_object: u64,
) -> Result<(), CodecError>
Expand description

Refuse a range whose end is earlier than its start, where the End Group is the last Group ID and the End Object is the last Object ID plus one.

This is the shape FETCH carries on every draft: the End Group field is “the end Group ID” and the End Object field is “The end Object ID, plus 1. A value of 0 means the entire group is requested.” A zero End Object therefore places no upper bound inside the end group and cannot make the range empty, so it is exempt.

Draft-07 Section 6.4 gives the SUBSCRIBE AbsoluteRange filter the same two fields with the same conventions, and states the rule in the same words, so that filter is checked here too.

§Errors

crate::error::CodecError::InvalidRange if the end is earlier than the start, reporting both ends as they appear on the wire.