Skip to main content

StockInfo

Struct StockInfo 

Source
pub struct StockInfo {
Show 22 fields pub stock_id: u64, pub sequence: u64, pub code: String, pub name_sc: String, pub name_tc: String, pub name_en: String, pub market_code: u32, pub instrument_type: u32, pub sub_instrument_type: u32, pub lot_size: u32, pub currency_code: u32, pub listing_date: u32, pub delisting: bool, pub delete_flag: bool, pub warrnt_stock_owner: u64, pub no_search: bool, pub future_origin_id: u64, pub zhuli_id: u64, pub cc_origin: String, pub cc_destination: String, pub exchange: String, pub listed_exchange: String,
}
Expand description

缓存的证券信息 (从 CSStockItem 解析)

Fields§

§stock_id: u64§sequence: u64§code: String§name_sc: String§name_tc: String§name_en: String§market_code: u32§instrument_type: u32§sub_instrument_type: u32§lot_size: u32§currency_code: u32§listing_date: u32§delisting: bool§delete_flag: bool§warrnt_stock_owner: u64

窝轮所属正股 ID (warrnt_stock_owner), 0 表示无

§no_search: bool

不可搜索标记 (no_search), true 表示不可搜索

§future_origin_id: u64

v1.4.106 codex F5: 期货主连合约关联 stock_id (proto field 41 origin_id).

含义 (对齐 C++ Ndt_Qot_SecInfo::nFutureOriginID): 当前 row 是主连合约 (e.g. HSImain, NQmain) 时, origin_id 指向真实月份合约的 stock_id; 普通合约 (HSI2604 / NQ2606) 此字段为 0.

F5 用途: PlaceOrder 在 IsFuturesTrdMarket && origin_id != 0 时 异步发 CMD 6747 拉真实合约 code, 用真实 code 下单 (对齐 C++ APIServer_Trd_PlaceOrder.cpp:632-650 ReqMainLinkContract 流程).

§zhuli_id: u64

v1.4.106 codex F5: 期货主力合约 stock_id (proto field 40 zhuli_id).

含义: 主连合约持有此字段, 指向当前主力合约 stock_id (流动性最大). CMD 6747 响应解析此字段后用 id_to_key 反查 code → 替换 PlaceOrder c2s.code 后下发. 普通合约此字段为 0.

§cc_origin: String

Crypto 货币对左侧货币 (C++ CSStockItem.cc_origin, proto field 60).

§cc_destination: String

Crypto 货币对右侧货币 (C++ CSStockItem.cc_destination, proto field 61).

§exchange: String

v1.4.110 final E.5 P2#6: 交易所 (proto field 57, e.g. “SEHK”, “NASDAQ”).

数据驱动 fallback (pitfall #35 C++ 数据驱动 vs Rust 启发式): trade handler 的 derive_exchange_str 应优先用此字段, 缺失时再 fallback 到 pattern match heuristic. backend 不下发此字段时为空串.

§listed_exchange: String

v1.4.110 final E.5 P2#6: 上市交易所 (proto field 74).

通常与 exchange 相同, dual-listed ADR / 双重主要上市等场景下不同 (e.g. 港股通的 H 股可能 exchange=HKEX, listed_exchange=SEHK).

Trait Implementations§

Source§

impl Clone for StockInfo

Source§

fn clone(&self) -> StockInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StockInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more