Enum Error
#[non_exhaustive]pub enum Error {
InvalidRequest {
field: String,
detail: String,
},
Transfer {
kind: TransferErrorKind,
detail: String,
},
Unsupported {
feature: Feature,
exchange: &'static str,
detail: String,
},
Adapter {
detail: String,
},
Auth {
detail: String,
},
Exchange {
exchange: &'static str,
code: String,
message: String,
status: Option<u16>,
kind: ExchangeErrorKind,
},
Transport {
detail: String,
},
Decode {
detail: String,
},
}Expand description
Local request, adapter, authentication, exchange, transport, and decoding failures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRequest
A request field failed validation.
Retrying the same request unchanged returns the same error.
Fields
Transfer
A cross-exchange transfer failed local safety validation.
Fields
kind: TransferErrorKindStable transfer failure category.
Unsupported
The adapter does not map this feature or request shape.
Retrying the same request or adding credentials cannot change this
result. The exchange may still expose a native API outside maxt.
Fields
Adapter
An adapter or foreign dispatcher violated the Adapter
contract.
Auth
A credentialed request could not be built locally, so none was sent.
Exchange
Error response from the exchange, including rejected credentials.
Fields
kind: ExchangeErrorKindHow the error classifies for retry purposes.
Transport
The request never completed: DNS, TLS, socket, or timeout.
Decode
The response payload could not be decoded.
Implementations§
§impl Error
impl Error
pub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether retrying the identical request could plausibly succeed.
Returns true for rate limits, exchange unavailability, and transport
failures. A rejected request is false, even when rebuilding a request
with a fresh timestamp could succeed.
pub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Whether the exchange refused because the caller sent requests too fast.
Worth branching on separately from Error::is_retryable: a rate limit
asks for a longer pause than a transport blip does.
Trait Implementations§
impl Eq for Error
§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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> 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§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.