[][src]Struct asn_db::Db

pub struct Db(_);

Loaded ASN database that is optimized for looking up ASN by IP address

Methods

impl Db[src]

pub fn form_tsv(
    data: impl Read
) -> Result<Db, DbError>
[src]

Load database from TSV file as provided by IPtoASN - only ip2asn-v4.tsv file format is supported a the moment

pub fn load(
    db_data: impl Read
) -> Result<Db, DbError>
[src]

Load previously stored database - this method is much faster than loading TSV file

pub fn store(
    &self,
    db_data: impl Write
) -> Result<(), DbError>
[src]

Store database as binary data

pub fn lookup(&self, ip: Ipv4Addr) -> Option<&Record>[src]

Lookup ASN information by IP address where given IP belongs to AS network

Trait Implementations

impl Debug for Db[src]

Auto Trait Implementations

impl Send for Db

impl Sync for Db

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<E, C> WrapContext for E[src]

type ContextError = ErrorContext<E, C>

impl<T> ToErrorNoContext for T[src]