Skip to main content

Crate futu_core

Crate futu_core 

Source
Expand description

futu-core — 共享类型 / 错误 / 协议 ID / 日志

§模块稳定性分层(v1.4.89 API audit)

Module稳定性跨 crate 消费者
errorStablefutu-codec / futu-net / futu-qot / futu-trd / futu-gateway / futu-rest / futu-backend / futu-server
proto_idStable同上 + futu-opend tests
logStablefutu-opend 主程序 / examples / futu-mcp
marketStablefutu-gateway handlers / bridge
exch_typeStable (v1.4.93)futu-gateway / futu-rest / futucli / futu-mcp / futu-qot
account_locatorStable (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 / freshness contracts 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 — ExchType enum → exchange code 字符串(v1.4.93 跨 crate 共享)。 REST adapter / futucli / MCP / qot SDK 用. 对齐 proto/Qot_Common.proto::ExchType. ExchType enum → 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.CODE symbol 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 TradeDateMarket enum and legacy aliases. QOT trading-days TradeDateMarket contract.
server_time
Internal shared API — C++ FTLogin server-time anchor and delay calibration. C++ FTLogin server-time anchoring and ProtoDelay calibration 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_Common enums shared by trade surfaces.
trade_security
Stable API — trade-side security code shape and sec-market derivation. Used by futu-trd and 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.