pub struct CFSocket { /* private fields */ }
Available on crate feature
CFSocket
only.Expand description
Implementations§
Source§impl CFSocket
impl CFSocket
Sourcepub unsafe fn new(
allocator: Option<&CFAllocator>,
protocol_family: i32,
socket_type: i32,
protocol: i32,
call_back_types: CFOptionFlags,
callout: CFSocketCallBack,
context: *const CFSocketContext,
) -> Option<CFRetained<CFSocket>>
Available on crate feature CFData
only.
pub unsafe fn new( allocator: Option<&CFAllocator>, protocol_family: i32, socket_type: i32, protocol: i32, call_back_types: CFOptionFlags, callout: CFSocketCallBack, context: *const CFSocketContext, ) -> Option<CFRetained<CFSocket>>
CFData
only.§Safety
allocator
might not allowNone
.callout
must be implemented correctly.context
must be a valid pointer.
Sourcepub unsafe fn with_native(
allocator: Option<&CFAllocator>,
sock: CFSocketNativeHandle,
call_back_types: CFOptionFlags,
callout: CFSocketCallBack,
context: *const CFSocketContext,
) -> Option<CFRetained<CFSocket>>
Available on crate feature CFData
only.
pub unsafe fn with_native( allocator: Option<&CFAllocator>, sock: CFSocketNativeHandle, call_back_types: CFOptionFlags, callout: CFSocketCallBack, context: *const CFSocketContext, ) -> Option<CFRetained<CFSocket>>
CFData
only.§Safety
allocator
might not allowNone
.callout
must be implemented correctly.context
must be a valid pointer.
Sourcepub unsafe fn with_socket_signature(
allocator: Option<&CFAllocator>,
signature: *const CFSocketSignature,
call_back_types: CFOptionFlags,
callout: CFSocketCallBack,
context: *const CFSocketContext,
) -> Option<CFRetained<CFSocket>>
Available on crate feature CFData
only.
pub unsafe fn with_socket_signature( allocator: Option<&CFAllocator>, signature: *const CFSocketSignature, call_back_types: CFOptionFlags, callout: CFSocketCallBack, context: *const CFSocketContext, ) -> Option<CFRetained<CFSocket>>
CFData
only.§Safety
allocator
might not allowNone
.signature
must be a valid pointer.callout
must be implemented correctly.context
must be a valid pointer.
Sourcepub unsafe fn new_connected_to_socket_signature(
allocator: Option<&CFAllocator>,
signature: *const CFSocketSignature,
call_back_types: CFOptionFlags,
callout: CFSocketCallBack,
context: *const CFSocketContext,
timeout: CFTimeInterval,
) -> Option<CFRetained<CFSocket>>
Available on crate features CFData
and CFDate
only.
pub unsafe fn new_connected_to_socket_signature( allocator: Option<&CFAllocator>, signature: *const CFSocketSignature, call_back_types: CFOptionFlags, callout: CFSocketCallBack, context: *const CFSocketContext, timeout: CFTimeInterval, ) -> Option<CFRetained<CFSocket>>
CFData
and CFDate
only.§Safety
allocator
might not allowNone
.signature
must be a valid pointer.callout
must be implemented correctly.context
must be a valid pointer.
pub fn set_address(&self, address: Option<&CFData>) -> CFSocketError
Available on crate feature
CFData
only.pub fn connect_to_address( &self, address: Option<&CFData>, timeout: CFTimeInterval, ) -> CFSocketError
Available on crate features
CFData
and CFDate
only.pub fn invalidate(&self)
pub fn is_valid(&self) -> bool
pub fn address(&self) -> Option<CFRetained<CFData>>
Available on crate feature
CFData
only.pub fn peer_address(&self) -> Option<CFRetained<CFData>>
Available on crate feature
CFData
only.Sourcepub unsafe fn context(&self, context: *mut CFSocketContext)
pub unsafe fn context(&self, context: *mut CFSocketContext)
§Safety
context
must be a valid pointer.
pub fn native(&self) -> CFSocketNativeHandle
pub fn new_run_loop_source( allocator: Option<&CFAllocator>, s: Option<&CFSocket>, order: CFIndex, ) -> Option<CFRetained<CFRunLoopSource>>
Available on crate feature
CFRunLoop
only.pub fn socket_flags(&self) -> CFOptionFlags
pub fn set_socket_flags(&self, flags: CFOptionFlags)
pub fn disable_call_backs(&self, call_back_types: CFOptionFlags)
pub fn enable_call_backs(&self, call_back_types: CFOptionFlags)
pub fn send_data( &self, address: Option<&CFData>, data: Option<&CFData>, timeout: CFTimeInterval, ) -> CFSocketError
Available on crate features
CFData
and CFDate
only.Sourcepub unsafe fn register_value(
name_server_signature: *const CFSocketSignature,
timeout: CFTimeInterval,
name: Option<&CFString>,
value: Option<&CFPropertyList>,
) -> CFSocketError
Available on crate features CFData
and CFDate
only.
pub unsafe fn register_value( name_server_signature: *const CFSocketSignature, timeout: CFTimeInterval, name: Option<&CFString>, value: Option<&CFPropertyList>, ) -> CFSocketError
CFData
and CFDate
only.§Safety
name_server_signature
must be a valid pointer.name
might not allowNone
.value
should be of the correct type.value
might not allowNone
.
Sourcepub unsafe fn copy_registered_value(
name_server_signature: *const CFSocketSignature,
timeout: CFTimeInterval,
name: Option<&CFString>,
value: *mut *const CFPropertyList,
name_server_address: *mut *const CFData,
) -> CFSocketError
Available on crate features CFData
and CFDate
only.
pub unsafe fn copy_registered_value( name_server_signature: *const CFSocketSignature, timeout: CFTimeInterval, name: Option<&CFString>, value: *mut *const CFPropertyList, name_server_address: *mut *const CFData, ) -> CFSocketError
CFData
and CFDate
only.§Safety
name_server_signature
must be a valid pointer.name
might not allowNone
.value
must be a valid pointer.name_server_address
must be a valid pointer.
Sourcepub unsafe fn register_socket_signature(
name_server_signature: *const CFSocketSignature,
timeout: CFTimeInterval,
name: Option<&CFString>,
signature: *const CFSocketSignature,
) -> CFSocketError
Available on crate features CFData
and CFDate
only.
pub unsafe fn register_socket_signature( name_server_signature: *const CFSocketSignature, timeout: CFTimeInterval, name: Option<&CFString>, signature: *const CFSocketSignature, ) -> CFSocketError
CFData
and CFDate
only.§Safety
name_server_signature
must be a valid pointer.name
might not allowNone
.signature
must be a valid pointer.
Sourcepub unsafe fn copy_registered_socket_signature(
name_server_signature: *const CFSocketSignature,
timeout: CFTimeInterval,
name: Option<&CFString>,
signature: *mut CFSocketSignature,
name_server_address: *mut *const CFData,
) -> CFSocketError
Available on crate features CFData
and CFDate
only.
pub unsafe fn copy_registered_socket_signature( name_server_signature: *const CFSocketSignature, timeout: CFTimeInterval, name: Option<&CFString>, signature: *mut CFSocketSignature, name_server_address: *mut *const CFData, ) -> CFSocketError
CFData
and CFDate
only.§Safety
name_server_signature
must be a valid pointer.name
might not allowNone
.signature
must be a valid pointer.name_server_address
must be a valid pointer.
Sourcepub unsafe fn unregister(
name_server_signature: *const CFSocketSignature,
timeout: CFTimeInterval,
name: Option<&CFString>,
) -> CFSocketError
Available on crate features CFData
and CFDate
only.
pub unsafe fn unregister( name_server_signature: *const CFSocketSignature, timeout: CFTimeInterval, name: Option<&CFString>, ) -> CFSocketError
CFData
and CFDate
only.§Safety
name_server_signature
must be a valid pointer.name
might not allowNone
.
pub fn set_default_name_registry_port_number(port: u16)
pub fn default_name_registry_port_number() -> u16
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 ConcreteType for CFSocket
impl ConcreteType for CFSocket
Source§impl RefEncode for CFSocket
impl RefEncode for CFSocket
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 CFSocket
impl Type for CFSocket
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 CFSocket
Auto Trait Implementations§
impl !Freeze for CFSocket
impl !RefUnwindSafe for CFSocket
impl !Send for CFSocket
impl !Sync for CFSocket
impl !Unpin for CFSocket
impl !UnwindSafe for CFSocket
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