diff --git a/pb-jelly-gen/src/protos.rs b/pb-jelly-gen/src/protos.rs index 2aea7a1..df6d01a 100644 --- a/pb-jelly-gen/src/protos.rs +++ b/pb-jelly-gen/src/protos.rs @@ -31,8 +31,7 @@ pub mod google { impl CodeGeneratorResponse_Feature { pub const FEATURE_NONE: CodeGeneratorResponse_Feature = CodeGeneratorResponse_Feature(0); pub const FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse_Feature = CodeGeneratorResponse_Feature(1); - pub const FEATURE_SUPPORTS_EDITIONS: CodeGeneratorResponse_Feature = CodeGeneratorResponse_Feature(2); - pub const KNOWN_VARIANTS: [CodeGeneratorResponse_Feature; 3] = [CodeGeneratorResponse_Feature::FEATURE_NONE, CodeGeneratorResponse_Feature::FEATURE_PROTO3_OPTIONAL, CodeGeneratorResponse_Feature::FEATURE_SUPPORTS_EDITIONS]; + pub const KNOWN_VARIANTS: [CodeGeneratorResponse_Feature; 2] = [CodeGeneratorResponse_Feature::FEATURE_NONE, CodeGeneratorResponse_Feature::FEATURE_PROTO3_OPTIONAL]; pub const fn value(self) -> i32 { self.0 } @@ -65,7 +64,6 @@ pub mod google { match self { CodeGeneratorResponse_Feature::FEATURE_NONE => ::std::option::Option::Some(CodeGeneratorResponse_Feature_Closed::FEATURE_NONE), CodeGeneratorResponse_Feature::FEATURE_PROTO3_OPTIONAL => ::std::option::Option::Some(CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL), - CodeGeneratorResponse_Feature::FEATURE_SUPPORTS_EDITIONS => ::std::option::Option::Some(CodeGeneratorResponse_Feature_Closed::FEATURE_SUPPORTS_EDITIONS), _ => None, } } @@ -84,10 +82,9 @@ pub mod google { pub enum CodeGeneratorResponse_Feature_Closed { FEATURE_NONE = 0, FEATURE_PROTO3_OPTIONAL = 1, - FEATURE_SUPPORTS_EDITIONS = 2, } impl CodeGeneratorResponse_Feature_Closed { - pub const KNOWN_VARIANTS: [CodeGeneratorResponse_Feature_Closed; 3] = [CodeGeneratorResponse_Feature_Closed::FEATURE_NONE, CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL, CodeGeneratorResponse_Feature_Closed::FEATURE_SUPPORTS_EDITIONS]; + pub const KNOWN_VARIANTS: [CodeGeneratorResponse_Feature_Closed; 2] = [CodeGeneratorResponse_Feature_Closed::FEATURE_NONE, CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL]; } impl ::std::default::Default for CodeGeneratorResponse_Feature_Closed { fn default() -> Self { @@ -99,7 +96,6 @@ pub mod google { match v { CodeGeneratorResponse_Feature_Closed::FEATURE_NONE => 0, CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL => 1, - CodeGeneratorResponse_Feature_Closed::FEATURE_SUPPORTS_EDITIONS => 2, } } } @@ -109,7 +105,6 @@ pub mod google { match v { 0 => Ok(CodeGeneratorResponse_Feature_Closed::FEATURE_NONE), 1 => Ok(CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL), - 2 => Ok(CodeGeneratorResponse_Feature_Closed::FEATURE_SUPPORTS_EDITIONS), _ => Err(v), } } @@ -121,7 +116,6 @@ pub mod google { match self { CodeGeneratorResponse_Feature_Closed::FEATURE_NONE => "FEATURE_NONE", CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL => "FEATURE_PROTO3_OPTIONAL", - CodeGeneratorResponse_Feature_Closed::FEATURE_SUPPORTS_EDITIONS => "FEATURE_SUPPORTS_EDITIONS", } } } @@ -360,11 +354,6 @@ pub mod google { /// they import. The files will appear in topological order, so each file /// appears before any file that imports it. - /// Note: the files listed in files_to_generate will include runtime-retention - /// options only, but all other files will include source-retention options. - /// The source_file_descriptors field below is available in case you need - /// source-retention options for files_to_generate. - /// protoc guarantees that all proto_files will be written after /// the fields above, even though this is not technically guaranteed by the /// protobuf wire format. This theoretically could allow a plugin to stream @@ -376,10 +365,6 @@ pub mod google { /// Type names of fields and extensions in the FileDescriptorProto are always /// fully qualified. pub proto_file: ::std::vec::Vec, - /// File descriptors with all options, including source-retention options. - /// These descriptors are only provided for the files listed in - /// files_to_generate. - pub source_file_descriptors: ::std::vec::Vec, /// The version number of protocol compiler. pub compiler_version: ::std::option::Option, } @@ -420,18 +405,6 @@ pub mod google { pub fn mut_proto_file(&mut self) -> &mut ::std::vec::Vec { &mut self.proto_file } - pub fn set_source_file_descriptors(&mut self, v: ::std::vec::Vec) { - self.source_file_descriptors = v; - } - pub fn take_source_file_descriptors(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.source_file_descriptors) - } - pub fn get_source_file_descriptors(&self) -> &[super::super::super::super::google::protobuf::descriptor::FileDescriptorProto] { - &self.source_file_descriptors - } - pub fn mut_source_file_descriptors(&mut self) -> &mut ::std::vec::Vec { - &mut self.source_file_descriptors - } pub fn has_compiler_version(&self) -> bool { self.compiler_version.is_some() } @@ -451,7 +424,6 @@ pub mod google { file_to_generate: ::std::default::Default::default(), parameter: ::std::default::Default::default(), proto_file: ::std::default::Default::default(), - source_file_descriptors: ::std::default::Default::default(), compiler_version: ::std::default::Default::default(), } } @@ -492,19 +464,10 @@ pub mod google { label: ::pb_jelly::Label::Repeated, oneof_index: None, }, - ::pb_jelly::FieldDescriptor { - name: "source_file_descriptors", - full_name: "google.protobuf.compiler.CodeGeneratorRequest.source_file_descriptors", - index: 3, - number: 17, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, ::pb_jelly::FieldDescriptor { name: "compiler_version", full_name: "google.protobuf.compiler.CodeGeneratorRequest.compiler_version", - index: 4, + index: 3, number: 3, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, @@ -541,14 +504,6 @@ pub mod google { proto_file_size += l; } size += proto_file_size; - let mut source_file_descriptors_size = 0; - for val in &self.source_file_descriptors { - let l = ::pb_jelly::Message::compute_size(val); - source_file_descriptors_size += ::pb_jelly::wire_format::serialized_length(17); - source_file_descriptors_size += ::pb_jelly::varint::serialized_length(l as u64); - source_file_descriptors_size += l; - } - size += source_file_descriptors_size; let mut compiler_version_size = 0; if let Some(ref val) = self.compiler_version { let l = ::pb_jelly::Message::compute_size(val); @@ -584,12 +539,6 @@ pub mod google { ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.source_file_descriptors { - ::pb_jelly::wire_format::write(17, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { @@ -607,10 +556,6 @@ pub mod google { let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "CodeGeneratorRequest", 15)?; self.proto_file.push(val); } - 17 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "CodeGeneratorRequest", 17)?; - self.source_file_descriptors.push(val); - } 3 => { let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "CodeGeneratorRequest", 3)?; self.compiler_version = Some(val); @@ -642,9 +587,6 @@ pub mod google { "proto_file" => { unimplemented!("Repeated fields are not currently supported.") } - "source_file_descriptors" => { - unimplemented!("Repeated fields are not currently supported.") - } "compiler_version" => { ::pb_jelly::reflection::FieldMut::Value(self.compiler_version.get_or_insert_with(::std::default::Default::default)) } @@ -1142,262 +1084,6 @@ pub mod google { }} } pub mod descriptor { - /// The full set of known editions. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct Edition(i32); - impl Edition { - /// A placeholder for an unknown edition value. - pub const EDITION_UNKNOWN: Edition = Edition(0); - /// Legacy syntax "editions". These pre-date editions, but behave much like - /// distinct editions. These can't be used to specify the edition of proto - /// files, but feature definitions must supply proto2/proto3 defaults for - /// backwards compatibility. - pub const EDITION_PROTO2: Edition = Edition(998); - pub const EDITION_PROTO3: Edition = Edition(999); - /// Editions that have been released. The specific values are arbitrary and - /// should not be depended on, but they will always be time-ordered for easy - /// comparison. - pub const EDITION_2023: Edition = Edition(1000); - /// Placeholder editions for testing feature resolution. These should not be - /// used or relyed on outside of tests. - pub const EDITION_1_TEST_ONLY: Edition = Edition(1); - pub const EDITION_2_TEST_ONLY: Edition = Edition(2); - pub const EDITION_99997_TEST_ONLY: Edition = Edition(99997); - pub const EDITION_99998_TEST_ONLY: Edition = Edition(99998); - pub const EDITION_99999_TEST_ONLY: Edition = Edition(99999); - pub const KNOWN_VARIANTS: [Edition; 9] = [Edition::EDITION_UNKNOWN, Edition::EDITION_PROTO2, Edition::EDITION_PROTO3, Edition::EDITION_2023, Edition::EDITION_1_TEST_ONLY, Edition::EDITION_2_TEST_ONLY, Edition::EDITION_99997_TEST_ONLY, Edition::EDITION_99998_TEST_ONLY, Edition::EDITION_99999_TEST_ONLY]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for Edition { - fn default() -> Self { - Edition::EDITION_UNKNOWN - } - } - impl From for i32 { - fn from(v: Edition) -> i32 { - v.0 - } - } - impl From for Edition { - fn from(v: i32) -> Edition { - Edition(v) - } - } - impl From for Edition { - fn from(v: Edition_Closed) -> Edition { - Edition(v as i32) - } - } - impl ::pb_jelly::ProtoEnum for Edition { - } - impl ::pb_jelly::OpenProtoEnum for Edition { - type Closed = Edition_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - Edition::EDITION_UNKNOWN => ::std::option::Option::Some(Edition_Closed::EDITION_UNKNOWN), - Edition::EDITION_PROTO2 => ::std::option::Option::Some(Edition_Closed::EDITION_PROTO2), - Edition::EDITION_PROTO3 => ::std::option::Option::Some(Edition_Closed::EDITION_PROTO3), - Edition::EDITION_2023 => ::std::option::Option::Some(Edition_Closed::EDITION_2023), - Edition::EDITION_1_TEST_ONLY => ::std::option::Option::Some(Edition_Closed::EDITION_1_TEST_ONLY), - Edition::EDITION_2_TEST_ONLY => ::std::option::Option::Some(Edition_Closed::EDITION_2_TEST_ONLY), - Edition::EDITION_99997_TEST_ONLY => ::std::option::Option::Some(Edition_Closed::EDITION_99997_TEST_ONLY), - Edition::EDITION_99998_TEST_ONLY => ::std::option::Option::Some(Edition_Closed::EDITION_99998_TEST_ONLY), - Edition::EDITION_99999_TEST_ONLY => ::std::option::Option::Some(Edition_Closed::EDITION_99999_TEST_ONLY), - _ => None, - } - } - } - impl ::std::fmt::Debug for Edition { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } - } - } - /// The full set of known editions. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum Edition_Closed { - /// A placeholder for an unknown edition value. - EDITION_UNKNOWN = 0, - /// Legacy syntax "editions". These pre-date editions, but behave much like - /// distinct editions. These can't be used to specify the edition of proto - /// files, but feature definitions must supply proto2/proto3 defaults for - /// backwards compatibility. - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - /// Editions that have been released. The specific values are arbitrary and - /// should not be depended on, but they will always be time-ordered for easy - /// comparison. - EDITION_2023 = 1000, - /// Placeholder editions for testing feature resolution. These should not be - /// used or relyed on outside of tests. - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - } - impl Edition_Closed { - pub const KNOWN_VARIANTS: [Edition_Closed; 9] = [Edition_Closed::EDITION_UNKNOWN, Edition_Closed::EDITION_PROTO2, Edition_Closed::EDITION_PROTO3, Edition_Closed::EDITION_2023, Edition_Closed::EDITION_1_TEST_ONLY, Edition_Closed::EDITION_2_TEST_ONLY, Edition_Closed::EDITION_99997_TEST_ONLY, Edition_Closed::EDITION_99998_TEST_ONLY, Edition_Closed::EDITION_99999_TEST_ONLY]; - } - impl ::std::default::Default for Edition_Closed { - fn default() -> Self { - Edition_Closed::EDITION_UNKNOWN - } - } - impl From for i32 { - fn from(v: Edition_Closed) -> i32 { - match v { - Edition_Closed::EDITION_UNKNOWN => 0, - Edition_Closed::EDITION_PROTO2 => 998, - Edition_Closed::EDITION_PROTO3 => 999, - Edition_Closed::EDITION_2023 => 1000, - Edition_Closed::EDITION_1_TEST_ONLY => 1, - Edition_Closed::EDITION_2_TEST_ONLY => 2, - Edition_Closed::EDITION_99997_TEST_ONLY => 99997, - Edition_Closed::EDITION_99998_TEST_ONLY => 99998, - Edition_Closed::EDITION_99999_TEST_ONLY => 99999, - } - } - } - impl ::std::convert::TryFrom for Edition_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(Edition_Closed::EDITION_UNKNOWN), - 998 => Ok(Edition_Closed::EDITION_PROTO2), - 999 => Ok(Edition_Closed::EDITION_PROTO3), - 1000 => Ok(Edition_Closed::EDITION_2023), - 1 => Ok(Edition_Closed::EDITION_1_TEST_ONLY), - 2 => Ok(Edition_Closed::EDITION_2_TEST_ONLY), - 99997 => Ok(Edition_Closed::EDITION_99997_TEST_ONLY), - 99998 => Ok(Edition_Closed::EDITION_99998_TEST_ONLY), - 99999 => Ok(Edition_Closed::EDITION_99999_TEST_ONLY), - _ => Err(v), - } - } - } - impl ::pb_jelly::ProtoEnum for Edition_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for Edition_Closed { - fn name(self) -> &'static str { - match self { - Edition_Closed::EDITION_UNKNOWN => "EDITION_UNKNOWN", - Edition_Closed::EDITION_PROTO2 => "EDITION_PROTO2", - Edition_Closed::EDITION_PROTO3 => "EDITION_PROTO3", - Edition_Closed::EDITION_2023 => "EDITION_2023", - Edition_Closed::EDITION_1_TEST_ONLY => "EDITION_1_TEST_ONLY", - Edition_Closed::EDITION_2_TEST_ONLY => "EDITION_2_TEST_ONLY", - Edition_Closed::EDITION_99997_TEST_ONLY => "EDITION_99997_TEST_ONLY", - Edition_Closed::EDITION_99998_TEST_ONLY => "EDITION_99998_TEST_ONLY", - Edition_Closed::EDITION_99999_TEST_ONLY => "EDITION_99999_TEST_ONLY", - } - } - } - - /// The verification state of the extension range. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct ExtensionRangeOptions_VerificationState(i32); - impl ExtensionRangeOptions_VerificationState { - /// All the extensions of the range must be declared. - pub const DECLARATION: ExtensionRangeOptions_VerificationState = ExtensionRangeOptions_VerificationState(0); - pub const UNVERIFIED: ExtensionRangeOptions_VerificationState = ExtensionRangeOptions_VerificationState(1); - pub const KNOWN_VARIANTS: [ExtensionRangeOptions_VerificationState; 2] = [ExtensionRangeOptions_VerificationState::DECLARATION, ExtensionRangeOptions_VerificationState::UNVERIFIED]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for ExtensionRangeOptions_VerificationState { - fn default() -> Self { - ExtensionRangeOptions_VerificationState::DECLARATION - } - } - impl From for i32 { - fn from(v: ExtensionRangeOptions_VerificationState) -> i32 { - v.0 - } - } - impl From for ExtensionRangeOptions_VerificationState { - fn from(v: i32) -> ExtensionRangeOptions_VerificationState { - ExtensionRangeOptions_VerificationState(v) - } - } - impl From for ExtensionRangeOptions_VerificationState { - fn from(v: ExtensionRangeOptions_VerificationState_Closed) -> ExtensionRangeOptions_VerificationState { - ExtensionRangeOptions_VerificationState(v as i32) - } - } - impl ::pb_jelly::ProtoEnum for ExtensionRangeOptions_VerificationState { - } - impl ::pb_jelly::OpenProtoEnum for ExtensionRangeOptions_VerificationState { - type Closed = ExtensionRangeOptions_VerificationState_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - ExtensionRangeOptions_VerificationState::DECLARATION => ::std::option::Option::Some(ExtensionRangeOptions_VerificationState_Closed::DECLARATION), - ExtensionRangeOptions_VerificationState::UNVERIFIED => ::std::option::Option::Some(ExtensionRangeOptions_VerificationState_Closed::UNVERIFIED), - _ => None, - } - } - } - impl ::std::fmt::Debug for ExtensionRangeOptions_VerificationState { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } - } - } - /// The verification state of the extension range. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum ExtensionRangeOptions_VerificationState_Closed { - /// All the extensions of the range must be declared. - DECLARATION = 0, - UNVERIFIED = 1, - } - impl ExtensionRangeOptions_VerificationState_Closed { - pub const KNOWN_VARIANTS: [ExtensionRangeOptions_VerificationState_Closed; 2] = [ExtensionRangeOptions_VerificationState_Closed::DECLARATION, ExtensionRangeOptions_VerificationState_Closed::UNVERIFIED]; - } - impl ::std::default::Default for ExtensionRangeOptions_VerificationState_Closed { - fn default() -> Self { - ExtensionRangeOptions_VerificationState_Closed::DECLARATION - } - } - impl From for i32 { - fn from(v: ExtensionRangeOptions_VerificationState_Closed) -> i32 { - match v { - ExtensionRangeOptions_VerificationState_Closed::DECLARATION => 0, - ExtensionRangeOptions_VerificationState_Closed::UNVERIFIED => 1, - } - } - } - impl ::std::convert::TryFrom for ExtensionRangeOptions_VerificationState_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(ExtensionRangeOptions_VerificationState_Closed::DECLARATION), - 1 => Ok(ExtensionRangeOptions_VerificationState_Closed::UNVERIFIED), - _ => Err(v), - } - } - } - impl ::pb_jelly::ProtoEnum for ExtensionRangeOptions_VerificationState_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for ExtensionRangeOptions_VerificationState_Closed { - fn name(self) -> &'static str { - match self { - ExtensionRangeOptions_VerificationState_Closed::DECLARATION => "DECLARATION", - ExtensionRangeOptions_VerificationState_Closed::UNVERIFIED => "UNVERIFIED", - } - } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] pub struct FieldDescriptorProto_Type(i32); @@ -1418,10 +1104,9 @@ pub mod google { pub const TYPE_BOOL: FieldDescriptorProto_Type = FieldDescriptorProto_Type(8); pub const TYPE_STRING: FieldDescriptorProto_Type = FieldDescriptorProto_Type(9); /// Tag-delimited aggregate. - /// Group type is deprecated and not supported after google.protobuf. However, Proto3 + /// Group type is deprecated and not supported in proto3. However, Proto3 /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. In Editions, the group wire format - /// can be enabled via the `message_encoding` feature. + /// treat group fields as unknown fields. pub const TYPE_GROUP: FieldDescriptorProto_Type = FieldDescriptorProto_Type(10); /// Length-delimited aggregate. pub const TYPE_MESSAGE: FieldDescriptorProto_Type = FieldDescriptorProto_Type(11); @@ -1515,10 +1200,9 @@ pub mod google { TYPE_BOOL = 8, TYPE_STRING = 9, /// Tag-delimited aggregate. - /// Group type is deprecated and not supported after google.protobuf. However, Proto3 + /// Group type is deprecated and not supported in proto3. However, Proto3 /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. In Editions, the group wire format - /// can be enabled via the `message_encoding` feature. + /// treat group fields as unknown fields. TYPE_GROUP = 10, /// Length-delimited aggregate. TYPE_MESSAGE = 11, @@ -1624,12 +1308,9 @@ pub mod google { impl FieldDescriptorProto_Label { /// 0 is reserved for errors pub const LABEL_OPTIONAL: FieldDescriptorProto_Label = FieldDescriptorProto_Label(1); - pub const LABEL_REPEATED: FieldDescriptorProto_Label = FieldDescriptorProto_Label(3); - /// The required label is only allowed in google.protobuf. In proto3 and Editions - /// it's explicitly prohibited. In Editions, the `field_presence` feature - /// can be used to get this behavior. pub const LABEL_REQUIRED: FieldDescriptorProto_Label = FieldDescriptorProto_Label(2); - pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label; 3] = [FieldDescriptorProto_Label::LABEL_OPTIONAL, FieldDescriptorProto_Label::LABEL_REPEATED, FieldDescriptorProto_Label::LABEL_REQUIRED]; + pub const LABEL_REPEATED: FieldDescriptorProto_Label = FieldDescriptorProto_Label(3); + pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label; 3] = [FieldDescriptorProto_Label::LABEL_OPTIONAL, FieldDescriptorProto_Label::LABEL_REQUIRED, FieldDescriptorProto_Label::LABEL_REPEATED]; pub const fn value(self) -> i32 { self.0 } @@ -1661,8 +1342,8 @@ pub mod google { fn into_known(self) -> ::std::option::Option { match self { FieldDescriptorProto_Label::LABEL_OPTIONAL => ::std::option::Option::Some(FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL), - FieldDescriptorProto_Label::LABEL_REPEATED => ::std::option::Option::Some(FieldDescriptorProto_Label_Closed::LABEL_REPEATED), FieldDescriptorProto_Label::LABEL_REQUIRED => ::std::option::Option::Some(FieldDescriptorProto_Label_Closed::LABEL_REQUIRED), + FieldDescriptorProto_Label::LABEL_REPEATED => ::std::option::Option::Some(FieldDescriptorProto_Label_Closed::LABEL_REPEATED), _ => None, } } @@ -1680,14 +1361,11 @@ pub mod google { pub enum FieldDescriptorProto_Label_Closed { /// 0 is reserved for errors LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - /// The required label is only allowed in google.protobuf. In proto3 and Editions - /// it's explicitly prohibited. In Editions, the `field_presence` feature - /// can be used to get this behavior. LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, } impl FieldDescriptorProto_Label_Closed { - pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label_Closed; 3] = [FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL, FieldDescriptorProto_Label_Closed::LABEL_REPEATED, FieldDescriptorProto_Label_Closed::LABEL_REQUIRED]; + pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label_Closed; 3] = [FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL, FieldDescriptorProto_Label_Closed::LABEL_REQUIRED, FieldDescriptorProto_Label_Closed::LABEL_REPEATED]; } impl ::std::default::Default for FieldDescriptorProto_Label_Closed { fn default() -> Self { @@ -1698,8 +1376,8 @@ pub mod google { fn from(v: FieldDescriptorProto_Label_Closed) -> i32 { match v { FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL => 1, - FieldDescriptorProto_Label_Closed::LABEL_REPEATED => 3, FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => 2, + FieldDescriptorProto_Label_Closed::LABEL_REPEATED => 3, } } } @@ -1708,8 +1386,8 @@ pub mod google { fn try_from(v: i32) -> ::std::result::Result { match v { 1 => Ok(FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL), - 3 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REPEATED), 2 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REQUIRED), + 3 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REPEATED), _ => Err(v), } } @@ -1720,8 +1398,8 @@ pub mod google { fn name(self) -> &'static str { match self { FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL => "LABEL_OPTIONAL", - FieldDescriptorProto_Label_Closed::LABEL_REPEATED => "LABEL_REPEATED", FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => "LABEL_REQUIRED", + FieldDescriptorProto_Label_Closed::LABEL_REPEATED => "LABEL_REPEATED", } } } @@ -1842,12 +1520,6 @@ pub mod google { impl FieldOptions_CType { /// Default mode. pub const STRING: FieldOptions_CType = FieldOptions_CType(0); - /// The option [ctype=CORD] may be applied to a non-repeated field of type - /// "bytes". It indicates that in C++, the data should be stored in a Cord - /// instead of a string. For very large strings, this may reduce memory - /// fragmentation. It may also allow better performance when parsing from a - /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then - /// alias the original buffer. pub const CORD: FieldOptions_CType = FieldOptions_CType(1); pub const STRING_PIECE: FieldOptions_CType = FieldOptions_CType(2); pub const KNOWN_VARIANTS: [FieldOptions_CType; 3] = [FieldOptions_CType::STRING, FieldOptions_CType::CORD, FieldOptions_CType::STRING_PIECE]; @@ -1901,12 +1573,6 @@ pub mod google { pub enum FieldOptions_CType_Closed { /// Default mode. STRING = 0, - /// The option [ctype=CORD] may be applied to a non-repeated field of type - /// "bytes". It indicates that in C++, the data should be stored in a Cord - /// instead of a string. For very large strings, this may reduce memory - /// fragmentation. It may also allow better performance when parsing from a - /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then - /// alias the original buffer. CORD = 1, STRING_PIECE = 2, } @@ -2056,262 +1722,6 @@ pub mod google { } } - /// If set to RETENTION_SOURCE, the option will be omitted from the binary. - /// Note: as of January 2023, support for this is in progress and does not yet - /// have an effect (b/264593489). - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FieldOptions_OptionRetention(i32); - impl FieldOptions_OptionRetention { - pub const RETENTION_UNKNOWN: FieldOptions_OptionRetention = FieldOptions_OptionRetention(0); - pub const RETENTION_RUNTIME: FieldOptions_OptionRetention = FieldOptions_OptionRetention(1); - pub const RETENTION_SOURCE: FieldOptions_OptionRetention = FieldOptions_OptionRetention(2); - pub const KNOWN_VARIANTS: [FieldOptions_OptionRetention; 3] = [FieldOptions_OptionRetention::RETENTION_UNKNOWN, FieldOptions_OptionRetention::RETENTION_RUNTIME, FieldOptions_OptionRetention::RETENTION_SOURCE]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for FieldOptions_OptionRetention { - fn default() -> Self { - FieldOptions_OptionRetention::RETENTION_UNKNOWN - } - } - impl From for i32 { - fn from(v: FieldOptions_OptionRetention) -> i32 { - v.0 - } - } - impl From for FieldOptions_OptionRetention { - fn from(v: i32) -> FieldOptions_OptionRetention { - FieldOptions_OptionRetention(v) - } - } - impl From for FieldOptions_OptionRetention { - fn from(v: FieldOptions_OptionRetention_Closed) -> FieldOptions_OptionRetention { - FieldOptions_OptionRetention(v as i32) - } - } - impl ::pb_jelly::ProtoEnum for FieldOptions_OptionRetention { - } - impl ::pb_jelly::OpenProtoEnum for FieldOptions_OptionRetention { - type Closed = FieldOptions_OptionRetention_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FieldOptions_OptionRetention::RETENTION_UNKNOWN => ::std::option::Option::Some(FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN), - FieldOptions_OptionRetention::RETENTION_RUNTIME => ::std::option::Option::Some(FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME), - FieldOptions_OptionRetention::RETENTION_SOURCE => ::std::option::Option::Some(FieldOptions_OptionRetention_Closed::RETENTION_SOURCE), - _ => None, - } - } - } - impl ::std::fmt::Debug for FieldOptions_OptionRetention { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } - } - } - /// If set to RETENTION_SOURCE, the option will be omitted from the binary. - /// Note: as of January 2023, support for this is in progress and does not yet - /// have an effect (b/264593489). - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FieldOptions_OptionRetention_Closed { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2, - } - impl FieldOptions_OptionRetention_Closed { - pub const KNOWN_VARIANTS: [FieldOptions_OptionRetention_Closed; 3] = [FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN, FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME, FieldOptions_OptionRetention_Closed::RETENTION_SOURCE]; - } - impl ::std::default::Default for FieldOptions_OptionRetention_Closed { - fn default() -> Self { - FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN - } - } - impl From for i32 { - fn from(v: FieldOptions_OptionRetention_Closed) -> i32 { - match v { - FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN => 0, - FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME => 1, - FieldOptions_OptionRetention_Closed::RETENTION_SOURCE => 2, - } - } - } - impl ::std::convert::TryFrom for FieldOptions_OptionRetention_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN), - 1 => Ok(FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME), - 2 => Ok(FieldOptions_OptionRetention_Closed::RETENTION_SOURCE), - _ => Err(v), - } - } - } - impl ::pb_jelly::ProtoEnum for FieldOptions_OptionRetention_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FieldOptions_OptionRetention_Closed { - fn name(self) -> &'static str { - match self { - FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN => "RETENTION_UNKNOWN", - FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME => "RETENTION_RUNTIME", - FieldOptions_OptionRetention_Closed::RETENTION_SOURCE => "RETENTION_SOURCE", - } - } - } - - /// This indicates the types of entities that the field may apply to when used - /// as an option. If it is unset, then the field may be freely used as an - /// option on any kind of entity. Note: as of January 2023, support for this is - /// in progress and does not yet have an effect (b/264593489). - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FieldOptions_OptionTargetType(i32); - impl FieldOptions_OptionTargetType { - pub const TARGET_TYPE_UNKNOWN: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(0); - pub const TARGET_TYPE_FILE: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(1); - pub const TARGET_TYPE_EXTENSION_RANGE: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(2); - pub const TARGET_TYPE_MESSAGE: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(3); - pub const TARGET_TYPE_FIELD: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(4); - pub const TARGET_TYPE_ONEOF: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(5); - pub const TARGET_TYPE_ENUM: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(6); - pub const TARGET_TYPE_ENUM_ENTRY: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(7); - pub const TARGET_TYPE_SERVICE: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(8); - pub const TARGET_TYPE_METHOD: FieldOptions_OptionTargetType = FieldOptions_OptionTargetType(9); - pub const KNOWN_VARIANTS: [FieldOptions_OptionTargetType; 10] = [FieldOptions_OptionTargetType::TARGET_TYPE_UNKNOWN, FieldOptions_OptionTargetType::TARGET_TYPE_FILE, FieldOptions_OptionTargetType::TARGET_TYPE_EXTENSION_RANGE, FieldOptions_OptionTargetType::TARGET_TYPE_MESSAGE, FieldOptions_OptionTargetType::TARGET_TYPE_FIELD, FieldOptions_OptionTargetType::TARGET_TYPE_ONEOF, FieldOptions_OptionTargetType::TARGET_TYPE_ENUM, FieldOptions_OptionTargetType::TARGET_TYPE_ENUM_ENTRY, FieldOptions_OptionTargetType::TARGET_TYPE_SERVICE, FieldOptions_OptionTargetType::TARGET_TYPE_METHOD]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for FieldOptions_OptionTargetType { - fn default() -> Self { - FieldOptions_OptionTargetType::TARGET_TYPE_UNKNOWN - } - } - impl From for i32 { - fn from(v: FieldOptions_OptionTargetType) -> i32 { - v.0 - } - } - impl From for FieldOptions_OptionTargetType { - fn from(v: i32) -> FieldOptions_OptionTargetType { - FieldOptions_OptionTargetType(v) - } - } - impl From for FieldOptions_OptionTargetType { - fn from(v: FieldOptions_OptionTargetType_Closed) -> FieldOptions_OptionTargetType { - FieldOptions_OptionTargetType(v as i32) - } - } - impl ::pb_jelly::ProtoEnum for FieldOptions_OptionTargetType { - } - impl ::pb_jelly::OpenProtoEnum for FieldOptions_OptionTargetType { - type Closed = FieldOptions_OptionTargetType_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FieldOptions_OptionTargetType::TARGET_TYPE_UNKNOWN => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN), - FieldOptions_OptionTargetType::TARGET_TYPE_FILE => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FILE), - FieldOptions_OptionTargetType::TARGET_TYPE_EXTENSION_RANGE => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_EXTENSION_RANGE), - FieldOptions_OptionTargetType::TARGET_TYPE_MESSAGE => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_MESSAGE), - FieldOptions_OptionTargetType::TARGET_TYPE_FIELD => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FIELD), - FieldOptions_OptionTargetType::TARGET_TYPE_ONEOF => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ONEOF), - FieldOptions_OptionTargetType::TARGET_TYPE_ENUM => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM), - FieldOptions_OptionTargetType::TARGET_TYPE_ENUM_ENTRY => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM_ENTRY), - FieldOptions_OptionTargetType::TARGET_TYPE_SERVICE => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_SERVICE), - FieldOptions_OptionTargetType::TARGET_TYPE_METHOD => ::std::option::Option::Some(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_METHOD), - _ => None, - } - } - } - impl ::std::fmt::Debug for FieldOptions_OptionTargetType { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } - } - } - /// This indicates the types of entities that the field may apply to when used - /// as an option. If it is unset, then the field may be freely used as an - /// option on any kind of entity. Note: as of January 2023, support for this is - /// in progress and does not yet have an effect (b/264593489). - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FieldOptions_OptionTargetType_Closed { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9, - } - impl FieldOptions_OptionTargetType_Closed { - pub const KNOWN_VARIANTS: [FieldOptions_OptionTargetType_Closed; 10] = [FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FILE, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_EXTENSION_RANGE, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_MESSAGE, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FIELD, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ONEOF, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM_ENTRY, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_SERVICE, FieldOptions_OptionTargetType_Closed::TARGET_TYPE_METHOD]; - } - impl ::std::default::Default for FieldOptions_OptionTargetType_Closed { - fn default() -> Self { - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN - } - } - impl From for i32 { - fn from(v: FieldOptions_OptionTargetType_Closed) -> i32 { - match v { - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN => 0, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FILE => 1, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_EXTENSION_RANGE => 2, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_MESSAGE => 3, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FIELD => 4, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ONEOF => 5, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM => 6, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM_ENTRY => 7, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_SERVICE => 8, - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_METHOD => 9, - } - } - } - impl ::std::convert::TryFrom for FieldOptions_OptionTargetType_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN), - 1 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FILE), - 2 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_EXTENSION_RANGE), - 3 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_MESSAGE), - 4 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FIELD), - 5 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ONEOF), - 6 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM), - 7 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM_ENTRY), - 8 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_SERVICE), - 9 => Ok(FieldOptions_OptionTargetType_Closed::TARGET_TYPE_METHOD), - _ => Err(v), - } - } - } - impl ::pb_jelly::ProtoEnum for FieldOptions_OptionTargetType_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FieldOptions_OptionTargetType_Closed { - fn name(self) -> &'static str { - match self { - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FILE => "TARGET_TYPE_FILE", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE", - FieldOptions_OptionTargetType_Closed::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD", - } - } - } - /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, /// or neither? HTTP based RPC implementation may choose GET verb for safe /// methods, and PUT verb for idempotent methods instead of the default POST. @@ -2422,767 +1832,422 @@ pub mod google { } } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_FieldPresence(i32); - impl FeatureSet_FieldPresence { - pub const FIELD_PRESENCE_UNKNOWN: FeatureSet_FieldPresence = FeatureSet_FieldPresence(0); - pub const EXPLICIT: FeatureSet_FieldPresence = FeatureSet_FieldPresence(1); - pub const IMPLICIT: FeatureSet_FieldPresence = FeatureSet_FieldPresence(2); - pub const LEGACY_REQUIRED: FeatureSet_FieldPresence = FeatureSet_FieldPresence(3); - pub const KNOWN_VARIANTS: [FeatureSet_FieldPresence; 4] = [FeatureSet_FieldPresence::FIELD_PRESENCE_UNKNOWN, FeatureSet_FieldPresence::EXPLICIT, FeatureSet_FieldPresence::IMPLICIT, FeatureSet_FieldPresence::LEGACY_REQUIRED]; - pub const fn value(self) -> i32 { - self.0 - } + /// The protocol compiler can output a FileDescriptorSet containing the .proto + /// files it parses. + #[derive(Clone, Debug, PartialEq)] + pub struct FileDescriptorSet { + pub file: ::std::vec::Vec, } - impl ::std::default::Default for FeatureSet_FieldPresence { - fn default() -> Self { - FeatureSet_FieldPresence::FIELD_PRESENCE_UNKNOWN + impl FileDescriptorSet { + pub fn set_file(&mut self, v: ::std::vec::Vec) { + self.file = v; } - } - impl From for i32 { - fn from(v: FeatureSet_FieldPresence) -> i32 { - v.0 + pub fn take_file(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.file) } - } - impl From for FeatureSet_FieldPresence { - fn from(v: i32) -> FeatureSet_FieldPresence { - FeatureSet_FieldPresence(v) + pub fn get_file(&self) -> &[FileDescriptorProto] { + &self.file } - } - impl From for FeatureSet_FieldPresence { - fn from(v: FeatureSet_FieldPresence_Closed) -> FeatureSet_FieldPresence { - FeatureSet_FieldPresence(v as i32) + pub fn mut_file(&mut self) -> &mut ::std::vec::Vec { + &mut self.file } } - impl ::pb_jelly::ProtoEnum for FeatureSet_FieldPresence { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_FieldPresence { - type Closed = FeatureSet_FieldPresence_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_FieldPresence::FIELD_PRESENCE_UNKNOWN => ::std::option::Option::Some(FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN), - FeatureSet_FieldPresence::EXPLICIT => ::std::option::Option::Some(FeatureSet_FieldPresence_Closed::EXPLICIT), - FeatureSet_FieldPresence::IMPLICIT => ::std::option::Option::Some(FeatureSet_FieldPresence_Closed::IMPLICIT), - FeatureSet_FieldPresence::LEGACY_REQUIRED => ::std::option::Option::Some(FeatureSet_FieldPresence_Closed::LEGACY_REQUIRED), - _ => None, + impl ::std::default::Default for FileDescriptorSet { + fn default() -> Self { + FileDescriptorSet { + file: ::std::default::Default::default(), } } } - impl ::std::fmt::Debug for FeatureSet_FieldPresence { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), + ::lazy_static::lazy_static! { + pub static ref FileDescriptorSet_default: FileDescriptorSet = FileDescriptorSet::default(); + } + impl ::pb_jelly::Message for FileDescriptorSet { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "FileDescriptorSet", + full_name: "google.protobuf.FileDescriptorSet", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "file", + full_name: "google.protobuf.FileDescriptorSet.file", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ], + oneofs: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0; + let mut file_size = 0; + for val in &self.file { + let l = ::pb_jelly::Message::compute_size(val); + file_size += ::pb_jelly::wire_format::serialized_length(1); + file_size += ::pb_jelly::varint::serialized_length(l as u64); + file_size += l; } + size += file_size; + size } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_FieldPresence_Closed { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3, - } - impl FeatureSet_FieldPresence_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_FieldPresence_Closed; 4] = [FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN, FeatureSet_FieldPresence_Closed::EXPLICIT, FeatureSet_FieldPresence_Closed::IMPLICIT, FeatureSet_FieldPresence_Closed::LEGACY_REQUIRED]; - } - impl ::std::default::Default for FeatureSet_FieldPresence_Closed { - fn default() -> Self { - FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + for val in &self.file { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + Ok(()) } - } - impl From for i32 { - fn from(v: FeatureSet_FieldPresence_Closed) -> i32 { - match v { - FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN => 0, - FeatureSet_FieldPresence_Closed::EXPLICIT => 1, - FeatureSet_FieldPresence_Closed::IMPLICIT => 2, - FeatureSet_FieldPresence_Closed::LEGACY_REQUIRED => 3, + fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { + while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { + match field_number { + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorSet", 1)?; + self.file.push(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } } + Ok(()) } } - impl ::std::convert::TryFrom for FeatureSet_FieldPresence_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN), - 1 => Ok(FeatureSet_FieldPresence_Closed::EXPLICIT), - 2 => Ok(FeatureSet_FieldPresence_Closed::IMPLICIT), - 3 => Ok(FeatureSet_FieldPresence_Closed::LEGACY_REQUIRED), - _ => Err(v), + impl ::pb_jelly::Reflection for FileDescriptorSet { + fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { + match oneof_name { + _ => { + panic!("unknown oneof name given"); + } } } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_FieldPresence_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_FieldPresence_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_FieldPresence_Closed::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN", - FeatureSet_FieldPresence_Closed::EXPLICIT => "EXPLICIT", - FeatureSet_FieldPresence_Closed::IMPLICIT => "IMPLICIT", - FeatureSet_FieldPresence_Closed::LEGACY_REQUIRED => "LEGACY_REQUIRED", + fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { + match field_name { + "file" => { + unimplemented!("Repeated fields are not currently supported.") + } + _ => { + panic!("unknown field name given") + } } } } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_EnumType(i32); - impl FeatureSet_EnumType { - pub const ENUM_TYPE_UNKNOWN: FeatureSet_EnumType = FeatureSet_EnumType(0); - pub const OPEN: FeatureSet_EnumType = FeatureSet_EnumType(1); - pub const CLOSED: FeatureSet_EnumType = FeatureSet_EnumType(2); - pub const KNOWN_VARIANTS: [FeatureSet_EnumType; 3] = [FeatureSet_EnumType::ENUM_TYPE_UNKNOWN, FeatureSet_EnumType::OPEN, FeatureSet_EnumType::CLOSED]; - pub const fn value(self) -> i32 { - self.0 - } + /// Describes a complete .proto file. + #[derive(Clone, Debug, PartialEq)] + pub struct FileDescriptorProto { + /// file name, relative to root of source tree + pub name: ::std::option::Option<::std::string::String>, + /// e.g. "foo", "foo.bar", etc. + pub package: ::std::option::Option<::std::string::String>, + /// Names of files imported by this file. + pub dependency: ::std::vec::Vec<::std::string::String>, + /// Indexes of the public imported files in the dependency list above. + pub public_dependency: ::std::vec::Vec, + /// Indexes of the weak imported files in the dependency list. + /// For Google-internal migration only. Do not use. + pub weak_dependency: ::std::vec::Vec, + /// All top-level definitions in this file. + pub message_type: ::std::vec::Vec, + pub enum_type: ::std::vec::Vec, + pub service: ::std::vec::Vec, + pub extension: ::std::vec::Vec, + pub options: ::std::option::Option, + /// This field contains optional information about the original source code. + /// You may safely remove this entire field without harming runtime + /// functionality of the descriptors -- the information is needed only by + /// development tools. + pub source_code_info: ::std::option::Option, + /// The syntax of the proto file. + /// The supported values are "proto2" and "proto3". + pub syntax: ::std::option::Option<::std::string::String>, } - impl ::std::default::Default for FeatureSet_EnumType { - fn default() -> Self { - FeatureSet_EnumType::ENUM_TYPE_UNKNOWN + impl FileDescriptorProto { + pub fn has_name(&self) -> bool { + self.name.is_some() } - } - impl From for i32 { - fn from(v: FeatureSet_EnumType) -> i32 { - v.0 + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = Some(v); } - } - impl From for FeatureSet_EnumType { - fn from(v: i32) -> FeatureSet_EnumType { - FeatureSet_EnumType(v) + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_default() } - } - impl From for FeatureSet_EnumType { - fn from(v: FeatureSet_EnumType_Closed) -> FeatureSet_EnumType { - FeatureSet_EnumType(v as i32) + pub fn get_name(&self) -> &str { + self.name.as_deref().unwrap_or("") } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_EnumType { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_EnumType { - type Closed = FeatureSet_EnumType_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_EnumType::ENUM_TYPE_UNKNOWN => ::std::option::Option::Some(FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN), - FeatureSet_EnumType::OPEN => ::std::option::Option::Some(FeatureSet_EnumType_Closed::OPEN), - FeatureSet_EnumType::CLOSED => ::std::option::Option::Some(FeatureSet_EnumType_Closed::CLOSED), - _ => None, - } + pub fn has_package(&self) -> bool { + self.package.is_some() } - } - impl ::std::fmt::Debug for FeatureSet_EnumType { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } + pub fn set_package(&mut self, v: ::std::string::String) { + self.package = Some(v); } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_EnumType_Closed { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2, - } - impl FeatureSet_EnumType_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_EnumType_Closed; 3] = [FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN, FeatureSet_EnumType_Closed::OPEN, FeatureSet_EnumType_Closed::CLOSED]; - } - impl ::std::default::Default for FeatureSet_EnumType_Closed { - fn default() -> Self { - FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN + pub fn take_package(&mut self) -> ::std::string::String { + self.package.take().unwrap_or_default() } - } - impl From for i32 { - fn from(v: FeatureSet_EnumType_Closed) -> i32 { - match v { - FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN => 0, - FeatureSet_EnumType_Closed::OPEN => 1, - FeatureSet_EnumType_Closed::CLOSED => 2, - } + pub fn get_package(&self) -> &str { + self.package.as_deref().unwrap_or("") } - } - impl ::std::convert::TryFrom for FeatureSet_EnumType_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN), - 1 => Ok(FeatureSet_EnumType_Closed::OPEN), - 2 => Ok(FeatureSet_EnumType_Closed::CLOSED), - _ => Err(v), - } + pub fn set_dependency(&mut self, v: ::std::vec::Vec<::std::string::String>) { + self.dependency = v; } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_EnumType_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_EnumType_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_EnumType_Closed::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN", - FeatureSet_EnumType_Closed::OPEN => "OPEN", - FeatureSet_EnumType_Closed::CLOSED => "CLOSED", - } + pub fn take_dependency(&mut self) -> ::std::vec::Vec<::std::string::String> { + ::std::mem::take(&mut self.dependency) } - } - - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_RepeatedFieldEncoding(i32); - impl FeatureSet_RepeatedFieldEncoding { - pub const REPEATED_FIELD_ENCODING_UNKNOWN: FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding(0); - pub const PACKED: FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding(1); - pub const EXPANDED: FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding(2); - pub const KNOWN_VARIANTS: [FeatureSet_RepeatedFieldEncoding; 3] = [FeatureSet_RepeatedFieldEncoding::REPEATED_FIELD_ENCODING_UNKNOWN, FeatureSet_RepeatedFieldEncoding::PACKED, FeatureSet_RepeatedFieldEncoding::EXPANDED]; - pub const fn value(self) -> i32 { - self.0 + pub fn get_dependency(&self) -> &[::std::string::String] { + &self.dependency } - } - impl ::std::default::Default for FeatureSet_RepeatedFieldEncoding { - fn default() -> Self { - FeatureSet_RepeatedFieldEncoding::REPEATED_FIELD_ENCODING_UNKNOWN + pub fn mut_dependency(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { + &mut self.dependency } - } - impl From for i32 { - fn from(v: FeatureSet_RepeatedFieldEncoding) -> i32 { - v.0 + pub fn set_public_dependency(&mut self, v: ::std::vec::Vec) { + self.public_dependency = v; } - } - impl From for FeatureSet_RepeatedFieldEncoding { - fn from(v: i32) -> FeatureSet_RepeatedFieldEncoding { - FeatureSet_RepeatedFieldEncoding(v) + pub fn take_public_dependency(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.public_dependency) } - } - impl From for FeatureSet_RepeatedFieldEncoding { - fn from(v: FeatureSet_RepeatedFieldEncoding_Closed) -> FeatureSet_RepeatedFieldEncoding { - FeatureSet_RepeatedFieldEncoding(v as i32) + pub fn get_public_dependency(&self) -> &[i32] { + &self.public_dependency } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_RepeatedFieldEncoding { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_RepeatedFieldEncoding { - type Closed = FeatureSet_RepeatedFieldEncoding_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_RepeatedFieldEncoding::REPEATED_FIELD_ENCODING_UNKNOWN => ::std::option::Option::Some(FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN), - FeatureSet_RepeatedFieldEncoding::PACKED => ::std::option::Option::Some(FeatureSet_RepeatedFieldEncoding_Closed::PACKED), - FeatureSet_RepeatedFieldEncoding::EXPANDED => ::std::option::Option::Some(FeatureSet_RepeatedFieldEncoding_Closed::EXPANDED), - _ => None, - } + pub fn mut_public_dependency(&mut self) -> &mut ::std::vec::Vec { + &mut self.public_dependency } - } - impl ::std::fmt::Debug for FeatureSet_RepeatedFieldEncoding { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } + pub fn set_weak_dependency(&mut self, v: ::std::vec::Vec) { + self.weak_dependency = v; } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_RepeatedFieldEncoding_Closed { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2, - } - impl FeatureSet_RepeatedFieldEncoding_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_RepeatedFieldEncoding_Closed; 3] = [FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN, FeatureSet_RepeatedFieldEncoding_Closed::PACKED, FeatureSet_RepeatedFieldEncoding_Closed::EXPANDED]; - } - impl ::std::default::Default for FeatureSet_RepeatedFieldEncoding_Closed { - fn default() -> Self { - FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN + pub fn take_weak_dependency(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.weak_dependency) } - } - impl From for i32 { - fn from(v: FeatureSet_RepeatedFieldEncoding_Closed) -> i32 { - match v { - FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN => 0, - FeatureSet_RepeatedFieldEncoding_Closed::PACKED => 1, - FeatureSet_RepeatedFieldEncoding_Closed::EXPANDED => 2, - } + pub fn get_weak_dependency(&self) -> &[i32] { + &self.weak_dependency } - } - impl ::std::convert::TryFrom for FeatureSet_RepeatedFieldEncoding_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN), - 1 => Ok(FeatureSet_RepeatedFieldEncoding_Closed::PACKED), - 2 => Ok(FeatureSet_RepeatedFieldEncoding_Closed::EXPANDED), - _ => Err(v), - } + pub fn mut_weak_dependency(&mut self) -> &mut ::std::vec::Vec { + &mut self.weak_dependency } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_RepeatedFieldEncoding_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_RepeatedFieldEncoding_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_RepeatedFieldEncoding_Closed::REPEATED_FIELD_ENCODING_UNKNOWN => "REPEATED_FIELD_ENCODING_UNKNOWN", - FeatureSet_RepeatedFieldEncoding_Closed::PACKED => "PACKED", - FeatureSet_RepeatedFieldEncoding_Closed::EXPANDED => "EXPANDED", - } - } - } - - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_Utf8Validation(i32); - impl FeatureSet_Utf8Validation { - pub const UTF8_VALIDATION_UNKNOWN: FeatureSet_Utf8Validation = FeatureSet_Utf8Validation(0); - pub const NONE: FeatureSet_Utf8Validation = FeatureSet_Utf8Validation(1); - pub const VERIFY: FeatureSet_Utf8Validation = FeatureSet_Utf8Validation(2); - pub const KNOWN_VARIANTS: [FeatureSet_Utf8Validation; 3] = [FeatureSet_Utf8Validation::UTF8_VALIDATION_UNKNOWN, FeatureSet_Utf8Validation::NONE, FeatureSet_Utf8Validation::VERIFY]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for FeatureSet_Utf8Validation { - fn default() -> Self { - FeatureSet_Utf8Validation::UTF8_VALIDATION_UNKNOWN - } - } - impl From for i32 { - fn from(v: FeatureSet_Utf8Validation) -> i32 { - v.0 - } - } - impl From for FeatureSet_Utf8Validation { - fn from(v: i32) -> FeatureSet_Utf8Validation { - FeatureSet_Utf8Validation(v) - } - } - impl From for FeatureSet_Utf8Validation { - fn from(v: FeatureSet_Utf8Validation_Closed) -> FeatureSet_Utf8Validation { - FeatureSet_Utf8Validation(v as i32) - } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_Utf8Validation { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_Utf8Validation { - type Closed = FeatureSet_Utf8Validation_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_Utf8Validation::UTF8_VALIDATION_UNKNOWN => ::std::option::Option::Some(FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN), - FeatureSet_Utf8Validation::NONE => ::std::option::Option::Some(FeatureSet_Utf8Validation_Closed::NONE), - FeatureSet_Utf8Validation::VERIFY => ::std::option::Option::Some(FeatureSet_Utf8Validation_Closed::VERIFY), - _ => None, - } - } - } - impl ::std::fmt::Debug for FeatureSet_Utf8Validation { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } - } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_Utf8Validation_Closed { - UTF8_VALIDATION_UNKNOWN = 0, - NONE = 1, - VERIFY = 2, - } - impl FeatureSet_Utf8Validation_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_Utf8Validation_Closed; 3] = [FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN, FeatureSet_Utf8Validation_Closed::NONE, FeatureSet_Utf8Validation_Closed::VERIFY]; - } - impl ::std::default::Default for FeatureSet_Utf8Validation_Closed { - fn default() -> Self { - FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN - } - } - impl From for i32 { - fn from(v: FeatureSet_Utf8Validation_Closed) -> i32 { - match v { - FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN => 0, - FeatureSet_Utf8Validation_Closed::NONE => 1, - FeatureSet_Utf8Validation_Closed::VERIFY => 2, - } - } - } - impl ::std::convert::TryFrom for FeatureSet_Utf8Validation_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN), - 1 => Ok(FeatureSet_Utf8Validation_Closed::NONE), - 2 => Ok(FeatureSet_Utf8Validation_Closed::VERIFY), - _ => Err(v), - } - } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_Utf8Validation_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_Utf8Validation_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN", - FeatureSet_Utf8Validation_Closed::NONE => "NONE", - FeatureSet_Utf8Validation_Closed::VERIFY => "VERIFY", - } - } - } - - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_MessageEncoding(i32); - impl FeatureSet_MessageEncoding { - pub const MESSAGE_ENCODING_UNKNOWN: FeatureSet_MessageEncoding = FeatureSet_MessageEncoding(0); - pub const LENGTH_PREFIXED: FeatureSet_MessageEncoding = FeatureSet_MessageEncoding(1); - pub const DELIMITED: FeatureSet_MessageEncoding = FeatureSet_MessageEncoding(2); - pub const KNOWN_VARIANTS: [FeatureSet_MessageEncoding; 3] = [FeatureSet_MessageEncoding::MESSAGE_ENCODING_UNKNOWN, FeatureSet_MessageEncoding::LENGTH_PREFIXED, FeatureSet_MessageEncoding::DELIMITED]; - pub const fn value(self) -> i32 { - self.0 - } - } - impl ::std::default::Default for FeatureSet_MessageEncoding { - fn default() -> Self { - FeatureSet_MessageEncoding::MESSAGE_ENCODING_UNKNOWN + pub fn set_message_type(&mut self, v: ::std::vec::Vec) { + self.message_type = v; } - } - impl From for i32 { - fn from(v: FeatureSet_MessageEncoding) -> i32 { - v.0 + pub fn take_message_type(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.message_type) } - } - impl From for FeatureSet_MessageEncoding { - fn from(v: i32) -> FeatureSet_MessageEncoding { - FeatureSet_MessageEncoding(v) + pub fn get_message_type(&self) -> &[DescriptorProto] { + &self.message_type } - } - impl From for FeatureSet_MessageEncoding { - fn from(v: FeatureSet_MessageEncoding_Closed) -> FeatureSet_MessageEncoding { - FeatureSet_MessageEncoding(v as i32) + pub fn mut_message_type(&mut self) -> &mut ::std::vec::Vec { + &mut self.message_type } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_MessageEncoding { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_MessageEncoding { - type Closed = FeatureSet_MessageEncoding_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_MessageEncoding::MESSAGE_ENCODING_UNKNOWN => ::std::option::Option::Some(FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN), - FeatureSet_MessageEncoding::LENGTH_PREFIXED => ::std::option::Option::Some(FeatureSet_MessageEncoding_Closed::LENGTH_PREFIXED), - FeatureSet_MessageEncoding::DELIMITED => ::std::option::Option::Some(FeatureSet_MessageEncoding_Closed::DELIMITED), - _ => None, - } + pub fn set_enum_type(&mut self, v: ::std::vec::Vec) { + self.enum_type = v; } - } - impl ::std::fmt::Debug for FeatureSet_MessageEncoding { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } + pub fn take_enum_type(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.enum_type) } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_MessageEncoding_Closed { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2, - } - impl FeatureSet_MessageEncoding_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_MessageEncoding_Closed; 3] = [FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN, FeatureSet_MessageEncoding_Closed::LENGTH_PREFIXED, FeatureSet_MessageEncoding_Closed::DELIMITED]; - } - impl ::std::default::Default for FeatureSet_MessageEncoding_Closed { - fn default() -> Self { - FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN + pub fn get_enum_type(&self) -> &[EnumDescriptorProto] { + &self.enum_type } - } - impl From for i32 { - fn from(v: FeatureSet_MessageEncoding_Closed) -> i32 { - match v { - FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN => 0, - FeatureSet_MessageEncoding_Closed::LENGTH_PREFIXED => 1, - FeatureSet_MessageEncoding_Closed::DELIMITED => 2, - } + pub fn mut_enum_type(&mut self) -> &mut ::std::vec::Vec { + &mut self.enum_type } - } - impl ::std::convert::TryFrom for FeatureSet_MessageEncoding_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN), - 1 => Ok(FeatureSet_MessageEncoding_Closed::LENGTH_PREFIXED), - 2 => Ok(FeatureSet_MessageEncoding_Closed::DELIMITED), - _ => Err(v), - } + pub fn set_service(&mut self, v: ::std::vec::Vec) { + self.service = v; } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_MessageEncoding_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_MessageEncoding_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_MessageEncoding_Closed::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN", - FeatureSet_MessageEncoding_Closed::LENGTH_PREFIXED => "LENGTH_PREFIXED", - FeatureSet_MessageEncoding_Closed::DELIMITED => "DELIMITED", - } + pub fn take_service(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.service) } - } - - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct FeatureSet_JsonFormat(i32); - impl FeatureSet_JsonFormat { - pub const JSON_FORMAT_UNKNOWN: FeatureSet_JsonFormat = FeatureSet_JsonFormat(0); - pub const ALLOW: FeatureSet_JsonFormat = FeatureSet_JsonFormat(1); - pub const LEGACY_BEST_EFFORT: FeatureSet_JsonFormat = FeatureSet_JsonFormat(2); - pub const KNOWN_VARIANTS: [FeatureSet_JsonFormat; 3] = [FeatureSet_JsonFormat::JSON_FORMAT_UNKNOWN, FeatureSet_JsonFormat::ALLOW, FeatureSet_JsonFormat::LEGACY_BEST_EFFORT]; - pub const fn value(self) -> i32 { - self.0 + pub fn get_service(&self) -> &[ServiceDescriptorProto] { + &self.service } - } - impl ::std::default::Default for FeatureSet_JsonFormat { - fn default() -> Self { - FeatureSet_JsonFormat::JSON_FORMAT_UNKNOWN + pub fn mut_service(&mut self) -> &mut ::std::vec::Vec { + &mut self.service } - } - impl From for i32 { - fn from(v: FeatureSet_JsonFormat) -> i32 { - v.0 + pub fn set_extension(&mut self, v: ::std::vec::Vec) { + self.extension = v; } - } - impl From for FeatureSet_JsonFormat { - fn from(v: i32) -> FeatureSet_JsonFormat { - FeatureSet_JsonFormat(v) + pub fn take_extension(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.extension) } - } - impl From for FeatureSet_JsonFormat { - fn from(v: FeatureSet_JsonFormat_Closed) -> FeatureSet_JsonFormat { - FeatureSet_JsonFormat(v as i32) + pub fn get_extension(&self) -> &[FieldDescriptorProto] { + &self.extension } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_JsonFormat { - } - impl ::pb_jelly::OpenProtoEnum for FeatureSet_JsonFormat { - type Closed = FeatureSet_JsonFormat_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - FeatureSet_JsonFormat::JSON_FORMAT_UNKNOWN => ::std::option::Option::Some(FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN), - FeatureSet_JsonFormat::ALLOW => ::std::option::Option::Some(FeatureSet_JsonFormat_Closed::ALLOW), - FeatureSet_JsonFormat::LEGACY_BEST_EFFORT => ::std::option::Option::Some(FeatureSet_JsonFormat_Closed::LEGACY_BEST_EFFORT), - _ => None, - } + pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { + &mut self.extension } - } - impl ::std::fmt::Debug for FeatureSet_JsonFormat { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } + pub fn has_options(&self) -> bool { + self.options.is_some() } - } - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum FeatureSet_JsonFormat_Closed { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2, - } - impl FeatureSet_JsonFormat_Closed { - pub const KNOWN_VARIANTS: [FeatureSet_JsonFormat_Closed; 3] = [FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN, FeatureSet_JsonFormat_Closed::ALLOW, FeatureSet_JsonFormat_Closed::LEGACY_BEST_EFFORT]; - } - impl ::std::default::Default for FeatureSet_JsonFormat_Closed { - fn default() -> Self { - FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN + pub fn set_options(&mut self, v: FileOptions) { + self.options = Some(v); } - } - impl From for i32 { - fn from(v: FeatureSet_JsonFormat_Closed) -> i32 { - match v { - FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN => 0, - FeatureSet_JsonFormat_Closed::ALLOW => 1, - FeatureSet_JsonFormat_Closed::LEGACY_BEST_EFFORT => 2, - } + pub fn take_options(&mut self) -> FileOptions { + self.options.take().unwrap_or_default() } - } - impl ::std::convert::TryFrom for FeatureSet_JsonFormat_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN), - 1 => Ok(FeatureSet_JsonFormat_Closed::ALLOW), - 2 => Ok(FeatureSet_JsonFormat_Closed::LEGACY_BEST_EFFORT), - _ => Err(v), - } + pub fn get_options(&self) -> &FileOptions { + self.options.as_ref().unwrap_or(&FileOptions_default) } - } - impl ::pb_jelly::ProtoEnum for FeatureSet_JsonFormat_Closed { - } - impl ::pb_jelly::ClosedProtoEnum for FeatureSet_JsonFormat_Closed { - fn name(self) -> &'static str { - match self { - FeatureSet_JsonFormat_Closed::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN", - FeatureSet_JsonFormat_Closed::ALLOW => "ALLOW", - FeatureSet_JsonFormat_Closed::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT", - } + pub fn has_source_code_info(&self) -> bool { + self.source_code_info.is_some() } - } - - /// Represents the identified object's effect on the element in the original - /// .proto file. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - #[repr(transparent)] - pub struct GeneratedCodeInfo_Annotation_Semantic(i32); - impl GeneratedCodeInfo_Annotation_Semantic { - /// There is no effect or the effect is indescribable. - pub const NONE: GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic(0); - /// The element is set or otherwise mutated. - pub const SET: GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic(1); - /// An alias to the element is returned. - pub const ALIAS: GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic(2); - pub const KNOWN_VARIANTS: [GeneratedCodeInfo_Annotation_Semantic; 3] = [GeneratedCodeInfo_Annotation_Semantic::NONE, GeneratedCodeInfo_Annotation_Semantic::SET, GeneratedCodeInfo_Annotation_Semantic::ALIAS]; - pub const fn value(self) -> i32 { - self.0 + pub fn set_source_code_info(&mut self, v: SourceCodeInfo) { + self.source_code_info = Some(v); } - } - impl ::std::default::Default for GeneratedCodeInfo_Annotation_Semantic { - fn default() -> Self { - GeneratedCodeInfo_Annotation_Semantic::NONE + pub fn take_source_code_info(&mut self) -> SourceCodeInfo { + self.source_code_info.take().unwrap_or_default() } - } - impl From for i32 { - fn from(v: GeneratedCodeInfo_Annotation_Semantic) -> i32 { - v.0 + pub fn get_source_code_info(&self) -> &SourceCodeInfo { + self.source_code_info.as_ref().unwrap_or(&SourceCodeInfo_default) } - } - impl From for GeneratedCodeInfo_Annotation_Semantic { - fn from(v: i32) -> GeneratedCodeInfo_Annotation_Semantic { - GeneratedCodeInfo_Annotation_Semantic(v) + pub fn has_syntax(&self) -> bool { + self.syntax.is_some() } - } - impl From for GeneratedCodeInfo_Annotation_Semantic { - fn from(v: GeneratedCodeInfo_Annotation_Semantic_Closed) -> GeneratedCodeInfo_Annotation_Semantic { - GeneratedCodeInfo_Annotation_Semantic(v as i32) + pub fn set_syntax(&mut self, v: ::std::string::String) { + self.syntax = Some(v); } - } - impl ::pb_jelly::ProtoEnum for GeneratedCodeInfo_Annotation_Semantic { - } - impl ::pb_jelly::OpenProtoEnum for GeneratedCodeInfo_Annotation_Semantic { - type Closed = GeneratedCodeInfo_Annotation_Semantic_Closed; - fn into_known(self) -> ::std::option::Option { - match self { - GeneratedCodeInfo_Annotation_Semantic::NONE => ::std::option::Option::Some(GeneratedCodeInfo_Annotation_Semantic_Closed::NONE), - GeneratedCodeInfo_Annotation_Semantic::SET => ::std::option::Option::Some(GeneratedCodeInfo_Annotation_Semantic_Closed::SET), - GeneratedCodeInfo_Annotation_Semantic::ALIAS => ::std::option::Option::Some(GeneratedCodeInfo_Annotation_Semantic_Closed::ALIAS), - _ => None, - } + pub fn take_syntax(&mut self) -> ::std::string::String { + self.syntax.take().unwrap_or_default() } - } - impl ::std::fmt::Debug for GeneratedCodeInfo_Annotation_Semantic { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match ::name(*self) { - Some(s) => write!(f, "{}", s), - None => write!(f, "Unknown({})", self.0), - } + pub fn get_syntax(&self) -> &str { + self.syntax.as_deref().unwrap_or("") } } - /// Represents the identified object's effect on the element in the original - /// .proto file. - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] - #[repr(i32)] - pub enum GeneratedCodeInfo_Annotation_Semantic_Closed { - /// There is no effect or the effect is indescribable. - NONE = 0, - /// The element is set or otherwise mutated. - SET = 1, - /// An alias to the element is returned. - ALIAS = 2, - } - impl GeneratedCodeInfo_Annotation_Semantic_Closed { - pub const KNOWN_VARIANTS: [GeneratedCodeInfo_Annotation_Semantic_Closed; 3] = [GeneratedCodeInfo_Annotation_Semantic_Closed::NONE, GeneratedCodeInfo_Annotation_Semantic_Closed::SET, GeneratedCodeInfo_Annotation_Semantic_Closed::ALIAS]; - } - impl ::std::default::Default for GeneratedCodeInfo_Annotation_Semantic_Closed { + impl ::std::default::Default for FileDescriptorProto { fn default() -> Self { - GeneratedCodeInfo_Annotation_Semantic_Closed::NONE - } - } - impl From for i32 { - fn from(v: GeneratedCodeInfo_Annotation_Semantic_Closed) -> i32 { - match v { - GeneratedCodeInfo_Annotation_Semantic_Closed::NONE => 0, - GeneratedCodeInfo_Annotation_Semantic_Closed::SET => 1, - GeneratedCodeInfo_Annotation_Semantic_Closed::ALIAS => 2, - } - } - } - impl ::std::convert::TryFrom for GeneratedCodeInfo_Annotation_Semantic_Closed { - type Error = i32; - fn try_from(v: i32) -> ::std::result::Result { - match v { - 0 => Ok(GeneratedCodeInfo_Annotation_Semantic_Closed::NONE), - 1 => Ok(GeneratedCodeInfo_Annotation_Semantic_Closed::SET), - 2 => Ok(GeneratedCodeInfo_Annotation_Semantic_Closed::ALIAS), - _ => Err(v), + FileDescriptorProto { + name: ::std::default::Default::default(), + package: ::std::default::Default::default(), + dependency: ::std::default::Default::default(), + public_dependency: ::std::default::Default::default(), + weak_dependency: ::std::default::Default::default(), + message_type: ::std::default::Default::default(), + enum_type: ::std::default::Default::default(), + service: ::std::default::Default::default(), + extension: ::std::default::Default::default(), + options: ::std::default::Default::default(), + source_code_info: ::std::default::Default::default(), + syntax: ::std::default::Default::default(), } } } - impl ::pb_jelly::ProtoEnum for GeneratedCodeInfo_Annotation_Semantic_Closed { + ::lazy_static::lazy_static! { + pub static ref FileDescriptorProto_default: FileDescriptorProto = FileDescriptorProto::default(); } - impl ::pb_jelly::ClosedProtoEnum for GeneratedCodeInfo_Annotation_Semantic_Closed { - fn name(self) -> &'static str { - match self { - GeneratedCodeInfo_Annotation_Semantic_Closed::NONE => "NONE", - GeneratedCodeInfo_Annotation_Semantic_Closed::SET => "SET", - GeneratedCodeInfo_Annotation_Semantic_Closed::ALIAS => "ALIAS", - } - } - } - - /// The protocol compiler can output a FileDescriptorSet containing the .proto - /// files it parses. - #[derive(Clone, Debug, PartialEq)] - pub struct FileDescriptorSet { - pub file: ::std::vec::Vec, - } - impl FileDescriptorSet { - pub fn set_file(&mut self, v: ::std::vec::Vec) { - self.file = v; - } - pub fn take_file(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.file) - } - pub fn get_file(&self) -> &[FileDescriptorProto] { - &self.file - } - pub fn mut_file(&mut self) -> &mut ::std::vec::Vec { - &mut self.file - } - } - impl ::std::default::Default for FileDescriptorSet { - fn default() -> Self { - FileDescriptorSet { - file: ::std::default::Default::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref FileDescriptorSet_default: FileDescriptorSet = FileDescriptorSet::default(); - } - impl ::pb_jelly::Message for FileDescriptorSet { + impl ::pb_jelly::Message for FileDescriptorProto { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FileDescriptorSet", - full_name: "google.protobuf.FileDescriptorSet", + name: "FileDescriptorProto", + full_name: "google.protobuf.FileDescriptorProto", fields: &[ ::pb_jelly::FieldDescriptor { - name: "file", - full_name: "google.protobuf.FileDescriptorSet.file", + name: "name", + full_name: "google.protobuf.FileDescriptorProto.name", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "package", + full_name: "google.protobuf.FileDescriptorProto.package", + index: 1, + number: 2, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "dependency", + full_name: "google.protobuf.FileDescriptorProto.dependency", + index: 2, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "public_dependency", + full_name: "google.protobuf.FileDescriptorProto.public_dependency", + index: 3, + number: 10, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "weak_dependency", + full_name: "google.protobuf.FileDescriptorProto.weak_dependency", + index: 4, + number: 11, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "message_type", + full_name: "google.protobuf.FileDescriptorProto.message_type", + index: 5, + number: 4, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "enum_type", + full_name: "google.protobuf.FileDescriptorProto.enum_type", + index: 6, + number: 5, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, + ::pb_jelly::FieldDescriptor { + name: "service", + full_name: "google.protobuf.FileDescriptorProto.service", + index: 7, + number: 6, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "extension", + full_name: "google.protobuf.FileDescriptorProto.extension", + index: 8, + number: 7, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "options", + full_name: "google.protobuf.FileDescriptorProto.options", + index: 9, + number: 8, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "source_code_info", + full_name: "google.protobuf.FileDescriptorProto.source_code_info", + index: 10, + number: 9, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "syntax", + full_name: "google.protobuf.FileDescriptorProto.syntax", + index: 11, + number: 12, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, ], oneofs: &[ ], @@ -3190,41 +2255,231 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut file_size = 0; - for val in &self.file { + let mut name_size = 0; + if let Some(ref val) = self.name { let l = ::pb_jelly::Message::compute_size(val); - file_size += ::pb_jelly::wire_format::serialized_length(1); - file_size += ::pb_jelly::varint::serialized_length(l as u64); - file_size += l; + name_size += ::pb_jelly::wire_format::serialized_length(1); + name_size += ::pb_jelly::varint::serialized_length(l as u64); + name_size += l; } - size += file_size; + size += name_size; + let mut package_size = 0; + if let Some(ref val) = self.package { + let l = ::pb_jelly::Message::compute_size(val); + package_size += ::pb_jelly::wire_format::serialized_length(2); + package_size += ::pb_jelly::varint::serialized_length(l as u64); + package_size += l; + } + size += package_size; + let mut dependency_size = 0; + for val in &self.dependency { + let l = ::pb_jelly::Message::compute_size(val); + dependency_size += ::pb_jelly::wire_format::serialized_length(3); + dependency_size += ::pb_jelly::varint::serialized_length(l as u64); + dependency_size += l; + } + size += dependency_size; + let mut public_dependency_size = 0; + for val in &self.public_dependency { + let l = ::pb_jelly::Message::compute_size(val); + public_dependency_size += ::pb_jelly::wire_format::serialized_length(10); + public_dependency_size += l; + } + size += public_dependency_size; + let mut weak_dependency_size = 0; + for val in &self.weak_dependency { + let l = ::pb_jelly::Message::compute_size(val); + weak_dependency_size += ::pb_jelly::wire_format::serialized_length(11); + weak_dependency_size += l; + } + size += weak_dependency_size; + let mut message_type_size = 0; + for val in &self.message_type { + let l = ::pb_jelly::Message::compute_size(val); + message_type_size += ::pb_jelly::wire_format::serialized_length(4); + message_type_size += ::pb_jelly::varint::serialized_length(l as u64); + message_type_size += l; + } + size += message_type_size; + let mut enum_type_size = 0; + for val in &self.enum_type { + let l = ::pb_jelly::Message::compute_size(val); + enum_type_size += ::pb_jelly::wire_format::serialized_length(5); + enum_type_size += ::pb_jelly::varint::serialized_length(l as u64); + enum_type_size += l; + } + size += enum_type_size; + let mut service_size = 0; + for val in &self.service { + let l = ::pb_jelly::Message::compute_size(val); + service_size += ::pb_jelly::wire_format::serialized_length(6); + service_size += ::pb_jelly::varint::serialized_length(l as u64); + service_size += l; + } + size += service_size; + let mut extension_size = 0; + for val in &self.extension { + let l = ::pb_jelly::Message::compute_size(val); + extension_size += ::pb_jelly::wire_format::serialized_length(7); + extension_size += ::pb_jelly::varint::serialized_length(l as u64); + extension_size += l; + } + size += extension_size; + let mut options_size = 0; + if let Some(ref val) = self.options { + let l = ::pb_jelly::Message::compute_size(val); + options_size += ::pb_jelly::wire_format::serialized_length(8); + options_size += ::pb_jelly::varint::serialized_length(l as u64); + options_size += l; + } + size += options_size; + let mut source_code_info_size = 0; + if let Some(ref val) = self.source_code_info { + let l = ::pb_jelly::Message::compute_size(val); + source_code_info_size += ::pb_jelly::wire_format::serialized_length(9); + source_code_info_size += ::pb_jelly::varint::serialized_length(l as u64); + source_code_info_size += l; + } + size += source_code_info_size; + let mut syntax_size = 0; + if let Some(ref val) = self.syntax { + let l = ::pb_jelly::Message::compute_size(val); + syntax_size += ::pb_jelly::wire_format::serialized_length(12); + syntax_size += ::pb_jelly::varint::serialized_length(l as u64); + syntax_size += l; + } + size += syntax_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.file { + if let Some(ref val) = self.name { ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorSet", 1)?; - self.file.push(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) + if let Some(ref val) = self.package { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.dependency { + ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.message_type { + ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.enum_type { + ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.service { + ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.extension { + ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.source_code_info { + ::pb_jelly::wire_format::write(9, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.public_dependency { + ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.weak_dependency { + ::pb_jelly::wire_format::write(11, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.syntax { + ::pb_jelly::wire_format::write(12, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + Ok(()) + } + fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { + while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { + match field_number { + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 1)?; + self.name = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 2)?; + self.package = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 3)?; + self.dependency.push(val); + } + 10 => { + ::pb_jelly::helpers::deserialize_packed::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 10, &mut self.public_dependency)?; + } + 11 => { + ::pb_jelly::helpers::deserialize_packed::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 11, &mut self.weak_dependency)?; + } + 4 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 4)?; + self.message_type.push(val); + } + 5 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 5)?; + self.enum_type.push(val); + } + 6 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 6)?; + self.service.push(val); + } + 7 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 7)?; + self.extension.push(val); + } + 8 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 8)?; + self.options = Some(val); + } + 9 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 9)?; + self.source_code_info = Some(val); + } + 12 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 12)?; + self.syntax = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) } } - impl ::pb_jelly::Reflection for FileDescriptorSet { + impl ::pb_jelly::Reflection for FileDescriptorProto { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -3234,9 +2489,42 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "file" => { + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) + } + "package" => { + ::pb_jelly::reflection::FieldMut::Value(self.package.get_or_insert_with(::std::default::Default::default)) + } + "dependency" => { + unimplemented!("Repeated fields are not currently supported.") + } + "public_dependency" => { + unimplemented!("Repeated fields are not currently supported.") + } + "weak_dependency" => { + unimplemented!("Repeated fields are not currently supported.") + } + "message_type" => { + unimplemented!("Repeated fields are not currently supported.") + } + "enum_type" => { + unimplemented!("Repeated fields are not currently supported.") + } + "service" => { unimplemented!("Repeated fields are not currently supported.") } + "extension" => { + unimplemented!("Repeated fields are not currently supported.") + } + "options" => { + ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) + } + "source_code_info" => { + ::pb_jelly::reflection::FieldMut::Value(self.source_code_info.get_or_insert_with(::std::default::Default::default)) + } + "syntax" => { + ::pb_jelly::reflection::FieldMut::Value(self.syntax.get_or_insert_with(::std::default::Default::default)) + } _ => { panic!("unknown field name given") } @@ -3244,40 +2532,23 @@ pub mod google { } } - /// Describes a complete .proto file. + /// Describes a message type. #[derive(Clone, Debug, PartialEq)] - pub struct FileDescriptorProto { - /// file name, relative to root of source tree + pub struct DescriptorProto { pub name: ::std::option::Option<::std::string::String>, - /// e.g. "foo", "foo.bar", etc. - pub package: ::std::option::Option<::std::string::String>, - /// Names of files imported by this file. - pub dependency: ::std::vec::Vec<::std::string::String>, - /// Indexes of the public imported files in the dependency list above. - pub public_dependency: ::std::vec::Vec, - /// Indexes of the weak imported files in the dependency list. - /// For Google-internal migration only. Do not use. - pub weak_dependency: ::std::vec::Vec, - /// All top-level definitions in this file. - pub message_type: ::std::vec::Vec, - pub enum_type: ::std::vec::Vec, - pub service: ::std::vec::Vec, + pub field: ::std::vec::Vec, pub extension: ::std::vec::Vec, - pub options: ::std::option::Option, - /// This field contains optional information about the original source code. - /// You may safely remove this entire field without harming runtime - /// functionality of the descriptors -- the information is needed only by - /// development tools. - pub source_code_info: ::std::option::Option, - /// The syntax of the proto file. - /// The supported values are "proto2", "proto3", and "editions". - - /// If `edition` is present, this value must be "editions". - pub syntax: ::std::option::Option<::std::string::String>, - /// The edition of the proto file. - pub edition: ::std::option::Option, + pub nested_type: ::std::vec::Vec, + pub enum_type: ::std::vec::Vec, + pub extension_range: ::std::vec::Vec, + pub oneof_decl: ::std::vec::Vec, + pub options: ::std::option::Option, + pub reserved_range: ::std::vec::Vec, + /// Reserved field names, which may not be used by fields in the same message. + /// A given name may only be reserved once. + pub reserved_name: ::std::vec::Vec<::std::string::String>, } - impl FileDescriptorProto { + impl DescriptorProto { pub fn has_name(&self) -> bool { self.name.is_some() } @@ -3290,179 +2561,143 @@ pub mod google { pub fn get_name(&self) -> &str { self.name.as_deref().unwrap_or("") } - pub fn has_package(&self) -> bool { - self.package.is_some() + pub fn set_field(&mut self, v: ::std::vec::Vec) { + self.field = v; } - pub fn set_package(&mut self, v: ::std::string::String) { - self.package = Some(v); + pub fn take_field(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.field) } - pub fn take_package(&mut self) -> ::std::string::String { - self.package.take().unwrap_or_default() + pub fn get_field(&self) -> &[FieldDescriptorProto] { + &self.field } - pub fn get_package(&self) -> &str { - self.package.as_deref().unwrap_or("") + pub fn mut_field(&mut self) -> &mut ::std::vec::Vec { + &mut self.field } - pub fn set_dependency(&mut self, v: ::std::vec::Vec<::std::string::String>) { - self.dependency = v; + pub fn set_extension(&mut self, v: ::std::vec::Vec) { + self.extension = v; } - pub fn take_dependency(&mut self) -> ::std::vec::Vec<::std::string::String> { - ::std::mem::take(&mut self.dependency) + pub fn take_extension(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.extension) } - pub fn get_dependency(&self) -> &[::std::string::String] { - &self.dependency + pub fn get_extension(&self) -> &[FieldDescriptorProto] { + &self.extension } - pub fn mut_dependency(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { - &mut self.dependency + pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { + &mut self.extension } - pub fn set_public_dependency(&mut self, v: ::std::vec::Vec) { - self.public_dependency = v; + pub fn set_nested_type(&mut self, v: ::std::vec::Vec) { + self.nested_type = v; } - pub fn take_public_dependency(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.public_dependency) + pub fn take_nested_type(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.nested_type) } - pub fn get_public_dependency(&self) -> &[i32] { - &self.public_dependency + pub fn get_nested_type(&self) -> &[DescriptorProto] { + &self.nested_type } - pub fn mut_public_dependency(&mut self) -> &mut ::std::vec::Vec { - &mut self.public_dependency + pub fn mut_nested_type(&mut self) -> &mut ::std::vec::Vec { + &mut self.nested_type } - pub fn set_weak_dependency(&mut self, v: ::std::vec::Vec) { - self.weak_dependency = v; + pub fn set_enum_type(&mut self, v: ::std::vec::Vec) { + self.enum_type = v; } - pub fn take_weak_dependency(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.weak_dependency) + pub fn take_enum_type(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.enum_type) } - pub fn get_weak_dependency(&self) -> &[i32] { - &self.weak_dependency - } - pub fn mut_weak_dependency(&mut self) -> &mut ::std::vec::Vec { - &mut self.weak_dependency - } - pub fn set_message_type(&mut self, v: ::std::vec::Vec) { - self.message_type = v; - } - pub fn take_message_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.message_type) - } - pub fn get_message_type(&self) -> &[DescriptorProto] { - &self.message_type - } - pub fn mut_message_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.message_type - } - pub fn set_enum_type(&mut self, v: ::std::vec::Vec) { - self.enum_type = v; - } - pub fn take_enum_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.enum_type) - } - pub fn get_enum_type(&self) -> &[EnumDescriptorProto] { - &self.enum_type + pub fn get_enum_type(&self) -> &[EnumDescriptorProto] { + &self.enum_type } pub fn mut_enum_type(&mut self) -> &mut ::std::vec::Vec { &mut self.enum_type } - pub fn set_service(&mut self, v: ::std::vec::Vec) { - self.service = v; + pub fn set_extension_range(&mut self, v: ::std::vec::Vec) { + self.extension_range = v; } - pub fn take_service(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.service) + pub fn take_extension_range(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.extension_range) } - pub fn get_service(&self) -> &[ServiceDescriptorProto] { - &self.service + pub fn get_extension_range(&self) -> &[DescriptorProto_ExtensionRange] { + &self.extension_range } - pub fn mut_service(&mut self) -> &mut ::std::vec::Vec { - &mut self.service + pub fn mut_extension_range(&mut self) -> &mut ::std::vec::Vec { + &mut self.extension_range } - pub fn set_extension(&mut self, v: ::std::vec::Vec) { - self.extension = v; + pub fn set_oneof_decl(&mut self, v: ::std::vec::Vec) { + self.oneof_decl = v; } - pub fn take_extension(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension) + pub fn take_oneof_decl(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.oneof_decl) } - pub fn get_extension(&self) -> &[FieldDescriptorProto] { - &self.extension + pub fn get_oneof_decl(&self) -> &[OneofDescriptorProto] { + &self.oneof_decl } - pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension + pub fn mut_oneof_decl(&mut self) -> &mut ::std::vec::Vec { + &mut self.oneof_decl } pub fn has_options(&self) -> bool { self.options.is_some() } - pub fn set_options(&mut self, v: FileOptions) { + pub fn set_options(&mut self, v: MessageOptions) { self.options = Some(v); } - pub fn take_options(&mut self) -> FileOptions { + pub fn take_options(&mut self) -> MessageOptions { self.options.take().unwrap_or_default() } - pub fn get_options(&self) -> &FileOptions { - self.options.as_ref().unwrap_or(&FileOptions_default) - } - pub fn has_source_code_info(&self) -> bool { - self.source_code_info.is_some() - } - pub fn set_source_code_info(&mut self, v: SourceCodeInfo) { - self.source_code_info = Some(v); - } - pub fn take_source_code_info(&mut self) -> SourceCodeInfo { - self.source_code_info.take().unwrap_or_default() + pub fn get_options(&self) -> &MessageOptions { + self.options.as_ref().unwrap_or(&MessageOptions_default) } - pub fn get_source_code_info(&self) -> &SourceCodeInfo { - self.source_code_info.as_ref().unwrap_or(&SourceCodeInfo_default) + pub fn set_reserved_range(&mut self, v: ::std::vec::Vec) { + self.reserved_range = v; } - pub fn has_syntax(&self) -> bool { - self.syntax.is_some() + pub fn take_reserved_range(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.reserved_range) } - pub fn set_syntax(&mut self, v: ::std::string::String) { - self.syntax = Some(v); + pub fn get_reserved_range(&self) -> &[DescriptorProto_ReservedRange] { + &self.reserved_range } - pub fn take_syntax(&mut self) -> ::std::string::String { - self.syntax.take().unwrap_or_default() + pub fn mut_reserved_range(&mut self) -> &mut ::std::vec::Vec { + &mut self.reserved_range } - pub fn get_syntax(&self) -> &str { - self.syntax.as_deref().unwrap_or("") + pub fn set_reserved_name(&mut self, v: ::std::vec::Vec<::std::string::String>) { + self.reserved_name = v; } - pub fn has_edition(&self) -> bool { - self.edition.is_some() + pub fn take_reserved_name(&mut self) -> ::std::vec::Vec<::std::string::String> { + ::std::mem::take(&mut self.reserved_name) } - pub fn set_edition(&mut self, v: Edition) { - self.edition = Some(v); + pub fn get_reserved_name(&self) -> &[::std::string::String] { + &self.reserved_name } - pub fn get_edition(&self) -> Edition { - self.edition.unwrap_or_default() + pub fn mut_reserved_name(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { + &mut self.reserved_name } } - impl ::std::default::Default for FileDescriptorProto { + impl ::std::default::Default for DescriptorProto { fn default() -> Self { - FileDescriptorProto { + DescriptorProto { name: ::std::default::Default::default(), - package: ::std::default::Default::default(), - dependency: ::std::default::Default::default(), - public_dependency: ::std::default::Default::default(), - weak_dependency: ::std::default::Default::default(), - message_type: ::std::default::Default::default(), - enum_type: ::std::default::Default::default(), - service: ::std::default::Default::default(), + field: ::std::default::Default::default(), extension: ::std::default::Default::default(), + nested_type: ::std::default::Default::default(), + enum_type: ::std::default::Default::default(), + extension_range: ::std::default::Default::default(), + oneof_decl: ::std::default::Default::default(), options: ::std::default::Default::default(), - source_code_info: ::std::default::Default::default(), - syntax: ::std::default::Default::default(), - edition: ::std::default::Default::default(), + reserved_range: ::std::default::Default::default(), + reserved_name: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref FileDescriptorProto_default: FileDescriptorProto = FileDescriptorProto::default(); + pub static ref DescriptorProto_default: DescriptorProto = DescriptorProto::default(); } - impl ::pb_jelly::Message for FileDescriptorProto { + impl ::pb_jelly::Message for DescriptorProto { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FileDescriptorProto", - full_name: "google.protobuf.FileDescriptorProto", + name: "DescriptorProto", + full_name: "google.protobuf.DescriptorProto", fields: &[ ::pb_jelly::FieldDescriptor { name: "name", - full_name: "google.protobuf.FileDescriptorProto.name", + full_name: "google.protobuf.DescriptorProto.name", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::LengthDelimited, @@ -3470,111 +2705,84 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "package", - full_name: "google.protobuf.FileDescriptorProto.package", + name: "field", + full_name: "google.protobuf.DescriptorProto.field", index: 1, number: 2, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "dependency", - full_name: "google.protobuf.FileDescriptorProto.dependency", + name: "extension", + full_name: "google.protobuf.DescriptorProto.extension", index: 2, - number: 3, + number: 6, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "public_dependency", - full_name: "google.protobuf.FileDescriptorProto.public_dependency", + name: "nested_type", + full_name: "google.protobuf.DescriptorProto.nested_type", index: 3, - number: 10, - typ: ::pb_jelly::wire_format::Type::Varint, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "weak_dependency", - full_name: "google.protobuf.FileDescriptorProto.weak_dependency", + name: "enum_type", + full_name: "google.protobuf.DescriptorProto.enum_type", index: 4, - number: 11, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "message_type", - full_name: "google.protobuf.FileDescriptorProto.message_type", - index: 5, number: 4, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "enum_type", - full_name: "google.protobuf.FileDescriptorProto.enum_type", - index: 6, + name: "extension_range", + full_name: "google.protobuf.DescriptorProto.extension_range", + index: 5, number: 5, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "service", - full_name: "google.protobuf.FileDescriptorProto.service", - index: 7, - number: 6, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "extension", - full_name: "google.protobuf.FileDescriptorProto.extension", - index: 8, - number: 7, + name: "oneof_decl", + full_name: "google.protobuf.DescriptorProto.oneof_decl", + index: 6, + number: 8, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { name: "options", - full_name: "google.protobuf.FileDescriptorProto.options", - index: 9, - number: 8, + full_name: "google.protobuf.DescriptorProto.options", + index: 7, + number: 7, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "source_code_info", - full_name: "google.protobuf.FileDescriptorProto.source_code_info", - index: 10, + name: "reserved_range", + full_name: "google.protobuf.DescriptorProto.reserved_range", + index: 8, number: 9, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "syntax", - full_name: "google.protobuf.FileDescriptorProto.syntax", - index: 11, - number: 12, + name: "reserved_name", + full_name: "google.protobuf.DescriptorProto.reserved_name", + index: 9, + number: 10, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "edition", - full_name: "google.protobuf.FileDescriptorProto.edition", - index: 12, - number: 14, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ], @@ -3592,99 +2800,78 @@ pub mod google { name_size += l; } size += name_size; - let mut package_size = 0; - if let Some(ref val) = self.package { + let mut field_size = 0; + for val in &self.field { let l = ::pb_jelly::Message::compute_size(val); - package_size += ::pb_jelly::wire_format::serialized_length(2); - package_size += ::pb_jelly::varint::serialized_length(l as u64); - package_size += l; + field_size += ::pb_jelly::wire_format::serialized_length(2); + field_size += ::pb_jelly::varint::serialized_length(l as u64); + field_size += l; } - size += package_size; - let mut dependency_size = 0; - for val in &self.dependency { + size += field_size; + let mut extension_size = 0; + for val in &self.extension { let l = ::pb_jelly::Message::compute_size(val); - dependency_size += ::pb_jelly::wire_format::serialized_length(3); - dependency_size += ::pb_jelly::varint::serialized_length(l as u64); - dependency_size += l; + extension_size += ::pb_jelly::wire_format::serialized_length(6); + extension_size += ::pb_jelly::varint::serialized_length(l as u64); + extension_size += l; } - size += dependency_size; - let mut public_dependency_size = 0; - for val in &self.public_dependency { + size += extension_size; + let mut nested_type_size = 0; + for val in &self.nested_type { let l = ::pb_jelly::Message::compute_size(val); - public_dependency_size += ::pb_jelly::wire_format::serialized_length(10); - public_dependency_size += l; + nested_type_size += ::pb_jelly::wire_format::serialized_length(3); + nested_type_size += ::pb_jelly::varint::serialized_length(l as u64); + nested_type_size += l; } - size += public_dependency_size; - let mut weak_dependency_size = 0; - for val in &self.weak_dependency { + size += nested_type_size; + let mut enum_type_size = 0; + for val in &self.enum_type { let l = ::pb_jelly::Message::compute_size(val); - weak_dependency_size += ::pb_jelly::wire_format::serialized_length(11); - weak_dependency_size += l; - } - size += weak_dependency_size; - let mut message_type_size = 0; - for val in &self.message_type { - let l = ::pb_jelly::Message::compute_size(val); - message_type_size += ::pb_jelly::wire_format::serialized_length(4); - message_type_size += ::pb_jelly::varint::serialized_length(l as u64); - message_type_size += l; - } - size += message_type_size; - let mut enum_type_size = 0; - for val in &self.enum_type { - let l = ::pb_jelly::Message::compute_size(val); - enum_type_size += ::pb_jelly::wire_format::serialized_length(5); + enum_type_size += ::pb_jelly::wire_format::serialized_length(4); enum_type_size += ::pb_jelly::varint::serialized_length(l as u64); enum_type_size += l; } size += enum_type_size; - let mut service_size = 0; - for val in &self.service { + let mut extension_range_size = 0; + for val in &self.extension_range { let l = ::pb_jelly::Message::compute_size(val); - service_size += ::pb_jelly::wire_format::serialized_length(6); - service_size += ::pb_jelly::varint::serialized_length(l as u64); - service_size += l; + extension_range_size += ::pb_jelly::wire_format::serialized_length(5); + extension_range_size += ::pb_jelly::varint::serialized_length(l as u64); + extension_range_size += l; } - size += service_size; - let mut extension_size = 0; - for val in &self.extension { + size += extension_range_size; + let mut oneof_decl_size = 0; + for val in &self.oneof_decl { let l = ::pb_jelly::Message::compute_size(val); - extension_size += ::pb_jelly::wire_format::serialized_length(7); - extension_size += ::pb_jelly::varint::serialized_length(l as u64); - extension_size += l; + oneof_decl_size += ::pb_jelly::wire_format::serialized_length(8); + oneof_decl_size += ::pb_jelly::varint::serialized_length(l as u64); + oneof_decl_size += l; } - size += extension_size; + size += oneof_decl_size; let mut options_size = 0; if let Some(ref val) = self.options { let l = ::pb_jelly::Message::compute_size(val); - options_size += ::pb_jelly::wire_format::serialized_length(8); + options_size += ::pb_jelly::wire_format::serialized_length(7); options_size += ::pb_jelly::varint::serialized_length(l as u64); options_size += l; } size += options_size; - let mut source_code_info_size = 0; - if let Some(ref val) = self.source_code_info { - let l = ::pb_jelly::Message::compute_size(val); - source_code_info_size += ::pb_jelly::wire_format::serialized_length(9); - source_code_info_size += ::pb_jelly::varint::serialized_length(l as u64); - source_code_info_size += l; - } - size += source_code_info_size; - let mut syntax_size = 0; - if let Some(ref val) = self.syntax { + let mut reserved_range_size = 0; + for val in &self.reserved_range { let l = ::pb_jelly::Message::compute_size(val); - syntax_size += ::pb_jelly::wire_format::serialized_length(12); - syntax_size += ::pb_jelly::varint::serialized_length(l as u64); - syntax_size += l; + reserved_range_size += ::pb_jelly::wire_format::serialized_length(9); + reserved_range_size += ::pb_jelly::varint::serialized_length(l as u64); + reserved_range_size += l; } - size += syntax_size; - let mut edition_size = 0; - if let Some(ref val) = self.edition { + size += reserved_range_size; + let mut reserved_name_size = 0; + for val in &self.reserved_name { let l = ::pb_jelly::Message::compute_size(val); - edition_size += ::pb_jelly::wire_format::serialized_length(14); - edition_size += l; + reserved_name_size += ::pb_jelly::wire_format::serialized_length(10); + reserved_name_size += ::pb_jelly::varint::serialized_length(l as u64); + reserved_name_size += l; } - size += edition_size; + size += reserved_name_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { @@ -3694,126 +2881,104 @@ pub mod google { ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.package { + for val in &self.field { ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.dependency { + for val in &self.nested_type { ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.message_type { + for val in &self.enum_type { ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.enum_type { + for val in &self.extension_range { ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.service { + for val in &self.extension { ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.extension { + if let Some(ref val) = self.options { ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.options { + for val in &self.oneof_decl { ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.source_code_info { + for val in &self.reserved_range { ::pb_jelly::wire_format::write(9, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.public_dependency { - ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.weak_dependency { - ::pb_jelly::wire_format::write(11, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.syntax { - ::pb_jelly::wire_format::write(12, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + for val in &self.reserved_name { + ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.edition { - ::pb_jelly::wire_format::write(14, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 1)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 1)?; self.name = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 2)?; - self.package = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 3)?; - self.dependency.push(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 2)?; + self.field.push(val); } - 10 => { - ::pb_jelly::helpers::deserialize_packed::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 10, &mut self.public_dependency)?; + 6 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 6)?; + self.extension.push(val); } - 11 => { - ::pb_jelly::helpers::deserialize_packed::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 11, &mut self.weak_dependency)?; + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 3)?; + self.nested_type.push(val); } 4 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 4)?; - self.message_type.push(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 4)?; + self.enum_type.push(val); } 5 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 5)?; - self.enum_type.push(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 5)?; + self.extension_range.push(val); } - 6 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 6)?; - self.service.push(val); + 8 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 8)?; + self.oneof_decl.push(val); } 7 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 7)?; - self.extension.push(val); - } - 8 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 8)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 7)?; self.options = Some(val); } 9 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 9)?; - self.source_code_info = Some(val); - } - 12 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 12)?; - self.syntax = Some(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 9)?; + self.reserved_range.push(val); } - 14 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 14)?; - self.edition = Some(val); + 10 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 10)?; + self.reserved_name.push(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -3823,7 +2988,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FileDescriptorProto { + impl ::pb_jelly::Reflection for DescriptorProto { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -3836,41 +3001,32 @@ pub mod google { "name" => { ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) } - "package" => { - ::pb_jelly::reflection::FieldMut::Value(self.package.get_or_insert_with(::std::default::Default::default)) - } - "dependency" => { - unimplemented!("Repeated fields are not currently supported.") - } - "public_dependency" => { + "field" => { unimplemented!("Repeated fields are not currently supported.") } - "weak_dependency" => { + "extension" => { unimplemented!("Repeated fields are not currently supported.") } - "message_type" => { + "nested_type" => { unimplemented!("Repeated fields are not currently supported.") } "enum_type" => { unimplemented!("Repeated fields are not currently supported.") } - "service" => { + "extension_range" => { unimplemented!("Repeated fields are not currently supported.") } - "extension" => { + "oneof_decl" => { unimplemented!("Repeated fields are not currently supported.") } "options" => { ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) } - "source_code_info" => { - ::pb_jelly::reflection::FieldMut::Value(self.source_code_info.get_or_insert_with(::std::default::Default::default)) - } - "syntax" => { - ::pb_jelly::reflection::FieldMut::Value(self.syntax.get_or_insert_with(::std::default::Default::default)) + "reserved_range" => { + unimplemented!("Repeated fields are not currently supported.") } - "edition" => { - ::pb_jelly::reflection::FieldMut::Value(self.edition.get_or_insert_with(::std::default::Default::default)) + "reserved_name" => { + unimplemented!("Repeated fields are not currently supported.") } _ => { panic!("unknown field name given") @@ -3879,259 +3035,91 @@ pub mod google { } } - /// Describes a message type. #[derive(Clone, Debug, PartialEq)] - pub struct DescriptorProto { - pub name: ::std::option::Option<::std::string::String>, - pub field: ::std::vec::Vec, - pub extension: ::std::vec::Vec, - pub nested_type: ::std::vec::Vec, - pub enum_type: ::std::vec::Vec, - pub extension_range: ::std::vec::Vec, - pub oneof_decl: ::std::vec::Vec, - pub options: ::std::option::Option, - pub reserved_range: ::std::vec::Vec, - /// Reserved field names, which may not be used by fields in the same message. - /// A given name may only be reserved once. - pub reserved_name: ::std::vec::Vec<::std::string::String>, + pub struct DescriptorProto_ExtensionRange { + /// Inclusive. + pub start: ::std::option::Option, + /// Exclusive. + pub end: ::std::option::Option, + pub options: ::std::option::Option, } - impl DescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() - } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); - } - pub fn take_name(&mut self) -> ::std::string::String { - self.name.take().unwrap_or_default() - } - pub fn get_name(&self) -> &str { - self.name.as_deref().unwrap_or("") + impl DescriptorProto_ExtensionRange { + pub fn has_start(&self) -> bool { + self.start.is_some() } - pub fn set_field(&mut self, v: ::std::vec::Vec) { - self.field = v; + pub fn set_start(&mut self, v: i32) { + self.start = Some(v); } - pub fn take_field(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.field) + pub fn get_start(&self) -> i32 { + self.start.unwrap_or(0) } - pub fn get_field(&self) -> &[FieldDescriptorProto] { - &self.field + pub fn has_end(&self) -> bool { + self.end.is_some() } - pub fn mut_field(&mut self) -> &mut ::std::vec::Vec { - &mut self.field + pub fn set_end(&mut self, v: i32) { + self.end = Some(v); } - pub fn set_extension(&mut self, v: ::std::vec::Vec) { - self.extension = v; + pub fn get_end(&self) -> i32 { + self.end.unwrap_or(0) } - pub fn take_extension(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension) + pub fn has_options(&self) -> bool { + self.options.is_some() } - pub fn get_extension(&self) -> &[FieldDescriptorProto] { - &self.extension + pub fn set_options(&mut self, v: ExtensionRangeOptions) { + self.options = Some(v); } - pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension + pub fn take_options(&mut self) -> ExtensionRangeOptions { + self.options.take().unwrap_or_default() } - pub fn set_nested_type(&mut self, v: ::std::vec::Vec) { - self.nested_type = v; + pub fn get_options(&self) -> &ExtensionRangeOptions { + self.options.as_ref().unwrap_or(&ExtensionRangeOptions_default) } - pub fn take_nested_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.nested_type) - } - pub fn get_nested_type(&self) -> &[DescriptorProto] { - &self.nested_type - } - pub fn mut_nested_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.nested_type - } - pub fn set_enum_type(&mut self, v: ::std::vec::Vec) { - self.enum_type = v; - } - pub fn take_enum_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.enum_type) - } - pub fn get_enum_type(&self) -> &[EnumDescriptorProto] { - &self.enum_type - } - pub fn mut_enum_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.enum_type - } - pub fn set_extension_range(&mut self, v: ::std::vec::Vec) { - self.extension_range = v; - } - pub fn take_extension_range(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension_range) - } - pub fn get_extension_range(&self) -> &[DescriptorProto_ExtensionRange] { - &self.extension_range - } - pub fn mut_extension_range(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension_range - } - pub fn set_oneof_decl(&mut self, v: ::std::vec::Vec) { - self.oneof_decl = v; - } - pub fn take_oneof_decl(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.oneof_decl) - } - pub fn get_oneof_decl(&self) -> &[OneofDescriptorProto] { - &self.oneof_decl - } - pub fn mut_oneof_decl(&mut self) -> &mut ::std::vec::Vec { - &mut self.oneof_decl - } - pub fn has_options(&self) -> bool { - self.options.is_some() - } - pub fn set_options(&mut self, v: MessageOptions) { - self.options = Some(v); - } - pub fn take_options(&mut self) -> MessageOptions { - self.options.take().unwrap_or_default() - } - pub fn get_options(&self) -> &MessageOptions { - self.options.as_ref().unwrap_or(&MessageOptions_default) - } - pub fn set_reserved_range(&mut self, v: ::std::vec::Vec) { - self.reserved_range = v; - } - pub fn take_reserved_range(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.reserved_range) - } - pub fn get_reserved_range(&self) -> &[DescriptorProto_ReservedRange] { - &self.reserved_range - } - pub fn mut_reserved_range(&mut self) -> &mut ::std::vec::Vec { - &mut self.reserved_range - } - pub fn set_reserved_name(&mut self, v: ::std::vec::Vec<::std::string::String>) { - self.reserved_name = v; - } - pub fn take_reserved_name(&mut self) -> ::std::vec::Vec<::std::string::String> { - ::std::mem::take(&mut self.reserved_name) - } - pub fn get_reserved_name(&self) -> &[::std::string::String] { - &self.reserved_name - } - pub fn mut_reserved_name(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { - &mut self.reserved_name - } - } - impl ::std::default::Default for DescriptorProto { - fn default() -> Self { - DescriptorProto { - name: ::std::default::Default::default(), - field: ::std::default::Default::default(), - extension: ::std::default::Default::default(), - nested_type: ::std::default::Default::default(), - enum_type: ::std::default::Default::default(), - extension_range: ::std::default::Default::default(), - oneof_decl: ::std::default::Default::default(), - options: ::std::default::Default::default(), - reserved_range: ::std::default::Default::default(), - reserved_name: ::std::default::Default::default(), - } + } + impl ::std::default::Default for DescriptorProto_ExtensionRange { + fn default() -> Self { + DescriptorProto_ExtensionRange { + start: ::std::default::Default::default(), + end: ::std::default::Default::default(), + options: ::std::default::Default::default(), + } } } ::lazy_static::lazy_static! { - pub static ref DescriptorProto_default: DescriptorProto = DescriptorProto::default(); + pub static ref DescriptorProto_ExtensionRange_default: DescriptorProto_ExtensionRange = DescriptorProto_ExtensionRange::default(); } - impl ::pb_jelly::Message for DescriptorProto { + impl ::pb_jelly::Message for DescriptorProto_ExtensionRange { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "DescriptorProto", - full_name: "google.protobuf.DescriptorProto", + name: "DescriptorProto_ExtensionRange", + full_name: "google.protobuf.DescriptorProto_ExtensionRange", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.DescriptorProto.name", + name: "start", + full_name: "google.protobuf.DescriptorProto_ExtensionRange.start", index: 0, number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "field", - full_name: "google.protobuf.DescriptorProto.field", + name: "end", + full_name: "google.protobuf.DescriptorProto_ExtensionRange.end", index: 1, number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "extension", - full_name: "google.protobuf.DescriptorProto.extension", + name: "options", + full_name: "google.protobuf.DescriptorProto_ExtensionRange.options", index: 2, - number: 6, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "nested_type", - full_name: "google.protobuf.DescriptorProto.nested_type", - index: 3, number: 3, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "enum_type", - full_name: "google.protobuf.DescriptorProto.enum_type", - index: 4, - number: 4, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "extension_range", - full_name: "google.protobuf.DescriptorProto.extension_range", - index: 5, - number: 5, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "oneof_decl", - full_name: "google.protobuf.DescriptorProto.oneof_decl", - index: 6, - number: 8, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "options", - full_name: "google.protobuf.DescriptorProto.options", - index: 7, - number: 7, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, - ::pb_jelly::FieldDescriptor { - name: "reserved_range", - full_name: "google.protobuf.DescriptorProto.reserved_range", - index: 8, - number: 9, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "reserved_name", - full_name: "google.protobuf.DescriptorProto.reserved_name", - index: 9, - number: 10, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, ], oneofs: &[ ], @@ -4139,145 +3127,41 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut name_size = 0; - if let Some(ref val) = self.name { - let l = ::pb_jelly::Message::compute_size(val); - name_size += ::pb_jelly::wire_format::serialized_length(1); - name_size += ::pb_jelly::varint::serialized_length(l as u64); - name_size += l; - } - size += name_size; - let mut field_size = 0; - for val in &self.field { - let l = ::pb_jelly::Message::compute_size(val); - field_size += ::pb_jelly::wire_format::serialized_length(2); - field_size += ::pb_jelly::varint::serialized_length(l as u64); - field_size += l; - } - size += field_size; - let mut extension_size = 0; - for val in &self.extension { - let l = ::pb_jelly::Message::compute_size(val); - extension_size += ::pb_jelly::wire_format::serialized_length(6); - extension_size += ::pb_jelly::varint::serialized_length(l as u64); - extension_size += l; - } - size += extension_size; - let mut nested_type_size = 0; - for val in &self.nested_type { - let l = ::pb_jelly::Message::compute_size(val); - nested_type_size += ::pb_jelly::wire_format::serialized_length(3); - nested_type_size += ::pb_jelly::varint::serialized_length(l as u64); - nested_type_size += l; - } - size += nested_type_size; - let mut enum_type_size = 0; - for val in &self.enum_type { - let l = ::pb_jelly::Message::compute_size(val); - enum_type_size += ::pb_jelly::wire_format::serialized_length(4); - enum_type_size += ::pb_jelly::varint::serialized_length(l as u64); - enum_type_size += l; - } - size += enum_type_size; - let mut extension_range_size = 0; - for val in &self.extension_range { + let mut start_size = 0; + if let Some(ref val) = self.start { let l = ::pb_jelly::Message::compute_size(val); - extension_range_size += ::pb_jelly::wire_format::serialized_length(5); - extension_range_size += ::pb_jelly::varint::serialized_length(l as u64); - extension_range_size += l; + start_size += ::pb_jelly::wire_format::serialized_length(1); + start_size += l; } - size += extension_range_size; - let mut oneof_decl_size = 0; - for val in &self.oneof_decl { + size += start_size; + let mut end_size = 0; + if let Some(ref val) = self.end { let l = ::pb_jelly::Message::compute_size(val); - oneof_decl_size += ::pb_jelly::wire_format::serialized_length(8); - oneof_decl_size += ::pb_jelly::varint::serialized_length(l as u64); - oneof_decl_size += l; + end_size += ::pb_jelly::wire_format::serialized_length(2); + end_size += l; } - size += oneof_decl_size; + size += end_size; let mut options_size = 0; if let Some(ref val) = self.options { let l = ::pb_jelly::Message::compute_size(val); - options_size += ::pb_jelly::wire_format::serialized_length(7); + options_size += ::pb_jelly::wire_format::serialized_length(3); options_size += ::pb_jelly::varint::serialized_length(l as u64); options_size += l; } size += options_size; - let mut reserved_range_size = 0; - for val in &self.reserved_range { - let l = ::pb_jelly::Message::compute_size(val); - reserved_range_size += ::pb_jelly::wire_format::serialized_length(9); - reserved_range_size += ::pb_jelly::varint::serialized_length(l as u64); - reserved_range_size += l; - } - size += reserved_range_size; - let mut reserved_name_size = 0; - for val in &self.reserved_name { - let l = ::pb_jelly::Message::compute_size(val); - reserved_name_size += ::pb_jelly::wire_format::serialized_length(10); - reserved_name_size += ::pb_jelly::varint::serialized_length(l as u64); - reserved_name_size += l; - } - size += reserved_name_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.field { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.nested_type { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.enum_type { - ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.extension_range { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.start { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - for val in &self.extension { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.end { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } if let Some(ref val) = self.options { - ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.oneof_decl { - ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.reserved_range { - ::pb_jelly::wire_format::write(9, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.reserved_name { - ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; @@ -4288,45 +3172,17 @@ pub mod google { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 1)?; - self.name = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ExtensionRange", 1)?; + self.start = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 2)?; - self.field.push(val); - } - 6 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 6)?; - self.extension.push(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ExtensionRange", 2)?; + self.end = Some(val); } 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 3)?; - self.nested_type.push(val); - } - 4 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 4)?; - self.enum_type.push(val); - } - 5 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 5)?; - self.extension_range.push(val); - } - 8 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 8)?; - self.oneof_decl.push(val); - } - 7 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 7)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto_ExtensionRange", 3)?; self.options = Some(val); } - 9 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 9)?; - self.reserved_range.push(val); - } - 10 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 10)?; - self.reserved_name.push(val); - } _ => { ::pb_jelly::skip(typ, &mut buf)?; } @@ -4335,7 +3191,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for DescriptorProto { + impl ::pb_jelly::Reflection for DescriptorProto_ExtensionRange { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -4345,36 +3201,15 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "name" => { - ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) - } - "field" => { - unimplemented!("Repeated fields are not currently supported.") - } - "extension" => { - unimplemented!("Repeated fields are not currently supported.") - } - "nested_type" => { - unimplemented!("Repeated fields are not currently supported.") - } - "enum_type" => { - unimplemented!("Repeated fields are not currently supported.") - } - "extension_range" => { - unimplemented!("Repeated fields are not currently supported.") + "start" => { + ::pb_jelly::reflection::FieldMut::Value(self.start.get_or_insert_with(::std::default::Default::default)) } - "oneof_decl" => { - unimplemented!("Repeated fields are not currently supported.") + "end" => { + ::pb_jelly::reflection::FieldMut::Value(self.end.get_or_insert_with(::std::default::Default::default)) } "options" => { ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) } - "reserved_range" => { - unimplemented!("Repeated fields are not currently supported.") - } - "reserved_name" => { - unimplemented!("Repeated fields are not currently supported.") - } _ => { panic!("unknown field name given") } @@ -4382,15 +3217,17 @@ pub mod google { } } - #[derive(Clone, Debug, PartialEq)] - pub struct DescriptorProto_ExtensionRange { + /// Range of reserved tag numbers. Reserved tag numbers may not be used by + /// fields or extension ranges in the same message. Reserved ranges may + /// not overlap. + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + pub struct DescriptorProto_ReservedRange { /// Inclusive. pub start: ::std::option::Option, /// Exclusive. pub end: ::std::option::Option, - pub options: ::std::option::Option, } - impl DescriptorProto_ExtensionRange { + impl DescriptorProto_ReservedRange { pub fn has_start(&self) -> bool { self.start.is_some() } @@ -4409,40 +3246,27 @@ pub mod google { pub fn get_end(&self) -> i32 { self.end.unwrap_or(0) } - pub fn has_options(&self) -> bool { - self.options.is_some() - } - pub fn set_options(&mut self, v: ExtensionRangeOptions) { - self.options = Some(v); - } - pub fn take_options(&mut self) -> ExtensionRangeOptions { - self.options.take().unwrap_or_default() - } - pub fn get_options(&self) -> &ExtensionRangeOptions { - self.options.as_ref().unwrap_or(&ExtensionRangeOptions_default) - } } - impl ::std::default::Default for DescriptorProto_ExtensionRange { + impl ::std::default::Default for DescriptorProto_ReservedRange { fn default() -> Self { - DescriptorProto_ExtensionRange { + DescriptorProto_ReservedRange { start: ::std::default::Default::default(), end: ::std::default::Default::default(), - options: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref DescriptorProto_ExtensionRange_default: DescriptorProto_ExtensionRange = DescriptorProto_ExtensionRange::default(); + pub static ref DescriptorProto_ReservedRange_default: DescriptorProto_ReservedRange = DescriptorProto_ReservedRange::default(); } - impl ::pb_jelly::Message for DescriptorProto_ExtensionRange { + impl ::pb_jelly::Message for DescriptorProto_ReservedRange { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "DescriptorProto_ExtensionRange", - full_name: "google.protobuf.DescriptorProto_ExtensionRange", + name: "DescriptorProto_ReservedRange", + full_name: "google.protobuf.DescriptorProto_ReservedRange", fields: &[ ::pb_jelly::FieldDescriptor { name: "start", - full_name: "google.protobuf.DescriptorProto_ExtensionRange.start", + full_name: "google.protobuf.DescriptorProto_ReservedRange.start", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::Varint, @@ -4451,22 +3275,13 @@ pub mod google { }, ::pb_jelly::FieldDescriptor { name: "end", - full_name: "google.protobuf.DescriptorProto_ExtensionRange.end", + full_name: "google.protobuf.DescriptorProto_ReservedRange.end", index: 1, number: 2, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, - ::pb_jelly::FieldDescriptor { - name: "options", - full_name: "google.protobuf.DescriptorProto_ExtensionRange.options", - index: 2, - number: 3, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, ], oneofs: &[ ], @@ -4488,14 +3303,6 @@ pub mod google { end_size += l; } size += end_size; - let mut options_size = 0; - if let Some(ref val) = self.options { - let l = ::pb_jelly::Message::compute_size(val); - options_size += ::pb_jelly::wire_format::serialized_length(3); - options_size += ::pb_jelly::varint::serialized_length(l as u64); - options_size += l; - } - size += options_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { @@ -4507,29 +3314,19 @@ pub mod google { ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.options { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ExtensionRange", 1)?; + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ReservedRange", 1)?; self.start = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ExtensionRange", 2)?; + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ReservedRange", 2)?; self.end = Some(val); } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto_ExtensionRange", 3)?; - self.options = Some(val); - } _ => { ::pb_jelly::skip(typ, &mut buf)?; } @@ -4538,7 +3335,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for DescriptorProto_ExtensionRange { + impl ::pb_jelly::Reflection for DescriptorProto_ReservedRange { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -4554,9 +3351,6 @@ pub mod google { "end" => { ::pb_jelly::reflection::FieldMut::Value(self.end.get_or_insert_with(::std::default::Default::default)) } - "options" => { - ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) - } _ => { panic!("unknown field name given") } @@ -4564,225 +3358,38 @@ pub mod google { } } - /// Range of reserved tag numbers. Reserved tag numbers may not be used by - /// fields or extension ranges in the same message. Reserved ranges may - /// not overlap. - #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] - pub struct DescriptorProto_ReservedRange { - /// Inclusive. - pub start: ::std::option::Option, - /// Exclusive. - pub end: ::std::option::Option, + #[derive(Clone, Debug, PartialEq)] + pub struct ExtensionRangeOptions { + /// The parser stores options it doesn't recognize here. See above. + pub uninterpreted_option: ::std::vec::Vec, + pub _extensions: ::pb_jelly::Unrecognized, } - impl DescriptorProto_ReservedRange { - pub fn has_start(&self) -> bool { - self.start.is_some() - } - pub fn set_start(&mut self, v: i32) { - self.start = Some(v); - } - pub fn get_start(&self) -> i32 { - self.start.unwrap_or(0) + impl ExtensionRangeOptions { + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn has_end(&self) -> bool { - self.end.is_some() + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn set_end(&mut self, v: i32) { - self.end = Some(v); + pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { + &self.uninterpreted_option } - pub fn get_end(&self) -> i32 { - self.end.unwrap_or(0) + pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { + &mut self.uninterpreted_option } } - impl ::std::default::Default for DescriptorProto_ReservedRange { + impl ::std::default::Default for ExtensionRangeOptions { fn default() -> Self { - DescriptorProto_ReservedRange { - start: ::std::default::Default::default(), - end: ::std::default::Default::default(), + ExtensionRangeOptions { + uninterpreted_option: ::std::default::Default::default(), + _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref DescriptorProto_ReservedRange_default: DescriptorProto_ReservedRange = DescriptorProto_ReservedRange::default(); + pub static ref ExtensionRangeOptions_default: ExtensionRangeOptions = ExtensionRangeOptions::default(); } - impl ::pb_jelly::Message for DescriptorProto_ReservedRange { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "DescriptorProto_ReservedRange", - full_name: "google.protobuf.DescriptorProto_ReservedRange", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "start", - full_name: "google.protobuf.DescriptorProto_ReservedRange.start", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "end", - full_name: "google.protobuf.DescriptorProto_ReservedRange.end", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut start_size = 0; - if let Some(ref val) = self.start { - let l = ::pb_jelly::Message::compute_size(val); - start_size += ::pb_jelly::wire_format::serialized_length(1); - start_size += l; - } - size += start_size; - let mut end_size = 0; - if let Some(ref val) = self.end { - let l = ::pb_jelly::Message::compute_size(val); - end_size += ::pb_jelly::wire_format::serialized_length(2); - end_size += l; - } - size += end_size; - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.start { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.end { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ReservedRange", 1)?; - self.start = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ReservedRange", 2)?; - self.end = Some(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for DescriptorProto_ReservedRange { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "start" => { - ::pb_jelly::reflection::FieldMut::Value(self.start.get_or_insert_with(::std::default::Default::default)) - } - "end" => { - ::pb_jelly::reflection::FieldMut::Value(self.end.get_or_insert_with(::std::default::Default::default)) - } - _ => { - panic!("unknown field name given") - } - } - } - } - - #[derive(Clone, Debug, PartialEq)] - pub struct ExtensionRangeOptions { - /// The parser stores options it doesn't recognize here. See above. - pub uninterpreted_option: ::std::vec::Vec, - /// For external users: DO NOT USE. We are in the process of open sourcing - /// extension declaration and executing internal cleanups before it can be - /// used externally. - pub declaration: ::std::vec::Vec, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// The verification state of the range. - /// TODO: flip the default to DECLARATION once all empty ranges - /// are marked as UNVERIFIED. - pub verification: ::std::option::Option, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl ExtensionRangeOptions { - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; - } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) - } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option - } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option - } - pub fn set_declaration(&mut self, v: ::std::vec::Vec) { - self.declaration = v; - } - pub fn take_declaration(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.declaration) - } - pub fn get_declaration(&self) -> &[ExtensionRangeOptions_Declaration] { - &self.declaration - } - pub fn mut_declaration(&mut self) -> &mut ::std::vec::Vec { - &mut self.declaration - } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn has_verification(&self) -> bool { - self.verification.is_some() - } - pub fn set_verification(&mut self, v: ExtensionRangeOptions_VerificationState) { - self.verification = Some(v); - } - pub fn get_verification(&self) -> ExtensionRangeOptions_VerificationState { - self.verification.unwrap_or_default() - } - } - impl ::std::default::Default for ExtensionRangeOptions { - fn default() -> Self { - ExtensionRangeOptions { - uninterpreted_option: ::std::default::Default::default(), - declaration: ::std::default::Default::default(), - features: ::std::default::Default::default(), - verification: Some(ExtensionRangeOptions_VerificationState::UNVERIFIED), - _extensions: ::pb_jelly::Unrecognized::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref ExtensionRangeOptions_default: ExtensionRangeOptions = ExtensionRangeOptions::default(); - } - impl ::pb_jelly::Message for ExtensionRangeOptions { + impl ::pb_jelly::Message for ExtensionRangeOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { name: "ExtensionRangeOptions", @@ -4797,33 +3404,6 @@ pub mod google { label: ::pb_jelly::Label::Repeated, oneof_index: None, }, - ::pb_jelly::FieldDescriptor { - name: "declaration", - full_name: "google.protobuf.ExtensionRangeOptions.declaration", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.ExtensionRangeOptions.features", - index: 2, - number: 50, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "verification", - full_name: "google.protobuf.ExtensionRangeOptions.verification", - index: 3, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, ], oneofs: &[ ], @@ -4839,49 +3419,10 @@ pub mod google { uninterpreted_option_size += l; } size += uninterpreted_option_size; - let mut declaration_size = 0; - for val in &self.declaration { - let l = ::pb_jelly::Message::compute_size(val); - declaration_size += ::pb_jelly::wire_format::serialized_length(2); - declaration_size += ::pb_jelly::varint::serialized_length(l as u64); - declaration_size += l; - } - size += declaration_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(50); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut verification_size = 0; - if let Some(ref val) = self.verification { - let l = ::pb_jelly::Message::compute_size(val); - verification_size += ::pb_jelly::wire_format::serialized_length(3); - verification_size += l; - } - size += verification_size; size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.declaration { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.verification { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(50, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } for val in &self.uninterpreted_option { ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); @@ -4898,18 +3439,6 @@ pub mod google { let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ExtensionRangeOptions", 999)?; self.uninterpreted_option.push(val); } - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ExtensionRangeOptions", 2)?; - self.declaration.push(val); - } - 50 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ExtensionRangeOptions", 50)?; - self.features = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ExtensionRangeOptions", 3)?; - self.verification = Some(val); - } 1000..=536870911 => { self._extensions.gather(field_number, typ, &mut buf)?; } @@ -4934,15 +3463,6 @@ pub mod google { "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") } - "declaration" => { - unimplemented!("Repeated fields are not currently supported.") - } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "verification" => { - ::pb_jelly::reflection::FieldMut::Value(self.verification.get_or_insert_with(::std::default::Default::default)) - } _ => { panic!("unknown field name given") } @@ -4955,340 +3475,68 @@ pub mod google { } } - #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] - pub struct ExtensionRangeOptions_Declaration { - /// The extension number declared within the extension range. + /// Describes a field within a message. + #[derive(Clone, Debug, PartialEq)] + pub struct FieldDescriptorProto { + pub name: ::std::option::Option<::std::string::String>, pub number: ::std::option::Option, - /// The fully-qualified name of the extension field. There must be a leading - /// dot in front of the full name. - pub full_name: ::std::option::Option<::std::string::String>, - /// The fully-qualified type name of the extension field. Unlike - /// Metadata.type, Declaration.type must have a leading dot for messages - /// and enums. - pub r#type: ::std::option::Option<::std::string::String>, - /// If true, indicates that the number is reserved in the extension range, - /// and any extension field with the number will fail to compile. Set this - /// when a declared extension field is deleted. - pub reserved: ::std::option::Option, - /// If true, indicates that the extension must be defined as repeated. - /// Otherwise the extension must be defined as optional. - pub repeated: ::std::option::Option, - } - impl ExtensionRangeOptions_Declaration { - pub fn has_number(&self) -> bool { - self.number.is_some() - } - pub fn set_number(&mut self, v: i32) { - self.number = Some(v); + pub label: ::std::option::Option, + /// If type_name is set, this need not be set. If both this and type_name + /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + pub r#type: ::std::option::Option, + /// For message and enum types, this is the name of the type. If the name + /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + /// rules are used to find the type (i.e. first the nested types within this + /// message are searched, then within the parent, on up to the root + /// namespace). + pub type_name: ::std::option::Option<::std::string::String>, + /// For extensions, this is the name of the type being extended. It is + /// resolved in the same manner as type_name. + pub extendee: ::std::option::Option<::std::string::String>, + /// For numeric types, contains the original text representation of the value. + /// For booleans, "true" or "false". + /// For strings, contains the default text contents (not escaped in any way). + /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. + /// TODO(kenton): Base-64 encode? + pub default_value: ::std::option::Option<::std::string::String>, + /// If set, gives the index of a oneof in the containing type's oneof_decl + /// list. This field is a member of that oneof. + pub oneof_index: ::std::option::Option, + /// JSON name of this field. The value is set by protocol compiler. If the + /// user has set a "json_name" option on this field, that option's value + /// will be used. Otherwise, it's deduced from the field's name by converting + /// it to camelCase. + pub json_name: ::std::option::Option<::std::string::String>, + pub options: ::std::option::Option, + /// If true, this is a proto3 "optional". When a proto3 field is optional, it + /// tracks presence regardless of field type. + + /// When proto3_optional is true, this field must be belong to a oneof to + /// signal to old proto3 clients that presence is tracked for this field. This + /// oneof is known as a "synthetic" oneof, and this field must be its sole + /// member (each proto3 optional field gets its own synthetic oneof). Synthetic + /// oneofs exist in the descriptor only, and do not generate any API. Synthetic + /// oneofs must be ordered after all "real" oneofs. + + /// For message fields, proto3_optional doesn't create any semantic change, + /// since non-repeated message fields always track presence. However it still + /// indicates the semantic detail of whether the user wrote "optional" or not. + /// This can be useful for round-tripping the .proto file. For consistency we + /// give message fields a synthetic oneof also, even though it is not required + /// to track presence. This is especially important because the parser can't + /// tell if a field is a message or an enum, so it must always create a + /// synthetic oneof. + + /// Proto2 optional fields do not set this flag, because they already indicate + /// optional with `LABEL_OPTIONAL`. + pub proto3_optional: ::std::option::Option, + } + impl FieldDescriptorProto { + pub fn has_name(&self) -> bool { + self.name.is_some() } - pub fn get_number(&self) -> i32 { - self.number.unwrap_or(0) - } - pub fn has_full_name(&self) -> bool { - self.full_name.is_some() - } - pub fn set_full_name(&mut self, v: ::std::string::String) { - self.full_name = Some(v); - } - pub fn take_full_name(&mut self) -> ::std::string::String { - self.full_name.take().unwrap_or_default() - } - pub fn get_full_name(&self) -> &str { - self.full_name.as_deref().unwrap_or("") - } - pub fn has_type(&self) -> bool { - self.r#type.is_some() - } - pub fn set_type(&mut self, v: ::std::string::String) { - self.r#type = Some(v); - } - pub fn take_type(&mut self) -> ::std::string::String { - self.r#type.take().unwrap_or_default() - } - pub fn get_type(&self) -> &str { - self.r#type.as_deref().unwrap_or("") - } - pub fn has_reserved(&self) -> bool { - self.reserved.is_some() - } - pub fn set_reserved(&mut self, v: bool) { - self.reserved = Some(v); - } - pub fn get_reserved(&self) -> bool { - self.reserved.unwrap_or(false) - } - pub fn has_repeated(&self) -> bool { - self.repeated.is_some() - } - pub fn set_repeated(&mut self, v: bool) { - self.repeated = Some(v); - } - pub fn get_repeated(&self) -> bool { - self.repeated.unwrap_or(false) - } - } - impl ::std::default::Default for ExtensionRangeOptions_Declaration { - fn default() -> Self { - ExtensionRangeOptions_Declaration { - number: ::std::default::Default::default(), - full_name: ::std::default::Default::default(), - r#type: ::std::default::Default::default(), - reserved: ::std::default::Default::default(), - repeated: ::std::default::Default::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref ExtensionRangeOptions_Declaration_default: ExtensionRangeOptions_Declaration = ExtensionRangeOptions_Declaration::default(); - } - impl ::pb_jelly::Message for ExtensionRangeOptions_Declaration { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "ExtensionRangeOptions_Declaration", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "number", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration.number", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "full_name", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration.full_name", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "type", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration.type", - index: 2, - number: 3, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "reserved", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration.reserved", - index: 3, - number: 5, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "repeated", - full_name: "google.protobuf.ExtensionRangeOptions_Declaration.repeated", - index: 4, - number: 6, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut number_size = 0; - if let Some(ref val) = self.number { - let l = ::pb_jelly::Message::compute_size(val); - number_size += ::pb_jelly::wire_format::serialized_length(1); - number_size += l; - } - size += number_size; - let mut full_name_size = 0; - if let Some(ref val) = self.full_name { - let l = ::pb_jelly::Message::compute_size(val); - full_name_size += ::pb_jelly::wire_format::serialized_length(2); - full_name_size += ::pb_jelly::varint::serialized_length(l as u64); - full_name_size += l; - } - size += full_name_size; - let mut type_size = 0; - if let Some(ref val) = self.r#type { - let l = ::pb_jelly::Message::compute_size(val); - type_size += ::pb_jelly::wire_format::serialized_length(3); - type_size += ::pb_jelly::varint::serialized_length(l as u64); - type_size += l; - } - size += type_size; - let mut reserved_size = 0; - if let Some(ref val) = self.reserved { - let l = ::pb_jelly::Message::compute_size(val); - reserved_size += ::pb_jelly::wire_format::serialized_length(5); - reserved_size += l; - } - size += reserved_size; - let mut repeated_size = 0; - if let Some(ref val) = self.repeated { - let l = ::pb_jelly::Message::compute_size(val); - repeated_size += ::pb_jelly::wire_format::serialized_length(6); - repeated_size += l; - } - size += repeated_size; - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.number { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.full_name { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.r#type { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.reserved { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.repeated { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ExtensionRangeOptions_Declaration", 1)?; - self.number = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ExtensionRangeOptions_Declaration", 2)?; - self.full_name = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ExtensionRangeOptions_Declaration", 3)?; - self.r#type = Some(val); - } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ExtensionRangeOptions_Declaration", 5)?; - self.reserved = Some(val); - } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ExtensionRangeOptions_Declaration", 6)?; - self.repeated = Some(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for ExtensionRangeOptions_Declaration { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "number" => { - ::pb_jelly::reflection::FieldMut::Value(self.number.get_or_insert_with(::std::default::Default::default)) - } - "full_name" => { - ::pb_jelly::reflection::FieldMut::Value(self.full_name.get_or_insert_with(::std::default::Default::default)) - } - "type" => { - ::pb_jelly::reflection::FieldMut::Value(self.r#type.get_or_insert_with(::std::default::Default::default)) - } - "reserved" => { - ::pb_jelly::reflection::FieldMut::Value(self.reserved.get_or_insert_with(::std::default::Default::default)) - } - "repeated" => { - ::pb_jelly::reflection::FieldMut::Value(self.repeated.get_or_insert_with(::std::default::Default::default)) - } - _ => { - panic!("unknown field name given") - } - } - } - } - - /// Describes a field within a message. - #[derive(Clone, Debug, PartialEq)] - pub struct FieldDescriptorProto { - pub name: ::std::option::Option<::std::string::String>, - pub number: ::std::option::Option, - pub label: ::std::option::Option, - /// If type_name is set, this need not be set. If both this and type_name - /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - pub r#type: ::std::option::Option, - /// For message and enum types, this is the name of the type. If the name - /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - /// rules are used to find the type (i.e. first the nested types within this - /// message are searched, then within the parent, on up to the root - /// namespace). - pub type_name: ::std::option::Option<::std::string::String>, - /// For extensions, this is the name of the type being extended. It is - /// resolved in the same manner as type_name. - pub extendee: ::std::option::Option<::std::string::String>, - /// For numeric types, contains the original text representation of the value. - /// For booleans, "true" or "false". - /// For strings, contains the default text contents (not escaped in any way). - /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. - pub default_value: ::std::option::Option<::std::string::String>, - /// If set, gives the index of a oneof in the containing type's oneof_decl - /// list. This field is a member of that oneof. - pub oneof_index: ::std::option::Option, - /// JSON name of this field. The value is set by protocol compiler. If the - /// user has set a "json_name" option on this field, that option's value - /// will be used. Otherwise, it's deduced from the field's name by converting - /// it to camelCase. - pub json_name: ::std::option::Option<::std::string::String>, - pub options: ::std::option::Option, - /// If true, this is a proto3 "optional". When a proto3 field is optional, it - /// tracks presence regardless of field type. - - /// When proto3_optional is true, this field must be belong to a oneof to - /// signal to old proto3 clients that presence is tracked for this field. This - /// oneof is known as a "synthetic" oneof, and this field must be its sole - /// member (each proto3 optional field gets its own synthetic oneof). Synthetic - /// oneofs exist in the descriptor only, and do not generate any API. Synthetic - /// oneofs must be ordered after all "real" oneofs. - - /// For message fields, proto3_optional doesn't create any semantic change, - /// since non-repeated message fields always track presence. However it still - /// indicates the semantic detail of whether the user wrote "optional" or not. - /// This can be useful for round-tripping the .proto file. For consistency we - /// give message fields a synthetic oneof also, even though it is not required - /// to track presence. This is especially important because the parser can't - /// tell if a field is a message or an enum, so it must always create a - /// synthetic oneof. - - /// Proto2 optional fields do not set this flag, because they already indicate - /// optional with `LABEL_OPTIONAL`. - pub proto3_optional: ::std::option::Option, - } - impl FieldDescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() - } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = Some(v); } pub fn take_name(&mut self) -> ::std::string::String { self.name.take().unwrap_or_default() @@ -7174,8 +5422,6 @@ pub mod google { /// is empty. When this option is not set, the package name will be used for /// determining the ruby package. pub ruby_package: ::std::option::Option<::std::string::String>, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, /// The parser stores options it doesn't recognize here. /// See the documentation for the "Options" section above. pub uninterpreted_option: ::std::vec::Vec, @@ -7260,2278 +5506,35 @@ pub mod google { pub fn set_cc_generic_services(&mut self, v: bool) { self.cc_generic_services = Some(v); } - pub fn get_cc_generic_services(&self) -> bool { - self.cc_generic_services.unwrap_or(false) - } - pub fn has_java_generic_services(&self) -> bool { - self.java_generic_services.is_some() - } - pub fn set_java_generic_services(&mut self, v: bool) { - self.java_generic_services = Some(v); - } - pub fn get_java_generic_services(&self) -> bool { - self.java_generic_services.unwrap_or(false) - } - pub fn has_py_generic_services(&self) -> bool { - self.py_generic_services.is_some() - } - pub fn set_py_generic_services(&mut self, v: bool) { - self.py_generic_services = Some(v); - } - pub fn get_py_generic_services(&self) -> bool { - self.py_generic_services.unwrap_or(false) - } - pub fn has_php_generic_services(&self) -> bool { - self.php_generic_services.is_some() - } - pub fn set_php_generic_services(&mut self, v: bool) { - self.php_generic_services = Some(v); - } - pub fn get_php_generic_services(&self) -> bool { - self.php_generic_services.unwrap_or(false) - } - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() - } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); - } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) - } - pub fn has_cc_enable_arenas(&self) -> bool { - self.cc_enable_arenas.is_some() - } - pub fn set_cc_enable_arenas(&mut self, v: bool) { - self.cc_enable_arenas = Some(v); - } - pub fn get_cc_enable_arenas(&self) -> bool { - self.cc_enable_arenas.unwrap_or(false) - } - pub fn has_objc_class_prefix(&self) -> bool { - self.objc_class_prefix.is_some() - } - pub fn set_objc_class_prefix(&mut self, v: ::std::string::String) { - self.objc_class_prefix = Some(v); - } - pub fn take_objc_class_prefix(&mut self) -> ::std::string::String { - self.objc_class_prefix.take().unwrap_or_default() - } - pub fn get_objc_class_prefix(&self) -> &str { - self.objc_class_prefix.as_deref().unwrap_or("") - } - pub fn has_csharp_namespace(&self) -> bool { - self.csharp_namespace.is_some() - } - pub fn set_csharp_namespace(&mut self, v: ::std::string::String) { - self.csharp_namespace = Some(v); - } - pub fn take_csharp_namespace(&mut self) -> ::std::string::String { - self.csharp_namespace.take().unwrap_or_default() - } - pub fn get_csharp_namespace(&self) -> &str { - self.csharp_namespace.as_deref().unwrap_or("") - } - pub fn has_swift_prefix(&self) -> bool { - self.swift_prefix.is_some() - } - pub fn set_swift_prefix(&mut self, v: ::std::string::String) { - self.swift_prefix = Some(v); - } - pub fn take_swift_prefix(&mut self) -> ::std::string::String { - self.swift_prefix.take().unwrap_or_default() - } - pub fn get_swift_prefix(&self) -> &str { - self.swift_prefix.as_deref().unwrap_or("") - } - pub fn has_php_class_prefix(&self) -> bool { - self.php_class_prefix.is_some() - } - pub fn set_php_class_prefix(&mut self, v: ::std::string::String) { - self.php_class_prefix = Some(v); - } - pub fn take_php_class_prefix(&mut self) -> ::std::string::String { - self.php_class_prefix.take().unwrap_or_default() - } - pub fn get_php_class_prefix(&self) -> &str { - self.php_class_prefix.as_deref().unwrap_or("") - } - pub fn has_php_namespace(&self) -> bool { - self.php_namespace.is_some() - } - pub fn set_php_namespace(&mut self, v: ::std::string::String) { - self.php_namespace = Some(v); - } - pub fn take_php_namespace(&mut self) -> ::std::string::String { - self.php_namespace.take().unwrap_or_default() - } - pub fn get_php_namespace(&self) -> &str { - self.php_namespace.as_deref().unwrap_or("") - } - pub fn has_php_metadata_namespace(&self) -> bool { - self.php_metadata_namespace.is_some() - } - pub fn set_php_metadata_namespace(&mut self, v: ::std::string::String) { - self.php_metadata_namespace = Some(v); - } - pub fn take_php_metadata_namespace(&mut self) -> ::std::string::String { - self.php_metadata_namespace.take().unwrap_or_default() - } - pub fn get_php_metadata_namespace(&self) -> &str { - self.php_metadata_namespace.as_deref().unwrap_or("") - } - pub fn has_ruby_package(&self) -> bool { - self.ruby_package.is_some() - } - pub fn set_ruby_package(&mut self, v: ::std::string::String) { - self.ruby_package = Some(v); - } - pub fn take_ruby_package(&mut self) -> ::std::string::String { - self.ruby_package.take().unwrap_or_default() - } - pub fn get_ruby_package(&self) -> &str { - self.ruby_package.as_deref().unwrap_or("") - } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; - } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) - } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option - } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option - } - } - impl ::std::default::Default for FileOptions { - fn default() -> Self { - FileOptions { - java_package: ::std::default::Default::default(), - java_outer_classname: ::std::default::Default::default(), - java_multiple_files: Some(false), - java_generate_equals_and_hash: ::std::default::Default::default(), - java_string_check_utf8: Some(false), - optimize_for: Some(FileOptions_OptimizeMode::SPEED), - go_package: ::std::default::Default::default(), - cc_generic_services: Some(false), - java_generic_services: Some(false), - py_generic_services: Some(false), - php_generic_services: Some(false), - deprecated: Some(false), - cc_enable_arenas: Some(true), - objc_class_prefix: ::std::default::Default::default(), - csharp_namespace: ::std::default::Default::default(), - swift_prefix: ::std::default::Default::default(), - php_class_prefix: ::std::default::Default::default(), - php_namespace: ::std::default::Default::default(), - php_metadata_namespace: ::std::default::Default::default(), - ruby_package: ::std::default::Default::default(), - features: ::std::default::Default::default(), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref FileOptions_default: FileOptions = FileOptions::default(); - } - impl ::pb_jelly::Message for FileOptions { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "FileOptions", - full_name: "google.protobuf.FileOptions", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "java_package", - full_name: "google.protobuf.FileOptions.java_package", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "java_outer_classname", - full_name: "google.protobuf.FileOptions.java_outer_classname", - index: 1, - number: 8, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "java_multiple_files", - full_name: "google.protobuf.FileOptions.java_multiple_files", - index: 2, - number: 10, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "java_generate_equals_and_hash", - full_name: "google.protobuf.FileOptions.java_generate_equals_and_hash", - index: 3, - number: 20, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "java_string_check_utf8", - full_name: "google.protobuf.FileOptions.java_string_check_utf8", - index: 4, - number: 27, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "optimize_for", - full_name: "google.protobuf.FileOptions.optimize_for", - index: 5, - number: 9, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "go_package", - full_name: "google.protobuf.FileOptions.go_package", - index: 6, - number: 11, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "cc_generic_services", - full_name: "google.protobuf.FileOptions.cc_generic_services", - index: 7, - number: 16, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "java_generic_services", - full_name: "google.protobuf.FileOptions.java_generic_services", - index: 8, - number: 17, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "py_generic_services", - full_name: "google.protobuf.FileOptions.py_generic_services", - index: 9, - number: 18, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "php_generic_services", - full_name: "google.protobuf.FileOptions.php_generic_services", - index: 10, - number: 42, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.FileOptions.deprecated", - index: 11, - number: 23, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "cc_enable_arenas", - full_name: "google.protobuf.FileOptions.cc_enable_arenas", - index: 12, - number: 31, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "objc_class_prefix", - full_name: "google.protobuf.FileOptions.objc_class_prefix", - index: 13, - number: 36, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "csharp_namespace", - full_name: "google.protobuf.FileOptions.csharp_namespace", - index: 14, - number: 37, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "swift_prefix", - full_name: "google.protobuf.FileOptions.swift_prefix", - index: 15, - number: 39, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "php_class_prefix", - full_name: "google.protobuf.FileOptions.php_class_prefix", - index: 16, - number: 40, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "php_namespace", - full_name: "google.protobuf.FileOptions.php_namespace", - index: 17, - number: 41, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "php_metadata_namespace", - full_name: "google.protobuf.FileOptions.php_metadata_namespace", - index: 18, - number: 44, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "ruby_package", - full_name: "google.protobuf.FileOptions.ruby_package", - index: 19, - number: 45, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.FileOptions.features", - index: 20, - number: 50, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.FileOptions.uninterpreted_option", - index: 21, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut java_package_size = 0; - if let Some(ref val) = self.java_package { - let l = ::pb_jelly::Message::compute_size(val); - java_package_size += ::pb_jelly::wire_format::serialized_length(1); - java_package_size += ::pb_jelly::varint::serialized_length(l as u64); - java_package_size += l; - } - size += java_package_size; - let mut java_outer_classname_size = 0; - if let Some(ref val) = self.java_outer_classname { - let l = ::pb_jelly::Message::compute_size(val); - java_outer_classname_size += ::pb_jelly::wire_format::serialized_length(8); - java_outer_classname_size += ::pb_jelly::varint::serialized_length(l as u64); - java_outer_classname_size += l; - } - size += java_outer_classname_size; - let mut java_multiple_files_size = 0; - if let Some(ref val) = self.java_multiple_files { - let l = ::pb_jelly::Message::compute_size(val); - java_multiple_files_size += ::pb_jelly::wire_format::serialized_length(10); - java_multiple_files_size += l; - } - size += java_multiple_files_size; - let mut java_generate_equals_and_hash_size = 0; - if let Some(ref val) = self.java_generate_equals_and_hash { - let l = ::pb_jelly::Message::compute_size(val); - java_generate_equals_and_hash_size += ::pb_jelly::wire_format::serialized_length(20); - java_generate_equals_and_hash_size += l; - } - size += java_generate_equals_and_hash_size; - let mut java_string_check_utf8_size = 0; - if let Some(ref val) = self.java_string_check_utf8 { - let l = ::pb_jelly::Message::compute_size(val); - java_string_check_utf8_size += ::pb_jelly::wire_format::serialized_length(27); - java_string_check_utf8_size += l; - } - size += java_string_check_utf8_size; - let mut optimize_for_size = 0; - if let Some(ref val) = self.optimize_for { - let l = ::pb_jelly::Message::compute_size(val); - optimize_for_size += ::pb_jelly::wire_format::serialized_length(9); - optimize_for_size += l; - } - size += optimize_for_size; - let mut go_package_size = 0; - if let Some(ref val) = self.go_package { - let l = ::pb_jelly::Message::compute_size(val); - go_package_size += ::pb_jelly::wire_format::serialized_length(11); - go_package_size += ::pb_jelly::varint::serialized_length(l as u64); - go_package_size += l; - } - size += go_package_size; - let mut cc_generic_services_size = 0; - if let Some(ref val) = self.cc_generic_services { - let l = ::pb_jelly::Message::compute_size(val); - cc_generic_services_size += ::pb_jelly::wire_format::serialized_length(16); - cc_generic_services_size += l; - } - size += cc_generic_services_size; - let mut java_generic_services_size = 0; - if let Some(ref val) = self.java_generic_services { - let l = ::pb_jelly::Message::compute_size(val); - java_generic_services_size += ::pb_jelly::wire_format::serialized_length(17); - java_generic_services_size += l; - } - size += java_generic_services_size; - let mut py_generic_services_size = 0; - if let Some(ref val) = self.py_generic_services { - let l = ::pb_jelly::Message::compute_size(val); - py_generic_services_size += ::pb_jelly::wire_format::serialized_length(18); - py_generic_services_size += l; - } - size += py_generic_services_size; - let mut php_generic_services_size = 0; - if let Some(ref val) = self.php_generic_services { - let l = ::pb_jelly::Message::compute_size(val); - php_generic_services_size += ::pb_jelly::wire_format::serialized_length(42); - php_generic_services_size += l; - } - size += php_generic_services_size; - let mut deprecated_size = 0; - if let Some(ref val) = self.deprecated { - let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(23); - deprecated_size += l; - } - size += deprecated_size; - let mut cc_enable_arenas_size = 0; - if let Some(ref val) = self.cc_enable_arenas { - let l = ::pb_jelly::Message::compute_size(val); - cc_enable_arenas_size += ::pb_jelly::wire_format::serialized_length(31); - cc_enable_arenas_size += l; - } - size += cc_enable_arenas_size; - let mut objc_class_prefix_size = 0; - if let Some(ref val) = self.objc_class_prefix { - let l = ::pb_jelly::Message::compute_size(val); - objc_class_prefix_size += ::pb_jelly::wire_format::serialized_length(36); - objc_class_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); - objc_class_prefix_size += l; - } - size += objc_class_prefix_size; - let mut csharp_namespace_size = 0; - if let Some(ref val) = self.csharp_namespace { - let l = ::pb_jelly::Message::compute_size(val); - csharp_namespace_size += ::pb_jelly::wire_format::serialized_length(37); - csharp_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); - csharp_namespace_size += l; - } - size += csharp_namespace_size; - let mut swift_prefix_size = 0; - if let Some(ref val) = self.swift_prefix { - let l = ::pb_jelly::Message::compute_size(val); - swift_prefix_size += ::pb_jelly::wire_format::serialized_length(39); - swift_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); - swift_prefix_size += l; - } - size += swift_prefix_size; - let mut php_class_prefix_size = 0; - if let Some(ref val) = self.php_class_prefix { - let l = ::pb_jelly::Message::compute_size(val); - php_class_prefix_size += ::pb_jelly::wire_format::serialized_length(40); - php_class_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); - php_class_prefix_size += l; - } - size += php_class_prefix_size; - let mut php_namespace_size = 0; - if let Some(ref val) = self.php_namespace { - let l = ::pb_jelly::Message::compute_size(val); - php_namespace_size += ::pb_jelly::wire_format::serialized_length(41); - php_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); - php_namespace_size += l; - } - size += php_namespace_size; - let mut php_metadata_namespace_size = 0; - if let Some(ref val) = self.php_metadata_namespace { - let l = ::pb_jelly::Message::compute_size(val); - php_metadata_namespace_size += ::pb_jelly::wire_format::serialized_length(44); - php_metadata_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); - php_metadata_namespace_size += l; - } - size += php_metadata_namespace_size; - let mut ruby_package_size = 0; - if let Some(ref val) = self.ruby_package { - let l = ::pb_jelly::Message::compute_size(val); - ruby_package_size += ::pb_jelly::wire_format::serialized_length(45); - ruby_package_size += ::pb_jelly::varint::serialized_length(l as u64); - ruby_package_size += l; - } - size += ruby_package_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(50); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut uninterpreted_option_size = 0; - for val in &self.uninterpreted_option { - let l = ::pb_jelly::Message::compute_size(val); - uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); - uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); - uninterpreted_option_size += l; - } - size += uninterpreted_option_size; - size += self._extensions.compute_size(); - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.java_package { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.java_outer_classname { - ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.optimize_for { - ::pb_jelly::wire_format::write(9, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.java_multiple_files { - ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.go_package { - ::pb_jelly::wire_format::write(11, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.cc_generic_services { - ::pb_jelly::wire_format::write(16, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.java_generic_services { - ::pb_jelly::wire_format::write(17, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.py_generic_services { - ::pb_jelly::wire_format::write(18, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.java_generate_equals_and_hash { - ::pb_jelly::wire_format::write(20, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(23, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.java_string_check_utf8 { - ::pb_jelly::wire_format::write(27, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.cc_enable_arenas { - ::pb_jelly::wire_format::write(31, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.objc_class_prefix { - ::pb_jelly::wire_format::write(36, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.csharp_namespace { - ::pb_jelly::wire_format::write(37, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.swift_prefix { - ::pb_jelly::wire_format::write(39, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.php_class_prefix { - ::pb_jelly::wire_format::write(40, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.php_namespace { - ::pb_jelly::wire_format::write(41, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.php_generic_services { - ::pb_jelly::wire_format::write(42, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.php_metadata_namespace { - ::pb_jelly::wire_format::write(44, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.ruby_package { - ::pb_jelly::wire_format::write(45, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(50, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.uninterpreted_option { - ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - self._extensions.serialize(w)?; - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 1)?; - self.java_package = Some(val); - } - 8 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 8)?; - self.java_outer_classname = Some(val); - } - 10 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 10)?; - self.java_multiple_files = Some(val); - } - 20 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 20)?; - self.java_generate_equals_and_hash = Some(val); - } - 27 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 27)?; - self.java_string_check_utf8 = Some(val); - } - 9 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 9)?; - self.optimize_for = Some(val); - } - 11 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 11)?; - self.go_package = Some(val); - } - 16 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 16)?; - self.cc_generic_services = Some(val); - } - 17 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 17)?; - self.java_generic_services = Some(val); - } - 18 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 18)?; - self.py_generic_services = Some(val); - } - 42 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 42)?; - self.php_generic_services = Some(val); - } - 23 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 23)?; - self.deprecated = Some(val); - } - 31 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 31)?; - self.cc_enable_arenas = Some(val); - } - 36 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 36)?; - self.objc_class_prefix = Some(val); - } - 37 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 37)?; - self.csharp_namespace = Some(val); - } - 39 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 39)?; - self.swift_prefix = Some(val); - } - 40 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 40)?; - self.php_class_prefix = Some(val); - } - 41 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 41)?; - self.php_namespace = Some(val); - } - 44 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 44)?; - self.php_metadata_namespace = Some(val); - } - 45 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 45)?; - self.ruby_package = Some(val); - } - 50 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 50)?; - self.features = Some(val); - } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 999)?; - self.uninterpreted_option.push(val); - } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for FileOptions { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "java_package" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_package.get_or_insert_with(::std::default::Default::default)) - } - "java_outer_classname" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_outer_classname.get_or_insert_with(::std::default::Default::default)) - } - "java_multiple_files" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_multiple_files.get_or_insert_with(::std::default::Default::default)) - } - "java_generate_equals_and_hash" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_generate_equals_and_hash.get_or_insert_with(::std::default::Default::default)) - } - "java_string_check_utf8" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_string_check_utf8.get_or_insert_with(::std::default::Default::default)) - } - "optimize_for" => { - ::pb_jelly::reflection::FieldMut::Value(self.optimize_for.get_or_insert_with(::std::default::Default::default)) - } - "go_package" => { - ::pb_jelly::reflection::FieldMut::Value(self.go_package.get_or_insert_with(::std::default::Default::default)) - } - "cc_generic_services" => { - ::pb_jelly::reflection::FieldMut::Value(self.cc_generic_services.get_or_insert_with(::std::default::Default::default)) - } - "java_generic_services" => { - ::pb_jelly::reflection::FieldMut::Value(self.java_generic_services.get_or_insert_with(::std::default::Default::default)) - } - "py_generic_services" => { - ::pb_jelly::reflection::FieldMut::Value(self.py_generic_services.get_or_insert_with(::std::default::Default::default)) - } - "php_generic_services" => { - ::pb_jelly::reflection::FieldMut::Value(self.php_generic_services.get_or_insert_with(::std::default::Default::default)) - } - "deprecated" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) - } - "cc_enable_arenas" => { - ::pb_jelly::reflection::FieldMut::Value(self.cc_enable_arenas.get_or_insert_with(::std::default::Default::default)) - } - "objc_class_prefix" => { - ::pb_jelly::reflection::FieldMut::Value(self.objc_class_prefix.get_or_insert_with(::std::default::Default::default)) - } - "csharp_namespace" => { - ::pb_jelly::reflection::FieldMut::Value(self.csharp_namespace.get_or_insert_with(::std::default::Default::default)) - } - "swift_prefix" => { - ::pb_jelly::reflection::FieldMut::Value(self.swift_prefix.get_or_insert_with(::std::default::Default::default)) - } - "php_class_prefix" => { - ::pb_jelly::reflection::FieldMut::Value(self.php_class_prefix.get_or_insert_with(::std::default::Default::default)) - } - "php_namespace" => { - ::pb_jelly::reflection::FieldMut::Value(self.php_namespace.get_or_insert_with(::std::default::Default::default)) - } - "php_metadata_namespace" => { - ::pb_jelly::reflection::FieldMut::Value(self.php_metadata_namespace.get_or_insert_with(::std::default::Default::default)) - } - "ruby_package" => { - ::pb_jelly::reflection::FieldMut::Value(self.ruby_package.get_or_insert_with(::std::default::Default::default)) - } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") - } - _ => { - panic!("unknown field name given") - } - } - } - } - impl ::pb_jelly::extensions::Extensible for FileOptions { - fn _extensions(&self) -> &::pb_jelly::Unrecognized { - &self._extensions - } - } - - #[derive(Clone, Debug, PartialEq)] - pub struct MessageOptions { - /// Set true to use the old proto1 MessageSet wire format for extensions. - /// This is provided for backwards-compatibility with the MessageSet wire - /// format. You should not use this for any other reason: It's less - /// efficient, has fewer features, and is more complicated. - - /// The message must be defined exactly as follows: - /// message Foo { - /// option message_set_wire_format = true; - /// extensions 4 to max; - /// } - /// Note that the message cannot have any defined fields; MessageSets only - /// have extensions. - - /// All extensions of your type must be singular messages; e.g. they cannot - /// be int32s, enums, or repeated messages. - - /// Because this is an option, the above two restrictions are not enforced by - /// the protocol compiler. - pub message_set_wire_format: ::std::option::Option, - /// Disables the generation of the standard "descriptor()" accessor, which can - /// conflict with a field of the same name. This is meant to make migration - /// from proto1 easier; new code should avoid fields named "descriptor". - pub no_standard_descriptor_accessor: ::std::option::Option, - /// Is this message deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the message, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating messages. - pub deprecated: ::std::option::Option, - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. - - /// Whether the message is an automatically generated map entry type for the - /// maps field. - - /// For maps fields: - /// map map_field = 1; - /// The parsed descriptor looks like: - /// message MapFieldEntry { - /// option map_entry = true; - /// optional KeyType key = 1; - /// optional ValueType value = 2; - /// } - /// repeated MapFieldEntry map_field = 1; - - /// Implementations may choose not to generate the map_entry=true message, but - /// use a native map in the target language to hold the keys and values. - /// The reflection APIs in such implementations still need to work as - /// if the field is a repeated message field. - pub map_entry: ::std::option::Option, - /// Enable the legacy handling of JSON field name conflicts. This lowercases - /// and strips underscored from the fields before comparison in proto3 only. - /// The new behavior takes `json_name` into account and applies to proto2 as - /// well. - - /// This should only be used as a temporary measure against broken builds due - /// to the change in behavior for JSON field name conflicts. - - /// TODO This is legacy behavior we plan to remove once downstream - /// teams have had time to migrate. - pub deprecated_legacy_json_field_conflicts: ::std::option::Option, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// The parser stores options it doesn't recognize here. See above. - pub uninterpreted_option: ::std::vec::Vec, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl MessageOptions { - pub fn has_message_set_wire_format(&self) -> bool { - self.message_set_wire_format.is_some() - } - pub fn set_message_set_wire_format(&mut self, v: bool) { - self.message_set_wire_format = Some(v); - } - pub fn get_message_set_wire_format(&self) -> bool { - self.message_set_wire_format.unwrap_or(false) - } - pub fn has_no_standard_descriptor_accessor(&self) -> bool { - self.no_standard_descriptor_accessor.is_some() - } - pub fn set_no_standard_descriptor_accessor(&mut self, v: bool) { - self.no_standard_descriptor_accessor = Some(v); - } - pub fn get_no_standard_descriptor_accessor(&self) -> bool { - self.no_standard_descriptor_accessor.unwrap_or(false) - } - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() - } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); - } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) - } - pub fn has_map_entry(&self) -> bool { - self.map_entry.is_some() - } - pub fn set_map_entry(&mut self, v: bool) { - self.map_entry = Some(v); - } - pub fn get_map_entry(&self) -> bool { - self.map_entry.unwrap_or(false) - } - pub fn has_deprecated_legacy_json_field_conflicts(&self) -> bool { - self.deprecated_legacy_json_field_conflicts.is_some() - } - pub fn set_deprecated_legacy_json_field_conflicts(&mut self, v: bool) { - self.deprecated_legacy_json_field_conflicts = Some(v); - } - pub fn get_deprecated_legacy_json_field_conflicts(&self) -> bool { - self.deprecated_legacy_json_field_conflicts.unwrap_or(false) - } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; - } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) - } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option - } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option - } - } - impl ::std::default::Default for MessageOptions { - fn default() -> Self { - MessageOptions { - message_set_wire_format: Some(false), - no_standard_descriptor_accessor: Some(false), - deprecated: Some(false), - map_entry: ::std::default::Default::default(), - deprecated_legacy_json_field_conflicts: ::std::default::Default::default(), - features: ::std::default::Default::default(), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref MessageOptions_default: MessageOptions = MessageOptions::default(); - } - impl ::pb_jelly::Message for MessageOptions { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "MessageOptions", - full_name: "google.protobuf.MessageOptions", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "message_set_wire_format", - full_name: "google.protobuf.MessageOptions.message_set_wire_format", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "no_standard_descriptor_accessor", - full_name: "google.protobuf.MessageOptions.no_standard_descriptor_accessor", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.MessageOptions.deprecated", - index: 2, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "map_entry", - full_name: "google.protobuf.MessageOptions.map_entry", - index: 3, - number: 7, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "deprecated_legacy_json_field_conflicts", - full_name: "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts", - index: 4, - number: 11, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.MessageOptions.features", - index: 5, - number: 12, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.MessageOptions.uninterpreted_option", - index: 6, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut message_set_wire_format_size = 0; - if let Some(ref val) = self.message_set_wire_format { - let l = ::pb_jelly::Message::compute_size(val); - message_set_wire_format_size += ::pb_jelly::wire_format::serialized_length(1); - message_set_wire_format_size += l; - } - size += message_set_wire_format_size; - let mut no_standard_descriptor_accessor_size = 0; - if let Some(ref val) = self.no_standard_descriptor_accessor { - let l = ::pb_jelly::Message::compute_size(val); - no_standard_descriptor_accessor_size += ::pb_jelly::wire_format::serialized_length(2); - no_standard_descriptor_accessor_size += l; - } - size += no_standard_descriptor_accessor_size; - let mut deprecated_size = 0; - if let Some(ref val) = self.deprecated { - let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(3); - deprecated_size += l; - } - size += deprecated_size; - let mut map_entry_size = 0; - if let Some(ref val) = self.map_entry { - let l = ::pb_jelly::Message::compute_size(val); - map_entry_size += ::pb_jelly::wire_format::serialized_length(7); - map_entry_size += l; - } - size += map_entry_size; - let mut deprecated_legacy_json_field_conflicts_size = 0; - if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { - let l = ::pb_jelly::Message::compute_size(val); - deprecated_legacy_json_field_conflicts_size += ::pb_jelly::wire_format::serialized_length(11); - deprecated_legacy_json_field_conflicts_size += l; - } - size += deprecated_legacy_json_field_conflicts_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(12); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut uninterpreted_option_size = 0; - for val in &self.uninterpreted_option { - let l = ::pb_jelly::Message::compute_size(val); - uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); - uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); - uninterpreted_option_size += l; - } - size += uninterpreted_option_size; - size += self._extensions.compute_size(); - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.message_set_wire_format { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.no_standard_descriptor_accessor { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.map_entry { - ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { - ::pb_jelly::wire_format::write(11, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(12, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.uninterpreted_option { - ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - self._extensions.serialize(w)?; - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 1)?; - self.message_set_wire_format = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 2)?; - self.no_standard_descriptor_accessor = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 3)?; - self.deprecated = Some(val); - } - 7 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 7)?; - self.map_entry = Some(val); - } - 11 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 11)?; - self.deprecated_legacy_json_field_conflicts = Some(val); - } - 12 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MessageOptions", 12)?; - self.features = Some(val); - } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MessageOptions", 999)?; - self.uninterpreted_option.push(val); - } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for MessageOptions { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "message_set_wire_format" => { - ::pb_jelly::reflection::FieldMut::Value(self.message_set_wire_format.get_or_insert_with(::std::default::Default::default)) - } - "no_standard_descriptor_accessor" => { - ::pb_jelly::reflection::FieldMut::Value(self.no_standard_descriptor_accessor.get_or_insert_with(::std::default::Default::default)) - } - "deprecated" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) - } - "map_entry" => { - ::pb_jelly::reflection::FieldMut::Value(self.map_entry.get_or_insert_with(::std::default::Default::default)) - } - "deprecated_legacy_json_field_conflicts" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated_legacy_json_field_conflicts.get_or_insert_with(::std::default::Default::default)) - } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") - } - _ => { - panic!("unknown field name given") - } - } - } - } - impl ::pb_jelly::extensions::Extensible for MessageOptions { - fn _extensions(&self) -> &::pb_jelly::Unrecognized { - &self._extensions - } - } - - #[derive(Clone, Debug, PartialEq)] - pub struct FieldOptions { - /// The ctype option instructs the C++ code generator to use a different - /// representation of the field than it normally would. See the specific - /// options below. This option is only implemented to support use of - /// [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - /// type "bytes" in the open source release -- sorry, we'll try to include - /// other types in a future version! - pub ctype: ::std::option::Option, - /// The packed option can be enabled for repeated primitive fields to enable - /// a more efficient representation on the wire. Rather than repeatedly - /// writing the tag and type for each element, the entire array is encoded as - /// a single length-delimited blob. In proto3, only explicit setting it to - /// false will avoid using packed encoding. This option is prohibited in - /// Editions, but the `repeated_field_encoding` feature can be used to control - /// the behavior. - pub packed: ::std::option::Option, - /// The jstype option determines the JavaScript type used for values of the - /// field. The option is permitted only for 64 bit integral and fixed types - /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - /// is represented as JavaScript string, which avoids loss of precision that - /// can happen when a large value is converted to a floating point JavaScript. - /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - /// use the JavaScript "number" type. The behavior of the default option - /// JS_NORMAL is implementation dependent. - - /// This option is an enum to permit additional types to be added, e.g. - /// goog.math.Integer. - pub jstype: ::std::option::Option, - /// Should this field be parsed lazily? Lazy applies only to message-type - /// fields. It means that when the outer message is initially parsed, the - /// inner message's contents will not be parsed but instead stored in encoded - /// form. The inner message will actually be parsed when it is first accessed. - - /// This is only a hint. Implementations are free to choose whether to use - /// eager or lazy parsing regardless of the value of this option. However, - /// setting this option true suggests that the protocol author believes that - /// using lazy parsing on this field is worth the additional bookkeeping - /// overhead typically needed to implement it. - - /// This option does not affect the public interface of any generated code; - /// all method signatures remain the same. Furthermore, thread-safety of the - /// interface is not affected by this option; const methods remain safe to - /// call from multiple threads concurrently, while non-const methods continue - /// to require exclusive access. - - /// Note that implementations may choose not to check required fields within - /// a lazy sub-message. That is, calling IsInitialized() on the outer message - /// may return true even if the inner message has missing required fields. - /// This is necessary because otherwise the inner message would have to be - /// parsed in order to perform the check, defeating the purpose of lazy - /// parsing. An implementation which chooses not to check required fields - /// must be consistent about it. That is, for any particular sub-message, the - /// implementation must either *always* check its required fields, or *never* - /// check its required fields, regardless of whether or not the message has - /// been parsed. - - /// As of May 2022, lazy verifies the contents of the byte stream during - /// parsing. An invalid byte stream will cause the overall parsing to fail. - pub lazy: ::std::option::Option, - /// unverified_lazy does no correctness checks on the byte stream. This should - /// only be used where lazy with verification is prohibitive for performance - /// reasons. - pub unverified_lazy: ::std::option::Option, - /// Is this field deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for accessors, or it will be completely ignored; in the very least, this - /// is a formalization for deprecating fields. - pub deprecated: ::std::option::Option, - /// For Google-internal migration only. Do not use. - pub weak: ::std::option::Option, - /// Indicate that the field value should not be printed out when using debug - /// formats, e.g. when the field contains sensitive credentials. - pub debug_redact: ::std::option::Option, - pub retention: ::std::option::Option, - pub targets: ::std::vec::Vec, - pub edition_defaults: ::std::vec::Vec, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// The parser stores options it doesn't recognize here. See above. - pub uninterpreted_option: ::std::vec::Vec, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl FieldOptions { - pub fn has_ctype(&self) -> bool { - self.ctype.is_some() - } - pub fn set_ctype(&mut self, v: FieldOptions_CType) { - self.ctype = Some(v); - } - pub fn get_ctype(&self) -> FieldOptions_CType { - self.ctype.unwrap_or_default() - } - pub fn has_packed(&self) -> bool { - self.packed.is_some() - } - pub fn set_packed(&mut self, v: bool) { - self.packed = Some(v); - } - pub fn get_packed(&self) -> bool { - self.packed.unwrap_or(false) - } - pub fn has_jstype(&self) -> bool { - self.jstype.is_some() - } - pub fn set_jstype(&mut self, v: FieldOptions_JSType) { - self.jstype = Some(v); - } - pub fn get_jstype(&self) -> FieldOptions_JSType { - self.jstype.unwrap_or_default() - } - pub fn has_lazy(&self) -> bool { - self.lazy.is_some() - } - pub fn set_lazy(&mut self, v: bool) { - self.lazy = Some(v); - } - pub fn get_lazy(&self) -> bool { - self.lazy.unwrap_or(false) - } - pub fn has_unverified_lazy(&self) -> bool { - self.unverified_lazy.is_some() - } - pub fn set_unverified_lazy(&mut self, v: bool) { - self.unverified_lazy = Some(v); - } - pub fn get_unverified_lazy(&self) -> bool { - self.unverified_lazy.unwrap_or(false) - } - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() - } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); - } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) - } - pub fn has_weak(&self) -> bool { - self.weak.is_some() - } - pub fn set_weak(&mut self, v: bool) { - self.weak = Some(v); - } - pub fn get_weak(&self) -> bool { - self.weak.unwrap_or(false) - } - pub fn has_debug_redact(&self) -> bool { - self.debug_redact.is_some() - } - pub fn set_debug_redact(&mut self, v: bool) { - self.debug_redact = Some(v); - } - pub fn get_debug_redact(&self) -> bool { - self.debug_redact.unwrap_or(false) - } - pub fn has_retention(&self) -> bool { - self.retention.is_some() - } - pub fn set_retention(&mut self, v: FieldOptions_OptionRetention) { - self.retention = Some(v); - } - pub fn get_retention(&self) -> FieldOptions_OptionRetention { - self.retention.unwrap_or_default() - } - pub fn set_targets(&mut self, v: ::std::vec::Vec) { - self.targets = v; - } - pub fn take_targets(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.targets) - } - pub fn get_targets(&self) -> &[FieldOptions_OptionTargetType] { - &self.targets - } - pub fn mut_targets(&mut self) -> &mut ::std::vec::Vec { - &mut self.targets - } - pub fn set_edition_defaults(&mut self, v: ::std::vec::Vec) { - self.edition_defaults = v; - } - pub fn take_edition_defaults(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.edition_defaults) - } - pub fn get_edition_defaults(&self) -> &[FieldOptions_EditionDefault] { - &self.edition_defaults - } - pub fn mut_edition_defaults(&mut self) -> &mut ::std::vec::Vec { - &mut self.edition_defaults - } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; - } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) - } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option - } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option - } - } - impl ::std::default::Default for FieldOptions { - fn default() -> Self { - FieldOptions { - ctype: Some(FieldOptions_CType::STRING), - packed: ::std::default::Default::default(), - jstype: Some(FieldOptions_JSType::JS_NORMAL), - lazy: Some(false), - unverified_lazy: Some(false), - deprecated: Some(false), - weak: Some(false), - debug_redact: Some(false), - retention: ::std::default::Default::default(), - targets: ::std::default::Default::default(), - edition_defaults: ::std::default::Default::default(), - features: ::std::default::Default::default(), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref FieldOptions_default: FieldOptions = FieldOptions::default(); - } - impl ::pb_jelly::Message for FieldOptions { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "FieldOptions", - full_name: "google.protobuf.FieldOptions", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "ctype", - full_name: "google.protobuf.FieldOptions.ctype", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "packed", - full_name: "google.protobuf.FieldOptions.packed", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "jstype", - full_name: "google.protobuf.FieldOptions.jstype", - index: 2, - number: 6, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "lazy", - full_name: "google.protobuf.FieldOptions.lazy", - index: 3, - number: 5, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "unverified_lazy", - full_name: "google.protobuf.FieldOptions.unverified_lazy", - index: 4, - number: 15, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.FieldOptions.deprecated", - index: 5, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "weak", - full_name: "google.protobuf.FieldOptions.weak", - index: 6, - number: 10, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "debug_redact", - full_name: "google.protobuf.FieldOptions.debug_redact", - index: 7, - number: 16, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "retention", - full_name: "google.protobuf.FieldOptions.retention", - index: 8, - number: 17, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "targets", - full_name: "google.protobuf.FieldOptions.targets", - index: 9, - number: 19, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "edition_defaults", - full_name: "google.protobuf.FieldOptions.edition_defaults", - index: 10, - number: 20, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.FieldOptions.features", - index: 11, - number: 21, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.FieldOptions.uninterpreted_option", - index: 12, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut ctype_size = 0; - if let Some(ref val) = self.ctype { - let l = ::pb_jelly::Message::compute_size(val); - ctype_size += ::pb_jelly::wire_format::serialized_length(1); - ctype_size += l; - } - size += ctype_size; - let mut packed_size = 0; - if let Some(ref val) = self.packed { - let l = ::pb_jelly::Message::compute_size(val); - packed_size += ::pb_jelly::wire_format::serialized_length(2); - packed_size += l; - } - size += packed_size; - let mut jstype_size = 0; - if let Some(ref val) = self.jstype { - let l = ::pb_jelly::Message::compute_size(val); - jstype_size += ::pb_jelly::wire_format::serialized_length(6); - jstype_size += l; - } - size += jstype_size; - let mut lazy_size = 0; - if let Some(ref val) = self.lazy { - let l = ::pb_jelly::Message::compute_size(val); - lazy_size += ::pb_jelly::wire_format::serialized_length(5); - lazy_size += l; - } - size += lazy_size; - let mut unverified_lazy_size = 0; - if let Some(ref val) = self.unverified_lazy { - let l = ::pb_jelly::Message::compute_size(val); - unverified_lazy_size += ::pb_jelly::wire_format::serialized_length(15); - unverified_lazy_size += l; - } - size += unverified_lazy_size; - let mut deprecated_size = 0; - if let Some(ref val) = self.deprecated { - let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(3); - deprecated_size += l; - } - size += deprecated_size; - let mut weak_size = 0; - if let Some(ref val) = self.weak { - let l = ::pb_jelly::Message::compute_size(val); - weak_size += ::pb_jelly::wire_format::serialized_length(10); - weak_size += l; - } - size += weak_size; - let mut debug_redact_size = 0; - if let Some(ref val) = self.debug_redact { - let l = ::pb_jelly::Message::compute_size(val); - debug_redact_size += ::pb_jelly::wire_format::serialized_length(16); - debug_redact_size += l; - } - size += debug_redact_size; - let mut retention_size = 0; - if let Some(ref val) = self.retention { - let l = ::pb_jelly::Message::compute_size(val); - retention_size += ::pb_jelly::wire_format::serialized_length(17); - retention_size += l; - } - size += retention_size; - let mut targets_size = 0; - for val in &self.targets { - let l = ::pb_jelly::Message::compute_size(val); - targets_size += ::pb_jelly::wire_format::serialized_length(19); - targets_size += l; - } - size += targets_size; - let mut edition_defaults_size = 0; - for val in &self.edition_defaults { - let l = ::pb_jelly::Message::compute_size(val); - edition_defaults_size += ::pb_jelly::wire_format::serialized_length(20); - edition_defaults_size += ::pb_jelly::varint::serialized_length(l as u64); - edition_defaults_size += l; - } - size += edition_defaults_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(21); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut uninterpreted_option_size = 0; - for val in &self.uninterpreted_option { - let l = ::pb_jelly::Message::compute_size(val); - uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); - uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); - uninterpreted_option_size += l; - } - size += uninterpreted_option_size; - size += self._extensions.compute_size(); - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.ctype { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.packed { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.lazy { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.jstype { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.weak { - ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.unverified_lazy { - ::pb_jelly::wire_format::write(15, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.debug_redact { - ::pb_jelly::wire_format::write(16, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.retention { - ::pb_jelly::wire_format::write(17, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.targets { - ::pb_jelly::wire_format::write(19, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.edition_defaults { - ::pb_jelly::wire_format::write(20, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(21, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.uninterpreted_option { - ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - self._extensions.serialize(w)?; - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 1)?; - self.ctype = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 2)?; - self.packed = Some(val); - } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 6)?; - self.jstype = Some(val); - } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 5)?; - self.lazy = Some(val); - } - 15 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 15)?; - self.unverified_lazy = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 3)?; - self.deprecated = Some(val); - } - 10 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 10)?; - self.weak = Some(val); - } - 16 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 16)?; - self.debug_redact = Some(val); - } - 17 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 17)?; - self.retention = Some(val); - } - 19 => { - ::pb_jelly::helpers::deserialize_packed::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 19, &mut self.targets)?; - } - 20 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 20)?; - self.edition_defaults.push(val); - } - 21 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 21)?; - self.features = Some(val); - } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 999)?; - self.uninterpreted_option.push(val); - } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for FieldOptions { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "ctype" => { - ::pb_jelly::reflection::FieldMut::Value(self.ctype.get_or_insert_with(::std::default::Default::default)) - } - "packed" => { - ::pb_jelly::reflection::FieldMut::Value(self.packed.get_or_insert_with(::std::default::Default::default)) - } - "jstype" => { - ::pb_jelly::reflection::FieldMut::Value(self.jstype.get_or_insert_with(::std::default::Default::default)) - } - "lazy" => { - ::pb_jelly::reflection::FieldMut::Value(self.lazy.get_or_insert_with(::std::default::Default::default)) - } - "unverified_lazy" => { - ::pb_jelly::reflection::FieldMut::Value(self.unverified_lazy.get_or_insert_with(::std::default::Default::default)) - } - "deprecated" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) - } - "weak" => { - ::pb_jelly::reflection::FieldMut::Value(self.weak.get_or_insert_with(::std::default::Default::default)) - } - "debug_redact" => { - ::pb_jelly::reflection::FieldMut::Value(self.debug_redact.get_or_insert_with(::std::default::Default::default)) - } - "retention" => { - ::pb_jelly::reflection::FieldMut::Value(self.retention.get_or_insert_with(::std::default::Default::default)) - } - "targets" => { - unimplemented!("Repeated fields are not currently supported.") - } - "edition_defaults" => { - unimplemented!("Repeated fields are not currently supported.") - } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") - } - _ => { - panic!("unknown field name given") - } - } - } - } - impl ::pb_jelly::extensions::Extensible for FieldOptions { - fn _extensions(&self) -> &::pb_jelly::Unrecognized { - &self._extensions - } - } - - #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] - pub struct FieldOptions_EditionDefault { - pub edition: ::std::option::Option, - /// Textproto value. - pub value: ::std::option::Option<::std::string::String>, - } - impl FieldOptions_EditionDefault { - pub fn has_edition(&self) -> bool { - self.edition.is_some() - } - pub fn set_edition(&mut self, v: Edition) { - self.edition = Some(v); - } - pub fn get_edition(&self) -> Edition { - self.edition.unwrap_or_default() - } - pub fn has_value(&self) -> bool { - self.value.is_some() - } - pub fn set_value(&mut self, v: ::std::string::String) { - self.value = Some(v); - } - pub fn take_value(&mut self) -> ::std::string::String { - self.value.take().unwrap_or_default() - } - pub fn get_value(&self) -> &str { - self.value.as_deref().unwrap_or("") - } - } - impl ::std::default::Default for FieldOptions_EditionDefault { - fn default() -> Self { - FieldOptions_EditionDefault { - edition: ::std::default::Default::default(), - value: ::std::default::Default::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref FieldOptions_EditionDefault_default: FieldOptions_EditionDefault = FieldOptions_EditionDefault::default(); - } - impl ::pb_jelly::Message for FieldOptions_EditionDefault { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "FieldOptions_EditionDefault", - full_name: "google.protobuf.FieldOptions_EditionDefault", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "edition", - full_name: "google.protobuf.FieldOptions_EditionDefault.edition", - index: 0, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "value", - full_name: "google.protobuf.FieldOptions_EditionDefault.value", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut edition_size = 0; - if let Some(ref val) = self.edition { - let l = ::pb_jelly::Message::compute_size(val); - edition_size += ::pb_jelly::wire_format::serialized_length(3); - edition_size += l; - } - size += edition_size; - let mut value_size = 0; - if let Some(ref val) = self.value { - let l = ::pb_jelly::Message::compute_size(val); - value_size += ::pb_jelly::wire_format::serialized_length(2); - value_size += ::pb_jelly::varint::serialized_length(l as u64); - value_size += l; - } - size += value_size; - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.value { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.edition { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - Ok(()) - } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions_EditionDefault", 3)?; - self.edition = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions_EditionDefault", 2)?; - self.value = Some(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) - } - } - impl ::pb_jelly::Reflection for FieldOptions_EditionDefault { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } - } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "edition" => { - ::pb_jelly::reflection::FieldMut::Value(self.edition.get_or_insert_with(::std::default::Default::default)) - } - "value" => { - ::pb_jelly::reflection::FieldMut::Value(self.value.get_or_insert_with(::std::default::Default::default)) - } - _ => { - panic!("unknown field name given") - } - } - } - } - - #[derive(Clone, Debug, PartialEq)] - pub struct OneofOptions { - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// The parser stores options it doesn't recognize here. See above. - pub uninterpreted_option: ::std::vec::Vec, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl OneofOptions { - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; - } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) - } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option - } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option - } - } - impl ::std::default::Default for OneofOptions { - fn default() -> Self { - OneofOptions { - features: ::std::default::Default::default(), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::default(), - } - } - } - ::lazy_static::lazy_static! { - pub static ref OneofOptions_default: OneofOptions = OneofOptions::default(); - } - impl ::pb_jelly::Message for OneofOptions { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "OneofOptions", - full_name: "google.protobuf.OneofOptions", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.OneofOptions.features", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.OneofOptions.uninterpreted_option", - index: 1, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(1); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut uninterpreted_option_size = 0; - for val in &self.uninterpreted_option { - let l = ::pb_jelly::Message::compute_size(val); - uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); - uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); - uninterpreted_option_size += l; - } - size += uninterpreted_option_size; - size += self._extensions.compute_size(); - size - } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - for val in &self.uninterpreted_option { - ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - self._extensions.serialize(w)?; - Ok(()) + pub fn get_cc_generic_services(&self) -> bool { + self.cc_generic_services.unwrap_or(false) } - fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { - while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { - match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "OneofOptions", 1)?; - self.features = Some(val); - } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "OneofOptions", 999)?; - self.uninterpreted_option.push(val); - } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) + pub fn has_java_generic_services(&self) -> bool { + self.java_generic_services.is_some() } - } - impl ::pb_jelly::Reflection for OneofOptions { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } + pub fn set_java_generic_services(&mut self, v: bool) { + self.java_generic_services = Some(v); } - fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { - match field_name { - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") - } - _ => { - panic!("unknown field name given") - } - } + pub fn get_java_generic_services(&self) -> bool { + self.java_generic_services.unwrap_or(false) } - } - impl ::pb_jelly::extensions::Extensible for OneofOptions { - fn _extensions(&self) -> &::pb_jelly::Unrecognized { - &self._extensions + pub fn has_py_generic_services(&self) -> bool { + self.py_generic_services.is_some() } - } - - #[derive(Clone, Debug, PartialEq)] - pub struct EnumOptions { - /// Set this option to true to allow mapping different tag names to the same - /// value. - pub allow_alias: ::std::option::Option, - /// Is this enum deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the enum, or it will be completely ignored; in the very least, this - /// is a formalization for deprecating enums. - pub deprecated: ::std::option::Option, - /// Enable the legacy handling of JSON field name conflicts. This lowercases - /// and strips underscored from the fields before comparison in proto3 only. - /// The new behavior takes `json_name` into account and applies to proto2 as - /// well. - /// TODO Remove this legacy behavior once downstream teams have - /// had time to migrate. - pub deprecated_legacy_json_field_conflicts: ::std::option::Option, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// The parser stores options it doesn't recognize here. See above. - pub uninterpreted_option: ::std::vec::Vec, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl EnumOptions { - pub fn has_allow_alias(&self) -> bool { - self.allow_alias.is_some() + pub fn set_py_generic_services(&mut self, v: bool) { + self.py_generic_services = Some(v); } - pub fn set_allow_alias(&mut self, v: bool) { - self.allow_alias = Some(v); + pub fn get_py_generic_services(&self) -> bool { + self.py_generic_services.unwrap_or(false) } - pub fn get_allow_alias(&self) -> bool { - self.allow_alias.unwrap_or(false) + pub fn has_php_generic_services(&self) -> bool { + self.php_generic_services.is_some() + } + pub fn set_php_generic_services(&mut self, v: bool) { + self.php_generic_services = Some(v); + } + pub fn get_php_generic_services(&self) -> bool { + self.php_generic_services.unwrap_or(false) } pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() @@ -9542,26 +5545,98 @@ pub mod google { pub fn get_deprecated(&self) -> bool { self.deprecated.unwrap_or(false) } - pub fn has_deprecated_legacy_json_field_conflicts(&self) -> bool { - self.deprecated_legacy_json_field_conflicts.is_some() + pub fn has_cc_enable_arenas(&self) -> bool { + self.cc_enable_arenas.is_some() + } + pub fn set_cc_enable_arenas(&mut self, v: bool) { + self.cc_enable_arenas = Some(v); + } + pub fn get_cc_enable_arenas(&self) -> bool { + self.cc_enable_arenas.unwrap_or(false) + } + pub fn has_objc_class_prefix(&self) -> bool { + self.objc_class_prefix.is_some() + } + pub fn set_objc_class_prefix(&mut self, v: ::std::string::String) { + self.objc_class_prefix = Some(v); + } + pub fn take_objc_class_prefix(&mut self) -> ::std::string::String { + self.objc_class_prefix.take().unwrap_or_default() + } + pub fn get_objc_class_prefix(&self) -> &str { + self.objc_class_prefix.as_deref().unwrap_or("") + } + pub fn has_csharp_namespace(&self) -> bool { + self.csharp_namespace.is_some() + } + pub fn set_csharp_namespace(&mut self, v: ::std::string::String) { + self.csharp_namespace = Some(v); + } + pub fn take_csharp_namespace(&mut self) -> ::std::string::String { + self.csharp_namespace.take().unwrap_or_default() + } + pub fn get_csharp_namespace(&self) -> &str { + self.csharp_namespace.as_deref().unwrap_or("") + } + pub fn has_swift_prefix(&self) -> bool { + self.swift_prefix.is_some() + } + pub fn set_swift_prefix(&mut self, v: ::std::string::String) { + self.swift_prefix = Some(v); + } + pub fn take_swift_prefix(&mut self) -> ::std::string::String { + self.swift_prefix.take().unwrap_or_default() + } + pub fn get_swift_prefix(&self) -> &str { + self.swift_prefix.as_deref().unwrap_or("") + } + pub fn has_php_class_prefix(&self) -> bool { + self.php_class_prefix.is_some() + } + pub fn set_php_class_prefix(&mut self, v: ::std::string::String) { + self.php_class_prefix = Some(v); + } + pub fn take_php_class_prefix(&mut self) -> ::std::string::String { + self.php_class_prefix.take().unwrap_or_default() + } + pub fn get_php_class_prefix(&self) -> &str { + self.php_class_prefix.as_deref().unwrap_or("") + } + pub fn has_php_namespace(&self) -> bool { + self.php_namespace.is_some() + } + pub fn set_php_namespace(&mut self, v: ::std::string::String) { + self.php_namespace = Some(v); + } + pub fn take_php_namespace(&mut self) -> ::std::string::String { + self.php_namespace.take().unwrap_or_default() + } + pub fn get_php_namespace(&self) -> &str { + self.php_namespace.as_deref().unwrap_or("") + } + pub fn has_php_metadata_namespace(&self) -> bool { + self.php_metadata_namespace.is_some() + } + pub fn set_php_metadata_namespace(&mut self, v: ::std::string::String) { + self.php_metadata_namespace = Some(v); } - pub fn set_deprecated_legacy_json_field_conflicts(&mut self, v: bool) { - self.deprecated_legacy_json_field_conflicts = Some(v); + pub fn take_php_metadata_namespace(&mut self) -> ::std::string::String { + self.php_metadata_namespace.take().unwrap_or_default() } - pub fn get_deprecated_legacy_json_field_conflicts(&self) -> bool { - self.deprecated_legacy_json_field_conflicts.unwrap_or(false) + pub fn get_php_metadata_namespace(&self) -> &str { + self.php_metadata_namespace.as_deref().unwrap_or("") } - pub fn has_features(&self) -> bool { - self.features.is_some() + pub fn has_ruby_package(&self) -> bool { + self.ruby_package.is_some() } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); + pub fn set_ruby_package(&mut self, v: ::std::string::String) { + self.ruby_package = Some(v); } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() + pub fn take_ruby_package(&mut self) -> ::std::string::String { + self.ruby_package.take().unwrap_or_default() } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) + pub fn get_ruby_package(&self) -> &str { + self.ruby_package.as_deref().unwrap_or("") } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; @@ -9576,67 +5651,227 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for EnumOptions { + impl ::std::default::Default for FileOptions { fn default() -> Self { - EnumOptions { - allow_alias: ::std::default::Default::default(), + FileOptions { + java_package: ::std::default::Default::default(), + java_outer_classname: ::std::default::Default::default(), + java_multiple_files: Some(false), + java_generate_equals_and_hash: ::std::default::Default::default(), + java_string_check_utf8: Some(false), + optimize_for: Some(FileOptions_OptimizeMode::SPEED), + go_package: ::std::default::Default::default(), + cc_generic_services: Some(false), + java_generic_services: Some(false), + py_generic_services: Some(false), + php_generic_services: Some(false), deprecated: Some(false), - deprecated_legacy_json_field_conflicts: ::std::default::Default::default(), - features: ::std::default::Default::default(), + cc_enable_arenas: Some(true), + objc_class_prefix: ::std::default::Default::default(), + csharp_namespace: ::std::default::Default::default(), + swift_prefix: ::std::default::Default::default(), + php_class_prefix: ::std::default::Default::default(), + php_namespace: ::std::default::Default::default(), + php_metadata_namespace: ::std::default::Default::default(), + ruby_package: ::std::default::Default::default(), uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref EnumOptions_default: EnumOptions = EnumOptions::default(); + pub static ref FileOptions_default: FileOptions = FileOptions::default(); } - impl ::pb_jelly::Message for EnumOptions { + impl ::pb_jelly::Message for FileOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "EnumOptions", - full_name: "google.protobuf.EnumOptions", + name: "FileOptions", + full_name: "google.protobuf.FileOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "allow_alias", - full_name: "google.protobuf.EnumOptions.allow_alias", - index: 0, - number: 2, + name: "java_package", + full_name: "google.protobuf.FileOptions.java_package", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "java_outer_classname", + full_name: "google.protobuf.FileOptions.java_outer_classname", + index: 1, + number: 8, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "java_multiple_files", + full_name: "google.protobuf.FileOptions.java_multiple_files", + index: 2, + number: 10, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "java_generate_equals_and_hash", + full_name: "google.protobuf.FileOptions.java_generate_equals_and_hash", + index: 3, + number: 20, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "java_string_check_utf8", + full_name: "google.protobuf.FileOptions.java_string_check_utf8", + index: 4, + number: 27, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "optimize_for", + full_name: "google.protobuf.FileOptions.optimize_for", + index: 5, + number: 9, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "go_package", + full_name: "google.protobuf.FileOptions.go_package", + index: 6, + number: 11, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "cc_generic_services", + full_name: "google.protobuf.FileOptions.cc_generic_services", + index: 7, + number: 16, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "java_generic_services", + full_name: "google.protobuf.FileOptions.java_generic_services", + index: 8, + number: 17, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "py_generic_services", + full_name: "google.protobuf.FileOptions.py_generic_services", + index: 9, + number: 18, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "php_generic_services", + full_name: "google.protobuf.FileOptions.php_generic_services", + index: 10, + number: 42, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { name: "deprecated", - full_name: "google.protobuf.EnumOptions.deprecated", - index: 1, - number: 3, + full_name: "google.protobuf.FileOptions.deprecated", + index: 11, + number: 23, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "deprecated_legacy_json_field_conflicts", - full_name: "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts", - index: 2, - number: 6, + name: "cc_enable_arenas", + full_name: "google.protobuf.FileOptions.cc_enable_arenas", + index: 12, + number: 31, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.EnumOptions.features", - index: 3, - number: 7, + name: "objc_class_prefix", + full_name: "google.protobuf.FileOptions.objc_class_prefix", + index: 13, + number: 36, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "csharp_namespace", + full_name: "google.protobuf.FileOptions.csharp_namespace", + index: 14, + number: 37, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "swift_prefix", + full_name: "google.protobuf.FileOptions.swift_prefix", + index: 15, + number: 39, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "php_class_prefix", + full_name: "google.protobuf.FileOptions.php_class_prefix", + index: 16, + number: 40, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "php_namespace", + full_name: "google.protobuf.FileOptions.php_namespace", + index: 17, + number: 41, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "php_metadata_namespace", + full_name: "google.protobuf.FileOptions.php_metadata_namespace", + index: 18, + number: 44, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "ruby_package", + full_name: "google.protobuf.FileOptions.ruby_package", + index: 19, + number: 45, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { name: "uninterpreted_option", - full_name: "google.protobuf.EnumOptions.uninterpreted_option", - index: 4, + full_name: "google.protobuf.FileOptions.uninterpreted_option", + index: 20, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -9649,35 +5884,156 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut allow_alias_size = 0; - if let Some(ref val) = self.allow_alias { + let mut java_package_size = 0; + if let Some(ref val) = self.java_package { + let l = ::pb_jelly::Message::compute_size(val); + java_package_size += ::pb_jelly::wire_format::serialized_length(1); + java_package_size += ::pb_jelly::varint::serialized_length(l as u64); + java_package_size += l; + } + size += java_package_size; + let mut java_outer_classname_size = 0; + if let Some(ref val) = self.java_outer_classname { + let l = ::pb_jelly::Message::compute_size(val); + java_outer_classname_size += ::pb_jelly::wire_format::serialized_length(8); + java_outer_classname_size += ::pb_jelly::varint::serialized_length(l as u64); + java_outer_classname_size += l; + } + size += java_outer_classname_size; + let mut java_multiple_files_size = 0; + if let Some(ref val) = self.java_multiple_files { + let l = ::pb_jelly::Message::compute_size(val); + java_multiple_files_size += ::pb_jelly::wire_format::serialized_length(10); + java_multiple_files_size += l; + } + size += java_multiple_files_size; + let mut java_generate_equals_and_hash_size = 0; + if let Some(ref val) = self.java_generate_equals_and_hash { + let l = ::pb_jelly::Message::compute_size(val); + java_generate_equals_and_hash_size += ::pb_jelly::wire_format::serialized_length(20); + java_generate_equals_and_hash_size += l; + } + size += java_generate_equals_and_hash_size; + let mut java_string_check_utf8_size = 0; + if let Some(ref val) = self.java_string_check_utf8 { + let l = ::pb_jelly::Message::compute_size(val); + java_string_check_utf8_size += ::pb_jelly::wire_format::serialized_length(27); + java_string_check_utf8_size += l; + } + size += java_string_check_utf8_size; + let mut optimize_for_size = 0; + if let Some(ref val) = self.optimize_for { + let l = ::pb_jelly::Message::compute_size(val); + optimize_for_size += ::pb_jelly::wire_format::serialized_length(9); + optimize_for_size += l; + } + size += optimize_for_size; + let mut go_package_size = 0; + if let Some(ref val) = self.go_package { + let l = ::pb_jelly::Message::compute_size(val); + go_package_size += ::pb_jelly::wire_format::serialized_length(11); + go_package_size += ::pb_jelly::varint::serialized_length(l as u64); + go_package_size += l; + } + size += go_package_size; + let mut cc_generic_services_size = 0; + if let Some(ref val) = self.cc_generic_services { + let l = ::pb_jelly::Message::compute_size(val); + cc_generic_services_size += ::pb_jelly::wire_format::serialized_length(16); + cc_generic_services_size += l; + } + size += cc_generic_services_size; + let mut java_generic_services_size = 0; + if let Some(ref val) = self.java_generic_services { + let l = ::pb_jelly::Message::compute_size(val); + java_generic_services_size += ::pb_jelly::wire_format::serialized_length(17); + java_generic_services_size += l; + } + size += java_generic_services_size; + let mut py_generic_services_size = 0; + if let Some(ref val) = self.py_generic_services { + let l = ::pb_jelly::Message::compute_size(val); + py_generic_services_size += ::pb_jelly::wire_format::serialized_length(18); + py_generic_services_size += l; + } + size += py_generic_services_size; + let mut php_generic_services_size = 0; + if let Some(ref val) = self.php_generic_services { + let l = ::pb_jelly::Message::compute_size(val); + php_generic_services_size += ::pb_jelly::wire_format::serialized_length(42); + php_generic_services_size += l; + } + size += php_generic_services_size; + let mut deprecated_size = 0; + if let Some(ref val) = self.deprecated { + let l = ::pb_jelly::Message::compute_size(val); + deprecated_size += ::pb_jelly::wire_format::serialized_length(23); + deprecated_size += l; + } + size += deprecated_size; + let mut cc_enable_arenas_size = 0; + if let Some(ref val) = self.cc_enable_arenas { + let l = ::pb_jelly::Message::compute_size(val); + cc_enable_arenas_size += ::pb_jelly::wire_format::serialized_length(31); + cc_enable_arenas_size += l; + } + size += cc_enable_arenas_size; + let mut objc_class_prefix_size = 0; + if let Some(ref val) = self.objc_class_prefix { + let l = ::pb_jelly::Message::compute_size(val); + objc_class_prefix_size += ::pb_jelly::wire_format::serialized_length(36); + objc_class_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); + objc_class_prefix_size += l; + } + size += objc_class_prefix_size; + let mut csharp_namespace_size = 0; + if let Some(ref val) = self.csharp_namespace { + let l = ::pb_jelly::Message::compute_size(val); + csharp_namespace_size += ::pb_jelly::wire_format::serialized_length(37); + csharp_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); + csharp_namespace_size += l; + } + size += csharp_namespace_size; + let mut swift_prefix_size = 0; + if let Some(ref val) = self.swift_prefix { + let l = ::pb_jelly::Message::compute_size(val); + swift_prefix_size += ::pb_jelly::wire_format::serialized_length(39); + swift_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); + swift_prefix_size += l; + } + size += swift_prefix_size; + let mut php_class_prefix_size = 0; + if let Some(ref val) = self.php_class_prefix { let l = ::pb_jelly::Message::compute_size(val); - allow_alias_size += ::pb_jelly::wire_format::serialized_length(2); - allow_alias_size += l; + php_class_prefix_size += ::pb_jelly::wire_format::serialized_length(40); + php_class_prefix_size += ::pb_jelly::varint::serialized_length(l as u64); + php_class_prefix_size += l; } - size += allow_alias_size; - let mut deprecated_size = 0; - if let Some(ref val) = self.deprecated { + size += php_class_prefix_size; + let mut php_namespace_size = 0; + if let Some(ref val) = self.php_namespace { let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(3); - deprecated_size += l; + php_namespace_size += ::pb_jelly::wire_format::serialized_length(41); + php_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); + php_namespace_size += l; } - size += deprecated_size; - let mut deprecated_legacy_json_field_conflicts_size = 0; - if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { + size += php_namespace_size; + let mut php_metadata_namespace_size = 0; + if let Some(ref val) = self.php_metadata_namespace { let l = ::pb_jelly::Message::compute_size(val); - deprecated_legacy_json_field_conflicts_size += ::pb_jelly::wire_format::serialized_length(6); - deprecated_legacy_json_field_conflicts_size += l; + php_metadata_namespace_size += ::pb_jelly::wire_format::serialized_length(44); + php_metadata_namespace_size += ::pb_jelly::varint::serialized_length(l as u64); + php_metadata_namespace_size += l; } - size += deprecated_legacy_json_field_conflicts_size; - let mut features_size = 0; - if let Some(ref val) = self.features { + size += php_metadata_namespace_size; + let mut ruby_package_size = 0; + if let Some(ref val) = self.ruby_package { let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(7); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; + ruby_package_size += ::pb_jelly::wire_format::serialized_length(45); + ruby_package_size += ::pb_jelly::varint::serialized_length(l as u64); + ruby_package_size += l; } - size += features_size; + size += ruby_package_size; let mut uninterpreted_option_size = 0; for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); @@ -9690,20 +6046,102 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.allow_alias { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; + if let Some(ref val) = self.java_package { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.java_outer_classname { + ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.optimize_for { + ::pb_jelly::wire_format::write(9, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.java_multiple_files { + ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.go_package { + ::pb_jelly::wire_format::write(11, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.cc_generic_services { + ::pb_jelly::wire_format::write(16, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.java_generic_services { + ::pb_jelly::wire_format::write(17, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.py_generic_services { + ::pb_jelly::wire_format::write(18, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.java_generate_equals_and_hash { + ::pb_jelly::wire_format::write(20, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::wire_format::write(23, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Varint, w)?; + if let Some(ref val) = self.java_string_check_utf8 { + ::pb_jelly::wire_format::write(27, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + if let Some(ref val) = self.cc_enable_arenas { + ::pb_jelly::wire_format::write(31, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.objc_class_prefix { + ::pb_jelly::wire_format::write(36, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.csharp_namespace { + ::pb_jelly::wire_format::write(37, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.swift_prefix { + ::pb_jelly::wire_format::write(39, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.php_class_prefix { + ::pb_jelly::wire_format::write(40, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.php_namespace { + ::pb_jelly::wire_format::write(41, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.php_generic_services { + ::pb_jelly::wire_format::write(42, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.php_metadata_namespace { + ::pb_jelly::wire_format::write(44, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.ruby_package { + ::pb_jelly::wire_format::write(45, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; @@ -9720,24 +6158,88 @@ pub mod google { fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 2)?; - self.allow_alias = Some(val); + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 1)?; + self.java_package = Some(val); } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 3)?; + 8 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 8)?; + self.java_outer_classname = Some(val); + } + 10 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 10)?; + self.java_multiple_files = Some(val); + } + 20 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 20)?; + self.java_generate_equals_and_hash = Some(val); + } + 27 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 27)?; + self.java_string_check_utf8 = Some(val); + } + 9 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 9)?; + self.optimize_for = Some(val); + } + 11 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 11)?; + self.go_package = Some(val); + } + 16 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 16)?; + self.cc_generic_services = Some(val); + } + 17 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 17)?; + self.java_generic_services = Some(val); + } + 18 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 18)?; + self.py_generic_services = Some(val); + } + 42 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 42)?; + self.php_generic_services = Some(val); + } + 23 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 23)?; self.deprecated = Some(val); } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 6)?; - self.deprecated_legacy_json_field_conflicts = Some(val); + 31 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileOptions", 31)?; + self.cc_enable_arenas = Some(val); } - 7 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumOptions", 7)?; - self.features = Some(val); + 36 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 36)?; + self.objc_class_prefix = Some(val); + } + 37 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 37)?; + self.csharp_namespace = Some(val); + } + 39 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 39)?; + self.swift_prefix = Some(val); + } + 40 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 40)?; + self.php_class_prefix = Some(val); + } + 41 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 41)?; + self.php_namespace = Some(val); + } + 44 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 44)?; + self.php_metadata_namespace = Some(val); + } + 45 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 45)?; + self.ruby_package = Some(val); } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -9751,7 +6253,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for EnumOptions { + impl ::pb_jelly::Reflection for FileOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -9761,17 +6263,65 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "allow_alias" => { - ::pb_jelly::reflection::FieldMut::Value(self.allow_alias.get_or_insert_with(::std::default::Default::default)) + "java_package" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_package.get_or_insert_with(::std::default::Default::default)) + } + "java_outer_classname" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_outer_classname.get_or_insert_with(::std::default::Default::default)) + } + "java_multiple_files" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_multiple_files.get_or_insert_with(::std::default::Default::default)) + } + "java_generate_equals_and_hash" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_generate_equals_and_hash.get_or_insert_with(::std::default::Default::default)) + } + "java_string_check_utf8" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_string_check_utf8.get_or_insert_with(::std::default::Default::default)) + } + "optimize_for" => { + ::pb_jelly::reflection::FieldMut::Value(self.optimize_for.get_or_insert_with(::std::default::Default::default)) + } + "go_package" => { + ::pb_jelly::reflection::FieldMut::Value(self.go_package.get_or_insert_with(::std::default::Default::default)) + } + "cc_generic_services" => { + ::pb_jelly::reflection::FieldMut::Value(self.cc_generic_services.get_or_insert_with(::std::default::Default::default)) + } + "java_generic_services" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_generic_services.get_or_insert_with(::std::default::Default::default)) + } + "py_generic_services" => { + ::pb_jelly::reflection::FieldMut::Value(self.py_generic_services.get_or_insert_with(::std::default::Default::default)) + } + "php_generic_services" => { + ::pb_jelly::reflection::FieldMut::Value(self.php_generic_services.get_or_insert_with(::std::default::Default::default)) + } + "deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) + } + "cc_enable_arenas" => { + ::pb_jelly::reflection::FieldMut::Value(self.cc_enable_arenas.get_or_insert_with(::std::default::Default::default)) + } + "objc_class_prefix" => { + ::pb_jelly::reflection::FieldMut::Value(self.objc_class_prefix.get_or_insert_with(::std::default::Default::default)) + } + "csharp_namespace" => { + ::pb_jelly::reflection::FieldMut::Value(self.csharp_namespace.get_or_insert_with(::std::default::Default::default)) } - "deprecated" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) + "swift_prefix" => { + ::pb_jelly::reflection::FieldMut::Value(self.swift_prefix.get_or_insert_with(::std::default::Default::default)) + } + "php_class_prefix" => { + ::pb_jelly::reflection::FieldMut::Value(self.php_class_prefix.get_or_insert_with(::std::default::Default::default)) } - "deprecated_legacy_json_field_conflicts" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated_legacy_json_field_conflicts.get_or_insert_with(::std::default::Default::default)) + "php_namespace" => { + ::pb_jelly::reflection::FieldMut::Value(self.php_namespace.get_or_insert_with(::std::default::Default::default)) + } + "php_metadata_namespace" => { + ::pb_jelly::reflection::FieldMut::Value(self.php_metadata_namespace.get_or_insert_with(::std::default::Default::default)) } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) + "ruby_package" => { + ::pb_jelly::reflection::FieldMut::Value(self.ruby_package.get_or_insert_with(::std::default::Default::default)) } "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") @@ -9782,30 +6332,87 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for EnumOptions { + impl ::pb_jelly::extensions::Extensible for FileOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } #[derive(Clone, Debug, PartialEq)] - pub struct EnumValueOptions { - /// Is this enum value deprecated? + pub struct MessageOptions { + /// Set true to use the old proto1 MessageSet wire format for extensions. + /// This is provided for backwards-compatibility with the MessageSet wire + /// format. You should not use this for any other reason: It's less + /// efficient, has fewer features, and is more complicated. + + /// The message must be defined exactly as follows: + /// message Foo { + /// option message_set_wire_format = true; + /// extensions 4 to max; + /// } + /// Note that the message cannot have any defined fields; MessageSets only + /// have extensions. + + /// All extensions of your type must be singular messages; e.g. they cannot + /// be int32s, enums, or repeated messages. + + /// Because this is an option, the above two restrictions are not enforced by + /// the protocol compiler. + pub message_set_wire_format: ::std::option::Option, + /// Disables the generation of the standard "descriptor()" accessor, which can + /// conflict with a field of the same name. This is meant to make migration + /// from proto1 easier; new code should avoid fields named "descriptor". + pub no_standard_descriptor_accessor: ::std::option::Option, + /// Is this message deprecated? /// Depending on the target platform, this can emit Deprecated annotations - /// for the enum value, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating enum values. + /// for the message, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating messages. pub deprecated: ::std::option::Option, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - /// Indicate that fields annotated with this enum value should not be printed - /// out when using debug formats, e.g. when the field contains sensitive - /// credentials. - pub debug_redact: ::std::option::Option, + /// Whether the message is an automatically generated map entry type for the + /// maps field. + + /// For maps fields: + /// map map_field = 1; + /// The parsed descriptor looks like: + /// message MapFieldEntry { + /// option map_entry = true; + /// optional KeyType key = 1; + /// optional ValueType value = 2; + /// } + /// repeated MapFieldEntry map_field = 1; + + /// Implementations may choose not to generate the map_entry=true message, but + /// use a native map in the target language to hold the keys and values. + /// The reflection APIs in such implementations still need to work as + /// if the field is a repeated message field. + + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + pub map_entry: ::std::option::Option, /// The parser stores options it doesn't recognize here. See above. pub uninterpreted_option: ::std::vec::Vec, pub _extensions: ::pb_jelly::Unrecognized, } - impl EnumValueOptions { + impl MessageOptions { + pub fn has_message_set_wire_format(&self) -> bool { + self.message_set_wire_format.is_some() + } + pub fn set_message_set_wire_format(&mut self, v: bool) { + self.message_set_wire_format = Some(v); + } + pub fn get_message_set_wire_format(&self) -> bool { + self.message_set_wire_format.unwrap_or(false) + } + pub fn has_no_standard_descriptor_accessor(&self) -> bool { + self.no_standard_descriptor_accessor.is_some() + } + pub fn set_no_standard_descriptor_accessor(&mut self, v: bool) { + self.no_standard_descriptor_accessor = Some(v); + } + pub fn get_no_standard_descriptor_accessor(&self) -> bool { + self.no_standard_descriptor_accessor.unwrap_or(false) + } pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() } @@ -9815,26 +6422,14 @@ pub mod google { pub fn get_deprecated(&self) -> bool { self.deprecated.unwrap_or(false) } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } - pub fn has_debug_redact(&self) -> bool { - self.debug_redact.is_some() + pub fn has_map_entry(&self) -> bool { + self.map_entry.is_some() } - pub fn set_debug_redact(&mut self, v: bool) { - self.debug_redact = Some(v); + pub fn set_map_entry(&mut self, v: bool) { + self.map_entry = Some(v); } - pub fn get_debug_redact(&self) -> bool { - self.debug_redact.unwrap_or(false) + pub fn get_map_entry(&self) -> bool { + self.map_entry.unwrap_or(false) } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; @@ -9849,29 +6444,30 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for EnumValueOptions { + impl ::std::default::Default for MessageOptions { fn default() -> Self { - EnumValueOptions { + MessageOptions { + message_set_wire_format: Some(false), + no_standard_descriptor_accessor: Some(false), deprecated: Some(false), - features: ::std::default::Default::default(), - debug_redact: Some(false), + map_entry: ::std::default::Default::default(), uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref EnumValueOptions_default: EnumValueOptions = EnumValueOptions::default(); + pub static ref MessageOptions_default: MessageOptions = MessageOptions::default(); } - impl ::pb_jelly::Message for EnumValueOptions { + impl ::pb_jelly::Message for MessageOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "EnumValueOptions", - full_name: "google.protobuf.EnumValueOptions", + name: "MessageOptions", + full_name: "google.protobuf.MessageOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.EnumValueOptions.deprecated", + name: "message_set_wire_format", + full_name: "google.protobuf.MessageOptions.message_set_wire_format", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::Varint, @@ -9879,17 +6475,17 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.EnumValueOptions.features", + name: "no_standard_descriptor_accessor", + full_name: "google.protobuf.MessageOptions.no_standard_descriptor_accessor", index: 1, number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "debug_redact", - full_name: "google.protobuf.EnumValueOptions.debug_redact", + name: "deprecated", + full_name: "google.protobuf.MessageOptions.deprecated", index: 2, number: 3, typ: ::pb_jelly::wire_format::Type::Varint, @@ -9897,9 +6493,18 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.EnumValueOptions.uninterpreted_option", + name: "map_entry", + full_name: "google.protobuf.MessageOptions.map_entry", index: 3, + number: 7, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "uninterpreted_option", + full_name: "google.protobuf.MessageOptions.uninterpreted_option", + index: 4, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -9912,28 +6517,34 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; + let mut message_set_wire_format_size = 0; + if let Some(ref val) = self.message_set_wire_format { + let l = ::pb_jelly::Message::compute_size(val); + message_set_wire_format_size += ::pb_jelly::wire_format::serialized_length(1); + message_set_wire_format_size += l; + } + size += message_set_wire_format_size; + let mut no_standard_descriptor_accessor_size = 0; + if let Some(ref val) = self.no_standard_descriptor_accessor { + let l = ::pb_jelly::Message::compute_size(val); + no_standard_descriptor_accessor_size += ::pb_jelly::wire_format::serialized_length(2); + no_standard_descriptor_accessor_size += l; + } + size += no_standard_descriptor_accessor_size; let mut deprecated_size = 0; if let Some(ref val) = self.deprecated { let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(1); + deprecated_size += ::pb_jelly::wire_format::serialized_length(3); deprecated_size += l; } size += deprecated_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(2); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; - let mut debug_redact_size = 0; - if let Some(ref val) = self.debug_redact { + let mut map_entry_size = 0; + if let Some(ref val) = self.map_entry { let l = ::pb_jelly::Message::compute_size(val); - debug_redact_size += ::pb_jelly::wire_format::serialized_length(3); - debug_redact_size += l; + map_entry_size += ::pb_jelly::wire_format::serialized_length(7); + map_entry_size += l; } - size += debug_redact_size; + size += map_entry_size; let mut uninterpreted_option_size = 0; for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); @@ -9946,20 +6557,22 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.deprecated { + if let Some(ref val) = self.message_set_wire_format { ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.no_standard_descriptor_accessor { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.debug_redact { + if let Some(ref val) = self.deprecated { ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } + if let Some(ref val) = self.map_entry { + ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } for val in &self.uninterpreted_option { ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); @@ -9973,19 +6586,23 @@ pub mod google { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueOptions", 1)?; - self.deprecated = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 1)?; + self.message_set_wire_format = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 2)?; - self.features = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 2)?; + self.no_standard_descriptor_accessor = Some(val); } 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueOptions", 3)?; - self.debug_redact = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 3)?; + self.deprecated = Some(val); + } + 7 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 7)?; + self.map_entry = Some(val); } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MessageOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -9999,7 +6616,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for EnumValueOptions { + impl ::pb_jelly::Reflection for MessageOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -10009,14 +6626,17 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { + "message_set_wire_format" => { + ::pb_jelly::reflection::FieldMut::Value(self.message_set_wire_format.get_or_insert_with(::std::default::Default::default)) + } + "no_standard_descriptor_accessor" => { + ::pb_jelly::reflection::FieldMut::Value(self.no_standard_descriptor_accessor.get_or_insert_with(::std::default::Default::default)) + } "deprecated" => { ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } - "debug_redact" => { - ::pb_jelly::reflection::FieldMut::Value(self.debug_redact.get_or_insert_with(::std::default::Default::default)) + "map_entry" => { + ::pb_jelly::reflection::FieldMut::Value(self.map_entry.get_or_insert_with(::std::default::Default::default)) } "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") @@ -10027,42 +6647,113 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for EnumValueOptions { + impl ::pb_jelly::extensions::Extensible for MessageOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } #[derive(Clone, Debug, PartialEq)] - pub struct ServiceOptions { - /// Any features defined in the specific edition. - pub features: ::std::option::Option, - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. + pub struct FieldOptions { + /// The ctype option instructs the C++ code generator to use a different + /// representation of the field than it normally would. See the specific + /// options below. This option is not yet implemented in the open source + /// release -- sorry, we'll try to include it in a future version! + pub ctype: ::std::option::Option, + /// The packed option can be enabled for repeated primitive fields to enable + /// a more efficient representation on the wire. Rather than repeatedly + /// writing the tag and type for each element, the entire array is encoded as + /// a single length-delimited blob. In proto3, only explicit setting it to + /// false will avoid using packed encoding. + pub packed: ::std::option::Option, + /// The jstype option determines the JavaScript type used for values of the + /// field. The option is permitted only for 64 bit integral and fixed types + /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + /// is represented as JavaScript string, which avoids loss of precision that + /// can happen when a large value is converted to a floating point JavaScript. + /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + /// use the JavaScript "number" type. The behavior of the default option + /// JS_NORMAL is implementation dependent. - /// Is this service deprecated? + /// This option is an enum to permit additional types to be added, e.g. + /// goog.math.Integer. + pub jstype: ::std::option::Option, + /// Should this field be parsed lazily? Lazy applies only to message-type + /// fields. It means that when the outer message is initially parsed, the + /// inner message's contents will not be parsed but instead stored in encoded + /// form. The inner message will actually be parsed when it is first accessed. + + /// This is only a hint. Implementations are free to choose whether to use + /// eager or lazy parsing regardless of the value of this option. However, + /// setting this option true suggests that the protocol author believes that + /// using lazy parsing on this field is worth the additional bookkeeping + /// overhead typically needed to implement it. + + /// This option does not affect the public interface of any generated code; + /// all method signatures remain the same. Furthermore, thread-safety of the + /// interface is not affected by this option; const methods remain safe to + /// call from multiple threads concurrently, while non-const methods continue + /// to require exclusive access. + + + /// Note that implementations may choose not to check required fields within + /// a lazy sub-message. That is, calling IsInitialized() on the outer message + /// may return true even if the inner message has missing required fields. + /// This is necessary because otherwise the inner message would have to be + /// parsed in order to perform the check, defeating the purpose of lazy + /// parsing. An implementation which chooses not to check required fields + /// must be consistent about it. That is, for any particular sub-message, the + /// implementation must either *always* check its required fields, or *never* + /// check its required fields, regardless of whether or not the message has + /// been parsed. + pub lazy: ::std::option::Option, + /// Is this field deprecated? /// Depending on the target platform, this can emit Deprecated annotations - /// for the service, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating services. + /// for accessors, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating fields. pub deprecated: ::std::option::Option, + /// For Google-internal migration only. Do not use. + pub weak: ::std::option::Option, /// The parser stores options it doesn't recognize here. See above. pub uninterpreted_option: ::std::vec::Vec, pub _extensions: ::pb_jelly::Unrecognized, } - impl ServiceOptions { - pub fn has_features(&self) -> bool { - self.features.is_some() + impl FieldOptions { + pub fn has_ctype(&self) -> bool { + self.ctype.is_some() + } + pub fn set_ctype(&mut self, v: FieldOptions_CType) { + self.ctype = Some(v); + } + pub fn get_ctype(&self) -> FieldOptions_CType { + self.ctype.unwrap_or_default() + } + pub fn has_packed(&self) -> bool { + self.packed.is_some() + } + pub fn set_packed(&mut self, v: bool) { + self.packed = Some(v); + } + pub fn get_packed(&self) -> bool { + self.packed.unwrap_or(false) + } + pub fn has_jstype(&self) -> bool { + self.jstype.is_some() + } + pub fn set_jstype(&mut self, v: FieldOptions_JSType) { + self.jstype = Some(v); + } + pub fn get_jstype(&self) -> FieldOptions_JSType { + self.jstype.unwrap_or_default() } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); + pub fn has_lazy(&self) -> bool { + self.lazy.is_some() } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() + pub fn set_lazy(&mut self, v: bool) { + self.lazy = Some(v); } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) + pub fn get_lazy(&self) -> bool { + self.lazy.unwrap_or(false) } pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() @@ -10073,6 +6764,15 @@ pub mod google { pub fn get_deprecated(&self) -> bool { self.deprecated.unwrap_or(false) } + pub fn has_weak(&self) -> bool { + self.weak.is_some() + } + pub fn set_weak(&mut self, v: bool) { + self.weak = Some(v); + } + pub fn get_weak(&self) -> bool { + self.weak.unwrap_or(false) + } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; } @@ -10086,47 +6786,87 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for ServiceOptions { + impl ::std::default::Default for FieldOptions { fn default() -> Self { - ServiceOptions { - features: ::std::default::Default::default(), + FieldOptions { + ctype: Some(FieldOptions_CType::STRING), + packed: ::std::default::Default::default(), + jstype: Some(FieldOptions_JSType::JS_NORMAL), + lazy: Some(false), deprecated: Some(false), + weak: Some(false), uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref ServiceOptions_default: ServiceOptions = ServiceOptions::default(); + pub static ref FieldOptions_default: FieldOptions = FieldOptions::default(); } - impl ::pb_jelly::Message for ServiceOptions { + impl ::pb_jelly::Message for FieldOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "ServiceOptions", - full_name: "google.protobuf.ServiceOptions", + name: "FieldOptions", + full_name: "google.protobuf.FieldOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.ServiceOptions.features", + name: "ctype", + full_name: "google.protobuf.FieldOptions.ctype", index: 0, - number: 34, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 1, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.ServiceOptions.deprecated", + name: "packed", + full_name: "google.protobuf.FieldOptions.packed", index: 1, - number: 33, + number: 2, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.ServiceOptions.uninterpreted_option", + name: "jstype", + full_name: "google.protobuf.FieldOptions.jstype", index: 2, + number: 6, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "lazy", + full_name: "google.protobuf.FieldOptions.lazy", + index: 3, + number: 5, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "deprecated", + full_name: "google.protobuf.FieldOptions.deprecated", + index: 4, + number: 3, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "weak", + full_name: "google.protobuf.FieldOptions.weak", + index: 5, + number: 10, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "uninterpreted_option", + full_name: "google.protobuf.FieldOptions.uninterpreted_option", + index: 6, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -10139,21 +6879,48 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut features_size = 0; - if let Some(ref val) = self.features { + let mut ctype_size = 0; + if let Some(ref val) = self.ctype { + let l = ::pb_jelly::Message::compute_size(val); + ctype_size += ::pb_jelly::wire_format::serialized_length(1); + ctype_size += l; + } + size += ctype_size; + let mut packed_size = 0; + if let Some(ref val) = self.packed { + let l = ::pb_jelly::Message::compute_size(val); + packed_size += ::pb_jelly::wire_format::serialized_length(2); + packed_size += l; + } + size += packed_size; + let mut jstype_size = 0; + if let Some(ref val) = self.jstype { + let l = ::pb_jelly::Message::compute_size(val); + jstype_size += ::pb_jelly::wire_format::serialized_length(6); + jstype_size += l; + } + size += jstype_size; + let mut lazy_size = 0; + if let Some(ref val) = self.lazy { let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(34); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; + lazy_size += ::pb_jelly::wire_format::serialized_length(5); + lazy_size += l; } - size += features_size; + size += lazy_size; let mut deprecated_size = 0; if let Some(ref val) = self.deprecated { let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(33); + deprecated_size += ::pb_jelly::wire_format::serialized_length(3); deprecated_size += l; } size += deprecated_size; + let mut weak_size = 0; + if let Some(ref val) = self.weak { + let l = ::pb_jelly::Message::compute_size(val); + weak_size += ::pb_jelly::wire_format::serialized_length(10); + weak_size += l; + } + size += weak_size; let mut uninterpreted_option_size = 0; for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); @@ -10166,14 +6933,28 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.ctype { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.packed { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(33, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(34, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.lazy { + ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.jstype { + ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.weak { + ::pb_jelly::wire_format::write(10, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } for val in &self.uninterpreted_option { @@ -10188,16 +6969,32 @@ pub mod google { fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 34 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceOptions", 34)?; - self.features = Some(val); + 1 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 1)?; + self.ctype = Some(val); } - 33 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ServiceOptions", 33)?; + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 2)?; + self.packed = Some(val); + } + 6 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 6)?; + self.jstype = Some(val); + } + 5 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 5)?; + self.lazy = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 3)?; self.deprecated = Some(val); } + 10 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions", 10)?; + self.weak = Some(val); + } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -10211,7 +7008,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for ServiceOptions { + impl ::pb_jelly::Reflection for FieldOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -10221,12 +7018,24 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) + "ctype" => { + ::pb_jelly::reflection::FieldMut::Value(self.ctype.get_or_insert_with(::std::default::Default::default)) + } + "packed" => { + ::pb_jelly::reflection::FieldMut::Value(self.packed.get_or_insert_with(::std::default::Default::default)) + } + "jstype" => { + ::pb_jelly::reflection::FieldMut::Value(self.jstype.get_or_insert_with(::std::default::Default::default)) + } + "lazy" => { + ::pb_jelly::reflection::FieldMut::Value(self.lazy.get_or_insert_with(::std::default::Default::default)) } "deprecated" => { ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) } + "weak" => { + ::pb_jelly::reflection::FieldMut::Value(self.weak.get_or_insert_with(::std::default::Default::default)) + } "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") } @@ -10236,62 +7045,19 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for ServiceOptions { + impl ::pb_jelly::extensions::Extensible for FieldOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } #[derive(Clone, Debug, PartialEq)] - pub struct MethodOptions { - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - /// Is this method deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the method, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating methods. - pub deprecated: ::std::option::Option, - pub idempotency_level: ::std::option::Option, - /// Any features defined in the specific edition. - pub features: ::std::option::Option, + pub struct OneofOptions { /// The parser stores options it doesn't recognize here. See above. pub uninterpreted_option: ::std::vec::Vec, pub _extensions: ::pb_jelly::Unrecognized, } - impl MethodOptions { - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() - } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); - } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) - } - pub fn has_idempotency_level(&self) -> bool { - self.idempotency_level.is_some() - } - pub fn set_idempotency_level(&mut self, v: MethodOptions_IdempotencyLevel) { - self.idempotency_level = Some(v); - } - pub fn get_idempotency_level(&self) -> MethodOptions_IdempotencyLevel { - self.idempotency_level.unwrap_or_default() - } - pub fn has_features(&self) -> bool { - self.features.is_some() - } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); - } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() - } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) - } + impl OneofOptions { pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; } @@ -10305,57 +7071,27 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for MethodOptions { + impl ::std::default::Default for OneofOptions { fn default() -> Self { - MethodOptions { - deprecated: Some(false), - idempotency_level: Some(MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN), - features: ::std::default::Default::default(), + OneofOptions { uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref MethodOptions_default: MethodOptions = MethodOptions::default(); + pub static ref OneofOptions_default: OneofOptions = OneofOptions::default(); } - impl ::pb_jelly::Message for MethodOptions { + impl ::pb_jelly::Message for OneofOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "MethodOptions", - full_name: "google.protobuf.MethodOptions", + name: "OneofOptions", + full_name: "google.protobuf.OneofOptions", fields: &[ - ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.MethodOptions.deprecated", - index: 0, - number: 33, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "idempotency_level", - full_name: "google.protobuf.MethodOptions.idempotency_level", - index: 1, - number: 34, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.MethodOptions.features", - index: 2, - number: 35, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, ::pb_jelly::FieldDescriptor { name: "uninterpreted_option", - full_name: "google.protobuf.MethodOptions.uninterpreted_option", - index: 3, + full_name: "google.protobuf.OneofOptions.uninterpreted_option", + index: 0, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -10368,28 +7104,6 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut deprecated_size = 0; - if let Some(ref val) = self.deprecated { - let l = ::pb_jelly::Message::compute_size(val); - deprecated_size += ::pb_jelly::wire_format::serialized_length(33); - deprecated_size += l; - } - size += deprecated_size; - let mut idempotency_level_size = 0; - if let Some(ref val) = self.idempotency_level { - let l = ::pb_jelly::Message::compute_size(val); - idempotency_level_size += ::pb_jelly::wire_format::serialized_length(34); - idempotency_level_size += l; - } - size += idempotency_level_size; - let mut features_size = 0; - if let Some(ref val) = self.features { - let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(35); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; - } - size += features_size; let mut uninterpreted_option_size = 0; for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); @@ -10402,20 +7116,6 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.deprecated { - ::pb_jelly::wire_format::write(33, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.idempotency_level { - ::pb_jelly::wire_format::write(34, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(35, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } for val in &self.uninterpreted_option { ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); @@ -10428,20 +7128,8 @@ pub mod google { fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 33 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodOptions", 33)?; - self.deprecated = Some(val); - } - 34 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodOptions", 34)?; - self.idempotency_level = Some(val); - } - 35 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodOptions", 35)?; - self.features = Some(val); - } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "OneofOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -10455,7 +7143,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for MethodOptions { + impl ::pb_jelly::Reflection for OneofOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -10465,15 +7153,6 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "deprecated" => { - ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) - } - "idempotency_level" => { - ::pb_jelly::reflection::FieldMut::Value(self.idempotency_level.get_or_insert_with(::std::default::Default::default)) - } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) - } "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") } @@ -10483,190 +7162,102 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for MethodOptions { + impl ::pb_jelly::extensions::Extensible for OneofOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } - /// A message representing a option the parser does not recognize. This only - /// appears in options protos created by the compiler::Parser class. - /// DescriptorPool resolves these when building Descriptor objects. Therefore, - /// options protos in descriptor objects (e.g. returned by Descriptor::options(), - /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - /// in them. #[derive(Clone, Debug, PartialEq)] - pub struct UninterpretedOption { - pub name: ::std::vec::Vec, - /// The value of the uninterpreted option, in whatever type the tokenizer - /// identified it as during parsing. Exactly one of these should be set. - pub identifier_value: ::std::option::Option<::std::string::String>, - pub positive_int_value: ::std::option::Option, - pub negative_int_value: ::std::option::Option, - pub double_value: ::std::option::Option, - pub string_value: ::std::option::Option<::std::vec::Vec>, - pub aggregate_value: ::std::option::Option<::std::string::String>, + pub struct EnumOptions { + /// Set this option to true to allow mapping different tag names to the same + /// value. + pub allow_alias: ::std::option::Option, + /// Is this enum deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating enums. + pub deprecated: ::std::option::Option, + /// The parser stores options it doesn't recognize here. See above. + pub uninterpreted_option: ::std::vec::Vec, + pub _extensions: ::pb_jelly::Unrecognized, } - impl UninterpretedOption { - pub fn set_name(&mut self, v: ::std::vec::Vec) { - self.name = v; - } - pub fn take_name(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.name) - } - pub fn get_name(&self) -> &[UninterpretedOption_NamePart] { - &self.name - } - pub fn mut_name(&mut self) -> &mut ::std::vec::Vec { - &mut self.name - } - pub fn has_identifier_value(&self) -> bool { - self.identifier_value.is_some() - } - pub fn set_identifier_value(&mut self, v: ::std::string::String) { - self.identifier_value = Some(v); - } - pub fn take_identifier_value(&mut self) -> ::std::string::String { - self.identifier_value.take().unwrap_or_default() - } - pub fn get_identifier_value(&self) -> &str { - self.identifier_value.as_deref().unwrap_or("") - } - pub fn has_positive_int_value(&self) -> bool { - self.positive_int_value.is_some() - } - pub fn set_positive_int_value(&mut self, v: u64) { - self.positive_int_value = Some(v); - } - pub fn get_positive_int_value(&self) -> u64 { - self.positive_int_value.unwrap_or(0) - } - pub fn has_negative_int_value(&self) -> bool { - self.negative_int_value.is_some() - } - pub fn set_negative_int_value(&mut self, v: i64) { - self.negative_int_value = Some(v); - } - pub fn get_negative_int_value(&self) -> i64 { - self.negative_int_value.unwrap_or(0) - } - pub fn has_double_value(&self) -> bool { - self.double_value.is_some() - } - pub fn set_double_value(&mut self, v: f64) { - self.double_value = Some(v); + impl EnumOptions { + pub fn has_allow_alias(&self) -> bool { + self.allow_alias.is_some() } - pub fn get_double_value(&self) -> f64 { - self.double_value.unwrap_or(0.) + pub fn set_allow_alias(&mut self, v: bool) { + self.allow_alias = Some(v); } - pub fn has_string_value(&self) -> bool { - self.string_value.is_some() + pub fn get_allow_alias(&self) -> bool { + self.allow_alias.unwrap_or(false) } - pub fn set_string_value(&mut self, v: ::std::vec::Vec) { - self.string_value = Some(v); + pub fn has_deprecated(&self) -> bool { + self.deprecated.is_some() } - pub fn take_string_value(&mut self) -> ::std::vec::Vec { - self.string_value.take().unwrap_or_default() + pub fn set_deprecated(&mut self, v: bool) { + self.deprecated = Some(v); } - pub fn get_string_value(&self) -> &[u8] { - self.string_value.as_deref().unwrap_or(&[]) + pub fn get_deprecated(&self) -> bool { + self.deprecated.unwrap_or(false) } - pub fn has_aggregate_value(&self) -> bool { - self.aggregate_value.is_some() + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn set_aggregate_value(&mut self, v: ::std::string::String) { - self.aggregate_value = Some(v); + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn take_aggregate_value(&mut self) -> ::std::string::String { - self.aggregate_value.take().unwrap_or_default() + pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { + &self.uninterpreted_option } - pub fn get_aggregate_value(&self) -> &str { - self.aggregate_value.as_deref().unwrap_or("") + pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { + &mut self.uninterpreted_option } } - impl ::std::default::Default for UninterpretedOption { + impl ::std::default::Default for EnumOptions { fn default() -> Self { - UninterpretedOption { - name: ::std::default::Default::default(), - identifier_value: ::std::default::Default::default(), - positive_int_value: ::std::default::Default::default(), - negative_int_value: ::std::default::Default::default(), - double_value: ::std::default::Default::default(), - string_value: ::std::default::Default::default(), - aggregate_value: ::std::default::Default::default(), + EnumOptions { + allow_alias: ::std::default::Default::default(), + deprecated: Some(false), + uninterpreted_option: ::std::default::Default::default(), + _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref UninterpretedOption_default: UninterpretedOption = UninterpretedOption::default(); + pub static ref EnumOptions_default: EnumOptions = EnumOptions::default(); } - impl ::pb_jelly::Message for UninterpretedOption { + impl ::pb_jelly::Message for EnumOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "UninterpretedOption", - full_name: "google.protobuf.UninterpretedOption", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.UninterpretedOption.name", - index: 0, - number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "identifier_value", - full_name: "google.protobuf.UninterpretedOption.identifier_value", - index: 1, - number: 3, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "positive_int_value", - full_name: "google.protobuf.UninterpretedOption.positive_int_value", - index: 2, - number: 4, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, + name: "EnumOptions", + full_name: "google.protobuf.EnumOptions", + fields: &[ ::pb_jelly::FieldDescriptor { - name: "negative_int_value", - full_name: "google.protobuf.UninterpretedOption.negative_int_value", - index: 3, - number: 5, + name: "allow_alias", + full_name: "google.protobuf.EnumOptions.allow_alias", + index: 0, + number: 2, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "double_value", - full_name: "google.protobuf.UninterpretedOption.double_value", - index: 4, - number: 6, - typ: ::pb_jelly::wire_format::Type::Fixed64, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "string_value", - full_name: "google.protobuf.UninterpretedOption.string_value", - index: 5, - number: 7, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + name: "deprecated", + full_name: "google.protobuf.EnumOptions.deprecated", + index: 1, + number: 3, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "aggregate_value", - full_name: "google.protobuf.UninterpretedOption.aggregate_value", - index: 6, - number: 8, + name: "uninterpreted_option", + full_name: "google.protobuf.EnumOptions.uninterpreted_option", + index: 2, + number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ], @@ -10676,130 +7267,228 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut name_size = 0; - for val in &self.name { - let l = ::pb_jelly::Message::compute_size(val); - name_size += ::pb_jelly::wire_format::serialized_length(2); - name_size += ::pb_jelly::varint::serialized_length(l as u64); - name_size += l; - } - size += name_size; - let mut identifier_value_size = 0; - if let Some(ref val) = self.identifier_value { - let l = ::pb_jelly::Message::compute_size(val); - identifier_value_size += ::pb_jelly::wire_format::serialized_length(3); - identifier_value_size += ::pb_jelly::varint::serialized_length(l as u64); - identifier_value_size += l; - } - size += identifier_value_size; - let mut positive_int_value_size = 0; - if let Some(ref val) = self.positive_int_value { - let l = ::pb_jelly::Message::compute_size(val); - positive_int_value_size += ::pb_jelly::wire_format::serialized_length(4); - positive_int_value_size += l; - } - size += positive_int_value_size; - let mut negative_int_value_size = 0; - if let Some(ref val) = self.negative_int_value { - let l = ::pb_jelly::Message::compute_size(val); - negative_int_value_size += ::pb_jelly::wire_format::serialized_length(5); - negative_int_value_size += l; - } - size += negative_int_value_size; - let mut double_value_size = 0; - if let Some(ref val) = self.double_value { + let mut allow_alias_size = 0; + if let Some(ref val) = self.allow_alias { let l = ::pb_jelly::Message::compute_size(val); - double_value_size += ::pb_jelly::wire_format::serialized_length(6); - double_value_size += l; + allow_alias_size += ::pb_jelly::wire_format::serialized_length(2); + allow_alias_size += l; } - size += double_value_size; - let mut string_value_size = 0; - if let Some(ref val) = self.string_value { + size += allow_alias_size; + let mut deprecated_size = 0; + if let Some(ref val) = self.deprecated { let l = ::pb_jelly::Message::compute_size(val); - string_value_size += ::pb_jelly::wire_format::serialized_length(7); - string_value_size += ::pb_jelly::varint::serialized_length(l as u64); - string_value_size += l; + deprecated_size += ::pb_jelly::wire_format::serialized_length(3); + deprecated_size += l; } - size += string_value_size; - let mut aggregate_value_size = 0; - if let Some(ref val) = self.aggregate_value { + size += deprecated_size; + let mut uninterpreted_option_size = 0; + for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); - aggregate_value_size += ::pb_jelly::wire_format::serialized_length(8); - aggregate_value_size += ::pb_jelly::varint::serialized_length(l as u64); - aggregate_value_size += l; + uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); + uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); + uninterpreted_option_size += l; } - size += aggregate_value_size; + size += uninterpreted_option_size; + size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.name { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.allow_alias { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.identifier_value { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + if let Some(ref val) = self.deprecated { + ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + for val in &self.uninterpreted_option { + ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.positive_int_value { - ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; + self._extensions.serialize(w)?; + Ok(()) + } + fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { + while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { + match field_number { + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 2)?; + self.allow_alias = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 3)?; + self.deprecated = Some(val); + } + 999 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumOptions", 999)?; + self.uninterpreted_option.push(val); + } + 1000..=536870911 => { + self._extensions.gather(field_number, typ, &mut buf)?; + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } } - if let Some(ref val) = self.negative_int_value { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; + Ok(()) + } + } + impl ::pb_jelly::Reflection for EnumOptions { + fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { + match oneof_name { + _ => { + panic!("unknown oneof name given"); + } } - if let Some(ref val) = self.double_value { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Fixed64, w)?; - ::pb_jelly::Message::serialize(val, w)?; + } + fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { + match field_name { + "allow_alias" => { + ::pb_jelly::reflection::FieldMut::Value(self.allow_alias.get_or_insert_with(::std::default::Default::default)) + } + "deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) + } + "uninterpreted_option" => { + unimplemented!("Repeated fields are not currently supported.") + } + _ => { + panic!("unknown field name given") + } + } + } + } + impl ::pb_jelly::extensions::Extensible for EnumOptions { + fn _extensions(&self) -> &::pb_jelly::Unrecognized { + &self._extensions + } + } + + #[derive(Clone, Debug, PartialEq)] + pub struct EnumValueOptions { + /// Is this enum value deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum value, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating enum values. + pub deprecated: ::std::option::Option, + /// The parser stores options it doesn't recognize here. See above. + pub uninterpreted_option: ::std::vec::Vec, + pub _extensions: ::pb_jelly::Unrecognized, + } + impl EnumValueOptions { + pub fn has_deprecated(&self) -> bool { + self.deprecated.is_some() + } + pub fn set_deprecated(&mut self, v: bool) { + self.deprecated = Some(v); + } + pub fn get_deprecated(&self) -> bool { + self.deprecated.unwrap_or(false) + } + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; + } + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) + } + pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { + &self.uninterpreted_option + } + pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { + &mut self.uninterpreted_option + } + } + impl ::std::default::Default for EnumValueOptions { + fn default() -> Self { + EnumValueOptions { + deprecated: Some(false), + uninterpreted_option: ::std::default::Default::default(), + _extensions: ::pb_jelly::Unrecognized::default(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref EnumValueOptions_default: EnumValueOptions = EnumValueOptions::default(); + } + impl ::pb_jelly::Message for EnumValueOptions { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "EnumValueOptions", + full_name: "google.protobuf.EnumValueOptions", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "deprecated", + full_name: "google.protobuf.EnumValueOptions.deprecated", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "uninterpreted_option", + full_name: "google.protobuf.EnumValueOptions.uninterpreted_option", + index: 1, + number: 999, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ], + oneofs: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0; + let mut deprecated_size = 0; + if let Some(ref val) = self.deprecated { + let l = ::pb_jelly::Message::compute_size(val); + deprecated_size += ::pb_jelly::wire_format::serialized_length(1); + deprecated_size += l; } - if let Some(ref val) = self.string_value { - ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + size += deprecated_size; + let mut uninterpreted_option_size = 0; + for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); + uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); + uninterpreted_option_size += l; + } + size += uninterpreted_option_size; + size += self._extensions.compute_size(); + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.deprecated { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.aggregate_value { - ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + for val in &self.uninterpreted_option { + ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } + self._extensions.serialize(w)?; Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 2)?; - self.name.push(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 3)?; - self.identifier_value = Some(val); - } - 4 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption", 4)?; - self.positive_int_value = Some(val); - } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption", 5)?; - self.negative_int_value = Some(val); - } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Fixed64, "UninterpretedOption", 6)?; - self.double_value = Some(val); + 1 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueOptions", 1)?; + self.deprecated = Some(val); } - 7 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::>(buf, typ, "UninterpretedOption", 7)?; - self.string_value = Some(val); + 999 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 999)?; + self.uninterpreted_option.push(val); } - 8 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 8)?; - self.aggregate_value = Some(val); + 1000..=536870911 => { + self._extensions.gather(field_number, typ, &mut buf)?; } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -10809,7 +7498,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for UninterpretedOption { + impl ::pb_jelly::Reflection for EnumValueOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -10819,26 +7508,11 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "name" => { - unimplemented!("Repeated fields are not currently supported.") - } - "identifier_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.identifier_value.get_or_insert_with(::std::default::Default::default)) - } - "positive_int_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.positive_int_value.get_or_insert_with(::std::default::Default::default)) - } - "negative_int_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.negative_int_value.get_or_insert_with(::std::default::Default::default)) - } - "double_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.double_value.get_or_insert_with(::std::default::Default::default)) - } - "string_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.string_value.get_or_insert_with(::std::default::Default::default)) + "deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) } - "aggregate_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.aggregate_value.get_or_insert_with(::std::default::Default::default)) + "uninterpreted_option" => { + unimplemented!("Repeated fields are not currently supported.") } _ => { panic!("unknown field name given") @@ -10846,73 +7520,85 @@ pub mod google { } } } + impl ::pb_jelly::extensions::Extensible for EnumValueOptions { + fn _extensions(&self) -> &::pb_jelly::Unrecognized { + &self._extensions + } + } - /// The name of the uninterpreted option. Each string represents a segment in - /// a dot-separated name. is_extension is true iff a segment represents an - /// extension (denoted with parentheses in options specs in .proto files). - /// E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - /// "foo.(bar.baz).moo". - #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] - pub struct UninterpretedOption_NamePart { - pub name_part: ::std::option::Option<::std::string::String>, - pub is_extension: ::std::option::Option, + #[derive(Clone, Debug, PartialEq)] + pub struct ServiceOptions { + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + /// Is this service deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the service, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating services. + pub deprecated: ::std::option::Option, + /// The parser stores options it doesn't recognize here. See above. + pub uninterpreted_option: ::std::vec::Vec, + pub _extensions: ::pb_jelly::Unrecognized, } - impl UninterpretedOption_NamePart { - pub fn has_name_part(&self) -> bool { - self.name_part.is_some() + impl ServiceOptions { + pub fn has_deprecated(&self) -> bool { + self.deprecated.is_some() } - pub fn set_name_part(&mut self, v: ::std::string::String) { - self.name_part = Some(v); + pub fn set_deprecated(&mut self, v: bool) { + self.deprecated = Some(v); } - pub fn take_name_part(&mut self) -> ::std::string::String { - self.name_part.take().unwrap_or_default() + pub fn get_deprecated(&self) -> bool { + self.deprecated.unwrap_or(false) } - pub fn get_name_part(&self) -> &str { - self.name_part.as_deref().unwrap_or("") + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn has_is_extension(&self) -> bool { - self.is_extension.is_some() + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn set_is_extension(&mut self, v: bool) { - self.is_extension = Some(v); + pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { + &self.uninterpreted_option } - pub fn get_is_extension(&self) -> bool { - self.is_extension.unwrap_or(false) + pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { + &mut self.uninterpreted_option } } - impl ::std::default::Default for UninterpretedOption_NamePart { + impl ::std::default::Default for ServiceOptions { fn default() -> Self { - UninterpretedOption_NamePart { - name_part: ::std::default::Default::default(), - is_extension: ::std::default::Default::default(), + ServiceOptions { + deprecated: Some(false), + uninterpreted_option: ::std::default::Default::default(), + _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref UninterpretedOption_NamePart_default: UninterpretedOption_NamePart = UninterpretedOption_NamePart::default(); + pub static ref ServiceOptions_default: ServiceOptions = ServiceOptions::default(); } - impl ::pb_jelly::Message for UninterpretedOption_NamePart { + impl ::pb_jelly::Message for ServiceOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "UninterpretedOption_NamePart", - full_name: "google.protobuf.UninterpretedOption_NamePart", + name: "ServiceOptions", + full_name: "google.protobuf.ServiceOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name_part", - full_name: "google.protobuf.UninterpretedOption_NamePart.name_part", + name: "deprecated", + full_name: "google.protobuf.ServiceOptions.deprecated", index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Required, + number: 33, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "is_extension", - full_name: "google.protobuf.UninterpretedOption_NamePart.is_extension", + name: "uninterpreted_option", + full_name: "google.protobuf.ServiceOptions.uninterpreted_option", index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Required, + number: 999, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ], @@ -10922,46 +7608,51 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut name_part_size = 0; - if let Some(ref val) = self.name_part { + let mut deprecated_size = 0; + if let Some(ref val) = self.deprecated { let l = ::pb_jelly::Message::compute_size(val); - name_part_size += ::pb_jelly::wire_format::serialized_length(1); - name_part_size += ::pb_jelly::varint::serialized_length(l as u64); - name_part_size += l; + deprecated_size += ::pb_jelly::wire_format::serialized_length(33); + deprecated_size += l; } - size += name_part_size; - let mut is_extension_size = 0; - if let Some(ref val) = self.is_extension { + size += deprecated_size; + let mut uninterpreted_option_size = 0; + for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); - is_extension_size += ::pb_jelly::wire_format::serialized_length(2); - is_extension_size += l; + uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); + uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); + uninterpreted_option_size += l; } - size += is_extension_size; + size += uninterpreted_option_size; + size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name_part { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; - let l = ::pb_jelly::Message::compute_size(val); - ::pb_jelly::varint::write(l as u64, w)?; + if let Some(ref val) = self.deprecated { + ::pb_jelly::wire_format::write(33, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.is_extension { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; + for val in &self.uninterpreted_option { + ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } + self._extensions.serialize(w)?; Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption_NamePart", 1)?; - self.name_part = Some(val); + 33 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ServiceOptions", 33)?; + self.deprecated = Some(val); } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption_NamePart", 2)?; - self.is_extension = Some(val); + 999 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceOptions", 999)?; + self.uninterpreted_option.push(val); + } + 1000..=536870911 => { + self._extensions.gather(field_number, typ, &mut buf)?; } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -10971,7 +7662,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for UninterpretedOption_NamePart { + impl ::pb_jelly::Reflection for ServiceOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -10981,11 +7672,11 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "name_part" => { - ::pb_jelly::reflection::FieldMut::Value(self.name_part.get_or_insert_with(::std::default::Default::default)) + "deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) } - "is_extension" => { - ::pb_jelly::reflection::FieldMut::Value(self.is_extension.get_or_insert_with(::std::default::Default::default)) + "uninterpreted_option" => { + unimplemented!("Repeated fields are not currently supported.") } _ => { panic!("unknown field name given") @@ -10993,156 +7684,105 @@ pub mod google { } } } + impl ::pb_jelly::extensions::Extensible for ServiceOptions { + fn _extensions(&self) -> &::pb_jelly::Unrecognized { + &self._extensions + } + } - // =================================================================== - // Features + #[derive(Clone, Debug, PartialEq)] + pub struct MethodOptions { + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. - /// TODO Enums in C++ gencode (and potentially other languages) are - /// not well scoped. This means that each of the feature enums below can clash - /// with each other. The short names we've chosen maximize call-site - /// readability, but leave us very open to this scenario. A future feature will - /// be designed and implemented to handle this, hopefully before we ever hit a - /// conflict here. - #[derive(Clone, Debug, PartialEq)] - pub struct FeatureSet { - pub field_presence: ::std::option::Option, - pub enum_type: ::std::option::Option, - pub repeated_field_encoding: ::std::option::Option, - pub utf8_validation: ::std::option::Option, - pub message_encoding: ::std::option::Option, - pub json_format: ::std::option::Option, + /// Is this method deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the method, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating methods. + pub deprecated: ::std::option::Option, + pub idempotency_level: ::std::option::Option, + /// The parser stores options it doesn't recognize here. See above. + pub uninterpreted_option: ::std::vec::Vec, pub _extensions: ::pb_jelly::Unrecognized, } - impl FeatureSet { - pub fn has_field_presence(&self) -> bool { - self.field_presence.is_some() - } - pub fn set_field_presence(&mut self, v: FeatureSet_FieldPresence) { - self.field_presence = Some(v); - } - pub fn get_field_presence(&self) -> FeatureSet_FieldPresence { - self.field_presence.unwrap_or_default() - } - pub fn has_enum_type(&self) -> bool { - self.enum_type.is_some() - } - pub fn set_enum_type(&mut self, v: FeatureSet_EnumType) { - self.enum_type = Some(v); - } - pub fn get_enum_type(&self) -> FeatureSet_EnumType { - self.enum_type.unwrap_or_default() - } - pub fn has_repeated_field_encoding(&self) -> bool { - self.repeated_field_encoding.is_some() - } - pub fn set_repeated_field_encoding(&mut self, v: FeatureSet_RepeatedFieldEncoding) { - self.repeated_field_encoding = Some(v); - } - pub fn get_repeated_field_encoding(&self) -> FeatureSet_RepeatedFieldEncoding { - self.repeated_field_encoding.unwrap_or_default() + impl MethodOptions { + pub fn has_deprecated(&self) -> bool { + self.deprecated.is_some() } - pub fn has_utf8_validation(&self) -> bool { - self.utf8_validation.is_some() + pub fn set_deprecated(&mut self, v: bool) { + self.deprecated = Some(v); } - pub fn set_utf8_validation(&mut self, v: FeatureSet_Utf8Validation) { - self.utf8_validation = Some(v); + pub fn get_deprecated(&self) -> bool { + self.deprecated.unwrap_or(false) } - pub fn get_utf8_validation(&self) -> FeatureSet_Utf8Validation { - self.utf8_validation.unwrap_or_default() + pub fn has_idempotency_level(&self) -> bool { + self.idempotency_level.is_some() } - pub fn has_message_encoding(&self) -> bool { - self.message_encoding.is_some() + pub fn set_idempotency_level(&mut self, v: MethodOptions_IdempotencyLevel) { + self.idempotency_level = Some(v); } - pub fn set_message_encoding(&mut self, v: FeatureSet_MessageEncoding) { - self.message_encoding = Some(v); + pub fn get_idempotency_level(&self) -> MethodOptions_IdempotencyLevel { + self.idempotency_level.unwrap_or_default() } - pub fn get_message_encoding(&self) -> FeatureSet_MessageEncoding { - self.message_encoding.unwrap_or_default() + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn has_json_format(&self) -> bool { - self.json_format.is_some() + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn set_json_format(&mut self, v: FeatureSet_JsonFormat) { - self.json_format = Some(v); + pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { + &self.uninterpreted_option } - pub fn get_json_format(&self) -> FeatureSet_JsonFormat { - self.json_format.unwrap_or_default() + pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { + &mut self.uninterpreted_option } } - impl ::std::default::Default for FeatureSet { + impl ::std::default::Default for MethodOptions { fn default() -> Self { - FeatureSet { - field_presence: ::std::default::Default::default(), - enum_type: ::std::default::Default::default(), - repeated_field_encoding: ::std::default::Default::default(), - utf8_validation: ::std::default::Default::default(), - message_encoding: ::std::default::Default::default(), - json_format: ::std::default::Default::default(), + MethodOptions { + deprecated: Some(false), + idempotency_level: Some(MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN), + uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref FeatureSet_default: FeatureSet = FeatureSet::default(); + pub static ref MethodOptions_default: MethodOptions = MethodOptions::default(); } - impl ::pb_jelly::Message for FeatureSet { + impl ::pb_jelly::Message for MethodOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FeatureSet", - full_name: "google.protobuf.FeatureSet", + name: "MethodOptions", + full_name: "google.protobuf.MethodOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "field_presence", - full_name: "google.protobuf.FeatureSet.field_presence", + name: "deprecated", + full_name: "google.protobuf.MethodOptions.deprecated", index: 0, - number: 1, + number: 33, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "enum_type", - full_name: "google.protobuf.FeatureSet.enum_type", + name: "idempotency_level", + full_name: "google.protobuf.MethodOptions.idempotency_level", index: 1, - number: 2, + number: 34, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "repeated_field_encoding", - full_name: "google.protobuf.FeatureSet.repeated_field_encoding", + name: "uninterpreted_option", + full_name: "google.protobuf.MethodOptions.uninterpreted_option", index: 2, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "utf8_validation", - full_name: "google.protobuf.FeatureSet.utf8_validation", - index: 3, - number: 4, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "message_encoding", - full_name: "google.protobuf.FeatureSet.message_encoding", - index: 4, - number: 5, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "json_format", - full_name: "google.protobuf.FeatureSet.json_format", - index: 5, - number: 6, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + number: 999, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ], @@ -11152,74 +7792,44 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut field_presence_size = 0; - if let Some(ref val) = self.field_presence { - let l = ::pb_jelly::Message::compute_size(val); - field_presence_size += ::pb_jelly::wire_format::serialized_length(1); - field_presence_size += l; - } - size += field_presence_size; - let mut enum_type_size = 0; - if let Some(ref val) = self.enum_type { - let l = ::pb_jelly::Message::compute_size(val); - enum_type_size += ::pb_jelly::wire_format::serialized_length(2); - enum_type_size += l; - } - size += enum_type_size; - let mut repeated_field_encoding_size = 0; - if let Some(ref val) = self.repeated_field_encoding { - let l = ::pb_jelly::Message::compute_size(val); - repeated_field_encoding_size += ::pb_jelly::wire_format::serialized_length(3); - repeated_field_encoding_size += l; - } - size += repeated_field_encoding_size; - let mut utf8_validation_size = 0; - if let Some(ref val) = self.utf8_validation { + let mut deprecated_size = 0; + if let Some(ref val) = self.deprecated { let l = ::pb_jelly::Message::compute_size(val); - utf8_validation_size += ::pb_jelly::wire_format::serialized_length(4); - utf8_validation_size += l; + deprecated_size += ::pb_jelly::wire_format::serialized_length(33); + deprecated_size += l; } - size += utf8_validation_size; - let mut message_encoding_size = 0; - if let Some(ref val) = self.message_encoding { + size += deprecated_size; + let mut idempotency_level_size = 0; + if let Some(ref val) = self.idempotency_level { let l = ::pb_jelly::Message::compute_size(val); - message_encoding_size += ::pb_jelly::wire_format::serialized_length(5); - message_encoding_size += l; + idempotency_level_size += ::pb_jelly::wire_format::serialized_length(34); + idempotency_level_size += l; } - size += message_encoding_size; - let mut json_format_size = 0; - if let Some(ref val) = self.json_format { + size += idempotency_level_size; + let mut uninterpreted_option_size = 0; + for val in &self.uninterpreted_option { let l = ::pb_jelly::Message::compute_size(val); - json_format_size += ::pb_jelly::wire_format::serialized_length(6); - json_format_size += l; + uninterpreted_option_size += ::pb_jelly::wire_format::serialized_length(999); + uninterpreted_option_size += ::pb_jelly::varint::serialized_length(l as u64); + uninterpreted_option_size += l; } - size += json_format_size; + size += uninterpreted_option_size; size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.field_presence { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.enum_type { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.repeated_field_encoding { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } - if let Some(ref val) = self.utf8_validation { - ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::Varint, w)?; + if let Some(ref val) = self.deprecated { + ::pb_jelly::wire_format::write(33, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.message_encoding { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; + if let Some(ref val) = self.idempotency_level { + ::pb_jelly::wire_format::write(34, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.json_format { - ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Varint, w)?; + for val in &self.uninterpreted_option { + ::pb_jelly::wire_format::write(999, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } self._extensions.serialize(w)?; @@ -11228,31 +7838,19 @@ pub mod google { fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 1)?; - self.field_presence = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 2)?; - self.enum_type = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 3)?; - self.repeated_field_encoding = Some(val); - } - 4 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 4)?; - self.utf8_validation = Some(val); + 33 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodOptions", 33)?; + self.deprecated = Some(val); } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 5)?; - self.message_encoding = Some(val); + 34 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodOptions", 34)?; + self.idempotency_level = Some(val); } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 6)?; - self.json_format = Some(val); + 999 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodOptions", 999)?; + self.uninterpreted_option.push(val); } - 1000..=1000 | 1001..=1001 | 9995..=9999 => { + 1000..=536870911 => { self._extensions.gather(field_number, typ, &mut buf)?; } _ => { @@ -11263,7 +7861,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FeatureSet { + impl ::pb_jelly::Reflection for MethodOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -11273,23 +7871,14 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "field_presence" => { - ::pb_jelly::reflection::FieldMut::Value(self.field_presence.get_or_insert_with(::std::default::Default::default)) - } - "enum_type" => { - ::pb_jelly::reflection::FieldMut::Value(self.enum_type.get_or_insert_with(::std::default::Default::default)) - } - "repeated_field_encoding" => { - ::pb_jelly::reflection::FieldMut::Value(self.repeated_field_encoding.get_or_insert_with(::std::default::Default::default)) - } - "utf8_validation" => { - ::pb_jelly::reflection::FieldMut::Value(self.utf8_validation.get_or_insert_with(::std::default::Default::default)) + "deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecated.get_or_insert_with(::std::default::Default::default)) } - "message_encoding" => { - ::pb_jelly::reflection::FieldMut::Value(self.message_encoding.get_or_insert_with(::std::default::Default::default)) + "idempotency_level" => { + ::pb_jelly::reflection::FieldMut::Value(self.idempotency_level.get_or_insert_with(::std::default::Default::default)) } - "json_format" => { - ::pb_jelly::reflection::FieldMut::Value(self.json_format.get_or_insert_with(::std::default::Default::default)) + "uninterpreted_option" => { + unimplemented!("Repeated fields are not currently supported.") } _ => { panic!("unknown field name given") @@ -11297,103 +7886,192 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for FeatureSet { + impl ::pb_jelly::extensions::Extensible for MethodOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } - /// A compiled specification for the defaults of a set of features. These - /// messages are generated from FeatureSet extensions and can be used to seed - /// feature resolution. The resolution with this object becomes a simple search - /// for the closest matching edition, followed by proto merges. + /// A message representing a option the parser does not recognize. This only + /// appears in options protos created by the compiler::Parser class. + /// DescriptorPool resolves these when building Descriptor objects. Therefore, + /// options protos in descriptor objects (e.g. returned by Descriptor::options(), + /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + /// in them. #[derive(Clone, Debug, PartialEq)] - pub struct FeatureSetDefaults { - pub defaults: ::std::vec::Vec, - /// The minimum supported edition (inclusive) when this was constructed. - /// Editions before this will not have defaults. - pub minimum_edition: ::std::option::Option, - /// The maximum known edition (inclusive) when this was constructed. Editions - /// after this will not have reliable defaults. - pub maximum_edition: ::std::option::Option, + pub struct UninterpretedOption { + pub name: ::std::vec::Vec, + /// The value of the uninterpreted option, in whatever type the tokenizer + /// identified it as during parsing. Exactly one of these should be set. + pub identifier_value: ::std::option::Option<::std::string::String>, + pub positive_int_value: ::std::option::Option, + pub negative_int_value: ::std::option::Option, + pub double_value: ::std::option::Option, + pub string_value: ::std::option::Option<::std::vec::Vec>, + pub aggregate_value: ::std::option::Option<::std::string::String>, } - impl FeatureSetDefaults { - pub fn set_defaults(&mut self, v: ::std::vec::Vec) { - self.defaults = v; + impl UninterpretedOption { + pub fn set_name(&mut self, v: ::std::vec::Vec) { + self.name = v; + } + pub fn take_name(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.name) + } + pub fn get_name(&self) -> &[UninterpretedOption_NamePart] { + &self.name + } + pub fn mut_name(&mut self) -> &mut ::std::vec::Vec { + &mut self.name } - pub fn take_defaults(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.defaults) + pub fn has_identifier_value(&self) -> bool { + self.identifier_value.is_some() + } + pub fn set_identifier_value(&mut self, v: ::std::string::String) { + self.identifier_value = Some(v); + } + pub fn take_identifier_value(&mut self) -> ::std::string::String { + self.identifier_value.take().unwrap_or_default() + } + pub fn get_identifier_value(&self) -> &str { + self.identifier_value.as_deref().unwrap_or("") + } + pub fn has_positive_int_value(&self) -> bool { + self.positive_int_value.is_some() + } + pub fn set_positive_int_value(&mut self, v: u64) { + self.positive_int_value = Some(v); + } + pub fn get_positive_int_value(&self) -> u64 { + self.positive_int_value.unwrap_or(0) + } + pub fn has_negative_int_value(&self) -> bool { + self.negative_int_value.is_some() + } + pub fn set_negative_int_value(&mut self, v: i64) { + self.negative_int_value = Some(v); + } + pub fn get_negative_int_value(&self) -> i64 { + self.negative_int_value.unwrap_or(0) + } + pub fn has_double_value(&self) -> bool { + self.double_value.is_some() } - pub fn get_defaults(&self) -> &[FeatureSetDefaults_FeatureSetEditionDefault] { - &self.defaults + pub fn set_double_value(&mut self, v: f64) { + self.double_value = Some(v); + } + pub fn get_double_value(&self) -> f64 { + self.double_value.unwrap_or(0.) + } + pub fn has_string_value(&self) -> bool { + self.string_value.is_some() } - pub fn mut_defaults(&mut self) -> &mut ::std::vec::Vec { - &mut self.defaults + pub fn set_string_value(&mut self, v: ::std::vec::Vec) { + self.string_value = Some(v); } - pub fn has_minimum_edition(&self) -> bool { - self.minimum_edition.is_some() + pub fn take_string_value(&mut self) -> ::std::vec::Vec { + self.string_value.take().unwrap_or_default() } - pub fn set_minimum_edition(&mut self, v: Edition) { - self.minimum_edition = Some(v); + pub fn get_string_value(&self) -> &[u8] { + self.string_value.as_deref().unwrap_or(&[]) } - pub fn get_minimum_edition(&self) -> Edition { - self.minimum_edition.unwrap_or_default() + pub fn has_aggregate_value(&self) -> bool { + self.aggregate_value.is_some() } - pub fn has_maximum_edition(&self) -> bool { - self.maximum_edition.is_some() + pub fn set_aggregate_value(&mut self, v: ::std::string::String) { + self.aggregate_value = Some(v); } - pub fn set_maximum_edition(&mut self, v: Edition) { - self.maximum_edition = Some(v); + pub fn take_aggregate_value(&mut self) -> ::std::string::String { + self.aggregate_value.take().unwrap_or_default() } - pub fn get_maximum_edition(&self) -> Edition { - self.maximum_edition.unwrap_or_default() + pub fn get_aggregate_value(&self) -> &str { + self.aggregate_value.as_deref().unwrap_or("") } } - impl ::std::default::Default for FeatureSetDefaults { + impl ::std::default::Default for UninterpretedOption { fn default() -> Self { - FeatureSetDefaults { - defaults: ::std::default::Default::default(), - minimum_edition: ::std::default::Default::default(), - maximum_edition: ::std::default::Default::default(), + UninterpretedOption { + name: ::std::default::Default::default(), + identifier_value: ::std::default::Default::default(), + positive_int_value: ::std::default::Default::default(), + negative_int_value: ::std::default::Default::default(), + double_value: ::std::default::Default::default(), + string_value: ::std::default::Default::default(), + aggregate_value: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref FeatureSetDefaults_default: FeatureSetDefaults = FeatureSetDefaults::default(); + pub static ref UninterpretedOption_default: UninterpretedOption = UninterpretedOption::default(); } - impl ::pb_jelly::Message for FeatureSetDefaults { + impl ::pb_jelly::Message for UninterpretedOption { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FeatureSetDefaults", - full_name: "google.protobuf.FeatureSetDefaults", + name: "UninterpretedOption", + full_name: "google.protobuf.UninterpretedOption", fields: &[ ::pb_jelly::FieldDescriptor { - name: "defaults", - full_name: "google.protobuf.FeatureSetDefaults.defaults", + name: "name", + full_name: "google.protobuf.UninterpretedOption.name", index: 0, - number: 1, + number: 2, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "minimum_edition", - full_name: "google.protobuf.FeatureSetDefaults.minimum_edition", + name: "identifier_value", + full_name: "google.protobuf.UninterpretedOption.identifier_value", index: 1, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "positive_int_value", + full_name: "google.protobuf.UninterpretedOption.positive_int_value", + index: 2, number: 4, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "maximum_edition", - full_name: "google.protobuf.FeatureSetDefaults.maximum_edition", - index: 2, + name: "negative_int_value", + full_name: "google.protobuf.UninterpretedOption.negative_int_value", + index: 3, number: 5, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, + ::pb_jelly::FieldDescriptor { + name: "double_value", + full_name: "google.protobuf.UninterpretedOption.double_value", + index: 4, + number: 6, + typ: ::pb_jelly::wire_format::Type::Fixed64, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "string_value", + full_name: "google.protobuf.UninterpretedOption.string_value", + index: 5, + number: 7, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "aggregate_value", + full_name: "google.protobuf.UninterpretedOption.aggregate_value", + index: 6, + number: 8, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, ], oneofs: &[ ], @@ -11401,61 +8079,130 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut defaults_size = 0; - for val in &self.defaults { + let mut name_size = 0; + for val in &self.name { + let l = ::pb_jelly::Message::compute_size(val); + name_size += ::pb_jelly::wire_format::serialized_length(2); + name_size += ::pb_jelly::varint::serialized_length(l as u64); + name_size += l; + } + size += name_size; + let mut identifier_value_size = 0; + if let Some(ref val) = self.identifier_value { + let l = ::pb_jelly::Message::compute_size(val); + identifier_value_size += ::pb_jelly::wire_format::serialized_length(3); + identifier_value_size += ::pb_jelly::varint::serialized_length(l as u64); + identifier_value_size += l; + } + size += identifier_value_size; + let mut positive_int_value_size = 0; + if let Some(ref val) = self.positive_int_value { + let l = ::pb_jelly::Message::compute_size(val); + positive_int_value_size += ::pb_jelly::wire_format::serialized_length(4); + positive_int_value_size += l; + } + size += positive_int_value_size; + let mut negative_int_value_size = 0; + if let Some(ref val) = self.negative_int_value { + let l = ::pb_jelly::Message::compute_size(val); + negative_int_value_size += ::pb_jelly::wire_format::serialized_length(5); + negative_int_value_size += l; + } + size += negative_int_value_size; + let mut double_value_size = 0; + if let Some(ref val) = self.double_value { let l = ::pb_jelly::Message::compute_size(val); - defaults_size += ::pb_jelly::wire_format::serialized_length(1); - defaults_size += ::pb_jelly::varint::serialized_length(l as u64); - defaults_size += l; + double_value_size += ::pb_jelly::wire_format::serialized_length(6); + double_value_size += l; } - size += defaults_size; - let mut minimum_edition_size = 0; - if let Some(ref val) = self.minimum_edition { + size += double_value_size; + let mut string_value_size = 0; + if let Some(ref val) = self.string_value { let l = ::pb_jelly::Message::compute_size(val); - minimum_edition_size += ::pb_jelly::wire_format::serialized_length(4); - minimum_edition_size += l; + string_value_size += ::pb_jelly::wire_format::serialized_length(7); + string_value_size += ::pb_jelly::varint::serialized_length(l as u64); + string_value_size += l; } - size += minimum_edition_size; - let mut maximum_edition_size = 0; - if let Some(ref val) = self.maximum_edition { + size += string_value_size; + let mut aggregate_value_size = 0; + if let Some(ref val) = self.aggregate_value { let l = ::pb_jelly::Message::compute_size(val); - maximum_edition_size += ::pb_jelly::wire_format::serialized_length(5); - maximum_edition_size += l; + aggregate_value_size += ::pb_jelly::wire_format::serialized_length(8); + aggregate_value_size += ::pb_jelly::varint::serialized_length(l as u64); + aggregate_value_size += l; } - size += maximum_edition_size; + size += aggregate_value_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.defaults { - ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + for val in &self.name { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.identifier_value { + ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.minimum_edition { + if let Some(ref val) = self.positive_int_value { ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.maximum_edition { + if let Some(ref val) = self.negative_int_value { ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } + if let Some(ref val) = self.double_value { + ::pb_jelly::wire_format::write(6, ::pb_jelly::wire_format::Type::Fixed64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.string_value { + ::pb_jelly::wire_format::write(7, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } + if let Some(ref val) = self.aggregate_value { + ::pb_jelly::wire_format::write(8, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + let l = ::pb_jelly::Message::compute_size(val); + ::pb_jelly::varint::write(l as u64, w)?; + ::pb_jelly::Message::serialize(val, w)?; + } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 1 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FeatureSetDefaults", 1)?; - self.defaults.push(val); + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 2)?; + self.name.push(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 3)?; + self.identifier_value = Some(val); } 4 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults", 4)?; - self.minimum_edition = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption", 4)?; + self.positive_int_value = Some(val); } 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults", 5)?; - self.maximum_edition = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption", 5)?; + self.negative_int_value = Some(val); + } + 6 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Fixed64, "UninterpretedOption", 6)?; + self.double_value = Some(val); + } + 7 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::>(buf, typ, "UninterpretedOption", 7)?; + self.string_value = Some(val); + } + 8 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 8)?; + self.aggregate_value = Some(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -11465,7 +8212,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FeatureSetDefaults { + impl ::pb_jelly::Reflection for UninterpretedOption { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -11475,14 +8222,26 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "defaults" => { + "name" => { unimplemented!("Repeated fields are not currently supported.") } - "minimum_edition" => { - ::pb_jelly::reflection::FieldMut::Value(self.minimum_edition.get_or_insert_with(::std::default::Default::default)) + "identifier_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.identifier_value.get_or_insert_with(::std::default::Default::default)) + } + "positive_int_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.positive_int_value.get_or_insert_with(::std::default::Default::default)) + } + "negative_int_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.negative_int_value.get_or_insert_with(::std::default::Default::default)) + } + "double_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.double_value.get_or_insert_with(::std::default::Default::default)) + } + "string_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.string_value.get_or_insert_with(::std::default::Default::default)) } - "maximum_edition" => { - ::pb_jelly::reflection::FieldMut::Value(self.maximum_edition.get_or_insert_with(::std::default::Default::default)) + "aggregate_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.aggregate_value.get_or_insert_with(::std::default::Default::default)) } _ => { panic!("unknown field name given") @@ -11491,71 +8250,72 @@ pub mod google { } } - /// A map from every known edition with a unique set of defaults to its - /// defaults. Not all editions may be contained here. For a given edition, - /// the defaults at the closest matching edition ordered at or before it should - /// be used. This field must be in strict ascending order by edition. - #[derive(Clone, Debug, PartialEq)] - pub struct FeatureSetDefaults_FeatureSetEditionDefault { - pub edition: ::std::option::Option, - pub features: ::std::option::Option, + /// The name of the uninterpreted option. Each string represents a segment in + /// a dot-separated name. is_extension is true iff a segment represents an + /// extension (denoted with parentheses in options specs in .proto files). + /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + /// "foo.(bar.baz).qux". + #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + pub struct UninterpretedOption_NamePart { + pub name_part: ::std::option::Option<::std::string::String>, + pub is_extension: ::std::option::Option, } - impl FeatureSetDefaults_FeatureSetEditionDefault { - pub fn has_edition(&self) -> bool { - self.edition.is_some() + impl UninterpretedOption_NamePart { + pub fn has_name_part(&self) -> bool { + self.name_part.is_some() } - pub fn set_edition(&mut self, v: Edition) { - self.edition = Some(v); + pub fn set_name_part(&mut self, v: ::std::string::String) { + self.name_part = Some(v); } - pub fn get_edition(&self) -> Edition { - self.edition.unwrap_or_default() + pub fn take_name_part(&mut self) -> ::std::string::String { + self.name_part.take().unwrap_or_default() } - pub fn has_features(&self) -> bool { - self.features.is_some() + pub fn get_name_part(&self) -> &str { + self.name_part.as_deref().unwrap_or("") } - pub fn set_features(&mut self, v: FeatureSet) { - self.features = Some(v); + pub fn has_is_extension(&self) -> bool { + self.is_extension.is_some() } - pub fn take_features(&mut self) -> FeatureSet { - self.features.take().unwrap_or_default() + pub fn set_is_extension(&mut self, v: bool) { + self.is_extension = Some(v); } - pub fn get_features(&self) -> &FeatureSet { - self.features.as_ref().unwrap_or(&FeatureSet_default) + pub fn get_is_extension(&self) -> bool { + self.is_extension.unwrap_or(false) } } - impl ::std::default::Default for FeatureSetDefaults_FeatureSetEditionDefault { + impl ::std::default::Default for UninterpretedOption_NamePart { fn default() -> Self { - FeatureSetDefaults_FeatureSetEditionDefault { - edition: ::std::default::Default::default(), - features: ::std::default::Default::default(), + UninterpretedOption_NamePart { + name_part: ::std::default::Default::default(), + is_extension: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref FeatureSetDefaults_FeatureSetEditionDefault_default: FeatureSetDefaults_FeatureSetEditionDefault = FeatureSetDefaults_FeatureSetEditionDefault::default(); + pub static ref UninterpretedOption_NamePart_default: UninterpretedOption_NamePart = UninterpretedOption_NamePart::default(); } - impl ::pb_jelly::Message for FeatureSetDefaults_FeatureSetEditionDefault { + impl ::pb_jelly::Message for UninterpretedOption_NamePart { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FeatureSetDefaults_FeatureSetEditionDefault", - full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault", + name: "UninterpretedOption_NamePart", + full_name: "google.protobuf.UninterpretedOption_NamePart", fields: &[ ::pb_jelly::FieldDescriptor { - name: "edition", - full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault.edition", + name: "name_part", + full_name: "google.protobuf.UninterpretedOption_NamePart.name_part", index: 0, - number: 3, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Required, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "features", - full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault.features", + name: "is_extension", + full_name: "google.protobuf.UninterpretedOption_NamePart.is_extension", index: 1, number: 2, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Required, oneof_index: None, }, ], @@ -11565,32 +8325,32 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0; - let mut edition_size = 0; - if let Some(ref val) = self.edition { + let mut name_part_size = 0; + if let Some(ref val) = self.name_part { let l = ::pb_jelly::Message::compute_size(val); - edition_size += ::pb_jelly::wire_format::serialized_length(3); - edition_size += l; + name_part_size += ::pb_jelly::wire_format::serialized_length(1); + name_part_size += ::pb_jelly::varint::serialized_length(l as u64); + name_part_size += l; } - size += edition_size; - let mut features_size = 0; - if let Some(ref val) = self.features { + size += name_part_size; + let mut is_extension_size = 0; + if let Some(ref val) = self.is_extension { let l = ::pb_jelly::Message::compute_size(val); - features_size += ::pb_jelly::wire_format::serialized_length(2); - features_size += ::pb_jelly::varint::serialized_length(l as u64); - features_size += l; + is_extension_size += ::pb_jelly::wire_format::serialized_length(2); + is_extension_size += l; } - size += features_size; + size += is_extension_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.features { - ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; + if let Some(ref val) = self.name_part { + ::pb_jelly::wire_format::write(1, ::pb_jelly::wire_format::Type::LengthDelimited, w)?; let l = ::pb_jelly::Message::compute_size(val); ::pb_jelly::varint::write(l as u64, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.edition { - ::pb_jelly::wire_format::write(3, ::pb_jelly::wire_format::Type::Varint, w)?; + if let Some(ref val) = self.is_extension { + ::pb_jelly::wire_format::write(2, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } Ok(()) @@ -11598,13 +8358,13 @@ pub mod google { fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { while let Some((field_number, typ)) = ::pb_jelly::wire_format::read(&mut buf)? { match field_number { - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults_FeatureSetEditionDefault", 3)?; - self.edition = Some(val); + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption_NamePart", 1)?; + self.name_part = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FeatureSetDefaults_FeatureSetEditionDefault", 2)?; - self.features = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "UninterpretedOption_NamePart", 2)?; + self.is_extension = Some(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -11614,7 +8374,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FeatureSetDefaults_FeatureSetEditionDefault { + impl ::pb_jelly::Reflection for UninterpretedOption_NamePart { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -11624,11 +8384,11 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "edition" => { - ::pb_jelly::reflection::FieldMut::Value(self.edition.get_or_insert_with(::std::default::Default::default)) + "name_part" => { + ::pb_jelly::reflection::FieldMut::Value(self.name_part.get_or_insert_with(::std::default::Default::default)) } - "features" => { - ::pb_jelly::reflection::FieldMut::Value(self.features.get_or_insert_with(::std::default::Default::default)) + "is_extension" => { + ::pb_jelly::reflection::FieldMut::Value(self.is_extension.get_or_insert_with(::std::default::Default::default)) } _ => { panic!("unknown field name given") @@ -11795,8 +8555,8 @@ pub mod google { /// location. /// Each element is a field number or an index. They form a path from - /// the root FileDescriptorProto to the place where the definition occurs. - /// For example, this path: + /// the root FileDescriptorProto to the place where the definition. For + /// example, this path: /// [ 4, 3, 2, 7, 1 ] /// refers to: /// file.message_type(3) // 4, 3 @@ -11848,13 +8608,13 @@ pub mod google { /// // Comment attached to baz. /// // Another line attached to baz. - /// // Comment attached to moo. + /// // Comment attached to qux. /// // - /// // Another line attached to moo. - /// optional double moo = 4; + /// // Another line attached to qux. + /// optional double qux = 4; /// // Detached comment for corge. This is not leading or trailing comments - /// // to moo or corge because there are blank lines separating it from + /// // to qux or corge because there are blank lines separating it from /// // both. /// // Detached comment for corge paragraph 2. @@ -12276,10 +9036,9 @@ pub mod google { /// that relates to the identified object. pub begin: ::std::option::Option, /// Identifies the ending offset in bytes in the generated code that - /// relates to the identified object. The end offset should be one past + /// relates to the identified offset. The end offset should be one past /// the last relevant byte (so the length of the text = end - begin). pub end: ::std::option::Option, - pub semantic: ::std::option::Option, } impl GeneratedCodeInfo_Annotation { pub fn set_path(&mut self, v: ::std::vec::Vec) { @@ -12324,15 +9083,6 @@ pub mod google { pub fn get_end(&self) -> i32 { self.end.unwrap_or(0) } - pub fn has_semantic(&self) -> bool { - self.semantic.is_some() - } - pub fn set_semantic(&mut self, v: GeneratedCodeInfo_Annotation_Semantic) { - self.semantic = Some(v); - } - pub fn get_semantic(&self) -> GeneratedCodeInfo_Annotation_Semantic { - self.semantic.unwrap_or_default() - } } impl ::std::default::Default for GeneratedCodeInfo_Annotation { fn default() -> Self { @@ -12341,7 +9091,6 @@ pub mod google { source_file: ::std::default::Default::default(), begin: ::std::default::Default::default(), end: ::std::default::Default::default(), - semantic: ::std::default::Default::default(), } } } @@ -12390,15 +9139,6 @@ pub mod google { label: ::pb_jelly::Label::Optional, oneof_index: None, }, - ::pb_jelly::FieldDescriptor { - name: "semantic", - full_name: "google.protobuf.GeneratedCodeInfo_Annotation.semantic", - index: 4, - number: 5, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, ], oneofs: &[ ], @@ -12438,13 +9178,6 @@ pub mod google { end_size += l; } size += end_size; - let mut semantic_size = 0; - if let Some(ref val) = self.semantic { - let l = ::pb_jelly::Message::compute_size(val); - semantic_size += ::pb_jelly::wire_format::serialized_length(5); - semantic_size += l; - } - size += semantic_size; size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { @@ -12473,10 +9206,6 @@ pub mod google { ::pb_jelly::wire_format::write(4, ::pb_jelly::wire_format::Type::Varint, w)?; ::pb_jelly::Message::serialize(val, w)?; } - if let Some(ref val) = self.semantic { - ::pb_jelly::wire_format::write(5, ::pb_jelly::wire_format::Type::Varint, w)?; - ::pb_jelly::Message::serialize(val, w)?; - } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { @@ -12497,10 +9226,6 @@ pub mod google { let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "GeneratedCodeInfo_Annotation", 4)?; self.end = Some(val); } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "GeneratedCodeInfo_Annotation", 5)?; - self.semantic = Some(val); - } _ => { ::pb_jelly::skip(typ, &mut buf)?; } @@ -12531,9 +9256,6 @@ pub mod google { "end" => { ::pb_jelly::reflection::FieldMut::Value(self.end.get_or_insert_with(::std::default::Default::default)) } - "semantic" => { - ::pb_jelly::reflection::FieldMut::Value(self.semantic.get_or_insert_with(::std::default::Default::default)) - } _ => { panic!("unknown field name given") }