X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/422be212d60fe053ed9bcb14aad6d1059b3a2906..487dfaa43e0370e63157dc302d55543cff2949cf:/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index 6d22c98..495b9e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ use std::{ ops::Sub, }; -use nix::errno::Errno; +mod error; #[cfg_attr(windows, path = "list_win.rs")] #[cfg_attr(unix, path = "list_unix.rs")] @@ -20,6 +20,8 @@ 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 { @@ -73,18 +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 { - CreateSocket(Errno), - Bind(Errno), - CreatePipe(Errno), - Getifaddrs(Errno), - GetInterfaceName(Errno), - FormatMacAddress, - Internal, -} - #[derive(Default, PartialEq, Eq)] struct List(HashMap);