Skip to main content

SystemInfo

Struct SystemInfo 

Source
pub struct SystemInfo {
Show 61 fields pub os: String, pub kernel: Option<String>, pub hostname: Option<String>, pub arch: String, pub cpu: String, pub cpu_cores: usize, pub cpu_core_info: String, pub memory: String, pub swap: String, pub uptime: String, pub processes: usize, pub load_avg: Option<String>, pub disks: Vec<String>, pub temps: Vec<String>, pub networks: Vec<String>, pub boot_time: String, pub battery: Option<String>, pub shell: Option<String>, pub terminal: Option<String>, pub desktop: Option<String>, pub cpu_freq: Option<String>, pub users: usize, pub gpu: Vec<String>, pub packages: Option<usize>, pub current_user: Option<String>, pub local_ip: Option<String>, pub public_ip: Option<String>, pub active_interface: Option<String>, pub motherboard: Option<String>, pub bios: Option<String>, pub displays: Vec<String>, pub audio: Option<String>, pub wifi: Option<String>, pub bluetooth: Option<String>, pub ui_theme: Option<String>, pub icons: Option<String>, pub cursor: Option<String>, pub font: Option<String>, pub terminal_font: Option<String>, pub camera: Vec<String>, pub gamepad: Vec<String>, pub cpu_cache: Option<String>, pub cpu_usage: Option<String>, pub physical_disks: Vec<String>, pub physical_memory: Option<String>, pub init_system: Option<String>, pub chassis: Option<String>, pub locale: Option<String>, pub bootmgr: Option<String>, pub editor: Option<String>, pub weather: Option<String>, pub wm: Option<String>, pub dns: Vec<String>, pub domain: Option<String>, pub domain_search: Vec<String>, pub terminal_size: Option<String>, pub btrfs: Vec<String>, pub zpool: Vec<String>, pub login_manager: Option<String>, pub brightness: Option<String>, pub power_adapter: Option<String>,
}
Expand description

Comprehensive system information data structure.

This struct holds all the metrics collected from the system, ranging from OS details to hardware specs and network status.

Fields§

§os: String

Operating system name and version.

§kernel: Option<String>

Kernel version.

§hostname: Option<String>

System hostname.

§arch: String

CPU architecture (e.g., x86_64).

§cpu: String

CPU model brand string.

§cpu_cores: usize

Total number of logical CPU cores.

§cpu_core_info: String

Formatted core topology string (e.g. “8C / 16T” or “6P + 4E / 16T”).

§memory: String

Formatted memory usage (Used / Total).

§swap: String

Formatted swap usage (Used / Total).

§uptime: String

System uptime formatted as a duration.

§processes: usize

Number of currently running processes.

§load_avg: Option<String>

Load average (1, 5, 15 minutes).

§disks: Vec<String>

List of mounted disks with usage information.

§temps: Vec<String>

Hardware component temperatures.

§networks: Vec<String>

Network interface statistics and status.

§boot_time: String

System boot time in ISO 8601 format.

§battery: Option<String>

Battery status (currently placeholder for future feature).

§shell: Option<String>

Path to the current user’s shell.

§terminal: Option<String>

Name of the terminal emulator in use.

§desktop: Option<String>

Detected desktop environment or window manager.

§cpu_freq: Option<String>

Current CPU frequency (formatted).

§users: usize

Number of interactive users (UID >= 1000).

§gpu: Vec<String>

List of detected GPUs with model names.

§packages: Option<usize>

Total count of installed packages across supported managers.

§current_user: Option<String>

Name of the user running the process.

§local_ip: Option<String>

Primary local IP address.

§public_ip: Option<String>

Public IP address (best effort).

§active_interface: Option<String>

Name of the active/default network interface.

§motherboard: Option<String>

Detected motherboard name and manufacturer.

§bios: Option<String>

Detected BIOS details.

§displays: Vec<String>

List of connected display resolutions and refresh rates.

§audio: Option<String>

Detected active audio driver/server and devices.

§wifi: Option<String>

Connected Wi-Fi SSID and speed.

§bluetooth: Option<String>

Bluetooth power status.

§ui_theme: Option<String>

UI Theme (GTK, Qt, macOS, Windows).

§icons: Option<String>

Icon theme (GTK/Qt).

§cursor: Option<String>

Cursor theme (GTK/Qt).

§font: Option<String>

System Font.

§terminal_font: Option<String>

Terminal Font (configured in terminal emulator).

§camera: Vec<String>

Connected camera/webcam names.

§gamepad: Vec<String>

Connected gamepad/controller names.

§cpu_cache: Option<String>

CPU cache sizes (L1d, L1i, L2, L3).

§cpu_usage: Option<String>

Current CPU utilization as a percentage.

§physical_disks: Vec<String>

Physical disk models, sizes, and types.

§physical_memory: Option<String>

Physical memory (RAM) slot summary — type, speed, capacity.

§init_system: Option<String>

PID 1 / init system (systemd, runit, OpenRC, launchd, etc.).

§chassis: Option<String>

Chassis type (Desktop, Laptop, Server, etc.).

§locale: Option<String>

System locale (from $LANG / $LC_ALL).

§bootmgr: Option<String>

Second-stage bootloader (GRUB, systemd-boot, etc.).

§editor: Option<String>

Default editor ($VISUAL / $EDITOR).

§weather: Option<String>

Current weather from Open-Meteo.

§wm: Option<String>

Active window manager name.

§dns: Vec<String>

Configured DNS nameservers.

§domain: Option<String>

Configured DNS domain name (from domain or first search entry in resolv.conf).

§domain_search: Vec<String>

Per-interface DNS search domain lists (from resolvectl or resolv.conf search).

§terminal_size: Option<String>

Terminal dimensions as “COLSxROWS”.

§btrfs: Vec<String>

Mounted btrfs filesystems with label and space allocation.

§zpool: Vec<String>

Imported ZFS pools with allocation and health status.

§login_manager: Option<String>

Active display/login manager (GDM, SDDM, LightDM, …). Linux only.

§brightness: Option<String>

Current backlight brightness as a percentage. Linux only.

§power_adapter: Option<String>

AC power adapter name and connection state. Linux only.

Implementations§

Source§

impl SystemInfo

Source

pub fn collect(opts: CollectOptions) -> Result<Self>

Collects system information using sysinfo and environment probes.

This method aggregates data from the operating system, hardware, and current user environment into a SystemInfo struct.

Trait Implementations§

Source§

impl Debug for SystemInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.