pub struct ProtobufImporter;Expand description
Parser for Protobuf format.
Implementations§
Source§impl ProtobufImporter
impl ProtobufImporter
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Protobuf parser instance.
§Example
use data_modelling_core::import::protobuf::ProtobufImporter;
let importer = ProtobufImporter::new();Sourcepub fn import(&self, proto_content: &str) -> Result<ImportResult, ImportError>
pub fn import(&self, proto_content: &str) -> Result<ImportResult, ImportError>
Import Protobuf content and create Table(s) (SDK interface).
§Arguments
proto_content- Protobuf.protofile content as a string
§Returns
An ImportResult containing extracted tables and any parse errors.
§Example
use data_modelling_core::import::protobuf::ProtobufImporter;
let importer = ProtobufImporter::new();
let proto = r#"
syntax = "proto3";
message User {
int64 id = 1;
string name = 2;
}
"#;
let result = importer.import(proto).unwrap();Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtobufImporter
impl RefUnwindSafe for ProtobufImporter
impl Send for ProtobufImporter
impl Sync for ProtobufImporter
impl Unpin for ProtobufImporter
impl UnwindSafe for ProtobufImporter
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