pub struct Reader<S: AsRef<[u8]>> {
    pub meta: Metadata,
    /* private fields */
}

Fields

meta: Metadata

Implementations

Open an IPDB database file by loading it into memory.

Example
let reader = ipdb::Reader::open_readfile("ipdb.ipdb").unwrap();

Lookup the socket address in the opened IPDB database

Example:

use ipdb;
use std::net::IpAddr;
use std::str::FromStr;

let reader = ipdb::Reader::open_readfile("ipdb.ipdb").unwrap();

let ip: IpAddr = "1.1.1.1".parse().unwrap();
let data = reader.lookup_prefix(ip, "EN".to_owned()).unwrap();
println!("{:#?}", data);

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.