czdb-rs
czdb-rs is a lightweight Rust library for querying CZDB-format IP geolocation databases. It supports both IPv4 and IPv6 lookups and provides multiple loading strategies for different performance needs.
- Buffered reader by default for low memory usage
- Optional memory-mapped file loading via the
mmapfeature - Fully in-memory loading for fastest access
The database file and key must be obtained from www.cz88.net.
Usage
use Czdb;
use IpAddr;
let db = new?;
let ip: IpAddr = "8.8.8.8".parse.unwrap;
if let Some = db.search
# Ok::
For the Chinese version of this document, see README.zh.md.