Releases: FAIRChemistry/md-models-macro
Releases · FAIRChemistry/md-models-macro
v0.1.2
v0.1.1
v0.1.0
MD-Models Macro
This macro accompanies the MD-Models crate to generate structs and enums based on a markdown data model. In the following, find a simple example usage:
use mdmodels_macro::parse_mdmodel;
parse_mdmodel!("tests/data/model.md");
fn main () {
let obj = test::Object {
string_value: "Hello, World!".to_string(),
enum_value: model::SomeEnum::VALUE,
};
// Serialize the object
let serialized = serde_json::to_string(&obj).unwrap();
println!("Serialized: \n{}\n", serialized);
// Deserialize the object
let deserialized: test::Object = serde_json::from_str(&serialized).unwrap();
println!("Deserialized: \n{:#?}\n", deserialized);
}