Skip to main content

Module sources

Module sources 

Source
Expand description

Low-level Apple Silicon metric sources.

This module exposes the SMC, IOReport, IOHID, CoreFoundation, and system profiler helpers used by crate::Sampler. It is useful for advanced integrations, debugging new hardware, or experimenting with additional Apple Silicon counters before they are added to the high-level metrics API.

Prefer crate::Sampler for regular use. The APIs in this module are lower level and may change between releases as macOS, hardware generations, and metric keys change. Low-level macOS metric sources.

Structs§

IOHIDSensors
IOHID temperature sensor reader.
IOReport
IOReport subscription used to sample Apple Silicon power and residency counters.
IOReportIterator
Iterator over IOReport channel samples.
IOReportIteratorItem
One IOReport channel item returned by IOReportIterator.
IOServiceIterator
Iterator over IORegistry services matching a service name.
KeyData
Raw SMC request/response payload.
KeyDataVer
SMC protocol version payload.
KeyInfo
Metadata describing an SMC key value.
PLimitData
SMC power limit payload.
SMC
Apple System Management Controller connection.
SensorVal
Decoded SMC sensor value.
SocInfo
Static Apple Silicon system information.

Functions§

cfdict_get_val
Look up a value in a CoreFoundation dictionary by string key.
cfdict_keys
Return all keys from a CoreFoundation dictionary as Rust strings.
cfio_get_props
Copy all CoreFoundation properties from an IORegistry entry.
cfio_get_residencies
Read IOReport state residency counters from a channel item.
cfio_integer_value
Read the integer value from an IOReport channel item.
cfio_watts
Convert an IOReport energy counter into Watts for a sampling duration.
cfnum
Create a CoreFoundation number object from an i32.
cfstr
Create a CoreFoundation string object from a Rust string.
from_cfstr
Convert a CoreFoundation string reference into a Rust String.
get_dvfs_mhz
Parse dynamic voltage and frequency scaling data from an IORegistry dictionary.
get_soc_info
Load cached static SoC information for the current machine.
libc_ram
Read used and total RAM in bytes via libc/mach APIs.
libc_swap
Read used and total swap in bytes via libc sysctl.

Type Aliases§

CVoidRef
Raw CoreFoundation/IOKit pointer used by FFI bindings.
WithError
Error type used by low-level source helpers.