File: simple.rs

package info (click to toggle)
rust-sensors 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 112 kB
  • sloc: makefile: 4
file content (24 lines) | stat: -rw-r--r-- 443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extern crate sensors;

use sensors::Sensors;

fn main() {
	let sensors = Sensors::new();
	for chip in sensors {
		println!(
			"{} (on {})",
			chip.get_name().unwrap(),
			chip.bus().get_adapter_name().unwrap()
		);
		for feature in chip {
			println!("  - {}", feature.get_label().unwrap());
			for subfeature in feature {
				println!(
					"    - {} = {}",
					subfeature.name(),
					subfeature.get_value().unwrap()
				);
			}
		}
	}
}