#[repr(C)]pub struct SCNetworkProtocol { /* private fields */ }
SCNetworkConfiguration
only.Expand description
This is the type of a reference to an object that represents a network protocol.
See also Apple’s documentation
Implementations§
Source§impl SCNetworkProtocol
impl SCNetworkProtocol
Sourcepub fn configuration(
self: &SCNetworkProtocol,
) -> Option<CFRetained<CFDictionary>>
pub fn configuration( self: &SCNetworkProtocol, ) -> Option<CFRetained<CFDictionary>>
Returns the configuration settings associated with the protocol.
Parameter protocol
: The network protocol.
Returns: The configuration settings associated with the protocol; NULL if no configuration settings are associated with the protocol or an error was encountered.
Sourcepub fn enabled(self: &SCNetworkProtocol) -> bool
pub fn enabled(self: &SCNetworkProtocol) -> bool
Returns whether this protocol has been enabled.
Parameter protocol
: The network protocol.
Returns: TRUE if the protocol is enabled.
Sourcepub fn protocol_type(self: &SCNetworkProtocol) -> Option<CFRetained<CFString>>
pub fn protocol_type(self: &SCNetworkProtocol) -> Option<CFRetained<CFString>>
Returns the associated network protocol type.
Parameter protocol
: The network protocol.
Returns: The protocol type.
Sourcepub unsafe fn set_configuration(
self: &SCNetworkProtocol,
config: Option<&CFDictionary>,
) -> bool
pub unsafe fn set_configuration( self: &SCNetworkProtocol, config: Option<&CFDictionary>, ) -> bool
Stores the configuration settings for the protocol.
Parameter protocol
: The network protocol.
Parameter config
: The configuration settings to associate with this protocol.
Returns: TRUE if the configuration was stored; FALSE if an error was encountered.
Sourcepub fn set_enabled(self: &SCNetworkProtocol, enabled: bool) -> bool
pub fn set_enabled(self: &SCNetworkProtocol, enabled: bool) -> bool
Enables or disables the protocol.
Parameter protocol
: The network protocol.
Parameter enabled
: TRUE if the protocol should be enabled.
Returns: TRUE if the enabled status was saved; FALSE if an error was encountered.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
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 SCNetworkProtocol
impl AsRef<AnyObject> for SCNetworkProtocol
Source§impl AsRef<CFType> for SCNetworkProtocol
impl AsRef<CFType> for SCNetworkProtocol
Source§impl AsRef<SCNetworkProtocol> for SCNetworkProtocol
impl AsRef<SCNetworkProtocol> for SCNetworkProtocol
Source§impl Borrow<AnyObject> for SCNetworkProtocol
impl Borrow<AnyObject> for SCNetworkProtocol
Source§impl Borrow<CFType> for SCNetworkProtocol
impl Borrow<CFType> for SCNetworkProtocol
Source§impl ConcreteType for SCNetworkProtocol
impl ConcreteType for SCNetworkProtocol
Source§impl Debug for SCNetworkProtocol
impl Debug for SCNetworkProtocol
Source§impl Deref for SCNetworkProtocol
impl Deref for SCNetworkProtocol
Source§impl Hash for SCNetworkProtocol
impl Hash for SCNetworkProtocol
Source§impl Message for SCNetworkProtocol
impl Message for SCNetworkProtocol
Source§impl PartialEq for SCNetworkProtocol
impl PartialEq for SCNetworkProtocol
Source§impl RefEncode for SCNetworkProtocol
impl RefEncode for SCNetworkProtocol
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for SCNetworkProtocol
impl Type for SCNetworkProtocol
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
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,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
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,
core-foundation
crate. Read more