pub struct CADSExporter;Expand description
CADS exporter for generating CADS v1.0 YAML from CADSAsset models
Implementations§
Source§impl CADSExporter
impl CADSExporter
Sourcepub fn export_asset(asset: &CADSAsset) -> String
pub fn export_asset(asset: &CADSAsset) -> String
Export a CADS asset to CADS v1.0 YAML format
§Arguments
asset- The CADS asset to export
§Returns
A YAML string in CADS v1.0 format
§Example
use data_modelling_core::export::cads::CADSExporter;
use data_modelling_core::models::cads::*;
let asset = CADSAsset {
api_version: "v1.0".to_string(),
kind: CADSKind::AIModel,
id: "550e8400-e29b-41d4-a716-446655440000".to_string(),
name: "sentiment-analysis-model".to_string(),
version: "1.0.0".to_string(),
status: CADSStatus::Production,
domain: None,
tags: vec![],
description: None,
runtime: None,
sla: None,
pricing: None,
team: None,
risk: None,
compliance: None,
validation_profiles: None,
bpmn_models: None,
dmn_models: None,
openapi_specs: None,
custom_properties: None,
created_at: None,
updated_at: None,
};
let yaml = CADSExporter::export_asset(&asset);
assert!(yaml.contains("apiVersion: v1.0"));
assert!(yaml.contains("kind: AIModel"));Auto Trait Implementations§
impl Freeze for CADSExporter
impl RefUnwindSafe for CADSExporter
impl Send for CADSExporter
impl Sync for CADSExporter
impl Unpin for CADSExporter
impl UnwindSafe for CADSExporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more