pub struct AvroImporter;Expand description
Parser for AVRO schema format.
Implementations§
Source§impl AvroImporter
impl AvroImporter
Sourcepub fn new() -> AvroImporter
pub fn new() -> AvroImporter
Create a new AVRO parser instance.
§Example
use data_modelling_core::import::avro::AvroImporter;
let importer = AvroImporter::new();Sourcepub fn import(&self, avro_content: &str) -> Result<ImportResult, ImportError>
pub fn import(&self, avro_content: &str) -> Result<ImportResult, ImportError>
Import AVRO schema content and create Table(s) (SDK interface).
§Arguments
avro_content- AVRO schema as JSON string (can be a single record or array of records)
§Returns
An ImportResult containing extracted tables and any parse errors.
§Example
use data_modelling_core::import::avro::AvroImporter;
let importer = AvroImporter::new();
let schema = r#"
{
"type": "record",
"name": "User",
"fields": [
{"name": "id", "type": "long"}
]
}
"#;
let result = importer.import(schema).unwrap();Trait Implementations§
Source§impl Default for AvroImporter
impl Default for AvroImporter
Source§fn default() -> AvroImporter
fn default() -> AvroImporter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AvroImporter
impl RefUnwindSafe for AvroImporter
impl Send for AvroImporter
impl Sync for AvroImporter
impl Unpin for AvroImporter
impl UnwindSafe for AvroImporter
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