pub struct CachedOrderSnapshot {Show 14 fields
pub backend_order_id: String,
pub order_version: i32,
pub exchange_code: i32,
pub exchange: String,
pub security_type: i32,
pub order_type: i32,
pub trd_side: i32,
pub order_status: i32,
pub trd_market: Option<i32>,
pub qty: f64,
pub price: f64,
pub code: String,
pub is_stub: bool,
pub is_pending_broker_confirm: bool,
}Expand description
v1.4.106 codex 0219 Finding 1+4: trade-write resolution snapshot.
用于 ModifyOrder / CancelOrder handler 把 cached order 字段一次性 拿出来构造 backend req. 不在 hot path 改 CachedOrder, 而是返一个 只读 snapshot 防 caller mutate cache.
字段 1:1 映射 backend OrderReplaceReq / OrderCancelReq 必填项 +
modify validation 用到的 (order_type / trd_side / qty /
price / order_status).
Fields§
§backend_order_id: String= backend szOrderID (alphanumeric 字符串, 服务端真实 id).
order_version: i32= backend Order.version.
exchange_code: i32= backend Order.exchange_code (期货所属交易所代码, e.g. NN_QotMarket).
exchange: String= backend Order.exchange (股票所属交易所字符串, e.g. “SEHK”).
security_type: i32= backend Order.security_type (1=COMMON, 2=OPTION, 4=FUTURES, 5=BOND).
order_type: i32FTAPI OrderType (modify validation 按原 order_type 决定 price /
aux_price / trail* 是否必填).
trd_side: i32FTAPI TrdSide (1=Buy / 2=Sell / 3=SellShort / 4=BuyBack).
trailing modify 计算 sign 用.
order_status: i32FTAPI OrderStatus (IsNotSupportOrderOp 检查用).
trd_market: Option<i32>FTAPI TrdMarket (modify validation 中 sec_type futures 路径用).
qty: f64FTAPI Order.qty (历史值, 仅 modify validation 引用).
price: f64FTAPI Order.price (历史值, 仅 modify validation 引用).
code: StringFTAPI Order.code (用于错误提示 + log 关联).
is_stub: boolPlaceOrder stub 标记. PlaceOrder ack 时插入的 stub is_stub=true +
order_version=0. ModifyOrder 按 C++ 本地回显订单 nVersion=-1
映射为 backend wire u32::MAX; CancelOrder 不依赖 order_version.
is_pending_broker_confirm: boolPlaceOrder stub 是否仍在等待 broker/backend 权威确认.
Real write handlers use this to avoid reporting success against a local optimistic echo when the authoritative order list has not accepted the order yet.
Implementations§
Source§impl CachedOrderSnapshot
impl CachedOrderSnapshot
Sourcepub fn from_order(o: &CachedOrder) -> Self
pub fn from_order(o: &CachedOrder) -> Self
从 CachedOrder 抽出 trade-write resolution 用到的字段子集.
Trait Implementations§
Source§impl Clone for CachedOrderSnapshot
impl Clone for CachedOrderSnapshot
Source§fn clone(&self) -> CachedOrderSnapshot
fn clone(&self) -> CachedOrderSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more