pub struct CFDictionary(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFDictionary reference.
Implementations§
Source§impl CFDictionary
impl CFDictionary
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CFDictionary pointer and returns None for null.
§Safety
A non-null ptr must be a live CFDictionary pointer of the exact dynamic type carrying one retain transferred to this wrapper. The caller must not release or separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFDictionary pointer and returns an owned wrapper.
§Safety
A non-null ptr must be a live CFDictionary pointer of the exact dynamic type for the duration of the retain call.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrows the raw +0 Core Foundation pointer while self remains alive.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFDictionary
impl CFDictionary
Sourcepub fn from_pairs(pairs: &[(&dyn AsCFType, &dyn AsCFType)]) -> Self
pub fn from_pairs(pairs: &[(&dyn AsCFType, &dyn AsCFType)]) -> Self
Create a dictionary from borrowed key/value pairs.
Sourcepub fn contains_key(&self, key: &dyn AsCFType) -> bool
pub fn contains_key(&self, key: &dyn AsCFType) -> bool
Whether key exists in the dictionary.
Trait Implementations§
Source§impl AsCFType for CFDictionary
impl AsCFType for CFDictionary
Source§impl Clone for CFDictionary
impl Clone for CFDictionary
Source§fn clone(&self) -> CFDictionary
fn clone(&self) -> CFDictionary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CFDictionary
impl Debug for CFDictionary
impl Eq for CFDictionary
Source§impl Hash for CFDictionary
impl Hash for CFDictionary
Source§impl PartialEq for CFDictionary
impl PartialEq for CFDictionary
impl StructuralPartialEq for CFDictionary
Auto Trait Implementations§
impl !Send for CFDictionary
impl !Sync for CFDictionary
impl Freeze for CFDictionary
impl RefUnwindSafe for CFDictionary
impl Unpin for CFDictionary
impl UnsafeUnpin for CFDictionary
impl UnwindSafe for CFDictionary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more