2 use std::os::raw::c_void;
4 pub struct CFMutableDictRef(CFMutableDictionaryRef);
6 impl CFMutableDictRef {
7 pub fn add_value<K, V>(&self, key: *const K, value: *const V) {
8 assert!(!self.0.is_null());
10 CFDictionaryAddValue(self.0, key as *const c_void, value as *const c_void);
15 impl Default for CFMutableDictRef {
16 fn default() -> Self {
18 CFDictionaryCreateMutable(
21 &kCFTypeDictionaryKeyCallBacks,
22 &kCFTypeDictionaryValueCallBacks,
25 assert!(!dict.is_null());
30 impl Drop for CFMutableDictRef {
32 assert!(!self.0.is_null());
34 CFRelease(self.0 as *const c_void);