123 stable releases

new 4.31.0-rc.2 Apr 30, 2025
4.31.0-beta1 Mar 6, 2025
4.30.0-beta1 Dec 18, 2024
3.7.2 Mar 10, 2025
0.0.5 Nov 28, 2014

#68 in Network programming

Download history 437852/week @ 2025-01-10 371887/week @ 2025-01-17 395383/week @ 2025-01-24 448321/week @ 2025-01-31 570865/week @ 2025-02-07 539136/week @ 2025-02-14 614379/week @ 2025-02-21 628033/week @ 2025-02-28 636596/week @ 2025-03-07 619242/week @ 2025-03-14 592323/week @ 2025-03-21 600362/week @ 2025-03-28 605095/week @ 2025-04-04 649848/week @ 2025-04-11 616596/week @ 2025-04-18 606891/week @ 2025-04-25

2,586,302 downloads per month
Used in 1,720 crates (491 directly)

BSD-3-Clause

1.5MB
32K SLoC

C 26K SLoC // 0.1% comments Rust 5.5K SLoC // 0.1% comments Bitbake 806 SLoC // 0.2% 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.

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

The protoc binary that you use to generate code needs to have a version that exactly matches the version of the protobuf crate you are using. More specifically, if you are using Rust protobuf x.y.z then you need to use protoc y.z. See here for more details on our versioning scheme.

The easiest way to get ahold of protoc is to download a prebuilt binary from the matching release here. Just make sure protoc is on your $PATH when you run cargo.

Dependencies