Struct core_foundation::propertylist::CFPropertyList
source · [−]pub struct CFPropertyList(_);
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
sourceimpl 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) -> CFType where
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.
sourceimpl 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
sourceimpl Clone for CFPropertyList
impl Clone for CFPropertyList
sourcefn clone(&self) -> CFPropertyList
fn clone(&self) -> CFPropertyList
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 Debug for CFPropertyList
impl Debug for CFPropertyList
sourceimpl Drop for CFPropertyList
impl Drop for CFPropertyList
sourceimpl PartialEq<CFPropertyList> for CFPropertyList
impl PartialEq<CFPropertyList> for CFPropertyList
impl Eq for CFPropertyList
Auto Trait Implementations
impl RefUnwindSafe for CFPropertyList
impl !Send for CFPropertyList
impl !Sync for CFPropertyList
impl Unpin for CFPropertyList
impl UnwindSafe for CFPropertyList
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> 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