net-kit 0.1.0

Cross-platform network reachability monitoring with a single Net facade and Tokio runtime support.
Documentation
1
2
3
4
5
6
7
8
9
10
use tokio::sync::{oneshot, watch};

/// Runtime handle for the monitor task created by a single `start` call.
pub(crate) struct MonitorRuntime {
    /// Used to signal the monitor task to stop.
    pub(crate) stop_sender: oneshot::Sender<()>,
    /// Set once the monitor task has obtained its initial state; `start` waits
    /// for this to become ready before returning.
    pub(crate) initial_state: watch::Receiver<bool>,
}