pub trait GeoDatabase: Send + Sync {
// Required methods
fn lookup(&self, ip: IpAddr) -> Result<Option<String>, GeoLookupError>;
fn database_type(&self) -> GeoDatabaseType;
}Expand description
Trait for GeoIP database backends
Required Methods§
Sourcefn lookup(&self, ip: IpAddr) -> Result<Option<String>, GeoLookupError>
fn lookup(&self, ip: IpAddr) -> Result<Option<String>, GeoLookupError>
Look up the country code for an IP address
Sourcefn database_type(&self) -> GeoDatabaseType
fn database_type(&self) -> GeoDatabaseType
Get the database type