Crates.io | protobuf-codegen-pure3 |
lib.rs | protobuf-codegen-pure3 |
version | 2.28.2 |
source | src |
created_at | 2022-09-07 10:55:33.956394 |
updated_at | 2023-02-27 06:22:56.774348 |
description | Pure-rust codegen for protobuf using protobuf-parser crate WIP |
homepage | https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-codegen-pure/ |
repository | https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-codegen-pure/ |
max_upload_size | |
id | 660308 |
size | 266,269 |
.rs
filesThis API does not require protoc
command present in $PATH
.
extern crate protoc_rust;
fn main() {
protobuf_codegen_pure::Codegen::new()
.out_dir("src/protos")
.inputs(&["protos/a.proto", "protos/b.proto"])
.include("protos")
.run()
.expect("Codegen failed.");
}
And in Cargo.toml
:
[build-dependencies]
protobuf-codegen-pure = "2"
It is advisable that protobuf-codegen-pure
build-dependecy version be the same as
protobuf
dependency.
The alternative is to use protoc-rust
crate
which uses protoc
command for parsing (so it uses the same parser
Google is using in their protobuf implementations).
This is documentation for version 2 of the crate.
In version 3, this API is moved to
protobuf-codegen
crate.