pub enum FilterRejection {
NoBudgetAdvertised,
TooManyRanges {
ranges: usize,
limit: u64,
},
RepeatedFilter(u64, u8, Option<u64>),
Unreadable(RangeFilterError),
RelativeFetchLocation,
}Expand description
Why a peer’s request must be answered with REQUEST_ERROR.
Draft-23 gives the Range Filters four rules and answers every one of them
the same way (Section 3.3.2: “MUST reject this with REQUEST_ERROR with error
code INVALID_FILTER”), and gives a FETCH’s relative Location filter
INVALID_RANGE (Section 3.2). FilterRejection::request_error_code is the
code.
None of these is a session close, which is the whole reason the type exists. A rejection is a reply, and a reply names the Request ID of the request it answers, so the endpoint has to have taken the request in order to refuse it. The rejection is recorded against that id and spent by the REQUEST_ERROR that answers it.
Variants§
NoBudgetAdvertised
The peer sent a Range Filter and this endpoint advertised no budget.
Section 9.1.6: “The default value is 0, so if not specified, the peer MUST NOT send any such filter parameters.” Zero is the default and it means none allowed — the opposite of what zero means in the option beside it, MAX_REQUEST_UPDATES, where it means no limit. The two sit in consecutive subsections and read opposite ways.
TooManyRanges
More Ranges than MAX_FILTER_RANGES allows, counted across every filter.
RepeatedFilter(u64, u8, Option<u64>)
Two filters with the same Parameter Type, SetID and Property Type.
Repeats of a type are otherwise expected, so the key is the whole triple: “The Track Property filter parameter MAY appear multiple times in a SUBSCRIBE_TRACKS message”
Unreadable(RangeFilterError)
A filter this codec could not read, or one that broke a rule of its own.
RelativeFetchLocation
A FETCH whose Location filter is relative.
Draft-23 Section 3.2: “If the Location filter is relative (see Section 9.19.9), the publisher MUST return REQUEST_ERROR with error code INVALID_RANGE.” Table 6 calls one type relative, 0x01 (Relative Start).
Implementations§
Source§impl FilterRejection
impl FilterRejection
Sourcepub fn request_error_code(&self) -> RequestErrorCode
pub fn request_error_code(&self) -> RequestErrorCode
The REQUEST_ERROR code this rejection is answered with.
Trait Implementations§
Source§impl Clone for FilterRejection
impl Clone for FilterRejection
Source§impl Debug for FilterRejection
impl Debug for FilterRejection
Source§impl Display for FilterRejection
impl Display for FilterRejection
impl Eq for FilterRejection
Source§impl Error for FilterRejection
impl Error for FilterRejection
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()