pub struct Metadata {
pub binary_format_major_version: u16,
pub binary_format_minor_version: u16,
pub build_epoch: u64,
pub database_type: String,
pub description: BTreeMap<String, String>,
pub ip_version: u16,
pub languages: Vec<String>,
pub node_count: u32,
pub record_size: u16,
}Expand description
Metadata about the MaxMind DB file.
Fields§
§binary_format_major_version: u16Major version of the binary format (always 2).
binary_format_minor_version: u16Minor version of the binary format (always 0).
build_epoch: u64Unix timestamp when the database was built.
database_type: StringDatabase type (e.g., “GeoIP2-City”, “GeoLite2-Country”).
description: BTreeMap<String, String>Map of language codes to database descriptions.
ip_version: u16IP version supported (4 or 6).
languages: Vec<String>Languages available in the database.
node_count: u32Number of nodes in the search tree.
record_size: u16Size of each record in bits (24, 28, or 32).
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn build_time(&self) -> SystemTime
pub fn build_time(&self) -> SystemTime
Returns the database build time as a SystemTime.
This converts the build_epoch Unix timestamp to a SystemTime.
§Example
use maxminddb::Reader;
let reader = Reader::open_readfile("test-data/test-data/GeoIP2-City-Test.mmdb").unwrap();
let build_time = reader.metadata.build_time();
println!("Database built: {:?}", build_time);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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