pub struct CachedOrderSnapshot {Show 17 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_combo: bool,
pub sub_account_id: Option<u64>,
pub is_stub: bool,
pub is_pending_broker_confirm: bool,
pub quote_id: Option<String>,
}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_combo: boolC++ Ndt_Trd_Order.enOptionStgyType != None combo marker.
Modify/Cancel uses this independently of the synthetic combo symbol:
both MsgHeader and single-order body must carry backend
SECURITY_TYPE_MULTILEG for combo orders.
sub_account_id: Option<u64>Backend Order.sub_account_id / C++ Ndt_Trd_Order.nSubAccID.
ModifyOrder real path mirrors C++ GetSubAccID(order) and writes this
value into MsgHeader.sub_account_id for FutuJP when it is non-zero.
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.
quote_id: Option<String>Cached Order.order_extra.quote_id, used only by the C++-aligned
event-contract combo modify/cancel validation.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CachedOrderSnapshot
impl Debug for CachedOrderSnapshot
Source§impl Default for CachedOrderSnapshot
impl Default for CachedOrderSnapshot
Source§fn default() -> CachedOrderSnapshot
fn default() -> CachedOrderSnapshot
Source§impl PartialEq for CachedOrderSnapshot
impl PartialEq for CachedOrderSnapshot
Source§fn eq(&self, other: &CachedOrderSnapshot) -> bool
fn eq(&self, other: &CachedOrderSnapshot) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CachedOrderSnapshot
Auto Trait Implementations§
impl Freeze for CachedOrderSnapshot
impl RefUnwindSafe for CachedOrderSnapshot
impl Send for CachedOrderSnapshot
impl Sync for CachedOrderSnapshot
impl Unpin for CachedOrderSnapshot
impl UnsafeUnpin for CachedOrderSnapshot
impl UnwindSafe for CachedOrderSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more