Skip to content

v0.2.0

Compare
Choose a tag to compare
@danburkert danburkert released this 10 Sep 19:46
· 466 commits to master since this release

PROST! is a Protocol Buffers implementation for the Rust Language. prost generates simple, idiomatic Rust code from proto2 and proto3 files.

prost 0.2.0 includes many improvements over the previous version, including:

  • The prost-codegen crate has been removed, and its functionality has been combined into prost-build.
  • A new crate, prost-types, containing Protobuf well-known types has been added. The code generator will automatically use prost-types when well-known types are encountered during .proto.rs code generation.
  • Field accessors for proto2 optional fields and enum fields have been made more ergonomic.
  • prost-build has a new builder API (prost_build::Config), which can be used to specify custom code generation options. Current options include:
    • Using BTreeMap instead of HashMap for map fields.
    • Custom code generation for protobuf service definitions.
  • New prost-specific error types, prost::EncodeError and prost::DecodeError for encoding and decoding results.
  • The prost::Message trait has been made more flexible, and more ergonomic.
  • varint encoding and decoding has been optimized, see the following commit messages for results:
  • Default values are now preserved during code generation (bugfix).
  • New Message::clear method.