Expand description
A Map
-like structure but storing data in disk.
NOTE:
- Both keys and values will NOT be encoded in this structure
§Examples
use mmdb_core::basic::mapx_raw::MapxRaw;
let dir = format!("/tmp/mmdb_testing/{}", rand::random::<u128>());
mmdb_core::mmdb_set_base_dir(&dir);
let mut l = MapxRaw::new();
l.insert(&[1], &[0]);
l.insert(&[1], &[0]);
l.insert(&[2], &[0]);
l.iter().for_each(|(_, v)| {
assert_eq!(&v[..], &[0]);
});
l.remove(&[2]);
assert_eq!(l.len(), 1);
l.clear();
assert_eq!(l.len(), 0);