host_discovery

Crates.iohost_discovery
lib.rshost_discovery
version2.1.9
created_at2023-11-24 20:22:23.604862+00
updated_at2025-03-23 17:56:41.205165+00
descriptionA simple Rust crate for host discovery
homepage
repositoryhttps://github.com/chrispaig3/host_discovery
max_upload_size
id1047621
size43,593
Chris Paige (chrispaig3)

documentation

https://docs.rs/host_discovery

README

This repository is no longer maintained.

This crate might be a better choice: Whoami

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)
Commit count: 262

cargo fmt