#[non_exhaustive]pub enum Error {
CapabilityUnavailable {
exchange: ExchangeId,
capability: Capability,
reason: CapabilityUnavailableReason,
},
MissingCredentials {
exchange: ExchangeId,
},
InvalidConfig {
context: InvalidConfigContext,
},
BadRequest {
context: BadRequestContext,
},
Transport {
context: TransportContext,
},
Decode {
context: DecodeContext,
},
Authentication {
context: AuthenticationContext,
},
Timeout {
context: TimeoutContext,
},
RateLimited {
context: RateLimitedContext,
},
Exchange {
context: ExchangeErrorContext,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MissingCredentials
Fields
§
exchange: ExchangeIdInvalidConfig
Fields
§
context: InvalidConfigContextBadRequest
Fields
§
context: BadRequestContextTransport
Fields
§
context: TransportContextDecode
Fields
§
context: DecodeContextAuthentication
Fields
§
context: AuthenticationContextTimeout
Fields
§
context: TimeoutContextRateLimited
Fields
§
context: RateLimitedContextExchange
Fields
§
context: ExchangeErrorContextImplementations§
Source§impl Error
impl Error
pub fn unsupported(exchange: ExchangeId, capability: Capability) -> Self
pub fn missing_credentials(exchange: ExchangeId) -> Self
pub fn invalid_config(message: impl Into<String>) -> InvalidConfigContextBuilder
pub fn bad_request(message: impl Into<String>) -> BadRequestContextBuilder
pub fn transport(message: impl Into<String>) -> TransportContextBuilder
pub fn decode(message: impl Into<String>) -> DecodeContextBuilder
pub fn authentication( message: impl Into<String>, ) -> AuthenticationContextBuilder
pub fn timeout(message: impl Into<String>) -> TimeoutContextBuilder
pub fn rate_limited(message: impl Into<String>) -> RateLimitedContextBuilder
pub fn exchange_error( exchange: ExchangeId, message: impl Into<String>, ) -> ExchangeErrorContextBuilder
pub fn kind(&self) -> ErrorKind
pub fn exchange(&self) -> Option<&ExchangeId>
pub fn operation(&self) -> Option<&str>
pub fn config_key(&self) -> Option<&str>
pub fn message(&self) -> Option<&str>
pub fn status(&self) -> Option<u16>
pub fn code(&self) -> Option<&str>
pub fn retry_after(&self) -> Option<Duration>
pub fn capability(&self) -> Option<Capability>
pub fn capability_reason(&self) -> Option<CapabilityUnavailableReason>
Trait Implementations§
Source§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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AuthenticationContext> for Error
impl From<AuthenticationContext> for Error
Source§fn from(context: AuthenticationContext) -> Self
fn from(context: AuthenticationContext) -> Self
Converts to this type from the input type.
Source§impl From<AuthenticationContextBuilder> for Error
impl From<AuthenticationContextBuilder> for Error
Source§fn from(builder: AuthenticationContextBuilder) -> Self
fn from(builder: AuthenticationContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<BadRequestContext> for Error
impl From<BadRequestContext> for Error
Source§fn from(context: BadRequestContext) -> Self
fn from(context: BadRequestContext) -> Self
Converts to this type from the input type.
Source§impl From<BadRequestContextBuilder> for Error
impl From<BadRequestContextBuilder> for Error
Source§fn from(builder: BadRequestContextBuilder) -> Self
fn from(builder: BadRequestContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<DecodeContext> for Error
impl From<DecodeContext> for Error
Source§fn from(context: DecodeContext) -> Self
fn from(context: DecodeContext) -> Self
Converts to this type from the input type.
Source§impl From<DecodeContextBuilder> for Error
impl From<DecodeContextBuilder> for Error
Source§fn from(builder: DecodeContextBuilder) -> Self
fn from(builder: DecodeContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<ExchangeErrorContext> for Error
impl From<ExchangeErrorContext> for Error
Source§fn from(context: ExchangeErrorContext) -> Self
fn from(context: ExchangeErrorContext) -> Self
Converts to this type from the input type.
Source§impl From<ExchangeErrorContextBuilder> for Error
impl From<ExchangeErrorContextBuilder> for Error
Source§fn from(builder: ExchangeErrorContextBuilder) -> Self
fn from(builder: ExchangeErrorContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<InvalidConfigContext> for Error
impl From<InvalidConfigContext> for Error
Source§fn from(context: InvalidConfigContext) -> Self
fn from(context: InvalidConfigContext) -> Self
Converts to this type from the input type.
Source§impl From<InvalidConfigContextBuilder> for Error
impl From<InvalidConfigContextBuilder> for Error
Source§fn from(builder: InvalidConfigContextBuilder) -> Self
fn from(builder: InvalidConfigContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<RateLimitedContext> for Error
impl From<RateLimitedContext> for Error
Source§fn from(context: RateLimitedContext) -> Self
fn from(context: RateLimitedContext) -> Self
Converts to this type from the input type.
Source§impl From<RateLimitedContextBuilder> for Error
impl From<RateLimitedContextBuilder> for Error
Source§fn from(builder: RateLimitedContextBuilder) -> Self
fn from(builder: RateLimitedContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TimeoutContext> for Error
impl From<TimeoutContext> for Error
Source§fn from(context: TimeoutContext) -> Self
fn from(context: TimeoutContext) -> Self
Converts to this type from the input type.
Source§impl From<TimeoutContextBuilder> for Error
impl From<TimeoutContextBuilder> for Error
Source§fn from(builder: TimeoutContextBuilder) -> Self
fn from(builder: TimeoutContextBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TransportContext> for Error
impl From<TransportContext> for Error
Source§fn from(context: TransportContext) -> Self
fn from(context: TransportContext) -> Self
Converts to this type from the input type.
Source§impl From<TransportContextBuilder> for Error
impl From<TransportContextBuilder> for Error
Source§fn from(builder: TransportContextBuilder) -> Self
fn from(builder: TransportContextBuilder) -> Self
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more