Struct core_foundation::propertylist::CFPropertyList
source · pub struct CFPropertyList(/* private fields */);
Expand description
A CFPropertyList struct. This is superclass to CFData
, CFString
, CFArray
,
CFDictionary
, CFDate
, CFBoolean
, and CFNumber
.
This superclass type does not have its own CFTypeID
, instead each instance has the CFTypeID
of the subclass it is an instance of. Thus, this type cannot implement the TCFType
trait,
since it cannot implement the static TCFType::type_id()
method.
Implementations§
source§impl CFPropertyList
impl CFPropertyList
pub fn as_concrete_TypeRef(&self) -> CFPropertyListRef
pub unsafe fn wrap_under_get_rule( reference: CFPropertyListRef, ) -> CFPropertyList
pub fn as_CFType(&self) -> CFType
pub fn into_CFType(self) -> CFTypewhere
Self: Sized,
pub fn as_CFTypeRef(&self) -> CFTypeRef
pub unsafe fn wrap_under_create_rule(obj: CFPropertyListRef) -> CFPropertyList
sourcepub fn retain_count(&self) -> CFIndex
pub 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.
sourcepub fn type_of(&self) -> CFTypeID
pub fn type_of(&self) -> CFTypeID
Returns the type ID of this object. Will be one of CFData
, CFString
, CFArray
,
CFDictionary
, CFDate
, CFBoolean
, or CFNumber
.
sourcepub fn instance_of<OtherCFType: TCFType>(&self) -> bool
pub fn instance_of<OtherCFType: TCFType>(&self) -> bool
Returns true
if this value is an instance of another type.
source§impl CFPropertyList
impl CFPropertyList
sourcepub fn downcast<T: CFPropertyListSubClass>(&self) -> Option<T>
pub fn downcast<T: CFPropertyListSubClass>(&self) -> Option<T>
Try to downcast the CFPropertyList
to a subclass. Checking if the instance is the
correct subclass happens at runtime and None
is returned if it is not the correct type.
Works similar to Box::downcast
and CFType::downcast
.
§Examples
// Create a string.
let string: CFString = CFString::from_static_string("FooBar");
// Cast it up to a property list.
let propertylist: CFPropertyList = string.to_CFPropertyList();
// Cast it down again.
assert_eq!(propertylist.downcast::<CFString>().unwrap().to_string(), "FooBar");
sourcepub fn downcast_into<T: CFPropertyListSubClass>(self) -> Option<T>
pub fn downcast_into<T: CFPropertyListSubClass>(self) -> Option<T>
Similar to downcast
, but consumes self and can thus avoid touching the retain count.
Trait Implementations§
source§impl Clone for CFPropertyList
impl Clone for CFPropertyList
source§fn clone(&self) -> CFPropertyList
fn clone(&self) -> CFPropertyList
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CFPropertyList
impl Debug for CFPropertyList
source§impl Drop for CFPropertyList
impl Drop for CFPropertyList
source§impl PartialEq for CFPropertyList
impl PartialEq for CFPropertyList
impl Eq for CFPropertyList
Auto Trait Implementations§
impl Freeze for CFPropertyList
impl RefUnwindSafe for CFPropertyList
impl !Send for CFPropertyList
impl !Sync for CFPropertyList
impl Unpin for CFPropertyList
impl UnwindSafe for CFPropertyList
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)