Skip to main content

interfaces

Function interfaces 

pub fn interfaces() -> Result<Vec<Interface>, Error>
Available on crate feature net only.
Expand description

Enumerate the host’s network interfaces and their assigned addresses.

Interfaces and addresses are returned in the order the operating system reports them; no ordering is guaranteed beyond that. Scoped IPv6 addresses (e.g. link-local) carry their zone via InterfaceAddress::scope_id.

Supported on linux, android, apple platforms and windows; any other platform errors with io::ErrorKind::Unsupported. The call performs a cheap but blocking system call; hot async paths may want to wrap it in a blocking task.