]> code.octet-stream.net Git - netwatcher/blobdiff - src/watch_mac.rs
Don't include "down" interfaces on Windows
[netwatcher] / src / watch_mac.rs
index 547db4801fd2bd156e9cda7d0a0c7d37195a7650..96e344bb97795bb495afead5c4024bb042b27d66 100644 (file)
@@ -1,10 +1,12 @@
 use crate::Update;\r
 \r
-pub struct WatchHandle;\r
+pub(crate) struct WatchHandle;\r
 \r
-pub fn watch_interfaces<F: FnMut(Update)>(callback: F) -> WatchHandle {\r
+pub(crate) fn watch_interfaces<F: FnMut(Update) + 'static>(\r
+    callback: F,\r
+) -> Result<WatchHandle, Error> {\r
     // stop current worker thread\r
     // post this into a thread that will use it\r
     drop(callback);\r
-    WatchHandle\r
+    Ok(WatchHandle)\r
 }\r