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 位卡号、白名单和可见 卡号匹配语义。 账户定位纯规则。
- 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 共享) - 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.