Struct network_interface::NetworkInterface
source · [−]pub struct NetworkInterface {
pub name: String,
pub addr: Option<Addr>,
pub mac_addr: Option<String>,
}
Expand description
A system’s network interface
Fields
name: String
Interface’s name
addr: Option<Addr>
Interface’s address
mac_addr: Option<String>
MAC Address
Implementations
sourceimpl NetworkInterface
impl NetworkInterface
pub fn new_afinet(
name: &str,
addr: Ipv4Addr,
netmask: Netmask<Ipv4Addr>,
broadcast: Option<Ipv4Addr>
) -> NetworkInterface
pub fn new_afinet6(
name: &str,
addr: Ipv6Addr,
netmask: Netmask<Ipv6Addr>,
broadcast: Option<Ipv6Addr>
) -> NetworkInterface
Trait Implementations
sourceimpl Clone for NetworkInterface
impl Clone for NetworkInterface
sourcefn clone(&self) -> NetworkInterface
fn clone(&self) -> NetworkInterface
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NetworkInterface
impl Debug for NetworkInterface
sourceimpl NetworkInterfaceConfig for NetworkInterface
impl NetworkInterfaceConfig for NetworkInterface
sourcefn show() -> Result<Vec<NetworkInterface>>
fn show() -> Result<Vec<NetworkInterface>>
List system’s network interfaces configuration
Auto Trait Implementations
impl RefUnwindSafe for NetworkInterface
impl Send for NetworkInterface
impl Sync for NetworkInterface
impl Unpin for NetworkInterface
impl UnwindSafe for NetworkInterface
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more