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
#[cfg(feature = "ws-client")]
use super::client_slot::ClientSlot;
#[cfg(feature = "http-client")]
use super::http_client_slot::HttpClientSlot;
#[cfg(feature = "net-status")]
use super::net_status_clients::NetStatusClientSlot;
use crate::common::CommonEngine;
#[cfg(feature = "ws-client")]
use crate::module::transport::compiled_network_config::CompiledNetworkConfig;
#[cfg(feature = "net-status")]
use std::collections::HashMap;
use std::sync::Arc;
#[cfg(feature = "net-status")]
use std::sync::Mutex;

pub(crate) struct OpenNetInner {
    #[cfg(feature = "quality-doctor")]
    pub(crate) quality: crate::module::quality::QualityOwner,
    pub(super) shutdown: Option<super::engine_shutdown::EngineShutdown>,
    #[cfg(feature = "ws-client")]
    pub(super) network: Arc<CompiledNetworkConfig>,
    #[allow(dead_code)]
    pub(crate) common_engine: Arc<CommonEngine>,
    #[cfg(feature = "net-status")]
    pub(crate) network_status: Arc<crate::module::net_status::inner::shared::SharedNetworkService>,
    #[cfg(feature = "net-status")]
    pub(super) net_status_clients: Arc<Mutex<HashMap<String, NetStatusClientSlot>>>,
    #[cfg(feature = "ws-client")]
    pub(super) clients: Arc<Mutex<HashMap<String, ClientSlot>>>,
    #[cfg(feature = "ws-client")]
    pub(super) clients_changed: Arc<tokio::sync::Notify>,
    #[cfg(feature = "http-client")]
    pub(super) http_clients: Arc<Mutex<HashMap<String, HttpClientSlot>>>,
}