pub struct NetworkInterface {
pub name: String,
pub ipv4_addresses: Vec<Ipv4Addr>,
pub ipv6_addresses: Vec<Ipv6Addr>,
pub is_up: bool,
pub supports_multicast: bool,
}Expand description
Network interface information
Fields§
§name: StringInterface name
ipv4_addresses: Vec<Ipv4Addr>IPv4 addresses
ipv6_addresses: Vec<Ipv6Addr>IPv6 addresses
is_up: boolWhether the interface is active
supports_multicast: boolWhether the interface supports multicast
Implementations§
Source§impl NetworkInterface
impl NetworkInterface
Sourcepub fn with_status(self, is_up: bool, supports_multicast: bool) -> Self
pub fn with_status(self, is_up: bool, supports_multicast: bool) -> Self
Set interface status
Sourcepub fn all_addresses(&self) -> Vec<IpAddr>
pub fn all_addresses(&self) -> Vec<IpAddr>
Get all IP addresses
Trait Implementations§
Source§impl Clone for NetworkInterface
impl Clone for NetworkInterface
Source§fn clone(&self) -> NetworkInterface
fn clone(&self) -> NetworkInterface
Returns a duplicate 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 Debug for NetworkInterface
impl Debug for NetworkInterface
Source§impl<'de> Deserialize<'de> for NetworkInterface
impl<'de> Deserialize<'de> for NetworkInterface
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NetworkInterface
impl PartialEq for NetworkInterface
Source§impl Serialize for NetworkInterface
impl Serialize for NetworkInterface
impl Eq for NetworkInterface
impl StructuralPartialEq for NetworkInterface
Auto Trait Implementations§
impl Freeze for NetworkInterface
impl RefUnwindSafe for NetworkInterface
impl Send for NetworkInterface
impl Sync for NetworkInterface
impl Unpin for NetworkInterface
impl UnwindSafe for NetworkInterface
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