Crate msd

source ·
Expand description

A library for reading and writing MSD files.


Reading and writing of MSD files is done using serde, a library for generic serialization and deserialization. It will work with any types that implement the Serialize and Deserialize traits.


use std::collections::HashMap;

let mut map: HashMap<String, usize> = HashMap::new();
map.insert("foo".to_owned(), 1);
map.insert("bar".to_owned(), 2);

// Serialize the map into a byte buffer.
let serialized = msd::to_bytes(&map).unwrap();

// Deserialize back into a map again.
let deserialized = msd::from_bytes(&serialized).unwrap();

assert_eq!(map, deserialized);


  • MSD deserialization.
  • MSD serialization.



  • Deserialize a value of type T from a slice of bytes.
  • Deserialize a value of type T from the given reader.
  • Serialize the given value into a byte buffer.
  • Serialize the given value into the given writer in MSD format.