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

#25 in Network programming

Download history 70007/week @ 2024-08-21 77834/week @ 2024-08-28 82846/week @ 2024-09-04 76305/week @ 2024-09-11 82276/week @ 2024-09-18 79691/week @ 2024-09-25 88209/week @ 2024-10-02 87423/week @ 2024-10-09 96978/week @ 2024-10-16 94688/week @ 2024-10-23 88273/week @ 2024-10-30 95201/week @ 2024-11-06 89853/week @ 2024-11-13 98857/week @ 2024-11-20 104090/week @ 2024-11-27 86340/week @ 2024-12-04

395,284 downloads per month
Used in 479 crates (47 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
~63K SLoC