pub enum OriginPullError {
Transient(Error),
Permanent(Error),
}Expand description
Outcome of a single crate::origin::Origin::fetch call, classified by
whether a retry is appropriate. The cache engine’s retry loop drives off
this distinction — Transient failures are retried up to
crate::RetryPolicy::max_retries, Permanent failures surface to the
caller immediately.
Both variants carry an anyhow::Error so adapters keep their
with_context chains intact. The retry loop, the circuit breaker and the
presence probe read the classification. A caller that surfaces the failure
drops it with Self::into_inner and returns the cause as
CacheError::OriginError.
Variants§
Transient(Error)
A retry-eligible failure: HTTP 5xx/408/429, connect/headers/chunk
timeouts, transport-level connection resets, or transient I/O on the
filesystem origin (Interrupted, TimedOut, ResourceBusy, WouldBlock).
Permanent(Error)
A failure that won’t be cured by retrying: HTTP 4xx (other than 404,
which maps to crate::origin::OriginFetch::NotFound),
encoding/decompression problems, size-cap breaches, symlink-escape
or permission-denied on the filesystem origin.
Implementations§
Source§impl OriginPullError
impl OriginPullError
Sourcepub const fn is_transient(&self) -> bool
pub const fn is_transient(&self) -> bool
True when the variant is Transient — the retry loop tests this in
the hot path; keep it const so it inlines cleanly.
Sourcepub fn into_inner(self) -> Error
pub fn into_inner(self) -> Error
Unwrap the underlying anyhow::Error, discarding the
transient/permanent classification. Used by the cache engine when
collapsing into CacheError::OriginError after retries are
exhausted (or on the first permanent failure).
Trait Implementations§
Source§impl Debug for OriginPullError
impl Debug for OriginPullError
Source§impl Display for OriginPullError
impl Display for OriginPullError
Source§impl Error for OriginPullError
impl Error for OriginPullError
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()
Auto Trait Implementations§
impl Freeze for OriginPullError
impl RefUnwindSafe for OriginPullError
impl Send for OriginPullError
impl Sync for OriginPullError
impl Unpin for OriginPullError
impl UnsafeUnpin for OriginPullError
impl UnwindSafe for OriginPullError
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> 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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.