118 stable releases

3.4.0 Feb 26, 2024
3.3.0 Oct 2, 2023
3.2.0 Sep 26, 2022
3.1.0 Jun 22, 2022
0.0.5 Nov 28, 2014

#8 in Encoding

Download history 271804/week @ 2024-01-05 273702/week @ 2024-01-12 306120/week @ 2024-01-19 295871/week @ 2024-01-26 294667/week @ 2024-02-02 313070/week @ 2024-02-09 272940/week @ 2024-02-16 305930/week @ 2024-02-23 311201/week @ 2024-03-01 311029/week @ 2024-03-08 330402/week @ 2024-03-15 303491/week @ 2024-03-22 327662/week @ 2024-03-29 309237/week @ 2024-04-05 320360/week @ 2024-04-12 278343/week @ 2024-04-19

1,296,701 downloads per month
Used in 1,443 crates (425 directly)

MIT license

1.5MB
29K SLoC

Library to read and write protocol buffers data

Features

This crate has one feature, which is with-bytes.

with-bytes enables protobuf crate support for bytes crate: when parsing bytes or strings from bytes::Bytes, protobuf will be able to reference the input instead of allocating subarrays.

Note, codegen also need to be instructed to generate Bytes or Chars for bytes or string protobuf types instead of default Vec<u8> or String, just enabling option on this crate is not enough.

See Customize struct in protobuf-codegen crate.

Accompanying crates

  • protobuf-json-mapping implements JSON parsing and serialization for protobuf messages.
  • protobuf-codegen can be used to rust code from .proto crates.
  • protoc-bin-vendored contains protoc command packed into the crate.
  • protobuf-parse contains .proto file parser. Rarely need to be used directly, but can be used for mechanical processing of .proto files.

Dependencies

~0.3–0.9MB
~20K SLoC