pub enum FailureKind {
Fetch,
Status,
Body,
Parse,
}Expand description
Why a poll failed, as a closed set.
Closed on purpose: the point is to count failures by cause, and a free-text kind cannot be counted. The detail string carries whatever else matters.
Variants§
Fetch
The request never produced a response — DNS, TLS, timeout, connection refused, or a refusal by the SSRF guard.
Status
A response arrived with a non-success status.
Body
The body was too large, or reading it failed part-way.
Parse
The body arrived and is not a feed this parser can read.
Implementations§
Source§impl FailureKind
impl FailureKind
Sourcepub const ALL: [Self; 4]
pub const ALL: [Self; 4]
Every variant, so a test can assert over the whole set rather than a list that drifts when a variant is added.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The stable string stored in feeds.last_error_kind and aggregated on
/stats. Changing one of these silently rewrites history in the
aggregate, so they are spelled out rather than derived from the variant.
Sourcepub fn parse(raw: &str) -> Option<Self>
pub fn parse(raw: &str) -> Option<Self>
Read back a persisted last_error_kind. None for anything this
version does not know, so a row written by a newer build is not
silently attributed to a cause this one recognises — the same contract
crate::metrics::Backend::parse keeps for the same reason.
Trait Implementations§
Source§impl Clone for FailureKind
impl Clone for FailureKind
Source§fn clone(&self) -> FailureKind
fn clone(&self) -> FailureKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FailureKind
Source§impl Debug for FailureKind
impl Debug for FailureKind
impl Eq for FailureKind
Source§impl PartialEq for FailureKind
impl PartialEq for FailureKind
impl StructuralPartialEq for FailureKind
Auto Trait Implementations§
impl Freeze for FailureKind
impl RefUnwindSafe for FailureKind
impl Send for FailureKind
impl Sync for FailureKind
impl Unpin for FailureKind
impl UnsafeUnpin for FailureKind
impl UnwindSafe for FailureKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more