3 releases

4.0.0-alpha.2 Aug 23, 2022

#1805 in Encoding

Download history 171/week @ 2024-06-17 240/week @ 2024-06-24 106/week @ 2024-07-01 192/week @ 2024-07-08 205/week @ 2024-07-15 177/week @ 2024-07-22 269/week @ 2024-07-29 235/week @ 2024-08-05 196/week @ 2024-08-12 178/week @ 2024-08-19 280/week @ 2024-08-26 113/week @ 2024-09-02 113/week @ 2024-09-09 167/week @ 2024-09-16 200/week @ 2024-09-23 107/week @ 2024-09-30

599 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

~260–770KB
~17K SLoC