[−][src]Struct macsmc::Smc
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
Returns an iterator over the available data points.
Errors
Error::DataError
If there was something wrong while getting the data
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,