Trait sysinfo::ComponentExt [−][src]
pub trait ComponentExt: Debug { fn get_temperature(&self) -> f32; fn get_max(&self) -> f32; fn get_critical(&self) -> Option<f32>; fn get_label(&self) -> &str; fn refresh(&mut self); }
Expand description
Getting a component temperature information.
Required methods
fn get_temperature(&self) -> f32
[src]
fn get_temperature(&self) -> f32
[src]Returns the temperature of the component (in celsius degree).
use sysinfo::{ComponentExt, System, SystemExt}; let s = System::new_all(); for component in s.get_components() { println!("{}°C", component.get_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.get_components() { println!("{}°C", component.get_max()); }
fn get_critical(&self) -> Option<f32>
[src]
fn get_critical(&self) -> Option<f32>
[src]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.get_components() { println!("{:?}°C", component.get_critical()); }
Returns the label of the component.
use sysinfo::{ComponentExt, System, SystemExt}; let s = System::new_all(); for component in s.get_components() { println!("{}", component.get_label()); }