Skip to main content

futu_qot/
lib.rs

1//! FutuOpenD 行情业务模块
2//!
3//! 实装"行情侧" 所有业务:订阅 / 快照 / K线 / 摆盘 / 分时 / 成交明细 /
4//! 静态信息 / 经纪队列 / 价格提醒等,对齐 C++ OpenD 的 `NN_ProtoCmd_Qot_*` 全集。
5//!
6//! 主要模块:
7//! - [`sub`] / [`push`] — 订阅管理 + [`QuotePushDispatcher`] 推送分发
8//! - [`basic_qot`] — 基础报价(`BasicQot`)
9//! - [`snapshot`] — 证券快照
10//! - [`kline`] / [`history_kl`] — 当日 K 线 / 历史 K 线
11//! - [`order_book`] / [`order_detail`] / [`ticker`] — 摆盘 / 逐笔 / 成交明细
12//! - [`broker`] — 经纪队列
13//! - [`rt`] — 分时数据
14//! - [`static_info`] — 证券静态信息
15//! - [`market_misc`] — 市场状态 / 股票过滤 / 期权链 / 涨跌 / 调整等
16//! - [`right_gate`] — 行情权限订阅拒绝矩阵的纯决策层
17//! - [`symbol`] — `MARKET.CODE` 用户输入解析与格式化
18//! - [`symbol_list`] — 列表型 input 契约 helper(v1.4.106 codex 0641 整体重构)
19//! - [`subscription_plan`] — 订阅请求到 backend desired options 的纯决策层
20//! - [`types`] — 核心类型([`Security`] / [`KLType`] / [`SubType`] / ...)
21
22pub mod basic_qot;
23pub mod broker;
24pub mod history_kl;
25pub mod ipo_calendar;
26pub mod kline;
27pub mod market_misc;
28pub mod order_book;
29pub mod order_detail;
30pub mod page_bounds;
31pub mod push;
32pub mod quote_rights;
33pub mod right_gate;
34pub mod rt;
35pub mod snapshot;
36pub mod static_info;
37pub mod sub;
38pub mod subscription_plan;
39pub mod symbol;
40pub mod symbol_list;
41pub mod ticker;
42pub mod types;
43
44#[inline]
45pub(crate) fn server_err(ret_type: i32, ret_msg: Option<String>) -> futu_core::error::FutuError {
46    let msg = match ret_msg {
47        Some(msg) if !msg.is_empty() => msg,
48        _ => "<missing ret_msg>".to_string(),
49    };
50    futu_core::error::FutuError::ServerError { ret_type, msg }
51}
52
53// Re-export 常用类型
54pub use page_bounds::{
55    PageBounds, PageBoundsError, PageBoundsErrorReason, validate_begin_num,
56    validate_optional_max_count,
57};
58pub use push::{QuoteHandler, QuotePushDispatcher};
59pub use types::{BasicQot, KLType, KLine, OrderBookData, QotMarket, RehabType, Security, SubType};
60
61#[cfg(test)]
62mod tests;