pub fn local_ip() -> Result<IpAddr, Error> {
    let ifas = find_af_inet()?;

    #[cfg(target_os = "macos")]
    const DEFAULT_IF_NAME: &str = "en0";

    #[cfg(target_os = "linux")]
    const DEFAULT_IF_NAME: &str = "wlp2s0";

    #[cfg(target_os = "windows")]
    const DEFAULT_IF_NAME: &str = "Ethernet";

    if let Some((_, ipaddr)) = find_ifa(ifas, DEFAULT_IF_NAME) {
        return Ok(ipaddr);
    }

    Err(Error::PlatformNotSupported(env::consts::OS.to_string()))
}
/// Retrieves the local ip address for the current operative system

Retrieves the local ip address for the current operative system
Retrieves the local ip address for the current operative system
pub fn local_ip() -> Result<IpAddr, Error> {
    let ifas = find_af_inet()?;
    #[cfg(target_os = "macos")]
    const DEFAULT_IF_NAME: &str = "en0";
    #[cfg(target_os = "linux")]
    const DEFAULT_IF_NAME: &str = "wlp2s0";
    #[cfg(target_os = "windows")]
    const DEFAULT_IF_NAME: &str = "Ethernet";
    if let Some((_, ipaddr)) = find_ifa(ifas, DEFAULT_IF_NAME) {
        return Ok(ipaddr);
    }
    Err(Error::PlatformNotSupported(env::consts::OS.to_string()))
}
pub fn local_ip ( ) -> Result < IpAddr , Error > { let ifas = find_af_inet ( ) ? ; # [ cfg ( target_os " " ) ] const DEFAULT_IF_NAME : & str = " " ; # [ cfg ( target_os " " ) ] const DEFAULT_IF_NAME : & str = " " ; # [ cfg ( target_os " " ) ] const DEFAULT_IF_NAME : & str = " " ; if let Some ( ( _ , ipaddr ) ) = find_ifa ( ifas , DEFAULT_IF_NAME ) { return Ok ( ipaddr ) ; } Err ( Error :: PlatformNotSupported ( env :: consts :: OS . to_string ( ) ) ) }
Retrieves the local ip address for the current operative system
Retrieves the local ip address for the current operative system