net-route 0.4.6

This crate provides a cross-platform interface for manipulating the routing table
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use futures::StreamExt;
use net_route::Handle;

#[tokio::main]
async fn main() -> std::io::Result<()> {
    let handle = Handle::new()?;
    let stream = handle.route_listen_stream();

    futures::pin_mut!(stream);

    println!("Listening for route events, press Ctrl+C to cancel...");
    while let Some(value) = stream.next().await {
        println!("{:?}", value);
    }
    Ok(())
}