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
14
15
16
17
18
use super::network_status_snapshot::NetworkStatusPublisher;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;

// Private per-generation identity. Observable values live exclusively in NetworkStatusSource.
pub(crate) struct MonitorState {
    pub(crate) active: Arc<AtomicBool>,
    pub(super) observation: Option<NetworkStatusPublisher>,
}

impl Default for MonitorState {
    fn default() -> Self {
        Self {
            active: Arc::new(AtomicBool::new(true)),
            observation: None,
        }
    }
}