20 unstable releases (7 breaking)

0.13.3 Aug 19, 2024
0.13.1 Jul 19, 2024
0.11.1 Mar 12, 2024
0.11.0 Dec 5, 2023
0.6.5 Oct 28, 2020

#32 in Network programming

Download history 69104/week @ 2024-05-18 78526/week @ 2024-05-25 77549/week @ 2024-06-01 71018/week @ 2024-06-08 69431/week @ 2024-06-15 73354/week @ 2024-06-22 66735/week @ 2024-06-29 63350/week @ 2024-07-06 74102/week @ 2024-07-13 73733/week @ 2024-07-20 68484/week @ 2024-07-27 72536/week @ 2024-08-03 84672/week @ 2024-08-10 68972/week @ 2024-08-17 73140/week @ 2024-08-24 67587/week @ 2024-08-31

304,786 downloads per month
Used in 424 crates (43 directly)

MIT OR BSD-3-Clause

48KB
1K SLoC

if-addrs

https://crates.io/crates/if-addrs

Overview

Retrieve network interface info for all interfaces on the system:

// List all of the machine's network interfaces
for iface in if_addrs::get_if_addrs().unwrap() {
    println!("{:#?}", iface);
}

Get notifications for changes in network interfaces:

let mut notifier = if_addrs::IfChangeNotifier::new().unwrap();
loop {
    if let Ok(details) = notifier.wait(None) {
        println!("{:#?}", details);
    }
}

License

This SAFE Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT http://opensource.org/licenses/MIT) at your option.

Contribution

Copyrights in the SAFE Network are retained by their contributors. No copyright assignment is required to contribute to this project.

Dependencies

~0–8.5MB
~60K SLoC