66 stable releases

2.1.8 Jan 15, 2025
2.1.7 Dec 28, 2024
2.1.6 Nov 25, 2024
2.0.2 Jun 22, 2024
0.5.0 Nov 30, 2023

#569 in Operating systems

Download history 17/week @ 2024-10-20 122/week @ 2024-10-27 50/week @ 2024-11-03 2/week @ 2024-11-10 151/week @ 2024-11-17 287/week @ 2024-11-24 13/week @ 2024-12-01 43/week @ 2024-12-08 1/week @ 2024-12-15 77/week @ 2024-12-22 39/week @ 2024-12-29 4/week @ 2025-01-05 98/week @ 2025-01-12 18/week @ 2025-01-19 1/week @ 2025-02-02

117 downloads per month

MIT license

14KB
267 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–38MB
~500K SLoC