3 releases
0.1.2 | May 26, 2024 |
---|---|
0.1.1 | May 26, 2024 |
0.1.0 | May 26, 2024 |
#311 in #protobuf
630 downloads per month
Used in 2 crates
(via astro-run-protocol)
14KB
348 lines
proto
proto
allows you to define Protocol Buffers using Rust code to reuse Rust's type system and ecosystem.
Example
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]);
}
Dependencies
~260–710KB
~17K SLoC