system_data is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install system_data
It will make the system_data command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall system_data uninstalls.
Adding system_data library as a dependency
Run this command in a terminal, in your project's directory:
cargo add system_data
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
system_data = "0.1.1"
The system_data library will be automatically available globally.
Read the system_data library documentation .
Back to the crate overview .
Readme
A package for collect information about OS, CPU and Disk Drive of a windows operating system.
You can collect disk information from any device with just a function call. you will be able to collect the OS Information, CPU Information and Disk Information information of a windows system with this package.
Install Package
cargo add system_data
Add Dependencies
system_data = " 0.1.1"
Modules
Functions
Common Functions
all ( ) you can use it to get all information.
name ( ) to get the name of CPU/DiskDrive.
Specific for CpuInfo module
cores ( ) for collect the cores information of a CPU.
processor_id ( ) for collect the Id of a Processor.
Specific for DiskInfo module
drive_size ( ) for collect the total capacity of disk drive.
drive_model ( ) for collect the model of system disk drive.
drive_serial_number ( ) for collect the serial number of system disk drive.
Example
We are printing here the total capacity information about the disk drive of a windows system.
cargo.toml
[ dependencies ]
system_data = " 0.1.1"
main.rs
use system_data;
fn main ( ) {
let cpu_name = system_data:: CpuInfo:: name( ) ;
println! ( " CPU Name: {} " , cpu_name) ;
}
Open your terminal with the correct path of your project and run cargo run command to get the output.
NOTE: Mac and Linux version will be available soon.
Best Regards.