Skip to main content

RangeFilterError

Enum RangeFilterError 

Source
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.

Fields

§detail: &'static str

Which field was missing, for a log that says what was short.

§

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.

Fields

§base: u64

The value the delta was counted from.

§delta: u64

The delta as it arrived.

§

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.

Sections 10.2.13 and 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

Source§

fn clone(&self) -> RangeFilterError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RangeFilterError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RangeFilterError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RangeFilterError

Source§

impl Error for RangeFilterError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for RangeFilterError

Source§

fn eq(&self, other: &RangeFilterError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RangeFilterError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.