IOPSGetPowerSourceDescription

Function IOPSGetPowerSourceDescription 

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

Returns a CFDictionary with readable information about the specific power source.

See the C-strings defined in IOPSKeys.h for specific keys into the dictionary. Don’t expect all keys to be present in any dictionary. Some power sources, for example, may not support the “Time Remaining To Empty” key and it will not be present in their dictionaries.

Parameter blob: The CFTypeRef returned by IOPSCopyPowerSourcesInfo()

Parameter ps: One of the CFTypeRefs in the CFArray returned by IOPSCopyPowerSourcesList()

Returns: Returns NULL if an error was encountered, otherwise a CFDictionary. Caller should NOT release the returned CFDictionary - it will be released as part of the CFTypeRef returned by IOPSCopyPowerSourcesInfo().

§Safety

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