GeoDatabase

Trait GeoDatabase 

Source
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§

Source

fn lookup(&self, ip: IpAddr) -> Result<Option<String>, GeoLookupError>

Look up the country code for an IP address

Source

fn database_type(&self) -> GeoDatabaseType

Get the database type

Implementors§