inherface 0.4.0

Retrieve a system's Network Interfaces on Linux
Documentation
use std::str::Utf8Error;

/// Errors for this library
#[derive(thiserror::Error, Debug)]
pub enum Error {
    /// An error during libc::getifaddrs
    #[error("Failed to execute `{0}`. Received error code `{1}`")]
    GetIfAddrsError(String, i32),
    /// Error when parsing the interface name to a valid utf8 String
    #[error("Failed to parse bytes into UTF-8 characters. `{0}`")]
    ParseUtf8Error(Utf8Error),
}

impl From<Utf8Error> for Error {
    fn from(error: Utf8Error) -> Self {
        Error::ParseUtf8Error(error)
    }
}

/// Wraps standard library Result with custom Error enum
pub type Result<T> = std::result::Result<T, Error>;