pub struct BinanceKlineData {
pub open_time: DateTime<Utc>,
pub interval: CandleInterval,
pub open: Decimal,
pub high: Decimal,
pub low: Decimal,
pub close: Decimal,
pub volume: Decimal,
pub trade_count: u64,
pub closed: bool,
}Expand description
The inner k payload shared by the BinanceSpot @kline_
and BinanceFuturesUsdMarket @continuousKline_ streams.
Both surfaces carry an identical k object for the fields rustrade consumes; they differ
only in where the market symbol lives (spot top-level s vs futures top-level ps) and
in the continuous payload omitting k.s. This struct deliberately omits the symbol so it
can be reused by both — the symbol is captured by the outer model and used to build the
SubscriptionId.
§Correctness notes
- OHLCV are JSON strings on the wire (e.g.
"0.01634790") → parsed viade_strtoDecimal, never through anf64(which silently truncates precision). open_time(t) is the candle’s open instant; the exclusiveclose_timeboundary is recomputed library-side viaclose_time_from_open(open + interval), not taken from the wireT(Binance’speriod-end − 1msconvention).
Fields§
§open_time: DateTime<Utc>§interval: CandleInterval§open: Decimal§high: Decimal§low: Decimal§close: Decimal§volume: Decimal§trade_count: u64§closed: booltrue once the kline interval has closed. rustrade emits closed candles only
(no repaint/lookahead) — an in-progress kline yields an empty MarketIter.
Trait Implementations§
Source§impl Clone for BinanceKlineData
impl Clone for BinanceKlineData
Source§fn clone(&self) -> BinanceKlineData
fn clone(&self) -> BinanceKlineData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinanceKlineData
impl Debug for BinanceKlineData
Source§impl<'de> Deserialize<'de> for BinanceKlineData
impl<'de> Deserialize<'de> for BinanceKlineData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BinanceKlineData
impl PartialEq for BinanceKlineData
Source§fn eq(&self, other: &BinanceKlineData) -> bool
fn eq(&self, other: &BinanceKlineData) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for BinanceKlineData
impl PartialOrd for BinanceKlineData
impl StructuralPartialEq for BinanceKlineData
Auto Trait Implementations§
impl Freeze for BinanceKlineData
impl RefUnwindSafe for BinanceKlineData
impl Send for BinanceKlineData
impl Sync for BinanceKlineData
impl Unpin for BinanceKlineData
impl UnsafeUnpin for BinanceKlineData
impl UnwindSafe for BinanceKlineData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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 more