]> code.octet-stream.net Git - netwatcher/blob - examples/watch.rs
4129dc668a520d3512698af9306eb83f475cbb37
[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 }