Struct libarp::interfaces::Interface
source · pub struct Interface { /* private fields */ }Expand description
Represents a network interface.
Wraps pnet’s NetworkInterface struct for better convenience.
Implementations§
source§impl Interface
impl Interface
sourcepub fn new_by_name(interface_name: &str) -> Option<Self>
pub fn new_by_name(interface_name: &str) -> Option<Self>
Selects the interface with the name interface_name.
sourcepub fn get_mac(&self) -> Result<MacAddr, Error>
pub fn get_mac(&self) -> Result<MacAddr, Error>
Returns the MAC address assigned to the interface.
sourcepub fn get_raw_interface(&self) -> &NetworkInterface
pub fn get_raw_interface(&self) -> &NetworkInterface
Returns the raw pnet interface instance related to the interface.