pub struct Adapter { /* private fields */ }
Expand description
Represent an adapter.
Implementations
sourceimpl Adapter
impl Adapter
sourcepub fn adapter_name(&self) -> &str
pub fn adapter_name(&self) -> &str
Get the adapter’s name
sourcepub fn ip_addresses(&self) -> &[IpAddr]
pub fn ip_addresses(&self) -> &[IpAddr]
Get the adapter’s ip addresses (unicast ip addresses)
sourcepub fn prefixes(&self) -> &[(IpAddr, u32)]
pub fn prefixes(&self) -> &[(IpAddr, u32)]
Get the adapter’s prefixes. Returns a list of tuples (IpAddr, u32), where first element is a subnet address, e.g. 192.168.1.0 and second element is prefix length, e.g. 24
sourcepub fn dns_servers(&self) -> &[IpAddr]
pub fn dns_servers(&self) -> &[IpAddr]
Get the adapter’s dns servers (the preferred dns server is first)
sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get the adapter’s description
sourcepub fn friendly_name(&self) -> &str
pub fn friendly_name(&self) -> &str
Get the adapter’s friendly name
sourcepub fn physical_address(&self) -> Option<&[u8]>
pub fn physical_address(&self) -> Option<&[u8]>
Get the adapter’s physical (MAC) address
sourcepub fn receive_link_speed(&self) -> u64
pub fn receive_link_speed(&self) -> u64
Get the adapter Recieve Link Speed (bits per second)
sourcepub fn transmit_link_speed(&self) -> u64
pub fn transmit_link_speed(&self) -> u64
Get the Trasnmit Link Speed (bits per second)
sourcepub fn oper_status(&self) -> OperStatus
pub fn oper_status(&self) -> OperStatus
Check if the adapter is up (OperStatus is IfOperStatusUp)
sourcepub fn ipv6_if_index(&self) -> u32
pub fn ipv6_if_index(&self) -> u32
Get the IPv6 interface index.
The return value can be used as an IPv6 scope id for link-local addresses.
sourcepub fn ipv4_metric(&self) -> u32
pub fn ipv4_metric(&self) -> u32
Returns the metric used to compute route preference for IPv4
sourcepub fn ipv6_metric(&self) -> u32
pub fn ipv6_metric(&self) -> u32
Returns the metric used to compute route preference for IPv6