Skip to main content

MmdbDecode

Derive Macro MmdbDecode 

Source
#[derive(MmdbDecode)]
Expand description

Derives borrowed MMDB map decoding for a struct.

Fields such as &str and &[u8] borrow the source database bytes. Unsupported or missing required fields produce a decoding error.

§Examples

ⓘ
use libmaxminddb_rs::MmdbDecode;
#[derive(MmdbDecode)]
struct Record<'a> { country: &'a str, asn: u32 }