pub struct QotSecurityKey {
pub public_sec_key: String,
pub stock_key: QotStockKey,
}Expand description
QOT broker-aware security key (复合): public "market_code" + broker-aware QotStockKey.
public_sec_key: FTAPISecurity字段回显形态 (“market_code”), 不带 broker. 给 handler response / first-push replay / display 用.stock_key: cache / subscription manager / push registry 内部识别, 带 broker.
同 stock_id 不同 broker 的 crypto 订阅:
QotSecurityKey { public_sec_key: "91_BTCUSDT", stock_key: QotStockKey { stock_id: 12345, broker_id: Some(1007) } }
QotSecurityKey { public_sec_key: "91_BTCUSDT", stock_key: QotStockKey { stock_id: 12345, broker_id: Some(1008) } }两者 public_sec_key 相同 (用户看到同一 symbol), 但 stock_key 不同 (内部隔离).
Fields§
§public_sec_key: String§stock_key: QotStockKeyImplementations§
Source§impl QotSecurityKey
impl QotSecurityKey
Sourcepub fn from_broker_id(
public_sec_key: String,
stock_id: u64,
broker_id: u32,
) -> Self
pub fn from_broker_id( public_sec_key: String, stock_id: u64, broker_id: u32, ) -> Self
broker-aware security key. broker_id = 0 自动降级 no-broker.
Sourcepub fn cache_key(&self) -> String
pub fn cache_key(&self) -> String
内部 cache encoding: "{market_code}@b{broker_id}" (broker-aware) 或
"{market_code}" (no-broker).
Sourcepub fn parse_public_sec_key(sec_key: &str) -> Option<QotPublicSecKey<'_>>
pub fn parse_public_sec_key(sec_key: &str) -> Option<QotPublicSecKey<'_>>
Parse public FTAPI sec_key envelope "{market}_{code}".
Only the first underscore belongs to the envelope; the code suffix may
contain additional underscores (e.g. 11_BRK_B).
Sourcepub fn parse_cache_key(cache_key: &str) -> Option<(String, Option<u32>)>
pub fn parse_cache_key(cache_key: &str) -> Option<(String, Option<u32>)>
v1.4.110 codex Phase 3 Slice 6b: parse cache_key() display string
back to (public_sec_key, Option<broker_id>).
返 (public_sec_key, Some(broker_id)) if 输入含 @bN suffix; 否则
(input, None). 解析失败 (e.g. @bNot_A_Number) 返 None.
用于 SubscriptionManager.qot_global_desired_keys() 返 display string 时, rebuild 路径要还原 broker dimension 才能 cache lookup.
Trait Implementations§
Source§impl Clone for QotSecurityKey
impl Clone for QotSecurityKey
Source§fn clone(&self) -> QotSecurityKey
fn clone(&self) -> QotSecurityKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QotSecurityKey
impl Debug for QotSecurityKey
Source§impl Hash for QotSecurityKey
impl Hash for QotSecurityKey
Source§impl PartialEq for QotSecurityKey
impl PartialEq for QotSecurityKey
impl Eq for QotSecurityKey
impl StructuralPartialEq for QotSecurityKey
Auto Trait Implementations§
impl Freeze for QotSecurityKey
impl RefUnwindSafe for QotSecurityKey
impl Send for QotSecurityKey
impl Sync for QotSecurityKey
impl Unpin for QotSecurityKey
impl UnsafeUnpin for QotSecurityKey
impl UnwindSafe for QotSecurityKey
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.