Type Definition maxminddb::OwnedReader

source ·
pub type OwnedReader<'data> = OwnedReaderFile<'data>;
Expand description

A type definition substituting OwnedReader<'data> with OwnedReaderFile<'data>, used if the feature mmap is not active.

Methods from Deref<Target = Reader<'data>>§

Lookup the socket address in the opened MaxMind DB

Example:

use maxminddb::geoip2;
use std::net::IpAddr;
use std::str::FromStr;

let reader = maxminddb::Reader::open("test-data/test-data/GeoIP2-City-Test.mmdb").unwrap();

let ip: IpAddr = FromStr::from_str("89.160.20.128").unwrap();
let city: geoip2::City = reader.lookup(ip).unwrap();
print!("{:?}", city);

Trait Implementations§

Allows to use OwnedReader as a drop-in replacement for a Reader<'data>.

The resulting type after dereferencing.
Dereferences the value.