Struct crypto_message::TradeMsg
source · pub struct TradeMsg {Show 13 fields
pub exchange: String,
pub market_type: MarketType,
pub msg_type: MessageType,
pub pair: String,
pub symbol: String,
pub timestamp: i64,
pub side: TradeSide,
pub price: f64,
pub quantity_base: f64,
pub quantity_quote: f64,
pub quantity_contract: Option<f64>,
pub trade_id: String,
pub json: String,
}
Expand description
Realtime trade message.
Fields§
§exchange: String
The exchange name, unique for each exchage
market_type: MarketType
Market type
msg_type: MessageType
Message type
pair: String
Unified pair, base/quote, e.g., BTC/USDT
symbol: String
Exchange-specific trading symbol or id, recognized by RESTful API
timestamp: i64
Unix timestamp, in milliseconds
side: TradeSide
Which side is taker
price: f64
price
quantity_base: f64
§quantity_quote: f64
§quantity_contract: Option<f64>
Number of contracts, always None for Spot
trade_id: String
§json: String
the original JSON message
Implementations§
source§impl TradeMsg
impl TradeMsg
sourcepub fn to_csv_string(&self) -> String
pub fn to_csv_string(&self) -> String
Convert to a CSV string.
The exchange
, market_type
, msg_type
, pair
and symbol
fields
are not included to save some disk space.
Trait Implementations§
source§impl<'de> Deserialize<'de> for TradeMsg
impl<'de> Deserialize<'de> for TradeMsg
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
Auto Trait Implementations§
impl RefUnwindSafe for TradeMsg
impl Send for TradeMsg
impl Sync for TradeMsg
impl Unpin for TradeMsg
impl UnwindSafe for TradeMsg
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