use std::process::Command;
fn fetch() -> HysSysInfo {
let mut target_os = HysOSType::UNKNOWN;
if cfg!(target_os = "windows") {
target_os = HysOSType::WINDOWS;
}
if cfg!(target_os = "linux") {
target_os = HysOSType::LINUX;
}
if cfg!(target_os = "macos") {
target_os = HysOSType::MACOS;
}
let os = HysOSInfo::fetch();
todo!()
}
impl HysOSInfo {
pub fn fetch() -> HysOSInfo {
todo!()
}
}
enum HysOSType {
WINDOWS,
MACOS,
LINUX,
UNKNOWN,
}
struct HysSysInfo {
os: HysOSInfo,
cpu: HysCPUInfo,
gpu: HysGPUInfo,
ram: HysMemInfo,
disk: HysDiskInfo,
network: HysNetworkInfo,
}
pub struct HysOSInfo {
name: String,
short_name: String,
version: String,
os_architecture: String,
status: String,
computer_name: String,
uptime: String,
}
pub struct HysCPUInfo {
pub vendor: String,
pub model: String,
pub name: String,
pub frequency: String,
pub architecture: HysCPUArchitecture,
pub cores: String,
pub logical_cores: String,
pub cache_size: CPUCacheSize,
pub virtualization: bool,
}
pub enum HysCPUArchitecture {
X86,
Arm,
X64,
Neutral,
Arm64,
X86OnArm64,
Unknown,
}
pub struct CPUCacheSize {
pub L1: String,
pub L2: String,
pub L3: String,
}
pub struct HysGPUInfo {
index: u8,
vendor: String,
model: String,
memory: u128,
device_id: String,
refresh_rate: HysGPURefreshRate,
display_drivers_location: Vec<String>,
driver_version: String,
video_mode_description: Vec<String>,
status: bool,
}
pub struct HysGPURefreshRate {
min: u32,
max: u32,
}
pub struct HysMemInfo {
index: u8,
vendor: String,
model: String,
serial_number: String,
total_memory: u64,
free_memory: u64,
}
pub struct HysDiskInfo {
index: u8,
vendor: String,
model: String,
serial_number: String,
capacity: u128,
free: u128,
free_percent: f64,
disk_type: HysDiskType,
#[cfg(target_os = "windows")]
disk_mount_char: char,
}
pub enum HysDiskType {
FLOPPY,
CD,
HD,
SSD,
M2,
UNKNOWN,
}
pub struct HysNetworkInfo {
}