#[non_exhaustive]pub struct MarketSnapshot {Show 17 fields
pub symbol: Option<String>,
pub name: Option<String>,
pub asset_class: Option<AssetClass>,
pub market_status: Option<String>,
pub last_price: Option<f64>,
pub bid: Option<f64>,
pub ask: Option<f64>,
pub open: Option<f64>,
pub high: Option<f64>,
pub low: Option<f64>,
pub close: Option<f64>,
pub previous_close: Option<f64>,
pub volume: Option<f64>,
pub change: Option<f64>,
pub change_percent: Option<f64>,
pub error: Option<String>,
pub message: Option<String>,
}Expand description
One symbol’s current market state, flattened across asset classes.
Providers return a row per requested symbol even when the lookup failed, so
a batch is never silently short: check error before reading
the price fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbol: Option<String>Ticker symbol as the provider spells it (e.g. "AAPL", "X:BTCUSD").
name: Option<String>Human-readable name of the instrument.
asset_class: Option<AssetClass>Market this row belongs to.
market_status: Option<String>Trading status of that market (e.g. "open", "closed").
last_price: Option<f64>Most recent trade price.
bid: Option<f64>Best bid.
ask: Option<f64>Best ask.
open: Option<f64>Session open.
high: Option<f64>Session high.
low: Option<f64>Session low.
close: Option<f64>Session close (last price of the current session).
previous_close: Option<f64>Previous session’s close.
volume: Option<f64>Session volume.
change: Option<f64>Absolute change over the session.
change_percent: Option<f64>Percentage change over the session.
error: Option<String>Per-symbol error code, if the provider could not resolve this symbol.
message: Option<String>Human-readable message accompanying error.
Trait Implementations§
Source§impl Clone for MarketSnapshot
impl Clone for MarketSnapshot
Source§fn clone(&self) -> MarketSnapshot
fn clone(&self) -> MarketSnapshot
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 MarketSnapshot
impl Debug for MarketSnapshot
Source§impl Default for MarketSnapshot
impl Default for MarketSnapshot
Source§fn default() -> MarketSnapshot
fn default() -> MarketSnapshot
Source§impl<'de> Deserialize<'de> for MarketSnapshot
impl<'de> Deserialize<'de> for MarketSnapshot
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>,
Auto Trait Implementations§
impl Freeze for MarketSnapshot
impl RefUnwindSafe for MarketSnapshot
impl Send for MarketSnapshot
impl Sync for MarketSnapshot
impl Unpin for MarketSnapshot
impl UnsafeUnpin for MarketSnapshot
impl UnwindSafe for MarketSnapshot
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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 more