64 stable releases

2.1.6 Nov 25, 2024
2.1.3 Oct 30, 2024
2.0.2 Jun 22, 2024
1.9.2 Feb 22, 2024
0.5.0 Nov 30, 2023

#196 in Operating systems

Download history 228/week @ 2024-08-12 293/week @ 2024-08-19 9/week @ 2024-08-26 140/week @ 2024-09-02 72/week @ 2024-09-16 469/week @ 2024-09-23 34/week @ 2024-09-30 295/week @ 2024-10-07 178/week @ 2024-10-14 7/week @ 2024-10-21 126/week @ 2024-10-28 47/week @ 2024-11-04 157/week @ 2024-11-18 294/week @ 2024-11-25

503 downloads per month

MIT license

12KB
256 lines

This library is a work in progress

A simple Rust crate for host discovery

Basic Usage

use host_discovery::{OSProfile, gpu};

fn main() {
    // linux example
    //let profile = OSProfile::new().distro().build();
    
    // and/or
    //let profile = OSProfile::new().is_wsl().build();
    let profile = OSProfile::new().win_edition().build();
    let arch = profile.arch;
    let os = profile.os;
    let edition = profile.win_edition;
    let gpu = gpu().expect("Unreachable");

    println!(
        " Architecture: {}\n OS: {}\n Edition: {}\n GPU: {}", 
        arch,
        os,
        edition.unwrap(),
        gpu,
    )
}

V3 Roadmap

  • Migrate from raw_cpuid to custom solution to support more CPU architectures.

Current Features

  • OS
  • Architecture
  • Hostname
  • Windows Edition
  • WSL Detection
  • Linux Distro
  • GPU Enumeration
  • CPU Detection (x86_64, aarch64 - macOS Only)

Dependencies

~4–34MB
~532K SLoC