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