camel-dataformat-protobuf
Protobuf DataFormat for rust-camel (JSON <-> protobuf wire format)
Overview
camel-dataformat-protobuf provides a dynamic protobuf data format that marshals JSON to protobuf bytes and unmarshals protobuf bytes back to JSON.
Features
- Marshal: JSON → protobuf bytes
- Unmarshal: protobuf bytes → JSON
- Integrates with
camel-proto-compilerfor dynamic proto resolution - Implements
camel_api::DataFormattrait - Works with DSL
marshal: protobuf:path#Messagesyntax
Installation
Add to your Cargo.toml:
[]
= "*"
URI Format
protobuf:path/to/file.proto#package.Message
Usage
use Body;
use ProtobufDataFormat;
use json;
let df = new?;
let body = Json;
let bytes = df.marshal?;
let back = df.unmarshal?;
License
Apache-2.0