Rust IP2Location

Crates.io Documentation Build Status

This library reads the IP2Location DB format and returns geo information for the given IP.

Requirements

Building

Testing

bash cargo t -v

Executing the Example

```bash cargo b --example

./target/debug/examples/lookup data/IP2LOCATION-LITE-DB1.IPV6.BIN 2a01:cb08:8d14:: Db Path: data/IP2LOCATION-LITE-DB1.IPV6.BIN |- Db Type: 1 |- Db Column: 2 |- Db Date (YY/MM/DD): 20/12/28

Ok( Record { ip: "2a01:cb08:8d14::", latitude: None, longitude: None, country: Some( Country { shortname: "FR", longname: "France", }, ), region: None, city: None, isp: None, domain: None, zipcode: None, timezone: None, netspeed: None, iddcode: None, areacode: None, weatherstationcode: None, weatherstationname: None, mcc: None, mnc: None, mobilebrand: None, elevation: None, usagetype: None, addresstype: None, category: None, }, )

```

Usage

Add this to your Cargo.toml: toml [dependencies] ip2location = "0.2.0"

License

This is free software, licensed under the MIT license.

Ip2Location Databases:


Sriram