Skip to main content

SecurityWithOpts

Struct SecurityWithOpts 

Source
pub struct SecurityWithOpts {
    pub stock_id: u64,
    pub ftapi_market: i32,
    pub sub_types_with_opts: Vec<(i32, SubBitOptions)>,
    pub broker_id: Option<NonZeroU32>,
}
Expand description

v1.4.106 codex 1131 F1+F2: 单个 (security, sub_types_with_opts) 集合. 让 caller 一次表达 (stock_id, ftapi_market, [(sub_type, SubBitOptions)]).

v1.4.110 Phase 2 Slice 4: 从 3-tuple 升级为 struct, 加 broker_id 字段 让 CMD6211 SecuritySubscribe.broker_id (FTCmdStockQuoteSubData.proto:269, 对齐 C++ MktQotSub.cpp:454-463 SecuritySubscribe::set_broker_id) 真正写 出去. broker_id = None 走 no-broker 路径 (普通股); Some(NonZeroU32) = crypto multi-broker 隔离.

当前 (Phase 2) 所有 caller 都传 broker_id = None (Phase 3 才在 SubHandler 入口接 securityFirm resolve 写 broker, 见 codex 调研 12:13 增量).

Fields§

§stock_id: u64§ftapi_market: i32§sub_types_with_opts: Vec<(i32, SubBitOptions)>§broker_id: Option<NonZeroU32>

v1.4.110 Phase 2 Slice 4: broker-aware 订阅 (C++ StockKey(stockID, brokerID), 见 qot_stock_key.rs Phase 1 doc).

  • None: C++ m_hasBroker = false, CMD6211 不写 broker_id field
  • Some(N): C++ m_hasBroker = true, CMD6211 写 broker_id = N

Implementations§

Source§

impl SecurityWithOpts

Source

pub fn new( stock_id: u64, ftapi_market: i32, sub_types_with_opts: Vec<(i32, SubBitOptions)>, ) -> Self

不带 broker 的快捷构造 (普通股 / 非 crypto).

Source

pub fn with_broker( stock_id: u64, ftapi_market: i32, sub_types_with_opts: Vec<(i32, SubBitOptions)>, broker_id: u32, ) -> Self

带 broker 的快捷构造 (crypto multi-broker). broker_id = 0 自动降级 None.

Trait Implementations§

Source§

impl Clone for SecurityWithOpts

Source§

fn clone(&self) -> SecurityWithOpts

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 SecurityWithOpts

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