pub struct ReconnectingClient { /* private fields */ }Expand description
带自动重连的客户端包装
Implementations§
Source§impl ReconnectingClient
impl ReconnectingClient
pub fn new(config: ClientConfig) -> Self
pub fn with_policy(self, policy: ReconnectPolicy) -> Self
Sourcepub fn with_init_ai_type(self, ai_type: Option<i32>) -> Self
pub fn with_init_ai_type(self, ai_type: Option<i32>) -> Self
Set C++ 10.7 InitConnect.C2S.aiType on each reconnect attempt.
None preserves the legacy wire shape. C++ treats an absent value as
0 (non-AI); Some(1) marks a skills/AI caller.
Sourcepub async fn connect(
&mut self,
) -> Result<(FutuClient, PushReceiver, InitConnectInfo)>
pub async fn connect( &mut self, ) -> Result<(FutuClient, PushReceiver, InitConnectInfo)>
带重连的连接循环
返回成功连接的 (FutuClient, push_rx, InitConnectInfo)。 如果达到最大重试次数则返回错误。
Auto Trait Implementations§
impl Freeze for ReconnectingClient
impl RefUnwindSafe for ReconnectingClient
impl Send for ReconnectingClient
impl Sync for ReconnectingClient
impl Unpin for ReconnectingClient
impl UnsafeUnpin for ReconnectingClient
impl UnwindSafe for ReconnectingClient
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