open-net 0.3.5

A cross-platform async networking library for Rust with HTTP and WebSocket clients, network status monitoring, configurable retries, WebSocket reconnection and heartbeats, and managed client lifecycles. Reuse common networking infrastructure across applications to avoid repeated implementation and debugging, helping save development time and AI coding tokens.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::module::ws_client::connection_session::ConnectionSession;
use crate::module::ws_client::session_runtime::SessionRuntime;
use crate::ws::ConnectOptions;
use std::sync::Arc;

/// 固定身份和配置的连接会话;自动重连复用它,终态后移除。
#[derive(Clone)]
pub(super) struct ConnectTarget {
    pub(super) options: ConnectOptions,
    pub(super) initial_connect_deadline: Option<tokio::time::Instant>,
    pub(super) session: Arc<ConnectionSession>,
    pub(super) runtime: Arc<SessionRuntime>,
}