pub struct Stats24hr {Show 22 fields
pub symbol: String,
pub price_change: Option<Decimal>,
pub price_change_percent: Option<Decimal>,
pub weighted_avg_price: Option<Decimal>,
pub prev_close_price: Option<Decimal>,
pub last_price: Option<Decimal>,
pub last_qty: Option<Decimal>,
pub bid_price: Option<Decimal>,
pub bid_qty: Option<Decimal>,
pub ask_price: Option<Decimal>,
pub ask_qty: Option<Decimal>,
pub open_price: Option<Decimal>,
pub high_price: Option<Decimal>,
pub low_price: Option<Decimal>,
pub volume: Option<Decimal>,
pub quote_volume: Option<Decimal>,
pub open_time: Option<i64>,
pub close_time: Option<i64>,
pub first_id: Option<i64>,
pub last_id: Option<i64>,
pub count: Option<i64>,
pub info: HashMap<String, Value>,
}Expand description
24-hour statistics data.
Fields§
§symbol: StringTrading symbol.
price_change: Option<Decimal>Price change.
price_change_percent: Option<Decimal>Price change percentage.
weighted_avg_price: Option<Decimal>Weighted average price.
prev_close_price: Option<Decimal>Previous close price.
last_price: Option<Decimal>Latest price.
last_qty: Option<Decimal>Latest trade quantity.
bid_price: Option<Decimal>Best bid price.
bid_qty: Option<Decimal>Best bid quantity.
ask_price: Option<Decimal>Best ask price.
ask_qty: Option<Decimal>Best ask quantity.
open_price: Option<Decimal>Open price.
high_price: Option<Decimal>High price.
low_price: Option<Decimal>Low price.
volume: Option<Decimal>Volume (base currency).
quote_volume: Option<Decimal>Quote volume (quote currency).
open_time: Option<i64>Open time.
close_time: Option<i64>Close time.
first_id: Option<i64>First trade ID.
last_id: Option<i64>Last trade ID.
count: Option<i64>Number of trades.
info: HashMap<String, Value>Raw exchange data.
Implementations§
Source§impl Stats24hr
impl Stats24hr
Sourcepub fn calculate_price_change_percent(&self) -> Option<Decimal>
pub fn calculate_price_change_percent(&self) -> Option<Decimal>
Calculates the price change percentage if not provided.
Sourcepub fn calculate_price_change(&self) -> Option<Decimal>
pub fn calculate_price_change(&self) -> Option<Decimal>
Calculates the price change if not provided.
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Checks if the price change is positive.
Sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Checks if the price change is negative.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stats24hr
impl<'de> Deserialize<'de> for Stats24hr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stats24hr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stats24hr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Stats24hr
impl Serialize for Stats24hr
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Stats24hr
impl RefUnwindSafe for Stats24hr
impl Send for Stats24hr
impl Sync for Stats24hr
impl Unpin for Stats24hr
impl UnwindSafe for Stats24hr
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