IOPSGetProvidingPowerSourceType

Function IOPSGetProvidingPowerSourceType 

Source
pub unsafe extern "C-unwind" fn IOPSGetProvidingPowerSourceType(
    snapshot: Option<&CFType>,
) -> Option<CFRetained<CFString>>
Available on crate feature ps only.
Expand description

Indicates the power source the computer is currently drawing from.

Determines which power source is providing power.

Parameter snapshot: The CFTypeRef returned by IOPSCopyPowerSourcesInfo()

Returns: One of: CFSTR(kIOPMACPowerKey), CFSTR(kIOPMBatteryPowerKey), CFSTR(kIOPMUPSPowerKey)

ยงSafety

  • snapshot should be of the correct type.
  • snapshot might not allow None.