X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/473c9605820f4531f9d40823338fa4bf8718dd6f..487dfaa43e0370e63157dc302d55543cff2949cf:/src/lib.rs?ds=sidebyside 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);