data_modelling_sdk/export/
mod.rs1pub mod avro;
15#[cfg(feature = "bpmn")]
16pub mod bpmn;
17pub mod cads;
18pub mod decision;
19#[cfg(feature = "dmn")]
20pub mod dmn;
21pub mod json_schema;
22pub mod knowledge;
23pub mod markdown;
24pub mod odcl;
25pub mod odcs;
26pub mod odps;
27#[cfg(feature = "openapi")]
28pub mod openapi;
29#[cfg(feature = "png-export")]
30pub mod png;
31pub mod protobuf;
32pub mod sql;
33
34#[derive(Debug, serde::Serialize, serde::Deserialize)]
40#[must_use = "export results contain the exported content and should be used"]
41pub struct ExportResult {
42 pub content: String,
44 pub format: String,
46}
47
48#[derive(Debug, thiserror::Error, serde::Serialize, serde::Deserialize)]
50pub enum ExportError {
51 #[error("Serialization error: {0}")]
52 SerializationError(String),
53 #[error("Validation error: {0}")]
54 ValidationError(String),
55 #[error("Invalid argument: {0}")]
56 InvalidArgument(String),
57 #[error("IO error: {0}")]
58 IoError(String),
59 #[error("Export error: {0}")]
60 ExportError(String),
61 #[error("BPMN export error: {0}")]
62 BPMNExportError(String),
63 #[error("DMN export error: {0}")]
64 DMNExportError(String),
65 #[error("OpenAPI export error: {0}")]
66 OpenAPIExportError(String),
67 #[error("Model not found: {0}")]
68 ModelNotFound(String),
69}
70
71impl From<Box<dyn std::error::Error>> for ExportError {
72 fn from(err: Box<dyn std::error::Error>) -> Self {
73 ExportError::ExportError(err.to_string())
74 }
75}
76
77pub use avro::AvroExporter;
79#[cfg(feature = "bpmn")]
80pub use bpmn::BPMNExporter;
81pub use cads::CADSExporter;
82pub use decision::DecisionExporter;
83#[cfg(feature = "dmn")]
84pub use dmn::DMNExporter;
85pub use json_schema::JSONSchemaExporter;
86pub use knowledge::KnowledgeExporter;
87pub use markdown::MarkdownExporter;
88pub use odcl::ODCLExporter;
89pub use odcs::ODCSExporter;
90pub use odps::ODPSExporter;
91#[cfg(feature = "openapi")]
92pub use openapi::OpenAPIExporter;
93#[cfg(feature = "png-export")]
94pub use png::PNGExporter;
95pub use protobuf::ProtobufExporter;
96pub use sql::SQLExporter;