pub enum Error {
Show 13 variants
Api {
code: i64,
msg: String,
},
Http {
status: u16,
body: String,
},
InvalidHeaderValue(InvalidHeaderValue),
Io(Error),
MissingCredentials,
Msg(String),
RateLimited {
retry_after_ms: u64,
},
RateLimitUnsatisfiable {
cost: u32,
burst: u32,
},
Reqwest(Error),
SerdeJson(Error),
TooManyPages {
max: usize,
},
SerdeUrlEncoded(Error),
SerdePathToError(Error<Error>),
}Variants§
Api
Http
A non-2xx HTTP response whose body is not a Bybit error envelope
(e.g. an HTML page from a CDN or gateway). body may be truncated.
InvalidHeaderValue(InvalidHeaderValue)
Io(Error)
MissingCredentials
A private endpoint was called on a client created without
api_key/api_secret.
Msg(String)
RateLimited
The local rate limiter rejected the request before it was sent.
retry_after_ms is the estimated wait until capacity is available.
RateLimitUnsatisfiable
The local rate limiter can never let this request through: its cost
exceeds the bucket’s burst, or the bucket does not refill. Retrying
will not help; adjust RateLimiterConfig.
Reqwest(Error)
SerdeJson(Error)
TooManyPages
A *_all pagination helper fetched max pages without reaching the end.
SerdeUrlEncoded(Error)
SerdePathToError(Error<Error>)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<APIErrorResponse> for Error
impl From<APIErrorResponse> for Error
Source§fn from(resp: APIErrorResponse) -> Self
fn from(resp: APIErrorResponse) -> Self
Converts to this type from the input type.
Source§impl From<InvalidHeaderValue> for Error
impl From<InvalidHeaderValue> for Error
Source§fn from(err: InvalidHeaderValue) -> Self
fn from(err: InvalidHeaderValue) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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