Crate sysutil

source ·
Expand description

Linux system information library

This library is ment to be used only in linux systems. It is possible to write code using it on other systems, but it will not allow to run the code, panicking before execution

§Installation

Run the following command in your terminal

cargo add sysutil

§Importation

Add in your code:

use sysutil;

GPU's related functions have been tested only on AMD Radeon 7000 series, any other GPU model is not "officially supported"

Structs§

  • Holds information about backlight
  • Contains capacity and current status of battery
  • Contains information relative to the installed bios
  • Bytes size data structure implementing methods to convert in various size orders The methods allow the convertion in the various size orders, both in base 1000 and base 1024
  • Encloses all CPU-related data available in the library
  • Contains currently active clock source and the available ones
  • Contains cpu frequencies, both average and processor wise
  • Contains base information relative to the CPU
  • Contains the average CPU usage and the discrete usage for each processor
  • Frequency data structure implements direct conversion for frequencies in various size orders
  • Encloses gpu metrics parameters
  • Contains information relative to the motherboard and the installed bios
  • Contains total download and upload newtwork rate (in bytes)
  • Represents a network route and its type, containing local address+port and remote address+port
  • Contains NVME device information
  • Contains processor id and its frequency
  • Encloses the different parameters relative to processor usage
  • Contains total ram size, both in GB (1000^3 bytes) and GiB (1024^3 bytes)
  • Contains scheduler information relative to a processor in the system
  • Contains information relative to a storage device in the system
  • Encloses device name, size and startpoint relative to a partition
  • Contains temperature sensor’s name and recorded temperature
  • Contains total gpu’s vram size, both in GB (1000^3 bytes) and GiB (1024^3 bytes)

Enums§

Functions§

  • Returns battery current status and capacity as specified in Battery struct, returns None if it’s not possible to retrieve data
  • Returns information about the currently installed BIOS
  • Returns the currently active clock source and the different ones available, enclosed in ClockSource struct
  • Returns cpu frequency, both average and processor wise
  • Returns CPU base information, enclosed in the CpuInfo data structure
  • Returns CPU usage, both average and processor-wise, each value is in percentage
  • Returns the current backlight brightness and the maximum possible value or None if it’s not possible to retrieve data
  • Returns metrics parameters from the amdgpu driver
  • returns current GPU usage in percentage, returns None if it’s not possible to retrieve data
  • Returns information about the motherboard
  • Returns current network rate (downlaod and upload), expressed in bytes
  • Returns a list of each internal network route
  • Returns a vector containing all NVME devices found in the system
  • Returns RAM size using the RamSize data structure
  • Returns current RAM usage in percentage
  • Returns scheduler information for each processor
  • Returns a vector containing all storage devices (NVME excluded) in the system
  • Returns every temperature sensor in the system, using the TemperatureSensor struct
  • Returns gpu’s vram size as specified in VramSize struct, returns None if it’s not possible to retrieve data
  • Returns gpu’s vram usage in percentage, returns None if it’s not possible to retrieve data