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.
Trait Implementations§
source§impl PartialEq<Interface> for Interface
impl PartialEq<Interface> for Interface
impl Eq for Interface
impl StructuralEq for Interface
impl StructuralPartialEq for Interface
Auto Trait Implementations§
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnwindSafe for Interface
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