Hello, I would like to ask you if there is a way to serialize this hash map to and from a file in a better way? I would need to make it so that it can work with the example I have at the end, but so that it is fast and that it takes up less space in the file than it does now
use {
ahash::AHashMap,
serde::{Deserialize, Serialize},
};
fn main() {
let mut map: AHashMap<&str, Value> = AHashMap::new();
map.insert("hello", Value::Bool(true));
map.insert("john", Value::Vector(b"doe".to_vec()));
let vec = rmp_serde::to_vec(&map).unwrap();
let _map2: AHashMap<String, Value> = rmp_serde::from_slice(&vec).unwrap();
std::fs::write("map.txt", vec).unwrap();
}
#[derive(Deserialize, Serialize)]
pub enum Value {
Int(i32),
Float(f64),
Vector(Vec<u8>),
Bool(bool),
}