muon-rs
A Rust library for the MuON data format, using serde.
See documentation for more information.
Deserializing
The easiest way to deserialize data is to derive serde::Deserialize
on
a struct. Then use one of the from_
functions.
Example
MuON file:
book: Pale Fire
author: Vladimir Nabokov
year: 1962
character: John Shade
location: New Wye
character: Charles Kinbote
location: Zembla
book: The Curious Incident of the Dog in the Night-Time
author: Mark Haddon
year: 2003
character: Christopher Boone
location: Swindon
character: Siobhan
Rust code:
let muon = open?;
let books: BookList = from_reader?;
println!;
Serializing
Deriving serde::Serialize
on a struct is just as easy. The to_
functions are used to serialize MuON data.
Example
let books = BookList ;
let muon = to_string?;
println!;
Types
MuON types can be mapped to different Rust types.
Contributing
Any feedback, bug reports or enhancement requests are welcome! Please create an issue and join the fun.