#protobuf #run-time #google #protoc #data #edge #source

sys staging-protobuf

Protocol Buffers - Google's data interchange format

3 releases (0 unstable)

new 4.30.0-beta1 Dec 18, 2024
4.30.0-beta Dec 4, 2024
4.27.3-beta.0 Oct 22, 2024

#1938 in Encoding

Download history 145/week @ 2024-10-21 7/week @ 2024-10-28 144/week @ 2024-12-02 20/week @ 2024-12-09

164 downloads per month
Used in staging-protobuf-example

BSD-3-Clause

1.5MB
31K SLoC

C 25K SLoC // 0.1% comments Rust 5K SLoC // 0.1% comments Bitbake 725 SLoC // 0.1% comments Bazel 58 SLoC // 0.1% comments

The runtime of the official Google Rust Protobuf implementation.

This is currently a beta release: the API is subject to change, and there may be some rough edges, including missing documentation and features.

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.

An example for how to use this crate can be found in the protobuf_example crate

V4 ownership and implementation change

V4 of this crate is officially supported by the Protobuf team at Google. Prior major versions were developed by as a community project by stepancheg who generously donated the crate name to Google.

V4 is a completely new implementation with a different API, as well as a fundamentally different approach than prior versions of this crate. It focuses on delivering a high-quality Rust API which is backed by either a pure C implementation (upb) or the Protobuf C++ implementation. This choice was made for performance, feature parity, development velocity, and security reasons. More discussion about the rationale and design philosophy can be found at https://protobuf.dev/reference/rust/.

It is not planned for the V3 pure Rust lineage to be actively developed going forward. While it is not expected to receive significant further development, as a stable and high quality pure Rust implementation, many open source projects may reasonably continue to stay on the V3 API.

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 $TAG
cmake . -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON
cmake --build . --parallel 12"

Dependencies