21 releases

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

#12 in Operating systems

Download history 107953/week @ 2025-01-10 103127/week @ 2025-01-17 104317/week @ 2025-01-24 108283/week @ 2025-01-31 117431/week @ 2025-02-07 107598/week @ 2025-02-14 102654/week @ 2025-02-21 110061/week @ 2025-02-28 119993/week @ 2025-03-07 115336/week @ 2025-03-14 120478/week @ 2025-03-21 113480/week @ 2025-03-28 115823/week @ 2025-04-04 100902/week @ 2025-04-11 97423/week @ 2025-04-18 92873/week @ 2025-04-25

425,766 downloads per month
Used in 559 crates (54 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
~52K SLoC