use anyhow::Result; use if_watch::{IfEvent, IfWatcher}; use ipnet::IpNet; #[async_std::main] async fn main() -> Result<()> { let mut watcher = IfWatcher::new().await?; loop { let watcher = &mut watcher; match watcher.await? { IfEvent::Down(IpNet::V4(ip)) => { println!("down {ip}"); println!(" { println!("up {ip}"); println!(" { println!("other event {x:?}"); } } } }