usecrate::error::{Result, ScxmlError};usecrate::model::Statechart;/// Export a statechart as a JSON value.
pubfnto_json(chart:&Statechart)->Result<serde_json::Value>{serde_json::to_value(chart).map_err(|e|ScxmlError::Json(e.to_string()))}/// Export a statechart as a pretty-printed JSON string.
pubfnto_json_string(chart:&Statechart)->Result<String>{serde_json::to_string_pretty(chart).map_err(|e|ScxmlError::Json(e.to_string()))}