Skip to main content

Module search

Module search 

Source
Expand description

IP geolocation lookup functions.

Provides four search entry points with different trade-offs:

FunctionInputWhen to use
search_by_uintu32You have a raw IPv4 integer
search_by_u128u128You have a raw IPv6 integer
search_by_ipaddrIpAddrYou already have a parsed IpAddr
search_ip&strYou 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 u128 IPv6 address.
search_by_uint
Search by raw u32 IPv4 address.
search_ip
Search by any IP-compatible input.