libmedium
A safe rust library to communicate with the sysfs interface of lm-sensors.
Usage
Just add this to your Cargo.toml
file:
[dependencies]
libmedium = "0.2"
Cargo-Features
Standard features
writable
: Standard feature that enables all functions that write to sysfs. This includes setting pwm values or disabling sensors.
Non standard features
measurements_units
: Sensor values are returned in types from themeasurements
crate.unrestricted_parsing
: This feature allows parsing of paths other than '/sys/class/hwmon'. This should only be useful for testing and debugging.
Examples
- Print the temperature of all the temp sensors in your system:
use ;
let hwmons = parse_read_only.unwrap;
for in &hwmons
- Set the pwm value of all your pwm capable fans to full speed (this requires the
writable
feature to not be disabled):
use ;
let hwmons = parse_read_write.unwrap;
for in &hwmons
License
This project is licensed under the MIT License - see the LICENSE.md file for details