pub struct ODPSExporter;Expand description
ODPS exporter for generating ODPS YAML from ODPSDataProduct models
Implementations§
Source§impl ODPSExporter
impl ODPSExporter
Sourcepub fn export(&self, product: &ODPSDataProduct) -> Result<String, ExportError>
pub fn export(&self, product: &ODPSDataProduct) -> Result<String, ExportError>
Sourcepub fn export_product(product: &ODPSDataProduct) -> String
pub fn export_product(product: &ODPSDataProduct) -> String
Export a Data Product to ODPS YAML format
§Arguments
product- The Data Product to export
§Returns
A YAML string in ODPS format
§Example
use data_modelling_core::export::odps::ODPSExporter;
use data_modelling_core::models::odps::*;
let product = ODPSDataProduct {
api_version: "v1.0.0".to_string(),
kind: "DataProduct".to_string(),
id: "550e8400-e29b-41d4-a716-446655440000".to_string(),
name: Some("customer-data-product".to_string()),
version: Some("1.0.0".to_string()),
status: ODPSStatus::Active,
domain: None,
tenant: None,
authoritative_definitions: None,
description: None,
custom_properties: None,
tags: vec![],
input_ports: None,
output_ports: None,
management_ports: None,
support: None,
team: None,
product_created_ts: None,
created_at: None,
updated_at: None,
};
let yaml = ODPSExporter::export_product(&product);
assert!(yaml.contains("apiVersion: v1.0.0"));
assert!(yaml.contains("kind: DataProduct"));Auto Trait Implementations§
impl Freeze for ODPSExporter
impl RefUnwindSafe for ODPSExporter
impl Send for ODPSExporter
impl Sync for ODPSExporter
impl Unpin for ODPSExporter
impl UnsafeUnpin for ODPSExporter
impl UnwindSafe for ODPSExporter
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