5 releases
0.0.5 | Feb 26, 2021 |
---|---|
0.0.4 | Feb 18, 2021 |
0.0.3 | Feb 12, 2021 |
0.0.2 | Feb 8, 2021 |
0.0.1 | Feb 6, 2021 |
#108 in #root
21KB
420 lines
Provides structures for Serde
to simplify deserialization of a Session
The main object to use with Serde
is SessionSerde
.
Examples
const JSON: &str = r#"
{
"vars": {
"name": "String",
"email": "Email"
},
"steps": {
"$root": {
"substeps": ["nameStep", "emailStep"],
"outputs": ["name","email"]
},
"nameStep": {
"outputs": ["name"]
},
"emailStep": {
"outputs": ["email"]
}
},
"actions": {
"$all": { "type": "htmlForm" }
}
}"#;
// Parse JSON to a Session
let session_serde: SessionSerde = serde_json::from_str(JSON).unwrap();
let session = session_serde.into_session::<serde_json::Error>(SessionId::new(0), false).unwrap();
Dependencies
~3–5MB
~86K SLoC