inherface 0.3.1

Retrieve a system's Network Interfaces on Linux
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! This binary is a simple wrapper around this project's library

use inherface::{NetworkInterface, get_interfaces};

fn main() {
    let interfaces = get_interfaces().unwrap();

    let mut as_vec = interfaces.into_values().collect::<Vec<NetworkInterface>>();
    as_vec.sort_by(|a, b| a.index.cmp(&b.index));

    as_vec.iter().for_each(|interface| {
        println!("{}", interface);
    });
}