X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/fd5b83a034dd0cc1751ddbfe1df813fdf798b8b1..91bdce994d6788c2c9a6b0488fd443615b1bcbe3:/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index 08a0a36..495b9e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,17 +4,24 @@ use std::{ ops::Sub, }; +mod error; + #[cfg_attr(windows, path = "list_win.rs")] #[cfg_attr(unix, path = "list_unix.rs")] mod list; #[cfg_attr(windows, path = "watch_win.rs")] #[cfg_attr(target_vendor = "apple", path = "watch_mac.rs")] -#[cfg_attr(any(target_os = "linux", target_os = "android"), path = "watch_linux.rs")] +#[cfg_attr( + any(target_os = "linux", target_os = "android"), + path = "watch_linux.rs" +)] mod watch; type IfIndex = u32; +pub use error::Error; + /// Information about one network interface at a point in time. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Interface { @@ -68,13 +75,6 @@ pub struct InterfaceDiff { pub addrs_removed: Vec, } -/// Errors in netwatcher or in one of the underlying platform integratinos. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum Error { - // TODO: handle all cases with proper sources - Internal, -} - #[derive(Default, PartialEq, Eq)] struct List(HashMap);