| Crates.io | host_discovery |
| lib.rs | host_discovery |
| version | 2.1.9 |
| created_at | 2023-11-24 20:22:23.604862+00 |
| updated_at | 2025-03-23 17:56:41.205165+00 |
| description | A simple Rust crate for host discovery |
| homepage | |
| repository | https://github.com/chrispaig3/host_discovery |
| max_upload_size | |
| id | 1047621 |
| size | 43,593 |
This crate might be a better choice: Whoami
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 }
Current Features