pub enum BinanceDataError {
RateLimited {
retry_after: Option<Duration>,
},
Api {
status: u16,
message: String,
},
Http {
message: String,
},
Deserialize {
message: String,
payload: String,
},
InvalidInput {
message: String,
},
}Expand description
Errors returned by the Binance historical klines REST client.
The kline endpoints are public and unauthenticated, so there is no auth or
environment-variable variant (contrast the massive feature’s MassiveError,
which carries both). WebSocket disconnects are handled by the live path’s
Connector, not here.
Variants§
RateLimited
Rate limited by the API (HTTP 429) or IP-banned for repeat violations
(HTTP 418). Carries the optional Retry-After duration parsed from the
response header.
§Contract
The historical Stream yields this error and ends — it does not
wait, retry, or run a process-global limiter. The consumer owns
retry/backoff and resumes losslessly by re-invoking fetch_candles
with start advanced to last_close_time + 1ms (the next candle’s open).
The [start, end] range is close_time-inclusive, so resuming exactly at
the last close_time would re-yield that final candle; the +1ms step
skips it without leaving a gap (pagination keys off open_time, and
open ≡ close − interval).
Api
API returned a non-success, non-rate-limit response (e.g. 400 Invalid symbol, 400 Invalid interval).
Http
Network or HTTP client error (DNS, TLS, timeout, connection reset).
Deserialize
Response body could not be deserialised into the expected kline shape.
InvalidInput
Client-side input validation failed before any request was made
(e.g. empty symbol, or a candle whose close_time overflows the
representable DateTime<Utc> range).
Trait Implementations§
Source§impl Clone for BinanceDataError
impl Clone for BinanceDataError
Source§fn clone(&self) -> BinanceDataError
fn clone(&self) -> BinanceDataError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BinanceDataError
impl Debug for BinanceDataError
Source§impl Display for BinanceDataError
impl Display for BinanceDataError
Source§impl Error for BinanceDataError
impl Error for BinanceDataError
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()
Source§impl From<Error> for BinanceDataError
impl From<Error> for BinanceDataError
Source§impl PartialEq for BinanceDataError
impl PartialEq for BinanceDataError
Source§fn eq(&self, other: &BinanceDataError) -> bool
fn eq(&self, other: &BinanceDataError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BinanceDataError
Auto Trait Implementations§
impl Freeze for BinanceDataError
impl RefUnwindSafe for BinanceDataError
impl Send for BinanceDataError
impl Sync for BinanceDataError
impl Unpin for BinanceDataError
impl UnsafeUnpin for BinanceDataError
impl UnwindSafe for BinanceDataError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.