Struct sysctl::Temperature [−][src]
pub struct Temperature { /* fields omitted */ }A custom type for temperature sysctls.
Example
extern crate sysctl; #[cfg(not(target_os = "macos"))] fn main() { if let Ok(sysctl::CtlValue::Temperature(val)) = ctl.value() { println!("Temperature: {:.2}K, {:.2}F, {:.2}C", val.kelvin(), val.fahrenheit(), val.celsius()); } else { panic!("Error, not a temperature ctl!") } }
Not available on MacOS
Methods
impl Temperature[src]
impl Temperaturepub fn kelvin(&self) -> f32[src]
pub fn kelvin(&self) -> f32pub fn celsius(&self) -> f32[src]
pub fn celsius(&self) -> f32pub fn fahrenheit(&self) -> f32[src]
pub fn fahrenheit(&self) -> f32Trait Implementations
impl Debug for Temperature[src]
impl Debug for Temperaturefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Copy for Temperature[src]
impl Copy for Temperatureimpl Clone for Temperature[src]
impl Clone for Temperaturefn clone(&self) -> Temperature[src]
fn clone(&self) -> TemperatureReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for Temperature[src]
impl PartialEq for Temperaturefn eq(&self, other: &Temperature) -> bool[src]
fn eq(&self, other: &Temperature) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Temperature) -> bool[src]
fn ne(&self, other: &Temperature) -> boolThis method tests for !=.
impl PartialOrd for Temperature[src]
impl PartialOrd for Temperaturefn partial_cmp(&self, other: &Temperature) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Temperature) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Temperature) -> bool[src]
fn lt(&self, other: &Temperature) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Temperature) -> bool[src]
fn le(&self, other: &Temperature) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Temperature) -> bool[src]
fn gt(&self, other: &Temperature) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Temperature) -> bool[src]
fn ge(&self, other: &Temperature) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Auto Trait Implementations
impl Send for Temperature
impl Send for Temperatureimpl Sync for Temperature
impl Sync for Temperature