Expand description
futu-core — 共享类型 / 错误 / 协议 ID / 日志
§模块稳定性分层(v1.4.89 API audit)
| Module | 稳定性 | 跨 crate 消费者 |
|---|---|---|
error | Stable | futu-codec / futu-net / futu-qot / futu-trd / futu-gateway / futu-rest / futu-backend / futu-server |
proto_id | Stable | 同上 + futu-opend tests |
log | Stable | futu-opend 主程序 / examples / futu-mcp |
market | Stable | futu-gateway handlers / bridge |
exch_type | Stable (v1.4.93) | futu-gateway / futu-rest / futucli / futu-mcp / futu-qot |
account_locator | Stable (v1.4.109) | futu-cache / futu-trd / futu-rest / futu-mcp / futucli |
[handler] | Internal — 当前无 implementor,保留占位 | — |
§稳定性约定
- Stable:外部二进制(例如 futu-opend / futu-mcp)和 examples 可依赖。 修改(签名 / 枚举变体 / 字段)走 SemVer breaking 流程。
- Internal:模块内
pub但不承诺稳定,下版可能调整签名或 gate 为pub(crate)。新外部调用方请 consult maintainer。
Modules§
- account_
locator - Stable API — 账户定位纯规则(acc_id / card_num / uni_card_num)。 Surface 只能调用这些规则,不应各自手写 4 位卡号、16 位卡号、白名单和可见 卡号匹配语义。 账户定位纯规则。
- audit_
log_ writer - Internal shared API — secure audit JSONL writer used by in-repo crates.
- broker_
discovery - Internal shared API — CMD9419/CMD20176 broker-discovery ret-code policy. Internal shared API — broker-discovery backend ret-code policy.
- conn_ip
- Internal shared API — ConnIP backend result-code policy used by platform and broker UpdateConnIp responses. Internal shared API — C++-aligned ConnIP result policy and address catalog.
- delay_
stats - Internal shared API — C++
INNData_ProtoDelay-style local delay statistics. - diagnostic
- Stable API — operator-facing capability/readiness diagnostic decision rows.
Used by quote-rights, static-status, doctor, and future diagnostics to keep
reason/action/source/freshnesscontracts consistent. Shared diagnostic decision rows for operator-facing readiness/capability reports. - diagnostic_
text - Stable API — user-facing diagnostic hint text with machine-readable keys. Used by CLI / REST / MCP / gateway surfaces so action hints do not drift. Stable user-facing diagnostic text keys and shared hint builders.
- error
- Stable API — 统一错误类型与
Result<T>别名,跨 10+ crate 消费。 - exch_
type - Stable API —
ExchTypeenum → exchange code 字符串(v1.4.93 跨 crate 共享)。 REST adapter / futucli / MCP / qot SDK 用. 对齐proto/Qot_Common.proto::ExchType.ExchTypeenum → exchange code string(跨 crate 共享) - heartbeat
- http_
client - Internal shared API — reqwest 0.13 Rustls builder with the repository’s curated Mozilla webpki trust contract instead of platform/user roots. Shared reqwest builder that preserves the repository’s curated webpki trust policy.
- localization
- Stable API — C++ language-pack compatible text lookup.
- log
- Stable API — 日志初始化入口(stderr fmt / JSON / audit-jsonl 三种模式)。 futu-opend / futu-mcp / examples 用。
- log_
redact - Stable API — log-safe labels for connection endpoints and other local diagnostics that should be correlated without exposing raw backend hosts.
- market
- Stable API — 市场 enum 与时区 dispatch(v1.4.69 跨 crate 共享)。 futu-gateway handlers / bridge / qot util 用。 市场 enum 与时区 dispatch(v1.4.69 跨 crate 共享)
- proto_
id - Stable API — FutuOpenD API 协议 ID 常量(对齐 C++
FTAPI_Define_ProtoID.h)。 所有 network / handler / test 代码用。 FutuOpenD API 协议 ID 常量 - qot_
endpoint_ market - Stable API — QOT StockFilter/IPO endpoint-local market buckets. Endpoint-local QOT market subsets shared by StockFilter and IPO endpoints.
- qot_
page_ bounds - Stable API — pure QOT pagination and max-count validation rules. Pure QOT pagination and max-count validation rules.
- qot_
plate_ market - Stable API — QOT PlateSet endpoint-local market buckets. Endpoint-local QOT market subset shared by PlateSet public surfaces.
- qot_
price_ reminder - Stable API — QOT price-reminder endpoint-local market buckets. Endpoint-local market subset for QOT price reminders.
- qot_
quote_ rights - Stable API — QOT quote-rights diagnostic DTOs and profile projection. 用户行情权限 profile。
- qot_
right_ gate - Stable API — QOT read/subscribe permission gate contract shared by SDK and surfaces. Pure QOT subscription and read permission decisions.
- qot_
stock_ key - Stable (v1.4.110) — QOT broker-aware stock/security key.
- qot_
subscription - Stable API — QOT subscription public constants and backend route DTOs.
- qot_
subscription_ options - Stable API — QOT subscribe/session option normalization shared by SDK and surfaces.
- qot_
symbol - Stable API — pure QOT MARKET.CODE symbol parsing and formatting rules.
Pure QOT
MARKET.CODEsymbol parsing and formatting rules. - qot_
symbol_ list - Stable API — proto-free QOT list input validation and stock-id resolution rules. Proto-free QOT list input validation and stock-id resolution contract.
- qot_
trade_ date_ market - Stable API — QOT trading-days
TradeDateMarketenum and legacy aliases. QOT trading-daysTradeDateMarketcontract. - server_
time - Internal shared API — C++ FTLogin server-time anchor and delay calibration.
C++ FTLogin server-time anchoring and
ProtoDelaycalibration rules. - trade_
broker - Stable API — trade-side broker identity mapping shared by routing and combo-order adapters. Trade-side broker identity tables shared by domain, gateway, and surfaces.
- trade_
currency - Stable API — trade-side currency labels and shared user-facing diagnostics. Trade-side currency labels and shared user-facing funds diagnostics.
- trade_
market - Stable API — trade-side market id namespace wrappers.
Used by
futu-trd, trade domain crates, and gateway adapters to avoid raw/canonical fund-market drift. Trade-side market id namespaces shared across domain, SDK, and gateway crates. - trade_
parsing - Stable API — trade-side user-facing raw enum parsers.
User-facing raw parsers for
Trd_Commonenums shared by trade surfaces. - trade_
security - Stable API — trade-side security code shape and sec-market derivation.
Used by
futu-trdand trade-write domain without introducing reverse runtime/domain dependencies. Trade-side security code shape and market derivation helpers. - update_
check - Shared Rust product version-manifest decision and fetch runtime.
Constants§
- INTERNAL_
UI_ CLIENT_ ID - C++ internal UI transport identity used only to reach the pre-login Verification flow without waiting for ordinary InitConnect completion.