#protobuf #bindings #demonstrate #protoc #how #together #protobuf-codegen

app protobuf-example

Example use of Rust Protocol Buffers bindings

2 releases (0 unstable)

4.31.0-beta1 Mar 6, 2025
4.30.0-beta1 Dec 18, 2024

#286 in Encoding

Download history 100/week @ 2024-12-17 125/week @ 2025-03-04 14/week @ 2025-03-11

139 downloads per month

BSD-3-Clause

4KB

An example that demonstrates how to use the protobuf and protobuf_codegen crates together.

How to get a compatible version of protoc

Usage of this crate currently requires protoc to be built from source, as it relies on changes that have not been included in the newest protoc release yet.

A future stable release will be compatible with the officially released protoc binaries.

You can build a compatible protoc from source as follows:

git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout rust-prerelease-4.31.0-beta1
cmake . -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON
cmake --build . --parallel 12"

Dependencies

~2MB
~38K SLoC