Skip to main content

Crate tor_geoip

Crate tor_geoip 

Source
Expand description

A crate for performing GeoIP lookups using the Tor GeoIP database.

Re-exportsยง

pub(crate) use crate::dense_range_map::DenseRangeMap; ๐Ÿ”’
pub use crate::err::Error;
pub(crate) use Debug; ๐Ÿ”’
pub(crate) use Debug; ๐Ÿ”’
pub(crate) use Display; ๐Ÿ”’
pub(crate) use Formatter; ๐Ÿ”’
pub(crate) use IpAddr; ๐Ÿ”’
pub(crate) use Ipv6Addr; ๐Ÿ”’
pub(crate) use NonZeroU16; ๐Ÿ”’
pub(crate) use NonZeroU32; ๐Ÿ”’
pub(crate) use std::ops::RangeInclusive; ๐Ÿ”’
pub(crate) use std::str::FromStr; ๐Ÿ”’
pub(crate) use Arc; ๐Ÿ”’
pub(crate) use OnceLock; ๐Ÿ”’

Modulesยง

dense_range_map ๐Ÿ”’
Helper type: a frozen RangeMap where most ranges do not have gaps between them.
err ๐Ÿ”’
Error types for GeoIP parsing.
rpc
RPC APIs for geoip functionality.

Structsยง

CountryCode
A two-letter country code.
GeoipDb
A database of IP addresses to country codes.
OptionCc
Wrapper for an Option<CountryCode> that encodes None as ??.
RawGeoipDbExport
An export of a GeoIp database in a raw format suitable for embedding.

Staticsยง

EMBEDDED_DB_PARSED ๐Ÿ”’
A parsed copy of the embedded database.

Traitsยง

DbAddress ๐Ÿ”’
A type that can be an address entry in one of our databases.
HasCountryCode
A (representation of a) host on the network which may have a known country code.

Functionsยง

parse_line ๐Ÿ”’
Parse a single line from a database, expecting addresses of type T.

Type Aliasesยง

Asn ๐Ÿ”’
The type of an ASN.
ParsedLine ๐Ÿ”’
A line as returned by parse_line.