pub struct FutuClient { /* private fields */ }Expand description
FutuOpenD 高层客户端
功能:
- InitConnect 握手
- 自动心跳 KeepAlive
- 请求-响应匹配(serial number)
- 推送消息分发
- 断线重连
Implementations§
Source§impl FutuClient
impl FutuClient
Sourcepub fn new(config: ClientConfig) -> (Self, UnboundedReceiver<PushMessage>)
pub fn new(config: ClientConfig) -> (Self, UnboundedReceiver<PushMessage>)
创建客户端(未连接状态)
返回 (client, push_rx),其中 push_rx 用于接收服务端推送。
Sourcepub async fn connect(&mut self) -> Result<InitConnectInfo>
pub async fn connect(&mut self) -> Result<InitConnectInfo>
连接到 OpenD 网关并完成 InitConnect 握手
Auto Trait Implementations§
impl !Freeze for FutuClient
impl !RefUnwindSafe for FutuClient
impl Send for FutuClient
impl Sync for FutuClient
impl Unpin for FutuClient
impl !UnwindSafe for FutuClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more