Crates.io | locator |
lib.rs | locator |
version | 0.2.2 |
source | src |
created_at | 2020-11-19 03:32:56.908869 |
updated_at | 2020-11-19 21:33:54.773075 |
description | Get IP address geolocation information freely. |
homepage | |
repository | https://github.com/DefunctLizard/locator/ |
max_upload_size | |
id | 313882 |
size | 60,869 |
Get IP address geolocation information freely.
Add to Cargo.toml
.
locator = 0.2.2
Using locator is really quite easy:
use locator::Locator;
use std::net::Ipv4Addr;
fn main() {
let ip = Ipv4Addr::new(1, 1, 1, 1);
match Locator::get_ipv4(ip) {
Ok(ip) => println!("{} - {}", ip.ip, ip.city),
Err(error) => println!("Error getting data: {}", error),
};
}
This and more examples are found in the examples directory.
The API can get these fields about IP addresses.
Grant Handy grantshandy@gmail.com
Data provided by ipwhois