ops::Sub,
};
-use nix::errno::Errno;
+mod error;
#[cfg_attr(windows, path = "list_win.rs")]
#[cfg_attr(unix, path = "list_unix.rs")]
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 {
pub addrs_removed: Vec<IpAddr>,
}
-/// 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<IfIndex, Interface>);