// Copyright (c) TribuFu. All Rights Reserved. use sysinfo::{System, SystemExt}; pub(crate) fn GetSystemInfo() -> System { let mut sys = System::new(); sys.refresh_all(); sys } /// Returns the uptime of the current system. pub fn GetSystemUptime() -> u64 { GetSystemInfo().uptime() } /// Returns the name of the current system. pub fn GetSystemName() -> Option { GetSystemInfo().name() } /// Returns the OS version of the current system. pub fn GetSystemVersion() -> Option { GetSystemInfo().os_version() } /// Returns the OS edition of the current system. pub fn GetSystemEdition() -> Option { GetSystemInfo().long_os_version() } /// Returns the kernel version of the current system. pub fn GetKernelVersion() -> Option { GetSystemInfo().kernel_version() } /// Returns the host name of the current system. pub fn GetHostName() -> Option { GetSystemInfo().host_name() }