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

#52 in Encoding

Download history 334928/week @ 2024-07-19 334626/week @ 2024-07-26 341570/week @ 2024-08-02 352987/week @ 2024-08-09 336552/week @ 2024-08-16 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 298839/week @ 2024-11-01

1,530,740 downloads per month
Used in 1,579 crates (454 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

~0.3–0.8MB
~18K SLoC