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