[−][src]Module atelier_core::io
Traits for reading and writing models in different formats. Separate crates implement the ability to handle different representations, such as the original Smithy, JSON AST, and OpenAPI.
This module also provides some useful Writer
implementations, all are features, all are included
by default.
- debug; uses the
Debug
implementation of Model to write out the internal structure. - uml; uses PlantUML to generate diagrams of a model structure.
Example Model Writer
The example below is pretty much the implementation of the debug
module, it writes the model
using the Debug
implementation associated with those objects.
#[derive(Debug)] pub struct Debugger {} impl Default for Debugger { fn default() -> Self { Self {} } } impl<'a> ModelWriter<'a> for Debugger { const REPRESENTATION: &'static str = "Debug"; fn write(&mut self, w: &mut impl Write, model: &'a Model) -> Result<()> { write!(w, "{:#?}", model)?; Ok(()) } }
Modules
debug | A simple implementation of the |
plant_uml | Writer to produce PlantUML text files for diagramming. |
Traits
ModelReader | Trait implemented to read a model from a specific representation. |
ModelWriter | Trait implemented to write a model in a specific representation. |
Functions
read_model_from_string | Read a model from the string-like value |
write_model_to_string | Write the |