pub struct SCNetworkInterface(/* private fields */);
Expand description
Represents a network interface.
See SCNetworkInterfaceRef
and its methods for details.
Implementations§
source§impl SCNetworkInterface
impl SCNetworkInterface
sourcepub fn interface_type(&self) -> Option<SCNetworkInterfaceType>
pub fn interface_type(&self) -> Option<SCNetworkInterfaceType>
Get type of the network interface, if the type is recognized, returns None
otherwise.
See SCNetworkInterfaceGetInterfaceType
for details.
sourcepub fn interface_type_string(&self) -> Option<CFString>
pub fn interface_type_string(&self) -> Option<CFString>
Returns the raw interface type identifier.
See SCNetworkInterfaceGetInterfaceType
for details.
sourcepub fn bsd_name(&self) -> Option<CFString>
pub fn bsd_name(&self) -> Option<CFString>
Returns the BSD name for the interface, such as en0
.
See SCNetworkInterfaceGetBSDName
for details.
sourcepub fn display_name(&self) -> Option<CFString>
pub fn display_name(&self) -> Option<CFString>
Returns the localized display name for the interface.
See SCNetworkInterfaceGetLocalizedDisplayName
for details.
Trait Implementations§
source§impl Clone for SCNetworkInterface
impl Clone for SCNetworkInterface
source§fn clone(&self) -> SCNetworkInterface
fn clone(&self) -> SCNetworkInterface
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Drop for SCNetworkInterface
impl Drop for SCNetworkInterface
source§impl PartialEq for SCNetworkInterface
impl PartialEq for SCNetworkInterface
source§impl TCFType for SCNetworkInterface
impl TCFType for SCNetworkInterface
source§fn as_concrete_TypeRef(&self) -> SCNetworkInterfaceRef
fn as_concrete_TypeRef(&self) -> SCNetworkInterfaceRef
Returns the object as its concrete
TypeRef
.source§unsafe fn wrap_under_get_rule(reference: SCNetworkInterfaceRef) -> Self
unsafe fn wrap_under_get_rule(reference: SCNetworkInterfaceRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef
subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped.source§fn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
Returns the object as a raw
CFTypeRef
. The reference count is not adjusted.source§unsafe fn wrap_under_create_rule(reference: SCNetworkInterfaceRef) -> Self
unsafe fn wrap_under_create_rule(reference: SCNetworkInterfaceRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef
subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped.source§fn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
Returns the object as a wrapped
CFType
. The reference count is incremented by one.source§fn into_CFType(self) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere
Self: Sized,
Returns the object as a wrapped
CFType
. Consumes self and avoids changing the reference
count.source§fn retain_count(&self) -> isize
fn retain_count(&self) -> isize
Returns the reference count of the object. It is unwise to do anything other than test
whether the return value of this method is greater than zero.
source§fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
Returns
true
if this value is an instance of another type.source§impl<'a> ToVoid<SCNetworkInterface> for &'a SCNetworkInterface
impl<'a> ToVoid<SCNetworkInterface> for &'a SCNetworkInterface
impl ConcreteCFType for SCNetworkInterface
impl Eq for SCNetworkInterface
Auto Trait Implementations§
impl Freeze for SCNetworkInterface
impl RefUnwindSafe for SCNetworkInterface
impl !Send for SCNetworkInterface
impl !Sync for SCNetworkInterface
impl Unpin for SCNetworkInterface
impl UnwindSafe for SCNetworkInterface
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)