pub struct TransportError(/* private fields */);Expand description
An HTTP transport failure.
An opaque wrapper rather than reqwest::Error itself, and that is the whole
point of it. reqwest is a 0.x crate, so under cargo’s rules 0.13 → 0.14
is a breaking change — and a reqwest::Error in this crate’s public API
would make every such bump a breaking change here, for a dependency that
has nothing to do with Alpaca. Callers on 0.1.x would be pinned to
reqwest 0.13 for the life of the line.
This crate already re-exports polars and crate::rust_decimal
with two paragraphs each explaining why
a version-skewed type is worth avoiding. reqwest got neither; now it does not
need one.
The reqwest::Error is deliberately not reachable — an accessor would
put the type back in the public API and undo the point of the wrapper. What a
caller actually asks of a transport error is answered by the predicates
below, and std::error::Error::source continues the chain past this layer
into reqwest’s own cause (the hyper or TLS error underneath), which is the
part that carries information this type does not already forward.
If you need a predicate that is not here, open an issue rather than reaching through: adding one is cheap and keeps the dependency contained.
Implementations§
Source§impl TransportError
impl TransportError
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Whether the failure was a timeout.
A timeout says nothing about whether the server acted on the request:
see Error::is_transient before using this to decide on a retry.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Whether the connection was never established.
The one transport failure that guarantees the request was not processed.
Trait Implementations§
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
Source§impl Error for TransportError
impl Error for TransportError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The inner error’s cause, not the inner error itself.
Display already delegates to reqwest::Error, so returning it here as
well would print the same sentence twice in any formatter that walks the
chain — which is most of them. Skipping a link that carries no new text
keeps the chain informative.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for TransportError
impl !UnwindSafe for TransportError
impl Freeze for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more