Version 3.0 is backward incompatible with 2.0 version. Changes are listed here:
- Enum fields are now
generated as
ProtobufEnumOrUnknown<E>
- Nested messages are now generated in nested mods
- Getters are no longer generated for public fields
- Field accessors (getters and setters) are not generated by default for public fields
- Remove global
parse_length_delimited*
functions PartialEq
with large number of fields now panics. Previosly it could cause stack overflow in the Rust compiler.- Change
message_down_cast*
functions signatures - Remove
descriptorx
fromprotobuf
crate - well_known_types::Any gets pack, unpack, is operations
- Option to store repeated message fields in
Vec
instead ofRepeatedField
. This option may be turned on by default later. - Similarly, option to store singular field on
Option
instead ofSingularPtrField
, which also may be turned on by default later. generate_getter
option to disable generation of getters functions.- Flush
CodedOutputStream
ondrop
- Rename
protoc_rust::Args
toprotoc_rust::Codegen
- Rename
protobuf_codegen_pure::Args
toprotobuf_codegen_pure::Codegen
protoc-bin-vendored
crate introduced
- Implement Any::pack,is,unpack operations
- Rename
protoc::Args
toprotoc::ProtocLangOut
- Generated code for reflection now references messages by Protobuf name, not by Rust name.
- Rename
ProtobufValueRef
toReflectValueRef
. Old name is kept for a while.
- Generated code now uses
associated constant
Lazy::INIT
forLazy
intialization instead of initializing fields directly.
- Oneof names are escaped now in generated code
- Added
dyn
to a list of rust keyword needed escaping
- Remove accidentally slipped into 2.10 version check
- Minimum supported Rust version is 1.40.0 now
bytes
crate upgraded to 0.5
ProtobufError
now provides error message inDisplay
instead ofError::description
Debug
is now implemented forEnumValueDescriptor
andReflectValueRef
Changes in 2.9 branch are not included in 2.10.
- Minimum supported Rust version is 1.34.2 now
- Generated code by protobuf compiler is now compatible
only with exactly the same version of protobuf library.
Note you can use
pure rust protobuf compiler
to avoid dependency on
protoc
binary. UnknownFields::fields
field is no longer public
- Text format and JSON printing and parsing is now implemented
- Mutation reflection is implemented
- All fields are public now except optional or repeated fields when
syntax = "proto2"
, but message fields are public even whensyntax = "proto2"
Box<dyn Message>
now implementsClone
- Generated code is slightly cleaner now (does not use
use
statements) - Generated code no longer uses unsafe (protobuf library still does)
- Add a couple functions to reflection
- Minimum supported Rust version
is 1.27.
This version stabilizes
dyn Trait
syntax. inside_protobuf
option is added which slightly modifies generated code inside protobuf. Should not affect users.- Generated files are now compatible only with the same version of runtime
- Fixed codegen for mutually recursive messages with oneofs
- Clippy annotations are now generated as
#[allow(clippy::all)]
instead of#[allow(clippy)]
- Fix
Hash
ofUnknownFields
- Improve rustdoc a little
- lite_runtime rust-protobuf option
- Fix OOM on malformed input
- Minimum supported Rust version is 1.26
- Implement
Hash
forUnknownFields
generate_accessors
options to disable generation of accessor functions (except getters).Default
is now implented for all&MyMessage
typesDebug
is now implemented for oneof enums
- Implement
From<Option<T>> for SingularPtrField<T>
- Revert clippy annotations
- Support of
protoc
command from Google protobuf before 3.0 is dropped (it might work, but not tested by CI); this does not affectsyntax = "proto2"
which is supported - When using
protoc
codegen options can now be passed with--rust_opt
flag - Serde is now supported
unknown_fields
field is public now
- Global
parse_length_delimited*
functions are deprecated - Fixed a bug with quotes in string literal parsing in pure codegen
- Minimum bytes version is 0.4 now (since protobuf doesn't work with 0.3 anyway)
- Fix panic on singular string field appeared more than once
- Properly handle map fields with key or value skipped in binary proto
- Make rust-protobuf compatible with rust 1.23.0
- Fix codegen with enum with default value a reserved rust keyword
- Rebublished branch 1.6 because of backward compatibility issues in 1.6 branch
- Fix panic on singular string field appeared more than once
- Properly handle map fields with key or value skipped in binary proto
- Make rust-protobuf compatible with rust 1.23.0
- Fix codegen with enum with default value a reserved rust keyword
- Rebublished branch 1.5 because of backward compatibility issues in 1.6 branch
Republished as 2.0.0
- Pure rust codegen
- Generated code can now be customized not only with
rustproto.proto
but also when invoked programmatically withprotoc-rust
- Oneof are now public by default
- Option to specify recursion limit
- Implement conversions for
Repeated*
- Proto files with suffixes others than
.proto
are now supported - Generated code now uses closures instead of private functions for reflection
- Drop
MessageStatic
trait - Protobuf no longer exposes internal
hex
module protobuf-codegen
is a separate crate- Drop old reflection accessors. Now code may need to be regenerated when protobuf version changed.
- Implement
std::io
traits byCodedInputStream
andCodedOutputStream
*descriptor_static()
function signatures no longer includeOption
param (1, 2)
- Start of changelog