diff --git a/protobuf-codegen/src/message.rs b/protobuf-codegen/src/message.rs index 862501343..ced60dd16 100644 --- a/protobuf-codegen/src/message.rs +++ b/protobuf-codegen/src/message.rs @@ -386,8 +386,7 @@ impl<'a> MessageGen<'a> { if self.serde_derive_enabled() { w.write_line("#[serde(skip)]"); } - // TODO: make public - w.field_decl("unknown_fields", "::protobuf::UnknownFields"); + w.pub_field_decl("unknown_fields", "::protobuf::UnknownFields"); if self.serde_derive_enabled() { w.write_line("#[serde(skip)]"); } diff --git a/protobuf/src/descriptor.rs b/protobuf/src/descriptor.rs index 116d30c7a..8d0a6bb2c 100644 --- a/protobuf/src/descriptor.rs +++ b/protobuf/src/descriptor.rs @@ -26,7 +26,7 @@ pub struct FileDescriptorSet { // message fields file: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -194,7 +194,7 @@ pub struct FileDescriptorProto { source_code_info: ::protobuf::SingularPtrField, syntax: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -892,7 +892,7 @@ pub struct DescriptorProto { reserved_range: ::protobuf::RepeatedField, reserved_name: ::protobuf::RepeatedField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -1486,7 +1486,7 @@ pub struct DescriptorProto_ExtensionRange { start: ::std::option::Option, end: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -1674,7 +1674,7 @@ pub struct DescriptorProto_ReservedRange { start: ::std::option::Option, end: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -1870,7 +1870,7 @@ pub struct FieldDescriptorProto { json_name: ::protobuf::SingularField<::std::string::String>, options: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -2595,7 +2595,7 @@ pub struct OneofDescriptorProto { name: ::protobuf::SingularField<::std::string::String>, options: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -2814,7 +2814,7 @@ pub struct EnumDescriptorProto { value: ::protobuf::RepeatedField, options: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -3081,7 +3081,7 @@ pub struct EnumValueDescriptorProto { number: ::std::option::Option, options: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -3339,7 +3339,7 @@ pub struct ServiceDescriptorProto { method: ::protobuf::RepeatedField, options: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -3609,7 +3609,7 @@ pub struct MethodDescriptorProto { client_streaming: ::std::option::Option, server_streaming: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -4022,7 +4022,7 @@ pub struct FileOptions { csharp_namespace: ::protobuf::SingularField<::std::string::String>, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -4843,7 +4843,7 @@ pub struct MessageOptions { map_entry: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -5162,7 +5162,7 @@ pub struct FieldOptions { weak: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -5649,7 +5649,7 @@ pub struct OneofOptions { // message fields uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -5808,7 +5808,7 @@ pub struct EnumOptions { deprecated: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -6044,7 +6044,7 @@ pub struct EnumValueOptions { deprecated: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -6241,7 +6241,7 @@ pub struct ServiceOptions { deprecated: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -6438,7 +6438,7 @@ pub struct MethodOptions { deprecated: ::std::option::Option, uninterpreted_option: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -6640,7 +6640,7 @@ pub struct UninterpretedOption { string_value: ::protobuf::SingularField<::std::vec::Vec>, aggregate_value: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -7071,7 +7071,7 @@ pub struct UninterpretedOption_NamePart { name_part: ::protobuf::SingularField<::std::string::String>, is_extension: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -7277,7 +7277,7 @@ pub struct SourceCodeInfo { // message fields location: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -7438,7 +7438,7 @@ pub struct SourceCodeInfo_Location { trailing_comments: ::protobuf::SingularField<::std::string::String>, leading_detached_comments: ::protobuf::RepeatedField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -7781,7 +7781,7 @@ pub struct GeneratedCodeInfo { // message fields annotation: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -7941,7 +7941,7 @@ pub struct GeneratedCodeInfo_Annotation { begin: ::std::option::Option, end: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/plugin.rs b/protobuf/src/plugin.rs index 873d76d64..6272765e3 100644 --- a/protobuf/src/plugin.rs +++ b/protobuf/src/plugin.rs @@ -28,7 +28,7 @@ pub struct CodeGeneratorRequest { parameter: ::protobuf::SingularField<::std::string::String>, proto_file: ::protobuf::RepeatedField<::protobuf::descriptor::FileDescriptorProto>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -278,7 +278,7 @@ pub struct CodeGeneratorResponse { error: ::protobuf::SingularField<::std::string::String>, file: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -489,7 +489,7 @@ pub struct CodeGeneratorResponse_File { insertion_point: ::protobuf::SingularField<::std::string::String>, content: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/any.rs b/protobuf/src/well_known_types/any.rs index ca64a59ad..fd4634d76 100644 --- a/protobuf/src/well_known_types/any.rs +++ b/protobuf/src/well_known_types/any.rs @@ -27,7 +27,7 @@ pub struct Any { pub type_url: ::std::string::String, pub value: ::std::vec::Vec, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/api.rs b/protobuf/src/well_known_types/api.rs index b5eddcb16..bd220edd3 100644 --- a/protobuf/src/well_known_types/api.rs +++ b/protobuf/src/well_known_types/api.rs @@ -32,7 +32,7 @@ pub struct Api { pub mixins: ::protobuf::RepeatedField, pub syntax: ::protobuf::well_known_types::Syntax, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -459,7 +459,7 @@ pub struct Method { pub options: ::protobuf::RepeatedField<::protobuf::well_known_types::Option>, pub syntax: ::protobuf::well_known_types::Syntax, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -838,7 +838,7 @@ pub struct Mixin { pub name: ::std::string::String, pub root: ::std::string::String, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/duration.rs b/protobuf/src/well_known_types/duration.rs index e5710242e..c960ad902 100644 --- a/protobuf/src/well_known_types/duration.rs +++ b/protobuf/src/well_known_types/duration.rs @@ -27,7 +27,7 @@ pub struct Duration { pub seconds: i64, pub nanos: i32, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/empty.rs b/protobuf/src/well_known_types/empty.rs index b2c4ca3d4..ca9078cfc 100644 --- a/protobuf/src/well_known_types/empty.rs +++ b/protobuf/src/well_known_types/empty.rs @@ -24,7 +24,7 @@ use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; #[derive(PartialEq,Clone,Default)] pub struct Empty { // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/field_mask.rs b/protobuf/src/well_known_types/field_mask.rs index e820bcbe1..3a936c212 100644 --- a/protobuf/src/well_known_types/field_mask.rs +++ b/protobuf/src/well_known_types/field_mask.rs @@ -26,7 +26,7 @@ pub struct FieldMask { // message fields pub paths: ::protobuf::RepeatedField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/source_context.rs b/protobuf/src/well_known_types/source_context.rs index 64825896f..c723a50d5 100644 --- a/protobuf/src/well_known_types/source_context.rs +++ b/protobuf/src/well_known_types/source_context.rs @@ -26,7 +26,7 @@ pub struct SourceContext { // message fields pub file_name: ::std::string::String, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/struct_pb.rs b/protobuf/src/well_known_types/struct_pb.rs index 78e78af68..66a6e7c9e 100644 --- a/protobuf/src/well_known_types/struct_pb.rs +++ b/protobuf/src/well_known_types/struct_pb.rs @@ -26,7 +26,7 @@ pub struct Struct { // message fields pub fields: ::std::collections::HashMap<::std::string::String, Value>, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -171,7 +171,7 @@ pub struct Value { // message oneof groups pub kind: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -655,7 +655,7 @@ pub struct ListValue { // message fields pub values: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/timestamp.rs b/protobuf/src/well_known_types/timestamp.rs index a18ea5f31..87f0279d3 100644 --- a/protobuf/src/well_known_types/timestamp.rs +++ b/protobuf/src/well_known_types/timestamp.rs @@ -27,7 +27,7 @@ pub struct Timestamp { pub seconds: i64, pub nanos: i32, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } diff --git a/protobuf/src/well_known_types/type_pb.rs b/protobuf/src/well_known_types/type_pb.rs index aec89878a..92145e7d6 100644 --- a/protobuf/src/well_known_types/type_pb.rs +++ b/protobuf/src/well_known_types/type_pb.rs @@ -31,7 +31,7 @@ pub struct Type { pub source_context: ::protobuf::SingularPtrField<::protobuf::well_known_types::SourceContext>, pub syntax: Syntax, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -412,7 +412,7 @@ pub struct Field { pub json_name: ::std::string::String, pub default_value: ::std::string::String, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -1054,7 +1054,7 @@ pub struct Enum { pub source_context: ::protobuf::SingularPtrField<::protobuf::well_known_types::SourceContext>, pub syntax: Syntax, // special fields - unknown_fields: ::protobuf::UnknownFields, + pub unknown_fields: ::protobuf::UnknownFields, cached_size: ::protobuf::CachedSize, } @@ -1388,7 +1388,7 @@ pub struct EnumValue { pub number: i32, pub options: ::protobuf::RepeatedField