pub struct Db(/* private fields */);
Expand description
ASN record database that is optimized for lookup by an IP address.
Implementations§
Source§impl Db
impl Db
Sourcepub fn form_tsv(data: impl Read) -> Result<Db, DbError>
pub fn form_tsv(data: impl Read) -> Result<Db, DbError>
Loads database from ASN data as provided by IPtoASN - the only supported file format is of ip2asn-v4.tsv
file.
Sourcepub fn load(db_data: impl Read) -> Result<Db, DbError>
pub fn load(db_data: impl Read) -> Result<Db, DbError>
Loads database from the binary index that was stored with .store()
- this method is much faster than loading from the TSV file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Db
impl RefUnwindSafe for Db
impl Send for Db
impl Sync for Db
impl Unpin for Db
impl UnwindSafe for Db
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more