Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rust MaxMind DB Reader

License

NotificationsYou must be signed in to change notification settings

oschwald/maxminddb-rust

Repository files navigation

crates.ioReleased API docs

This library reads the MaxMind DB format, including the GeoIP2 and GeoLite2databases.

Building

To build everything:

cargo build

Testing

This crate manages its test data within a git submodule.To run the tests, you will first need to run the following command.

git submodule update --init

Usage

Add this to yourCargo.toml:

[dependencies]maxminddb ="0.26"

and this to your crate root:

externcrate maxminddb;

API Documentation

The API docs are onDocs.rs.

Example

Seeexamples/lookup.rs for a basic example.

Benchmarks

The projects include benchmarks usingCriterion.rs.

First you need to have a working copy of the GeoIP City database.You can fetch it fromhere.

Place it in the root folder asGeoIP2-City.mmdb.

Once this is done, run

cargo bench

Ifgnuplot is installed, Criterion.rs can generatean HTML report displaying the results of the benchmark undertarget/criterion/report/index.html.

Result of doing 100 random IP lookups:

Contributing

Contributions welcome! Please fork the repository and open a pull requestwith your changes.

License

This is free software, licensed under the ISC license.


[8]ページ先頭

©2009-2025 Movatter.jp