pub struct Czdb { /* private fields */ }Expand description
Represents a CZDB database, providing methods to load and search the database for IP geolocation data.
Implementations§
Source§impl Czdb
impl Czdb
Sourcepub fn new(db_path: &str, key: &str) -> Result<Self, CzError>
pub fn new(db_path: &str, key: &str) -> Result<Self, CzError>
Creates a new Czdb instance using a standard BufReader.
§Arguments
db_path: The path to the database file.key: The base64-encoded decryption key.
Sourcepub fn new_from_bytes(data: Vec<u8>, key: &str) -> Result<Self, CzError>
pub fn new_from_bytes(data: Vec<u8>, key: &str) -> Result<Self, CzError>
Creates a new Czdb instance from in-memory bytes of the database file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Czdb
impl RefUnwindSafe for Czdb
impl Send for Czdb
impl Sync for Czdb
impl Unpin for Czdb
impl UnwindSafe for Czdb
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