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

#27 in Network programming

Download history 44638/week @ 2024-12-24 59329/week @ 2024-12-31 96669/week @ 2025-01-07 110883/week @ 2025-01-14 101017/week @ 2025-01-21 104338/week @ 2025-01-28 113821/week @ 2025-02-04 116822/week @ 2025-02-11 99719/week @ 2025-02-18 105430/week @ 2025-02-25 116683/week @ 2025-03-04 120022/week @ 2025-03-11 113246/week @ 2025-03-18 120946/week @ 2025-03-25 110413/week @ 2025-04-01 95245/week @ 2025-04-08

460,888 downloads per month
Used in 564 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–8MB
~54K SLoC