15 releases
0.0.16 | Jan 18, 2024 |
---|---|
0.0.15 | Dec 14, 2023 |
0.0.14 | Oct 28, 2023 |
0.0.12 | May 9, 2023 |
0.0.5 | Nov 20, 2020 |
#856 in Encoding
115KB
2K
SLoC
pb-jelly-gen
It's working! It's working! - Anakin Skywalker
This crate provides a tool to generate Rust
code from proto2
or proto3
files.
How To Use
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:
- Running
brew install protobuf
or... - Download or build from source
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"])
}
Dependencies
~3–12MB
~155K SLoC