65 stable releases

2.1.7 Dec 28, 2024
2.1.6 Nov 25, 2024
2.1.3 Oct 30, 2024
2.0.2 Jun 22, 2024
0.5.0 Nov 30, 2023

#177 in Operating systems

Download history 209/week @ 2024-09-18 299/week @ 2024-09-25 18/week @ 2024-10-02 307/week @ 2024-10-09 167/week @ 2024-10-16 3/week @ 2024-10-23 148/week @ 2024-10-30 25/week @ 2024-11-06 118/week @ 2024-11-13 258/week @ 2024-11-20 75/week @ 2024-11-27 21/week @ 2024-12-04 23/week @ 2024-12-11 113/week @ 2024-12-25 6/week @ 2025-01-01

163 downloads per month

MIT license

12KB
255 lines

This library is a work in progress

A simple Rust crate for host discovery

Basic Usage

use host_discovery::{gpu, x86_cpu, OSProfile};

fn main() {
    let profile = OSProfile::new().computer_name().win_edition().build();

    let os = profile.os;
    let arch = profile.arch;
    let win_edition = profile.win_edition.unwrap();
    let computer_name = profile.computer_name.unwrap();
    println!(
        "Profile: [OS: {}, arch: {}, edition: {}, computer name: {}]",
        os, arch, win_edition, computer_name
    );
    println!("GPU: {}", gpu().unwrap());
    println!("CPU: {}", x86_cpu());
}
Console Output:

Profile: [OS: windows, arch: x86_64, edition: Professional, computer name: WORK]
GPU: GraphicsCard { model: "NVIDIA GeForce RTX 3070 Ti", driver_version: "566.36" }
CPU: Processor { model: ProcessorBrandString { as_str: "AMD Ryzen 7 5700X 8-Core Processor" }, cores: 16 }

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–33MB
~494K SLoC