Struct core_graphics::display::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<*const c_void, *const c_void>
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<*const c_void, *const c_void>
pub fn into_untyped(self) -> CFDictionary<*const c_void, *const c_void>
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<T, 'a>(&'a self, key: T) -> Option<ItemRef<'a, V>>where
T: ToVoid<K>,
V: FromVoid,
K: ToVoid<K>,
sourcepub fn get<T, 'a>(&'a self, key: T) -> ItemRef<'a, V>where
T: ToVoid<K>,
V: FromVoid,
K: ToVoid<K>,
pub fn get<T, 'a>(&'a self, key: T) -> ItemRef<'a, V>where
T: ToVoid<K>,
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, Global>, Vec<*const c_void, Global>)
Trait Implementations
sourceimpl CFPropertyListSubClass for CFDictionary<*const c_void, *const c_void>
impl CFPropertyListSubClass for CFDictionary<*const c_void, *const c_void>
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<K, V> Drop for CFDictionary<K, V>
impl<K, V> Drop for CFDictionary<K, V>
sourceimpl PartialEq<CFDictionary<*const c_void, *const c_void>> for CFDictionary<*const c_void, *const c_void>
impl PartialEq<CFDictionary<*const c_void, *const c_void>> for CFDictionary<*const c_void, *const c_void>
sourceimpl<K, V> TCFType for CFDictionary<K, V>
impl<K, V> TCFType for CFDictionary<K, V>
sourcefn as_concrete_TypeRef(&self) -> *const __CFDictionary
fn as_concrete_TypeRef(&self) -> *const __CFDictionary
Returns the object as its concrete TypeRef.
sourceunsafe fn wrap_under_get_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>
unsafe fn wrap_under_get_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>
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) -> *const c_void
fn as_CFTypeRef(&self) -> *const c_void
Returns the object as a raw
CFTypeRef
. The reference count is not adjusted.sourceunsafe fn wrap_under_create_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>
unsafe fn wrap_under_create_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>
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) -> i64
fn retain_count(&self) -> i64
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>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
Returns true if this value is an instance of another type.
sourceimpl<'a> ToVoid<CFDictionary<*const c_void, *const c_void>> for &'a CFDictionary<*const c_void, *const c_void>
impl<'a> ToVoid<CFDictionary<*const c_void, *const c_void>> for &'a CFDictionary<*const c_void, *const c_void>
sourceimpl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionary<*const c_void, *const c_void>
impl ToVoid<CFDictionary<*const c_void, *const c_void>> for CFDictionary<*const c_void, *const c_void>
impl ConcreteCFType for CFDictionary<*const c_void, *const c_void>
impl Eq for CFDictionary<*const c_void, *const c_void>
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