122 stable releases

3.7.1 Oct 15, 2024
3.5.1 Aug 19, 2024
3.5.0 Jun 26, 2024
3.4.0 Feb 26, 2024
0.0.5 Nov 28, 2014

#34 in Encoding

Download history 364147/week @ 2024-08-23 337913/week @ 2024-08-30 380897/week @ 2024-09-06 319158/week @ 2024-09-13 377176/week @ 2024-09-20 377963/week @ 2024-09-27 354107/week @ 2024-10-04 368962/week @ 2024-10-11 412782/week @ 2024-10-18 382215/week @ 2024-10-25 360611/week @ 2024-11-01 369935/week @ 2024-11-08 432636/week @ 2024-11-15 353667/week @ 2024-11-22 384626/week @ 2024-11-29 341304/week @ 2024-12-06

1,599,239 downloads per month
Used in 1,606 crates (467 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 generate 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

~265–780KB
~17K SLoC