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 |
|
#177 in Operating systems
163 downloads per month
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