Changelog after version 3.0.0 lives in CHANGELOG.md.
- New stable version released.
- JSON support is moved into a separate crate
protobuf-json-mapping - Generated code for well known types is more similar to regular protobuf now
(well known type modules are now placed as is in
well_known_typesmodule instead of being flattened). file_descriptor_proto()function is private now in generated code. Descriptor can be obtained by callingfile_descriptor().proto().file_descriptor()now returns&'static FileDescriptor- Hide
UnknownValuesfrom public API (keepUnknownFields)
- More efficient reflective operations
- Fewer internals exposed from public API (e.g.
ProtobufTypeis no longer public)
- keywords are now escaped with
_suffix - generate trivial
is_initializedfunctions when possible
- all fields are public now in generated messages
protobuf-supportcrate added. This crate contains utilities shared by other protobuf crates. This crate has no public API.
- remove
expose_oneofcodegen option (it is on by default for a long time) - remove unused serde-related options from
rustproto.proto - in generated code, enum variant names are converted to camel case
- generate
SpecialFieldsfield in messages instead of a pair (unknown_fields,cached_size) - reflection operations like
nested_messagesnow return iterator instead ofVec - replace
fn Enum::values()withconst Enum::VALUES - remove
EnumFull::enum_descriptor(), does not provide much value overenum_descriptor_static - rename
EnumFull::enum_descriptor_static->enum_descriptor - fix
EnumFull::descriptorfor enums withallow_alias - rename
MessageDescriptor::enumstonested_enums - rename
MessageDescriptor::descriptor_statictodescriptor - add
EnumDescriptor::enclosing_message() Messagenow requiresPartialEq
- Unimplement
DerefMutforMessageField:DerefMutwhich modifies the object state is too dangerous.Derefis kept though.Derefreturns an empty instance if field is not set. - Added
Message::clear, removed traitClear Lazy(which is used in generated code) is now implemented withonce_cellcrate.- protobuf 3 experimental
optionalfields are implemented
- Lite runtime generation is restored. When lite runtime requested, code is generated without reflection support.
liteoption can be specified when usingprotoc-gen-rustplugin similarly to how C++ or Java do.
- Getters are now generated without
get_prefix.get_prefix also removed from public API functions. - Reflection API now supports
ServiceDescriptor. Which can be used to generate code for gRPC for example. - Message size computation uses u64 now. It is explicit error now on attempt to serialize a message larger than 2GiB.
- Binary message parsing now switches by tag, not by field name. It is faster.
- Fixed invalid aliasing and uninitialized memory access
MessageFieldnow implementsDerefandDerefMut- Slightly more compact generated code
- serde is no longer supported natively. See explanations in the issue.
- Rename
ProtobufErrortoErrorand make it opaque type. RenameProtobufResulttoResult. - Rename
ProtobufEnumtoEnumandProtobufEnumOrUnknowntoEnumOrUnknown gen_mod_rsoption istrueby default now: code generator now generatesmod.rswith modulescarllercheoptions renamed totokio(sincebytescrate now lives intokioorg)protobuf-parseAPI cleanup (API used to parse.protofiles, not protocol buffers data files)- Remove
protoccrate, most of it is incorprotated intoprotobuf-parsecrate, and the rest is not very useful - Generated enums for
oneofare marked#[non_exhaustive]
- Dynamic messages work (but not tested enough)
Displayfor message now outputs text format, andDebugfor message does standard rust#[derive(Debug)].- Smaller generated code (common code snippets extracted into the library runtime)
- Improvements in dynamic messages
- Remove
protobuf-codegen-pureandprotoc-rustcrates. Now all codegen (pure or withprotocis done usingprotobuf-codegencrate). LazyV2(internal utility for rust-protobuf) now implementsDrop.- Default
.protoparser inprotobuf-codegenis now pure-rust (not usingprotoccommand) - Dynamic messages mostly work
- Use
always_output_default_valuesoption to output empty array for repeated fields when serializing to JSON - Switch error handling to
thiserrorandanyhowcrates .protofile parsing now lives in a separate crateprotobuf-parse
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 PartialEqwith large number of fields now panics. Previosly it could cause stack overflow in the Rust compiler.- Change
message_down_cast*functions signatures - Remove
descriptorxfromprotobufcrate
- Option to store repeated message fields in
Vecinstead ofRepeatedField. This option may be turned on by default later. - Similarly, option to store singular field on
Optioninstead ofSingularPtrField, which also may be turned on by default later. generate_getteroption to disable generation of getters functions.- Flush
CodedOutputStreamondrop
- backport optional fields from version 3
protoc-bin-vendorednow lives in a separate repository
- Min rust version bumped back to 1.52.1
- Bump min rust version to 1.55.0
- Fixed invalid aliasing and uninitialized memory access
- Documentation
- Min supported Rust version is 1.52.1.
- Fix
SingularField::unwrap_or_default serde_rename_allcodegen option
- Accidentally published version roughtly equivalent to 2.23.0
- Update bundled
protocversion to 3.15.8
- Work around some breaking changes in Rust nightly
- Slightly better prefix stripping algorithm in pure rust codegen: "." is now considered to be a prefix for "foo/bar.proto". (Probably Rust stdlib should do that out of the box)
- Update bundled version of
protocto version 3.14.0 protoc-bin-vendorednow includesgoogle/**.protofiles, soimport "google/protobuf/Timestamp.proto"should work with this crate without relying on external files
- update
bytescrate dependency version from 0.6 to 1.0
- Add
UnknownFields::remove - Fix several inconsistencies between
protocparser and pure rust parser protobuf::parse_from*functions are deprecated, useprotobuf::Message::parse_from*instead- impl
IntoIteratorfor&mut RepeatedField<T>and forRepeatedField<T> - update
bytescrate dependency version from 0.5 to 0.6
- Backport
rust::skipworkaround from 2.22.1
gen_mod_rscodegen option can be used to generate.rsfiles friendlier to generating files in$OUT_DIR
protoccrate now depends onwhichcrate forprotocbinary lookup- pure rust codegen output adjusted to be closer to
protoc-command based output RepeatedField::retainis implemented
- Fix compilation when feature
with-bytesis enabled
- Mute self-deprecation warning when compiling rust-protobuf
- Generated repeated and message fields for proto2 are public now (for proto3 all fields are already public).
- Generated code no longer contains
unsafe - Minor changes in generated files
- Min supported rust version if 1.44.1 now
- Replace deprecated
#![cfg_attr(rustfmt, rustfmt_skip)]with#![rustfmt::skip]
- Rename
protoc_rust::Argstoprotoc_rust::Codegen - Rename
protobuf_codegen_pure::Argstoprotobuf_codegen_pure::Codegen protoc-bin-vendoredcrate introduced
- Implement Any::pack,is,unpack operations
- Rename
protoc::Argstoprotoc::ProtocLangOut
- Generated code for reflection now references messages by Protobuf name, not by Rust name.
- Rename
ProtobufValueReftoReflectValueRef. Old name is kept for a while.
- Generated code now uses
associated constant
Lazy::INITforLazyintialization instead of initializing fields directly.
- Oneof names are escaped now in generated code
- Added
dynto a list of rust keyword needed escaping
- Remove accidentally slipped into 2.10 version check
- Minimum supported Rust version is 1.40.0 now
bytescrate upgraded to 0.5
ProtobufErrornow provides error message inDisplayinstead ofError::descriptionDebugis now implemented forEnumValueDescriptorandReflectValueRef
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
protocbinary. UnknownFields::fieldsfield 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
usestatements) - 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 Traitsyntax. inside_protobufoption 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
HashofUnknownFields - Improve rustdoc a little
- lite_runtime rust-protobuf option
- Fix OOM on malformed input
- Minimum supported Rust version is 1.26
- Implement
HashforUnknownFields
generate_accessorsoptions to disable generation of accessor functions (except getters).Defaultis now implented for all&MyMessagetypesDebugis now implemented for oneof enums
- Implement
From<Option<T>> for SingularPtrField<T>
- Revert clippy annotations
- Support of
protoccommand 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
protoccodegen options can now be passed with--rust_optflag - Serde is now supported
unknown_fieldsfield 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.protobut 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
.protoare now supported - Generated code now uses closures instead of private functions for reflection
- Drop
MessageStatictrait - Protobuf no longer exposes internal
hexmodule protobuf-codegenis a separate crate- Drop old reflection accessors. Now code may need to be regenerated when protobuf version changed.
- Implement
std::iotraits byCodedInputStreamandCodedOutputStream *descriptor_static()function signatures no longer includeOptionparam (1, 2)
- Start of changelog
- First commit added to the repository