host_discovery 0.1.5

A simple crate for host discovery
Documentation
host_discovery-0.1.5 has been yanked.

A simple rust crate for host discovery

On Crates.io

Todo

  • Add support for WSL detection (is enabled or not)
  • Add support for windows edition detection

Basic Usage

  • Add to your project
cargo add host_discovery

use host_discovery;

fn main() {
    // `detect_os()` Returns a variant of the OperatingSystem enum
    println!("OS: {}", detect_os().to_string()); 
    // `detect_distro()` Reads & returns the name of the Linux distro as a String from /etc/os-release
    println!("Distro: {}", detect_distro()); 
    // `get_public_ip()` Retrieves the host's public IP address
    println!("Public IP: {}", get_public_ip());
}