Skip to main content

MainBrokerSnapshot

Struct MainBrokerSnapshot 

Source
pub struct MainBrokerSnapshot {
    pub main_brokers: Vec<u32>,
    pub connect_brokers: Vec<u32>,
    pub crypto_brokers: Vec<u32>,
}
Expand description

MainBrokerageRsp 解析后的 snapshot, 用于 MainBrokerCache.

Fields§

§main_brokers: Vec<u32>

主推券商 (按 backend 下发顺序)

§connect_brokers: Vec<u32>

主推 + 已开户 (建 broker channel 时用, 9419 主要应用)

v1.4.110 codex audit P3 #9: 当前 Rust daemon 不读此字段 — broker channel 建连仍走 auth_code_list (HTTP auth 拿到的) + CMD20176 (sanity check), 见 futu-backend::valid_brokers 模块文档. 保留此字段作 future fallback 数据源 (若 auth_code_list 滞后/失效, 可切到 9419 connect_brokers 作权威). codex 调研 12:02 增量 §B 列了 3 个数据源的语义差异.

§crypto_brokers: Vec<u32>

数字货币主推券商 (按 backend 下发顺序, QOT default broker 解析关键)

Implementations§

Source§

impl MainBrokerSnapshot

Source

pub fn default_crypto_broker( &self, single_crypto_account_broker: Option<u32>, ) -> u32

C++ INNData_Trd_MainBrokerage::GetCryptoSupportedDefaultMainBroker() 等价 (line 70-123).

选择顺序:

  1. 如果 caller 提供了已开户 crypto account 数 == 1, 直接用该 account 的 broker (caller 责任注入, 本 fn 不查 trd_cache).
  2. crypto_brokers 第一个支持 crypto 的 main broker.
  3. main_brokers 第一个支持 crypto 的 main broker.
  4. 兜底 FALLBACK_DEFAULT_CRYPTO_BROKER (1007).

Trait Implementations§

Source§

impl Clone for MainBrokerSnapshot

Source§

fn clone(&self) -> MainBrokerSnapshot

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 MainBrokerSnapshot

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for MainBrokerSnapshot

Source§

fn default() -> MainBrokerSnapshot

Returns the “default value” for a type. 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