pub struct LastTradeRecord {
pub ticker: Option<String>,
pub class_code: Option<String>,
pub side: Option<String>,
pub volume: Option<Decimal>,
pub price: Decimal,
pub quantity: Decimal,
pub date_time: Option<String>,
}Expand description
One trade of the tape. The docs give dateTime, side (1 buy, 2 sell), price, volume (in
the currency) and quantity (pieces), and NO instrument: it is the one asked for. ticker and
classCode are read if the broker sends them (older samples have them).
§Examples
use brokapi_bcs_protocol::http::models::LastTradeRecord;
let t: LastTradeRecord = serde_json::from_str(
r#"{"dateTime":"2026-10-19T07:05:00.000Z","side":"1","price":300.1,"volume":60020,"quantity":200}"#,
)?;
assert_eq!(t.quantity, dec!(200.0));
assert!(t.ticker.is_none()); // the documented record has no instrumentFields§
§ticker: Option<String>Ticker, if the broker sends it. The documented record has none: it is the instrument you asked for.
class_code: Option<String>Class code, if the broker sends it. The documented record has none.
side: Option<String>Side of the trade as text: 1 buy, 2 sell on REST. Older samples carry BUY and SELL.
volume: Option<Decimal>Trade volume in the instrument currency.
price: DecimalTrade price.
quantity: DecimalQuantity in pieces.
date_time: Option<String>Time of the trade (UTC), kept as the text the broker sends.
Trait Implementations§
Source§impl Clone for LastTradeRecord
impl Clone for LastTradeRecord
Source§fn clone(&self) -> LastTradeRecord
fn clone(&self) -> LastTradeRecord
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 LastTradeRecord
impl Debug for LastTradeRecord
Source§impl<'de> Deserialize<'de> for LastTradeRecord
impl<'de> Deserialize<'de> for LastTradeRecord
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 Freeze for LastTradeRecord
impl RefUnwindSafe for LastTradeRecord
impl Send for LastTradeRecord
impl Sync for LastTradeRecord
impl Unpin for LastTradeRecord
impl UnsafeUnpin for LastTradeRecord
impl UnwindSafe for LastTradeRecord
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