[][src]Struct sysctl::Temperature

pub struct Temperature { /* fields omitted */ }

A custom type for temperature sysctls.

Example

let ctl = sysctl::Ctl::new("dev.cpu.0.temperature").unwrap();
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

Implementations

impl Temperature[src]

pub fn kelvin(&self) -> f32[src]

pub fn celsius(&self) -> f32[src]

pub fn fahrenheit(&self) -> f32[src]

Trait Implementations

impl Clone for Temperature[src]

impl Copy for Temperature[src]

impl Debug for Temperature[src]

impl PartialEq<Temperature> for Temperature[src]

impl PartialOrd<Temperature> for Temperature[src]

impl StructuralPartialEq for Temperature[src]

Auto Trait Implementations

impl RefUnwindSafe for Temperature

impl Send for Temperature

impl Sync for Temperature

impl Unpin for Temperature

impl UnwindSafe for Temperature

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.