#[non_exhaustive]pub enum HttpTransportError {
Timeout,
Connect(String),
Io(String),
InvalidRequest(String),
ResponseTooLarge {
actual: usize,
limit: usize,
},
Rejected(String),
}Expand description
Why an outbound request did not produce a response.
Transport-level only. A response with a discouraging status code is
an Ok(HttpResponse), because only the caller knows what a given
status means for its own protocol.
#[non_exhaustive] because a host may distinguish failures this
crate has no vocabulary for yet; a caller matching exhaustively today
should not break when one is added.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
The request exceeded its deadline.
Distinct from Self::Connect and Self::Io because callers
act on it differently. identity-jwt treats a timed-out JWKS
fetch as soft-fail-at-boot rather than a configuration error, and
a delegation timeout must map to “unknown” rather than
“rejected”, since a token may still have been minted.
Connect(String)
The connection could not be established.
Io(String)
The connection was established but the exchange failed.
InvalidRequest(String)
The request could not be formed — an unparseable URL, an illegal header. Always a bug or a configuration error, never transient.
ResponseTooLarge
The response body exceeded the request’s ceiling. The body is discarded rather than truncated.
Fields
Rejected(String)
The host declined to make the request at all.
Egress policy, an SSRF guard, admission control, or an open
circuit. Deliberately distinct from Self::Connect: “we
declined to try” and “we tried and failed” send an operator to
different places, and collapsing them turns a blocked destination
into a phantom network problem.
Implementations§
Source§impl HttpTransportError
impl HttpTransportError
Sourcepub fn may_have_reached_peer(&self) -> bool
pub fn may_have_reached_peer(&self) -> bool
Whether the peer may have received and acted on the request.
This is the question a caller actually needs, and it is not the
same as “should I retry”. Retry safety is idempotency plus this;
only the caller knows the first half. A JWKS GET is safe to
repeat regardless. An RFC 8693 token exchange is not: repeat one
that already landed and the IdP mints a second credential
nobody is tracking.
true means unknown, not certain. A timeout cannot
distinguish “never arrived” from “arrived, and the response was
lost on the way back”, so it answers true and the caller must
treat the outcome as indeterminate rather than failed.
This maps onto the effect-log triad a delegating plugin records:
false is a clean rejected, true is unknown and wants
reconciliation rather than an assumption.
Trait Implementations§
Source§impl Clone for HttpTransportError
impl Clone for HttpTransportError
Source§fn clone(&self) -> HttpTransportError
fn clone(&self) -> HttpTransportError
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 HttpTransportError
impl Debug for HttpTransportError
Source§impl Display for HttpTransportError
impl Display for HttpTransportError
impl Eq for HttpTransportError
Source§impl Error for HttpTransportError
impl Error for HttpTransportError
1.30.0 · 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()
Source§impl From<HttpTransportError> for HttpRequestError
impl From<HttpTransportError> for HttpRequestError
Source§fn from(e: HttpTransportError) -> HttpRequestError
fn from(e: HttpTransportError) -> HttpRequestError
Source§impl PartialEq for HttpTransportError
impl PartialEq for HttpTransportError
impl StructuralPartialEq for HttpTransportError
Auto Trait Implementations§
impl Freeze for HttpTransportError
impl RefUnwindSafe for HttpTransportError
impl Send for HttpTransportError
impl Sync for HttpTransportError
impl Unpin for HttpTransportError
impl UnsafeUnpin for HttpTransportError
impl UnwindSafe for HttpTransportError
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<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
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<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