[][src]Struct macsmc::Smc

pub struct Smc { /* fields omitted */ }
This is supported on macOS only.

The SMC client. All methods take self as a mutable reference, even though it is technically not required. This is to make sure, that a single connection can only be used by one reference at a time.

Examples

let mut smc = Smc::connect()?;
let cpu_temp = smc.cpu_temperature()?;
assert!(*cpu_temp.proximity > 0.0);
// will disconnect
drop(smc);

Implementations

impl Smc[src]

pub fn connect() -> Result<Self>[src]

This is supported on macOS only.

Creates a new connection to the SMC system.

Errors

Error::SmcNotAvailable If the SMC system is not available

pub fn fans(&mut self) -> Result<FanIter>[src]

This is supported on macOS only.

Returns an iterator over all FanSpeed items available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn battery_info(&mut self) -> Result<BatteryInfo>[src]

This is supported on macOS only.

Returns the overall BatteryInfo

Errors

Error::DataError If there was something wrong while getting the data

pub fn battery_details(&mut self) -> Result<BatteryIter>[src]

This is supported on macOS only.

Returns an iterator over all BatteryDetail items available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn cpu_temperature(&mut self) -> Result<CpuTemperatures>[src]

This is supported on macOS only.

Returns the overall CpuTemperatures available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn cpu_core_temps(&mut self) -> Result<CpuIter>[src]

This is supported on macOS only.

Returns an iterator over all cpu core temperatures in Celsius.

Errors

Error::DataError If there was something wrong while getting the data

pub fn gpu_temperature(&mut self) -> Result<GpuTemperatures>[src]

This is supported on macOS only.

Returns the overall GpuTemperatures available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn other_temperatures(&mut self) -> Result<OtherTemperatures>[src]

This is supported on macOS only.

Returns the overall information about OtherTemperatures available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn cpu_power(&mut self) -> Result<CpuPower>[src]

This is supported on macOS only.

Returns the overall CpuPower information available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn gpu_power(&mut self) -> Result<Watt>[src]

This is supported on macOS only.

Returns the overall GPUPower information in Watt available.

Errors

Error::DataError If there was something wrong while getting the data

pub fn power_dc_in(&mut self) -> Result<Watt>[src]

This is supported on macOS only.

Returns the current amount of power being in Watt drawn from DC.

Errors

Error::DataError If there was something wrong while getting the data

pub fn power_system_total(&mut self) -> Result<Watt>[src]

This is supported on macOS only.

Returns the overall power draw in Watt of the whole system.

Errors

Error::DataError If there was something wrong while getting the data

pub fn number_of_keys(&mut self) -> Result<u32>[src]

This is supported on macOS only.

Returns the number of available keys to query.

Errors

Error::DataError If there was something wrong while getting the data

pub fn all_keys(&mut self) -> Result<KeysIter>[src]

This is supported on macOS only.

Returns an iterator over the available keys.

Errors

Error::DataError If there was something wrong while getting the data

pub fn all_data(&mut self) -> Result<DataIter>[src]

This is supported on macOS only.

Returns an iterator over the available data points.

Errors

Error::DataError If there was something wrong while getting the data

Trait Implementations

impl Debug for Smc[src]

Auto Trait Implementations

impl RefUnwindSafe for Smc

impl !Send for Smc

impl !Sync for Smc

impl Unpin for Smc

impl UnwindSafe for Smc

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, 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.