21 releases

new 0.13.4 Mar 20, 2025
0.13.3 Aug 19, 2024
0.13.1 Jul 19, 2024
0.11.1 Mar 12, 2024
0.6.5 Oct 28, 2020

#23 in Network programming

Download history 102802/week @ 2024-12-01 113692/week @ 2024-12-08 97766/week @ 2024-12-15 46619/week @ 2024-12-22 51153/week @ 2024-12-29 94278/week @ 2025-01-05 109346/week @ 2025-01-12 104007/week @ 2025-01-19 99346/week @ 2025-01-26 116558/week @ 2025-02-02 115750/week @ 2025-02-09 102105/week @ 2025-02-16 101573/week @ 2025-02-23 114683/week @ 2025-03-02 121704/week @ 2025-03-09 104162/week @ 2025-03-16

449,892 downloads per month
Used in 549 crates (53 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–7.5MB
~53K SLoC