Module libmacchina::traits
source · Expand description
This module contains all the traits and types for creating a cross-platform API to query different readouts from various operating systems. For each operating system, there must be an implementation of these traits.
Enums§
- Holds the possible variants for battery status.
- The supported package managers whose packages can be extracted.
- This enum contains possible error types when doing sensor & variable readouts.
- The currently running shell is a program, whose path can be relative, or absolute.
- There are two distinct kinds of shells, a so called “current” shell, i.e. the shell the user is currently using. And a default shell, i.e. that the user sets for themselves using the
chsh
tool.
Traits§
- This trait provides the necessary functions for querying battery statistics from the host computer. A desktop computer might not be able to provide values such as
percentage
andstatus
, which means aReadoutError
can be returned. - This trait provides the interface for implementing functionality used for querying general information about the running operating system and current user.
- This trait is used for implementing common functions for reading kernel properties, such as kernel name and version.
- This trait provides common functions for querying the current memory state of the host device, most notably
total
andused
. All other methods exposed by this trait are there in case you’re intending to calculate memory usage on your own. - This trait provides an interface to various networking statistics about the host system.
- This trait provides an interface to various functions used to count packages on the host system. Almost all modern operating systems use some kind of package manager.
- This trait provides the interface for implementing functionality used for getting product information about the host machine.