Struct core_foundation::dictionary::CFDictionary
source · [−]Implementations
sourceimpl<K, V> CFDictionary<K, V>
impl<K, V> CFDictionary<K, V>
pub fn from_CFType_pairs(pairs: &[(K, V)]) -> CFDictionary<K, V> where
K: TCFType,
V: TCFType,
pub fn to_untyped(&self) -> CFDictionary
sourcepub unsafe fn to_mutable(&self) -> CFMutableDictionary<K, V>
pub unsafe fn to_mutable(&self) -> CFMutableDictionary<K, V>
Returns a CFMutableDictionary
pointing to the same underlying dictionary as this immutable one.
This should only be used when the underlying dictionary is mutable.
sourcepub fn into_untyped(self) -> CFDictionary
pub fn into_untyped(self) -> CFDictionary
Returns the same dictionary, but with the types reset to void pointers.
Equal to to_untyped
, but is faster since it does not increment the retain count.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains_key(&self, key: &K) -> bool where
K: ToVoid<K>,
pub fn find<'a, T: ToVoid<K>>(&'a self, key: T) -> Option<ItemRef<'a, V>> where
V: FromVoid,
K: ToVoid<K>,
sourcepub fn get<'a, T: ToVoid<K>>(&'a self, key: T) -> ItemRef<'a, V> where
V: FromVoid,
K: ToVoid<K>,
pub fn get<'a, T: ToVoid<K>>(&'a self, key: T) -> ItemRef<'a, V> where
V: FromVoid,
K: ToVoid<K>,
Panics
Panics if the key is not present in the dictionary. Use find
to get an Option
instead
of panicking.
pub fn get_keys_and_values(&self) -> (Vec<*const c_void>, Vec<*const c_void>)
Trait Implementations
sourceimpl CFPropertyListSubClass for CFDictionary
impl CFPropertyListSubClass for CFDictionary
sourcefn to_CFPropertyList(&self) -> CFPropertyList
fn to_CFPropertyList(&self) -> CFPropertyList
Create an instance of the superclass type CFPropertyList
for this instance. Read more
sourcefn into_CFPropertyList(self) -> CFPropertyList where
Self: Sized,
fn into_CFPropertyList(self) -> CFPropertyList where
Self: Sized,
Equal to to_CFPropertyList
, but consumes self and avoids changing the reference count. Read more
sourceimpl Clone for CFDictionary
impl Clone for CFDictionary
sourcefn clone(&self) -> CFDictionary
fn clone(&self) -> CFDictionary
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<K, V> Debug for CFDictionary<K, V>
impl<K, V> Debug for CFDictionary<K, V>
sourceimpl<K, V> Drop for CFDictionary<K, V>
impl<K, V> Drop for CFDictionary<K, V>
sourceimpl<'a, K, V> From<&'a CFDictionary<K, V>> for CFMutableDictionary<K, V>
impl<'a, K, V> From<&'a CFDictionary<K, V>> for CFMutableDictionary<K, V>
sourcefn from(dict: &'a CFDictionary<K, V>) -> Self
fn from(dict: &'a CFDictionary<K, V>) -> Self
Creates a new mutable dictionary with the key-value pairs from another dictionary. The capacity of the new mutable dictionary is not limited.
sourceimpl PartialEq<CFDictionary<*const c_void, *const c_void>> for CFDictionary
impl PartialEq<CFDictionary<*const c_void, *const c_void>> for CFDictionary
sourceimpl<K, V> TCFType for CFDictionary<K, V>
impl<K, V> TCFType for CFDictionary<K, V>
type Ref = CFDictionaryRef
type Ref = CFDictionaryRef
The reference type wrapped inside this type.
sourcefn as_concrete_TypeRef(&self) -> CFDictionaryRef
fn as_concrete_TypeRef(&self) -> CFDictionaryRef
Returns the object as its concrete TypeRef.
sourceunsafe fn wrap_under_get_rule(reference: CFDictionaryRef) -> Self
unsafe fn wrap_under_get_rule(reference: CFDictionaryRef) -> Self
Returns an instance of the object, wrapping the underlying CFTypeRef
subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped. Read more
sourcefn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
Returns the object as a raw CFTypeRef
. The reference count is not adjusted.
sourceunsafe fn wrap_under_create_rule(reference: CFDictionaryRef) -> Self
unsafe fn wrap_under_create_rule(reference: CFDictionaryRef) -> Self
Returns an instance of the object, wrapping the underlying CFTypeRef
subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped. Read more
sourcefn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
Returns the object as a wrapped CFType
. The reference count is incremented by one.
sourcefn into_CFType(self) -> CFType where
Self: Sized,
fn into_CFType(self) -> CFType where
Self: Sized,
Returns the object as a wrapped CFType
. Consumes self and avoids changing the reference
count. Read more
sourcefn retain_count(&self) -> CFIndex
fn retain_count(&self) -> CFIndex
Returns the reference count of the object. It is unwise to do anything other than test whether the return value of this method is greater than zero. Read more
sourcefn instance_of<OtherCFType: TCFType>(&self) -> bool
fn instance_of<OtherCFType: TCFType>(&self) -> bool
Returns true if this value is an instance of another type.
sourceimpl<'a> ToVoid<CFDictionary<*const c_void, *const c_void>> for &'a CFDictionary
impl<'a> ToVoid<CFDictionary<*const c_void, *const c_void>> for &'a CFDictionary
sourceimpl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionary
impl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionary
sourceimpl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionaryRef
impl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionaryRef
impl ConcreteCFType for CFDictionary<*const c_void, *const c_void>
impl Eq for CFDictionary
Auto Trait Implementations
impl<K, V> RefUnwindSafe for CFDictionary<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K = *const c_void, V = *const c_void> !Send for CFDictionary<K, V>
impl<K = *const c_void, V = *const c_void> !Sync for CFDictionary<K, V>
impl<K, V> Unpin for CFDictionary<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for CFDictionary<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromMutVoid for T where
T: TCFType,
impl<T> FromMutVoid for T where
T: TCFType,
unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more