Expand description
IP geolocation lookup functions.
Provides four search entry points with different trade-offs:
| Function | Input | When to use |
|---|---|---|
search_by_uint | u32 | You have a raw IPv4 integer |
search_by_u128 | u128 | You have a raw IPv6 integer |
search_by_ipaddr | IpAddr | You already have a parsed IpAddr |
search_ip | &str | You have an IP string (dotted-decimal, colon-hex, or numeric) |
All functions return &str borrowing from the loaded xdb data — zero heap allocation per query.
Functions§
- search_
by_ ipaddr - Search by
std::net::IpAddr. - search_
by_ u128 - Search by raw
u128IPv6 address. - search_
by_ uint - Search by raw
u32IPv4 address. - search_
ip - Search by any IP-compatible input.