Crates.io | pb-jelly-gen |
lib.rs | pb-jelly-gen |
version | 0.0.16 |
source | src |
created_at | 2020-09-16 01:13:38.719683 |
updated_at | 2024-01-18 21:29:28.375112 |
description | A protobuf binding generation framework for the Rust language developed at Dropbox |
homepage | https://github.com/dropbox/pb-jelly |
repository | https://github.com/dropbox/pb-jelly/tree/main/pb-jelly-gen |
max_upload_size | |
id | 289282 |
size | 130,220 |
pb-jelly-gen
This crate provides a tool to generate Rust
code from proto2
or proto3
files.
python
+ protoc
The core of this crate is a python script codegen.py
that is provided to the protobuf compiler, protoc
as a plugin.
You'll need the protobuf compiler which you can get by:
brew install protobuf
or...protobuf
Once you've completed the above steps, you should include this crate as a build-dependency in your Cargo.toml
and then call the API of this crate from a build.rs
files in the root of your repo.
Cargo.toml
[build-dependencies]
pb-jelly-gen = "0.0.16"
build.rs
use pb_jelly_gen::gen_protos;
fn main() -> std::io::Result<()> {
// Replace `./protos` with a path to your proto files.
gen_protos(vec!["./protos"])
}