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