net-lattice 0.12.3

A modern, cross-platform Rust library for configuring and inspecting operating system networking through a single, strongly typed API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Consume native change notifications through the optional async facade.

use futures::StreamExt;
use net_lattice::{EventFilter, Lattice, Result};

async fn monitor() -> Result<()> {
    let lattice = Lattice::connect()?;
    let mut events = lattice.watch_async(EventFilter::ALL)?;
    while let Some(event) = events.next().await {
        println!("event: {:?}", event?);
    }
    Ok(())
}

fn main() -> Result<()> {
    futures::executor::block_on(monitor())
}