fn main() { // Our Data: let data = vec![ (1, "Hello".as_bytes().to_vec()), (2, ", ".as_bytes().to_vec()), (4, "world".as_bytes().to_vec()), (1, "!".as_bytes().to_vec()), ]; // Write to file. // Note that one should not panic!() in real life. match kvds::encode_to_file("data", data) { Err(e) => panic!("Err: {:?}", e), _ => (), } // Read from file. let decoded_data = match kvds::decode_from_file("data") { Ok(d) => d, Err(e) => panic!("Err: {:?}", e), // Again, DO NOT PANIC!() IRL. }; // Print it. It should look like a Vec<(u8, Vec)>, same as the original `data`! println!("{:?}", decoded_data); }