Trait sysinfo::ComponentExt
source · [−]pub trait ComponentExt: Debug {
fn temperature(&self) -> f32;
fn max(&self) -> f32;
fn critical(&self) -> Option<f32>;
fn label(&self) -> &str;
fn refresh(&mut self);
}
Expand description
Getting a component temperature information.
Required Methods
fn temperature(&self) -> f32
fn temperature(&self) -> f32
Returns the temperature of the component (in celsius degree).
use sysinfo::{ComponentExt, System, SystemExt};
let s = System::new_all();
for component in s.components() {
println!("{}°C", component.temperature());
}
Returns the maximum temperature of the component (in celsius degree).
use sysinfo::{ComponentExt, System, SystemExt};
let s = System::new_all();
for component in s.components() {
println!("{}°C", component.max());
}
Returns the highest temperature before the component halts (in celsius degree).
use sysinfo::{ComponentExt, System, SystemExt};
let s = System::new_all();
for component in s.components() {
println!("{:?}°C", component.critical());
}
Returns the label of the component.
use sysinfo::{ComponentExt, System, SystemExt};
let s = System::new_all();
for component in s.components() {
println!("{}", component.label());
}