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 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) -> boolwhere
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 moresourcefn into_CFPropertyList(self) -> CFPropertyListwhere
Self: Sized,
fn into_CFPropertyList(self) -> CFPropertyListwhere
Self: Sized,
Equal to
to_CFPropertyList
, but consumes self and avoids changing the reference count. Read moresourceimpl 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 moresourceimpl Debug for CFDictionary
impl Debug for CFDictionary
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
sourcefn eq(&self, other: &CFDictionary) -> bool
fn eq(&self, other: &CFDictionary) -> bool
sourceimpl<K, V> TCFType for CFDictionary<K, V>
impl<K, V> TCFType for CFDictionary<K, V>
type Ref = *const __CFDictionary
type Ref = *const __CFDictionary
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 moresourcefn 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 moresourcefn 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) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere
Self: Sized,
Returns the object as a wrapped
CFType
. Consumes self and avoids changing the reference
count. Read moresourcefn 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more