Expand description
A library for reading and writing MSD files.
§Usage
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.
§Example
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);
Modules§
Structs§
- Deserializer
- Deserializes data from MSD format.
- Serializer
- Serializes data into MSD format.
Functions§
- from_
bytes - Deserialize a value of type
T
from a slice of bytes. - from_
reader - Deserialize a value of type
T
from the givenreader
. - to_
bytes - Serialize the given
value
into a byte buffer. - to_
writer - Serialize the given
value
into the givenwriter
in MSD format.