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