3 releases

4.0.0-alpha.2 Aug 23, 2022

#2221 in Encoding

Download history 181/week @ 2024-07-20 270/week @ 2024-07-27 234/week @ 2024-08-03 191/week @ 2024-08-10 190/week @ 2024-08-17 252/week @ 2024-08-24 139/week @ 2024-08-31 113/week @ 2024-09-07 161/week @ 2024-09-14 195/week @ 2024-09-21 129/week @ 2024-09-28 91/week @ 2024-10-05 152/week @ 2024-10-12 185/week @ 2024-10-19 251/week @ 2024-10-26 254/week @ 2024-11-02

865 downloads per month
Used in 9 crates (3 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.8MB
~18K SLoC