pub struct OrderMessage {
pub original_client_order_id: Option<String>,
pub client_order_id: String,
pub data: Option<OrderExecutionData>,
}Expand description
A message about an order from the order channels.
It comes from orders/events/ws (the current channel) and from the deprecated execution and transaction
channels. It carries the report in OrderMessage::data.
§Examples
use brokapi_bcs_protocol::models::enums::{ExecutionType, OrderStatus};
use brokapi_bcs_protocol::ws::models::OrderMessage;
let m: OrderMessage = serde_json::from_str(
r#"{"originalClientOrderId":"o-1","clientOrderId":"",
"data":{"orderStatus":"1","executionType":"1","ticker":"SBER","classCode":"TQBR",
"side":"1","orderType":"2","orderQuantity":10,"executedQuantity":4,
"lastQuantity":4,"remainedQuantity":6,"price":300.0}}"#,
)?;
let data = m.data.unwrap();
assert_eq!(data.order_status, OrderStatus::PartiallyFilled);
assert_eq!(data.execution_type, Some(ExecutionType::PartialFill));
assert_eq!(data.last_quantity, dec!(4.0));Fields§
§original_client_order_id: Option<String>The clientOrderId you gave when you placed the order. For an edit it is the id of the changed order, as the broker docs word it.
client_order_id: StringId of the request that caused the message. Empty text if the broker sent none.
data: Option<OrderExecutionData>The report. None if the message has none.
Trait Implementations§
Source§impl Clone for OrderMessage
impl Clone for OrderMessage
Source§fn clone(&self) -> OrderMessage
fn clone(&self) -> OrderMessage
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 OrderMessage
impl Debug for OrderMessage
Source§impl<'de> Deserialize<'de> for OrderMessage
impl<'de> Deserialize<'de> for OrderMessage
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 OrderMessage
impl RefUnwindSafe for OrderMessage
impl Send for OrderMessage
impl Sync for OrderMessage
impl Unpin for OrderMessage
impl UnsafeUnpin for OrderMessage
impl UnwindSafe for OrderMessage
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