Function CFAttributedStringGetAttributes

Source
pub unsafe extern "C-unwind" fn CFAttributedStringGetAttributes(
    a_str: &CFAttributedString,
    loc: CFIndex,
    effective_range: *mut CFRange,
) -> Option<CFRetained<CFDictionary>>
Available on crate features CFAttributedString and CFBase and CFDictionary only.
Expand description

Returns the attributes at the specified location. If effectiveRange is not NULL, upon return *effectiveRange contains a range over which the exact same set of attributes apply. Note that for performance reasons, the returned effectiveRange is not necessarily the maximal range - for that, use CFAttributedStringGetAttributesAndLongestEffectiveRange(). It’s a programming error for loc to specify a location outside the bounds of the attributed string.

Note that the returned attribute dictionary might change in unpredictable ways from under the caller if the attributed string is edited after this call. If you wish to hang on to the dictionary long-term, you should make an actual copy of it rather than just retaining it. Also, no assumptions should be made about the relationship of the actual CFDictionaryRef returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionary will be identical (that is, ==) to those originally specified.