pub struct Database { /* private fields */ }
Expand description
Database for indexing and searching combined list of ipv4 and ipv6 entries.
Implementations§
Source§impl Database
impl Database
Sourcepub fn from_reader(reader: impl Read) -> Result<Self, Error>
pub fn from_reader(reader: impl Read) -> Result<Self, Error>
Reads a new database from a reader.
This can be memory data using std::io::Cursor, or a std::fs::File.
Sourcepub fn lookup(&self, address: IpAddr) -> Option<IpEntry<'_>>
pub fn lookup(&self, address: IpAddr) -> Option<IpEntry<'_>>
Looks up a IpAddr in the database.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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