host_discovery

Crates.iohost_discovery
lib.rshost_discovery
version2.1.6
sourcesrc
created_at2023-11-24 20:22:23.604862
updated_at2024-11-25 19:35:50.187849
descriptionA simple Rust crate for host discovery
homepage
repositoryhttps://github.com/chrispaig3/host_discovery
max_upload_size
id1047621
size12,522
Chris Paige (chrispaig3)

documentation

https://docs.rs/host_discovery

README

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

cargo fmt