X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/473c9605820f4531f9d40823338fa4bf8718dd6f..91bdce994d6788c2c9a6b0488fd443615b1bcbe3:/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);