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_types
module 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
UnknownValues
from public API (keepUnknownFields
)
- More efficient reflective operations
- Fewer internals exposed from public API (e.g.
ProtobufType
is no longer public)
- keywords are now escaped with
_
suffix - generate trivial
is_initialized
functions when possible
- all fields are public now in generated messages
protobuf-support
crate added. This crate contains utilities shared by other protobuf crates. This crate has no public API.
- remove
expose_oneof
codegen 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
SpecialFields
field in messages instead of a pair (unknown_fields
,cached_size
) - reflection operations like
nested_messages
now 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::descriptor
for enums withallow_alias
- rename
MessageDescriptor::enums
tonested_enums
- rename
MessageDescriptor::descriptor_static
todescriptor
- add
EnumDescriptor::enclosing_message()
Message
now requiresPartialEq
- Unimplement
DerefMut
forMessageField
:DerefMut
which modifies the object state is too dangerous.Deref
is kept though.Deref
returns an empty instance if field is not set. - Added
Message::clear
, removed traitClear
Lazy
(which is used in generated code) is now implemented withonce_cell
crate.- protobuf 3 experimental
optional
fields are implemented
- Lite runtime generation is restored. When lite runtime requested, code is generated without reflection support.
lite
option can be specified when usingprotoc-gen-rust
plugin 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
MessageField
now implementsDeref
andDerefMut
- Slightly more compact generated code
- serde is no longer supported natively. See explanations in the issue.
- Rename
ProtobufError
toError
and make it opaque type. RenameProtobufResult
toResult
. - Rename
ProtobufEnum
toEnum
andProtobufEnumOrUnknown
toEnumOrUnknown
gen_mod_rs
option istrue
by default now: code generator now generatesmod.rs
with modulescarllerche
options renamed totokio
(sincebytes
crate now lives intokio
org)protobuf-parse
API cleanup (API used to parse.proto
files, not protocol buffers data files)- Remove
protoc
crate, most of it is incorprotated intoprotobuf-parse
crate, and the rest is not very useful - Generated enums for
oneof
are marked#[non_exhaustive]
- Dynamic messages work (but not tested enough)
Display
for message now outputs text format, andDebug
for message does standard rust#[derive(Debug)]
.- Smaller generated code (common code snippets extracted into the library runtime)
- Improvements in dynamic messages
- Remove
protobuf-codegen-pure
andprotoc-rust
crates. Now all codegen (pure or withprotoc
is done usingprotobuf-codegen
crate). LazyV2
(internal utility for rust-protobuf) now implementsDrop
.- Default
.proto
parser inprotobuf-codegen
is now pure-rust (not usingprotoc
command) - Dynamic messages mostly work
- Use
always_output_default_values
option to output empty array for repeated fields when serializing to JSON - Switch error handling to
thiserror
andanyhow
crates .proto
file 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 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
- 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
- backport optional fields from version 3
protoc-bin-vendored
now 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_all
codegen option
- Accidentally published version roughtly equivalent to 2.23.0
- Update bundled
protoc
version 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
protoc
to version 3.14.0 protoc-bin-vendored
now includesgoogle/**.proto
files, soimport "google/protobuf/Timestamp.proto"
should work with this crate without relying on external files
- update
bytes
crate dependency version from 0.6 to 1.0
- Add
UnknownFields::remove
- Fix several inconsistencies between
protoc
parser and pure rust parser protobuf::parse_from*
functions are deprecated, useprotobuf::Message::parse_from*
instead- impl
IntoIterator
for&mut RepeatedField<T>
and forRepeatedField<T>
- update
bytes
crate dependency version from 0.5 to 0.6
- Backport
rust::skip
workaround from 2.22.1
gen_mod_rs
codegen option can be used to generate.rs
files friendlier to generating files in$OUT_DIR
protoc
crate now depends onwhich
crate forprotoc
binary lookup- pure rust codegen output adjusted to be closer to
protoc
-command based output RepeatedField::retain
is implemented
- Fix compilation when feature
with-bytes
is 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::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
- First commit added to the repository