zkonge / rust-ifaces

Rust bindings to retrieve network interface information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ifaces

Rust bindings to retrieve network interface information

Now compatible with current Rust 2018 edition.

OS Support

  • Windows
  • Unix-Like (BSD-Like, XNU, Linux)

Run

git clone https://github.com/zkonge/rust-ifaces.git
cargo run --example ifaces

Example

[dependencies]
ifaces = { git = "https://github.com/zkonge/rust-ifaces.git" }
fn main() {
    match ifaces::ifaces() {
        Ok(interfaces) => {
            for interface in interfaces.iter() {
                println!("Found Interface: {:?}", interface)
            }
        }
        Err(_) => println!("Ooops ...")
    }
}

Thanks

About

Rust bindings to retrieve network interface information

License:MIT License


Languages

Language:Rust 100.0%