pub enum ExchangeError {
Show 14 variants
AuthenticationFailed(String),
RateLimitExceeded {
retry_after_ms: u64,
},
NetworkError(String),
OrderRejected(String),
InsufficientFunds {
required: String,
available: String,
},
InstrumentNotFound(String),
MarketClosed {
instrument: String,
},
InvalidOrder(String),
OrderNotFound(String),
UnexpectedResponse(String),
ConfigurationError(String),
ExchangeSpecific {
code: String,
message: String,
},
Timeout(u64),
Internal(String),
}Expand description
Errors that can occur when interacting with an exchange.
Variants§
AuthenticationFailed(String)
Authentication failed.
RateLimitExceeded
Rate limit exceeded.
NetworkError(String)
Network error.
OrderRejected(String)
Order rejected by the exchange.
InsufficientFunds
Insufficient funds.
InstrumentNotFound(String)
Instrument not found.
MarketClosed
Market is closed.
InvalidOrder(String)
Invalid order parameters.
OrderNotFound(String)
Order not found.
UnexpectedResponse(String)
Exchange returned an unexpected response.
ConfigurationError(String)
Configuration error.
ExchangeSpecific
Exchange-specific error.
Timeout(u64)
Operation timed out.
Internal(String)
Generic internal error.
Implementations§
Source§impl ExchangeError
impl ExchangeError
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true if the error is retryable.
Sourcepub const fn retry_delay_ms(&self) -> Option<u64>
pub const fn retry_delay_ms(&self) -> Option<u64>
Returns the retry delay in milliseconds if applicable.
Trait Implementations§
Source§impl Debug for ExchangeError
impl Debug for ExchangeError
Source§impl Display for ExchangeError
impl Display for ExchangeError
Source§impl Error for ExchangeError
impl Error for ExchangeError
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()
Auto Trait Implementations§
impl Forget for ExchangeError
impl Freeze for ExchangeError
impl Move for ExchangeError
impl RefUnwindSafe for ExchangeError
impl Send for ExchangeError
impl Sync for ExchangeError
impl Unpin for ExchangeError
impl UnsafeUnpin for ExchangeError
impl UnwindSafe for ExchangeError
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