1 unstable release
0.1.0 | Oct 8, 2024 |
---|
#602 in Hardware support
212 downloads per month
49KB
1K
SLoC
dmisys
維護者
- neko_0xff(@neko0xff)
想法
主要是想把一些Linux上的系統配置用Rust讀出來,且試著包成函式庫供以其它程式方便進行呼叫!
支援平台
- Linux
功能
如下是自己己實作出的功能!
- 調用系統的一些參數規格(ex: RAM&Disk的使用情況 )
- HTTP請求(ex: 對外的公開IP)
- 單位轉換
文件
授權
本倉庫採用GPL-3.0 license進行授權
lib.rs
:
This is a specialized library designed to output the hardware configuration required by the system, as well as various status information of the current device.
Specifically, it can provide crucial metrics such as network upload and download speeds, local IP address, and public IP address. This information is essential for monitoring system performance, troubleshooting issues, and optimizing the network environment.
Example: CPU Information
This example shows how to output CPU hardware space.
use dmisys::*;
fn main() {
println!("CPU Model: {:?}", cpu::read_cpu_model());
println!("CPU Frequency: {:.2} GHz", cpu::get_cpu_frequency());
println!("CPU Core: {:?}", cpu::read_cpu_cores());
println!("CPU Threads: {:?}", cpu::read_cpu_threads());
println!("CPU Arch: {}", cpu::read_cpu_arch());
println!("CPU Load Avg: {}%", cpu::get_cpu_loading().to_string());
}
Example: GPU Device List
This example shows how to output Installed GPU Devices List
use dmisys::*;
pub fn output_msg() {
let gpus = device::read_device_gpu();
if gpus.is_empty() {
println!("No GPUs found");
} else {
for (index, gpu) in gpus.iter().enumerate() {
let count = index+1;
println!("GPU {}: {}", count, gpu);
}
}
}
Dependencies
~14–23MB
~374K SLoC