A wrapper on getifaddrs
which retrieves host's
network interfaces.
Handy functions are provided such as local_ip
which retrieve the local IP
address based on the host system
```rust use std::net::IpAddr; use localipaddress::local_ip;
assert!(matches!(local_ip().unwrap(), IpAddr)); ```
You are able to iterate over a vector of tuples where the first element of the tuple is the name of the network interface and the second is the IP address.
```rust use std::net::IpAddr; use localipaddress::findafinet;
let ifas = findafinet().unwrap();
if let Some((, ipaddr)) = ifas .iter() .find(|(name, ipaddr)| *name == "en0" && matches!(ipaddr, IpAddr::V4())) { println!("This is your local IP address: {:?}", ipaddr); // This is your local IP address: 192.168.1.111 assert!(matches!(ipaddr, IpAddr)); } ```
In order to create a release you must push a Git tag as follows
sh
git tag -a <version> -m <message>
Example
sh
git tag -a v0.1.0 -m "First release"
Tags must follow semver conventions Tags must be prefixed with a lowercase
v
letter.
Then push tags as follows:
sh
git push origin main --follow-tags
Every contribution to this project is welcome. Feel free to open a pull request, an issue or just by starting this project.
Distributed under the terms of both the MIT license and the Apache License (Version 2.0)