pub struct OrderData {Show 16 fields
pub gateway_name: String,
pub symbol: String,
pub exchange: Exchange,
pub orderid: String,
pub order_type: OrderType,
pub direction: Option<Direction>,
pub offset: Offset,
pub price: f64,
pub volume: f64,
pub traded: f64,
pub status: Status,
pub datetime: Option<DtNs>,
pub reference: String,
pub name: String,
pub status_msg: String,
pub traded_price: f64,
}Expand description
订单最新状态跟踪数据。
Fields§
§gateway_name: String上游网关名
symbol: String合约代码
exchange: Exchange交易所
orderid: String委托号(网关内唯一)
order_type: OrderType委托类型(Python type;Rust 改名避关键字,serde 线上字段名还原为 "type")
direction: Option<Direction>方向(缺省 None)
offset: Offset开平(缺省 NONE)
price: f64委托价
volume: f64委托总量
traded: f64已成交量
status: Status状态(缺省 SUBMITTING)
datetime: Option<DtNs>时间戳(UTC 纪元纳秒;缺省 None)
reference: String策略/来源备注
name: String证券名称
status_msg: String委托状态描述(废单原因)
traded_price: f64成交均价
Implementations§
Source§impl OrderData
impl OrderData
Sourcepub fn en_symbol_into(&self, buf: &mut String)
pub fn en_symbol_into(&self, buf: &mut String)
零分配版本:追加到复用缓冲。
Sourcepub fn en_orderid(&self) -> String
pub fn en_orderid(&self) -> String
en_orderid = "{gateway_name}.{orderid}"(object.py:180)。
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
订单是否活跃(object.py:182;真源为 Status::is_active)。
Sourcepub fn create_cancel_request(&self) -> CancelRequest
pub fn create_cancel_request(&self) -> CancelRequest
由订单直接生成撤单请求(object.py:188)。
Trait Implementations§
impl StructuralPartialEq for OrderData
Auto Trait Implementations§
impl Freeze for OrderData
impl RefUnwindSafe for OrderData
impl Send for OrderData
impl Sync for OrderData
impl Unpin for OrderData
impl UnsafeUnpin for OrderData
impl UnwindSafe for OrderData
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