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); }

Getting a component temperature information.

Required methods

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());
}

fn get_max(&self) -> f32[src]

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]

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());
}

fn get_label(&self) -> &str[src]

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());
}

fn refresh(&mut self)[src]

Refreshes component.

use sysinfo::{ComponentExt, System, SystemExt};

let mut s = System::new_all();
for component in s.get_components_mut() {
    component.refresh();
}
Loading content...

Implementors

impl ComponentExt for Component[src]

Loading content...