From 1b6a91191969c211dde8600f28d567db11bb2077 Mon Sep 17 00:00:00 2001 From: Geoffry Song Date: Wed, 20 Nov 2024 16:33:33 -0800 Subject: [PATCH] Bump protobuf version to 28.3 --- .github/workflows/main.yml | 2 +- pb-jelly-gen/src/protos.rs | 9438 ++++++++++++++++++++++++------------ 2 files changed, 6425 insertions(+), 3015 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e4d35c..e09182a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: CI env: - PROTOBUF_VER: 3.17.3 + PROTOBUF_VER: 28.3 # Run on git push, PR, or manually from the Actions tab on: [push, pull_request, workflow_dispatch, merge_group] diff --git a/pb-jelly-gen/src/protos.rs b/pb-jelly-gen/src/protos.rs index b212b10..b31b95a 100644 --- a/pb-jelly-gen/src/protos.rs +++ b/pb-jelly-gen/src/protos.rs @@ -33,7 +33,8 @@ 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 KNOWN_VARIANTS: [CodeGeneratorResponse_Feature; 2] = [CodeGeneratorResponse_Feature::FEATURE_NONE, CodeGeneratorResponse_Feature::FEATURE_PROTO3_OPTIONAL]; + 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 fn value(self) -> i32 { self.0 } @@ -66,6 +67,7 @@ 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,9 +86,10 @@ 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; 2] = [CodeGeneratorResponse_Feature_Closed::FEATURE_NONE, CodeGeneratorResponse_Feature_Closed::FEATURE_PROTO3_OPTIONAL]; + 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]; } impl ::std::default::Default for CodeGeneratorResponse_Feature_Closed { fn default() -> Self { @@ -98,6 +101,7 @@ 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, } } } @@ -107,6 +111,7 @@ 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), } } @@ -118,6 +123,7 @@ 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", } } } @@ -333,6 +339,11 @@ 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 @@ -344,6 +355,10 @@ 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, } @@ -384,6 +399,18 @@ 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() } @@ -403,6 +430,7 @@ 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(), } } @@ -443,10 +471,19 @@ 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: 3, + index: 4, number: 3, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, @@ -468,6 +505,9 @@ pub mod google { for val in &self.proto_file { size += ::pb_jelly::helpers::compute_size_field::(val, 15, ::pb_jelly::wire_format::Type::LengthDelimited); } + for val in &self.source_file_descriptors { + size += ::pb_jelly::helpers::compute_size_field::(val, 17, ::pb_jelly::wire_format::Type::LengthDelimited); + } if let Some(ref val) = self.compiler_version { size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); } @@ -486,6 +526,9 @@ pub mod google { for val in &self.proto_file { ::pb_jelly::helpers::serialize_field::(w, val, 15, ::pb_jelly::wire_format::Type::LengthDelimited)?; } + for val in &self.source_file_descriptors { + ::pb_jelly::helpers::serialize_field::(w, val, 17, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { @@ -503,6 +546,10 @@ 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); @@ -534,6 +581,9 @@ 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)) } @@ -559,6 +609,16 @@ pub mod google { /// A bitmask of supported features that the code generator supports. /// This is a bitwise "or" of values from the Feature enum. pub supported_features: ::std::option::Option, + /// The minimum edition this plugin supports. This will be treated as an + /// Edition enum, but we want to allow unknown values. It should be specified + /// according the edition enum value, *not* the edition number. Only takes + /// effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + pub minimum_edition: ::std::option::Option, + /// The maximum edition this plugin supports. This will be treated as an + /// Edition enum, but we want to allow unknown values. It should be specified + /// according the edition enum value, *not* the edition number. Only takes + /// effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + pub maximum_edition: ::std::option::Option, pub file: ::std::vec::Vec, } impl CodeGeneratorResponse { @@ -583,6 +643,24 @@ pub mod google { pub fn get_supported_features(&self) -> u64 { self.supported_features.unwrap_or(0u64) } + pub fn has_minimum_edition(&self) -> bool { + self.minimum_edition.is_some() + } + pub fn set_minimum_edition(&mut self, v: i32) { + self.minimum_edition = Some(v); + } + pub fn get_minimum_edition(&self) -> i32 { + self.minimum_edition.unwrap_or(0i32) + } + pub fn has_maximum_edition(&self) -> bool { + self.maximum_edition.is_some() + } + pub fn set_maximum_edition(&mut self, v: i32) { + self.maximum_edition = Some(v); + } + pub fn get_maximum_edition(&self) -> i32 { + self.maximum_edition.unwrap_or(0i32) + } pub fn set_file(&mut self, v: ::std::vec::Vec) { self.file = v; } @@ -601,6 +679,8 @@ pub mod google { CodeGeneratorResponse { error: ::std::default::Default::default(), supported_features: ::std::default::Default::default(), + minimum_edition: ::std::default::Default::default(), + maximum_edition: ::std::default::Default::default(), file: ::std::default::Default::default(), } } @@ -632,10 +712,28 @@ pub mod google { label: ::pb_jelly::Label::Optional, oneof_index: None, }, + ::pb_jelly::FieldDescriptor { + name: "minimum_edition", + full_name: "google.protobuf.compiler.CodeGeneratorResponse.minimum_edition", + index: 2, + number: 3, + 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.compiler.CodeGeneratorResponse.maximum_edition", + index: 3, + number: 4, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, ::pb_jelly::FieldDescriptor { name: "file", full_name: "google.protobuf.compiler.CodeGeneratorResponse.file", - index: 2, + index: 4, number: 15, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -654,6 +752,12 @@ pub mod google { if let Some(ref val) = self.supported_features { size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } + if let Some(ref val) = self.minimum_edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.maximum_edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); + } for val in &self.file { size += ::pb_jelly::helpers::compute_size_field::(val, 15, ::pb_jelly::wire_format::Type::LengthDelimited); } @@ -666,6 +770,12 @@ pub mod google { if let Some(ref val) = self.supported_features { ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; } + if let Some(ref val) = self.minimum_edition { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.maximum_edition { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; + } for val in &self.file { ::pb_jelly::helpers::serialize_field::(w, val, 15, ::pb_jelly::wire_format::Type::LengthDelimited)?; } @@ -682,6 +792,14 @@ pub mod google { let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "CodeGeneratorResponse", 2)?; self.supported_features = Some(val); } + 3 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "CodeGeneratorResponse", 3)?; + self.minimum_edition = Some(val); + } + 4 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "CodeGeneratorResponse", 4)?; + self.maximum_edition = Some(val); + } 15 => { let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "CodeGeneratorResponse", 15)?; self.file.push(val); @@ -710,6 +828,12 @@ pub mod google { "supported_features" => { ::pb_jelly::reflection::FieldMut::Value(self.supported_features.get_or_insert_with(::std::default::Default::default)) } + "minimum_edition" => { + ::pb_jelly::reflection::FieldMut::Value(self.minimum_edition.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)) + } "file" => { unimplemented!("Repeated fields are not currently supported.") } @@ -978,6 +1102,290 @@ 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); + /// A placeholder edition for specifying default behaviors *before* a feature + /// was first introduced. This is effectively an "infinite past". + pub const EDITION_LEGACY: Edition = Edition(900); + /// 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); + pub const EDITION_2024: Edition = Edition(1001); + /// 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); + /// Placeholder for specifying unbounded edition support. This should only + /// ever be used by plugins that can expect to never require any changes to + /// support a new edition. + pub const EDITION_MAX: Edition = Edition(2147483647); + pub const KNOWN_VARIANTS: [Edition; 12] = [Edition::EDITION_UNKNOWN, Edition::EDITION_LEGACY, Edition::EDITION_PROTO2, Edition::EDITION_PROTO3, Edition::EDITION_2023, Edition::EDITION_2024, 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, Edition::EDITION_MAX]; + 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_LEGACY => ::std::option::Option::Some(Edition_Closed::EDITION_LEGACY), + 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_2024 => ::std::option::Option::Some(Edition_Closed::EDITION_2024), + 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), + Edition::EDITION_MAX => ::std::option::Option::Some(Edition_Closed::EDITION_MAX), + _ => 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, + /// A placeholder edition for specifying default behaviors *before* a feature + /// was first introduced. This is effectively an "infinite past". + EDITION_LEGACY = 900, + /// 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, + EDITION_2024 = 1001, + /// 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, + /// Placeholder for specifying unbounded edition support. This should only + /// ever be used by plugins that can expect to never require any changes to + /// support a new edition. + EDITION_MAX = 2147483647, + } + impl Edition_Closed { + pub const KNOWN_VARIANTS: [Edition_Closed; 12] = [Edition_Closed::EDITION_UNKNOWN, Edition_Closed::EDITION_LEGACY, Edition_Closed::EDITION_PROTO2, Edition_Closed::EDITION_PROTO3, Edition_Closed::EDITION_2023, Edition_Closed::EDITION_2024, 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, Edition_Closed::EDITION_MAX]; + } + 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_LEGACY => 900, + Edition_Closed::EDITION_PROTO2 => 998, + Edition_Closed::EDITION_PROTO3 => 999, + Edition_Closed::EDITION_2023 => 1000, + Edition_Closed::EDITION_2024 => 1001, + 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, + Edition_Closed::EDITION_MAX => 2147483647, + } + } + } + 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), + 900 => Ok(Edition_Closed::EDITION_LEGACY), + 998 => Ok(Edition_Closed::EDITION_PROTO2), + 999 => Ok(Edition_Closed::EDITION_PROTO3), + 1000 => Ok(Edition_Closed::EDITION_2023), + 1001 => Ok(Edition_Closed::EDITION_2024), + 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), + 2147483647 => Ok(Edition_Closed::EDITION_MAX), + _ => 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_LEGACY => "EDITION_LEGACY", + Edition_Closed::EDITION_PROTO2 => "EDITION_PROTO2", + Edition_Closed::EDITION_PROTO3 => "EDITION_PROTO3", + Edition_Closed::EDITION_2023 => "EDITION_2023", + Edition_Closed::EDITION_2024 => "EDITION_2024", + 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", + Edition_Closed::EDITION_MAX => "EDITION_MAX", + } + } + } + + /// 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); @@ -998,9 +1406,10 @@ 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 in proto3. However, Proto3 + /// Group type is deprecated and not supported after google.protobuf. However, Proto3 /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. + /// treat group fields as unknown fields. In Editions, the group wire format + /// can be enabled via the `message_encoding` feature. pub const TYPE_GROUP: FieldDescriptorProto_Type = FieldDescriptorProto_Type(10); /// Length-delimited aggregate. pub const TYPE_MESSAGE: FieldDescriptorProto_Type = FieldDescriptorProto_Type(11); @@ -1094,9 +1503,10 @@ pub mod google { TYPE_BOOL = 8, TYPE_STRING = 9, /// Tag-delimited aggregate. - /// Group type is deprecated and not supported in proto3. However, Proto3 + /// Group type is deprecated and not supported after google.protobuf. However, Proto3 /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. + /// treat group fields as unknown fields. In Editions, the group wire format + /// can be enabled via the `message_encoding` feature. TYPE_GROUP = 10, /// Length-delimited aggregate. TYPE_MESSAGE = 11, @@ -1202,9 +1612,12 @@ pub mod google { impl FieldDescriptorProto_Label { /// 0 is reserved for errors pub const LABEL_OPTIONAL: FieldDescriptorProto_Label = FieldDescriptorProto_Label(1); - pub const LABEL_REQUIRED: FieldDescriptorProto_Label = FieldDescriptorProto_Label(2); 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]; + /// 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 fn value(self) -> i32 { self.0 } @@ -1236,8 +1649,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_REQUIRED => ::std::option::Option::Some(FieldDescriptorProto_Label_Closed::LABEL_REQUIRED), 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), _ => None, } } @@ -1255,11 +1668,14 @@ pub mod google { pub enum FieldDescriptorProto_Label_Closed { /// 0 is reserved for errors LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, 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, } impl FieldDescriptorProto_Label_Closed { - pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label_Closed; 3] = [FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL, FieldDescriptorProto_Label_Closed::LABEL_REQUIRED, FieldDescriptorProto_Label_Closed::LABEL_REPEATED]; + pub const KNOWN_VARIANTS: [FieldDescriptorProto_Label_Closed; 3] = [FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL, FieldDescriptorProto_Label_Closed::LABEL_REPEATED, FieldDescriptorProto_Label_Closed::LABEL_REQUIRED]; } impl ::std::default::Default for FieldDescriptorProto_Label_Closed { fn default() -> Self { @@ -1270,8 +1686,8 @@ pub mod google { fn from(v: FieldDescriptorProto_Label_Closed) -> i32 { match v { FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL => 1, - FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => 2, FieldDescriptorProto_Label_Closed::LABEL_REPEATED => 3, + FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => 2, } } } @@ -1280,8 +1696,8 @@ pub mod google { fn try_from(v: i32) -> ::std::result::Result { match v { 1 => Ok(FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL), - 2 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REQUIRED), 3 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REPEATED), + 2 => Ok(FieldDescriptorProto_Label_Closed::LABEL_REQUIRED), _ => Err(v), } } @@ -1292,8 +1708,8 @@ pub mod google { fn name(self) -> &'static str { match self { FieldDescriptorProto_Label_Closed::LABEL_OPTIONAL => "LABEL_OPTIONAL", - FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => "LABEL_REQUIRED", FieldDescriptorProto_Label_Closed::LABEL_REPEATED => "LABEL_REPEATED", + FieldDescriptorProto_Label_Closed::LABEL_REQUIRED => "LABEL_REQUIRED", } } } @@ -1414,6 +1830,12 @@ 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]; @@ -1467,6 +1889,12 @@ 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, } @@ -1616,57 +2044,55 @@ pub mod google { } } - /// 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. + /// 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 MethodOptions_IdempotencyLevel(i32); - impl MethodOptions_IdempotencyLevel { - pub const IDEMPOTENCY_UNKNOWN: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(0); - /// implies idempotent - pub const NO_SIDE_EFFECTS: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(1); - /// idempotent, but may have side effects - pub const IDEMPOTENT: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(2); - pub const KNOWN_VARIANTS: [MethodOptions_IdempotencyLevel; 3] = [MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN, MethodOptions_IdempotencyLevel::NO_SIDE_EFFECTS, MethodOptions_IdempotencyLevel::IDEMPOTENT]; + 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 MethodOptions_IdempotencyLevel { + impl ::std::default::Default for FieldOptions_OptionRetention { fn default() -> Self { - MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN + FieldOptions_OptionRetention::RETENTION_UNKNOWN } } - impl From for i32 { - fn from(v: MethodOptions_IdempotencyLevel) -> i32 { + impl From for i32 { + fn from(v: FieldOptions_OptionRetention) -> i32 { v.0 } } - impl From for MethodOptions_IdempotencyLevel { - fn from(v: i32) -> MethodOptions_IdempotencyLevel { - MethodOptions_IdempotencyLevel(v) + impl From for FieldOptions_OptionRetention { + fn from(v: i32) -> FieldOptions_OptionRetention { + FieldOptions_OptionRetention(v) } } - impl From for MethodOptions_IdempotencyLevel { - fn from(v: MethodOptions_IdempotencyLevel_Closed) -> MethodOptions_IdempotencyLevel { - MethodOptions_IdempotencyLevel(v as i32) + impl From for FieldOptions_OptionRetention { + fn from(v: FieldOptions_OptionRetention_Closed) -> FieldOptions_OptionRetention { + FieldOptions_OptionRetention(v as i32) } } - impl ::pb_jelly::ProtoEnum for MethodOptions_IdempotencyLevel { + impl ::pb_jelly::ProtoEnum for FieldOptions_OptionRetention { } - impl ::pb_jelly::OpenProtoEnum for MethodOptions_IdempotencyLevel { - type Closed = MethodOptions_IdempotencyLevel_Closed; - fn into_known(self) -> ::std::option::Option { + impl ::pb_jelly::OpenProtoEnum for FieldOptions_OptionRetention { + type Closed = FieldOptions_OptionRetention_Closed; + fn into_known(self) -> ::std::option::Option { match self { - MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN), - MethodOptions_IdempotencyLevel::NO_SIDE_EFFECTS => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS), - MethodOptions_IdempotencyLevel::IDEMPOTENT => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT), + 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 MethodOptions_IdempotencyLevel { + 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), @@ -1674,547 +2100,1092 @@ pub mod google { } } } - /// 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. + /// 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 MethodOptions_IdempotencyLevel_Closed { - IDEMPOTENCY_UNKNOWN = 0, - /// implies idempotent - NO_SIDE_EFFECTS = 1, - /// idempotent, but may have side effects - IDEMPOTENT = 2, + pub enum FieldOptions_OptionRetention_Closed { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, } - impl MethodOptions_IdempotencyLevel_Closed { - pub const KNOWN_VARIANTS: [MethodOptions_IdempotencyLevel_Closed; 3] = [MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN, MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS, MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT]; + 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 MethodOptions_IdempotencyLevel_Closed { + impl ::std::default::Default for FieldOptions_OptionRetention_Closed { fn default() -> Self { - MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN + FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN } } - impl From for i32 { - fn from(v: MethodOptions_IdempotencyLevel_Closed) -> i32 { + impl From for i32 { + fn from(v: FieldOptions_OptionRetention_Closed) -> i32 { match v { - MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN => 0, - MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS => 1, - MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT => 2, + FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN => 0, + FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME => 1, + FieldOptions_OptionRetention_Closed::RETENTION_SOURCE => 2, } } } - impl ::std::convert::TryFrom for MethodOptions_IdempotencyLevel_Closed { + impl ::std::convert::TryFrom for FieldOptions_OptionRetention_Closed { type Error = i32; fn try_from(v: i32) -> ::std::result::Result { match v { - 0 => Ok(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN), - 1 => Ok(MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS), - 2 => Ok(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT), + 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 MethodOptions_IdempotencyLevel_Closed { + impl ::pb_jelly::ProtoEnum for FieldOptions_OptionRetention_Closed { } - impl ::pb_jelly::ClosedProtoEnum for MethodOptions_IdempotencyLevel_Closed { + impl ::pb_jelly::ClosedProtoEnum for FieldOptions_OptionRetention_Closed { fn name(self) -> &'static str { match self { - MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN", - MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS", - MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT => "IDEMPOTENT", + FieldOptions_OptionRetention_Closed::RETENTION_UNKNOWN => "RETENTION_UNKNOWN", + FieldOptions_OptionRetention_Closed::RETENTION_RUNTIME => "RETENTION_RUNTIME", + FieldOptions_OptionRetention_Closed::RETENTION_SOURCE => "RETENTION_SOURCE", } } } - /// 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, + /// 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 FileDescriptorSet { - pub fn set_file(&mut self, v: ::std::vec::Vec) { - self.file = v; + impl ::std::default::Default for FieldOptions_OptionTargetType { + fn default() -> Self { + FieldOptions_OptionTargetType::TARGET_TYPE_UNKNOWN } - pub fn take_file(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.file) + } + impl From for i32 { + fn from(v: FieldOptions_OptionTargetType) -> i32 { + v.0 } - pub fn get_file(&self) -> &[FileDescriptorProto] { - &self.file + } + impl From for FieldOptions_OptionTargetType { + fn from(v: i32) -> FieldOptions_OptionTargetType { + FieldOptions_OptionTargetType(v) } - pub fn mut_file(&mut self) -> &mut ::std::vec::Vec { - &mut self.file + } + impl From for FieldOptions_OptionTargetType { + fn from(v: FieldOptions_OptionTargetType_Closed) -> FieldOptions_OptionTargetType { + FieldOptions_OptionTargetType(v as i32) } } - impl ::std::default::Default for FileDescriptorSet { - fn default() -> Self { - FileDescriptorSet { - file: ::std::default::Default::default(), + 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, } } } - ::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 = 0usize; - for val in &self.file { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + 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), } - size } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.file { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - Ok(()) + } + /// 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 } - 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)?; - } - } + } + 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, } - Ok(()) } } - 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 ::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), } } - 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") - } + } + 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", } } } - /// 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>, + /// 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. + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[repr(transparent)] + pub struct MethodOptions_IdempotencyLevel(i32); + impl MethodOptions_IdempotencyLevel { + pub const IDEMPOTENCY_UNKNOWN: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(0); + /// implies idempotent + pub const NO_SIDE_EFFECTS: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(1); + /// idempotent, but may have side effects + pub const IDEMPOTENT: MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel(2); + pub const KNOWN_VARIANTS: [MethodOptions_IdempotencyLevel; 3] = [MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN, MethodOptions_IdempotencyLevel::NO_SIDE_EFFECTS, MethodOptions_IdempotencyLevel::IDEMPOTENT]; + pub const fn value(self) -> i32 { + self.0 + } } - impl FileDescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() + impl ::std::default::Default for MethodOptions_IdempotencyLevel { + fn default() -> Self { + MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); + } + impl From for i32 { + fn from(v: MethodOptions_IdempotencyLevel) -> i32 { + v.0 } - pub fn take_name(&mut self) -> ::std::string::String { - self.name.take().unwrap_or_default() + } + impl From for MethodOptions_IdempotencyLevel { + fn from(v: i32) -> MethodOptions_IdempotencyLevel { + MethodOptions_IdempotencyLevel(v) } - pub fn get_name(&self) -> &str { - self.name.as_deref().unwrap_or("") + } + impl From for MethodOptions_IdempotencyLevel { + fn from(v: MethodOptions_IdempotencyLevel_Closed) -> MethodOptions_IdempotencyLevel { + MethodOptions_IdempotencyLevel(v as i32) } - pub fn has_package(&self) -> bool { - self.package.is_some() + } + impl ::pb_jelly::ProtoEnum for MethodOptions_IdempotencyLevel { + } + impl ::pb_jelly::OpenProtoEnum for MethodOptions_IdempotencyLevel { + type Closed = MethodOptions_IdempotencyLevel_Closed; + fn into_known(self) -> ::std::option::Option { + match self { + MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN), + MethodOptions_IdempotencyLevel::NO_SIDE_EFFECTS => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS), + MethodOptions_IdempotencyLevel::IDEMPOTENT => ::std::option::Option::Some(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT), + _ => None, + } } - pub fn set_package(&mut self, v: ::std::string::String) { - self.package = Some(v); + } + impl ::std::fmt::Debug for MethodOptions_IdempotencyLevel { + 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_package(&mut self) -> ::std::string::String { - self.package.take().unwrap_or_default() + } + /// 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. + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] + #[repr(i32)] + pub enum MethodOptions_IdempotencyLevel_Closed { + IDEMPOTENCY_UNKNOWN = 0, + /// implies idempotent + NO_SIDE_EFFECTS = 1, + /// idempotent, but may have side effects + IDEMPOTENT = 2, + } + impl MethodOptions_IdempotencyLevel_Closed { + pub const KNOWN_VARIANTS: [MethodOptions_IdempotencyLevel_Closed; 3] = [MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN, MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS, MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT]; + } + impl ::std::default::Default for MethodOptions_IdempotencyLevel_Closed { + fn default() -> Self { + MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN } - pub fn get_package(&self) -> &str { - self.package.as_deref().unwrap_or("") + } + impl From for i32 { + fn from(v: MethodOptions_IdempotencyLevel_Closed) -> i32 { + match v { + MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN => 0, + MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS => 1, + MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT => 2, + } } - pub fn set_dependency(&mut self, v: ::std::vec::Vec<::std::string::String>) { - self.dependency = v; + } + impl ::std::convert::TryFrom for MethodOptions_IdempotencyLevel_Closed { + type Error = i32; + fn try_from(v: i32) -> ::std::result::Result { + match v { + 0 => Ok(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN), + 1 => Ok(MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS), + 2 => Ok(MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT), + _ => Err(v), + } } - pub fn take_dependency(&mut self) -> ::std::vec::Vec<::std::string::String> { - ::std::mem::take(&mut self.dependency) + } + impl ::pb_jelly::ProtoEnum for MethodOptions_IdempotencyLevel_Closed { + } + impl ::pb_jelly::ClosedProtoEnum for MethodOptions_IdempotencyLevel_Closed { + fn name(self) -> &'static str { + match self { + MethodOptions_IdempotencyLevel_Closed::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN", + MethodOptions_IdempotencyLevel_Closed::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS", + MethodOptions_IdempotencyLevel_Closed::IDEMPOTENT => "IDEMPOTENT", + } } - pub fn get_dependency(&self) -> &[::std::string::String] { - &self.dependency + } + + #[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 } - pub fn mut_dependency(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { - &mut self.dependency + } + impl ::std::default::Default for FeatureSet_FieldPresence { + fn default() -> Self { + FeatureSet_FieldPresence::FIELD_PRESENCE_UNKNOWN } - pub fn set_public_dependency(&mut self, v: ::std::vec::Vec) { - self.public_dependency = v; + } + impl From for i32 { + fn from(v: FeatureSet_FieldPresence) -> i32 { + v.0 } - pub fn take_public_dependency(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.public_dependency) + } + impl From for FeatureSet_FieldPresence { + fn from(v: i32) -> FeatureSet_FieldPresence { + FeatureSet_FieldPresence(v) } - pub fn get_public_dependency(&self) -> &[i32] { - &self.public_dependency + } + impl From for FeatureSet_FieldPresence { + fn from(v: FeatureSet_FieldPresence_Closed) -> FeatureSet_FieldPresence { + FeatureSet_FieldPresence(v as i32) } - pub fn mut_public_dependency(&mut self) -> &mut ::std::vec::Vec { - &mut self.public_dependency + } + 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, + } } - pub fn set_weak_dependency(&mut self, v: ::std::vec::Vec) { - self.weak_dependency = v; + } + 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), + } } - pub fn take_weak_dependency(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.weak_dependency) + } + #[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 } - pub fn get_weak_dependency(&self) -> &[i32] { - &self.weak_dependency + } + 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, + } } - pub fn mut_weak_dependency(&mut self) -> &mut ::std::vec::Vec { - &mut self.weak_dependency + } + 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), + } } - pub fn set_message_type(&mut self, v: ::std::vec::Vec) { - self.message_type = v; + } + 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", + } } - pub fn take_message_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.message_type) + } + + #[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 } - pub fn get_message_type(&self) -> &[DescriptorProto] { - &self.message_type + } + impl ::std::default::Default for FeatureSet_EnumType { + fn default() -> Self { + FeatureSet_EnumType::ENUM_TYPE_UNKNOWN } - pub fn mut_message_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.message_type + } + impl From for i32 { + fn from(v: FeatureSet_EnumType) -> i32 { + v.0 } - pub fn set_enum_type(&mut self, v: ::std::vec::Vec) { - self.enum_type = v; + } + impl From for FeatureSet_EnumType { + fn from(v: i32) -> FeatureSet_EnumType { + FeatureSet_EnumType(v) } - pub fn take_enum_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.enum_type) + } + impl From for FeatureSet_EnumType { + fn from(v: FeatureSet_EnumType_Closed) -> FeatureSet_EnumType { + FeatureSet_EnumType(v as i32) } - pub fn get_enum_type(&self) -> &[EnumDescriptorProto] { - &self.enum_type + } + 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 mut_enum_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.enum_type + } + 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_service(&mut self, v: ::std::vec::Vec) { - self.service = 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_service(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.service) + } + 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_service(&self) -> &[ServiceDescriptorProto] { - &self.service + } + 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 mut_service(&mut self) -> &mut ::std::vec::Vec { - &mut self.service + } + 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 set_extension(&mut self, v: ::std::vec::Vec) { - self.extension = v; + } + + #[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 take_extension(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension) + } + impl ::std::default::Default for FeatureSet_RepeatedFieldEncoding { + fn default() -> Self { + FeatureSet_RepeatedFieldEncoding::REPEATED_FIELD_ENCODING_UNKNOWN } - pub fn get_extension(&self) -> &[FieldDescriptorProto] { - &self.extension + } + impl From for i32 { + fn from(v: FeatureSet_RepeatedFieldEncoding) -> i32 { + v.0 } - pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension + } + impl From for FeatureSet_RepeatedFieldEncoding { + fn from(v: i32) -> FeatureSet_RepeatedFieldEncoding { + FeatureSet_RepeatedFieldEncoding(v) } - pub fn has_options(&self) -> bool { - self.options.is_some() + } + impl From for FeatureSet_RepeatedFieldEncoding { + fn from(v: FeatureSet_RepeatedFieldEncoding_Closed) -> FeatureSet_RepeatedFieldEncoding { + FeatureSet_RepeatedFieldEncoding(v as i32) } - pub fn set_options(&mut self, v: FileOptions) { - self.options = Some(v); + } + 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 take_options(&mut self) -> FileOptions { - self.options.take().unwrap_or_default() + } + 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 get_options(&self) -> &FileOptions { - self.options.as_ref().unwrap_or(&FileOptions_default) + } + #[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 has_source_code_info(&self) -> bool { - self.source_code_info.is_some() + } + 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 set_source_code_info(&mut self, v: SourceCodeInfo) { - self.source_code_info = Some(v); + } + 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 take_source_code_info(&mut self) -> SourceCodeInfo { - self.source_code_info.take().unwrap_or_default() + } + 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", + } } - pub fn get_source_code_info(&self) -> &SourceCodeInfo { - self.source_code_info.as_ref().unwrap_or(&SourceCodeInfo_default) + } + + #[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 VERIFY: FeatureSet_Utf8Validation = FeatureSet_Utf8Validation(2); + pub const NONE: FeatureSet_Utf8Validation = FeatureSet_Utf8Validation(3); + pub const KNOWN_VARIANTS: [FeatureSet_Utf8Validation; 3] = [FeatureSet_Utf8Validation::UTF8_VALIDATION_UNKNOWN, FeatureSet_Utf8Validation::VERIFY, FeatureSet_Utf8Validation::NONE]; + pub const fn value(self) -> i32 { + self.0 } - pub fn has_syntax(&self) -> bool { - self.syntax.is_some() + } + impl ::std::default::Default for FeatureSet_Utf8Validation { + fn default() -> Self { + FeatureSet_Utf8Validation::UTF8_VALIDATION_UNKNOWN } - pub fn set_syntax(&mut self, v: ::std::string::String) { - self.syntax = Some(v); + } + impl From for i32 { + fn from(v: FeatureSet_Utf8Validation) -> i32 { + v.0 } - pub fn take_syntax(&mut self) -> ::std::string::String { - self.syntax.take().unwrap_or_default() + } + impl From for FeatureSet_Utf8Validation { + fn from(v: i32) -> FeatureSet_Utf8Validation { + FeatureSet_Utf8Validation(v) } - pub fn get_syntax(&self) -> &str { - self.syntax.as_deref().unwrap_or("") + } + impl From for FeatureSet_Utf8Validation { + fn from(v: FeatureSet_Utf8Validation_Closed) -> FeatureSet_Utf8Validation { + FeatureSet_Utf8Validation(v as i32) } } - impl ::std::default::Default for FileDescriptorProto { + 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::VERIFY => ::std::option::Option::Some(FeatureSet_Utf8Validation_Closed::VERIFY), + FeatureSet_Utf8Validation::NONE => ::std::option::Option::Some(FeatureSet_Utf8Validation_Closed::NONE), + _ => 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, + VERIFY = 2, + NONE = 3, + } + impl FeatureSet_Utf8Validation_Closed { + pub const KNOWN_VARIANTS: [FeatureSet_Utf8Validation_Closed; 3] = [FeatureSet_Utf8Validation_Closed::UTF8_VALIDATION_UNKNOWN, FeatureSet_Utf8Validation_Closed::VERIFY, FeatureSet_Utf8Validation_Closed::NONE]; + } + impl ::std::default::Default for FeatureSet_Utf8Validation_Closed { fn default() -> Self { - 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(), + 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::VERIFY => 2, + FeatureSet_Utf8Validation_Closed::NONE => 3, } } } - ::lazy_static::lazy_static! { - pub static ref FileDescriptorProto_default: FileDescriptorProto = FileDescriptorProto::default(); + 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), + 2 => Ok(FeatureSet_Utf8Validation_Closed::VERIFY), + 3 => Ok(FeatureSet_Utf8Validation_Closed::NONE), + _ => Err(v), + } + } } - impl ::pb_jelly::Message for FileDescriptorProto { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "FileDescriptorProto", - full_name: "google.protobuf.FileDescriptorProto", - fields: &[ - ::pb_jelly::FieldDescriptor { - 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: &[ - ], - }) - } - fn compute_size(&self) -> usize { - let mut size = 0usize; - if let Some(ref val) = self.name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.package { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + 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::VERIFY => "VERIFY", + FeatureSet_Utf8Validation_Closed::NONE => "NONE", } - for val in &self.dependency { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + + #[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 + } + } + impl From for i32 { + fn from(v: FeatureSet_MessageEncoding) -> i32 { + v.0 + } + } + impl From for FeatureSet_MessageEncoding { + fn from(v: i32) -> FeatureSet_MessageEncoding { + FeatureSet_MessageEncoding(v) + } + } + impl From for FeatureSet_MessageEncoding { + fn from(v: FeatureSet_MessageEncoding_Closed) -> FeatureSet_MessageEncoding { + FeatureSet_MessageEncoding(v as i32) + } + } + 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, } - for val in &self.public_dependency { - size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); + } + } + 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), } - for val in &self.weak_dependency { - size += ::pb_jelly::helpers::compute_size_field::(val, 11, ::pb_jelly::wire_format::Type::Varint); + } + } + #[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 + } + } + 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, } - for val in &self.message_type { - size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + 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), } - for val in &self.enum_type { - size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + 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", } - for val in &self.service { - size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + + #[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 + } + } + impl ::std::default::Default for FeatureSet_JsonFormat { + fn default() -> Self { + FeatureSet_JsonFormat::JSON_FORMAT_UNKNOWN + } + } + impl From for i32 { + fn from(v: FeatureSet_JsonFormat) -> i32 { + v.0 + } + } + impl From for FeatureSet_JsonFormat { + fn from(v: i32) -> FeatureSet_JsonFormat { + FeatureSet_JsonFormat(v) + } + } + impl From for FeatureSet_JsonFormat { + fn from(v: FeatureSet_JsonFormat_Closed) -> FeatureSet_JsonFormat { + FeatureSet_JsonFormat(v as i32) + } + } + 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, } - for val in &self.extension { - size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + 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), } - if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + #[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 + } + } + 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, } - if let Some(ref val) = self.source_code_info { - size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + 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), } - if let Some(ref val) = self.syntax { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 12, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + 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", } - size } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + + /// 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 + } + } + impl ::std::default::Default for GeneratedCodeInfo_Annotation_Semantic { + fn default() -> Self { + GeneratedCodeInfo_Annotation_Semantic::NONE + } + } + impl From for i32 { + fn from(v: GeneratedCodeInfo_Annotation_Semantic) -> i32 { + v.0 + } + } + impl From for GeneratedCodeInfo_Annotation_Semantic { + fn from(v: i32) -> GeneratedCodeInfo_Annotation_Semantic { + GeneratedCodeInfo_Annotation_Semantic(v) + } + } + impl From for GeneratedCodeInfo_Annotation_Semantic { + fn from(v: GeneratedCodeInfo_Annotation_Semantic_Closed) -> GeneratedCodeInfo_Annotation_Semantic { + GeneratedCodeInfo_Annotation_Semantic(v as i32) + } + } + 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, } - if let Some(ref val) = self.package { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + } + 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), } - for val in &self.dependency { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + } + /// 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 { + 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, } - for val in &self.message_type { - ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.enum_type { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.service { - ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.extension { - ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + } + 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), } - if let Some(ref val) = self.source_code_info { - ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + } + impl ::pb_jelly::ProtoEnum for GeneratedCodeInfo_Annotation_Semantic_Closed { + } + 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", } - for val in &self.public_dependency { - ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; + } + } + + /// 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(), } - for val in &self.weak_dependency { - ::pb_jelly::helpers::serialize_field::(w, val, 11, ::pb_jelly::wire_format::Type::Varint)?; + } + } + ::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 = 0usize; + for val in &self.file { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - if let Some(ref val) = self.syntax { - ::pb_jelly::helpers::serialize_field::(w, val, 12, ::pb_jelly::wire_format::Type::LengthDelimited)?; + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + for val in &self.file { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } Ok(()) } @@ -2222,50 +3193,8 @@ 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, "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); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorSet", 1)?; + self.file.push(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -2275,7 +3204,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FileDescriptorProto { + impl ::pb_jelly::Reflection for FileDescriptorSet { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -2285,42 +3214,9 @@ 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)) - } - "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" => { + "file" => { 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") } @@ -2328,23 +3224,40 @@ pub mod google { } } - /// Describes a message type. + /// Describes a complete .proto file. #[derive(Clone, Debug, PartialEq)] - pub struct DescriptorProto { + pub struct FileDescriptorProto { + /// file name, relative to root of source tree pub name: ::std::option::Option<::std::string::String>, - pub field: ::std::vec::Vec, - pub extension: ::std::vec::Vec, - pub nested_type: ::std::vec::Vec, + /// 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 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 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", "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, } - impl DescriptorProto { + impl FileDescriptorProto { pub fn has_name(&self) -> bool { self.name.is_some() } @@ -2357,41 +3270,65 @@ pub mod google { pub fn get_name(&self) -> &str { self.name.as_deref().unwrap_or("") } - pub fn set_field(&mut self, v: ::std::vec::Vec) { - self.field = v; + pub fn has_package(&self) -> bool { + self.package.is_some() } - pub fn take_field(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.field) + pub fn set_package(&mut self, v: ::std::string::String) { + self.package = Some(v); } - pub fn get_field(&self) -> &[FieldDescriptorProto] { - &self.field + pub fn take_package(&mut self) -> ::std::string::String { + self.package.take().unwrap_or_default() } - pub fn mut_field(&mut self) -> &mut ::std::vec::Vec { - &mut self.field + pub fn get_package(&self) -> &str { + self.package.as_deref().unwrap_or("") } - pub fn set_extension(&mut self, v: ::std::vec::Vec) { - self.extension = v; + pub fn set_dependency(&mut self, v: ::std::vec::Vec<::std::string::String>) { + self.dependency = v; } - pub fn take_extension(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension) + pub fn take_dependency(&mut self) -> ::std::vec::Vec<::std::string::String> { + ::std::mem::take(&mut self.dependency) } - pub fn get_extension(&self) -> &[FieldDescriptorProto] { - &self.extension + pub fn get_dependency(&self) -> &[::std::string::String] { + &self.dependency } - pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension + pub fn mut_dependency(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { + &mut self.dependency } - pub fn set_nested_type(&mut self, v: ::std::vec::Vec) { - self.nested_type = v; + pub fn set_public_dependency(&mut self, v: ::std::vec::Vec) { + self.public_dependency = v; } - pub fn take_nested_type(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.nested_type) + pub fn take_public_dependency(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.public_dependency) } - pub fn get_nested_type(&self) -> &[DescriptorProto] { - &self.nested_type + pub fn get_public_dependency(&self) -> &[i32] { + &self.public_dependency } - pub fn mut_nested_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.nested_type + pub fn mut_public_dependency(&mut self) -> &mut ::std::vec::Vec { + &mut self.public_dependency + } + pub fn set_weak_dependency(&mut self, v: ::std::vec::Vec) { + self.weak_dependency = v; + } + pub fn take_weak_dependency(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.weak_dependency) + } + 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; @@ -2405,95 +3342,107 @@ pub mod google { 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 set_service(&mut self, v: ::std::vec::Vec) { + self.service = v; } - pub fn take_extension_range(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.extension_range) + pub fn take_service(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.service) } - pub fn get_extension_range(&self) -> &[DescriptorProto_ExtensionRange] { - &self.extension_range + pub fn get_service(&self) -> &[ServiceDescriptorProto] { + &self.service } - pub fn mut_extension_range(&mut self) -> &mut ::std::vec::Vec { - &mut self.extension_range + pub fn mut_service(&mut self) -> &mut ::std::vec::Vec { + &mut self.service } - pub fn set_oneof_decl(&mut self, v: ::std::vec::Vec) { - self.oneof_decl = v; + pub fn set_extension(&mut self, v: ::std::vec::Vec) { + self.extension = v; } - pub fn take_oneof_decl(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.oneof_decl) + pub fn take_extension(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.extension) } - pub fn get_oneof_decl(&self) -> &[OneofDescriptorProto] { - &self.oneof_decl + pub fn get_extension(&self) -> &[FieldDescriptorProto] { + &self.extension } - pub fn mut_oneof_decl(&mut self) -> &mut ::std::vec::Vec { - &mut self.oneof_decl + pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { + &mut self.extension } pub fn has_options(&self) -> bool { self.options.is_some() } - pub fn set_options(&mut self, v: MessageOptions) { + pub fn set_options(&mut self, v: FileOptions) { self.options = Some(v); } - pub fn take_options(&mut self) -> MessageOptions { + pub fn take_options(&mut self) -> FileOptions { self.options.take().unwrap_or_default() } - pub fn get_options(&self) -> &MessageOptions { - self.options.as_ref().unwrap_or(&MessageOptions_default) + pub fn get_options(&self) -> &FileOptions { + self.options.as_ref().unwrap_or(&FileOptions_default) } - pub fn set_reserved_range(&mut self, v: ::std::vec::Vec) { - self.reserved_range = v; + pub fn has_source_code_info(&self) -> bool { + self.source_code_info.is_some() } - pub fn take_reserved_range(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.reserved_range) + pub fn set_source_code_info(&mut self, v: SourceCodeInfo) { + self.source_code_info = Some(v); } - pub fn get_reserved_range(&self) -> &[DescriptorProto_ReservedRange] { - &self.reserved_range + pub fn take_source_code_info(&mut self) -> SourceCodeInfo { + self.source_code_info.take().unwrap_or_default() } - pub fn mut_reserved_range(&mut self) -> &mut ::std::vec::Vec { - &mut self.reserved_range + pub fn get_source_code_info(&self) -> &SourceCodeInfo { + self.source_code_info.as_ref().unwrap_or(&SourceCodeInfo_default) } - pub fn set_reserved_name(&mut self, v: ::std::vec::Vec<::std::string::String>) { - self.reserved_name = v; + pub fn has_syntax(&self) -> bool { + self.syntax.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_syntax(&mut self, v: ::std::string::String) { + self.syntax = Some(v); } - pub fn get_reserved_name(&self) -> &[::std::string::String] { - &self.reserved_name + pub fn take_syntax(&mut self) -> ::std::string::String { + self.syntax.take().unwrap_or_default() } - pub fn mut_reserved_name(&mut self) -> &mut ::std::vec::Vec<::std::string::String> { - &mut self.reserved_name + pub fn get_syntax(&self) -> &str { + self.syntax.as_deref().unwrap_or("") + } + 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() } } - impl ::std::default::Default for DescriptorProto { + impl ::std::default::Default for FileDescriptorProto { fn default() -> Self { - DescriptorProto { + FileDescriptorProto { name: ::std::default::Default::default(), - field: ::std::default::Default::default(), - extension: ::std::default::Default::default(), - nested_type: ::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(), - extension_range: ::std::default::Default::default(), - oneof_decl: ::std::default::Default::default(), + service: ::std::default::Default::default(), + extension: ::std::default::Default::default(), options: ::std::default::Default::default(), - reserved_range: ::std::default::Default::default(), - reserved_name: ::std::default::Default::default(), + source_code_info: ::std::default::Default::default(), + syntax: ::std::default::Default::default(), + edition: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref DescriptorProto_default: DescriptorProto = DescriptorProto::default(); + pub static ref FileDescriptorProto_default: FileDescriptorProto = FileDescriptorProto::default(); } - impl ::pb_jelly::Message for DescriptorProto { + impl ::pb_jelly::Message for FileDescriptorProto { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "DescriptorProto", - full_name: "google.protobuf.DescriptorProto", + name: "FileDescriptorProto", + full_name: "google.protobuf.FileDescriptorProto", fields: &[ ::pb_jelly::FieldDescriptor { name: "name", - full_name: "google.protobuf.DescriptorProto.name", + full_name: "google.protobuf.FileDescriptorProto.name", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::LengthDelimited, @@ -2501,84 +3450,111 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "field", - full_name: "google.protobuf.DescriptorProto.field", + name: "package", + full_name: "google.protobuf.FileDescriptorProto.package", index: 1, number: 2, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "extension", - full_name: "google.protobuf.DescriptorProto.extension", + name: "dependency", + full_name: "google.protobuf.FileDescriptorProto.dependency", index: 2, - number: 6, + number: 3, 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", + name: "public_dependency", + full_name: "google.protobuf.FileDescriptorProto.public_dependency", index: 3, - number: 3, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 10, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "enum_type", - full_name: "google.protobuf.DescriptorProto.enum_type", + name: "weak_dependency", + full_name: "google.protobuf.FileDescriptorProto.weak_dependency", index: 4, - number: 4, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 11, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "extension_range", - full_name: "google.protobuf.DescriptorProto.extension_range", + name: "message_type", + full_name: "google.protobuf.FileDescriptorProto.message_type", index: 5, - number: 5, + number: 4, 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", + name: "enum_type", + full_name: "google.protobuf.FileDescriptorProto.enum_type", index: 6, - number: 8, + number: 5, 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", + name: "service", + full_name: "google.protobuf.FileDescriptorProto.service", index: 7, - number: 7, + number: 6, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "reserved_range", - full_name: "google.protobuf.DescriptorProto.reserved_range", + name: "extension", + full_name: "google.protobuf.FileDescriptorProto.extension", index: 8, - number: 9, + number: 7, 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", + name: "options", + full_name: "google.protobuf.FileDescriptorProto.options", index: 9, - number: 10, + number: 8, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + 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, + }, + ::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, oneof_index: None, }, ], @@ -2591,32 +3567,41 @@ pub mod google { if let Some(ref val) = self.name { size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.field { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.package { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.extension { - size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::LengthDelimited); + for val in &self.dependency { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.nested_type { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + for val in &self.public_dependency { + size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); + } + for val in &self.weak_dependency { + size += ::pb_jelly::helpers::compute_size_field::(val, 11, ::pb_jelly::wire_format::Type::Varint); + } + for val in &self.message_type { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); } for val in &self.enum_type { - size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.extension_range { - size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); + for val in &self.service { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.oneof_decl { - size += ::pb_jelly::helpers::compute_size_field::(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); + for val in &self.extension { + size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); } if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); + size += ::pb_jelly::helpers::compute_size_field::(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.reserved_range { - size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.source_code_info { + size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.reserved_name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 10, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.syntax { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 12, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 14, ::pb_jelly::wire_format::Type::Varint); } size } @@ -2624,32 +3609,41 @@ pub mod google { if let Some(ref val) = self.name { ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.field { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.package { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.nested_type { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + for val in &self.dependency { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.message_type { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.enum_type { - ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.extension_range { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; + for val in &self.service { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.extension { - ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::LengthDelimited)?; + ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; } if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; + ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.oneof_decl { - ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.source_code_info { + ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.reserved_range { - ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::LengthDelimited)?; + for val in &self.public_dependency { + ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; } - for val in &self.reserved_name { - ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::LengthDelimited)?; + for val in &self.weak_dependency { + ::pb_jelly::helpers::serialize_field::(w, val, 11, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.syntax { + ::pb_jelly::helpers::serialize_field::(w, val, 12, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.edition { + ::pb_jelly::helpers::serialize_field::(w, val, 14, ::pb_jelly::wire_format::Type::Varint)?; } Ok(()) } @@ -2657,44 +3651,54 @@ 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)?; + 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, "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_length_delimited::(buf, typ, "FileDescriptorProto", 2)?; + self.package = Some(val); } 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 3)?; - self.nested_type.push(val); + 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, "DescriptorProto", 4)?; - self.enum_type.push(val); + 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, "DescriptorProto", 5)?; - self.extension_range.push(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 5)?; + self.enum_type.push(val); } - 8 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 8)?; - self.oneof_decl.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, "DescriptorProto", 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, "DescriptorProto", 9)?; - self.reserved_range.push(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 9)?; + self.source_code_info = Some(val); } - 10 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 10)?; - self.reserved_name.push(val); + 12 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileDescriptorProto", 12)?; + self.syntax = Some(val); + } + 14 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FileDescriptorProto", 14)?; + self.edition = Some(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -2704,7 +3708,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for DescriptorProto { + impl ::pb_jelly::Reflection for FileDescriptorProto { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -2717,32 +3721,41 @@ pub mod google { "name" => { ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) } - "field" => { + "package" => { + ::pb_jelly::reflection::FieldMut::Value(self.package.get_or_insert_with(::std::default::Default::default)) + } + "dependency" => { unimplemented!("Repeated fields are not currently supported.") } - "extension" => { + "public_dependency" => { unimplemented!("Repeated fields are not currently supported.") } - "nested_type" => { + "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.") } - "extension_range" => { + "service" => { unimplemented!("Repeated fields are not currently supported.") } - "oneof_decl" => { + "extension" => { unimplemented!("Repeated fields are not currently supported.") } "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.") + "source_code_info" => { + ::pb_jelly::reflection::FieldMut::Value(self.source_code_info.get_or_insert_with(::std::default::Default::default)) } - "reserved_name" => { - unimplemented!("Repeated fields are not currently supported.") + "syntax" => { + ::pb_jelly::reflection::FieldMut::Value(self.syntax.get_or_insert_with(::std::default::Default::default)) + } + "edition" => { + ::pb_jelly::reflection::FieldMut::Value(self.edition.get_or_insert_with(::std::default::Default::default)) } _ => { panic!("unknown field name given") @@ -2751,91 +3764,259 @@ pub mod google { } } + /// Describes a message type. #[derive(Clone, Debug, PartialEq)] - pub struct DescriptorProto_ExtensionRange { - /// Inclusive. - pub start: ::std::option::Option, - /// Exclusive. - pub end: ::std::option::Option, - pub options: ::std::option::Option, + 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>, } - impl DescriptorProto_ExtensionRange { - pub fn has_start(&self) -> bool { - self.start.is_some() + impl DescriptorProto { + pub fn has_name(&self) -> bool { + self.name.is_some() } - pub fn set_start(&mut self, v: i32) { - self.start = Some(v); + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = Some(v); } - pub fn get_start(&self) -> i32 { - self.start.unwrap_or(0i32) + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_default() } - pub fn has_end(&self) -> bool { - self.end.is_some() + pub fn get_name(&self) -> &str { + self.name.as_deref().unwrap_or("") } - pub fn set_end(&mut self, v: i32) { - self.end = Some(v); + pub fn set_field(&mut self, v: ::std::vec::Vec) { + self.field = v; } - pub fn get_end(&self) -> i32 { - self.end.unwrap_or(0i32) + pub fn take_field(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.field) + } + pub fn get_field(&self) -> &[FieldDescriptorProto] { + &self.field + } + pub fn mut_field(&mut self) -> &mut ::std::vec::Vec { + &mut self.field + } + pub fn set_extension(&mut self, v: ::std::vec::Vec) { + self.extension = v; + } + pub fn take_extension(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.extension) + } + pub fn get_extension(&self) -> &[FieldDescriptorProto] { + &self.extension + } + pub fn mut_extension(&mut self) -> &mut ::std::vec::Vec { + &mut self.extension + } + pub fn set_nested_type(&mut self, v: ::std::vec::Vec) { + self.nested_type = v; + } + 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: ExtensionRangeOptions) { + pub fn set_options(&mut self, v: MessageOptions) { self.options = Some(v); } - pub fn take_options(&mut self) -> ExtensionRangeOptions { + pub fn take_options(&mut self) -> MessageOptions { self.options.take().unwrap_or_default() } - pub fn get_options(&self) -> &ExtensionRangeOptions { - self.options.as_ref().unwrap_or(&ExtensionRangeOptions_default) + pub fn get_options(&self) -> &MessageOptions { + self.options.as_ref().unwrap_or(&MessageOptions_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(), - } + pub fn set_reserved_range(&mut self, v: ::std::vec::Vec) { + self.reserved_range = v; } - } - ::lazy_static::lazy_static! { - pub static ref DescriptorProto_ExtensionRange_default: DescriptorProto_ExtensionRange = DescriptorProto_ExtensionRange::default(); - } - impl ::pb_jelly::Message for DescriptorProto_ExtensionRange { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + 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(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref DescriptorProto_default: DescriptorProto = DescriptorProto::default(); + } + impl ::pb_jelly::Message for DescriptorProto { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "DescriptorProto_ExtensionRange", - full_name: "google.protobuf.DescriptorProto_ExtensionRange", + name: "DescriptorProto", + full_name: "google.protobuf.DescriptorProto", fields: &[ ::pb_jelly::FieldDescriptor { - name: "start", - full_name: "google.protobuf.DescriptorProto_ExtensionRange.start", + name: "name", + full_name: "google.protobuf.DescriptorProto.name", index: 0, number: 1, - typ: ::pb_jelly::wire_format::Type::Varint, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "end", - full_name: "google.protobuf.DescriptorProto_ExtensionRange.end", + name: "field", + full_name: "google.protobuf.DescriptorProto.field", index: 1, number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + 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_ExtensionRange.options", + name: "extension", + full_name: "google.protobuf.DescriptorProto.extension", 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: &[ ], @@ -2843,26 +4024,68 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.start { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - if let Some(ref val) = self.end { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + for val in &self.field { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.extension { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.nested_type { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.enum_type { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.extension_range { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.oneof_decl { + size += ::pb_jelly::helpers::compute_size_field::(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); } if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.reserved_range { + size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.reserved_name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 10, ::pb_jelly::wire_format::Type::LengthDelimited); } size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.start { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.end { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + for val in &self.field { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.nested_type { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.enum_type { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.extension_range { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.extension { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::LengthDelimited)?; } if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.oneof_decl { + ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.reserved_range { + ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.reserved_name { + ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::LengthDelimited)?; } Ok(()) } @@ -2870,17 +4093,45 @@ 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, "DescriptorProto_ExtensionRange", 1)?; - self.start = Some(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto", 1)?; + self.name = Some(val); } 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "DescriptorProto_ExtensionRange", 2)?; - self.end = Some(val); + 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); } 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "DescriptorProto_ExtensionRange", 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)?; 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)?; } @@ -2889,7 +4140,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for DescriptorProto_ExtensionRange { + impl ::pb_jelly::Reflection for DescriptorProto { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -2899,18 +4150,203 @@ pub mod google { } 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)) + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) } - "end" => { - ::pb_jelly::reflection::FieldMut::Value(self.end.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.") + } + "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)) } - _ => { - panic!("unknown field name given") - } + "reserved_range" => { + unimplemented!("Repeated fields are not currently supported.") + } + "reserved_name" => { + unimplemented!("Repeated fields are not currently supported.") + } + _ => { + panic!("unknown field name given") + } + } + } + } + + #[derive(Clone, Debug, PartialEq)] + pub struct DescriptorProto_ExtensionRange { + /// Inclusive. + pub start: ::std::option::Option, + /// Exclusive. + pub end: ::std::option::Option, + pub options: ::std::option::Option, + } + impl DescriptorProto_ExtensionRange { + 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(0i32) + } + pub fn has_end(&self) -> bool { + self.end.is_some() + } + pub fn set_end(&mut self, v: i32) { + self.end = Some(v); + } + pub fn get_end(&self) -> i32 { + self.end.unwrap_or(0i32) + } + 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 { + 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_ExtensionRange_default: DescriptorProto_ExtensionRange = DescriptorProto_ExtensionRange::default(); + } + impl ::pb_jelly::Message for DescriptorProto_ExtensionRange { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "DescriptorProto_ExtensionRange", + full_name: "google.protobuf.DescriptorProto_ExtensionRange", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "start", + full_name: "google.protobuf.DescriptorProto_ExtensionRange.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_ExtensionRange.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: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0usize; + if let Some(ref val) = self.start { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.end { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.options { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.start { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.end { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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)?; + self.start = Some(val); + } + 2 => { + 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_ExtensionRange", 3)?; + self.options = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for DescriptorProto_ExtensionRange { + 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)) + } + "options" => { + ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) + } + _ => { + panic!("unknown field name given") + } } } } @@ -3050,6 +4486,16 @@ pub mod google { 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 { @@ -3065,11 +4511,47 @@ pub mod google { 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: ::std::option::Option::Some(ExtensionRangeOptions_VerificationState::UNVERIFIED), _extensions: ::pb_jelly::Unrecognized::default(), } } @@ -3092,6 +4574,33 @@ 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: &[ ], @@ -3102,10 +4611,28 @@ pub mod google { for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); } + for val in &self.declaration { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 50, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.verification { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + } size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + for val in &self.declaration { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.verification { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 50, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; } @@ -3119,6 +4646,18 @@ 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)?; } @@ -3143,6 +4682,15 @@ 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") } @@ -3155,50 +4703,291 @@ pub mod google { } } - /// Describes a field within a message. - #[derive(Clone, Debug, PartialEq)] - pub struct FieldDescriptorProto { - pub name: ::std::option::Option<::std::string::String>, + #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + pub struct ExtensionRangeOptions_Declaration { + /// The extension number declared within the extension range. 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. - /// 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, + /// 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 fn get_number(&self) -> i32 { + self.number.unwrap_or(0i32) + } + 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 = 0usize; + if let Some(ref val) = self.number { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.full_name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.r#type { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.reserved { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.repeated { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.number { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.full_name { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.r#type { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.reserved { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.repeated { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + } + 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 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 @@ -3917,472 +5706,1242 @@ pub mod google { ], }) } - fn compute_size(&self) -> usize { - let mut size = 0usize; - if let Some(ref val) = self.name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); - } - for val in &self.value { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); - } - for val in &self.reserved_range { - size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); - } - for val in &self.reserved_name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); - } - size + fn compute_size(&self) -> usize { + let mut size = 0usize; + if let Some(ref val) = self.name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.value { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.options { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.reserved_range { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.reserved_name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.value { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.reserved_range { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.reserved_name { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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, "EnumDescriptorProto", 1)?; + self.name = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 2)?; + self.value.push(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 3)?; + self.options = Some(val); + } + 4 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 4)?; + self.reserved_range.push(val); + } + 5 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 5)?; + self.reserved_name.push(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for EnumDescriptorProto { + 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 { + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) + } + "value" => { + unimplemented!("Repeated fields are not currently supported.") + } + "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") + } + } + } + } + + /// Range of reserved numeric values. Reserved values may not be used by + /// entries in the same enum. Reserved ranges may not overlap. + + /// Note that this is distinct from DescriptorProto.ReservedRange in that it + /// is inclusive such that it can appropriately represent the entire int32 + /// domain. + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + pub struct EnumDescriptorProto_EnumReservedRange { + /// Inclusive. + pub start: ::std::option::Option, + /// Inclusive. + pub end: ::std::option::Option, + } + impl EnumDescriptorProto_EnumReservedRange { + 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(0i32) + } + pub fn has_end(&self) -> bool { + self.end.is_some() + } + pub fn set_end(&mut self, v: i32) { + self.end = Some(v); + } + pub fn get_end(&self) -> i32 { + self.end.unwrap_or(0i32) + } + } + impl ::std::default::Default for EnumDescriptorProto_EnumReservedRange { + fn default() -> Self { + EnumDescriptorProto_EnumReservedRange { + start: ::std::default::Default::default(), + end: ::std::default::Default::default(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref EnumDescriptorProto_EnumReservedRange_default: EnumDescriptorProto_EnumReservedRange = EnumDescriptorProto_EnumReservedRange::default(); + } + impl ::pb_jelly::Message for EnumDescriptorProto_EnumReservedRange { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "EnumDescriptorProto_EnumReservedRange", + full_name: "google.protobuf.EnumDescriptorProto_EnumReservedRange", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "start", + full_name: "google.protobuf.EnumDescriptorProto_EnumReservedRange.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.EnumDescriptorProto_EnumReservedRange.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 = 0usize; + if let Some(ref val) = self.start { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.end { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.start { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.end { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + } + 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, "EnumDescriptorProto_EnumReservedRange", 1)?; + self.start = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumDescriptorProto_EnumReservedRange", 2)?; + self.end = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for EnumDescriptorProto_EnumReservedRange { + 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") + } + } + } + } + + /// Describes a value within an enum. + #[derive(Clone, Debug, PartialEq)] + pub struct EnumValueDescriptorProto { + pub name: ::std::option::Option<::std::string::String>, + pub number: ::std::option::Option, + pub options: ::std::option::Option, + } + impl EnumValueDescriptorProto { + 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("") + } + pub fn has_number(&self) -> bool { + self.number.is_some() + } + pub fn set_number(&mut self, v: i32) { + self.number = Some(v); + } + pub fn get_number(&self) -> i32 { + self.number.unwrap_or(0i32) + } + pub fn has_options(&self) -> bool { + self.options.is_some() + } + pub fn set_options(&mut self, v: EnumValueOptions) { + self.options = Some(v); + } + pub fn take_options(&mut self) -> EnumValueOptions { + self.options.take().unwrap_or_default() + } + pub fn get_options(&self) -> &EnumValueOptions { + self.options.as_ref().unwrap_or(&EnumValueOptions_default) + } + } + impl ::std::default::Default for EnumValueDescriptorProto { + fn default() -> Self { + EnumValueDescriptorProto { + name: ::std::default::Default::default(), + number: ::std::default::Default::default(), + options: ::std::default::Default::default(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref EnumValueDescriptorProto_default: EnumValueDescriptorProto = EnumValueDescriptorProto::default(); + } + impl ::pb_jelly::Message for EnumValueDescriptorProto { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "EnumValueDescriptorProto", + full_name: "google.protobuf.EnumValueDescriptorProto", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "name", + full_name: "google.protobuf.EnumValueDescriptorProto.name", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "number", + full_name: "google.protobuf.EnumValueDescriptorProto.number", + 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.EnumValueDescriptorProto.options", + index: 2, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ], + oneofs: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0usize; + if let Some(ref val) = self.name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.number { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.options { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.number { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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, "EnumValueDescriptorProto", 1)?; + self.name = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueDescriptorProto", 2)?; + self.number = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueDescriptorProto", 3)?; + self.options = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for EnumValueDescriptorProto { + 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 { + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) + } + "number" => { + ::pb_jelly::reflection::FieldMut::Value(self.number.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") + } + } + } + } + + /// Describes a service. + #[derive(Clone, Debug, PartialEq)] + pub struct ServiceDescriptorProto { + pub name: ::std::option::Option<::std::string::String>, + pub method: ::std::vec::Vec, + pub options: ::std::option::Option, + } + impl ServiceDescriptorProto { + 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("") + } + pub fn set_method(&mut self, v: ::std::vec::Vec) { + self.method = v; + } + pub fn take_method(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.method) + } + pub fn get_method(&self) -> &[MethodDescriptorProto] { + &self.method + } + pub fn mut_method(&mut self) -> &mut ::std::vec::Vec { + &mut self.method + } + pub fn has_options(&self) -> bool { + self.options.is_some() + } + pub fn set_options(&mut self, v: ServiceOptions) { + self.options = Some(v); + } + pub fn take_options(&mut self) -> ServiceOptions { + self.options.take().unwrap_or_default() + } + pub fn get_options(&self) -> &ServiceOptions { + self.options.as_ref().unwrap_or(&ServiceOptions_default) + } + } + impl ::std::default::Default for ServiceDescriptorProto { + fn default() -> Self { + ServiceDescriptorProto { + name: ::std::default::Default::default(), + method: ::std::default::Default::default(), + options: ::std::default::Default::default(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref ServiceDescriptorProto_default: ServiceDescriptorProto = ServiceDescriptorProto::default(); + } + impl ::pb_jelly::Message for ServiceDescriptorProto { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "ServiceDescriptorProto", + full_name: "google.protobuf.ServiceDescriptorProto", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "name", + full_name: "google.protobuf.ServiceDescriptorProto.name", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "method", + full_name: "google.protobuf.ServiceDescriptorProto.method", + index: 1, + number: 2, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "options", + full_name: "google.protobuf.ServiceDescriptorProto.options", + index: 2, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ], + oneofs: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0usize; + if let Some(ref val) = self.name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.method { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.options { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.method { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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, "ServiceDescriptorProto", 1)?; + self.name = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceDescriptorProto", 2)?; + self.method.push(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceDescriptorProto", 3)?; + self.options = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for ServiceDescriptorProto { + 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 { + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) + } + "method" => { + unimplemented!("Repeated fields are not currently supported.") + } + "options" => { + ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) + } + _ => { + panic!("unknown field name given") + } + } + } + } + + /// Describes a method of a service. + #[derive(Clone, Debug, PartialEq)] + pub struct MethodDescriptorProto { + pub name: ::std::option::Option<::std::string::String>, + /// Input and output type names. These are resolved in the same way as + /// FieldDescriptorProto.type_name, but must refer to a message type. + pub input_type: ::std::option::Option<::std::string::String>, + pub output_type: ::std::option::Option<::std::string::String>, + pub options: ::std::option::Option, + /// Identifies if client streams multiple client messages + pub client_streaming: ::std::option::Option, + /// Identifies if server streams multiple server messages + pub server_streaming: ::std::option::Option, + } + impl MethodDescriptorProto { + 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("") + } + pub fn has_input_type(&self) -> bool { + self.input_type.is_some() + } + pub fn set_input_type(&mut self, v: ::std::string::String) { + self.input_type = Some(v); + } + pub fn take_input_type(&mut self) -> ::std::string::String { + self.input_type.take().unwrap_or_default() + } + pub fn get_input_type(&self) -> &str { + self.input_type.as_deref().unwrap_or("") + } + pub fn has_output_type(&self) -> bool { + self.output_type.is_some() + } + pub fn set_output_type(&mut self, v: ::std::string::String) { + self.output_type = Some(v); + } + pub fn take_output_type(&mut self) -> ::std::string::String { + self.output_type.take().unwrap_or_default() + } + pub fn get_output_type(&self) -> &str { + self.output_type.as_deref().unwrap_or("") + } + pub fn has_options(&self) -> bool { + self.options.is_some() + } + pub fn set_options(&mut self, v: MethodOptions) { + self.options = Some(v); + } + pub fn take_options(&mut self) -> MethodOptions { + self.options.take().unwrap_or_default() + } + pub fn get_options(&self) -> &MethodOptions { + self.options.as_ref().unwrap_or(&MethodOptions_default) + } + pub fn has_client_streaming(&self) -> bool { + self.client_streaming.is_some() + } + pub fn set_client_streaming(&mut self, v: bool) { + self.client_streaming = Some(v); + } + pub fn get_client_streaming(&self) -> bool { + self.client_streaming.unwrap_or(false) + } + pub fn has_server_streaming(&self) -> bool { + self.server_streaming.is_some() + } + pub fn set_server_streaming(&mut self, v: bool) { + self.server_streaming = Some(v); + } + pub fn get_server_streaming(&self) -> bool { + self.server_streaming.unwrap_or(false) + } + } + impl ::std::default::Default for MethodDescriptorProto { + fn default() -> Self { + MethodDescriptorProto { + name: ::std::default::Default::default(), + input_type: ::std::default::Default::default(), + output_type: ::std::default::Default::default(), + options: ::std::default::Default::default(), + client_streaming: ::std::option::Option::Some(false), + server_streaming: ::std::option::Option::Some(false), + } + } + } + ::lazy_static::lazy_static! { + pub static ref MethodDescriptorProto_default: MethodDescriptorProto = MethodDescriptorProto::default(); + } + impl ::pb_jelly::Message for MethodDescriptorProto { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "MethodDescriptorProto", + full_name: "google.protobuf.MethodDescriptorProto", + fields: &[ + ::pb_jelly::FieldDescriptor { + name: "name", + full_name: "google.protobuf.MethodDescriptorProto.name", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "input_type", + full_name: "google.protobuf.MethodDescriptorProto.input_type", + index: 1, + number: 2, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "output_type", + full_name: "google.protobuf.MethodDescriptorProto.output_type", + index: 2, + number: 3, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "options", + full_name: "google.protobuf.MethodDescriptorProto.options", + index: 3, + number: 4, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "client_streaming", + full_name: "google.protobuf.MethodDescriptorProto.client_streaming", + index: 4, + number: 5, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "server_streaming", + full_name: "google.protobuf.MethodDescriptorProto.server_streaming", + index: 5, + 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 = 0usize; + if let Some(ref val) = self.name { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.input_type { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.output_type { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.options { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.client_streaming { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.server_streaming { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.input_type { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.output_type { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.options { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.client_streaming { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.server_streaming { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + } + 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, "MethodDescriptorProto", 1)?; + self.name = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodDescriptorProto", 2)?; + self.input_type = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodDescriptorProto", 3)?; + self.output_type = Some(val); + } + 4 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodDescriptorProto", 4)?; + self.options = Some(val); + } + 5 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodDescriptorProto", 5)?; + self.client_streaming = Some(val); + } + 6 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodDescriptorProto", 6)?; + self.server_streaming = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } + } + Ok(()) + } + } + impl ::pb_jelly::Reflection for MethodDescriptorProto { + 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 { + "name" => { + ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) + } + "input_type" => { + ::pb_jelly::reflection::FieldMut::Value(self.input_type.get_or_insert_with(::std::default::Default::default)) + } + "output_type" => { + ::pb_jelly::reflection::FieldMut::Value(self.output_type.get_or_insert_with(::std::default::Default::default)) + } + "options" => { + ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) + } + "client_streaming" => { + ::pb_jelly::reflection::FieldMut::Value(self.client_streaming.get_or_insert_with(::std::default::Default::default)) + } + "server_streaming" => { + ::pb_jelly::reflection::FieldMut::Value(self.server_streaming.get_or_insert_with(::std::default::Default::default)) + } + _ => { + panic!("unknown field name given") + } + } + } + } + + // =================================================================== + // Options + + // Each of the definitions above may have "options" attached. These are + // just annotations which may cause code to be generated slightly differently + // or may contain hints for code that manipulates protocol messages. + + // Clients may define custom options as extensions of the *Options messages. + // These extensions may not yet be known at parsing time, so the parser cannot + // store the values in them. Instead it stores them in a field in the *Options + // message called uninterpreted_option. This field must have the same name + // across all *Options messages. We then use this field to populate the + // extensions when we build a descriptor, at which point all protos have been + // parsed and so all extensions are known. + + // Extension numbers for custom options may be chosen as follows: + // * For options which will only be used within a single application or + // organization, or for experimental options, use field numbers 50000 + // through 99999. It is up to you to ensure that you do not use the + // same number for multiple options. + // * For options which will be published and used publicly by multiple + // independent entities, e-mail protobuf-global-extension-registry@google.com + // to reserve extension numbers. Simply provide your project name (e.g. + // Objective-C plugin) and your project website (if available) -- there's no + // need to explain how you intend to use them. Usually you only need one + // extension number. You can declare multiple options with only one extension + // number by putting them in a sub-message. See the Custom Options section of + // the docs for examples: + // https://developers.google.com/protocol-buffers/docs/proto#options + // If this turns out to be popular, a web service will be set up + // to automatically assign option numbers. + + #[derive(Clone, Debug, PartialEq)] + pub struct FileOptions { + /// Sets the Java package where classes generated from this .proto will be + /// placed. By default, the proto package is used, but this is often + /// inappropriate because proto packages do not normally start with backwards + /// domain names. + pub java_package: ::std::option::Option<::std::string::String>, + /// Controls the name of the wrapper Java class generated for the .proto file. + /// That class will always contain the .proto file's getDescriptor() method as + /// well as any top-level extensions defined in the .proto file. + /// If java_multiple_files is disabled, then all the other classes from the + /// .proto file will be nested inside the single wrapper outer class. + pub java_outer_classname: ::std::option::Option<::std::string::String>, + /// If enabled, then the Java code generator will generate a separate .java + /// file for each top-level message, enum, and service defined in the .proto + /// file. Thus, these types will *not* be nested inside the wrapper class + /// named by java_outer_classname. However, the wrapper class will still be + /// generated to contain the file's getDescriptor() method as well as any + /// top-level extensions defined in the file. + pub java_multiple_files: ::std::option::Option, + /// This option does nothing. + pub java_generate_equals_and_hash: ::std::option::Option, + /// A proto2 file can set this to true to opt in to UTF-8 checking for Java, + /// which will throw an exception if invalid UTF-8 is parsed from the wire or + /// assigned to a string field. + + /// TODO: clarify exactly what kinds of field types this option + /// applies to, and update these docs accordingly. + + /// Proto3 files already perform these checks. Setting the option explicitly to + /// false has no effect: it cannot be used to opt proto3 files out of UTF-8 + /// checks. + pub java_string_check_utf8: ::std::option::Option, + pub optimize_for: ::std::option::Option, + /// Sets the Go package where structs generated from this .proto will be + /// placed. If omitted, the Go package will be derived from the following: + /// - The basename of the package import path, if provided. + /// - Otherwise, the package statement in the .proto file, if present. + /// - Otherwise, the basename of the .proto file, without extension. + pub go_package: ::std::option::Option<::std::string::String>, + /// Should generic services be generated in each language? "Generic" services + /// are not specific to any particular RPC system. They are generated by the + /// main code generators in each language (without additional plugins). + /// Generic services were the only kind of service generation supported by + /// early versions of google.protobuf. + + /// Generic services are now considered deprecated in favor of using plugins + /// that generate code specific to your particular RPC system. Therefore, + /// these default to false. Old code which depends on generic services should + /// explicitly set them to true. + pub cc_generic_services: ::std::option::Option, + pub java_generic_services: ::std::option::Option, + pub py_generic_services: ::std::option::Option, + /// Is this file deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for everything in the file, or it will be completely ignored; in the very + /// least, this is a formalization for deprecating files. + pub deprecated: ::std::option::Option, + /// Enables the use of arenas for the proto messages in this file. This applies + /// only to generated classes for C++. + pub cc_enable_arenas: ::std::option::Option, + /// Sets the objective c class prefix which is prepended to all objective c + /// generated classes from this .proto. There is no default. + pub objc_class_prefix: ::std::option::Option<::std::string::String>, + /// Namespace for generated classes; defaults to the package. + pub csharp_namespace: ::std::option::Option<::std::string::String>, + /// By default Swift generators will take the proto package and CamelCase it + /// replacing '.' with underscore and use that to prefix the types/symbols + /// defined. When this options is provided, they will use this value instead + /// to prefix the types/symbols defined. + pub swift_prefix: ::std::option::Option<::std::string::String>, + /// Sets the php class prefix which is prepended to all php generated classes + /// from this .proto. Default is empty. + pub php_class_prefix: ::std::option::Option<::std::string::String>, + /// Use this option to change the namespace of php generated classes. Default + /// is empty. When this option is empty, the package name will be used for + /// determining the namespace. + pub php_namespace: ::std::option::Option<::std::string::String>, + /// Use this option to change the namespace of php generated metadata classes. + /// Default is empty. When this option is empty, the proto file name will be + /// used for determining the namespace. + pub php_metadata_namespace: ::std::option::Option<::std::string::String>, + /// Use this option to change the package of ruby generated classes. Default + /// 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, + pub _extensions: ::pb_jelly::Unrecognized, + } + impl FileOptions { + pub fn has_java_package(&self) -> bool { + self.java_package.is_some() + } + pub fn set_java_package(&mut self, v: ::std::string::String) { + self.java_package = Some(v); + } + pub fn take_java_package(&mut self) -> ::std::string::String { + self.java_package.take().unwrap_or_default() + } + pub fn get_java_package(&self) -> &str { + self.java_package.as_deref().unwrap_or("") + } + pub fn has_java_outer_classname(&self) -> bool { + self.java_outer_classname.is_some() + } + pub fn set_java_outer_classname(&mut self, v: ::std::string::String) { + self.java_outer_classname = Some(v); + } + pub fn take_java_outer_classname(&mut self) -> ::std::string::String { + self.java_outer_classname.take().unwrap_or_default() + } + pub fn get_java_outer_classname(&self) -> &str { + self.java_outer_classname.as_deref().unwrap_or("") + } + pub fn has_java_multiple_files(&self) -> bool { + self.java_multiple_files.is_some() + } + pub fn set_java_multiple_files(&mut self, v: bool) { + self.java_multiple_files = Some(v); + } + pub fn get_java_multiple_files(&self) -> bool { + self.java_multiple_files.unwrap_or(false) + } + pub fn has_java_generate_equals_and_hash(&self) -> bool { + self.java_generate_equals_and_hash.is_some() } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.value { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.reserved_range { - ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - for val in &self.reserved_name { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - Ok(()) + pub fn set_java_generate_equals_and_hash(&mut self, v: bool) { + self.java_generate_equals_and_hash = Some(v); } - 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, "EnumDescriptorProto", 1)?; - self.name = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 2)?; - self.value.push(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 3)?; - self.options = Some(val); - } - 4 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 4)?; - self.reserved_range.push(val); - } - 5 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumDescriptorProto", 5)?; - self.reserved_name.push(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) + pub fn get_java_generate_equals_and_hash(&self) -> bool { + self.java_generate_equals_and_hash.unwrap_or(false) } - } - impl ::pb_jelly::Reflection for EnumDescriptorProto { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } + pub fn has_java_string_check_utf8(&self) -> bool { + self.java_string_check_utf8.is_some() } - 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)) - } - "value" => { - unimplemented!("Repeated fields are not currently supported.") - } - "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") - } - } + pub fn set_java_string_check_utf8(&mut self, v: bool) { + self.java_string_check_utf8 = Some(v); } - } - - /// Range of reserved numeric values. Reserved values may not be used by - /// entries in the same enum. Reserved ranges may not overlap. - - /// Note that this is distinct from DescriptorProto.ReservedRange in that it - /// is inclusive such that it can appropriately represent the entire int32 - /// domain. - #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] - pub struct EnumDescriptorProto_EnumReservedRange { - /// Inclusive. - pub start: ::std::option::Option, - /// Inclusive. - pub end: ::std::option::Option, - } - impl EnumDescriptorProto_EnumReservedRange { - pub fn has_start(&self) -> bool { - self.start.is_some() + pub fn get_java_string_check_utf8(&self) -> bool { + self.java_string_check_utf8.unwrap_or(false) } - pub fn set_start(&mut self, v: i32) { - self.start = Some(v); + pub fn has_optimize_for(&self) -> bool { + self.optimize_for.is_some() } - pub fn get_start(&self) -> i32 { - self.start.unwrap_or(0i32) + pub fn set_optimize_for(&mut self, v: FileOptions_OptimizeMode) { + self.optimize_for = Some(v); } - pub fn has_end(&self) -> bool { - self.end.is_some() + pub fn get_optimize_for(&self) -> FileOptions_OptimizeMode { + self.optimize_for.unwrap_or_default() } - pub fn set_end(&mut self, v: i32) { - self.end = Some(v); + pub fn has_go_package(&self) -> bool { + self.go_package.is_some() } - pub fn get_end(&self) -> i32 { - self.end.unwrap_or(0i32) + pub fn set_go_package(&mut self, v: ::std::string::String) { + self.go_package = Some(v); } - } - impl ::std::default::Default for EnumDescriptorProto_EnumReservedRange { - fn default() -> Self { - EnumDescriptorProto_EnumReservedRange { - start: ::std::default::Default::default(), - end: ::std::default::Default::default(), - } + pub fn take_go_package(&mut self) -> ::std::string::String { + self.go_package.take().unwrap_or_default() } - } - ::lazy_static::lazy_static! { - pub static ref EnumDescriptorProto_EnumReservedRange_default: EnumDescriptorProto_EnumReservedRange = EnumDescriptorProto_EnumReservedRange::default(); - } - impl ::pb_jelly::Message for EnumDescriptorProto_EnumReservedRange { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "EnumDescriptorProto_EnumReservedRange", - full_name: "google.protobuf.EnumDescriptorProto_EnumReservedRange", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "start", - full_name: "google.protobuf.EnumDescriptorProto_EnumReservedRange.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.EnumDescriptorProto_EnumReservedRange.end", - index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) + pub fn get_go_package(&self) -> &str { + self.go_package.as_deref().unwrap_or("") } - fn compute_size(&self) -> usize { - let mut size = 0usize; - if let Some(ref val) = self.start { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.end { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); - } - size + pub fn has_cc_generic_services(&self) -> bool { + self.cc_generic_services.is_some() } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.start { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.end { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; - } - Ok(()) + pub fn set_cc_generic_services(&mut self, v: bool) { + self.cc_generic_services = Some(v); } - 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, "EnumDescriptorProto_EnumReservedRange", 1)?; - self.start = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumDescriptorProto_EnumReservedRange", 2)?; - self.end = Some(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) + 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_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() } - } - impl ::pb_jelly::Reflection for EnumDescriptorProto_EnumReservedRange { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } + pub fn set_cc_enable_arenas(&mut self, v: bool) { + self.cc_enable_arenas = Some(v); } - 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") - } - } + pub fn get_cc_enable_arenas(&self) -> bool { + self.cc_enable_arenas.unwrap_or(false) } - } - - /// Describes a value within an enum. - #[derive(Clone, Debug, PartialEq)] - pub struct EnumValueDescriptorProto { - pub name: ::std::option::Option<::std::string::String>, - pub number: ::std::option::Option, - pub options: ::std::option::Option, - } - impl EnumValueDescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() + pub fn has_objc_class_prefix(&self) -> bool { + self.objc_class_prefix.is_some() } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); + pub fn set_objc_class_prefix(&mut self, v: ::std::string::String) { + self.objc_class_prefix = Some(v); } - pub fn take_name(&mut self) -> ::std::string::String { - self.name.take().unwrap_or_default() + pub fn take_objc_class_prefix(&mut self) -> ::std::string::String { + self.objc_class_prefix.take().unwrap_or_default() } - pub fn get_name(&self) -> &str { - self.name.as_deref().unwrap_or("") + pub fn get_objc_class_prefix(&self) -> &str { + self.objc_class_prefix.as_deref().unwrap_or("") } - pub fn has_number(&self) -> bool { - self.number.is_some() + pub fn has_csharp_namespace(&self) -> bool { + self.csharp_namespace.is_some() } - pub fn set_number(&mut self, v: i32) { - self.number = Some(v); + pub fn set_csharp_namespace(&mut self, v: ::std::string::String) { + self.csharp_namespace = Some(v); } - pub fn get_number(&self) -> i32 { - self.number.unwrap_or(0i32) + pub fn take_csharp_namespace(&mut self) -> ::std::string::String { + self.csharp_namespace.take().unwrap_or_default() } - pub fn has_options(&self) -> bool { - self.options.is_some() + pub fn get_csharp_namespace(&self) -> &str { + self.csharp_namespace.as_deref().unwrap_or("") } - pub fn set_options(&mut self, v: EnumValueOptions) { - self.options = Some(v); + pub fn has_swift_prefix(&self) -> bool { + self.swift_prefix.is_some() } - pub fn take_options(&mut self) -> EnumValueOptions { - self.options.take().unwrap_or_default() + pub fn set_swift_prefix(&mut self, v: ::std::string::String) { + self.swift_prefix = Some(v); } - pub fn get_options(&self) -> &EnumValueOptions { - self.options.as_ref().unwrap_or(&EnumValueOptions_default) + pub fn take_swift_prefix(&mut self) -> ::std::string::String { + self.swift_prefix.take().unwrap_or_default() } - } - impl ::std::default::Default for EnumValueDescriptorProto { - fn default() -> Self { - EnumValueDescriptorProto { - name: ::std::default::Default::default(), - number: ::std::default::Default::default(), - options: ::std::default::Default::default(), - } + pub fn get_swift_prefix(&self) -> &str { + self.swift_prefix.as_deref().unwrap_or("") } - } - ::lazy_static::lazy_static! { - pub static ref EnumValueDescriptorProto_default: EnumValueDescriptorProto = EnumValueDescriptorProto::default(); - } - impl ::pb_jelly::Message for EnumValueDescriptorProto { - fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { - Some(::pb_jelly::MessageDescriptor { - name: "EnumValueDescriptorProto", - full_name: "google.protobuf.EnumValueDescriptorProto", - fields: &[ - ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.EnumValueDescriptorProto.name", - index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ::pb_jelly::FieldDescriptor { - name: "number", - full_name: "google.protobuf.EnumValueDescriptorProto.number", - 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.EnumValueDescriptorProto.options", - index: 2, - number: 3, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, - oneof_index: None, - }, - ], - oneofs: &[ - ], - }) + pub fn has_php_class_prefix(&self) -> bool { + self.php_class_prefix.is_some() } - fn compute_size(&self) -> usize { - let mut size = 0usize; - if let Some(ref val) = self.name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.number { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); - } - size + pub fn set_php_class_prefix(&mut self, v: ::std::string::String) { + self.php_class_prefix = Some(v); } - fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.number { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - Ok(()) + pub fn take_php_class_prefix(&mut self) -> ::std::string::String { + self.php_class_prefix.take().unwrap_or_default() } - 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, "EnumValueDescriptorProto", 1)?; - self.name = Some(val); - } - 2 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueDescriptorProto", 2)?; - self.number = Some(val); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueDescriptorProto", 3)?; - self.options = Some(val); - } - _ => { - ::pb_jelly::skip(typ, &mut buf)?; - } - } - } - Ok(()) + pub fn get_php_class_prefix(&self) -> &str { + self.php_class_prefix.as_deref().unwrap_or("") } - } - impl ::pb_jelly::Reflection for EnumValueDescriptorProto { - fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { - match oneof_name { - _ => { - panic!("unknown oneof name given"); - } - } + pub fn has_php_namespace(&self) -> bool { + self.php_namespace.is_some() } - 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)) - } - "number" => { - ::pb_jelly::reflection::FieldMut::Value(self.number.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") - } - } + pub fn set_php_namespace(&mut self, v: ::std::string::String) { + self.php_namespace = Some(v); } - } - - /// Describes a service. - #[derive(Clone, Debug, PartialEq)] - pub struct ServiceDescriptorProto { - pub name: ::std::option::Option<::std::string::String>, - pub method: ::std::vec::Vec, - pub options: ::std::option::Option, - } - impl ServiceDescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() + pub fn take_php_namespace(&mut self) -> ::std::string::String { + self.php_namespace.take().unwrap_or_default() } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); + pub fn get_php_namespace(&self) -> &str { + self.php_namespace.as_deref().unwrap_or("") } - pub fn take_name(&mut self) -> ::std::string::String { - self.name.take().unwrap_or_default() + pub fn has_php_metadata_namespace(&self) -> bool { + self.php_metadata_namespace.is_some() } - pub fn get_name(&self) -> &str { - self.name.as_deref().unwrap_or("") + pub fn set_php_metadata_namespace(&mut self, v: ::std::string::String) { + self.php_metadata_namespace = Some(v); } - pub fn set_method(&mut self, v: ::std::vec::Vec) { - self.method = v; + pub fn take_php_metadata_namespace(&mut self) -> ::std::string::String { + self.php_metadata_namespace.take().unwrap_or_default() } - pub fn take_method(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.method) + 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 get_method(&self) -> &[MethodDescriptorProto] { - &self.method + pub fn set_features(&mut self, v: FeatureSet) { + self.features = Some(v); } - pub fn mut_method(&mut self) -> &mut ::std::vec::Vec { - &mut self.method + pub fn take_features(&mut self) -> FeatureSet { + self.features.take().unwrap_or_default() } - pub fn has_options(&self) -> bool { - self.options.is_some() + pub fn get_features(&self) -> &FeatureSet { + self.features.as_ref().unwrap_or(&FeatureSet_default) } - pub fn set_options(&mut self, v: ServiceOptions) { - self.options = Some(v); + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn take_options(&mut self) -> ServiceOptions { - self.options.take().unwrap_or_default() + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn get_options(&self) -> &ServiceOptions { - self.options.as_ref().unwrap_or(&ServiceOptions_default) + 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 ServiceDescriptorProto { + impl ::std::default::Default for FileOptions { fn default() -> Self { - ServiceDescriptorProto { - name: ::std::default::Default::default(), - method: ::std::default::Default::default(), - options: ::std::default::Default::default(), + FileOptions { + java_package: ::std::default::Default::default(), + java_outer_classname: ::std::default::Default::default(), + java_multiple_files: ::std::option::Option::Some(false), + java_generate_equals_and_hash: ::std::default::Default::default(), + java_string_check_utf8: ::std::option::Option::Some(false), + optimize_for: ::std::option::Option::Some(FileOptions_OptimizeMode::SPEED), + go_package: ::std::default::Default::default(), + cc_generic_services: ::std::option::Option::Some(false), + java_generic_services: ::std::option::Option::Some(false), + py_generic_services: ::std::option::Option::Some(false), + deprecated: ::std::option::Option::Some(false), + cc_enable_arenas: ::std::option::Option::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 ServiceDescriptorProto_default: ServiceDescriptorProto = ServiceDescriptorProto::default(); + pub static ref FileOptions_default: FileOptions = FileOptions::default(); } - impl ::pb_jelly::Message for ServiceDescriptorProto { + impl ::pb_jelly::Message for FileOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "ServiceDescriptorProto", - full_name: "google.protobuf.ServiceDescriptorProto", + name: "FileOptions", + full_name: "google.protobuf.FileOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.ServiceDescriptorProto.name", + name: "java_package", + full_name: "google.protobuf.FileOptions.java_package", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::LengthDelimited, @@ -4390,23 +6949,185 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "method", - full_name: "google.protobuf.ServiceDescriptorProto.method", + name: "java_outer_classname", + full_name: "google.protobuf.FileOptions.java_outer_classname", index: 1, - number: 2, + number: 8, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "options", - full_name: "google.protobuf.ServiceDescriptorProto.options", + name: "java_multiple_files", + full_name: "google.protobuf.FileOptions.java_multiple_files", index: 2, - number: 3, + 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: "deprecated", + full_name: "google.protobuf.FileOptions.deprecated", + index: 10, + 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: 11, + 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: 12, + 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: 13, + 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: 14, + 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: 15, + 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: 16, + 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: 17, + 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: 18, + 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: 19, + 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: 20, + number: 999, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, + oneof_index: None, + }, ], oneofs: &[ ], @@ -4414,43 +7135,228 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.name { + if let Some(ref val) = self.java_package { size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.method { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.java_outer_classname { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.java_multiple_files { + size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.java_generate_equals_and_hash { + size += ::pb_jelly::helpers::compute_size_field::(val, 20, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.java_string_check_utf8 { + size += ::pb_jelly::helpers::compute_size_field::(val, 27, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.optimize_for { + size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.go_package { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 11, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.cc_generic_services { + size += ::pb_jelly::helpers::compute_size_field::(val, 16, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.java_generic_services { + size += ::pb_jelly::helpers::compute_size_field::(val, 17, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.py_generic_services { + size += ::pb_jelly::helpers::compute_size_field::(val, 18, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 23, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.cc_enable_arenas { + size += ::pb_jelly::helpers::compute_size_field::(val, 31, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.objc_class_prefix { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 36, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.csharp_namespace { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 37, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.swift_prefix { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 39, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.php_class_prefix { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 40, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.php_namespace { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 41, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.php_metadata_namespace { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 44, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.ruby_package { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 45, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 50, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.uninterpreted_option { + size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); } + size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { + if let Some(ref val) = self.java_package { ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.method { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.java_outer_classname { + ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.optimize_for { + ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.java_multiple_files { + ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.go_package { + ::pb_jelly::helpers::serialize_field::(w, val, 11, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.cc_generic_services { + ::pb_jelly::helpers::serialize_field::(w, val, 16, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.java_generic_services { + ::pb_jelly::helpers::serialize_field::(w, val, 17, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.py_generic_services { + ::pb_jelly::helpers::serialize_field::(w, val, 18, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.java_generate_equals_and_hash { + ::pb_jelly::helpers::serialize_field::(w, val, 20, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.deprecated { + ::pb_jelly::helpers::serialize_field::(w, val, 23, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.java_string_check_utf8 { + ::pb_jelly::helpers::serialize_field::(w, val, 27, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.cc_enable_arenas { + ::pb_jelly::helpers::serialize_field::(w, val, 31, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.objc_class_prefix { + ::pb_jelly::helpers::serialize_field::(w, val, 36, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.csharp_namespace { + ::pb_jelly::helpers::serialize_field::(w, val, 37, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.swift_prefix { + ::pb_jelly::helpers::serialize_field::(w, val, 39, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.php_class_prefix { + ::pb_jelly::helpers::serialize_field::(w, val, 40, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.php_namespace { + ::pb_jelly::helpers::serialize_field::(w, val, 41, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.php_metadata_namespace { + ::pb_jelly::helpers::serialize_field::(w, val, 44, ::pb_jelly::wire_format::Type::LengthDelimited)?; } + if let Some(ref val) = self.ruby_package { + ::pb_jelly::helpers::serialize_field::(w, val, 45, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 50, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.uninterpreted_option { + ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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, "ServiceDescriptorProto", 1)?; - self.name = Some(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 1)?; + self.java_package = Some(val); } - 2 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceDescriptorProto", 2)?; - self.method.push(val); + 8 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FileOptions", 8)?; + self.java_outer_classname = Some(val); } - 3 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceDescriptorProto", 3)?; - self.options = 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); + } + 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)?; @@ -4460,7 +7366,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for ServiceDescriptorProto { + impl ::pb_jelly::Reflection for FileOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -4470,14 +7376,68 @@ 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)) + "java_package" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_package.get_or_insert_with(::std::default::Default::default)) } - "method" => { - unimplemented!("Repeated fields are not currently supported.") + "java_outer_classname" => { + ::pb_jelly::reflection::FieldMut::Value(self.java_outer_classname.get_or_insert_with(::std::default::Default::default)) } - "options" => { - ::pb_jelly::reflection::FieldMut::Value(self.options.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)) + } + "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") @@ -4485,164 +7445,238 @@ pub mod google { } } } + impl ::pb_jelly::extensions::Extensible for FileOptions { + fn _extensions(&self) -> &::pb_jelly::Unrecognized { + &self._extensions + } + } - /// Describes a method of a service. #[derive(Clone, Debug, PartialEq)] - pub struct MethodDescriptorProto { - pub name: ::std::option::Option<::std::string::String>, - /// Input and output type names. These are resolved in the same way as - /// FieldDescriptorProto.type_name, but must refer to a message type. - pub input_type: ::std::option::Option<::std::string::String>, - pub output_type: ::std::option::Option<::std::string::String>, - pub options: ::std::option::Option, - /// Identifies if client streams multiple client messages - pub client_streaming: ::std::option::Option, - /// Identifies if server streams multiple server messages - pub server_streaming: ::std::option::Option, + 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, + /// 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, + /// 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 MethodDescriptorProto { - pub fn has_name(&self) -> bool { - self.name.is_some() + impl MessageOptions { + pub fn has_message_set_wire_format(&self) -> bool { + self.message_set_wire_format.is_some() } - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = Some(v); + pub fn set_message_set_wire_format(&mut self, v: bool) { + self.message_set_wire_format = Some(v); } - pub fn take_name(&mut self) -> ::std::string::String { - self.name.take().unwrap_or_default() + pub fn get_message_set_wire_format(&self) -> bool { + self.message_set_wire_format.unwrap_or(false) } - pub fn get_name(&self) -> &str { - self.name.as_deref().unwrap_or("") + pub fn has_no_standard_descriptor_accessor(&self) -> bool { + self.no_standard_descriptor_accessor.is_some() } - pub fn has_input_type(&self) -> bool { - self.input_type.is_some() + pub fn set_no_standard_descriptor_accessor(&mut self, v: bool) { + self.no_standard_descriptor_accessor = Some(v); } - pub fn set_input_type(&mut self, v: ::std::string::String) { - self.input_type = Some(v); + pub fn get_no_standard_descriptor_accessor(&self) -> bool { + self.no_standard_descriptor_accessor.unwrap_or(false) } - pub fn take_input_type(&mut self) -> ::std::string::String { - self.input_type.take().unwrap_or_default() + pub fn has_deprecated(&self) -> bool { + self.deprecated.is_some() } - pub fn get_input_type(&self) -> &str { - self.input_type.as_deref().unwrap_or("") + pub fn set_deprecated(&mut self, v: bool) { + self.deprecated = Some(v); } - pub fn has_output_type(&self) -> bool { - self.output_type.is_some() + pub fn get_deprecated(&self) -> bool { + self.deprecated.unwrap_or(false) } - pub fn set_output_type(&mut self, v: ::std::string::String) { - self.output_type = Some(v); + pub fn has_map_entry(&self) -> bool { + self.map_entry.is_some() } - pub fn take_output_type(&mut self) -> ::std::string::String { - self.output_type.take().unwrap_or_default() + pub fn set_map_entry(&mut self, v: bool) { + self.map_entry = Some(v); } - pub fn get_output_type(&self) -> &str { - self.output_type.as_deref().unwrap_or("") + pub fn get_map_entry(&self) -> bool { + self.map_entry.unwrap_or(false) } - pub fn has_options(&self) -> bool { - self.options.is_some() + pub fn has_deprecated_legacy_json_field_conflicts(&self) -> bool { + self.deprecated_legacy_json_field_conflicts.is_some() } - pub fn set_options(&mut self, v: MethodOptions) { - self.options = 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_options(&mut self) -> MethodOptions { - self.options.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_options(&self) -> &MethodOptions { - self.options.as_ref().unwrap_or(&MethodOptions_default) + pub fn has_features(&self) -> bool { + self.features.is_some() } - pub fn has_client_streaming(&self) -> bool { - self.client_streaming.is_some() + pub fn set_features(&mut self, v: FeatureSet) { + self.features = Some(v); } - pub fn set_client_streaming(&mut self, v: bool) { - self.client_streaming = Some(v); + pub fn take_features(&mut self) -> FeatureSet { + self.features.take().unwrap_or_default() } - pub fn get_client_streaming(&self) -> bool { - self.client_streaming.unwrap_or(false) + pub fn get_features(&self) -> &FeatureSet { + self.features.as_ref().unwrap_or(&FeatureSet_default) } - pub fn has_server_streaming(&self) -> bool { - self.server_streaming.is_some() + pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { + self.uninterpreted_option = v; } - pub fn set_server_streaming(&mut self, v: bool) { - self.server_streaming = Some(v); + pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.uninterpreted_option) } - pub fn get_server_streaming(&self) -> bool { - self.server_streaming.unwrap_or(false) + 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 MethodDescriptorProto { + impl ::std::default::Default for MessageOptions { fn default() -> Self { - MethodDescriptorProto { - name: ::std::default::Default::default(), - input_type: ::std::default::Default::default(), - output_type: ::std::default::Default::default(), - options: ::std::default::Default::default(), - client_streaming: ::std::option::Option::Some(false), - server_streaming: ::std::option::Option::Some(false), + MessageOptions { + message_set_wire_format: ::std::option::Option::Some(false), + no_standard_descriptor_accessor: ::std::option::Option::Some(false), + deprecated: ::std::option::Option::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 MethodDescriptorProto_default: MethodDescriptorProto = MethodDescriptorProto::default(); + pub static ref MessageOptions_default: MessageOptions = MessageOptions::default(); } - impl ::pb_jelly::Message for MethodDescriptorProto { + impl ::pb_jelly::Message for MessageOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "MethodDescriptorProto", - full_name: "google.protobuf.MethodDescriptorProto", + name: "MessageOptions", + full_name: "google.protobuf.MessageOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.MethodDescriptorProto.name", + name: "message_set_wire_format", + full_name: "google.protobuf.MessageOptions.message_set_wire_format", 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: "input_type", - full_name: "google.protobuf.MethodDescriptorProto.input_type", + 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: "output_type", - full_name: "google.protobuf.MethodDescriptorProto.output_type", + name: "deprecated", + full_name: "google.protobuf.MessageOptions.deprecated", index: 2, number: 3, - 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: "options", - full_name: "google.protobuf.MethodDescriptorProto.options", + name: "map_entry", + full_name: "google.protobuf.MessageOptions.map_entry", index: 3, - number: 4, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 7, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "client_streaming", - full_name: "google.protobuf.MethodDescriptorProto.client_streaming", + name: "deprecated_legacy_json_field_conflicts", + full_name: "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts", index: 4, - number: 5, + number: 11, typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "server_streaming", - full_name: "google.protobuf.MethodDescriptorProto.server_streaming", + name: "features", + full_name: "google.protobuf.MessageOptions.features", index: 5, - number: 6, - typ: ::pb_jelly::wire_format::Type::Varint, + 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: &[ ], @@ -4650,345 +7684,262 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.name { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.message_set_wire_format { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.input_type { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.no_standard_descriptor_accessor { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.output_type { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.options { - size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.map_entry { + size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.client_streaming { - size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { + size += ::pb_jelly::helpers::compute_size_field::(val, 11, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.server_streaming { - size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 12, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.uninterpreted_option { + size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); } + size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.message_set_wire_format { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.input_type { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.no_standard_descriptor_accessor { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.deprecated { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.output_type { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.map_entry { + ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.options { - ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { + ::pb_jelly::helpers::serialize_field::(w, val, 11, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.client_streaming { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 12, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.server_streaming { - ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + for val in &self.uninterpreted_option { + ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; } + 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, "MethodDescriptorProto", 1)?; - self.name = 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, "MethodDescriptorProto", 2)?; - self.input_type = 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_length_delimited::(buf, typ, "MethodDescriptorProto", 3)?; - self.output_type = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 3)?; + self.deprecated = Some(val); } - 4 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodDescriptorProto", 4)?; - self.options = 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); } - 5 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodDescriptorProto", 5)?; - self.client_streaming = 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); } - 6 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MethodDescriptorProto", 6)?; - self.server_streaming = 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 MethodDescriptorProto { - 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 { - "name" => { - ::pb_jelly::reflection::FieldMut::Value(self.name.get_or_insert_with(::std::default::Default::default)) - } - "input_type" => { - ::pb_jelly::reflection::FieldMut::Value(self.input_type.get_or_insert_with(::std::default::Default::default)) - } - "output_type" => { - ::pb_jelly::reflection::FieldMut::Value(self.output_type.get_or_insert_with(::std::default::Default::default)) - } - "options" => { - ::pb_jelly::reflection::FieldMut::Value(self.options.get_or_insert_with(::std::default::Default::default)) - } - "client_streaming" => { - ::pb_jelly::reflection::FieldMut::Value(self.client_streaming.get_or_insert_with(::std::default::Default::default)) - } - "server_streaming" => { - ::pb_jelly::reflection::FieldMut::Value(self.server_streaming.get_or_insert_with(::std::default::Default::default)) - } - _ => { - panic!("unknown field name given") - } - } - } - } - - // =================================================================== - // Options - - // Each of the definitions above may have "options" attached. These are - // just annotations which may cause code to be generated slightly differently - // or may contain hints for code that manipulates protocol messages. - - // Clients may define custom options as extensions of the *Options messages. - // These extensions may not yet be known at parsing time, so the parser cannot - // store the values in them. Instead it stores them in a field in the *Options - // message called uninterpreted_option. This field must have the same name - // across all *Options messages. We then use this field to populate the - // extensions when we build a descriptor, at which point all protos have been - // parsed and so all extensions are known. - - // Extension numbers for custom options may be chosen as follows: - // * For options which will only be used within a single application or - // organization, or for experimental options, use field numbers 50000 - // through 99999. It is up to you to ensure that you do not use the - // same number for multiple options. - // * For options which will be published and used publicly by multiple - // independent entities, e-mail protobuf-global-extension-registry@google.com - // to reserve extension numbers. Simply provide your project name (e.g. - // Objective-C plugin) and your project website (if available) -- there's no - // need to explain how you intend to use them. Usually you only need one - // extension number. You can declare multiple options with only one extension - // number by putting them in a sub-message. See the Custom Options section of - // the docs for examples: - // https://developers.google.com/protocol-buffers/docs/proto#options - // If this turns out to be popular, a web service will be set up - // to automatically assign option numbers. - - #[derive(Clone, Debug, PartialEq)] - pub struct FileOptions { - /// Sets the Java package where classes generated from this .proto will be - /// placed. By default, the proto package is used, but this is often - /// inappropriate because proto packages do not normally start with backwards - /// domain names. - pub java_package: ::std::option::Option<::std::string::String>, - /// Controls the name of the wrapper Java class generated for the .proto file. - /// That class will always contain the .proto file's getDescriptor() method as - /// well as any top-level extensions defined in the .proto file. - /// If java_multiple_files is disabled, then all the other classes from the - /// .proto file will be nested inside the single wrapper outer class. - pub java_outer_classname: ::std::option::Option<::std::string::String>, - /// If enabled, then the Java code generator will generate a separate .java - /// file for each top-level message, enum, and service defined in the .proto - /// file. Thus, these types will *not* be nested inside the wrapper class - /// named by java_outer_classname. However, the wrapper class will still be - /// generated to contain the file's getDescriptor() method as well as any - /// top-level extensions defined in the file. - pub java_multiple_files: ::std::option::Option, - /// This option does nothing. - pub java_generate_equals_and_hash: ::std::option::Option, - /// If set true, then the Java2 code generator will generate code that - /// throws an exception whenever an attempt is made to assign a non-UTF-8 - /// byte sequence to a string field. - /// Message reflection will do the same. - /// However, an extension field still accepts non-UTF-8 byte sequences. - /// This option has no effect on when used with the lite runtime. - pub java_string_check_utf8: ::std::option::Option, - pub optimize_for: ::std::option::Option, - /// Sets the Go package where structs generated from this .proto will be - /// placed. If omitted, the Go package will be derived from the following: - /// - The basename of the package import path, if provided. - /// - Otherwise, the package statement in the .proto file, if present. - /// - Otherwise, the basename of the .proto file, without extension. - pub go_package: ::std::option::Option<::std::string::String>, - /// Should generic services be generated in each language? "Generic" services - /// are not specific to any particular RPC system. They are generated by the - /// main code generators in each language (without additional plugins). - /// Generic services were the only kind of service generation supported by - /// early versions of google.protobuf. - - /// Generic services are now considered deprecated in favor of using plugins - /// that generate code specific to your particular RPC system. Therefore, - /// these default to false. Old code which depends on generic services should - /// explicitly set them to true. - pub cc_generic_services: ::std::option::Option, - pub java_generic_services: ::std::option::Option, - pub py_generic_services: ::std::option::Option, - pub php_generic_services: ::std::option::Option, - /// Is this file deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for everything in the file, or it will be completely ignored; in the very - /// least, this is a formalization for deprecating files. - pub deprecated: ::std::option::Option, - /// Enables the use of arenas for the proto messages in this file. This applies - /// only to generated classes for C++. - pub cc_enable_arenas: ::std::option::Option, - /// Sets the objective c class prefix which is prepended to all objective c - /// generated classes from this .proto. There is no default. - pub objc_class_prefix: ::std::option::Option<::std::string::String>, - /// Namespace for generated classes; defaults to the package. - pub csharp_namespace: ::std::option::Option<::std::string::String>, - /// By default Swift generators will take the proto package and CamelCase it - /// replacing '.' with underscore and use that to prefix the types/symbols - /// defined. When this options is provided, they will use this value instead - /// to prefix the types/symbols defined. - pub swift_prefix: ::std::option::Option<::std::string::String>, - /// Sets the php class prefix which is prepended to all php generated classes - /// from this .proto. Default is empty. - pub php_class_prefix: ::std::option::Option<::std::string::String>, - /// Use this option to change the namespace of php generated classes. Default - /// is empty. When this option is empty, the package name will be used for - /// determining the namespace. - pub php_namespace: ::std::option::Option<::std::string::String>, - /// Use this option to change the namespace of php generated metadata classes. - /// Default is empty. When this option is empty, the proto file name will be - /// used for determining the namespace. - pub php_metadata_namespace: ::std::option::Option<::std::string::String>, - /// Use this option to change the package of ruby generated classes. Default - /// 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>, - /// The parser stores options it doesn't recognize here. - /// See the documentation for the "Options" section above. - pub uninterpreted_option: ::std::vec::Vec, - pub _extensions: ::pb_jelly::Unrecognized, - } - impl FileOptions { - pub fn has_java_package(&self) -> bool { - self.java_package.is_some() - } - pub fn set_java_package(&mut self, v: ::std::string::String) { - self.java_package = Some(v); - } - pub fn take_java_package(&mut self) -> ::std::string::String { - self.java_package.take().unwrap_or_default() - } - pub fn get_java_package(&self) -> &str { - self.java_package.as_deref().unwrap_or("") - } - pub fn has_java_outer_classname(&self) -> bool { - self.java_outer_classname.is_some() - } - pub fn set_java_outer_classname(&mut self, v: ::std::string::String) { - self.java_outer_classname = Some(v); - } - pub fn take_java_outer_classname(&mut self) -> ::std::string::String { - self.java_outer_classname.take().unwrap_or_default() - } - pub fn get_java_outer_classname(&self) -> &str { - self.java_outer_classname.as_deref().unwrap_or("") - } - pub fn has_java_multiple_files(&self) -> bool { - self.java_multiple_files.is_some() - } - pub fn set_java_multiple_files(&mut self, v: bool) { - self.java_multiple_files = Some(v); - } - pub fn get_java_multiple_files(&self) -> bool { - self.java_multiple_files.unwrap_or(false) - } - pub fn has_java_generate_equals_and_hash(&self) -> bool { - self.java_generate_equals_and_hash.is_some() - } - pub fn set_java_generate_equals_and_hash(&mut self, v: bool) { - self.java_generate_equals_and_hash = Some(v); - } - pub fn get_java_generate_equals_and_hash(&self) -> bool { - self.java_generate_equals_and_hash.unwrap_or(false) - } - pub fn has_java_string_check_utf8(&self) -> bool { - self.java_string_check_utf8.is_some() - } - pub fn set_java_string_check_utf8(&mut self, v: bool) { - self.java_string_check_utf8 = Some(v); - } - pub fn get_java_string_check_utf8(&self) -> bool { - self.java_string_check_utf8.unwrap_or(false) - } - pub fn has_optimize_for(&self) -> bool { - self.optimize_for.is_some() + } + } + } + Ok(()) } - pub fn set_optimize_for(&mut self, v: FileOptions_OptimizeMode) { - self.optimize_for = Some(v); + } + 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"); + } + } } - pub fn get_optimize_for(&self) -> FileOptions_OptimizeMode { - self.optimize_for.unwrap_or_default() + 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") + } + } } - pub fn has_go_package(&self) -> bool { - self.go_package.is_some() + } + impl ::pb_jelly::extensions::Extensible for MessageOptions { + fn _extensions(&self) -> &::pb_jelly::Unrecognized { + &self._extensions } - pub fn set_go_package(&mut self, v: ::std::string::String) { - self.go_package = Some(v); + } + + #[derive(Clone, Debug, PartialEq)] + pub struct FieldOptions { + /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + /// 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. + /// TODO: make ctype actually deprecated. + 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 lazy message fields are still eagerly verified to check + /// ill-formed wireformat or missing required fields. Calling IsInitialized() + /// on the outer message would fail if the inner message has missing required + /// fields. Failed verification would result in parsing failure (except when + /// uninitialized messages are acceptable). + 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, + pub feature_support: ::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 take_go_package(&mut self) -> ::std::string::String { - self.go_package.take().unwrap_or_default() + pub fn set_ctype(&mut self, v: FieldOptions_CType) { + self.ctype = Some(v); } - pub fn get_go_package(&self) -> &str { - self.go_package.as_deref().unwrap_or("") + pub fn get_ctype(&self) -> FieldOptions_CType { + self.ctype.unwrap_or_default() } - pub fn has_cc_generic_services(&self) -> bool { - self.cc_generic_services.is_some() + pub fn has_packed(&self) -> bool { + self.packed.is_some() } - pub fn set_cc_generic_services(&mut self, v: bool) { - self.cc_generic_services = Some(v); + pub fn set_packed(&mut self, v: bool) { + self.packed = Some(v); } - pub fn get_cc_generic_services(&self) -> bool { - self.cc_generic_services.unwrap_or(false) + pub fn get_packed(&self) -> bool { + self.packed.unwrap_or(false) } - pub fn has_java_generic_services(&self) -> bool { - self.java_generic_services.is_some() + pub fn has_jstype(&self) -> bool { + self.jstype.is_some() } - pub fn set_java_generic_services(&mut self, v: bool) { - self.java_generic_services = Some(v); + pub fn set_jstype(&mut self, v: FieldOptions_JSType) { + self.jstype = Some(v); } - pub fn get_java_generic_services(&self) -> bool { - self.java_generic_services.unwrap_or(false) + pub fn get_jstype(&self) -> FieldOptions_JSType { + self.jstype.unwrap_or_default() } - pub fn has_py_generic_services(&self) -> bool { - self.py_generic_services.is_some() + pub fn has_lazy(&self) -> bool { + self.lazy.is_some() } - pub fn set_py_generic_services(&mut self, v: bool) { - self.py_generic_services = Some(v); + pub fn set_lazy(&mut self, v: bool) { + self.lazy = Some(v); } - pub fn get_py_generic_services(&self) -> bool { - self.py_generic_services.unwrap_or(false) + pub fn get_lazy(&self) -> bool { + self.lazy.unwrap_or(false) } - pub fn has_php_generic_services(&self) -> bool { - self.php_generic_services.is_some() + pub fn has_unverified_lazy(&self) -> bool { + self.unverified_lazy.is_some() } - pub fn set_php_generic_services(&mut self, v: bool) { - self.php_generic_services = Some(v); + pub fn set_unverified_lazy(&mut self, v: bool) { + self.unverified_lazy = Some(v); } - pub fn get_php_generic_services(&self) -> bool { - self.php_generic_services.unwrap_or(false) + pub fn get_unverified_lazy(&self) -> bool { + self.unverified_lazy.unwrap_or(false) } pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() @@ -4999,98 +7950,80 @@ pub mod google { 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_weak(&self) -> bool { + self.weak.is_some() } - pub fn has_csharp_namespace(&self) -> bool { - self.csharp_namespace.is_some() + pub fn set_weak(&mut self, v: bool) { + self.weak = Some(v); } - pub fn set_csharp_namespace(&mut self, v: ::std::string::String) { - self.csharp_namespace = Some(v); + pub fn get_weak(&self) -> bool { + self.weak.unwrap_or(false) } - pub fn take_csharp_namespace(&mut self) -> ::std::string::String { - self.csharp_namespace.take().unwrap_or_default() + pub fn has_debug_redact(&self) -> bool { + self.debug_redact.is_some() } - pub fn get_csharp_namespace(&self) -> &str { - self.csharp_namespace.as_deref().unwrap_or("") + pub fn set_debug_redact(&mut self, v: bool) { + self.debug_redact = Some(v); } - pub fn has_swift_prefix(&self) -> bool { - self.swift_prefix.is_some() + pub fn get_debug_redact(&self) -> bool { + self.debug_redact.unwrap_or(false) } - pub fn set_swift_prefix(&mut self, v: ::std::string::String) { - self.swift_prefix = Some(v); + pub fn has_retention(&self) -> bool { + self.retention.is_some() } - pub fn take_swift_prefix(&mut self) -> ::std::string::String { - self.swift_prefix.take().unwrap_or_default() + pub fn set_retention(&mut self, v: FieldOptions_OptionRetention) { + self.retention = Some(v); } - pub fn get_swift_prefix(&self) -> &str { - self.swift_prefix.as_deref().unwrap_or("") + pub fn get_retention(&self) -> FieldOptions_OptionRetention { + self.retention.unwrap_or_default() } - pub fn has_php_class_prefix(&self) -> bool { - self.php_class_prefix.is_some() + pub fn set_targets(&mut self, v: ::std::vec::Vec) { + self.targets = v; } - pub fn set_php_class_prefix(&mut self, v: ::std::string::String) { - self.php_class_prefix = Some(v); + pub fn take_targets(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.targets) } - pub fn take_php_class_prefix(&mut self) -> ::std::string::String { - self.php_class_prefix.take().unwrap_or_default() + pub fn get_targets(&self) -> &[FieldOptions_OptionTargetType] { + &self.targets } - pub fn get_php_class_prefix(&self) -> &str { - self.php_class_prefix.as_deref().unwrap_or("") + pub fn mut_targets(&mut self) -> &mut ::std::vec::Vec { + &mut self.targets } - pub fn has_php_namespace(&self) -> bool { - self.php_namespace.is_some() + pub fn set_edition_defaults(&mut self, v: ::std::vec::Vec) { + self.edition_defaults = v; } - pub fn set_php_namespace(&mut self, v: ::std::string::String) { - self.php_namespace = Some(v); + pub fn take_edition_defaults(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.edition_defaults) } - pub fn take_php_namespace(&mut self) -> ::std::string::String { - self.php_namespace.take().unwrap_or_default() + pub fn get_edition_defaults(&self) -> &[FieldOptions_EditionDefault] { + &self.edition_defaults } - pub fn get_php_namespace(&self) -> &str { - self.php_namespace.as_deref().unwrap_or("") + pub fn mut_edition_defaults(&mut self) -> &mut ::std::vec::Vec { + &mut self.edition_defaults } - pub fn has_php_metadata_namespace(&self) -> bool { - self.php_metadata_namespace.is_some() + pub fn has_features(&self) -> bool { + self.features.is_some() } - pub fn set_php_metadata_namespace(&mut self, v: ::std::string::String) { - self.php_metadata_namespace = Some(v); + pub fn set_features(&mut self, v: FeatureSet) { + self.features = Some(v); } - pub fn take_php_metadata_namespace(&mut self) -> ::std::string::String { - self.php_metadata_namespace.take().unwrap_or_default() + pub fn take_features(&mut self) -> FeatureSet { + self.features.take().unwrap_or_default() } - pub fn get_php_metadata_namespace(&self) -> &str { - self.php_metadata_namespace.as_deref().unwrap_or("") + pub fn get_features(&self) -> &FeatureSet { + self.features.as_ref().unwrap_or(&FeatureSet_default) } - pub fn has_ruby_package(&self) -> bool { - self.ruby_package.is_some() + pub fn has_feature_support(&self) -> bool { + self.feature_support.is_some() } - pub fn set_ruby_package(&mut self, v: ::std::string::String) { - self.ruby_package = Some(v); + pub fn set_feature_support(&mut self, v: FieldOptions_FeatureSupport) { + self.feature_support = Some(v); } - pub fn take_ruby_package(&mut self) -> ::std::string::String { - self.ruby_package.take().unwrap_or_default() + pub fn take_feature_support(&mut self) -> FieldOptions_FeatureSupport { + self.feature_support.take().unwrap_or_default() } - pub fn get_ruby_package(&self) -> &str { - self.ruby_package.as_deref().unwrap_or("") + pub fn get_feature_support(&self) -> &FieldOptions_FeatureSupport { + self.feature_support.as_ref().unwrap_or(&FieldOptions_FeatureSupport_default) } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; @@ -5105,109 +8038,102 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for FileOptions { + impl ::std::default::Default for FieldOptions { fn default() -> Self { - FileOptions { - java_package: ::std::default::Default::default(), - java_outer_classname: ::std::default::Default::default(), - java_multiple_files: ::std::option::Option::Some(false), - java_generate_equals_and_hash: ::std::default::Default::default(), - java_string_check_utf8: ::std::option::Option::Some(false), - optimize_for: ::std::option::Option::Some(FileOptions_OptimizeMode::SPEED), - go_package: ::std::default::Default::default(), - cc_generic_services: ::std::option::Option::Some(false), - java_generic_services: ::std::option::Option::Some(false), - py_generic_services: ::std::option::Option::Some(false), - php_generic_services: ::std::option::Option::Some(false), + FieldOptions { + ctype: ::std::option::Option::Some(FieldOptions_CType::STRING), + packed: ::std::default::Default::default(), + jstype: ::std::option::Option::Some(FieldOptions_JSType::JS_NORMAL), + lazy: ::std::option::Option::Some(false), + unverified_lazy: ::std::option::Option::Some(false), deprecated: ::std::option::Option::Some(false), - cc_enable_arenas: ::std::option::Option::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(), + weak: ::std::option::Option::Some(false), + debug_redact: ::std::option::Option::Some(false), + retention: ::std::default::Default::default(), + targets: ::std::default::Default::default(), + edition_defaults: ::std::default::Default::default(), + features: ::std::default::Default::default(), + feature_support: ::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(); + pub static ref FieldOptions_default: FieldOptions = FieldOptions::default(); } - impl ::pb_jelly::Message for FileOptions { + impl ::pb_jelly::Message for FieldOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FileOptions", - full_name: "google.protobuf.FileOptions", + name: "FieldOptions", + full_name: "google.protobuf.FieldOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "java_package", - full_name: "google.protobuf.FileOptions.java_package", + name: "ctype", + full_name: "google.protobuf.FieldOptions.ctype", 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: "java_outer_classname", - full_name: "google.protobuf.FileOptions.java_outer_classname", + name: "packed", + full_name: "google.protobuf.FieldOptions.packed", index: 1, - number: 8, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 2, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "java_multiple_files", - full_name: "google.protobuf.FileOptions.java_multiple_files", + name: "jstype", + full_name: "google.protobuf.FieldOptions.jstype", index: 2, - number: 10, + number: 6, 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", + name: "lazy", + full_name: "google.protobuf.FieldOptions.lazy", index: 3, - number: 20, + number: 5, 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", + name: "unverified_lazy", + full_name: "google.protobuf.FieldOptions.unverified_lazy", index: 4, - number: 27, + number: 15, 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", + name: "deprecated", + full_name: "google.protobuf.FieldOptions.deprecated", index: 5, - number: 9, + number: 3, 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", + name: "weak", + full_name: "google.protobuf.FieldOptions.weak", index: 6, - number: 11, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + number: 10, + typ: ::pb_jelly::wire_format::Type::Varint, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "cc_generic_services", - full_name: "google.protobuf.FileOptions.cc_generic_services", + name: "debug_redact", + full_name: "google.protobuf.FieldOptions.debug_redact", index: 7, number: 16, typ: ::pb_jelly::wire_format::Type::Varint, @@ -5215,8 +8141,8 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "java_generic_services", - full_name: "google.protobuf.FileOptions.java_generic_services", + name: "retention", + full_name: "google.protobuf.FieldOptions.retention", index: 8, number: 17, typ: ::pb_jelly::wire_format::Type::Varint, @@ -5224,113 +8150,525 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "py_generic_services", - full_name: "google.protobuf.FileOptions.py_generic_services", + name: "targets", + full_name: "google.protobuf.FieldOptions.targets", index: 9, - number: 18, + number: 19, typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "php_generic_services", - full_name: "google.protobuf.FileOptions.php_generic_services", + name: "edition_defaults", + full_name: "google.protobuf.FieldOptions.edition_defaults", index: 10, - number: 42, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Optional, + number: 20, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.FileOptions.deprecated", + name: "features", + full_name: "google.protobuf.FieldOptions.features", index: 11, - number: 23, - typ: ::pb_jelly::wire_format::Type::Varint, + number: 21, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "cc_enable_arenas", - full_name: "google.protobuf.FileOptions.cc_enable_arenas", + name: "feature_support", + full_name: "google.protobuf.FieldOptions.feature_support", index: 12, - number: 31, - typ: ::pb_jelly::wire_format::Type::Varint, + number: 22, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "objc_class_prefix", - full_name: "google.protobuf.FileOptions.objc_class_prefix", + name: "uninterpreted_option", + full_name: "google.protobuf.FieldOptions.uninterpreted_option", index: 13, - number: 36, + number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Optional, + label: ::pb_jelly::Label::Repeated, oneof_index: None, }, + ], + oneofs: &[ + ], + }) + } + fn compute_size(&self) -> usize { + let mut size = 0usize; + if let Some(ref val) = self.ctype { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.packed { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.jstype { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.lazy { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.unverified_lazy { + size += ::pb_jelly::helpers::compute_size_field::(val, 15, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.weak { + size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.debug_redact { + size += ::pb_jelly::helpers::compute_size_field::(val, 16, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.retention { + size += ::pb_jelly::helpers::compute_size_field::(val, 17, ::pb_jelly::wire_format::Type::Varint); + } + for val in &self.targets { + size += ::pb_jelly::helpers::compute_size_field::(val, 19, ::pb_jelly::wire_format::Type::Varint); + } + for val in &self.edition_defaults { + size += ::pb_jelly::helpers::compute_size_field::(val, 20, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 21, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.feature_support { + size += ::pb_jelly::helpers::compute_size_field::(val, 22, ::pb_jelly::wire_format::Type::LengthDelimited); + } + for val in &self.uninterpreted_option { + size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size += self._extensions.compute_size(); + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.ctype { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.packed { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.deprecated { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.lazy { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.jstype { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.weak { + ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.unverified_lazy { + ::pb_jelly::helpers::serialize_field::(w, val, 15, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.debug_redact { + ::pb_jelly::helpers::serialize_field::(w, val, 16, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.retention { + ::pb_jelly::helpers::serialize_field::(w, val, 17, ::pb_jelly::wire_format::Type::Varint)?; + } + for val in &self.targets { + ::pb_jelly::helpers::serialize_field::(w, val, 19, ::pb_jelly::wire_format::Type::Varint)?; + } + for val in &self.edition_defaults { + ::pb_jelly::helpers::serialize_field::(w, val, 20, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 21, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.feature_support { + ::pb_jelly::helpers::serialize_field::(w, val, 22, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + for val in &self.uninterpreted_option { + ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + 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); + } + 22 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 22)?; + self.feature_support = 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)) + } + "feature_support" => { + ::pb_jelly::reflection::FieldMut::Value(self.feature_support.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: "csharp_namespace", - full_name: "google.protobuf.FileOptions.csharp_namespace", - index: 14, - number: 37, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, + 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: "swift_prefix", - full_name: "google.protobuf.FileOptions.swift_prefix", - index: 15, - number: 39, + 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 = 0usize; + if let Some(ref val) = self.edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.value { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); + } + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.value { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.edition { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + } + 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") + } + } + } + } + + /// Information about the support window of a feature. + #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + pub struct FieldOptions_FeatureSupport { + /// The edition that this feature was first available in. In editions + /// earlier than this one, the default assigned to EDITION_LEGACY will be + /// used, and proto files will not be able to override it. + pub edition_introduced: ::std::option::Option, + /// The edition this feature becomes deprecated in. Using this after this + /// edition may trigger warnings. + pub edition_deprecated: ::std::option::Option, + /// The deprecation warning text if this feature is used after the edition it + /// was marked deprecated in. + pub deprecation_warning: ::std::option::Option<::std::string::String>, + /// The edition this feature is no longer available in. In editions after + /// this one, the last default assigned will be used, and proto files will + /// not be able to override it. + pub edition_removed: ::std::option::Option, + } + impl FieldOptions_FeatureSupport { + pub fn has_edition_introduced(&self) -> bool { + self.edition_introduced.is_some() + } + pub fn set_edition_introduced(&mut self, v: Edition) { + self.edition_introduced = Some(v); + } + pub fn get_edition_introduced(&self) -> Edition { + self.edition_introduced.unwrap_or_default() + } + pub fn has_edition_deprecated(&self) -> bool { + self.edition_deprecated.is_some() + } + pub fn set_edition_deprecated(&mut self, v: Edition) { + self.edition_deprecated = Some(v); + } + pub fn get_edition_deprecated(&self) -> Edition { + self.edition_deprecated.unwrap_or_default() + } + pub fn has_deprecation_warning(&self) -> bool { + self.deprecation_warning.is_some() + } + pub fn set_deprecation_warning(&mut self, v: ::std::string::String) { + self.deprecation_warning = Some(v); + } + pub fn take_deprecation_warning(&mut self) -> ::std::string::String { + self.deprecation_warning.take().unwrap_or_default() + } + pub fn get_deprecation_warning(&self) -> &str { + self.deprecation_warning.as_deref().unwrap_or("") + } + pub fn has_edition_removed(&self) -> bool { + self.edition_removed.is_some() + } + pub fn set_edition_removed(&mut self, v: Edition) { + self.edition_removed = Some(v); + } + pub fn get_edition_removed(&self) -> Edition { + self.edition_removed.unwrap_or_default() + } + } + impl ::std::default::Default for FieldOptions_FeatureSupport { + fn default() -> Self { + FieldOptions_FeatureSupport { + edition_introduced: ::std::default::Default::default(), + edition_deprecated: ::std::default::Default::default(), + deprecation_warning: ::std::default::Default::default(), + edition_removed: ::std::default::Default::default(), + } + } + } + ::lazy_static::lazy_static! { + pub static ref FieldOptions_FeatureSupport_default: FieldOptions_FeatureSupport = FieldOptions_FeatureSupport::default(); + } + impl ::pb_jelly::Message for FieldOptions_FeatureSupport { + fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { + Some(::pb_jelly::MessageDescriptor { + name: "FieldOptions_FeatureSupport", + full_name: "google.protobuf.FieldOptions_FeatureSupport", + fields: &[ ::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, + name: "edition_introduced", + full_name: "google.protobuf.FieldOptions_FeatureSupport.edition_introduced", + index: 0, + number: 1, + typ: ::pb_jelly::wire_format::Type::Varint, 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, + name: "edition_deprecated", + full_name: "google.protobuf.FieldOptions_FeatureSupport.edition_deprecated", + index: 1, + number: 2, + typ: ::pb_jelly::wire_format::Type::Varint, 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, + name: "deprecation_warning", + full_name: "google.protobuf.FieldOptions_FeatureSupport.deprecation_warning", + index: 2, + number: 3, 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, + name: "edition_removed", + full_name: "google.protobuf.FieldOptions_FeatureSupport.edition_removed", + index: 3, + number: 4, + 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.FileOptions.uninterpreted_option", - index: 20, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, - oneof_index: None, - }, ], oneofs: &[ ], @@ -5338,65 +8676,170 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.java_package { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.java_outer_classname { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.java_multiple_files { - size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.java_generate_equals_and_hash { - size += ::pb_jelly::helpers::compute_size_field::(val, 20, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.java_string_check_utf8 { - size += ::pb_jelly::helpers::compute_size_field::(val, 27, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.edition_introduced { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.optimize_for { - size += ::pb_jelly::helpers::compute_size_field::(val, 9, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.go_package { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 11, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.cc_generic_services { - size += ::pb_jelly::helpers::compute_size_field::(val, 16, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.edition_deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.java_generic_services { - size += ::pb_jelly::helpers::compute_size_field::(val, 17, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.py_generic_services { - size += ::pb_jelly::helpers::compute_size_field::(val, 18, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.deprecation_warning { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); } - if let Some(ref val) = self.php_generic_services { - size += ::pb_jelly::helpers::compute_size_field::(val, 42, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.edition_removed { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.deprecated { - size += ::pb_jelly::helpers::compute_size_field::(val, 23, ::pb_jelly::wire_format::Type::Varint); + size + } + fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.edition_introduced { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.cc_enable_arenas { - size += ::pb_jelly::helpers::compute_size_field::(val, 31, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.edition_deprecated { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.objc_class_prefix { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 36, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.deprecation_warning { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.csharp_namespace { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 37, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.edition_removed { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.swift_prefix { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 39, ::pb_jelly::wire_format::Type::LengthDelimited); + 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_FeatureSupport", 1)?; + self.edition_introduced = Some(val); + } + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions_FeatureSupport", 2)?; + self.edition_deprecated = Some(val); + } + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions_FeatureSupport", 3)?; + self.deprecation_warning = Some(val); + } + 4 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FieldOptions_FeatureSupport", 4)?; + self.edition_removed = Some(val); + } + _ => { + ::pb_jelly::skip(typ, &mut buf)?; + } + } } - if let Some(ref val) = self.php_class_prefix { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 40, ::pb_jelly::wire_format::Type::LengthDelimited); + Ok(()) + } + } + impl ::pb_jelly::Reflection for FieldOptions_FeatureSupport { + 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.php_namespace { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 41, ::pb_jelly::wire_format::Type::LengthDelimited); + } + fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { + match field_name { + "edition_introduced" => { + ::pb_jelly::reflection::FieldMut::Value(self.edition_introduced.get_or_insert_with(::std::default::Default::default)) + } + "edition_deprecated" => { + ::pb_jelly::reflection::FieldMut::Value(self.edition_deprecated.get_or_insert_with(::std::default::Default::default)) + } + "deprecation_warning" => { + ::pb_jelly::reflection::FieldMut::Value(self.deprecation_warning.get_or_insert_with(::std::default::Default::default)) + } + "edition_removed" => { + ::pb_jelly::reflection::FieldMut::Value(self.edition_removed.get_or_insert_with(::std::default::Default::default)) + } + _ => { + panic!("unknown field name given") + } } - if let Some(ref val) = self.php_metadata_namespace { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 44, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + + #[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(), } - if let Some(ref val) = self.ruby_package { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 45, ::pb_jelly::wire_format::Type::LengthDelimited); + } + } + ::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 = 0usize; + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); @@ -5405,65 +8848,8 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.java_package { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.java_outer_classname { - ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.optimize_for { - ::pb_jelly::helpers::serialize_field::(w, val, 9, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.java_multiple_files { - ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.go_package { - ::pb_jelly::helpers::serialize_field::(w, val, 11, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.cc_generic_services { - ::pb_jelly::helpers::serialize_field::(w, val, 16, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.java_generic_services { - ::pb_jelly::helpers::serialize_field::(w, val, 17, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.py_generic_services { - ::pb_jelly::helpers::serialize_field::(w, val, 18, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.java_generate_equals_and_hash { - ::pb_jelly::helpers::serialize_field::(w, val, 20, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 23, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.java_string_check_utf8 { - ::pb_jelly::helpers::serialize_field::(w, val, 27, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.cc_enable_arenas { - ::pb_jelly::helpers::serialize_field::(w, val, 31, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.objc_class_prefix { - ::pb_jelly::helpers::serialize_field::(w, val, 36, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.csharp_namespace { - ::pb_jelly::helpers::serialize_field::(w, val, 37, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.swift_prefix { - ::pb_jelly::helpers::serialize_field::(w, val, 39, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.php_class_prefix { - ::pb_jelly::helpers::serialize_field::(w, val, 40, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.php_namespace { - ::pb_jelly::helpers::serialize_field::(w, val, 41, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.php_generic_services { - ::pb_jelly::helpers::serialize_field::(w, val, 42, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.php_metadata_namespace { - ::pb_jelly::helpers::serialize_field::(w, val, 44, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.ruby_package { - ::pb_jelly::helpers::serialize_field::(w, val, 45, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; @@ -5475,87 +8861,11 @@ 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, "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); + 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, "FileOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "OneofOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -5569,7 +8879,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FileOptions { + impl ::pb_jelly::Reflection for OneofOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -5579,65 +8889,8 @@ pub mod google { } 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.") @@ -5648,86 +8901,44 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for FileOptions { + impl ::pb_jelly::extensions::Extensible for OneofOptions { 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? + #[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 message, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating messages. + /// 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, - /// 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, + /// 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 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() + impl EnumOptions { + pub fn has_allow_alias(&self) -> bool { + self.allow_alias.is_some() } - pub fn set_no_standard_descriptor_accessor(&mut self, v: bool) { - self.no_standard_descriptor_accessor = Some(v); + pub fn set_allow_alias(&mut self, v: bool) { + self.allow_alias = Some(v); } - pub fn get_no_standard_descriptor_accessor(&self) -> bool { - self.no_standard_descriptor_accessor.unwrap_or(false) + pub fn get_allow_alias(&self) -> bool { + self.allow_alias.unwrap_or(false) } pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() @@ -5738,14 +8949,26 @@ pub mod google { 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 has_deprecated_legacy_json_field_conflicts(&self) -> bool { + self.deprecated_legacy_json_field_conflicts.is_some() } - pub fn set_map_entry(&mut self, v: bool) { - self.map_entry = Some(v); + pub fn set_deprecated_legacy_json_field_conflicts(&mut self, v: bool) { + self.deprecated_legacy_json_field_conflicts = Some(v); } - pub fn get_map_entry(&self) -> bool { - self.map_entry.unwrap_or(false) + 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; @@ -5760,66 +8983,66 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for MessageOptions { + impl ::std::default::Default for EnumOptions { fn default() -> Self { - MessageOptions { - message_set_wire_format: ::std::option::Option::Some(false), - no_standard_descriptor_accessor: ::std::option::Option::Some(false), + EnumOptions { + allow_alias: ::std::default::Default::default(), deprecated: ::std::option::Option::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(); + pub static ref EnumOptions_default: EnumOptions = EnumOptions::default(); } - impl ::pb_jelly::Message for MessageOptions { + impl ::pb_jelly::Message for EnumOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "MessageOptions", - full_name: "google.protobuf.MessageOptions", + name: "EnumOptions", + full_name: "google.protobuf.EnumOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "message_set_wire_format", - full_name: "google.protobuf.MessageOptions.message_set_wire_format", + name: "allow_alias", + full_name: "google.protobuf.EnumOptions.allow_alias", index: 0, - number: 1, + number: 2, 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", + name: "deprecated", + full_name: "google.protobuf.EnumOptions.deprecated", index: 1, - number: 2, + number: 3, 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", + name: "deprecated_legacy_json_field_conflicts", + full_name: "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts", index: 2, - number: 3, + number: 6, 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", + name: "features", + full_name: "google.protobuf.EnumOptions.features", index: 3, number: 7, - typ: ::pb_jelly::wire_format::Type::Varint, + 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", + full_name: "google.protobuf.EnumOptions.uninterpreted_option", index: 4, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, @@ -5833,17 +9056,17 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.message_set_wire_format { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.no_standard_descriptor_accessor { + if let Some(ref val) = self.allow_alias { size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } if let Some(ref val) = self.deprecated { size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.map_entry { - size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); } for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); @@ -5852,17 +9075,17 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.message_set_wire_format { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.no_standard_descriptor_accessor { + if let Some(ref val) = self.allow_alias { ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; } if let Some(ref val) = self.deprecated { ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.map_entry { - ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.deprecated_legacy_json_field_conflicts { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; @@ -5873,24 +9096,24 @@ 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, "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); + 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, "MessageOptions", 3)?; + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 3)?; 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); + } 7 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "MessageOptions", 7)?; - self.map_entry = Some(val); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumOptions", 7)?; + self.features = Some(val); } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MessageOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -5904,7 +9127,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for MessageOptions { + impl ::pb_jelly::Reflection for EnumOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -5914,135 +9137,53 @@ 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)) + "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)) } - "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 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. - - /// 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 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 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); + _ => { + panic!("unknown field name given") + } + } } - pub fn get_lazy(&self) -> bool { - self.lazy.unwrap_or(false) + } + 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, + /// 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, + /// Information about the support window of a feature value. + pub feature_support: ::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() } @@ -6052,14 +9193,38 @@ 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 has_features(&self) -> bool { + self.features.is_some() } - pub fn set_weak(&mut self, v: bool) { - self.weak = Some(v); + pub fn set_features(&mut self, v: FeatureSet) { + self.features = Some(v); } - pub fn get_weak(&self) -> bool { - self.weak.unwrap_or(false) + 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 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_feature_support(&self) -> bool { + self.feature_support.is_some() + } + pub fn set_feature_support(&mut self, v: FieldOptions_FeatureSupport) { + self.feature_support = Some(v); + } + pub fn take_feature_support(&mut self) -> FieldOptions_FeatureSupport { + self.feature_support.take().unwrap_or_default() + } + pub fn get_feature_support(&self) -> &FieldOptions_FeatureSupport { + self.feature_support.as_ref().unwrap_or(&FieldOptions_FeatureSupport_default) } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; @@ -6074,32 +9239,30 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for FieldOptions { + impl ::std::default::Default for EnumValueOptions { fn default() -> Self { - FieldOptions { - ctype: ::std::option::Option::Some(FieldOptions_CType::STRING), - packed: ::std::default::Default::default(), - jstype: ::std::option::Option::Some(FieldOptions_JSType::JS_NORMAL), - lazy: ::std::option::Option::Some(false), + EnumValueOptions { deprecated: ::std::option::Option::Some(false), - weak: ::std::option::Option::Some(false), + features: ::std::default::Default::default(), + debug_redact: ::std::option::Option::Some(false), + feature_support: ::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(); + pub static ref EnumValueOptions_default: EnumValueOptions = EnumValueOptions::default(); } - impl ::pb_jelly::Message for FieldOptions { + impl ::pb_jelly::Message for EnumValueOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "FieldOptions", - full_name: "google.protobuf.FieldOptions", + name: "EnumValueOptions", + full_name: "google.protobuf.EnumValueOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "ctype", - full_name: "google.protobuf.FieldOptions.ctype", + name: "deprecated", + full_name: "google.protobuf.EnumValueOptions.deprecated", index: 0, number: 1, typ: ::pb_jelly::wire_format::Type::Varint, @@ -6107,54 +9270,36 @@ pub mod google { oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "packed", - full_name: "google.protobuf.FieldOptions.packed", + name: "features", + full_name: "google.protobuf.EnumValueOptions.features", index: 1, number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Optional, oneof_index: None, }, ::pb_jelly::FieldDescriptor { - name: "jstype", - full_name: "google.protobuf.FieldOptions.jstype", + name: "debug_redact", + full_name: "google.protobuf.EnumValueOptions.debug_redact", 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, + name: "feature_support", + full_name: "google.protobuf.EnumValueOptions.feature_support", + index: 3, + number: 4, + 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: 6, + full_name: "google.protobuf.EnumValueOptions.uninterpreted_option", + index: 4, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -6167,23 +9312,17 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.ctype { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.packed { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.jstype { - size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.lazy { - size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); } - if let Some(ref val) = self.deprecated { + if let Some(ref val) = self.debug_redact { size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.weak { - size += ::pb_jelly::helpers::compute_size_field::(val, 10, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.feature_support { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); } for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); @@ -6192,23 +9331,17 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.ctype { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.packed { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; - } if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.lazy { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.jstype { - ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.debug_redact { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.weak { - ::pb_jelly::helpers::serialize_field::(w, val, 10, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.feature_support { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; @@ -6220,31 +9353,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, "FieldOptions", 1)?; - self.ctype = Some(val); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueOptions", 1)?; + self.deprecated = 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); + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 2)?; + self.features = 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); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumValueOptions", 3)?; + self.debug_redact = 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); + 4 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 4)?; + self.feature_support = Some(val); } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FieldOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -6258,7 +9383,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for FieldOptions { + impl ::pb_jelly::Reflection for EnumValueOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -6268,23 +9393,17 @@ pub mod google { } 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)) - } "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)) + "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)) + } + "feature_support" => { + ::pb_jelly::reflection::FieldMut::Value(self.feature_support.get_or_insert_with(::std::default::Default::default)) } "uninterpreted_option" => { unimplemented!("Repeated fields are not currently supported.") @@ -6295,19 +9414,52 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for FieldOptions { + impl ::pb_jelly::extensions::Extensible for EnumValueOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } #[derive(Clone, Debug, PartialEq)] - pub struct OneofOptions { + 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. + + /// 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 OneofOptions { + impl ServiceOptions { + 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_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; } @@ -6321,27 +9473,47 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for OneofOptions { + impl ::std::default::Default for ServiceOptions { fn default() -> Self { - OneofOptions { + ServiceOptions { + features: ::std::default::Default::default(), + deprecated: ::std::option::Option::Some(false), uninterpreted_option: ::std::default::Default::default(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref OneofOptions_default: OneofOptions = OneofOptions::default(); + pub static ref ServiceOptions_default: ServiceOptions = ServiceOptions::default(); } - impl ::pb_jelly::Message for OneofOptions { + impl ::pb_jelly::Message for ServiceOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "OneofOptions", - full_name: "google.protobuf.OneofOptions", + name: "ServiceOptions", + full_name: "google.protobuf.ServiceOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.OneofOptions.uninterpreted_option", + name: "features", + full_name: "google.protobuf.ServiceOptions.features", index: 0, + number: 34, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "deprecated", + full_name: "google.protobuf.ServiceOptions.deprecated", + index: 1, + number: 33, + 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", + index: 2, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -6354,6 +9526,12 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 34, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.deprecated { + size += ::pb_jelly::helpers::compute_size_field::(val, 33, ::pb_jelly::wire_format::Type::Varint); + } for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); } @@ -6361,6 +9539,12 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { + if let Some(ref val) = self.deprecated { + ::pb_jelly::helpers::serialize_field::(w, val, 33, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 34, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; } @@ -6370,8 +9554,16 @@ 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); + } + 33 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ServiceOptions", 33)?; + self.deprecated = Some(val); + } 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "OneofOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -6385,7 +9577,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for OneofOptions { + impl ::pb_jelly::Reflection for ServiceOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -6395,6 +9587,12 @@ 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)) + } + "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.") } @@ -6404,36 +9602,32 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for OneofOptions { + impl ::pb_jelly::extensions::Extensible for ServiceOptions { fn _extensions(&self) -> &::pb_jelly::Unrecognized { &self._extensions } } - #[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? + #[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 enum, or it will be completely ignored; in the very least, this - /// is a formalization for deprecating enums. + /// 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, /// 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_allow_alias(&mut self, v: bool) { - self.allow_alias = Some(v); - } - pub fn get_allow_alias(&self) -> bool { - self.allow_alias.unwrap_or(false) - } + impl MethodOptions { pub fn has_deprecated(&self) -> bool { self.deprecated.is_some() } @@ -6443,6 +9637,27 @@ pub mod google { 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) + } pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { self.uninterpreted_option = v; } @@ -6456,47 +9671,57 @@ pub mod google { &mut self.uninterpreted_option } } - impl ::std::default::Default for EnumOptions { + impl ::std::default::Default for MethodOptions { fn default() -> Self { - EnumOptions { - allow_alias: ::std::default::Default::default(), + MethodOptions { deprecated: ::std::option::Option::Some(false), + idempotency_level: ::std::option::Option::Some(MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN), + features: ::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 MethodOptions_default: MethodOptions = MethodOptions::default(); } - impl ::pb_jelly::Message for EnumOptions { + impl ::pb_jelly::Message for MethodOptions { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "EnumOptions", - full_name: "google.protobuf.EnumOptions", + name: "MethodOptions", + full_name: "google.protobuf.MethodOptions", fields: &[ ::pb_jelly::FieldDescriptor { - name: "allow_alias", - full_name: "google.protobuf.EnumOptions.allow_alias", + name: "deprecated", + full_name: "google.protobuf.MethodOptions.deprecated", index: 0, - number: 2, + number: 33, 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", + name: "idempotency_level", + full_name: "google.protobuf.MethodOptions.idempotency_level", index: 1, - number: 3, + number: 34, 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.EnumOptions.uninterpreted_option", + 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, number: 999, typ: ::pb_jelly::wire_format::Type::LengthDelimited, label: ::pb_jelly::Label::Repeated, @@ -6509,11 +9734,14 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.allow_alias { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); - } if let Some(ref val) = self.deprecated { - size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + size += ::pb_jelly::helpers::compute_size_field::(val, 33, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.idempotency_level { + size += ::pb_jelly::helpers::compute_size_field::(val, 34, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.features { + size += ::pb_jelly::helpers::compute_size_field::(val, 35, ::pb_jelly::wire_format::Type::LengthDelimited); } for val in &self.uninterpreted_option { size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); @@ -6522,11 +9750,14 @@ pub mod google { size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.allow_alias { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; - } if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + ::pb_jelly::helpers::serialize_field::(w, val, 33, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.idempotency_level { + ::pb_jelly::helpers::serialize_field::(w, val, 34, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.features { + ::pb_jelly::helpers::serialize_field::(w, val, 35, ::pb_jelly::wire_format::Type::LengthDelimited)?; } for val in &self.uninterpreted_option { ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; @@ -6537,16 +9768,20 @@ 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); - } - 3 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "EnumOptions", 3)?; + 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, "EnumOptions", 999)?; + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodOptions", 999)?; self.uninterpreted_option.push(val); } 1000..=536870911 => { @@ -6560,7 +9795,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for EnumOptions { + impl ::pb_jelly::Reflection for MethodOptions { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -6570,12 +9805,15 @@ 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)) - } "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.") } @@ -6585,80 +9823,190 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for EnumOptions { + impl ::pb_jelly::extensions::Extensible for MethodOptions { 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 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, + 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 EnumValueOptions { - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() + impl UninterpretedOption { + pub fn set_name(&mut self, v: ::std::vec::Vec) { + self.name = v; } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); + pub fn take_name(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.name) } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) + pub fn get_name(&self) -> &[UninterpretedOption_NamePart] { + &self.name } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; + pub fn mut_name(&mut self) -> &mut ::std::vec::Vec { + &mut self.name } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) + pub fn has_identifier_value(&self) -> bool { + self.identifier_value.is_some() } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option + pub fn set_identifier_value(&mut self, v: ::std::string::String) { + self.identifier_value = Some(v); } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option + 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(0u64) + } + 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(0i64) + } + 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); + } + pub fn get_double_value(&self) -> f64 { + self.double_value.unwrap_or(0f64) + } + pub fn has_string_value(&self) -> bool { + self.string_value.is_some() + } + pub fn set_string_value(&mut self, v: ::std::vec::Vec) { + self.string_value = Some(v); + } + pub fn take_string_value(&mut self) -> ::std::vec::Vec { + self.string_value.take().unwrap_or_default() + } + pub fn get_string_value(&self) -> &[u8] { + self.string_value.as_deref().unwrap_or(&[]) + } + pub fn has_aggregate_value(&self) -> bool { + self.aggregate_value.is_some() + } + pub fn set_aggregate_value(&mut self, v: ::std::string::String) { + self.aggregate_value = Some(v); + } + pub fn take_aggregate_value(&mut self) -> ::std::string::String { + self.aggregate_value.take().unwrap_or_default() + } + pub fn get_aggregate_value(&self) -> &str { + self.aggregate_value.as_deref().unwrap_or("") } } - impl ::std::default::Default for EnumValueOptions { + impl ::std::default::Default for UninterpretedOption { fn default() -> Self { - EnumValueOptions { - deprecated: ::std::option::Option::Some(false), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::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 EnumValueOptions_default: EnumValueOptions = EnumValueOptions::default(); + pub static ref UninterpretedOption_default: UninterpretedOption = UninterpretedOption::default(); } - impl ::pb_jelly::Message for EnumValueOptions { + impl ::pb_jelly::Message for UninterpretedOption { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "EnumValueOptions", - full_name: "google.protobuf.EnumValueOptions", + name: "UninterpretedOption", + full_name: "google.protobuf.UninterpretedOption", fields: &[ ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.EnumValueOptions.deprecated", - index: 0, - number: 1, + 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, }, ::pb_jelly::FieldDescriptor { - name: "uninterpreted_option", - full_name: "google.protobuf.EnumValueOptions.uninterpreted_option", - index: 1, - number: 999, + 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::Repeated, + 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, }, ], @@ -6668,38 +10016,83 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.deprecated { - size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); + for val in &self.name { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.uninterpreted_option { - size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.identifier_value { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.positive_int_value { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.negative_int_value { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.double_value { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Fixed64); + } + if let Some(ref val) = self.string_value { + size += ::pb_jelly::helpers::compute_size_field::<::std::vec::Vec>(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.aggregate_value { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); } - size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; + for val in &self.name { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.uninterpreted_option { - ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.identifier_value { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.positive_int_value { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.negative_int_value { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.double_value { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Fixed64)?; + } + if let Some(ref val) = self.string_value { + ::pb_jelly::helpers::serialize_field::>(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.aggregate_value { + ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - 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, "EnumValueOptions", 1)?; - self.deprecated = Some(val); + 2 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 2)?; + self.name.push(val); } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "EnumValueOptions", 999)?; - self.uninterpreted_option.push(val); + 3 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption", 3)?; + self.identifier_value = Some(val); } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; + 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); + } + 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)?; @@ -6709,7 +10102,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for EnumValueOptions { + impl ::pb_jelly::Reflection for UninterpretedOption { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -6719,97 +10112,100 @@ 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)) - } - "uninterpreted_option" => { + "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)) + } + "aggregate_value" => { + ::pb_jelly::reflection::FieldMut::Value(self.aggregate_value.get_or_insert_with(::std::default::Default::default)) + } _ => { panic!("unknown field name given") } } } } - impl ::pb_jelly::extensions::Extensible for EnumValueOptions { - fn _extensions(&self) -> &::pb_jelly::Unrecognized { - &self._extensions - } - } - - #[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, + /// 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, } - impl ServiceOptions { - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() + impl UninterpretedOption_NamePart { + pub fn has_name_part(&self) -> bool { + self.name_part.is_some() } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); + pub fn set_name_part(&mut self, v: ::std::string::String) { + self.name_part = Some(v); } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) + pub fn take_name_part(&mut self) -> ::std::string::String { + self.name_part.take().unwrap_or_default() } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; + pub fn get_name_part(&self) -> &str { + self.name_part.as_deref().unwrap_or("") } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) + pub fn has_is_extension(&self) -> bool { + self.is_extension.is_some() } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option + pub fn set_is_extension(&mut self, v: bool) { + self.is_extension = Some(v); } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option + pub fn get_is_extension(&self) -> bool { + self.is_extension.unwrap_or(false) } } - impl ::std::default::Default for ServiceOptions { + impl ::std::default::Default for UninterpretedOption_NamePart { fn default() -> Self { - ServiceOptions { - deprecated: ::std::option::Option::Some(false), - uninterpreted_option: ::std::default::Default::default(), - _extensions: ::pb_jelly::Unrecognized::default(), + UninterpretedOption_NamePart { + name_part: ::std::default::Default::default(), + is_extension: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref ServiceOptions_default: ServiceOptions = ServiceOptions::default(); + pub static ref UninterpretedOption_NamePart_default: UninterpretedOption_NamePart = UninterpretedOption_NamePart::default(); } - impl ::pb_jelly::Message for ServiceOptions { + impl ::pb_jelly::Message for UninterpretedOption_NamePart { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "ServiceOptions", - full_name: "google.protobuf.ServiceOptions", + name: "UninterpretedOption_NamePart", + full_name: "google.protobuf.UninterpretedOption_NamePart", fields: &[ ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.ServiceOptions.deprecated", + name: "name_part", + full_name: "google.protobuf.UninterpretedOption_NamePart.name_part", index: 0, - number: 33, - 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: "uninterpreted_option", - full_name: "google.protobuf.ServiceOptions.uninterpreted_option", + name: "is_extension", + full_name: "google.protobuf.UninterpretedOption_NamePart.is_extension", index: 1, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + number: 2, + typ: ::pb_jelly::wire_format::Type::Varint, + label: ::pb_jelly::Label::Required, oneof_index: None, }, ], @@ -6819,38 +10215,33 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.deprecated { - size += ::pb_jelly::helpers::compute_size_field::(val, 33, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.name_part { + size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - for val in &self.uninterpreted_option { - size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.is_extension { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } - size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 33, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.name_part { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - for val in &self.uninterpreted_option { - ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.is_extension { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; } - 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 { - 33 => { - let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "ServiceOptions", 33)?; - self.deprecated = Some(val); - } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "ServiceOptions", 999)?; - self.uninterpreted_option.push(val); + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "UninterpretedOption_NamePart", 1)?; + self.name_part = Some(val); } - 1000..=536870911 => { - self._extensions.gather(field_number, typ, &mut buf)?; + 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); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -6860,7 +10251,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for ServiceOptions { + impl ::pb_jelly::Reflection for UninterpretedOption_NamePart { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -6870,11 +10261,11 @@ 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)) + "name_part" => { + ::pb_jelly::reflection::FieldMut::Value(self.name_part.get_or_insert_with(::std::default::Default::default)) } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") + "is_extension" => { + ::pb_jelly::reflection::FieldMut::Value(self.is_extension.get_or_insert_with(::std::default::Default::default)) } _ => { panic!("unknown field name given") @@ -6882,105 +10273,156 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for ServiceOptions { - 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. + // =================================================================== + // Features - /// 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, + /// 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, pub _extensions: ::pb_jelly::Unrecognized, } - impl MethodOptions { - pub fn has_deprecated(&self) -> bool { - self.deprecated.is_some() + impl FeatureSet { + pub fn has_field_presence(&self) -> bool { + self.field_presence.is_some() } - pub fn set_deprecated(&mut self, v: bool) { - self.deprecated = Some(v); + pub fn set_field_presence(&mut self, v: FeatureSet_FieldPresence) { + self.field_presence = Some(v); } - pub fn get_deprecated(&self) -> bool { - self.deprecated.unwrap_or(false) + pub fn get_field_presence(&self) -> FeatureSet_FieldPresence { + self.field_presence.unwrap_or_default() } - pub fn has_idempotency_level(&self) -> bool { - self.idempotency_level.is_some() + pub fn has_enum_type(&self) -> bool { + self.enum_type.is_some() } - pub fn set_idempotency_level(&mut self, v: MethodOptions_IdempotencyLevel) { - self.idempotency_level = Some(v); + pub fn set_enum_type(&mut self, v: FeatureSet_EnumType) { + self.enum_type = Some(v); } - pub fn get_idempotency_level(&self) -> MethodOptions_IdempotencyLevel { - self.idempotency_level.unwrap_or_default() + pub fn get_enum_type(&self) -> FeatureSet_EnumType { + self.enum_type.unwrap_or_default() } - pub fn set_uninterpreted_option(&mut self, v: ::std::vec::Vec) { - self.uninterpreted_option = v; + pub fn has_repeated_field_encoding(&self) -> bool { + self.repeated_field_encoding.is_some() } - pub fn take_uninterpreted_option(&mut self) -> ::std::vec::Vec { - ::std::mem::take(&mut self.uninterpreted_option) + pub fn set_repeated_field_encoding(&mut self, v: FeatureSet_RepeatedFieldEncoding) { + self.repeated_field_encoding = Some(v); } - pub fn get_uninterpreted_option(&self) -> &[UninterpretedOption] { - &self.uninterpreted_option + pub fn get_repeated_field_encoding(&self) -> FeatureSet_RepeatedFieldEncoding { + self.repeated_field_encoding.unwrap_or_default() } - pub fn mut_uninterpreted_option(&mut self) -> &mut ::std::vec::Vec { - &mut self.uninterpreted_option + pub fn has_utf8_validation(&self) -> bool { + self.utf8_validation.is_some() + } + pub fn set_utf8_validation(&mut self, v: FeatureSet_Utf8Validation) { + self.utf8_validation = Some(v); + } + pub fn get_utf8_validation(&self) -> FeatureSet_Utf8Validation { + self.utf8_validation.unwrap_or_default() + } + pub fn has_message_encoding(&self) -> bool { + self.message_encoding.is_some() + } + pub fn set_message_encoding(&mut self, v: FeatureSet_MessageEncoding) { + self.message_encoding = Some(v); + } + pub fn get_message_encoding(&self) -> FeatureSet_MessageEncoding { + self.message_encoding.unwrap_or_default() + } + pub fn has_json_format(&self) -> bool { + self.json_format.is_some() + } + pub fn set_json_format(&mut self, v: FeatureSet_JsonFormat) { + self.json_format = Some(v); + } + pub fn get_json_format(&self) -> FeatureSet_JsonFormat { + self.json_format.unwrap_or_default() } } - impl ::std::default::Default for MethodOptions { + impl ::std::default::Default for FeatureSet { fn default() -> Self { - MethodOptions { - deprecated: ::std::option::Option::Some(false), - idempotency_level: ::std::option::Option::Some(MethodOptions_IdempotencyLevel::IDEMPOTENCY_UNKNOWN), - uninterpreted_option: ::std::default::Default::default(), + 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(), _extensions: ::pb_jelly::Unrecognized::default(), } } } ::lazy_static::lazy_static! { - pub static ref MethodOptions_default: MethodOptions = MethodOptions::default(); + pub static ref FeatureSet_default: FeatureSet = FeatureSet::default(); } - impl ::pb_jelly::Message for MethodOptions { + impl ::pb_jelly::Message for FeatureSet { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "MethodOptions", - full_name: "google.protobuf.MethodOptions", + name: "FeatureSet", + full_name: "google.protobuf.FeatureSet", fields: &[ ::pb_jelly::FieldDescriptor { - name: "deprecated", - full_name: "google.protobuf.MethodOptions.deprecated", + name: "field_presence", + full_name: "google.protobuf.FeatureSet.field_presence", index: 0, - number: 33, + number: 1, 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", + name: "enum_type", + full_name: "google.protobuf.FeatureSet.enum_type", index: 1, - number: 34, + 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.MethodOptions.uninterpreted_option", + name: "repeated_field_encoding", + full_name: "google.protobuf.FeatureSet.repeated_field_encoding", index: 2, - number: 999, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Repeated, + 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, oneof_index: None, }, ], @@ -6990,27 +10432,45 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.deprecated { - size += ::pb_jelly::helpers::compute_size_field::(val, 33, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.field_presence { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.idempotency_level { - size += ::pb_jelly::helpers::compute_size_field::(val, 34, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.enum_type { + size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); } - for val in &self.uninterpreted_option { - size += ::pb_jelly::helpers::compute_size_field::(val, 999, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.repeated_field_encoding { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.utf8_validation { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.message_encoding { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } + if let Some(ref val) = self.json_format { + size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Varint); } size += self._extensions.compute_size(); size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.deprecated { - ::pb_jelly::helpers::serialize_field::(w, val, 33, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.field_presence { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.idempotency_level { - ::pb_jelly::helpers::serialize_field::(w, val, 34, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.enum_type { + ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; } - for val in &self.uninterpreted_option { - ::pb_jelly::helpers::serialize_field::(w, val, 999, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.repeated_field_encoding { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.utf8_validation { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.message_encoding { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } + if let Some(ref val) = self.json_format { + ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Varint)?; } self._extensions.serialize(w)?; Ok(()) @@ -7018,19 +10478,31 @@ 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); + 1 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 1)?; + self.field_presence = 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); + 2 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 2)?; + self.enum_type = Some(val); } - 999 => { - let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "MethodOptions", 999)?; - self.uninterpreted_option.push(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); } - 1000..=536870911 => { + 4 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 4)?; + self.utf8_validation = 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); + } + 6 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSet", 6)?; + self.json_format = Some(val); + } + 1000..=9994 | 9995..=9999 | 10000..=10000 => { self._extensions.gather(field_number, typ, &mut buf)?; } _ => { @@ -7041,7 +10513,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for MethodOptions { + impl ::pb_jelly::Reflection for FeatureSet { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -7051,14 +10523,23 @@ 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)) + "field_presence" => { + ::pb_jelly::reflection::FieldMut::Value(self.field_presence.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)) + "enum_type" => { + ::pb_jelly::reflection::FieldMut::Value(self.enum_type.get_or_insert_with(::std::default::Default::default)) } - "uninterpreted_option" => { - unimplemented!("Repeated fields are not currently supported.") + "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)) + } + "message_encoding" => { + ::pb_jelly::reflection::FieldMut::Value(self.message_encoding.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)) } _ => { panic!("unknown field name given") @@ -7066,192 +10547,103 @@ pub mod google { } } } - impl ::pb_jelly::extensions::Extensible for MethodOptions { + impl ::pb_jelly::extensions::Extensible for FeatureSet { 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>, - } - 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(0u64) - } - 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(0i64) - } - 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); + /// 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. + #[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, + } + impl FeatureSetDefaults { + pub fn set_defaults(&mut self, v: ::std::vec::Vec) { + self.defaults = v; } - pub fn get_double_value(&self) -> f64 { - self.double_value.unwrap_or(0f64) + pub fn take_defaults(&mut self) -> ::std::vec::Vec { + ::std::mem::take(&mut self.defaults) } - pub fn has_string_value(&self) -> bool { - self.string_value.is_some() + pub fn get_defaults(&self) -> &[FeatureSetDefaults_FeatureSetEditionDefault] { + &self.defaults } - pub fn set_string_value(&mut self, v: ::std::vec::Vec) { - self.string_value = Some(v); + pub fn mut_defaults(&mut self) -> &mut ::std::vec::Vec { + &mut self.defaults } - pub fn take_string_value(&mut self) -> ::std::vec::Vec { - self.string_value.take().unwrap_or_default() + pub fn has_minimum_edition(&self) -> bool { + self.minimum_edition.is_some() } - pub fn get_string_value(&self) -> &[u8] { - self.string_value.as_deref().unwrap_or(&[]) + pub fn set_minimum_edition(&mut self, v: Edition) { + self.minimum_edition = Some(v); } - pub fn has_aggregate_value(&self) -> bool { - self.aggregate_value.is_some() + pub fn get_minimum_edition(&self) -> Edition { + self.minimum_edition.unwrap_or_default() } - pub fn set_aggregate_value(&mut self, v: ::std::string::String) { - self.aggregate_value = Some(v); + pub fn has_maximum_edition(&self) -> bool { + self.maximum_edition.is_some() } - pub fn take_aggregate_value(&mut self) -> ::std::string::String { - self.aggregate_value.take().unwrap_or_default() + pub fn set_maximum_edition(&mut self, v: Edition) { + self.maximum_edition = Some(v); } - pub fn get_aggregate_value(&self) -> &str { - self.aggregate_value.as_deref().unwrap_or("") + pub fn get_maximum_edition(&self) -> Edition { + self.maximum_edition.unwrap_or_default() } } - impl ::std::default::Default for UninterpretedOption { + impl ::std::default::Default for FeatureSetDefaults { 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(), + FeatureSetDefaults { + defaults: ::std::default::Default::default(), + minimum_edition: ::std::default::Default::default(), + maximum_edition: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref UninterpretedOption_default: UninterpretedOption = UninterpretedOption::default(); + pub static ref FeatureSetDefaults_default: FeatureSetDefaults = FeatureSetDefaults::default(); } - impl ::pb_jelly::Message for UninterpretedOption { + impl ::pb_jelly::Message for FeatureSetDefaults { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "UninterpretedOption", - full_name: "google.protobuf.UninterpretedOption", + name: "FeatureSetDefaults", + full_name: "google.protobuf.FeatureSetDefaults", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name", - full_name: "google.protobuf.UninterpretedOption.name", + name: "defaults", + full_name: "google.protobuf.FeatureSetDefaults.defaults", index: 0, - number: 2, + number: 1, 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", + name: "minimum_edition", + full_name: "google.protobuf.FeatureSetDefaults.minimum_edition", 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: "negative_int_value", - full_name: "google.protobuf.UninterpretedOption.negative_int_value", - index: 3, + name: "maximum_edition", + full_name: "google.protobuf.FeatureSetDefaults.maximum_edition", + index: 2, 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: &[ ], @@ -7259,83 +10651,43 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - for val in &self.name { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.identifier_value { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 3, ::pb_jelly::wire_format::Type::LengthDelimited); - } - if let Some(ref val) = self.positive_int_value { - size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.negative_int_value { - size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); - } - if let Some(ref val) = self.double_value { - size += ::pb_jelly::helpers::compute_size_field::(val, 6, ::pb_jelly::wire_format::Type::Fixed64); + for val in &self.defaults { + size += ::pb_jelly::helpers::compute_size_field::(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); } - if let Some(ref val) = self.string_value { - size += ::pb_jelly::helpers::compute_size_field::<::std::vec::Vec>(val, 7, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.minimum_edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.aggregate_value { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 8, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.maximum_edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); } size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - for val in &self.name { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.identifier_value { - ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::LengthDelimited)?; - } - if let Some(ref val) = self.positive_int_value { - ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; - } - if let Some(ref val) = self.negative_int_value { - ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + for val in &self.defaults { + ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; } - if let Some(ref val) = self.double_value { - ::pb_jelly::helpers::serialize_field::(w, val, 6, ::pb_jelly::wire_format::Type::Fixed64)?; - } - if let Some(ref val) = self.string_value { - ::pb_jelly::helpers::serialize_field::>(w, val, 7, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.minimum_edition { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.aggregate_value { - ::pb_jelly::helpers::serialize_field::(w, val, 8, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.maximum_edition { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; } 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); + 1 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FeatureSetDefaults", 1)?; + self.defaults.push(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); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults", 4)?; + self.minimum_edition = 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); - } - 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); + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults", 5)?; + self.maximum_edition = Some(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -7345,7 +10697,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for UninterpretedOption { + impl ::pb_jelly::Reflection for FeatureSetDefaults { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -7355,26 +10707,14 @@ pub mod google { } fn get_field_mut(&mut self, field_name: &str) -> ::pb_jelly::reflection::FieldMut<'_> { match field_name { - "name" => { + "defaults" => { 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)) + "minimum_edition" => { + ::pb_jelly::reflection::FieldMut::Value(self.minimum_edition.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)) - } - "aggregate_value" => { - ::pb_jelly::reflection::FieldMut::Value(self.aggregate_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)) } _ => { panic!("unknown field name given") @@ -7383,72 +10723,96 @@ pub mod google { } } - /// 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, + /// 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, + /// Defaults of features that can be overridden in this edition. + pub overridable_features: ::std::option::Option, + /// Defaults of features that can't be overridden in this edition. + pub fixed_features: ::std::option::Option, } - impl UninterpretedOption_NamePart { - pub fn has_name_part(&self) -> bool { - self.name_part.is_some() + impl FeatureSetDefaults_FeatureSetEditionDefault { + pub fn has_edition(&self) -> bool { + self.edition.is_some() } - pub fn set_name_part(&mut self, v: ::std::string::String) { - self.name_part = Some(v); + pub fn set_edition(&mut self, v: Edition) { + self.edition = Some(v); } - pub fn take_name_part(&mut self) -> ::std::string::String { - self.name_part.take().unwrap_or_default() + pub fn get_edition(&self) -> Edition { + self.edition.unwrap_or_default() } - pub fn get_name_part(&self) -> &str { - self.name_part.as_deref().unwrap_or("") + pub fn has_overridable_features(&self) -> bool { + self.overridable_features.is_some() } - pub fn has_is_extension(&self) -> bool { - self.is_extension.is_some() + pub fn set_overridable_features(&mut self, v: FeatureSet) { + self.overridable_features = Some(v); } - pub fn set_is_extension(&mut self, v: bool) { - self.is_extension = Some(v); + pub fn take_overridable_features(&mut self) -> FeatureSet { + self.overridable_features.take().unwrap_or_default() } - pub fn get_is_extension(&self) -> bool { - self.is_extension.unwrap_or(false) + pub fn get_overridable_features(&self) -> &FeatureSet { + self.overridable_features.as_ref().unwrap_or(&FeatureSet_default) + } + pub fn has_fixed_features(&self) -> bool { + self.fixed_features.is_some() + } + pub fn set_fixed_features(&mut self, v: FeatureSet) { + self.fixed_features = Some(v); + } + pub fn take_fixed_features(&mut self) -> FeatureSet { + self.fixed_features.take().unwrap_or_default() + } + pub fn get_fixed_features(&self) -> &FeatureSet { + self.fixed_features.as_ref().unwrap_or(&FeatureSet_default) } } - impl ::std::default::Default for UninterpretedOption_NamePart { + impl ::std::default::Default for FeatureSetDefaults_FeatureSetEditionDefault { fn default() -> Self { - UninterpretedOption_NamePart { - name_part: ::std::default::Default::default(), - is_extension: ::std::default::Default::default(), + FeatureSetDefaults_FeatureSetEditionDefault { + edition: ::std::default::Default::default(), + overridable_features: ::std::default::Default::default(), + fixed_features: ::std::default::Default::default(), } } } ::lazy_static::lazy_static! { - pub static ref UninterpretedOption_NamePart_default: UninterpretedOption_NamePart = UninterpretedOption_NamePart::default(); + pub static ref FeatureSetDefaults_FeatureSetEditionDefault_default: FeatureSetDefaults_FeatureSetEditionDefault = FeatureSetDefaults_FeatureSetEditionDefault::default(); } - impl ::pb_jelly::Message for UninterpretedOption_NamePart { + impl ::pb_jelly::Message for FeatureSetDefaults_FeatureSetEditionDefault { fn descriptor(&self) -> ::std::option::Option<::pb_jelly::MessageDescriptor> { Some(::pb_jelly::MessageDescriptor { - name: "UninterpretedOption_NamePart", - full_name: "google.protobuf.UninterpretedOption_NamePart", + name: "FeatureSetDefaults_FeatureSetEditionDefault", + full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault", fields: &[ ::pb_jelly::FieldDescriptor { - name: "name_part", - full_name: "google.protobuf.UninterpretedOption_NamePart.name_part", + name: "edition", + full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault.edition", index: 0, - number: 1, - typ: ::pb_jelly::wire_format::Type::LengthDelimited, - label: ::pb_jelly::Label::Required, + number: 3, + 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: "overridable_features", + full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault.overridable_features", index: 1, - number: 2, - typ: ::pb_jelly::wire_format::Type::Varint, - label: ::pb_jelly::Label::Required, + number: 4, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, + oneof_index: None, + }, + ::pb_jelly::FieldDescriptor { + name: "fixed_features", + full_name: "google.protobuf.FeatureSetDefaults_FeatureSetEditionDefault.fixed_features", + index: 2, + number: 5, + typ: ::pb_jelly::wire_format::Type::LengthDelimited, + label: ::pb_jelly::Label::Optional, oneof_index: None, }, ], @@ -7458,33 +10822,43 @@ pub mod google { } fn compute_size(&self) -> usize { let mut size = 0usize; - if let Some(ref val) = self.name_part { - size += ::pb_jelly::helpers::compute_size_field::<::std::string::String>(val, 1, ::pb_jelly::wire_format::Type::LengthDelimited); + if let Some(ref val) = self.edition { + size += ::pb_jelly::helpers::compute_size_field::(val, 3, ::pb_jelly::wire_format::Type::Varint); } - if let Some(ref val) = self.is_extension { - size += ::pb_jelly::helpers::compute_size_field::(val, 2, ::pb_jelly::wire_format::Type::Varint); + if let Some(ref val) = self.overridable_features { + size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::LengthDelimited); + } + if let Some(ref val) = self.fixed_features { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::LengthDelimited); } size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { - if let Some(ref val) = self.name_part { - ::pb_jelly::helpers::serialize_field::(w, val, 1, ::pb_jelly::wire_format::Type::LengthDelimited)?; + if let Some(ref val) = self.edition { + ::pb_jelly::helpers::serialize_field::(w, val, 3, ::pb_jelly::wire_format::Type::Varint)?; } - if let Some(ref val) = self.is_extension { - ::pb_jelly::helpers::serialize_field::(w, val, 2, ::pb_jelly::wire_format::Type::Varint)?; + if let Some(ref val) = self.overridable_features { + ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::LengthDelimited)?; + } + if let Some(ref val) = self.fixed_features { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::LengthDelimited)?; } 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); + 3 => { + let val = ::pb_jelly::helpers::deserialize_known_length::(buf, typ, ::pb_jelly::wire_format::Type::Varint, "FeatureSetDefaults_FeatureSetEditionDefault", 3)?; + self.edition = 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); + 4 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FeatureSetDefaults_FeatureSetEditionDefault", 4)?; + self.overridable_features = Some(val); + } + 5 => { + let val = ::pb_jelly::helpers::deserialize_length_delimited::(buf, typ, "FeatureSetDefaults_FeatureSetEditionDefault", 5)?; + self.fixed_features = Some(val); } _ => { ::pb_jelly::skip(typ, &mut buf)?; @@ -7494,7 +10868,7 @@ pub mod google { Ok(()) } } - impl ::pb_jelly::Reflection for UninterpretedOption_NamePart { + impl ::pb_jelly::Reflection for FeatureSetDefaults_FeatureSetEditionDefault { fn which_one_of(&self, oneof_name: &str) -> ::std::option::Option<&'static str> { match oneof_name { _ => { @@ -7504,11 +10878,14 @@ 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)) + "edition" => { + ::pb_jelly::reflection::FieldMut::Value(self.edition.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)) + "overridable_features" => { + ::pb_jelly::reflection::FieldMut::Value(self.overridable_features.get_or_insert_with(::std::default::Default::default)) + } + "fixed_features" => { + ::pb_jelly::reflection::FieldMut::Value(self.fixed_features.get_or_insert_with(::std::default::Default::default)) } _ => { panic!("unknown field name given") @@ -7667,8 +11044,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. For - /// example, this path: + /// the root FileDescriptorProto to the place where the definition appears. + /// For example, this path: /// [ 4, 3, 2, 7, 1 ] /// refers to: /// file.message_type(3) // 4, 3 @@ -7720,13 +11097,13 @@ pub mod google { /// // Comment attached to baz. /// // Another line attached to baz. - /// // Comment attached to qux. + /// // Comment attached to moo. /// // - /// // Another line attached to qux. - /// optional double qux = 4; + /// // Another line attached to moo. + /// optional double moo = 4; /// // Detached comment for corge. This is not leading or trailing comments - /// // to qux or corge because there are blank lines separating it from + /// // to moo or corge because there are blank lines separating it from /// // both. /// // Detached comment for corge paragraph 2. @@ -8114,9 +11491,10 @@ 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 offset. The end offset should be one past + /// relates to the identified object. 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) { @@ -8161,6 +11539,15 @@ pub mod google { pub fn get_end(&self) -> i32 { self.end.unwrap_or(0i32) } + 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 { @@ -8169,6 +11556,7 @@ pub mod google { source_file: ::std::default::Default::default(), begin: ::std::default::Default::default(), end: ::std::default::Default::default(), + semantic: ::std::default::Default::default(), } } } @@ -8217,6 +11605,15 @@ 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: &[ ], @@ -8242,6 +11639,9 @@ pub mod google { if let Some(ref val) = self.end { size += ::pb_jelly::helpers::compute_size_field::(val, 4, ::pb_jelly::wire_format::Type::Varint); } + if let Some(ref val) = self.semantic { + size += ::pb_jelly::helpers::compute_size_field::(val, 5, ::pb_jelly::wire_format::Type::Varint); + } size } fn serialize(&self, w: &mut W) -> ::std::io::Result<()> { @@ -8265,6 +11665,9 @@ pub mod google { if let Some(ref val) = self.end { ::pb_jelly::helpers::serialize_field::(w, val, 4, ::pb_jelly::wire_format::Type::Varint)?; } + if let Some(ref val) = self.semantic { + ::pb_jelly::helpers::serialize_field::(w, val, 5, ::pb_jelly::wire_format::Type::Varint)?; + } Ok(()) } fn deserialize(&mut self, mut buf: &mut B) -> ::std::io::Result<()> { @@ -8285,6 +11688,10 @@ 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)?; } @@ -8315,6 +11722,9 @@ 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") }