pub struct CFMessagePort { /* private fields */ }
Available on crate feature
CFMessagePort
only.Expand description
This is toll-free bridged with NSMessagePort
.
Implementations§
Source§impl CFMessagePort
impl CFMessagePort
Sourcepub unsafe fn new_local(
allocator: Option<&CFAllocator>,
name: Option<&CFString>,
callout: CFMessagePortCallBack,
context: *mut CFMessagePortContext,
should_free_info: *mut u8,
) -> Option<CFRetained<CFMessagePort>>
Available on crate feature CFData
only.
pub unsafe fn new_local( allocator: Option<&CFAllocator>, name: Option<&CFString>, callout: CFMessagePortCallBack, context: *mut CFMessagePortContext, should_free_info: *mut u8, ) -> Option<CFRetained<CFMessagePort>>
CFData
only.§Safety
allocator
might not allowNone
.name
might not allowNone
.callout
must be implemented correctly.context
must be a valid pointer.should_free_info
must be a valid pointer.
pub fn new_remote( allocator: Option<&CFAllocator>, name: Option<&CFString>, ) -> Option<CFRetained<CFMessagePort>>
pub fn is_remote(&self) -> bool
pub fn name(&self) -> Option<CFRetained<CFString>>
pub fn set_name(&self, new_name: Option<&CFString>) -> bool
Sourcepub unsafe fn context(&self, context: *mut CFMessagePortContext)
pub unsafe fn context(&self, context: *mut CFMessagePortContext)
§Safety
context
must be a valid pointer.
pub fn invalidate(&self)
pub fn is_valid(&self) -> bool
pub fn invalidation_call_back(&self) -> CFMessagePortInvalidationCallBack
Sourcepub unsafe fn set_invalidation_call_back(
&self,
callout: CFMessagePortInvalidationCallBack,
)
pub unsafe fn set_invalidation_call_back( &self, callout: CFMessagePortInvalidationCallBack, )
§Safety
callout
must be implemented correctly.
Sourcepub unsafe fn send_request(
&self,
msgid: i32,
data: Option<&CFData>,
send_timeout: CFTimeInterval,
rcv_timeout: CFTimeInterval,
reply_mode: Option<&CFString>,
return_data: *mut *const CFData,
) -> i32
Available on crate features CFData
and CFDate
only.
pub unsafe fn send_request( &self, msgid: i32, data: Option<&CFData>, send_timeout: CFTimeInterval, rcv_timeout: CFTimeInterval, reply_mode: Option<&CFString>, return_data: *mut *const CFData, ) -> i32
CFData
and CFDate
only.§Safety
data
might not allowNone
.reply_mode
might not allowNone
.return_data
must be a valid pointer.
pub fn new_run_loop_source( allocator: Option<&CFAllocator>, local: Option<&CFMessagePort>, order: CFIndex, ) -> Option<CFRetained<CFRunLoopSource>>
Available on crate feature
CFRunLoop
only.Sourcepub unsafe fn set_dispatch_queue(&self, queue: Option<&DispatchQueue>)
Available on crate feature dispatch2
only.
pub unsafe fn set_dispatch_queue(&self, queue: Option<&DispatchQueue>)
dispatch2
only.§Safety
queue
possibly has additional threading requirements.queue
might not allowNone
.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
pub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CFMessagePort
impl AsRef<AnyObject> for CFMessagePort
Source§impl AsRef<CFMessagePort> for CFMessagePort
impl AsRef<CFMessagePort> for CFMessagePort
Source§impl AsRef<CFType> for CFMessagePort
impl AsRef<CFType> for CFMessagePort
Source§impl Borrow<AnyObject> for CFMessagePort
impl Borrow<AnyObject> for CFMessagePort
Source§impl Borrow<CFType> for CFMessagePort
impl Borrow<CFType> for CFMessagePort
Source§impl ConcreteType for CFMessagePort
impl ConcreteType for CFMessagePort
Source§impl Debug for CFMessagePort
impl Debug for CFMessagePort
Source§impl Deref for CFMessagePort
impl Deref for CFMessagePort
Source§impl Hash for CFMessagePort
impl Hash for CFMessagePort
Source§impl Message for CFMessagePort
impl Message for CFMessagePort
Source§impl PartialEq for CFMessagePort
impl PartialEq for CFMessagePort
Source§impl RefEncode for CFMessagePort
impl RefEncode for CFMessagePort
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
Source§impl Type for CFMessagePort
impl Type for CFMessagePort
Source§fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Increment the reference count of the receiver. Read more
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
👎Deprecated: this is redundant
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::retain
Helper for easier transition from the
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the
core-foundation
crate. Read moreimpl Eq for CFMessagePort
Auto Trait Implementations§
impl !Freeze for CFMessagePort
impl !RefUnwindSafe for CFMessagePort
impl !Send for CFMessagePort
impl !Sync for CFMessagePort
impl !Unpin for CFMessagePort
impl !UnwindSafe for CFMessagePort
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