Crate macsmc

Source
Expand description

SMC client for macOS

§Examples

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

See Smc for the starting point.

Structs§

BatteryDetail
Various information about the battery in detail
BatteryInfo
Various information about the battery in general.
BatteryIter
Iterator for BatteryDetails. Advancing this iterator by calling nth is a O(1) operation and will not query all intermediate keys.
Celsius
Temperature in Celsius (centigrade) scale. This is the default scale being used.
CpuIter
Iterator for the Celsius temperatures of all cpu cores. Advancing this iterator by calling nth is a O(1) operation and will not query all intermediate keys.
CpuPower
Various power related values of the CPU. If a sensor is missing, the value is 0.0
CpuTemperatures
Combination of various CPU Temperatures If a sensor is missing, the value is 0.0
DataIter
Iterator for all Dbgs. Advancing this iterator by calling nth is a O(1) operation and will not query all intermediate keys.
Dbg
Return type for a debug command. Does not interpret the data.
DbgKeyInfo
Return type for a debug command. Does not interpret the data.
Fahrenheit
Temperature in Fahrenheit scale. To convert from Celsius to Fahrenheit:
FanIter
Iterator for FanSpeeds. Advancing this iterator by calling nth is a O(1) operation and will not query all intermediate keys.
FanSpeed
Collection of various speeds about a single fan. If a sensor is missing, the value is 0.0
GpuTemperatures
Combination of various CPU Temperatures If a sensor is missing, the value is 0.0
KeysIter
Iterator for all DbgKeyInfos. Advancing this iterator by calling nth is a O(1) operation and will not query all intermediate keys.
MilliAmpere
Value wrapper for values that are mA units
MilliAmpereHours
Value wrapper for values that are mAh units
OtherTemperatures
Various other CPU temperatures. This list is not exhaustive nor are the sensors commonly available. If a sensor is missing, the value is 0.0
Rpm
Unit for fan speed (RPM = Revolutions per minute)
SmcmacOS
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.
Volt
Value wrapper for values that are V units
Watt
Value wrapper for values that are W units

Enums§

DataValue
Raw data value from a sensor
Error
Possible errors that can happen
FanMode
How a fan is being operated.

Type Aliases§

Result
This crates result type