Skip to main content

SecurityInfoSource

Enum SecurityInfoSource 

Source
pub enum SecurityInfoSource {
    StockListFull,
    OnDemandBasic,
    Bootstrap,
}
Expand description

v1.4.106 codex 1148 F7 (P2): cache row “完整度 / 来源” 标记。

此 enum 区分一个 CachedSecurityInfo 是从 stock-list 完整 sync 来的 (字段全), 还是 subscribe on-demand CMD 20106 临时补的 (大量字段为空)。 GetStaticInfo / GetSecuritySnapshot / make_static_info 等需要完整 静态字段的路径在收到 OnDemandBasic 行时触发完整 stock-list / 20106 completed refresh, 或明确返 partial / unavailable, 不假装完整数据。

来源 audit: codex/2026-05-01-1148-v1.4.106-codex-qot-static-data-review.md Finding 7。

Variants§

§

StockListFull

来自 backend stock-list full sync (含 list_time / warrnt_stock_owner / exch_type / no_search 等所有字段, 是权威数据)。

§

OnDemandBasic

来自 subscribe / GetStaticInfo / GetSecuritySnapshot 的 on-demand CMD 20106 临时补行 — 仅含 stock_id / market / mkt_id / code / name / lot_size / sec_type, 其余字段缺省 (list_time=“”, warrnt_stock_owner=0, exch_type=0, no_search=false)。应当作权威静态数据源。

作 Default: 保守策略 — 历史 caller 漏标 source 时, 当 partial 处理 (is_complete()=false), 后续 stock_list_sync / Bootstrap 自动覆写为权威 来源。这样 cache miss → on-demand fetch → 默认 source = OnDemandBasic 不会被误当 StockListFull 权威数据消费。

§

Bootstrap

SQLite bootstrap reload (启动时从本地数据库恢复)。字段完整度同 StockListFull (因为 SQLite 是上次 full sync 的快照), 但生命期更长 (跨 daemon 重启)。一般 caller 当 StockListFull 处理。

Implementations§

Source§

impl SecurityInfoSource

Source

pub fn is_complete(self) -> bool

是否含完整静态字段 (list_time / warrnt_stock_owner / exch_type / no_search 等)。OnDemandBasic 缺这些, 其他 source 都齐。

Trait Implementations§

Source§

impl Clone for SecurityInfoSource

Source§

fn clone(&self) -> SecurityInfoSource

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 SecurityInfoSource

Source§

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

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

impl Default for SecurityInfoSource

Source§

fn default() -> SecurityInfoSource

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SecurityInfoSource

Source§

fn eq(&self, other: &SecurityInfoSource) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SecurityInfoSource

Source§

impl Eq for SecurityInfoSource

Source§

impl StructuralPartialEq for SecurityInfoSource

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.

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<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