v0.2.0
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 intoprost-build
. - A new crate,
prost-types
, containing Protobuf well-known types has been added. The code generator will automatically useprost-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 ofHashMap
for map fields. - Custom code generation for protobuf
service
definitions.
- Using
- New prost-specific error types,
prost::EncodeError
andprost::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.