]> code.octet-stream.net Git - netwatcher/blob - examples/watch.rs
Make watching work on Linux
[netwatcher] / examples / watch.rs
1 use std::time::Duration;
2
3 fn main() {
4 let _handle = netwatcher::watch_interfaces(|update| {
5 println!("Interface update!");
6 println!("State: {:?}", update.interfaces);
7 println!("Diff: {:?}", update.diff);
8 });
9
10 loop {
11 std::thread::sleep(Duration::from_secs(60));
12 }
13 }