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
handlerInternal — 当前无 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 位卡号、白名单和可见 卡号匹配语义。 账户定位纯规则。
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 共享)
handler
Internal API — 连接事件回调 trait,当前无任何 implementor。保留占位以便 未来需要 SDK 抽象时直接使用。
log
Stable API — 日志初始化入口(stderr fmt / JSON / audit-jsonl 三种模式)。 futu-opend / futu-mcp / examples 用。
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_stock_key
Stable (v1.4.110) — QOT broker-aware stock/security key.