Crate sys_info_extended

Source
Expand description

#Introduction This crate focuses on geting system information.

For now it supports Linux, Mac OS X and Windows. And now it can get information of kernel/cpu/memory/disk/load/hostname and so on.

Structs§

DiskInfo
Disk information.
EnvOptions
configurations for working with env’s on windows.
HardSearchOptions
type that includes hard search options for is_program_installed_search_hard() function.
LanguageOptions
LinuxOSReleaseInfo
The os release info of Linux.
LoadAvg
System load average value.
MemInfo
System memory information.
RamInFo
type that includes mghz and ddr type values.
UserConfigurations
Type that includes home directory and shell preference of user.
WindowsGraphicsCard
a type that includes all (probably) informations that windows provide about your graphics card.

Enums§

EnvLevel
Env level implementation for windows.
Error
Error types

Functions§

append_env
append a value currently existing env, only windows.
boottime
Get system boottime
check_computer_type
get the computer type. Only “Notebook” and “Desktop” allowed for linux, checks if a battery is exist that implemented on your computer and if it exists, return “Notebook” value, otherwise “Desktop” value. But the way it work on windows is different, it can return various values since windows has able to give more specific infos about computer types.
cpu_num
Get cpu num quantity.
cpu_speed
Get cpu speed.
disk_info
Get disk information.
get_current_user
get the current user as string. Both works on windows and linux.
get_graphics_info
get the graphic card infos, for windows.
get_home_dir_and_shell
Returns The UserConfigurations struct that includes home dir and shell preference of the user. Only works on linux.
get_language_options
returns the language options for the computer, both works on windows and linux.
get_public_ipv4_address
Get the public ipv4 address as string.
get_ram_infos
returns the RamInfo struct per each ram that attached your computer, that includes the mhz value and ddr type, for only windows.
get_system_env_var
gets value of the env that has given name from the system. only for windows.
get_timezone
it returns the system’s timezone info. In windows, It returning values are incompatible with tz database timezones such as “Turkey Standard Time” instead of “Europe/Istanbul”.
get_user_env_var
gets value of the env that has given name from the user. only for windows.
hostname
Get hostname.
is_program_installed
that function searchs a program on the terminal if it’s exist and / or returns a positive answer to various version arguments. Works on both Windows And Linux.
is_program_installed_search_hard
Since windows has a bunch of api’s that enlists downloaded programs and not all of them reachable via a terminal, that function searchs a program with given name and options on both terminal and various program listing api’s of windows. Warning: It runs too slow. Use it with caution.
linux_os_release
Get the os release note of Linux
loadavg
Get system load average value.
mem_info
Get memory information.
os_release
Get operation system release version.
os_type
Get operation system type.
proc_total
Get current processes quantity.
set_env
set an env variable if it’s not exist before, only windows.