pub struct SystemInfo {
pub cpu_model: String,
pub cpu_count: u32,
pub ram_total: String,
pub ram_free: String,
pub ram_available: String,
pub disk_total: String,
pub disk_free: String,
pub disk_used_percent: String,
pub uptime: String,
pub uptime_seconds: u64,
pub load_average: String,
}Expand description
Basic system information — direct /proc reads only.
No shell commands are used for data available in /proc. Disk
information (df) is the only exception because Linux provides
no per-mount usage summary in /proc.
Fields§
§cpu_model: StringCPU model string from /proc/cpuinfo model name field.
cpu_count: u32Logical CPU core count from /proc/cpuinfo (counts processor entries).
ram_total: StringTotal RAM in human-readable form (e.g. "32Gi") from /proc/meminfo
MemTotal (kB → human).
ram_free: StringFree RAM in human-readable form (e.g. "750Mi") from /proc/meminfo
MemFree (kB → human).
ram_available: StringAvailable RAM in human-readable form (e.g. "22Gi") from /proc/meminfo
MemAvailable (kB → human). This is the memory usable for new
allocations without swapping — more useful than ram_free for
capacity planning.
disk_total: StringTotal disk space in human-readable form (e.g. "100G") from df -h /.
disk_free: StringFree disk space in human-readable form from df -h /.
disk_used_percent: StringDisk usage percentage as a string without % sign (e.g. "45").
uptime: StringHuman-readable uptime (e.g. "up 6 days, 3 hours") computed from
/proc/uptime.
uptime_seconds: u64Machine-parseable uptime in seconds from /proc/uptime first field.
load_average: StringLoad average string (e.g. "0.50, 0.30, 0.20") from /proc/loadavg
first three fields.
Trait Implementations§
Source§impl Clone for SystemInfo
impl Clone for SystemInfo
Source§fn clone(&self) -> SystemInfo
fn clone(&self) -> SystemInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more