#[non_exhaustive]pub enum TransportError {
Transport {
class: TransportErrorClass,
detail: Redacted<String>,
},
Configuration {
message: Redacted<String>,
},
HttpStatus {
status: u16,
headers: Vec<(String, Redacted<String>)>,
body: Redacted<String>,
},
}Expand description
Production HTTP transport seam and its typed surfaces.
HttpTransport is the async injection point downstream clients
consume; TransportResponse is its success envelope (2xx status,
redacted headers, body); TransportError is its typed failure
surface, and TransportErrorClass is the label telemetry and retry
layers use to partition REST-transport failures without parsing error
messages. The native default implementation is ReqwestTransport;
the browser default lives in cow-sdk-core (transport::fetch).
Typed error surface returned by every
HttpTransport implementation.
Transport adapters funnel every failure into this enum so downstream
telemetry, retry, and backoff layers observe a uniform classification
without parsing free-form error strings. The
Transport variant pairs a TransportErrorClass tag
with a redacted detail string; the Configuration
variant captures builder-time or input-validation failures that happen
before a network request is dispatched; the
HttpStatus variant captures a non-2xx response so
the orderbook and subgraph layers receive the numeric status, response
headers, and body together without rebuilding them from free-form error
strings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport
Network or request-execution failure observed by the transport layer.
Fields
class: TransportErrorClassCategorical failure mode taken from the documented
is_timeout, is_connect, is_redirect, is_decode, is_body,
is_builder, is_request, is_status, fallthrough partition.
Configuration
Builder-time or input-validation failure that prevented a request from being dispatched.
HttpStatus
Non-2xx HTTP response returned by the remote endpoint.
Adapters surface the numeric status code and the raw response body together with the response headers through this variant so downstream orchestration can classify the outcome without re-reading the transport’s rendered error text.
Implementations§
Source§impl TransportError
impl TransportError
Sourcepub const fn class(&self) -> Option<TransportErrorClass>
pub const fn class(&self) -> Option<TransportErrorClass>
Returns the TransportErrorClass for Transport
variants and None for configuration and HTTP-status failures.
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
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()
Auto Trait Implementations§
impl Freeze for TransportError
impl RefUnwindSafe for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
impl UnwindSafe 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
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> 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.