Crates.io | proto |
lib.rs | proto |
version | 0.1.2 |
source | src |
created_at | 2024-05-26 07:49:22.323358 |
updated_at | 2024-05-26 12:30:14.610338 |
description | `proto` allows you to define Protocol Buffers using Rust code to reuse Rust's type system and ecosystem. |
homepage | https://github.com/panghu-huang/proto |
repository | https://github.com/panghu-huang/proto |
max_upload_size | |
id | 1252392 |
size | 14,558 |
proto
allows you to define Protocol Buffers using Rust code to reuse Rust's type system and ecosystem.
use proto::proto;
fn main() {
// Define a Protocol Buffers service
let service = proto! {
package example;
codec crate::common::JsonCodec;
service Greeter {
rpc SayHello (crate::HelloRequest) returns (stream crate::HelloResponse) {}
}
};
tonic_build::manual::Builder::new()
.out_dir("./pb")
.compile(&[service]);
}