1pub mod account;
16pub mod currency;
17pub mod market;
18pub mod misc;
19pub mod order;
20pub mod projection;
21pub mod push;
22pub mod query;
23pub mod read_plan;
24pub mod types;
25
26#[inline]
37pub(crate) fn server_err(
38 ret_type: i32,
39 ret_msg: Option<String>,
40 err_code: Option<i32>,
41) -> futu_core::error::FutuError {
42 let raw = ret_msg.unwrap_or_default();
43 let err_code_label = match err_code {
44 Some(code) => code.to_string(),
45 None => "none".to_string(),
46 };
47 let msg = if raw.is_empty() {
48 format!("[err_code={err_code_label}]")
49 } else {
50 format!("[err_code={err_code_label}] {raw}")
51 };
52 futu_core::error::FutuError::ServerError { ret_type, msg }
53}
54
55pub use account::{
57 TrdAcc, get_acc_list, get_funds, get_position_list, get_position_list_with_filter_market,
58 unlock_trade,
59};
60pub use misc::{
61 HistoryFilterConditions, MaxTrdQtysParams, get_history_order_fill_list, get_history_order_list,
62 get_max_trd_qtys, reconfirm_order, sub_acc_push,
63};
64pub use order::{cancel_order, modify_order, place_order};
65pub use push::{TradeHandler, TradePushDispatcher, TrdNotifyInfo};
66pub use query::{Order, OrderFill, get_order_fill_list, get_order_list};
67pub use types::{
68 Funds, ModifyOrderOp, ModifyOrderParams, OrderType, PlaceOrderParams, PlaceOrderResult,
69 Position, TrdEnv, TrdHeader, TrdMarket, TrdSide,
70};
71
72#[cfg(test)]
73mod server_err_tests;