pub struct LarkWsClient;Expand description
飞书 WebSocket 客户端入口。
连接建立后由内部单一 session loop 拥有:I/O、心跳、控制帧、分包、事件调度与写回。
Implementations§
Source§impl LarkWsClient
impl LarkWsClient
Sourcepub async fn open(
config: Arc<Config>,
event_handler: EventDispatcherHandler,
) -> Result<(), WsClientError>
pub async fn open( config: Arc<Config>, event_handler: EventDispatcherHandler, ) -> Result<(), WsClientError>
建立 WebSocket 长连接并运行完整会话,直到关闭或错误。
§返回
生产路径在会话终止时几乎总是 Err:
Err(WsClientError::ConnectionClosed { reason }):对端 Close(含正常关闭 code)或入站空闲超时;正常断开也是Err,调用方请匹配此变体- 其它
Err:端点查询、传输、malformed 控制帧、未知 frame method、 非法会话状态等
入站空闲超时仅在收到 WebSocket 层 Ping 时刷新(与历史行为一致)。
Auto Trait Implementations§
impl Freeze for LarkWsClient
impl RefUnwindSafe for LarkWsClient
impl Send for LarkWsClient
impl Sync for LarkWsClient
impl Unpin for LarkWsClient
impl UnsafeUnpin for LarkWsClient
impl UnwindSafe for LarkWsClient
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