pub enum ResponseClass {
PartialContent,
NotModified,
RangeNotSatisfiable,
AuthChallenge,
RateLimited,
StructuredError,
Redirect,
Success,
Other,
}Expand description
Discrete signal families used to gate harvest admission in Phase 2.
Always construct via ResponseClass::classify — never match on raw status codes.
Variants§
PartialContent
206 Partial Content — range request satisfied.
NotModified
304 Not Modified — conditional request matched; no body returned.
RangeNotSatisfiable
416 Range Not Satisfiable — range request out of bounds.
AuthChallenge
401 Unauthorized or 407 Proxy Authentication Required.
RateLimited
429 Too Many Requests or 503 Service Unavailable.
StructuredError
4xx with Content-Type: application/problem+json or application/json.
Redirect
3xx with a Location header present.
Success
2xx excluding 206.
Other
Anything not covered by the above variants.
Implementations§
Source§impl ResponseClass
impl ResponseClass
Sourcepub fn classify(status: StatusCode, headers: &HeaderMap) -> Self
pub fn classify(status: StatusCode, headers: &HeaderMap) -> Self
Classifies an HTTP response into one of the eight signal families.
Top-to-bottom; first match wins. Precedence: 206 before Success, 304 before Redirect,
401/429 before StructuredError.
Trait Implementations§
Source§impl Clone for ResponseClass
impl Clone for ResponseClass
Source§fn clone(&self) -> ResponseClass
fn clone(&self) -> ResponseClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResponseClass
impl Debug for ResponseClass
Source§impl PartialEq for ResponseClass
impl PartialEq for ResponseClass
Source§fn eq(&self, other: &ResponseClass) -> bool
fn eq(&self, other: &ResponseClass) -> bool
self and other values to be equal, and is used by ==.