pub struct CFFileDescriptor(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFFileDescriptor reference.
Implementations§
Source§impl CFFileDescriptor
impl CFFileDescriptor
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Wraps a +1 retained CFFileDescriptor pointer and returns None for null.
Sourcepub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFFileDescriptor pointer and wraps the resulting +1 reference.
§Safety
ptr must be NULL or a valid CFFileDescriptor pointer.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CFFileDescriptor
impl Debug for CFFileDescriptor
Source§impl Hash for CFFileDescriptor
impl Hash for CFFileDescriptor
Source§impl PartialEq for CFFileDescriptor
impl PartialEq for CFFileDescriptor
Source§fn eq(&self, other: &CFFileDescriptor) -> bool
fn eq(&self, other: &CFFileDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CFFileDescriptor
impl StructuralPartialEq for CFFileDescriptor
Auto Trait Implementations§
impl Freeze for CFFileDescriptor
impl RefUnwindSafe for CFFileDescriptor
impl !Send for CFFileDescriptor
impl !Sync for CFFileDescriptor
impl Unpin for CFFileDescriptor
impl UnsafeUnpin for CFFileDescriptor
impl UnwindSafe for CFFileDescriptor
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