pub struct CFType(/* private fields */);Expand description
Owned, type-erased CFTypeRef.
Implementations§
Source§impl CFType
impl CFType
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CFTypeRef and returns None for null.
§Safety
A non-null ptr must be a live Core Foundation object pointer carrying
one retain that is transferred to the returned wrapper. The caller must
not release or separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFTypeRef and returns an owned wrapper.
§Safety
A non-null ptr must be a live Core Foundation object pointer for the
duration of the retain call.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrow the raw +0 CFTypeRef pointer while self remains alive.
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Human-readable Core Foundation description.
Trait Implementations§
impl Eq for CFType
Auto Trait Implementations§
impl !Send for CFType
impl !Sync for CFType
impl Freeze for CFType
impl RefUnwindSafe for CFType
impl Unpin for CFType
impl UnsafeUnpin for CFType
impl UnwindSafe for CFType
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
Mutably borrows from an owned value. Read more