open-net 0.3.2

A cross-platform async networking library with WebSocket clients and network status monitoring.
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,
        }
    }
}