pub enum RangeFilterError {
NotARangeFilter(u64),
Malformed {
detail: &'static str,
},
DeltaOverflow {
base: u64,
delta: u64,
},
PriorityAboveTheField(u64),
PropertyTypeIsNotAnInteger(u64),
}Expand description
A Range Filter value this codec could not turn into ranges.
Kept out of CodecError on purpose, and the
absence of a From impl is the mechanism: draft-19 answers every one of
these with a REQUEST_ERROR carrying INVALID_FILTER, which is a message the
endpoint sends after decoding the request, so none of them may become a
decoder refusal. See this module’s header.
Variants§
NotARangeFilter(u64)
A parameter type outside 0x25 through 0x29 was handed to the reader.
Malformed
The value ran out before a field the shape requires.
DeltaOverflow
A delta resolved past the end of the 64-bit space.
“Any delta encoding that results in a value that exceeds 2^64-1 MUST be rejected with REQUEST_ERROR with error code INVALID_FILTER.” The sum is checked rather than allowed to wrap: a wrapped Start is a small number, and a filter that reads as 0-5 when its sender wrote something above the end of the space passes Objects it was written to exclude.
PriorityAboveTheField(u64)
A PRIORITY_FILTER range names a value the field cannot hold.
Section 10.2.12: “If a decoded value exceeds 255, the endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER since Publisher Priority is an 8-bit field.”
“A decoded value”, so the resolved Start or End rather than the delta that spelled it — a filter of 200 to 300 has both deltas well inside the byte and one endpoint outside it.
PropertyTypeIsNotAnInteger(u64)
A property filter names a Property Type that is not an integer-valued one.
Draft-19 Section 10.2.13 and draft-19 Section 10.2.14 say the same of both: the filter selects a range “for a required Object Property Type which MUST be even, i.e. a single integer value (see Figure 2), otherwise the endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER”.
The parity is the Key-Value-Pair convention doing the work: an even Type carries a bare varint and an odd one carries length-prefixed bytes, so an odd Property Type is a property whose value is not a number and a range over it has nothing to compare.
Trait Implementations§
Source§impl Clone for RangeFilterError
impl Clone for RangeFilterError
Source§impl Debug for RangeFilterError
impl Debug for RangeFilterError
Source§impl Display for RangeFilterError
impl Display for RangeFilterError
impl Eq for RangeFilterError
Source§impl Error for RangeFilterError
impl Error for RangeFilterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()