File: README.md

package info (click to toggle)
rust-if-addrs 0.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: makefile: 4
file content (32 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# if-addrs
https://crates.io/crates/if-addrs

## Overview

Retrieve network interface info for all interfaces on the system:

```rust
// 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:

```rust
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](LICENSE-BSD) https://opensource.org/licenses/BSD-3-Clause) or the MIT license ([LICENSE-MIT](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.