pub struct CFFileDescriptor(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFFileDescriptor reference.
Implementations§
Source§impl CFFileDescriptor
impl CFFileDescriptor
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 CFFileDescriptor pointer and returns None for null.
§Safety
A non-null ptr must be a live CFFileDescriptor pointer of the exact dynamic type carrying one retain transferred to this 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 CFFileDescriptor pointer and returns an owned wrapper.
§Safety
A non-null ptr must be a live CFFileDescriptor pointer of the exact dynamic type 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
Borrows the raw +0 Core Foundation pointer while self remains alive.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFFileDescriptor
impl CFFileDescriptor
Sourcepub fn from_raw_fd(native_fd: i32, close_on_invalidate: bool) -> Option<Self>
pub fn from_raw_fd(native_fd: i32, close_on_invalidate: bool) -> Option<Self>
Wrap a native file descriptor with a no-op callback.
Sourcepub fn native_descriptor(&self) -> i32
pub fn native_descriptor(&self) -> i32
Underlying native file descriptor.
Sourcepub fn invalidate(&self)
pub fn invalidate(&self)
Invalidate the descriptor.
Trait Implementations§
Source§impl AsCFType for CFFileDescriptor
impl AsCFType for CFFileDescriptor
Source§impl Clone for CFFileDescriptor
impl Clone for CFFileDescriptor
Source§fn clone(&self) -> CFFileDescriptor
fn clone(&self) -> CFFileDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more