Skip to main content

buffa_descriptor/generated/
google.protobuf.descriptor.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2// source: google/protobuf/descriptor.proto
3
4/// The full set of known editions.
5#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
6#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
7#[repr(i32)]
8pub enum Edition {
9    /// A placeholder for an unknown edition value.
10    EDITION_UNKNOWN = 0i32,
11    /// A placeholder edition for specifying default behaviors *before* a feature
12    /// was first introduced.  This is effectively an "infinite past".
13    EDITION_LEGACY = 900i32,
14    /// Legacy syntax "editions".  These pre-date editions, but behave much like
15    /// distinct editions.  These can't be used to specify the edition of proto
16    /// files, but feature definitions must supply proto2/proto3 defaults for
17    /// backwards compatibility.
18    EDITION_PROTO2 = 998i32,
19    EDITION_PROTO3 = 999i32,
20    /// Editions that have been released.  The specific values are arbitrary and
21    /// should not be depended on, but they will always be time-ordered for easy
22    /// comparison.
23    EDITION_2023 = 1000i32,
24    EDITION_2024 = 1001i32,
25    /// A placeholder edition for developing and testing unscheduled features.
26    EDITION_UNSTABLE = 9999i32,
27    /// Placeholder editions for testing feature resolution.  These should not be
28    /// used or relied on outside of tests.
29    EDITION_1_TEST_ONLY = 1i32,
30    EDITION_2_TEST_ONLY = 2i32,
31    EDITION_99997_TEST_ONLY = 99997i32,
32    EDITION_99998_TEST_ONLY = 99998i32,
33    EDITION_99999_TEST_ONLY = 99999i32,
34    /// Placeholder for specifying unbounded edition support.  This should only
35    /// ever be used by plugins that can expect to never require any changes to
36    /// support a new edition.
37    EDITION_MAX = 2147483647i32,
38}
39impl Edition {
40    ///Idiomatic alias for [`Self::EDITION_UNKNOWN`]; `Debug` prints the variant name.
41    #[allow(non_upper_case_globals)]
42    pub const EditionUnknown: Self = Self::EDITION_UNKNOWN;
43    ///Idiomatic alias for [`Self::EDITION_LEGACY`]; `Debug` prints the variant name.
44    #[allow(non_upper_case_globals)]
45    pub const EditionLegacy: Self = Self::EDITION_LEGACY;
46    ///Idiomatic alias for [`Self::EDITION_PROTO2`]; `Debug` prints the variant name.
47    #[allow(non_upper_case_globals)]
48    pub const EditionProto2: Self = Self::EDITION_PROTO2;
49    ///Idiomatic alias for [`Self::EDITION_PROTO3`]; `Debug` prints the variant name.
50    #[allow(non_upper_case_globals)]
51    pub const EditionProto3: Self = Self::EDITION_PROTO3;
52    ///Idiomatic alias for [`Self::EDITION_2023`]; `Debug` prints the variant name.
53    #[allow(non_upper_case_globals)]
54    pub const Edition2023: Self = Self::EDITION_2023;
55    ///Idiomatic alias for [`Self::EDITION_2024`]; `Debug` prints the variant name.
56    #[allow(non_upper_case_globals)]
57    pub const Edition2024: Self = Self::EDITION_2024;
58    ///Idiomatic alias for [`Self::EDITION_UNSTABLE`]; `Debug` prints the variant name.
59    #[allow(non_upper_case_globals)]
60    pub const EditionUnstable: Self = Self::EDITION_UNSTABLE;
61    ///Idiomatic alias for [`Self::EDITION_1_TEST_ONLY`]; `Debug` prints the variant name.
62    #[allow(non_upper_case_globals)]
63    pub const Edition1TestOnly: Self = Self::EDITION_1_TEST_ONLY;
64    ///Idiomatic alias for [`Self::EDITION_2_TEST_ONLY`]; `Debug` prints the variant name.
65    #[allow(non_upper_case_globals)]
66    pub const Edition2TestOnly: Self = Self::EDITION_2_TEST_ONLY;
67    ///Idiomatic alias for [`Self::EDITION_99997_TEST_ONLY`]; `Debug` prints the variant name.
68    #[allow(non_upper_case_globals)]
69    pub const Edition99997TestOnly: Self = Self::EDITION_99997_TEST_ONLY;
70    ///Idiomatic alias for [`Self::EDITION_99998_TEST_ONLY`]; `Debug` prints the variant name.
71    #[allow(non_upper_case_globals)]
72    pub const Edition99998TestOnly: Self = Self::EDITION_99998_TEST_ONLY;
73    ///Idiomatic alias for [`Self::EDITION_99999_TEST_ONLY`]; `Debug` prints the variant name.
74    #[allow(non_upper_case_globals)]
75    pub const Edition99999TestOnly: Self = Self::EDITION_99999_TEST_ONLY;
76    ///Idiomatic alias for [`Self::EDITION_MAX`]; `Debug` prints the variant name.
77    #[allow(non_upper_case_globals)]
78    pub const EditionMax: Self = Self::EDITION_MAX;
79}
80impl ::core::default::Default for Edition {
81    fn default() -> Self {
82        Self::EDITION_UNKNOWN
83    }
84}
85#[cfg(feature = "json")]
86const _: () = {
87    impl ::serde::Serialize for Edition {
88        fn serialize<S: ::serde::Serializer>(
89            &self,
90            s: S,
91        ) -> ::core::result::Result<S::Ok, S::Error> {
92            s.serialize_str(::buffa::Enumeration::proto_name(self))
93        }
94    }
95    impl<'de> ::serde::Deserialize<'de> for Edition {
96        fn deserialize<D: ::serde::Deserializer<'de>>(
97            d: D,
98        ) -> ::core::result::Result<Self, D::Error> {
99            struct _V;
100            impl ::serde::de::Visitor<'_> for _V {
101                type Value = Edition;
102                fn expecting(
103                    &self,
104                    f: &mut ::core::fmt::Formatter<'_>,
105                ) -> ::core::fmt::Result {
106                    f.write_str(
107                        concat!("a string, integer, or null for ", stringify!(Edition)),
108                    )
109                }
110                fn visit_str<E: ::serde::de::Error>(
111                    self,
112                    v: &str,
113                ) -> ::core::result::Result<Edition, E> {
114                    <Edition as ::buffa::Enumeration>::from_proto_name(v)
115                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
116                }
117                fn visit_i64<E: ::serde::de::Error>(
118                    self,
119                    v: i64,
120                ) -> ::core::result::Result<Edition, E> {
121                    let v32 = i32::try_from(v)
122                        .map_err(|_| {
123                            ::serde::de::Error::custom(
124                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
125                            )
126                        })?;
127                    <Edition as ::buffa::Enumeration>::from_i32(v32)
128                        .ok_or_else(|| {
129                            ::serde::de::Error::custom(
130                                ::buffa::alloc::format!("unknown enum value {v32}"),
131                            )
132                        })
133                }
134                fn visit_u64<E: ::serde::de::Error>(
135                    self,
136                    v: u64,
137                ) -> ::core::result::Result<Edition, E> {
138                    let v32 = i32::try_from(v)
139                        .map_err(|_| {
140                            ::serde::de::Error::custom(
141                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
142                            )
143                        })?;
144                    <Edition as ::buffa::Enumeration>::from_i32(v32)
145                        .ok_or_else(|| {
146                            ::serde::de::Error::custom(
147                                ::buffa::alloc::format!("unknown enum value {v32}"),
148                            )
149                        })
150                }
151                fn visit_unit<E: ::serde::de::Error>(
152                    self,
153                ) -> ::core::result::Result<Edition, E> {
154                    ::core::result::Result::Ok(::core::default::Default::default())
155                }
156            }
157            d.deserialize_any(_V)
158        }
159    }
160    impl ::buffa::json_helpers::ProtoElemJson for Edition {
161        fn serialize_proto_json<S: ::serde::Serializer>(
162            v: &Self,
163            s: S,
164        ) -> ::core::result::Result<S::Ok, S::Error> {
165            ::serde::Serialize::serialize(v, s)
166        }
167        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
168            d: D,
169        ) -> ::core::result::Result<Self, D::Error> {
170            <Self as ::serde::Deserialize>::deserialize(d)
171        }
172    }
173};
174impl ::buffa::Enumeration for Edition {
175    fn from_i32(value: i32) -> ::core::option::Option<Self> {
176        match value {
177            0i32 => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
178            900i32 => ::core::option::Option::Some(Self::EDITION_LEGACY),
179            998i32 => ::core::option::Option::Some(Self::EDITION_PROTO2),
180            999i32 => ::core::option::Option::Some(Self::EDITION_PROTO3),
181            1000i32 => ::core::option::Option::Some(Self::EDITION_2023),
182            1001i32 => ::core::option::Option::Some(Self::EDITION_2024),
183            9999i32 => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
184            1i32 => ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY),
185            2i32 => ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY),
186            99997i32 => ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY),
187            99998i32 => ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY),
188            99999i32 => ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY),
189            2147483647i32 => ::core::option::Option::Some(Self::EDITION_MAX),
190            _ => ::core::option::Option::None,
191        }
192    }
193    fn to_i32(&self) -> i32 {
194        *self as i32
195    }
196    fn proto_name(&self) -> &'static str {
197        match self {
198            Self::EDITION_UNKNOWN => "EDITION_UNKNOWN",
199            Self::EDITION_LEGACY => "EDITION_LEGACY",
200            Self::EDITION_PROTO2 => "EDITION_PROTO2",
201            Self::EDITION_PROTO3 => "EDITION_PROTO3",
202            Self::EDITION_2023 => "EDITION_2023",
203            Self::EDITION_2024 => "EDITION_2024",
204            Self::EDITION_UNSTABLE => "EDITION_UNSTABLE",
205            Self::EDITION_1_TEST_ONLY => "EDITION_1_TEST_ONLY",
206            Self::EDITION_2_TEST_ONLY => "EDITION_2_TEST_ONLY",
207            Self::EDITION_99997_TEST_ONLY => "EDITION_99997_TEST_ONLY",
208            Self::EDITION_99998_TEST_ONLY => "EDITION_99998_TEST_ONLY",
209            Self::EDITION_99999_TEST_ONLY => "EDITION_99999_TEST_ONLY",
210            Self::EDITION_MAX => "EDITION_MAX",
211        }
212    }
213    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
214        match name {
215            "EDITION_UNKNOWN" => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
216            "EDITION_LEGACY" => ::core::option::Option::Some(Self::EDITION_LEGACY),
217            "EDITION_PROTO2" => ::core::option::Option::Some(Self::EDITION_PROTO2),
218            "EDITION_PROTO3" => ::core::option::Option::Some(Self::EDITION_PROTO3),
219            "EDITION_2023" => ::core::option::Option::Some(Self::EDITION_2023),
220            "EDITION_2024" => ::core::option::Option::Some(Self::EDITION_2024),
221            "EDITION_UNSTABLE" => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
222            "EDITION_1_TEST_ONLY" => {
223                ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY)
224            }
225            "EDITION_2_TEST_ONLY" => {
226                ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY)
227            }
228            "EDITION_99997_TEST_ONLY" => {
229                ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY)
230            }
231            "EDITION_99998_TEST_ONLY" => {
232                ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY)
233            }
234            "EDITION_99999_TEST_ONLY" => {
235                ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY)
236            }
237            "EDITION_MAX" => ::core::option::Option::Some(Self::EDITION_MAX),
238            _ => ::core::option::Option::None,
239        }
240    }
241    fn values() -> &'static [Self] {
242        &[
243            Self::EDITION_UNKNOWN,
244            Self::EDITION_LEGACY,
245            Self::EDITION_PROTO2,
246            Self::EDITION_PROTO3,
247            Self::EDITION_2023,
248            Self::EDITION_2024,
249            Self::EDITION_UNSTABLE,
250            Self::EDITION_1_TEST_ONLY,
251            Self::EDITION_2_TEST_ONLY,
252            Self::EDITION_99997_TEST_ONLY,
253            Self::EDITION_99998_TEST_ONLY,
254            Self::EDITION_99999_TEST_ONLY,
255            Self::EDITION_MAX,
256        ]
257    }
258}
259/// Describes the 'visibility' of a symbol with respect to the proto import
260/// system. Symbols can only be imported when the visibility rules do not prevent
261/// it (ex: local symbols cannot be imported).  Visibility modifiers can only set
262/// on `message` and `enum` as they are the only types available to be referenced
263/// from other files.
264#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
265#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
266#[repr(i32)]
267pub enum SymbolVisibility {
268    VISIBILITY_UNSET = 0i32,
269    VISIBILITY_LOCAL = 1i32,
270    VISIBILITY_EXPORT = 2i32,
271}
272impl SymbolVisibility {
273    ///Idiomatic alias for [`Self::VISIBILITY_UNSET`]; `Debug` prints the variant name.
274    #[allow(non_upper_case_globals)]
275    pub const VisibilityUnset: Self = Self::VISIBILITY_UNSET;
276    ///Idiomatic alias for [`Self::VISIBILITY_LOCAL`]; `Debug` prints the variant name.
277    #[allow(non_upper_case_globals)]
278    pub const VisibilityLocal: Self = Self::VISIBILITY_LOCAL;
279    ///Idiomatic alias for [`Self::VISIBILITY_EXPORT`]; `Debug` prints the variant name.
280    #[allow(non_upper_case_globals)]
281    pub const VisibilityExport: Self = Self::VISIBILITY_EXPORT;
282}
283impl ::core::default::Default for SymbolVisibility {
284    fn default() -> Self {
285        Self::VISIBILITY_UNSET
286    }
287}
288#[cfg(feature = "json")]
289const _: () = {
290    impl ::serde::Serialize for SymbolVisibility {
291        fn serialize<S: ::serde::Serializer>(
292            &self,
293            s: S,
294        ) -> ::core::result::Result<S::Ok, S::Error> {
295            s.serialize_str(::buffa::Enumeration::proto_name(self))
296        }
297    }
298    impl<'de> ::serde::Deserialize<'de> for SymbolVisibility {
299        fn deserialize<D: ::serde::Deserializer<'de>>(
300            d: D,
301        ) -> ::core::result::Result<Self, D::Error> {
302            struct _V;
303            impl ::serde::de::Visitor<'_> for _V {
304                type Value = SymbolVisibility;
305                fn expecting(
306                    &self,
307                    f: &mut ::core::fmt::Formatter<'_>,
308                ) -> ::core::fmt::Result {
309                    f.write_str(
310                        concat!(
311                            "a string, integer, or null for ",
312                            stringify!(SymbolVisibility)
313                        ),
314                    )
315                }
316                fn visit_str<E: ::serde::de::Error>(
317                    self,
318                    v: &str,
319                ) -> ::core::result::Result<SymbolVisibility, E> {
320                    <SymbolVisibility as ::buffa::Enumeration>::from_proto_name(v)
321                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
322                }
323                fn visit_i64<E: ::serde::de::Error>(
324                    self,
325                    v: i64,
326                ) -> ::core::result::Result<SymbolVisibility, E> {
327                    let v32 = i32::try_from(v)
328                        .map_err(|_| {
329                            ::serde::de::Error::custom(
330                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
331                            )
332                        })?;
333                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
334                        .ok_or_else(|| {
335                            ::serde::de::Error::custom(
336                                ::buffa::alloc::format!("unknown enum value {v32}"),
337                            )
338                        })
339                }
340                fn visit_u64<E: ::serde::de::Error>(
341                    self,
342                    v: u64,
343                ) -> ::core::result::Result<SymbolVisibility, E> {
344                    let v32 = i32::try_from(v)
345                        .map_err(|_| {
346                            ::serde::de::Error::custom(
347                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
348                            )
349                        })?;
350                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
351                        .ok_or_else(|| {
352                            ::serde::de::Error::custom(
353                                ::buffa::alloc::format!("unknown enum value {v32}"),
354                            )
355                        })
356                }
357                fn visit_unit<E: ::serde::de::Error>(
358                    self,
359                ) -> ::core::result::Result<SymbolVisibility, E> {
360                    ::core::result::Result::Ok(::core::default::Default::default())
361                }
362            }
363            d.deserialize_any(_V)
364        }
365    }
366    impl ::buffa::json_helpers::ProtoElemJson for SymbolVisibility {
367        fn serialize_proto_json<S: ::serde::Serializer>(
368            v: &Self,
369            s: S,
370        ) -> ::core::result::Result<S::Ok, S::Error> {
371            ::serde::Serialize::serialize(v, s)
372        }
373        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
374            d: D,
375        ) -> ::core::result::Result<Self, D::Error> {
376            <Self as ::serde::Deserialize>::deserialize(d)
377        }
378    }
379};
380impl ::buffa::Enumeration for SymbolVisibility {
381    fn from_i32(value: i32) -> ::core::option::Option<Self> {
382        match value {
383            0i32 => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
384            1i32 => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
385            2i32 => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
386            _ => ::core::option::Option::None,
387        }
388    }
389    fn to_i32(&self) -> i32 {
390        *self as i32
391    }
392    fn proto_name(&self) -> &'static str {
393        match self {
394            Self::VISIBILITY_UNSET => "VISIBILITY_UNSET",
395            Self::VISIBILITY_LOCAL => "VISIBILITY_LOCAL",
396            Self::VISIBILITY_EXPORT => "VISIBILITY_EXPORT",
397        }
398    }
399    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
400        match name {
401            "VISIBILITY_UNSET" => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
402            "VISIBILITY_LOCAL" => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
403            "VISIBILITY_EXPORT" => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
404            _ => ::core::option::Option::None,
405        }
406    }
407    fn values() -> &'static [Self] {
408        &[Self::VISIBILITY_UNSET, Self::VISIBILITY_LOCAL, Self::VISIBILITY_EXPORT]
409    }
410}
411/// The protocol compiler can output a FileDescriptorSet containing the .proto
412/// files it parses.
413#[derive(Clone, PartialEq, Default)]
414#[cfg_attr(feature = "json", derive(::serde::Serialize))]
415#[cfg_attr(feature = "json", serde(default))]
416#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
417pub struct FileDescriptorSet {
418    /// Field 1: `file`
419    #[cfg_attr(
420        feature = "json",
421        serde(
422            rename = "file",
423            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
424            deserialize_with = "::buffa::json_helpers::null_as_default"
425        )
426    )]
427    pub file: ::buffa::alloc::vec::Vec<FileDescriptorProto>,
428    #[cfg_attr(feature = "json", serde(flatten))]
429    #[doc(hidden)]
430    pub __buffa_unknown_fields: __FileDescriptorSetExtJson,
431}
432impl ::core::fmt::Debug for FileDescriptorSet {
433    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
434        f.debug_struct("FileDescriptorSet").field("file", &self.file).finish()
435    }
436}
437impl FileDescriptorSet {
438    /// Protobuf type URL for this message, for use with `Any::pack` and
439    /// `Any::unpack_if`.
440    ///
441    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
442    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
443}
444::buffa::impl_default_instance!(FileDescriptorSet);
445impl ::buffa::MessageName for FileDescriptorSet {
446    const PACKAGE: &'static str = "google.protobuf";
447    const NAME: &'static str = "FileDescriptorSet";
448    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorSet";
449    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
450}
451impl ::buffa::Message for FileDescriptorSet {
452    /// Returns the total encoded size in bytes.
453    ///
454    /// The result is a `u32`; the protobuf specification requires all
455    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
456    /// compliant message will never overflow this type.
457    #[allow(clippy::let_and_return)]
458    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
459        #[allow(unused_imports)]
460        use ::buffa::Enumeration as _;
461        let mut size = 0u32;
462        for v in &self.file {
463            let __slot = __cache.reserve();
464            let inner_size = v.compute_size(__cache);
465            __cache.set(__slot, inner_size);
466            size
467                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
468                    + inner_size;
469        }
470        size += self.__buffa_unknown_fields.encoded_len() as u32;
471        size
472    }
473    fn write_to(
474        &self,
475        __cache: &mut ::buffa::SizeCache,
476        buf: &mut impl ::buffa::bytes::BufMut,
477    ) {
478        #[allow(unused_imports)]
479        use ::buffa::Enumeration as _;
480        for v in &self.file {
481            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
482            v.write_to(__cache, buf);
483        }
484        self.__buffa_unknown_fields.write_to(buf);
485    }
486    fn merge_field(
487        &mut self,
488        tag: ::buffa::encoding::Tag,
489        buf: &mut impl ::buffa::bytes::Buf,
490        ctx: ::buffa::DecodeContext<'_>,
491    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
492        #[allow(unused_imports)]
493        use ::buffa::bytes::Buf as _;
494        #[allow(unused_imports)]
495        use ::buffa::Enumeration as _;
496        match tag.field_number() {
497            1u32 => {
498                ::buffa::encoding::check_wire_type(
499                    tag,
500                    ::buffa::encoding::WireType::LengthDelimited,
501                )?;
502                let mut elem = ::core::default::Default::default();
503                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
504                self.file.push(elem);
505            }
506            _ => {
507                self.__buffa_unknown_fields
508                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
509            }
510        }
511        ::core::result::Result::Ok(())
512    }
513    fn clear(&mut self) {
514        self.file.clear();
515        self.__buffa_unknown_fields.clear();
516    }
517}
518impl ::buffa::ExtensionSet for FileDescriptorSet {
519    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorSet";
520    fn unknown_fields(&self) -> &::buffa::UnknownFields {
521        &self.__buffa_unknown_fields
522    }
523    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
524        &mut self.__buffa_unknown_fields
525    }
526}
527#[cfg(feature = "text")]
528impl ::buffa::text::TextFormat for FileDescriptorSet {
529    fn encode_text(
530        &self,
531        enc: &mut ::buffa::text::TextEncoder<'_>,
532    ) -> ::core::fmt::Result {
533        #[allow(unused_imports)]
534        use ::buffa::Enumeration as _;
535        for __v in &self.file {
536            enc.write_field_name("file")?;
537            enc.write_message(__v)?;
538        }
539        enc.write_extension_fields(
540            "google.protobuf.FileDescriptorSet",
541            &self.__buffa_unknown_fields,
542        )?;
543        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
544        ::core::result::Result::Ok(())
545    }
546    fn merge_text(
547        &mut self,
548        dec: &mut ::buffa::text::TextDecoder<'_>,
549    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
550        #[allow(unused_imports)]
551        use ::buffa::Enumeration as _;
552        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
553            match __name {
554                "file" => {
555                    dec.read_repeated_into(
556                        &mut self.file,
557                        |__d| {
558                            let mut __m = ::core::default::Default::default();
559                            __d.merge_message(&mut __m)?;
560                            ::core::result::Result::Ok(__m)
561                        },
562                    )?
563                }
564                __name if __name.starts_with('[') => {
565                    for __r in dec
566                        .read_extension(__name, "google.protobuf.FileDescriptorSet")?
567                    {
568                        self.__buffa_unknown_fields.push(__r);
569                    }
570                }
571                _ => dec.skip_value()?,
572            }
573        }
574        ::core::result::Result::Ok(())
575    }
576}
577#[cfg(feature = "json")]
578impl<'de> serde::Deserialize<'de> for FileDescriptorSet {
579    fn deserialize<D: serde::Deserializer<'de>>(
580        d: D,
581    ) -> ::core::result::Result<Self, D::Error> {
582        struct _V;
583        impl<'de> serde::de::Visitor<'de> for _V {
584            type Value = FileDescriptorSet;
585            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
586                f.write_str("struct FileDescriptorSet")
587            }
588            #[allow(clippy::field_reassign_with_default)]
589            fn visit_map<A: serde::de::MapAccess<'de>>(
590                self,
591                mut map: A,
592            ) -> ::core::result::Result<FileDescriptorSet, A::Error> {
593                let mut __f_file: ::core::option::Option<
594                    ::buffa::alloc::vec::Vec<FileDescriptorProto>,
595                > = None;
596                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
597                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
598                    match key.as_str() {
599                        "file" => {
600                            __f_file = Some({
601                                struct _S;
602                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
603                                    type Value = ::buffa::alloc::vec::Vec<FileDescriptorProto>;
604                                    fn deserialize<D: serde::Deserializer<'de>>(
605                                        self,
606                                        d: D,
607                                    ) -> ::core::result::Result<
608                                        ::buffa::alloc::vec::Vec<FileDescriptorProto>,
609                                        D::Error,
610                                    > {
611                                        ::buffa::json_helpers::null_as_default(d)
612                                    }
613                                }
614                                map.next_value_seed(_S)?
615                            });
616                        }
617                        __k if __k.starts_with('[') => {
618                            let __v: ::buffa::serde_json::Value = map.next_value()?;
619                            match ::buffa::extension_registry::deserialize_extension_key(
620                                "google.protobuf.FileDescriptorSet",
621                                __k,
622                                __v,
623                            ) {
624                                ::core::option::Option::Some(
625                                    ::core::result::Result::Ok(__recs),
626                                ) => {
627                                    for __rec in __recs {
628                                        __ext_records.push(__rec);
629                                    }
630                                }
631                                ::core::option::Option::Some(
632                                    ::core::result::Result::Err(__e),
633                                ) => {
634                                    return ::core::result::Result::Err(
635                                        <A::Error as ::serde::de::Error>::custom(__e),
636                                    );
637                                }
638                                ::core::option::Option::None => {}
639                            }
640                        }
641                        _ => {
642                            map.next_value::<serde::de::IgnoredAny>()?;
643                        }
644                    }
645                }
646                let mut __r = <FileDescriptorSet as ::core::default::Default>::default();
647                if let ::core::option::Option::Some(v) = __f_file {
648                    __r.file = v;
649                }
650                for __rec in __ext_records {
651                    __r.__buffa_unknown_fields.push(__rec);
652                }
653                Ok(__r)
654            }
655        }
656        d.deserialize_map(_V)
657    }
658}
659#[cfg(feature = "json")]
660impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorSet {
661    fn serialize_proto_json<S: ::serde::Serializer>(
662        v: &Self,
663        s: S,
664    ) -> ::core::result::Result<S::Ok, S::Error> {
665        ::serde::Serialize::serialize(v, s)
666    }
667    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
668        d: D,
669    ) -> ::core::result::Result<Self, D::Error> {
670        <Self as ::serde::Deserialize>::deserialize(d)
671    }
672}
673#[doc(hidden)]
674#[derive(Clone, Debug, Default, PartialEq)]
675#[repr(transparent)]
676#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
677pub struct __FileDescriptorSetExtJson(pub ::buffa::UnknownFields);
678impl ::core::ops::Deref for __FileDescriptorSetExtJson {
679    type Target = ::buffa::UnknownFields;
680    fn deref(&self) -> &::buffa::UnknownFields {
681        &self.0
682    }
683}
684impl ::core::ops::DerefMut for __FileDescriptorSetExtJson {
685    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
686        &mut self.0
687    }
688}
689impl ::core::convert::From<::buffa::UnknownFields> for __FileDescriptorSetExtJson {
690    fn from(u: ::buffa::UnknownFields) -> Self {
691        Self(u)
692    }
693}
694#[cfg(feature = "json")]
695impl ::serde::Serialize for __FileDescriptorSetExtJson {
696    fn serialize<S: ::serde::Serializer>(
697        &self,
698        s: S,
699    ) -> ::core::result::Result<S::Ok, S::Error> {
700        ::buffa::extension_registry::serialize_extensions(
701            "google.protobuf.FileDescriptorSet",
702            &self.0,
703            s,
704        )
705    }
706}
707#[cfg(feature = "json")]
708impl<'de> ::serde::Deserialize<'de> for __FileDescriptorSetExtJson {
709    fn deserialize<D: ::serde::Deserializer<'de>>(
710        d: D,
711    ) -> ::core::result::Result<Self, D::Error> {
712        ::buffa::extension_registry::deserialize_extensions(
713                "google.protobuf.FileDescriptorSet",
714                d,
715            )
716            .map(Self)
717    }
718}
719#[cfg(feature = "json")]
720#[doc(hidden)]
721pub const __FILE_DESCRIPTOR_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
722    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
723    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorSet>,
724    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorSet>,
725    is_wkt: false,
726};
727#[cfg(feature = "text")]
728#[doc(hidden)]
729pub const __FILE_DESCRIPTOR_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
730    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
731    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorSet>,
732    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorSet>,
733};
734/// Describes a complete .proto file.
735#[derive(Clone, PartialEq, Default)]
736#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
737#[cfg_attr(feature = "json", serde(default))]
738#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
739pub struct FileDescriptorProto {
740    /// file name, relative to root of source tree
741    ///
742    /// Field 1: `name`
743    #[cfg_attr(
744        feature = "json",
745        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
746    )]
747    pub name: ::core::option::Option<::buffa::alloc::string::String>,
748    /// e.g. "foo", "foo.bar", etc.
749    ///
750    /// Field 2: `package`
751    #[cfg_attr(
752        feature = "json",
753        serde(
754            rename = "package",
755            skip_serializing_if = "::core::option::Option::is_none"
756        )
757    )]
758    pub package: ::core::option::Option<::buffa::alloc::string::String>,
759    /// Names of files imported by this file.
760    ///
761    /// Field 3: `dependency`
762    #[cfg_attr(
763        feature = "json",
764        serde(
765            rename = "dependency",
766            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
767            deserialize_with = "::buffa::json_helpers::null_as_default"
768        )
769    )]
770    pub dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
771    /// Indexes of the public imported files in the dependency list above.
772    ///
773    /// Field 10: `public_dependency`
774    #[cfg_attr(
775        feature = "json",
776        serde(
777            rename = "publicDependency",
778            alias = "public_dependency",
779            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
780            deserialize_with = "::buffa::json_helpers::null_as_default"
781        )
782    )]
783    pub public_dependency: ::buffa::alloc::vec::Vec<i32>,
784    /// Indexes of the weak imported files in the dependency list.
785    /// For Google-internal migration only. Do not use.
786    ///
787    /// Field 11: `weak_dependency`
788    #[cfg_attr(
789        feature = "json",
790        serde(
791            rename = "weakDependency",
792            alias = "weak_dependency",
793            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
794            deserialize_with = "::buffa::json_helpers::null_as_default"
795        )
796    )]
797    pub weak_dependency: ::buffa::alloc::vec::Vec<i32>,
798    /// Names of files imported by this file purely for the purpose of providing
799    /// option extensions. These are excluded from the dependency list above.
800    ///
801    /// Field 15: `option_dependency`
802    #[cfg_attr(
803        feature = "json",
804        serde(
805            rename = "optionDependency",
806            alias = "option_dependency",
807            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
808            deserialize_with = "::buffa::json_helpers::null_as_default"
809        )
810    )]
811    pub option_dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
812    /// All top-level definitions in this file.
813    ///
814    /// Field 4: `message_type`
815    #[cfg_attr(
816        feature = "json",
817        serde(
818            rename = "messageType",
819            alias = "message_type",
820            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
821            deserialize_with = "::buffa::json_helpers::null_as_default"
822        )
823    )]
824    pub message_type: ::buffa::alloc::vec::Vec<DescriptorProto>,
825    /// Field 5: `enum_type`
826    #[cfg_attr(
827        feature = "json",
828        serde(
829            rename = "enumType",
830            alias = "enum_type",
831            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
832            deserialize_with = "::buffa::json_helpers::null_as_default"
833        )
834    )]
835    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
836    /// Field 6: `service`
837    #[cfg_attr(
838        feature = "json",
839        serde(
840            rename = "service",
841            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
842            deserialize_with = "::buffa::json_helpers::null_as_default"
843        )
844    )]
845    pub service: ::buffa::alloc::vec::Vec<ServiceDescriptorProto>,
846    /// Field 7: `extension`
847    #[cfg_attr(
848        feature = "json",
849        serde(
850            rename = "extension",
851            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
852            deserialize_with = "::buffa::json_helpers::null_as_default"
853        )
854    )]
855    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
856    /// Field 8: `options`
857    #[cfg_attr(
858        feature = "json",
859        serde(
860            rename = "options",
861            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
862        )
863    )]
864    pub options: ::buffa::MessageField<FileOptions>,
865    /// This field contains optional information about the original source code.
866    /// You may safely remove this entire field without harming runtime
867    /// functionality of the descriptors -- the information is needed only by
868    /// development tools.
869    ///
870    /// Field 9: `source_code_info`
871    #[cfg_attr(
872        feature = "json",
873        serde(
874            rename = "sourceCodeInfo",
875            alias = "source_code_info",
876            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
877        )
878    )]
879    pub source_code_info: ::buffa::MessageField<SourceCodeInfo>,
880    /// The syntax of the proto file.
881    /// The supported values are "proto2", "proto3", and "editions".
882    ///
883    /// If `edition` is present, this value must be "editions".
884    /// WARNING: This field should only be used by protobuf plugins or special
885    /// cases like the proto compiler. Other uses are discouraged and
886    /// developers should rely on the protoreflect APIs for their client language.
887    ///
888    /// Field 12: `syntax`
889    #[cfg_attr(
890        feature = "json",
891        serde(rename = "syntax", skip_serializing_if = "::core::option::Option::is_none")
892    )]
893    pub syntax: ::core::option::Option<::buffa::alloc::string::String>,
894    /// The edition of the proto file.
895    /// WARNING: This field should only be used by protobuf plugins or special
896    /// cases like the proto compiler. Other uses are discouraged and
897    /// developers should rely on the protoreflect APIs for their client language.
898    ///
899    /// Field 14: `edition`
900    #[cfg_attr(
901        feature = "json",
902        serde(
903            rename = "edition",
904            with = "::buffa::json_helpers::opt_closed_enum",
905            skip_serializing_if = "::core::option::Option::is_none"
906        )
907    )]
908    pub edition: ::core::option::Option<Edition>,
909    #[cfg_attr(feature = "json", serde(skip))]
910    #[doc(hidden)]
911    pub __buffa_unknown_fields: ::buffa::UnknownFields,
912}
913impl ::core::fmt::Debug for FileDescriptorProto {
914    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
915        f.debug_struct("FileDescriptorProto")
916            .field("name", &self.name)
917            .field("package", &self.package)
918            .field("dependency", &self.dependency)
919            .field("public_dependency", &self.public_dependency)
920            .field("weak_dependency", &self.weak_dependency)
921            .field("option_dependency", &self.option_dependency)
922            .field("message_type", &self.message_type)
923            .field("enum_type", &self.enum_type)
924            .field("service", &self.service)
925            .field("extension", &self.extension)
926            .field("options", &self.options)
927            .field("source_code_info", &self.source_code_info)
928            .field("syntax", &self.syntax)
929            .field("edition", &self.edition)
930            .finish()
931    }
932}
933impl FileDescriptorProto {
934    /// Protobuf type URL for this message, for use with `Any::pack` and
935    /// `Any::unpack_if`.
936    ///
937    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
938    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
939}
940impl FileDescriptorProto {
941    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
942    #[inline]
943    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
944    pub fn with_name(
945        mut self,
946        value: impl Into<::buffa::alloc::string::String>,
947    ) -> Self {
948        self.name = Some(value.into());
949        self
950    }
951    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
952    #[inline]
953    ///Sets [`Self::package`] to `Some(value)`, consuming and returning `self`.
954    pub fn with_package(
955        mut self,
956        value: impl Into<::buffa::alloc::string::String>,
957    ) -> Self {
958        self.package = Some(value.into());
959        self
960    }
961    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
962    #[inline]
963    ///Sets [`Self::syntax`] to `Some(value)`, consuming and returning `self`.
964    pub fn with_syntax(
965        mut self,
966        value: impl Into<::buffa::alloc::string::String>,
967    ) -> Self {
968        self.syntax = Some(value.into());
969        self
970    }
971    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
972    #[inline]
973    ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
974    pub fn with_edition(mut self, value: impl Into<Edition>) -> Self {
975        self.edition = Some(value.into());
976        self
977    }
978}
979::buffa::impl_default_instance!(FileDescriptorProto);
980impl ::buffa::MessageName for FileDescriptorProto {
981    const PACKAGE: &'static str = "google.protobuf";
982    const NAME: &'static str = "FileDescriptorProto";
983    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorProto";
984    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
985}
986impl ::buffa::Message for FileDescriptorProto {
987    /// Returns the total encoded size in bytes.
988    ///
989    /// The result is a `u32`; the protobuf specification requires all
990    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
991    /// compliant message will never overflow this type.
992    #[allow(clippy::let_and_return)]
993    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
994        #[allow(unused_imports)]
995        use ::buffa::Enumeration as _;
996        let mut size = 0u32;
997        if let Some(ref v) = self.name {
998            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
999        }
1000        if let Some(ref v) = self.package {
1001            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1002        }
1003        for v in &self.dependency {
1004            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1005        }
1006        for v in &self.message_type {
1007            let __slot = __cache.reserve();
1008            let inner_size = v.compute_size(__cache);
1009            __cache.set(__slot, inner_size);
1010            size
1011                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1012                    + inner_size;
1013        }
1014        for v in &self.enum_type {
1015            let __slot = __cache.reserve();
1016            let inner_size = v.compute_size(__cache);
1017            __cache.set(__slot, inner_size);
1018            size
1019                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1020                    + inner_size;
1021        }
1022        for v in &self.service {
1023            let __slot = __cache.reserve();
1024            let inner_size = v.compute_size(__cache);
1025            __cache.set(__slot, inner_size);
1026            size
1027                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1028                    + inner_size;
1029        }
1030        for v in &self.extension {
1031            let __slot = __cache.reserve();
1032            let inner_size = v.compute_size(__cache);
1033            __cache.set(__slot, inner_size);
1034            size
1035                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1036                    + inner_size;
1037        }
1038        if self.options.is_set() {
1039            let __slot = __cache.reserve();
1040            let inner_size = self.options.compute_size(__cache);
1041            __cache.set(__slot, inner_size);
1042            size
1043                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1044                    + inner_size;
1045        }
1046        if self.source_code_info.is_set() {
1047            let __slot = __cache.reserve();
1048            let inner_size = self.source_code_info.compute_size(__cache);
1049            __cache.set(__slot, inner_size);
1050            size
1051                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1052                    + inner_size;
1053        }
1054        for v in &self.public_dependency {
1055            size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
1056        }
1057        for v in &self.weak_dependency {
1058            size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
1059        }
1060        if let Some(ref v) = self.syntax {
1061            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1062        }
1063        if let Some(ref v) = self.edition {
1064            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
1065        }
1066        for v in &self.option_dependency {
1067            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1068        }
1069        size += self.__buffa_unknown_fields.encoded_len() as u32;
1070        size
1071    }
1072    fn write_to(
1073        &self,
1074        __cache: &mut ::buffa::SizeCache,
1075        buf: &mut impl ::buffa::bytes::BufMut,
1076    ) {
1077        #[allow(unused_imports)]
1078        use ::buffa::Enumeration as _;
1079        if let Some(ref v) = self.name {
1080            ::buffa::types::put_string_field(1u32, v, buf);
1081        }
1082        if let Some(ref v) = self.package {
1083            ::buffa::types::put_string_field(2u32, v, buf);
1084        }
1085        for v in &self.dependency {
1086            ::buffa::types::put_string_field(3u32, v, buf);
1087        }
1088        for v in &self.message_type {
1089            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
1090            v.write_to(__cache, buf);
1091        }
1092        for v in &self.enum_type {
1093            ::buffa::types::put_len_delimited_header(5u32, __cache.consume_next(), buf);
1094            v.write_to(__cache, buf);
1095        }
1096        for v in &self.service {
1097            ::buffa::types::put_len_delimited_header(6u32, __cache.consume_next(), buf);
1098            v.write_to(__cache, buf);
1099        }
1100        for v in &self.extension {
1101            ::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
1102            v.write_to(__cache, buf);
1103        }
1104        if self.options.is_set() {
1105            ::buffa::types::put_len_delimited_header(8u32, __cache.consume_next(), buf);
1106            self.options.write_to(__cache, buf);
1107        }
1108        if self.source_code_info.is_set() {
1109            ::buffa::types::put_len_delimited_header(9u32, __cache.consume_next(), buf);
1110            self.source_code_info.write_to(__cache, buf);
1111        }
1112        for v in &self.public_dependency {
1113            ::buffa::types::put_int32_field(10u32, *v, buf);
1114        }
1115        for v in &self.weak_dependency {
1116            ::buffa::types::put_int32_field(11u32, *v, buf);
1117        }
1118        if let Some(ref v) = self.syntax {
1119            ::buffa::types::put_string_field(12u32, v, buf);
1120        }
1121        if let Some(ref v) = self.edition {
1122            ::buffa::types::put_int32_field(14u32, v.to_i32(), buf);
1123        }
1124        for v in &self.option_dependency {
1125            ::buffa::types::put_string_field(15u32, v, buf);
1126        }
1127        self.__buffa_unknown_fields.write_to(buf);
1128    }
1129    fn merge_field(
1130        &mut self,
1131        tag: ::buffa::encoding::Tag,
1132        buf: &mut impl ::buffa::bytes::Buf,
1133        ctx: ::buffa::DecodeContext<'_>,
1134    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1135        #[allow(unused_imports)]
1136        use ::buffa::bytes::Buf as _;
1137        #[allow(unused_imports)]
1138        use ::buffa::Enumeration as _;
1139        match tag.field_number() {
1140            1u32 => {
1141                ::buffa::encoding::check_wire_type(
1142                    tag,
1143                    ::buffa::encoding::WireType::LengthDelimited,
1144                )?;
1145                ::buffa::types::merge_string(
1146                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1147                    buf,
1148                )?;
1149            }
1150            2u32 => {
1151                ::buffa::encoding::check_wire_type(
1152                    tag,
1153                    ::buffa::encoding::WireType::LengthDelimited,
1154                )?;
1155                ::buffa::types::merge_string(
1156                    self.package.get_or_insert_with(::buffa::alloc::string::String::new),
1157                    buf,
1158                )?;
1159            }
1160            3u32 => {
1161                ::buffa::encoding::check_wire_type(
1162                    tag,
1163                    ::buffa::encoding::WireType::LengthDelimited,
1164                )?;
1165                self.dependency.push(::buffa::types::decode_string(buf)?);
1166            }
1167            4u32 => {
1168                ::buffa::encoding::check_wire_type(
1169                    tag,
1170                    ::buffa::encoding::WireType::LengthDelimited,
1171                )?;
1172                let mut elem = ::core::default::Default::default();
1173                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1174                self.message_type.push(elem);
1175            }
1176            5u32 => {
1177                ::buffa::encoding::check_wire_type(
1178                    tag,
1179                    ::buffa::encoding::WireType::LengthDelimited,
1180                )?;
1181                let mut elem = ::core::default::Default::default();
1182                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1183                self.enum_type.push(elem);
1184            }
1185            6u32 => {
1186                ::buffa::encoding::check_wire_type(
1187                    tag,
1188                    ::buffa::encoding::WireType::LengthDelimited,
1189                )?;
1190                let mut elem = ::core::default::Default::default();
1191                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1192                self.service.push(elem);
1193            }
1194            7u32 => {
1195                ::buffa::encoding::check_wire_type(
1196                    tag,
1197                    ::buffa::encoding::WireType::LengthDelimited,
1198                )?;
1199                let mut elem = ::core::default::Default::default();
1200                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1201                self.extension.push(elem);
1202            }
1203            8u32 => {
1204                ::buffa::encoding::check_wire_type(
1205                    tag,
1206                    ::buffa::encoding::WireType::LengthDelimited,
1207                )?;
1208                ::buffa::Message::merge_length_delimited(
1209                    self.options.get_or_insert_default(),
1210                    buf,
1211                    ctx,
1212                )?;
1213            }
1214            9u32 => {
1215                ::buffa::encoding::check_wire_type(
1216                    tag,
1217                    ::buffa::encoding::WireType::LengthDelimited,
1218                )?;
1219                ::buffa::Message::merge_length_delimited(
1220                    self.source_code_info.get_or_insert_default(),
1221                    buf,
1222                    ctx,
1223                )?;
1224            }
1225            10u32 => {
1226                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1227                    let len = ::buffa::encoding::decode_varint(buf)?;
1228                    let len = usize::try_from(len)
1229                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1230                    if buf.remaining() < len {
1231                        return ::core::result::Result::Err(
1232                            ::buffa::DecodeError::UnexpectedEof,
1233                        );
1234                    }
1235                    self.public_dependency.reserve(len);
1236                    let mut limited = buf.take(len);
1237                    while limited.has_remaining() {
1238                        self.public_dependency
1239                            .push(::buffa::types::decode_int32(&mut limited)?);
1240                    }
1241                    let leftover = limited.remaining();
1242                    if leftover > 0 {
1243                        limited.advance(leftover);
1244                    }
1245                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1246                    self.public_dependency.push(::buffa::types::decode_int32(buf)?);
1247                } else {
1248                    return ::core::result::Result::Err(
1249                        ::buffa::encoding::wire_type_mismatch(
1250                            tag,
1251                            ::buffa::encoding::WireType::LengthDelimited,
1252                        ),
1253                    );
1254                }
1255            }
1256            11u32 => {
1257                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1258                    let len = ::buffa::encoding::decode_varint(buf)?;
1259                    let len = usize::try_from(len)
1260                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1261                    if buf.remaining() < len {
1262                        return ::core::result::Result::Err(
1263                            ::buffa::DecodeError::UnexpectedEof,
1264                        );
1265                    }
1266                    self.weak_dependency.reserve(len);
1267                    let mut limited = buf.take(len);
1268                    while limited.has_remaining() {
1269                        self.weak_dependency
1270                            .push(::buffa::types::decode_int32(&mut limited)?);
1271                    }
1272                    let leftover = limited.remaining();
1273                    if leftover > 0 {
1274                        limited.advance(leftover);
1275                    }
1276                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1277                    self.weak_dependency.push(::buffa::types::decode_int32(buf)?);
1278                } else {
1279                    return ::core::result::Result::Err(
1280                        ::buffa::encoding::wire_type_mismatch(
1281                            tag,
1282                            ::buffa::encoding::WireType::LengthDelimited,
1283                        ),
1284                    );
1285                }
1286            }
1287            12u32 => {
1288                ::buffa::encoding::check_wire_type(
1289                    tag,
1290                    ::buffa::encoding::WireType::LengthDelimited,
1291                )?;
1292                ::buffa::types::merge_string(
1293                    self.syntax.get_or_insert_with(::buffa::alloc::string::String::new),
1294                    buf,
1295                )?;
1296            }
1297            14u32 => {
1298                ::buffa::encoding::check_wire_type(
1299                    tag,
1300                    ::buffa::encoding::WireType::Varint,
1301                )?;
1302                let __raw = ::buffa::types::decode_int32(buf)?;
1303                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
1304                    __raw,
1305                ) {
1306                    self.edition = ::core::option::Option::Some(__v);
1307                } else {
1308                    self.__buffa_unknown_fields
1309                        .push(::buffa::UnknownField {
1310                            number: 14u32,
1311                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
1312                        });
1313                }
1314            }
1315            15u32 => {
1316                ::buffa::encoding::check_wire_type(
1317                    tag,
1318                    ::buffa::encoding::WireType::LengthDelimited,
1319                )?;
1320                self.option_dependency.push(::buffa::types::decode_string(buf)?);
1321            }
1322            _ => {
1323                self.__buffa_unknown_fields
1324                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1325            }
1326        }
1327        ::core::result::Result::Ok(())
1328    }
1329    fn clear(&mut self) {
1330        self.name = ::core::option::Option::None;
1331        self.package = ::core::option::Option::None;
1332        self.dependency.clear();
1333        self.message_type.clear();
1334        self.enum_type.clear();
1335        self.service.clear();
1336        self.extension.clear();
1337        self.options = ::buffa::MessageField::none();
1338        self.source_code_info = ::buffa::MessageField::none();
1339        self.public_dependency.clear();
1340        self.weak_dependency.clear();
1341        self.syntax = ::core::option::Option::None;
1342        self.edition = ::core::option::Option::None;
1343        self.option_dependency.clear();
1344        self.__buffa_unknown_fields.clear();
1345    }
1346}
1347impl ::buffa::ExtensionSet for FileDescriptorProto {
1348    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto";
1349    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1350        &self.__buffa_unknown_fields
1351    }
1352    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1353        &mut self.__buffa_unknown_fields
1354    }
1355}
1356#[cfg(feature = "text")]
1357impl ::buffa::text::TextFormat for FileDescriptorProto {
1358    fn encode_text(
1359        &self,
1360        enc: &mut ::buffa::text::TextEncoder<'_>,
1361    ) -> ::core::fmt::Result {
1362        #[allow(unused_imports)]
1363        use ::buffa::Enumeration as _;
1364        if let ::core::option::Option::Some(ref __v) = self.name {
1365            enc.write_field_name("name")?;
1366            enc.write_string(__v)?;
1367        }
1368        if let ::core::option::Option::Some(ref __v) = self.package {
1369            enc.write_field_name("package")?;
1370            enc.write_string(__v)?;
1371        }
1372        if self.options.is_set() {
1373            enc.write_field_name("options")?;
1374            enc.write_message(&*self.options)?;
1375        }
1376        if self.source_code_info.is_set() {
1377            enc.write_field_name("source_code_info")?;
1378            enc.write_message(&*self.source_code_info)?;
1379        }
1380        if let ::core::option::Option::Some(ref __v) = self.syntax {
1381            enc.write_field_name("syntax")?;
1382            enc.write_string(__v)?;
1383        }
1384        if let ::core::option::Option::Some(ref __v) = self.edition {
1385            enc.write_field_name("edition")?;
1386            enc.write_enum_name(__v.proto_name())?;
1387        }
1388        for __v in &self.dependency {
1389            enc.write_field_name("dependency")?;
1390            enc.write_string(__v)?;
1391        }
1392        for __v in &self.public_dependency {
1393            enc.write_field_name("public_dependency")?;
1394            enc.write_i32(*__v)?;
1395        }
1396        for __v in &self.weak_dependency {
1397            enc.write_field_name("weak_dependency")?;
1398            enc.write_i32(*__v)?;
1399        }
1400        for __v in &self.option_dependency {
1401            enc.write_field_name("option_dependency")?;
1402            enc.write_string(__v)?;
1403        }
1404        for __v in &self.message_type {
1405            enc.write_field_name("message_type")?;
1406            enc.write_message(__v)?;
1407        }
1408        for __v in &self.enum_type {
1409            enc.write_field_name("enum_type")?;
1410            enc.write_message(__v)?;
1411        }
1412        for __v in &self.service {
1413            enc.write_field_name("service")?;
1414            enc.write_message(__v)?;
1415        }
1416        for __v in &self.extension {
1417            enc.write_field_name("extension")?;
1418            enc.write_message(__v)?;
1419        }
1420        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1421        ::core::result::Result::Ok(())
1422    }
1423    fn merge_text(
1424        &mut self,
1425        dec: &mut ::buffa::text::TextDecoder<'_>,
1426    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1427        #[allow(unused_imports)]
1428        use ::buffa::Enumeration as _;
1429        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1430            match __name {
1431                "name" => {
1432                    self.name = ::core::option::Option::Some(
1433                        dec.read_string()?.into_owned(),
1434                    );
1435                }
1436                "package" => {
1437                    self.package = ::core::option::Option::Some(
1438                        dec.read_string()?.into_owned(),
1439                    );
1440                }
1441                "options" => dec.merge_message(self.options.get_or_insert_default())?,
1442                "source_code_info" => {
1443                    dec.merge_message(self.source_code_info.get_or_insert_default())?
1444                }
1445                "syntax" => {
1446                    self.syntax = ::core::option::Option::Some(
1447                        dec.read_string()?.into_owned(),
1448                    );
1449                }
1450                "edition" => {
1451                    self.edition = ::core::option::Option::Some(
1452                        dec.read_closed_enum_by_name::<Edition>()?,
1453                    );
1454                }
1455                "dependency" => {
1456                    dec.read_repeated_into(
1457                        &mut self.dependency,
1458                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1459                    )?
1460                }
1461                "public_dependency" => {
1462                    dec.read_repeated_into(
1463                        &mut self.public_dependency,
1464                        |__d| __d.read_i32(),
1465                    )?
1466                }
1467                "weak_dependency" => {
1468                    dec.read_repeated_into(
1469                        &mut self.weak_dependency,
1470                        |__d| __d.read_i32(),
1471                    )?
1472                }
1473                "option_dependency" => {
1474                    dec.read_repeated_into(
1475                        &mut self.option_dependency,
1476                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1477                    )?
1478                }
1479                "message_type" => {
1480                    dec.read_repeated_into(
1481                        &mut self.message_type,
1482                        |__d| {
1483                            let mut __m = ::core::default::Default::default();
1484                            __d.merge_message(&mut __m)?;
1485                            ::core::result::Result::Ok(__m)
1486                        },
1487                    )?
1488                }
1489                "enum_type" => {
1490                    dec.read_repeated_into(
1491                        &mut self.enum_type,
1492                        |__d| {
1493                            let mut __m = ::core::default::Default::default();
1494                            __d.merge_message(&mut __m)?;
1495                            ::core::result::Result::Ok(__m)
1496                        },
1497                    )?
1498                }
1499                "service" => {
1500                    dec.read_repeated_into(
1501                        &mut self.service,
1502                        |__d| {
1503                            let mut __m = ::core::default::Default::default();
1504                            __d.merge_message(&mut __m)?;
1505                            ::core::result::Result::Ok(__m)
1506                        },
1507                    )?
1508                }
1509                "extension" => {
1510                    dec.read_repeated_into(
1511                        &mut self.extension,
1512                        |__d| {
1513                            let mut __m = ::core::default::Default::default();
1514                            __d.merge_message(&mut __m)?;
1515                            ::core::result::Result::Ok(__m)
1516                        },
1517                    )?
1518                }
1519                _ => dec.skip_value()?,
1520            }
1521        }
1522        ::core::result::Result::Ok(())
1523    }
1524}
1525#[cfg(feature = "json")]
1526impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorProto {
1527    fn serialize_proto_json<S: ::serde::Serializer>(
1528        v: &Self,
1529        s: S,
1530    ) -> ::core::result::Result<S::Ok, S::Error> {
1531        ::serde::Serialize::serialize(v, s)
1532    }
1533    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1534        d: D,
1535    ) -> ::core::result::Result<Self, D::Error> {
1536        <Self as ::serde::Deserialize>::deserialize(d)
1537    }
1538}
1539#[cfg(feature = "json")]
1540#[doc(hidden)]
1541pub const __FILE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1542    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1543    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorProto>,
1544    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorProto>,
1545    is_wkt: false,
1546};
1547#[cfg(feature = "text")]
1548#[doc(hidden)]
1549pub const __FILE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1550    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1551    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorProto>,
1552    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorProto>,
1553};
1554/// Describes a message type.
1555#[derive(Clone, PartialEq, Default)]
1556#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
1557#[cfg_attr(feature = "json", serde(default))]
1558#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1559pub struct DescriptorProto {
1560    /// Field 1: `name`
1561    #[cfg_attr(
1562        feature = "json",
1563        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
1564    )]
1565    pub name: ::core::option::Option<::buffa::alloc::string::String>,
1566    /// Field 2: `field`
1567    #[cfg_attr(
1568        feature = "json",
1569        serde(
1570            rename = "field",
1571            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1572            deserialize_with = "::buffa::json_helpers::null_as_default"
1573        )
1574    )]
1575    pub field: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1576    /// Field 6: `extension`
1577    #[cfg_attr(
1578        feature = "json",
1579        serde(
1580            rename = "extension",
1581            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1582            deserialize_with = "::buffa::json_helpers::null_as_default"
1583        )
1584    )]
1585    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1586    /// Field 3: `nested_type`
1587    #[cfg_attr(
1588        feature = "json",
1589        serde(
1590            rename = "nestedType",
1591            alias = "nested_type",
1592            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1593            deserialize_with = "::buffa::json_helpers::null_as_default"
1594        )
1595    )]
1596    pub nested_type: ::buffa::alloc::vec::Vec<Self>,
1597    /// Field 4: `enum_type`
1598    #[cfg_attr(
1599        feature = "json",
1600        serde(
1601            rename = "enumType",
1602            alias = "enum_type",
1603            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1604            deserialize_with = "::buffa::json_helpers::null_as_default"
1605        )
1606    )]
1607    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
1608    /// Field 5: `extension_range`
1609    #[cfg_attr(
1610        feature = "json",
1611        serde(
1612            rename = "extensionRange",
1613            alias = "extension_range",
1614            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1615            deserialize_with = "::buffa::json_helpers::null_as_default"
1616        )
1617    )]
1618    pub extension_range: ::buffa::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
1619    /// Field 8: `oneof_decl`
1620    #[cfg_attr(
1621        feature = "json",
1622        serde(
1623            rename = "oneofDecl",
1624            alias = "oneof_decl",
1625            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1626            deserialize_with = "::buffa::json_helpers::null_as_default"
1627        )
1628    )]
1629    pub oneof_decl: ::buffa::alloc::vec::Vec<OneofDescriptorProto>,
1630    /// Field 7: `options`
1631    #[cfg_attr(
1632        feature = "json",
1633        serde(
1634            rename = "options",
1635            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1636        )
1637    )]
1638    pub options: ::buffa::MessageField<MessageOptions>,
1639    /// Field 9: `reserved_range`
1640    #[cfg_attr(
1641        feature = "json",
1642        serde(
1643            rename = "reservedRange",
1644            alias = "reserved_range",
1645            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1646            deserialize_with = "::buffa::json_helpers::null_as_default"
1647        )
1648    )]
1649    pub reserved_range: ::buffa::alloc::vec::Vec<descriptor_proto::ReservedRange>,
1650    /// Reserved field names, which may not be used by fields in the same message.
1651    /// A given name may only be reserved once.
1652    ///
1653    /// Field 10: `reserved_name`
1654    #[cfg_attr(
1655        feature = "json",
1656        serde(
1657            rename = "reservedName",
1658            alias = "reserved_name",
1659            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1660            deserialize_with = "::buffa::json_helpers::null_as_default"
1661        )
1662    )]
1663    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1664    /// Support for `export` and `local` keywords on enums.
1665    ///
1666    /// Field 11: `visibility`
1667    #[cfg_attr(
1668        feature = "json",
1669        serde(
1670            rename = "visibility",
1671            with = "::buffa::json_helpers::opt_closed_enum",
1672            skip_serializing_if = "::core::option::Option::is_none"
1673        )
1674    )]
1675    pub visibility: ::core::option::Option<SymbolVisibility>,
1676    #[cfg_attr(feature = "json", serde(skip))]
1677    #[doc(hidden)]
1678    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1679}
1680impl ::core::fmt::Debug for DescriptorProto {
1681    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1682        f.debug_struct("DescriptorProto")
1683            .field("name", &self.name)
1684            .field("field", &self.field)
1685            .field("extension", &self.extension)
1686            .field("nested_type", &self.nested_type)
1687            .field("enum_type", &self.enum_type)
1688            .field("extension_range", &self.extension_range)
1689            .field("oneof_decl", &self.oneof_decl)
1690            .field("options", &self.options)
1691            .field("reserved_range", &self.reserved_range)
1692            .field("reserved_name", &self.reserved_name)
1693            .field("visibility", &self.visibility)
1694            .finish()
1695    }
1696}
1697impl DescriptorProto {
1698    /// Protobuf type URL for this message, for use with `Any::pack` and
1699    /// `Any::unpack_if`.
1700    ///
1701    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1702    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1703}
1704impl DescriptorProto {
1705    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1706    #[inline]
1707    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
1708    pub fn with_name(
1709        mut self,
1710        value: impl Into<::buffa::alloc::string::String>,
1711    ) -> Self {
1712        self.name = Some(value.into());
1713        self
1714    }
1715    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1716    #[inline]
1717    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
1718    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
1719        self.visibility = Some(value.into());
1720        self
1721    }
1722}
1723::buffa::impl_default_instance!(DescriptorProto);
1724impl ::buffa::MessageName for DescriptorProto {
1725    const PACKAGE: &'static str = "google.protobuf";
1726    const NAME: &'static str = "DescriptorProto";
1727    const FULL_NAME: &'static str = "google.protobuf.DescriptorProto";
1728    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1729}
1730impl ::buffa::Message for DescriptorProto {
1731    /// Returns the total encoded size in bytes.
1732    ///
1733    /// The result is a `u32`; the protobuf specification requires all
1734    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1735    /// compliant message will never overflow this type.
1736    #[allow(clippy::let_and_return)]
1737    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1738        #[allow(unused_imports)]
1739        use ::buffa::Enumeration as _;
1740        let mut size = 0u32;
1741        if let Some(ref v) = self.name {
1742            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1743        }
1744        for v in &self.field {
1745            let __slot = __cache.reserve();
1746            let inner_size = v.compute_size(__cache);
1747            __cache.set(__slot, inner_size);
1748            size
1749                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1750                    + inner_size;
1751        }
1752        for v in &self.nested_type {
1753            let __slot = __cache.reserve();
1754            let inner_size = v.compute_size(__cache);
1755            __cache.set(__slot, inner_size);
1756            size
1757                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1758                    + inner_size;
1759        }
1760        for v in &self.enum_type {
1761            let __slot = __cache.reserve();
1762            let inner_size = v.compute_size(__cache);
1763            __cache.set(__slot, inner_size);
1764            size
1765                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1766                    + inner_size;
1767        }
1768        for v in &self.extension_range {
1769            let __slot = __cache.reserve();
1770            let inner_size = v.compute_size(__cache);
1771            __cache.set(__slot, inner_size);
1772            size
1773                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1774                    + inner_size;
1775        }
1776        for v in &self.extension {
1777            let __slot = __cache.reserve();
1778            let inner_size = v.compute_size(__cache);
1779            __cache.set(__slot, inner_size);
1780            size
1781                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1782                    + inner_size;
1783        }
1784        if self.options.is_set() {
1785            let __slot = __cache.reserve();
1786            let inner_size = self.options.compute_size(__cache);
1787            __cache.set(__slot, inner_size);
1788            size
1789                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1790                    + inner_size;
1791        }
1792        for v in &self.oneof_decl {
1793            let __slot = __cache.reserve();
1794            let inner_size = v.compute_size(__cache);
1795            __cache.set(__slot, inner_size);
1796            size
1797                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1798                    + inner_size;
1799        }
1800        for v in &self.reserved_range {
1801            let __slot = __cache.reserve();
1802            let inner_size = v.compute_size(__cache);
1803            __cache.set(__slot, inner_size);
1804            size
1805                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1806                    + inner_size;
1807        }
1808        for v in &self.reserved_name {
1809            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1810        }
1811        if let Some(ref v) = self.visibility {
1812            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
1813        }
1814        size += self.__buffa_unknown_fields.encoded_len() as u32;
1815        size
1816    }
1817    fn write_to(
1818        &self,
1819        __cache: &mut ::buffa::SizeCache,
1820        buf: &mut impl ::buffa::bytes::BufMut,
1821    ) {
1822        #[allow(unused_imports)]
1823        use ::buffa::Enumeration as _;
1824        if let Some(ref v) = self.name {
1825            ::buffa::types::put_string_field(1u32, v, buf);
1826        }
1827        for v in &self.field {
1828            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
1829            v.write_to(__cache, buf);
1830        }
1831        for v in &self.nested_type {
1832            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
1833            v.write_to(__cache, buf);
1834        }
1835        for v in &self.enum_type {
1836            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
1837            v.write_to(__cache, buf);
1838        }
1839        for v in &self.extension_range {
1840            ::buffa::types::put_len_delimited_header(5u32, __cache.consume_next(), buf);
1841            v.write_to(__cache, buf);
1842        }
1843        for v in &self.extension {
1844            ::buffa::types::put_len_delimited_header(6u32, __cache.consume_next(), buf);
1845            v.write_to(__cache, buf);
1846        }
1847        if self.options.is_set() {
1848            ::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
1849            self.options.write_to(__cache, buf);
1850        }
1851        for v in &self.oneof_decl {
1852            ::buffa::types::put_len_delimited_header(8u32, __cache.consume_next(), buf);
1853            v.write_to(__cache, buf);
1854        }
1855        for v in &self.reserved_range {
1856            ::buffa::types::put_len_delimited_header(9u32, __cache.consume_next(), buf);
1857            v.write_to(__cache, buf);
1858        }
1859        for v in &self.reserved_name {
1860            ::buffa::types::put_string_field(10u32, v, buf);
1861        }
1862        if let Some(ref v) = self.visibility {
1863            ::buffa::types::put_int32_field(11u32, v.to_i32(), buf);
1864        }
1865        self.__buffa_unknown_fields.write_to(buf);
1866    }
1867    fn merge_field(
1868        &mut self,
1869        tag: ::buffa::encoding::Tag,
1870        buf: &mut impl ::buffa::bytes::Buf,
1871        ctx: ::buffa::DecodeContext<'_>,
1872    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1873        #[allow(unused_imports)]
1874        use ::buffa::bytes::Buf as _;
1875        #[allow(unused_imports)]
1876        use ::buffa::Enumeration as _;
1877        match tag.field_number() {
1878            1u32 => {
1879                ::buffa::encoding::check_wire_type(
1880                    tag,
1881                    ::buffa::encoding::WireType::LengthDelimited,
1882                )?;
1883                ::buffa::types::merge_string(
1884                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1885                    buf,
1886                )?;
1887            }
1888            2u32 => {
1889                ::buffa::encoding::check_wire_type(
1890                    tag,
1891                    ::buffa::encoding::WireType::LengthDelimited,
1892                )?;
1893                let mut elem = ::core::default::Default::default();
1894                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1895                self.field.push(elem);
1896            }
1897            3u32 => {
1898                ::buffa::encoding::check_wire_type(
1899                    tag,
1900                    ::buffa::encoding::WireType::LengthDelimited,
1901                )?;
1902                let mut elem = ::core::default::Default::default();
1903                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1904                self.nested_type.push(elem);
1905            }
1906            4u32 => {
1907                ::buffa::encoding::check_wire_type(
1908                    tag,
1909                    ::buffa::encoding::WireType::LengthDelimited,
1910                )?;
1911                let mut elem = ::core::default::Default::default();
1912                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1913                self.enum_type.push(elem);
1914            }
1915            5u32 => {
1916                ::buffa::encoding::check_wire_type(
1917                    tag,
1918                    ::buffa::encoding::WireType::LengthDelimited,
1919                )?;
1920                let mut elem = ::core::default::Default::default();
1921                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1922                self.extension_range.push(elem);
1923            }
1924            6u32 => {
1925                ::buffa::encoding::check_wire_type(
1926                    tag,
1927                    ::buffa::encoding::WireType::LengthDelimited,
1928                )?;
1929                let mut elem = ::core::default::Default::default();
1930                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1931                self.extension.push(elem);
1932            }
1933            7u32 => {
1934                ::buffa::encoding::check_wire_type(
1935                    tag,
1936                    ::buffa::encoding::WireType::LengthDelimited,
1937                )?;
1938                ::buffa::Message::merge_length_delimited(
1939                    self.options.get_or_insert_default(),
1940                    buf,
1941                    ctx,
1942                )?;
1943            }
1944            8u32 => {
1945                ::buffa::encoding::check_wire_type(
1946                    tag,
1947                    ::buffa::encoding::WireType::LengthDelimited,
1948                )?;
1949                let mut elem = ::core::default::Default::default();
1950                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1951                self.oneof_decl.push(elem);
1952            }
1953            9u32 => {
1954                ::buffa::encoding::check_wire_type(
1955                    tag,
1956                    ::buffa::encoding::WireType::LengthDelimited,
1957                )?;
1958                let mut elem = ::core::default::Default::default();
1959                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1960                self.reserved_range.push(elem);
1961            }
1962            10u32 => {
1963                ::buffa::encoding::check_wire_type(
1964                    tag,
1965                    ::buffa::encoding::WireType::LengthDelimited,
1966                )?;
1967                self.reserved_name.push(::buffa::types::decode_string(buf)?);
1968            }
1969            11u32 => {
1970                ::buffa::encoding::check_wire_type(
1971                    tag,
1972                    ::buffa::encoding::WireType::Varint,
1973                )?;
1974                let __raw = ::buffa::types::decode_int32(buf)?;
1975                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
1976                    __raw,
1977                ) {
1978                    self.visibility = ::core::option::Option::Some(__v);
1979                } else {
1980                    self.__buffa_unknown_fields
1981                        .push(::buffa::UnknownField {
1982                            number: 11u32,
1983                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
1984                        });
1985                }
1986            }
1987            _ => {
1988                self.__buffa_unknown_fields
1989                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1990            }
1991        }
1992        ::core::result::Result::Ok(())
1993    }
1994    fn clear(&mut self) {
1995        self.name = ::core::option::Option::None;
1996        self.field.clear();
1997        self.nested_type.clear();
1998        self.enum_type.clear();
1999        self.extension_range.clear();
2000        self.extension.clear();
2001        self.options = ::buffa::MessageField::none();
2002        self.oneof_decl.clear();
2003        self.reserved_range.clear();
2004        self.reserved_name.clear();
2005        self.visibility = ::core::option::Option::None;
2006        self.__buffa_unknown_fields.clear();
2007    }
2008}
2009impl ::buffa::ExtensionSet for DescriptorProto {
2010    const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto";
2011    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2012        &self.__buffa_unknown_fields
2013    }
2014    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2015        &mut self.__buffa_unknown_fields
2016    }
2017}
2018#[cfg(feature = "text")]
2019impl ::buffa::text::TextFormat for DescriptorProto {
2020    fn encode_text(
2021        &self,
2022        enc: &mut ::buffa::text::TextEncoder<'_>,
2023    ) -> ::core::fmt::Result {
2024        #[allow(unused_imports)]
2025        use ::buffa::Enumeration as _;
2026        if let ::core::option::Option::Some(ref __v) = self.name {
2027            enc.write_field_name("name")?;
2028            enc.write_string(__v)?;
2029        }
2030        if self.options.is_set() {
2031            enc.write_field_name("options")?;
2032            enc.write_message(&*self.options)?;
2033        }
2034        if let ::core::option::Option::Some(ref __v) = self.visibility {
2035            enc.write_field_name("visibility")?;
2036            enc.write_enum_name(__v.proto_name())?;
2037        }
2038        for __v in &self.field {
2039            enc.write_field_name("field")?;
2040            enc.write_message(__v)?;
2041        }
2042        for __v in &self.extension {
2043            enc.write_field_name("extension")?;
2044            enc.write_message(__v)?;
2045        }
2046        for __v in &self.nested_type {
2047            enc.write_field_name("nested_type")?;
2048            enc.write_message(__v)?;
2049        }
2050        for __v in &self.enum_type {
2051            enc.write_field_name("enum_type")?;
2052            enc.write_message(__v)?;
2053        }
2054        for __v in &self.extension_range {
2055            enc.write_field_name("extension_range")?;
2056            enc.write_message(__v)?;
2057        }
2058        for __v in &self.oneof_decl {
2059            enc.write_field_name("oneof_decl")?;
2060            enc.write_message(__v)?;
2061        }
2062        for __v in &self.reserved_range {
2063            enc.write_field_name("reserved_range")?;
2064            enc.write_message(__v)?;
2065        }
2066        for __v in &self.reserved_name {
2067            enc.write_field_name("reserved_name")?;
2068            enc.write_string(__v)?;
2069        }
2070        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2071        ::core::result::Result::Ok(())
2072    }
2073    fn merge_text(
2074        &mut self,
2075        dec: &mut ::buffa::text::TextDecoder<'_>,
2076    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2077        #[allow(unused_imports)]
2078        use ::buffa::Enumeration as _;
2079        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2080            match __name {
2081                "name" => {
2082                    self.name = ::core::option::Option::Some(
2083                        dec.read_string()?.into_owned(),
2084                    );
2085                }
2086                "options" => dec.merge_message(self.options.get_or_insert_default())?,
2087                "visibility" => {
2088                    self.visibility = ::core::option::Option::Some(
2089                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
2090                    );
2091                }
2092                "field" => {
2093                    dec.read_repeated_into(
2094                        &mut self.field,
2095                        |__d| {
2096                            let mut __m = ::core::default::Default::default();
2097                            __d.merge_message(&mut __m)?;
2098                            ::core::result::Result::Ok(__m)
2099                        },
2100                    )?
2101                }
2102                "extension" => {
2103                    dec.read_repeated_into(
2104                        &mut self.extension,
2105                        |__d| {
2106                            let mut __m = ::core::default::Default::default();
2107                            __d.merge_message(&mut __m)?;
2108                            ::core::result::Result::Ok(__m)
2109                        },
2110                    )?
2111                }
2112                "nested_type" => {
2113                    dec.read_repeated_into(
2114                        &mut self.nested_type,
2115                        |__d| {
2116                            let mut __m = ::core::default::Default::default();
2117                            __d.merge_message(&mut __m)?;
2118                            ::core::result::Result::Ok(__m)
2119                        },
2120                    )?
2121                }
2122                "enum_type" => {
2123                    dec.read_repeated_into(
2124                        &mut self.enum_type,
2125                        |__d| {
2126                            let mut __m = ::core::default::Default::default();
2127                            __d.merge_message(&mut __m)?;
2128                            ::core::result::Result::Ok(__m)
2129                        },
2130                    )?
2131                }
2132                "extension_range" => {
2133                    dec.read_repeated_into(
2134                        &mut self.extension_range,
2135                        |__d| {
2136                            let mut __m = ::core::default::Default::default();
2137                            __d.merge_message(&mut __m)?;
2138                            ::core::result::Result::Ok(__m)
2139                        },
2140                    )?
2141                }
2142                "oneof_decl" => {
2143                    dec.read_repeated_into(
2144                        &mut self.oneof_decl,
2145                        |__d| {
2146                            let mut __m = ::core::default::Default::default();
2147                            __d.merge_message(&mut __m)?;
2148                            ::core::result::Result::Ok(__m)
2149                        },
2150                    )?
2151                }
2152                "reserved_range" => {
2153                    dec.read_repeated_into(
2154                        &mut self.reserved_range,
2155                        |__d| {
2156                            let mut __m = ::core::default::Default::default();
2157                            __d.merge_message(&mut __m)?;
2158                            ::core::result::Result::Ok(__m)
2159                        },
2160                    )?
2161                }
2162                "reserved_name" => {
2163                    dec.read_repeated_into(
2164                        &mut self.reserved_name,
2165                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
2166                    )?
2167                }
2168                _ => dec.skip_value()?,
2169            }
2170        }
2171        ::core::result::Result::Ok(())
2172    }
2173}
2174#[cfg(feature = "json")]
2175impl ::buffa::json_helpers::ProtoElemJson for DescriptorProto {
2176    fn serialize_proto_json<S: ::serde::Serializer>(
2177        v: &Self,
2178        s: S,
2179    ) -> ::core::result::Result<S::Ok, S::Error> {
2180        ::serde::Serialize::serialize(v, s)
2181    }
2182    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2183        d: D,
2184    ) -> ::core::result::Result<Self, D::Error> {
2185        <Self as ::serde::Deserialize>::deserialize(d)
2186    }
2187}
2188#[cfg(feature = "json")]
2189#[doc(hidden)]
2190pub const __DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2191    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2192    to_json: ::buffa::type_registry::any_to_json::<DescriptorProto>,
2193    from_json: ::buffa::type_registry::any_from_json::<DescriptorProto>,
2194    is_wkt: false,
2195};
2196#[cfg(feature = "text")]
2197#[doc(hidden)]
2198pub const __DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2199    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2200    text_encode: ::buffa::type_registry::any_encode_text::<DescriptorProto>,
2201    text_merge: ::buffa::type_registry::any_merge_text::<DescriptorProto>,
2202};
2203pub mod descriptor_proto {
2204    #[allow(unused_imports)]
2205    use super::*;
2206    #[derive(Clone, PartialEq, Default)]
2207    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2208    #[cfg_attr(feature = "json", serde(default))]
2209    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2210    pub struct ExtensionRange {
2211        /// Inclusive.
2212        ///
2213        /// Field 1: `start`
2214        #[cfg_attr(
2215            feature = "json",
2216            serde(
2217                rename = "start",
2218                with = "::buffa::json_helpers::opt_int32",
2219                skip_serializing_if = "::core::option::Option::is_none"
2220            )
2221        )]
2222        pub start: ::core::option::Option<i32>,
2223        /// Exclusive.
2224        ///
2225        /// Field 2: `end`
2226        #[cfg_attr(
2227            feature = "json",
2228            serde(
2229                rename = "end",
2230                with = "::buffa::json_helpers::opt_int32",
2231                skip_serializing_if = "::core::option::Option::is_none"
2232            )
2233        )]
2234        pub end: ::core::option::Option<i32>,
2235        /// Field 3: `options`
2236        #[cfg_attr(
2237            feature = "json",
2238            serde(
2239                rename = "options",
2240                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2241            )
2242        )]
2243        pub options: ::buffa::MessageField<super::ExtensionRangeOptions>,
2244        #[cfg_attr(feature = "json", serde(skip))]
2245        #[doc(hidden)]
2246        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2247    }
2248    impl ::core::fmt::Debug for ExtensionRange {
2249        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2250            f.debug_struct("ExtensionRange")
2251                .field("start", &self.start)
2252                .field("end", &self.end)
2253                .field("options", &self.options)
2254                .finish()
2255        }
2256    }
2257    impl ExtensionRange {
2258        /// Protobuf type URL for this message, for use with `Any::pack` and
2259        /// `Any::unpack_if`.
2260        ///
2261        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2262        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2263    }
2264    impl ExtensionRange {
2265        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2266        #[inline]
2267        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2268        pub fn with_start(mut self, value: i32) -> Self {
2269            self.start = Some(value);
2270            self
2271        }
2272        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2273        #[inline]
2274        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2275        pub fn with_end(mut self, value: i32) -> Self {
2276            self.end = Some(value);
2277            self
2278        }
2279    }
2280    ::buffa::impl_default_instance!(ExtensionRange);
2281    impl ::buffa::MessageName for ExtensionRange {
2282        const PACKAGE: &'static str = "google.protobuf";
2283        const NAME: &'static str = "DescriptorProto.ExtensionRange";
2284        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2285        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2286    }
2287    impl ::buffa::Message for ExtensionRange {
2288        /// Returns the total encoded size in bytes.
2289        ///
2290        /// The result is a `u32`; the protobuf specification requires all
2291        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2292        /// compliant message will never overflow this type.
2293        #[allow(clippy::let_and_return)]
2294        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2295            #[allow(unused_imports)]
2296            use ::buffa::Enumeration as _;
2297            let mut size = 0u32;
2298            if let Some(v) = self.start {
2299                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2300            }
2301            if let Some(v) = self.end {
2302                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2303            }
2304            if self.options.is_set() {
2305                let __slot = __cache.reserve();
2306                let inner_size = self.options.compute_size(__cache);
2307                __cache.set(__slot, inner_size);
2308                size
2309                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2310                        + inner_size;
2311            }
2312            size += self.__buffa_unknown_fields.encoded_len() as u32;
2313            size
2314        }
2315        fn write_to(
2316            &self,
2317            __cache: &mut ::buffa::SizeCache,
2318            buf: &mut impl ::buffa::bytes::BufMut,
2319        ) {
2320            #[allow(unused_imports)]
2321            use ::buffa::Enumeration as _;
2322            if let Some(v) = self.start {
2323                ::buffa::types::put_int32_field(1u32, v, buf);
2324            }
2325            if let Some(v) = self.end {
2326                ::buffa::types::put_int32_field(2u32, v, buf);
2327            }
2328            if self.options.is_set() {
2329                ::buffa::types::put_len_delimited_header(
2330                    3u32,
2331                    __cache.consume_next(),
2332                    buf,
2333                );
2334                self.options.write_to(__cache, buf);
2335            }
2336            self.__buffa_unknown_fields.write_to(buf);
2337        }
2338        fn merge_field(
2339            &mut self,
2340            tag: ::buffa::encoding::Tag,
2341            buf: &mut impl ::buffa::bytes::Buf,
2342            ctx: ::buffa::DecodeContext<'_>,
2343        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2344            #[allow(unused_imports)]
2345            use ::buffa::bytes::Buf as _;
2346            #[allow(unused_imports)]
2347            use ::buffa::Enumeration as _;
2348            match tag.field_number() {
2349                1u32 => {
2350                    ::buffa::encoding::check_wire_type(
2351                        tag,
2352                        ::buffa::encoding::WireType::Varint,
2353                    )?;
2354                    self.start = ::core::option::Option::Some(
2355                        ::buffa::types::decode_int32(buf)?,
2356                    );
2357                }
2358                2u32 => {
2359                    ::buffa::encoding::check_wire_type(
2360                        tag,
2361                        ::buffa::encoding::WireType::Varint,
2362                    )?;
2363                    self.end = ::core::option::Option::Some(
2364                        ::buffa::types::decode_int32(buf)?,
2365                    );
2366                }
2367                3u32 => {
2368                    ::buffa::encoding::check_wire_type(
2369                        tag,
2370                        ::buffa::encoding::WireType::LengthDelimited,
2371                    )?;
2372                    ::buffa::Message::merge_length_delimited(
2373                        self.options.get_or_insert_default(),
2374                        buf,
2375                        ctx,
2376                    )?;
2377                }
2378                _ => {
2379                    self.__buffa_unknown_fields
2380                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2381                }
2382            }
2383            ::core::result::Result::Ok(())
2384        }
2385        fn clear(&mut self) {
2386            self.start = ::core::option::Option::None;
2387            self.end = ::core::option::Option::None;
2388            self.options = ::buffa::MessageField::none();
2389            self.__buffa_unknown_fields.clear();
2390        }
2391    }
2392    impl ::buffa::ExtensionSet for ExtensionRange {
2393        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2394        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2395            &self.__buffa_unknown_fields
2396        }
2397        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2398            &mut self.__buffa_unknown_fields
2399        }
2400    }
2401    #[cfg(feature = "text")]
2402    impl ::buffa::text::TextFormat for ExtensionRange {
2403        fn encode_text(
2404            &self,
2405            enc: &mut ::buffa::text::TextEncoder<'_>,
2406        ) -> ::core::fmt::Result {
2407            #[allow(unused_imports)]
2408            use ::buffa::Enumeration as _;
2409            if let ::core::option::Option::Some(ref __v) = self.start {
2410                enc.write_field_name("start")?;
2411                enc.write_i32(*__v)?;
2412            }
2413            if let ::core::option::Option::Some(ref __v) = self.end {
2414                enc.write_field_name("end")?;
2415                enc.write_i32(*__v)?;
2416            }
2417            if self.options.is_set() {
2418                enc.write_field_name("options")?;
2419                enc.write_message(&*self.options)?;
2420            }
2421            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2422            ::core::result::Result::Ok(())
2423        }
2424        fn merge_text(
2425            &mut self,
2426            dec: &mut ::buffa::text::TextDecoder<'_>,
2427        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2428            #[allow(unused_imports)]
2429            use ::buffa::Enumeration as _;
2430            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2431                match __name {
2432                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2433                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2434                    "options" => dec.merge_message(self.options.get_or_insert_default())?,
2435                    _ => dec.skip_value()?,
2436                }
2437            }
2438            ::core::result::Result::Ok(())
2439        }
2440    }
2441    #[cfg(feature = "json")]
2442    impl ::buffa::json_helpers::ProtoElemJson for ExtensionRange {
2443        fn serialize_proto_json<S: ::serde::Serializer>(
2444            v: &Self,
2445            s: S,
2446        ) -> ::core::result::Result<S::Ok, S::Error> {
2447            ::serde::Serialize::serialize(v, s)
2448        }
2449        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2450            d: D,
2451        ) -> ::core::result::Result<Self, D::Error> {
2452            <Self as ::serde::Deserialize>::deserialize(d)
2453        }
2454    }
2455    #[cfg(feature = "json")]
2456    #[doc(hidden)]
2457    pub const __EXTENSION_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2458        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2459        to_json: ::buffa::type_registry::any_to_json::<ExtensionRange>,
2460        from_json: ::buffa::type_registry::any_from_json::<ExtensionRange>,
2461        is_wkt: false,
2462    };
2463    #[cfg(feature = "text")]
2464    #[doc(hidden)]
2465    pub const __EXTENSION_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2466        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2467        text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRange>,
2468        text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRange>,
2469    };
2470    /// Range of reserved tag numbers. Reserved tag numbers may not be used by
2471    /// fields or extension ranges in the same message. Reserved ranges may
2472    /// not overlap.
2473    #[derive(Clone, PartialEq, Default)]
2474    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2475    #[cfg_attr(feature = "json", serde(default))]
2476    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2477    pub struct ReservedRange {
2478        /// Inclusive.
2479        ///
2480        /// Field 1: `start`
2481        #[cfg_attr(
2482            feature = "json",
2483            serde(
2484                rename = "start",
2485                with = "::buffa::json_helpers::opt_int32",
2486                skip_serializing_if = "::core::option::Option::is_none"
2487            )
2488        )]
2489        pub start: ::core::option::Option<i32>,
2490        /// Exclusive.
2491        ///
2492        /// Field 2: `end`
2493        #[cfg_attr(
2494            feature = "json",
2495            serde(
2496                rename = "end",
2497                with = "::buffa::json_helpers::opt_int32",
2498                skip_serializing_if = "::core::option::Option::is_none"
2499            )
2500        )]
2501        pub end: ::core::option::Option<i32>,
2502        #[cfg_attr(feature = "json", serde(skip))]
2503        #[doc(hidden)]
2504        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2505    }
2506    impl ::core::fmt::Debug for ReservedRange {
2507        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2508            f.debug_struct("ReservedRange")
2509                .field("start", &self.start)
2510                .field("end", &self.end)
2511                .finish()
2512        }
2513    }
2514    impl ReservedRange {
2515        /// Protobuf type URL for this message, for use with `Any::pack` and
2516        /// `Any::unpack_if`.
2517        ///
2518        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2519        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2520    }
2521    impl ReservedRange {
2522        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2523        #[inline]
2524        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2525        pub fn with_start(mut self, value: i32) -> Self {
2526            self.start = Some(value);
2527            self
2528        }
2529        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2530        #[inline]
2531        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2532        pub fn with_end(mut self, value: i32) -> Self {
2533            self.end = Some(value);
2534            self
2535        }
2536    }
2537    ::buffa::impl_default_instance!(ReservedRange);
2538    impl ::buffa::MessageName for ReservedRange {
2539        const PACKAGE: &'static str = "google.protobuf";
2540        const NAME: &'static str = "DescriptorProto.ReservedRange";
2541        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2542        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2543    }
2544    impl ::buffa::Message for ReservedRange {
2545        /// Returns the total encoded size in bytes.
2546        ///
2547        /// The result is a `u32`; the protobuf specification requires all
2548        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2549        /// compliant message will never overflow this type.
2550        #[allow(clippy::let_and_return)]
2551        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2552            #[allow(unused_imports)]
2553            use ::buffa::Enumeration as _;
2554            let mut size = 0u32;
2555            if let Some(v) = self.start {
2556                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2557            }
2558            if let Some(v) = self.end {
2559                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2560            }
2561            size += self.__buffa_unknown_fields.encoded_len() as u32;
2562            size
2563        }
2564        fn write_to(
2565            &self,
2566            _cache: &mut ::buffa::SizeCache,
2567            buf: &mut impl ::buffa::bytes::BufMut,
2568        ) {
2569            #[allow(unused_imports)]
2570            use ::buffa::Enumeration as _;
2571            if let Some(v) = self.start {
2572                ::buffa::types::put_int32_field(1u32, v, buf);
2573            }
2574            if let Some(v) = self.end {
2575                ::buffa::types::put_int32_field(2u32, v, buf);
2576            }
2577            self.__buffa_unknown_fields.write_to(buf);
2578        }
2579        fn merge_field(
2580            &mut self,
2581            tag: ::buffa::encoding::Tag,
2582            buf: &mut impl ::buffa::bytes::Buf,
2583            ctx: ::buffa::DecodeContext<'_>,
2584        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2585            #[allow(unused_imports)]
2586            use ::buffa::bytes::Buf as _;
2587            #[allow(unused_imports)]
2588            use ::buffa::Enumeration as _;
2589            match tag.field_number() {
2590                1u32 => {
2591                    ::buffa::encoding::check_wire_type(
2592                        tag,
2593                        ::buffa::encoding::WireType::Varint,
2594                    )?;
2595                    self.start = ::core::option::Option::Some(
2596                        ::buffa::types::decode_int32(buf)?,
2597                    );
2598                }
2599                2u32 => {
2600                    ::buffa::encoding::check_wire_type(
2601                        tag,
2602                        ::buffa::encoding::WireType::Varint,
2603                    )?;
2604                    self.end = ::core::option::Option::Some(
2605                        ::buffa::types::decode_int32(buf)?,
2606                    );
2607                }
2608                _ => {
2609                    self.__buffa_unknown_fields
2610                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2611                }
2612            }
2613            ::core::result::Result::Ok(())
2614        }
2615        fn clear(&mut self) {
2616            self.start = ::core::option::Option::None;
2617            self.end = ::core::option::Option::None;
2618            self.__buffa_unknown_fields.clear();
2619        }
2620    }
2621    impl ::buffa::ExtensionSet for ReservedRange {
2622        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2623        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2624            &self.__buffa_unknown_fields
2625        }
2626        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2627            &mut self.__buffa_unknown_fields
2628        }
2629    }
2630    #[cfg(feature = "text")]
2631    impl ::buffa::text::TextFormat for ReservedRange {
2632        fn encode_text(
2633            &self,
2634            enc: &mut ::buffa::text::TextEncoder<'_>,
2635        ) -> ::core::fmt::Result {
2636            #[allow(unused_imports)]
2637            use ::buffa::Enumeration as _;
2638            if let ::core::option::Option::Some(ref __v) = self.start {
2639                enc.write_field_name("start")?;
2640                enc.write_i32(*__v)?;
2641            }
2642            if let ::core::option::Option::Some(ref __v) = self.end {
2643                enc.write_field_name("end")?;
2644                enc.write_i32(*__v)?;
2645            }
2646            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2647            ::core::result::Result::Ok(())
2648        }
2649        fn merge_text(
2650            &mut self,
2651            dec: &mut ::buffa::text::TextDecoder<'_>,
2652        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2653            #[allow(unused_imports)]
2654            use ::buffa::Enumeration as _;
2655            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2656                match __name {
2657                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2658                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2659                    _ => dec.skip_value()?,
2660                }
2661            }
2662            ::core::result::Result::Ok(())
2663        }
2664    }
2665    #[cfg(feature = "json")]
2666    impl ::buffa::json_helpers::ProtoElemJson for ReservedRange {
2667        fn serialize_proto_json<S: ::serde::Serializer>(
2668            v: &Self,
2669            s: S,
2670        ) -> ::core::result::Result<S::Ok, S::Error> {
2671            ::serde::Serialize::serialize(v, s)
2672        }
2673        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2674            d: D,
2675        ) -> ::core::result::Result<Self, D::Error> {
2676            <Self as ::serde::Deserialize>::deserialize(d)
2677        }
2678    }
2679    #[cfg(feature = "json")]
2680    #[doc(hidden)]
2681    pub const __RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2682        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2683        to_json: ::buffa::type_registry::any_to_json::<ReservedRange>,
2684        from_json: ::buffa::type_registry::any_from_json::<ReservedRange>,
2685        is_wkt: false,
2686    };
2687    #[cfg(feature = "text")]
2688    #[doc(hidden)]
2689    pub const __RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2690        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2691        text_encode: ::buffa::type_registry::any_encode_text::<ReservedRange>,
2692        text_merge: ::buffa::type_registry::any_merge_text::<ReservedRange>,
2693    };
2694    #[cfg(feature = "views")]
2695    #[doc(inline)]
2696    pub use super::__buffa::view::descriptor_proto::ExtensionRangeView;
2697    #[cfg(feature = "views")]
2698    #[doc(inline)]
2699    pub use super::__buffa::view::descriptor_proto::ExtensionRangeOwnedView;
2700    #[cfg(feature = "views")]
2701    #[doc(inline)]
2702    pub use super::__buffa::view::descriptor_proto::ReservedRangeView;
2703    #[cfg(feature = "views")]
2704    #[doc(inline)]
2705    pub use super::__buffa::view::descriptor_proto::ReservedRangeOwnedView;
2706}
2707#[derive(Clone, PartialEq, Default)]
2708#[cfg_attr(feature = "json", derive(::serde::Serialize))]
2709#[cfg_attr(feature = "json", serde(default))]
2710#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2711pub struct ExtensionRangeOptions {
2712    /// The parser stores options it doesn't recognize here. See above.
2713    ///
2714    /// Field 999: `uninterpreted_option`
2715    #[cfg_attr(
2716        feature = "json",
2717        serde(
2718            rename = "uninterpretedOption",
2719            alias = "uninterpreted_option",
2720            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2721            deserialize_with = "::buffa::json_helpers::null_as_default"
2722        )
2723    )]
2724    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
2725    /// For external users: DO NOT USE. We are in the process of open sourcing
2726    /// extension declaration and executing internal cleanups before it can be
2727    /// used externally.
2728    ///
2729    /// Field 2: `declaration`
2730    #[cfg_attr(
2731        feature = "json",
2732        serde(
2733            rename = "declaration",
2734            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2735            deserialize_with = "::buffa::json_helpers::null_as_default"
2736        )
2737    )]
2738    pub declaration: ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
2739    /// Any features defined in the specific edition.
2740    ///
2741    /// Field 50: `features`
2742    #[cfg_attr(
2743        feature = "json",
2744        serde(
2745            rename = "features",
2746            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2747        )
2748    )]
2749    pub features: ::buffa::MessageField<FeatureSet>,
2750    /// The verification state of the range.
2751    /// TODO: flip the default to DECLARATION once all empty ranges
2752    /// are marked as UNVERIFIED.
2753    ///
2754    /// Field 3: `verification`
2755    #[cfg_attr(
2756        feature = "json",
2757        serde(
2758            rename = "verification",
2759            with = "::buffa::json_helpers::opt_closed_enum",
2760            skip_serializing_if = "::core::option::Option::is_none"
2761        )
2762    )]
2763    pub verification: ::core::option::Option<extension_range_options::VerificationState>,
2764    #[cfg_attr(feature = "json", serde(flatten))]
2765    #[doc(hidden)]
2766    pub __buffa_unknown_fields: __ExtensionRangeOptionsExtJson,
2767}
2768impl ::core::fmt::Debug for ExtensionRangeOptions {
2769    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2770        f.debug_struct("ExtensionRangeOptions")
2771            .field("uninterpreted_option", &self.uninterpreted_option)
2772            .field("declaration", &self.declaration)
2773            .field("features", &self.features)
2774            .field("verification", &self.verification)
2775            .finish()
2776    }
2777}
2778impl ExtensionRangeOptions {
2779    /// Protobuf type URL for this message, for use with `Any::pack` and
2780    /// `Any::unpack_if`.
2781    ///
2782    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2783    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2784}
2785impl ExtensionRangeOptions {
2786    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2787    #[inline]
2788    ///Sets [`Self::verification`] to `Some(value)`, consuming and returning `self`.
2789    pub fn with_verification(
2790        mut self,
2791        value: impl Into<extension_range_options::VerificationState>,
2792    ) -> Self {
2793        self.verification = Some(value.into());
2794        self
2795    }
2796}
2797::buffa::impl_default_instance!(ExtensionRangeOptions);
2798impl ::buffa::MessageName for ExtensionRangeOptions {
2799    const PACKAGE: &'static str = "google.protobuf";
2800    const NAME: &'static str = "ExtensionRangeOptions";
2801    const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions";
2802    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2803}
2804impl ::buffa::Message for ExtensionRangeOptions {
2805    /// Returns the total encoded size in bytes.
2806    ///
2807    /// The result is a `u32`; the protobuf specification requires all
2808    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2809    /// compliant message will never overflow this type.
2810    #[allow(clippy::let_and_return)]
2811    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2812        #[allow(unused_imports)]
2813        use ::buffa::Enumeration as _;
2814        let mut size = 0u32;
2815        for v in &self.declaration {
2816            let __slot = __cache.reserve();
2817            let inner_size = v.compute_size(__cache);
2818            __cache.set(__slot, inner_size);
2819            size
2820                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2821                    + inner_size;
2822        }
2823        if let Some(ref v) = self.verification {
2824            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
2825        }
2826        if self.features.is_set() {
2827            let __slot = __cache.reserve();
2828            let inner_size = self.features.compute_size(__cache);
2829            __cache.set(__slot, inner_size);
2830            size
2831                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2832                    + inner_size;
2833        }
2834        for v in &self.uninterpreted_option {
2835            let __slot = __cache.reserve();
2836            let inner_size = v.compute_size(__cache);
2837            __cache.set(__slot, inner_size);
2838            size
2839                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2840                    + inner_size;
2841        }
2842        size += self.__buffa_unknown_fields.encoded_len() as u32;
2843        size
2844    }
2845    fn write_to(
2846        &self,
2847        __cache: &mut ::buffa::SizeCache,
2848        buf: &mut impl ::buffa::bytes::BufMut,
2849    ) {
2850        #[allow(unused_imports)]
2851        use ::buffa::Enumeration as _;
2852        for v in &self.declaration {
2853            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
2854            v.write_to(__cache, buf);
2855        }
2856        if let Some(ref v) = self.verification {
2857            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
2858        }
2859        if self.features.is_set() {
2860            ::buffa::types::put_len_delimited_header(50u32, __cache.consume_next(), buf);
2861            self.features.write_to(__cache, buf);
2862        }
2863        for v in &self.uninterpreted_option {
2864            ::buffa::types::put_len_delimited_header(
2865                999u32,
2866                __cache.consume_next(),
2867                buf,
2868            );
2869            v.write_to(__cache, buf);
2870        }
2871        self.__buffa_unknown_fields.write_to(buf);
2872    }
2873    fn merge_field(
2874        &mut self,
2875        tag: ::buffa::encoding::Tag,
2876        buf: &mut impl ::buffa::bytes::Buf,
2877        ctx: ::buffa::DecodeContext<'_>,
2878    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2879        #[allow(unused_imports)]
2880        use ::buffa::bytes::Buf as _;
2881        #[allow(unused_imports)]
2882        use ::buffa::Enumeration as _;
2883        match tag.field_number() {
2884            2u32 => {
2885                ::buffa::encoding::check_wire_type(
2886                    tag,
2887                    ::buffa::encoding::WireType::LengthDelimited,
2888                )?;
2889                let mut elem = ::core::default::Default::default();
2890                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2891                self.declaration.push(elem);
2892            }
2893            3u32 => {
2894                ::buffa::encoding::check_wire_type(
2895                    tag,
2896                    ::buffa::encoding::WireType::Varint,
2897                )?;
2898                let __raw = ::buffa::types::decode_int32(buf)?;
2899                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
2900                    __raw,
2901                ) {
2902                    self.verification = ::core::option::Option::Some(__v);
2903                } else {
2904                    self.__buffa_unknown_fields
2905                        .push(::buffa::UnknownField {
2906                            number: 3u32,
2907                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
2908                        });
2909                }
2910            }
2911            50u32 => {
2912                ::buffa::encoding::check_wire_type(
2913                    tag,
2914                    ::buffa::encoding::WireType::LengthDelimited,
2915                )?;
2916                ::buffa::Message::merge_length_delimited(
2917                    self.features.get_or_insert_default(),
2918                    buf,
2919                    ctx,
2920                )?;
2921            }
2922            999u32 => {
2923                ::buffa::encoding::check_wire_type(
2924                    tag,
2925                    ::buffa::encoding::WireType::LengthDelimited,
2926                )?;
2927                let mut elem = ::core::default::Default::default();
2928                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2929                self.uninterpreted_option.push(elem);
2930            }
2931            _ => {
2932                self.__buffa_unknown_fields
2933                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2934            }
2935        }
2936        ::core::result::Result::Ok(())
2937    }
2938    fn clear(&mut self) {
2939        self.declaration.clear();
2940        self.verification = ::core::option::Option::None;
2941        self.features = ::buffa::MessageField::none();
2942        self.uninterpreted_option.clear();
2943        self.__buffa_unknown_fields.clear();
2944    }
2945}
2946impl ::buffa::ExtensionSet for ExtensionRangeOptions {
2947    const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions";
2948    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2949        &self.__buffa_unknown_fields
2950    }
2951    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2952        &mut self.__buffa_unknown_fields
2953    }
2954}
2955#[cfg(feature = "text")]
2956impl ::buffa::text::TextFormat for ExtensionRangeOptions {
2957    fn encode_text(
2958        &self,
2959        enc: &mut ::buffa::text::TextEncoder<'_>,
2960    ) -> ::core::fmt::Result {
2961        #[allow(unused_imports)]
2962        use ::buffa::Enumeration as _;
2963        if self.features.is_set() {
2964            enc.write_field_name("features")?;
2965            enc.write_message(&*self.features)?;
2966        }
2967        if let ::core::option::Option::Some(ref __v) = self.verification {
2968            enc.write_field_name("verification")?;
2969            enc.write_enum_name(__v.proto_name())?;
2970        }
2971        for __v in &self.uninterpreted_option {
2972            enc.write_field_name("uninterpreted_option")?;
2973            enc.write_message(__v)?;
2974        }
2975        for __v in &self.declaration {
2976            enc.write_field_name("declaration")?;
2977            enc.write_message(__v)?;
2978        }
2979        enc.write_extension_fields(
2980            "google.protobuf.ExtensionRangeOptions",
2981            &self.__buffa_unknown_fields,
2982        )?;
2983        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2984        ::core::result::Result::Ok(())
2985    }
2986    fn merge_text(
2987        &mut self,
2988        dec: &mut ::buffa::text::TextDecoder<'_>,
2989    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2990        #[allow(unused_imports)]
2991        use ::buffa::Enumeration as _;
2992        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2993            match __name {
2994                "features" => dec.merge_message(self.features.get_or_insert_default())?,
2995                "verification" => {
2996                    self.verification = ::core::option::Option::Some(
2997                        dec
2998                            .read_closed_enum_by_name::<
2999                                extension_range_options::VerificationState,
3000                            >()?,
3001                    );
3002                }
3003                "uninterpreted_option" => {
3004                    dec.read_repeated_into(
3005                        &mut self.uninterpreted_option,
3006                        |__d| {
3007                            let mut __m = ::core::default::Default::default();
3008                            __d.merge_message(&mut __m)?;
3009                            ::core::result::Result::Ok(__m)
3010                        },
3011                    )?
3012                }
3013                "declaration" => {
3014                    dec.read_repeated_into(
3015                        &mut self.declaration,
3016                        |__d| {
3017                            let mut __m = ::core::default::Default::default();
3018                            __d.merge_message(&mut __m)?;
3019                            ::core::result::Result::Ok(__m)
3020                        },
3021                    )?
3022                }
3023                __name if __name.starts_with('[') => {
3024                    for __r in dec
3025                        .read_extension(__name, "google.protobuf.ExtensionRangeOptions")?
3026                    {
3027                        self.__buffa_unknown_fields.push(__r);
3028                    }
3029                }
3030                _ => dec.skip_value()?,
3031            }
3032        }
3033        ::core::result::Result::Ok(())
3034    }
3035}
3036#[cfg(feature = "json")]
3037impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions {
3038    fn deserialize<D: serde::Deserializer<'de>>(
3039        d: D,
3040    ) -> ::core::result::Result<Self, D::Error> {
3041        struct _V;
3042        impl<'de> serde::de::Visitor<'de> for _V {
3043            type Value = ExtensionRangeOptions;
3044            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3045                f.write_str("struct ExtensionRangeOptions")
3046            }
3047            #[allow(clippy::field_reassign_with_default)]
3048            fn visit_map<A: serde::de::MapAccess<'de>>(
3049                self,
3050                mut map: A,
3051            ) -> ::core::result::Result<ExtensionRangeOptions, A::Error> {
3052                let mut __f_uninterpreted_option: ::core::option::Option<
3053                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
3054                > = None;
3055                let mut __f_declaration: ::core::option::Option<
3056                    ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
3057                > = None;
3058                let mut __f_features: ::core::option::Option<
3059                    ::buffa::MessageField<FeatureSet>,
3060                > = None;
3061                let mut __f_verification: ::core::option::Option<
3062                    ::core::option::Option<extension_range_options::VerificationState>,
3063                > = None;
3064                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
3065                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
3066                    match key.as_str() {
3067                        "uninterpretedOption" | "uninterpreted_option" => {
3068                            __f_uninterpreted_option = Some({
3069                                struct _S;
3070                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3071                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
3072                                    fn deserialize<D: serde::Deserializer<'de>>(
3073                                        self,
3074                                        d: D,
3075                                    ) -> ::core::result::Result<
3076                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
3077                                        D::Error,
3078                                    > {
3079                                        ::buffa::json_helpers::null_as_default(d)
3080                                    }
3081                                }
3082                                map.next_value_seed(_S)?
3083                            });
3084                        }
3085                        "declaration" => {
3086                            __f_declaration = Some({
3087                                struct _S;
3088                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3089                                    type Value = ::buffa::alloc::vec::Vec<
3090                                        extension_range_options::Declaration,
3091                                    >;
3092                                    fn deserialize<D: serde::Deserializer<'de>>(
3093                                        self,
3094                                        d: D,
3095                                    ) -> ::core::result::Result<
3096                                        ::buffa::alloc::vec::Vec<
3097                                            extension_range_options::Declaration,
3098                                        >,
3099                                        D::Error,
3100                                    > {
3101                                        ::buffa::json_helpers::null_as_default(d)
3102                                    }
3103                                }
3104                                map.next_value_seed(_S)?
3105                            });
3106                        }
3107                        "features" => {
3108                            __f_features = Some(
3109                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
3110                            );
3111                        }
3112                        "verification" => {
3113                            __f_verification = Some({
3114                                struct _S;
3115                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3116                                    type Value = ::core::option::Option<
3117                                        extension_range_options::VerificationState,
3118                                    >;
3119                                    fn deserialize<D: serde::Deserializer<'de>>(
3120                                        self,
3121                                        d: D,
3122                                    ) -> ::core::result::Result<
3123                                        ::core::option::Option<
3124                                            extension_range_options::VerificationState,
3125                                        >,
3126                                        D::Error,
3127                                    > {
3128                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
3129                                    }
3130                                }
3131                                map.next_value_seed(_S)?
3132                            });
3133                        }
3134                        __k if __k.starts_with('[') => {
3135                            let __v: ::buffa::serde_json::Value = map.next_value()?;
3136                            match ::buffa::extension_registry::deserialize_extension_key(
3137                                "google.protobuf.ExtensionRangeOptions",
3138                                __k,
3139                                __v,
3140                            ) {
3141                                ::core::option::Option::Some(
3142                                    ::core::result::Result::Ok(__recs),
3143                                ) => {
3144                                    for __rec in __recs {
3145                                        __ext_records.push(__rec);
3146                                    }
3147                                }
3148                                ::core::option::Option::Some(
3149                                    ::core::result::Result::Err(__e),
3150                                ) => {
3151                                    return ::core::result::Result::Err(
3152                                        <A::Error as ::serde::de::Error>::custom(__e),
3153                                    );
3154                                }
3155                                ::core::option::Option::None => {}
3156                            }
3157                        }
3158                        _ => {
3159                            map.next_value::<serde::de::IgnoredAny>()?;
3160                        }
3161                    }
3162                }
3163                let mut __r = <ExtensionRangeOptions as ::core::default::Default>::default();
3164                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
3165                    __r.uninterpreted_option = v;
3166                }
3167                if let ::core::option::Option::Some(v) = __f_declaration {
3168                    __r.declaration = v;
3169                }
3170                if let ::core::option::Option::Some(v) = __f_features {
3171                    __r.features = v;
3172                }
3173                if let ::core::option::Option::Some(v) = __f_verification {
3174                    __r.verification = v;
3175                }
3176                for __rec in __ext_records {
3177                    __r.__buffa_unknown_fields.push(__rec);
3178                }
3179                Ok(__r)
3180            }
3181        }
3182        d.deserialize_map(_V)
3183    }
3184}
3185#[cfg(feature = "json")]
3186impl ::buffa::json_helpers::ProtoElemJson for ExtensionRangeOptions {
3187    fn serialize_proto_json<S: ::serde::Serializer>(
3188        v: &Self,
3189        s: S,
3190    ) -> ::core::result::Result<S::Ok, S::Error> {
3191        ::serde::Serialize::serialize(v, s)
3192    }
3193    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3194        d: D,
3195    ) -> ::core::result::Result<Self, D::Error> {
3196        <Self as ::serde::Deserialize>::deserialize(d)
3197    }
3198}
3199#[doc(hidden)]
3200#[derive(Clone, Debug, Default, PartialEq)]
3201#[repr(transparent)]
3202#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3203pub struct __ExtensionRangeOptionsExtJson(pub ::buffa::UnknownFields);
3204impl ::core::ops::Deref for __ExtensionRangeOptionsExtJson {
3205    type Target = ::buffa::UnknownFields;
3206    fn deref(&self) -> &::buffa::UnknownFields {
3207        &self.0
3208    }
3209}
3210impl ::core::ops::DerefMut for __ExtensionRangeOptionsExtJson {
3211    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
3212        &mut self.0
3213    }
3214}
3215impl ::core::convert::From<::buffa::UnknownFields> for __ExtensionRangeOptionsExtJson {
3216    fn from(u: ::buffa::UnknownFields) -> Self {
3217        Self(u)
3218    }
3219}
3220#[cfg(feature = "json")]
3221impl ::serde::Serialize for __ExtensionRangeOptionsExtJson {
3222    fn serialize<S: ::serde::Serializer>(
3223        &self,
3224        s: S,
3225    ) -> ::core::result::Result<S::Ok, S::Error> {
3226        ::buffa::extension_registry::serialize_extensions(
3227            "google.protobuf.ExtensionRangeOptions",
3228            &self.0,
3229            s,
3230        )
3231    }
3232}
3233#[cfg(feature = "json")]
3234impl<'de> ::serde::Deserialize<'de> for __ExtensionRangeOptionsExtJson {
3235    fn deserialize<D: ::serde::Deserializer<'de>>(
3236        d: D,
3237    ) -> ::core::result::Result<Self, D::Error> {
3238        ::buffa::extension_registry::deserialize_extensions(
3239                "google.protobuf.ExtensionRangeOptions",
3240                d,
3241            )
3242            .map(Self)
3243    }
3244}
3245#[cfg(feature = "json")]
3246#[doc(hidden)]
3247pub const __EXTENSION_RANGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3248    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3249    to_json: ::buffa::type_registry::any_to_json::<ExtensionRangeOptions>,
3250    from_json: ::buffa::type_registry::any_from_json::<ExtensionRangeOptions>,
3251    is_wkt: false,
3252};
3253#[cfg(feature = "text")]
3254#[doc(hidden)]
3255pub const __EXTENSION_RANGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3256    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3257    text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRangeOptions>,
3258    text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRangeOptions>,
3259};
3260pub mod extension_range_options {
3261    #[allow(unused_imports)]
3262    use super::*;
3263    /// The verification state of the extension range.
3264    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
3265    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3266    #[repr(i32)]
3267    pub enum VerificationState {
3268        /// All the extensions of the range must be declared.
3269        DECLARATION = 0i32,
3270        UNVERIFIED = 1i32,
3271    }
3272    impl VerificationState {
3273        ///Idiomatic alias for [`Self::DECLARATION`]; `Debug` prints the variant name.
3274        #[allow(non_upper_case_globals)]
3275        pub const Declaration: Self = Self::DECLARATION;
3276        ///Idiomatic alias for [`Self::UNVERIFIED`]; `Debug` prints the variant name.
3277        #[allow(non_upper_case_globals)]
3278        pub const Unverified: Self = Self::UNVERIFIED;
3279    }
3280    impl ::core::default::Default for VerificationState {
3281        fn default() -> Self {
3282            Self::DECLARATION
3283        }
3284    }
3285    #[cfg(feature = "json")]
3286    const _: () = {
3287        impl ::serde::Serialize for VerificationState {
3288            fn serialize<S: ::serde::Serializer>(
3289                &self,
3290                s: S,
3291            ) -> ::core::result::Result<S::Ok, S::Error> {
3292                s.serialize_str(::buffa::Enumeration::proto_name(self))
3293            }
3294        }
3295        impl<'de> ::serde::Deserialize<'de> for VerificationState {
3296            fn deserialize<D: ::serde::Deserializer<'de>>(
3297                d: D,
3298            ) -> ::core::result::Result<Self, D::Error> {
3299                struct _V;
3300                impl ::serde::de::Visitor<'_> for _V {
3301                    type Value = VerificationState;
3302                    fn expecting(
3303                        &self,
3304                        f: &mut ::core::fmt::Formatter<'_>,
3305                    ) -> ::core::fmt::Result {
3306                        f.write_str(
3307                            concat!(
3308                                "a string, integer, or null for ",
3309                                stringify!(VerificationState)
3310                            ),
3311                        )
3312                    }
3313                    fn visit_str<E: ::serde::de::Error>(
3314                        self,
3315                        v: &str,
3316                    ) -> ::core::result::Result<VerificationState, E> {
3317                        <VerificationState as ::buffa::Enumeration>::from_proto_name(v)
3318                            .ok_or_else(|| {
3319                                ::serde::de::Error::unknown_variant(v, &[])
3320                            })
3321                    }
3322                    fn visit_i64<E: ::serde::de::Error>(
3323                        self,
3324                        v: i64,
3325                    ) -> ::core::result::Result<VerificationState, E> {
3326                        let v32 = i32::try_from(v)
3327                            .map_err(|_| {
3328                                ::serde::de::Error::custom(
3329                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3330                                )
3331                            })?;
3332                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3333                            .ok_or_else(|| {
3334                                ::serde::de::Error::custom(
3335                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3336                                )
3337                            })
3338                    }
3339                    fn visit_u64<E: ::serde::de::Error>(
3340                        self,
3341                        v: u64,
3342                    ) -> ::core::result::Result<VerificationState, E> {
3343                        let v32 = i32::try_from(v)
3344                            .map_err(|_| {
3345                                ::serde::de::Error::custom(
3346                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3347                                )
3348                            })?;
3349                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3350                            .ok_or_else(|| {
3351                                ::serde::de::Error::custom(
3352                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3353                                )
3354                            })
3355                    }
3356                    fn visit_unit<E: ::serde::de::Error>(
3357                        self,
3358                    ) -> ::core::result::Result<VerificationState, E> {
3359                        ::core::result::Result::Ok(::core::default::Default::default())
3360                    }
3361                }
3362                d.deserialize_any(_V)
3363            }
3364        }
3365        impl ::buffa::json_helpers::ProtoElemJson for VerificationState {
3366            fn serialize_proto_json<S: ::serde::Serializer>(
3367                v: &Self,
3368                s: S,
3369            ) -> ::core::result::Result<S::Ok, S::Error> {
3370                ::serde::Serialize::serialize(v, s)
3371            }
3372            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3373                d: D,
3374            ) -> ::core::result::Result<Self, D::Error> {
3375                <Self as ::serde::Deserialize>::deserialize(d)
3376            }
3377        }
3378    };
3379    impl ::buffa::Enumeration for VerificationState {
3380        fn from_i32(value: i32) -> ::core::option::Option<Self> {
3381            match value {
3382                0i32 => ::core::option::Option::Some(Self::DECLARATION),
3383                1i32 => ::core::option::Option::Some(Self::UNVERIFIED),
3384                _ => ::core::option::Option::None,
3385            }
3386        }
3387        fn to_i32(&self) -> i32 {
3388            *self as i32
3389        }
3390        fn proto_name(&self) -> &'static str {
3391            match self {
3392                Self::DECLARATION => "DECLARATION",
3393                Self::UNVERIFIED => "UNVERIFIED",
3394            }
3395        }
3396        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
3397            match name {
3398                "DECLARATION" => ::core::option::Option::Some(Self::DECLARATION),
3399                "UNVERIFIED" => ::core::option::Option::Some(Self::UNVERIFIED),
3400                _ => ::core::option::Option::None,
3401            }
3402        }
3403        fn values() -> &'static [Self] {
3404            &[Self::DECLARATION, Self::UNVERIFIED]
3405        }
3406    }
3407    #[derive(Clone, PartialEq, Default)]
3408    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3409    #[cfg_attr(feature = "json", serde(default))]
3410    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3411    pub struct Declaration {
3412        /// The extension number declared within the extension range.
3413        ///
3414        /// Field 1: `number`
3415        #[cfg_attr(
3416            feature = "json",
3417            serde(
3418                rename = "number",
3419                with = "::buffa::json_helpers::opt_int32",
3420                skip_serializing_if = "::core::option::Option::is_none"
3421            )
3422        )]
3423        pub number: ::core::option::Option<i32>,
3424        /// The fully-qualified name of the extension field. There must be a leading
3425        /// dot in front of the full name.
3426        ///
3427        /// Field 2: `full_name`
3428        #[cfg_attr(
3429            feature = "json",
3430            serde(
3431                rename = "fullName",
3432                alias = "full_name",
3433                skip_serializing_if = "::core::option::Option::is_none"
3434            )
3435        )]
3436        pub full_name: ::core::option::Option<::buffa::alloc::string::String>,
3437        /// The fully-qualified type name of the extension field. Unlike
3438        /// Metadata.type, Declaration.type must have a leading dot for messages
3439        /// and enums.
3440        ///
3441        /// Field 3: `type`
3442        #[cfg_attr(
3443            feature = "json",
3444            serde(
3445                rename = "type",
3446                skip_serializing_if = "::core::option::Option::is_none"
3447            )
3448        )]
3449        pub r#type: ::core::option::Option<::buffa::alloc::string::String>,
3450        /// If true, indicates that the number is reserved in the extension range,
3451        /// and any extension field with the number will fail to compile. Set this
3452        /// when a declared extension field is deleted.
3453        ///
3454        /// Field 5: `reserved`
3455        #[cfg_attr(
3456            feature = "json",
3457            serde(
3458                rename = "reserved",
3459                skip_serializing_if = "::core::option::Option::is_none"
3460            )
3461        )]
3462        pub reserved: ::core::option::Option<bool>,
3463        /// If true, indicates that the extension must be defined as repeated.
3464        /// Otherwise the extension must be defined as optional.
3465        ///
3466        /// Field 6: `repeated`
3467        #[cfg_attr(
3468            feature = "json",
3469            serde(
3470                rename = "repeated",
3471                skip_serializing_if = "::core::option::Option::is_none"
3472            )
3473        )]
3474        pub repeated: ::core::option::Option<bool>,
3475        #[cfg_attr(feature = "json", serde(skip))]
3476        #[doc(hidden)]
3477        pub __buffa_unknown_fields: ::buffa::UnknownFields,
3478    }
3479    impl ::core::fmt::Debug for Declaration {
3480        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3481            f.debug_struct("Declaration")
3482                .field("number", &self.number)
3483                .field("full_name", &self.full_name)
3484                .field("type", &self.r#type)
3485                .field("reserved", &self.reserved)
3486                .field("repeated", &self.repeated)
3487                .finish()
3488        }
3489    }
3490    impl Declaration {
3491        /// Protobuf type URL for this message, for use with `Any::pack` and
3492        /// `Any::unpack_if`.
3493        ///
3494        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3495        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3496    }
3497    impl Declaration {
3498        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3499        #[inline]
3500        ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
3501        pub fn with_number(mut self, value: i32) -> Self {
3502            self.number = Some(value);
3503            self
3504        }
3505        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3506        #[inline]
3507        ///Sets [`Self::full_name`] to `Some(value)`, consuming and returning `self`.
3508        pub fn with_full_name(
3509            mut self,
3510            value: impl Into<::buffa::alloc::string::String>,
3511        ) -> Self {
3512            self.full_name = Some(value.into());
3513            self
3514        }
3515        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3516        #[inline]
3517        ///Sets `type` to `Some(value)`, consuming and returning `self`.
3518        pub fn with_type(
3519            mut self,
3520            value: impl Into<::buffa::alloc::string::String>,
3521        ) -> Self {
3522            self.r#type = Some(value.into());
3523            self
3524        }
3525        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3526        #[inline]
3527        ///Sets [`Self::reserved`] to `Some(value)`, consuming and returning `self`.
3528        pub fn with_reserved(mut self, value: bool) -> Self {
3529            self.reserved = Some(value);
3530            self
3531        }
3532        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3533        #[inline]
3534        ///Sets [`Self::repeated`] to `Some(value)`, consuming and returning `self`.
3535        pub fn with_repeated(mut self, value: bool) -> Self {
3536            self.repeated = Some(value);
3537            self
3538        }
3539    }
3540    ::buffa::impl_default_instance!(Declaration);
3541    impl ::buffa::MessageName for Declaration {
3542        const PACKAGE: &'static str = "google.protobuf";
3543        const NAME: &'static str = "ExtensionRangeOptions.Declaration";
3544        const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3545        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3546    }
3547    impl ::buffa::Message for Declaration {
3548        /// Returns the total encoded size in bytes.
3549        ///
3550        /// The result is a `u32`; the protobuf specification requires all
3551        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3552        /// compliant message will never overflow this type.
3553        #[allow(clippy::let_and_return)]
3554        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3555            #[allow(unused_imports)]
3556            use ::buffa::Enumeration as _;
3557            let mut size = 0u32;
3558            if let Some(v) = self.number {
3559                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
3560            }
3561            if let Some(ref v) = self.full_name {
3562                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3563            }
3564            if let Some(ref v) = self.r#type {
3565                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3566            }
3567            if self.reserved.is_some() {
3568                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3569            }
3570            if self.repeated.is_some() {
3571                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3572            }
3573            size += self.__buffa_unknown_fields.encoded_len() as u32;
3574            size
3575        }
3576        fn write_to(
3577            &self,
3578            _cache: &mut ::buffa::SizeCache,
3579            buf: &mut impl ::buffa::bytes::BufMut,
3580        ) {
3581            #[allow(unused_imports)]
3582            use ::buffa::Enumeration as _;
3583            if let Some(v) = self.number {
3584                ::buffa::types::put_int32_field(1u32, v, buf);
3585            }
3586            if let Some(ref v) = self.full_name {
3587                ::buffa::types::put_string_field(2u32, v, buf);
3588            }
3589            if let Some(ref v) = self.r#type {
3590                ::buffa::types::put_string_field(3u32, v, buf);
3591            }
3592            if let Some(v) = self.reserved {
3593                ::buffa::types::put_bool_field(5u32, v, buf);
3594            }
3595            if let Some(v) = self.repeated {
3596                ::buffa::types::put_bool_field(6u32, v, buf);
3597            }
3598            self.__buffa_unknown_fields.write_to(buf);
3599        }
3600        fn merge_field(
3601            &mut self,
3602            tag: ::buffa::encoding::Tag,
3603            buf: &mut impl ::buffa::bytes::Buf,
3604            ctx: ::buffa::DecodeContext<'_>,
3605        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3606            #[allow(unused_imports)]
3607            use ::buffa::bytes::Buf as _;
3608            #[allow(unused_imports)]
3609            use ::buffa::Enumeration as _;
3610            match tag.field_number() {
3611                1u32 => {
3612                    ::buffa::encoding::check_wire_type(
3613                        tag,
3614                        ::buffa::encoding::WireType::Varint,
3615                    )?;
3616                    self.number = ::core::option::Option::Some(
3617                        ::buffa::types::decode_int32(buf)?,
3618                    );
3619                }
3620                2u32 => {
3621                    ::buffa::encoding::check_wire_type(
3622                        tag,
3623                        ::buffa::encoding::WireType::LengthDelimited,
3624                    )?;
3625                    ::buffa::types::merge_string(
3626                        self
3627                            .full_name
3628                            .get_or_insert_with(::buffa::alloc::string::String::new),
3629                        buf,
3630                    )?;
3631                }
3632                3u32 => {
3633                    ::buffa::encoding::check_wire_type(
3634                        tag,
3635                        ::buffa::encoding::WireType::LengthDelimited,
3636                    )?;
3637                    ::buffa::types::merge_string(
3638                        self
3639                            .r#type
3640                            .get_or_insert_with(::buffa::alloc::string::String::new),
3641                        buf,
3642                    )?;
3643                }
3644                5u32 => {
3645                    ::buffa::encoding::check_wire_type(
3646                        tag,
3647                        ::buffa::encoding::WireType::Varint,
3648                    )?;
3649                    self.reserved = ::core::option::Option::Some(
3650                        ::buffa::types::decode_bool(buf)?,
3651                    );
3652                }
3653                6u32 => {
3654                    ::buffa::encoding::check_wire_type(
3655                        tag,
3656                        ::buffa::encoding::WireType::Varint,
3657                    )?;
3658                    self.repeated = ::core::option::Option::Some(
3659                        ::buffa::types::decode_bool(buf)?,
3660                    );
3661                }
3662                _ => {
3663                    self.__buffa_unknown_fields
3664                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3665                }
3666            }
3667            ::core::result::Result::Ok(())
3668        }
3669        fn clear(&mut self) {
3670            self.number = ::core::option::Option::None;
3671            self.full_name = ::core::option::Option::None;
3672            self.r#type = ::core::option::Option::None;
3673            self.reserved = ::core::option::Option::None;
3674            self.repeated = ::core::option::Option::None;
3675            self.__buffa_unknown_fields.clear();
3676        }
3677    }
3678    impl ::buffa::ExtensionSet for Declaration {
3679        const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3680        fn unknown_fields(&self) -> &::buffa::UnknownFields {
3681            &self.__buffa_unknown_fields
3682        }
3683        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3684            &mut self.__buffa_unknown_fields
3685        }
3686    }
3687    #[cfg(feature = "text")]
3688    impl ::buffa::text::TextFormat for Declaration {
3689        fn encode_text(
3690            &self,
3691            enc: &mut ::buffa::text::TextEncoder<'_>,
3692        ) -> ::core::fmt::Result {
3693            #[allow(unused_imports)]
3694            use ::buffa::Enumeration as _;
3695            if let ::core::option::Option::Some(ref __v) = self.number {
3696                enc.write_field_name("number")?;
3697                enc.write_i32(*__v)?;
3698            }
3699            if let ::core::option::Option::Some(ref __v) = self.full_name {
3700                enc.write_field_name("full_name")?;
3701                enc.write_string(__v)?;
3702            }
3703            if let ::core::option::Option::Some(ref __v) = self.r#type {
3704                enc.write_field_name("type")?;
3705                enc.write_string(__v)?;
3706            }
3707            if let ::core::option::Option::Some(ref __v) = self.reserved {
3708                enc.write_field_name("reserved")?;
3709                enc.write_bool(*__v)?;
3710            }
3711            if let ::core::option::Option::Some(ref __v) = self.repeated {
3712                enc.write_field_name("repeated")?;
3713                enc.write_bool(*__v)?;
3714            }
3715            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3716            ::core::result::Result::Ok(())
3717        }
3718        fn merge_text(
3719            &mut self,
3720            dec: &mut ::buffa::text::TextDecoder<'_>,
3721        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3722            #[allow(unused_imports)]
3723            use ::buffa::Enumeration as _;
3724            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3725                match __name {
3726                    "number" => {
3727                        self.number = ::core::option::Option::Some(dec.read_i32()?);
3728                    }
3729                    "full_name" => {
3730                        self.full_name = ::core::option::Option::Some(
3731                            dec.read_string()?.into_owned(),
3732                        );
3733                    }
3734                    "type" => {
3735                        self.r#type = ::core::option::Option::Some(
3736                            dec.read_string()?.into_owned(),
3737                        );
3738                    }
3739                    "reserved" => {
3740                        self.reserved = ::core::option::Option::Some(dec.read_bool()?);
3741                    }
3742                    "repeated" => {
3743                        self.repeated = ::core::option::Option::Some(dec.read_bool()?);
3744                    }
3745                    _ => dec.skip_value()?,
3746                }
3747            }
3748            ::core::result::Result::Ok(())
3749        }
3750    }
3751    #[cfg(feature = "json")]
3752    impl ::buffa::json_helpers::ProtoElemJson for Declaration {
3753        fn serialize_proto_json<S: ::serde::Serializer>(
3754            v: &Self,
3755            s: S,
3756        ) -> ::core::result::Result<S::Ok, S::Error> {
3757            ::serde::Serialize::serialize(v, s)
3758        }
3759        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3760            d: D,
3761        ) -> ::core::result::Result<Self, D::Error> {
3762            <Self as ::serde::Deserialize>::deserialize(d)
3763        }
3764    }
3765    #[cfg(feature = "json")]
3766    #[doc(hidden)]
3767    pub const __DECLARATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3768        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3769        to_json: ::buffa::type_registry::any_to_json::<Declaration>,
3770        from_json: ::buffa::type_registry::any_from_json::<Declaration>,
3771        is_wkt: false,
3772    };
3773    #[cfg(feature = "text")]
3774    #[doc(hidden)]
3775    pub const __DECLARATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3776        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3777        text_encode: ::buffa::type_registry::any_encode_text::<Declaration>,
3778        text_merge: ::buffa::type_registry::any_merge_text::<Declaration>,
3779    };
3780    #[cfg(feature = "views")]
3781    #[doc(inline)]
3782    pub use super::__buffa::view::extension_range_options::DeclarationView;
3783    #[cfg(feature = "views")]
3784    #[doc(inline)]
3785    pub use super::__buffa::view::extension_range_options::DeclarationOwnedView;
3786}
3787/// Describes a field within a message.
3788#[derive(Clone, PartialEq, Default)]
3789#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3790#[cfg_attr(feature = "json", serde(default))]
3791#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3792pub struct FieldDescriptorProto {
3793    /// Field 1: `name`
3794    #[cfg_attr(
3795        feature = "json",
3796        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
3797    )]
3798    pub name: ::core::option::Option<::buffa::alloc::string::String>,
3799    /// Field 3: `number`
3800    #[cfg_attr(
3801        feature = "json",
3802        serde(
3803            rename = "number",
3804            with = "::buffa::json_helpers::opt_int32",
3805            skip_serializing_if = "::core::option::Option::is_none"
3806        )
3807    )]
3808    pub number: ::core::option::Option<i32>,
3809    /// Field 4: `label`
3810    #[cfg_attr(
3811        feature = "json",
3812        serde(
3813            rename = "label",
3814            with = "::buffa::json_helpers::opt_closed_enum",
3815            skip_serializing_if = "::core::option::Option::is_none"
3816        )
3817    )]
3818    pub label: ::core::option::Option<field_descriptor_proto::Label>,
3819    /// If type_name is set, this need not be set.  If both this and type_name
3820    /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
3821    ///
3822    /// Field 5: `type`
3823    #[cfg_attr(
3824        feature = "json",
3825        serde(
3826            rename = "type",
3827            with = "::buffa::json_helpers::opt_closed_enum",
3828            skip_serializing_if = "::core::option::Option::is_none"
3829        )
3830    )]
3831    pub r#type: ::core::option::Option<field_descriptor_proto::Type>,
3832    /// For message and enum types, this is the name of the type.  If the name
3833    /// starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
3834    /// rules are used to find the type (i.e. first the nested types within this
3835    /// message are searched, then within the parent, on up to the root
3836    /// namespace).
3837    ///
3838    /// Field 6: `type_name`
3839    #[cfg_attr(
3840        feature = "json",
3841        serde(
3842            rename = "typeName",
3843            alias = "type_name",
3844            skip_serializing_if = "::core::option::Option::is_none"
3845        )
3846    )]
3847    pub type_name: ::core::option::Option<::buffa::alloc::string::String>,
3848    /// For extensions, this is the name of the type being extended.  It is
3849    /// resolved in the same manner as type_name.
3850    ///
3851    /// Field 2: `extendee`
3852    #[cfg_attr(
3853        feature = "json",
3854        serde(
3855            rename = "extendee",
3856            skip_serializing_if = "::core::option::Option::is_none"
3857        )
3858    )]
3859    pub extendee: ::core::option::Option<::buffa::alloc::string::String>,
3860    /// For numeric types, contains the original text representation of the value.
3861    /// For booleans, "true" or "false".
3862    /// For strings, contains the default text contents (not escaped in any way).
3863    /// For bytes, contains the C escaped value.  All bytes \>= 128 are escaped.
3864    ///
3865    /// Field 7: `default_value`
3866    #[cfg_attr(
3867        feature = "json",
3868        serde(
3869            rename = "defaultValue",
3870            alias = "default_value",
3871            skip_serializing_if = "::core::option::Option::is_none"
3872        )
3873    )]
3874    pub default_value: ::core::option::Option<::buffa::alloc::string::String>,
3875    /// If set, gives the index of a oneof in the containing type's oneof_decl
3876    /// list.  This field is a member of that oneof.
3877    ///
3878    /// Field 9: `oneof_index`
3879    #[cfg_attr(
3880        feature = "json",
3881        serde(
3882            rename = "oneofIndex",
3883            alias = "oneof_index",
3884            with = "::buffa::json_helpers::opt_int32",
3885            skip_serializing_if = "::core::option::Option::is_none"
3886        )
3887    )]
3888    pub oneof_index: ::core::option::Option<i32>,
3889    /// JSON name of this field. The value is set by protocol compiler. If the
3890    /// user has set a "json_name" option on this field, that option's value
3891    /// will be used. Otherwise, it's deduced from the field's name by converting
3892    /// it to camelCase.
3893    ///
3894    /// Field 10: `json_name`
3895    #[cfg_attr(
3896        feature = "json",
3897        serde(
3898            rename = "jsonName",
3899            alias = "json_name",
3900            skip_serializing_if = "::core::option::Option::is_none"
3901        )
3902    )]
3903    pub json_name: ::core::option::Option<::buffa::alloc::string::String>,
3904    /// Field 8: `options`
3905    #[cfg_attr(
3906        feature = "json",
3907        serde(
3908            rename = "options",
3909            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
3910        )
3911    )]
3912    pub options: ::buffa::MessageField<FieldOptions>,
3913    /// If true, this is a proto3 "optional". When a proto3 field is optional, it
3914    /// tracks presence regardless of field type.
3915    ///
3916    /// When proto3_optional is true, this field must belong to a oneof to signal
3917    /// to old proto3 clients that presence is tracked for this field. This oneof
3918    /// is known as a "synthetic" oneof, and this field must be its sole member
3919    /// (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
3920    /// exist in the descriptor only, and do not generate any API. Synthetic oneofs
3921    /// must be ordered after all "real" oneofs.
3922    ///
3923    /// For message fields, proto3_optional doesn't create any semantic change,
3924    /// since non-repeated message fields always track presence. However it still
3925    /// indicates the semantic detail of whether the user wrote "optional" or not.
3926    /// This can be useful for round-tripping the .proto file. For consistency we
3927    /// give message fields a synthetic oneof also, even though it is not required
3928    /// to track presence. This is especially important because the parser can't
3929    /// tell if a field is a message or an enum, so it must always create a
3930    /// synthetic oneof.
3931    ///
3932    /// Proto2 optional fields do not set this flag, because they already indicate
3933    /// optional with `LABEL_OPTIONAL`.
3934    ///
3935    /// Field 17: `proto3_optional`
3936    #[cfg_attr(
3937        feature = "json",
3938        serde(
3939            rename = "proto3Optional",
3940            alias = "proto3_optional",
3941            skip_serializing_if = "::core::option::Option::is_none"
3942        )
3943    )]
3944    pub proto3_optional: ::core::option::Option<bool>,
3945    #[cfg_attr(feature = "json", serde(skip))]
3946    #[doc(hidden)]
3947    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3948}
3949impl ::core::fmt::Debug for FieldDescriptorProto {
3950    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3951        f.debug_struct("FieldDescriptorProto")
3952            .field("name", &self.name)
3953            .field("number", &self.number)
3954            .field("label", &self.label)
3955            .field("type", &self.r#type)
3956            .field("type_name", &self.type_name)
3957            .field("extendee", &self.extendee)
3958            .field("default_value", &self.default_value)
3959            .field("oneof_index", &self.oneof_index)
3960            .field("json_name", &self.json_name)
3961            .field("options", &self.options)
3962            .field("proto3_optional", &self.proto3_optional)
3963            .finish()
3964    }
3965}
3966impl FieldDescriptorProto {
3967    /// Protobuf type URL for this message, for use with `Any::pack` and
3968    /// `Any::unpack_if`.
3969    ///
3970    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3971    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
3972}
3973impl FieldDescriptorProto {
3974    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3975    #[inline]
3976    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
3977    pub fn with_name(
3978        mut self,
3979        value: impl Into<::buffa::alloc::string::String>,
3980    ) -> Self {
3981        self.name = Some(value.into());
3982        self
3983    }
3984    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3985    #[inline]
3986    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
3987    pub fn with_number(mut self, value: i32) -> Self {
3988        self.number = Some(value);
3989        self
3990    }
3991    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3992    #[inline]
3993    ///Sets [`Self::label`] to `Some(value)`, consuming and returning `self`.
3994    pub fn with_label(
3995        mut self,
3996        value: impl Into<field_descriptor_proto::Label>,
3997    ) -> Self {
3998        self.label = Some(value.into());
3999        self
4000    }
4001    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4002    #[inline]
4003    ///Sets `type` to `Some(value)`, consuming and returning `self`.
4004    pub fn with_type(mut self, value: impl Into<field_descriptor_proto::Type>) -> Self {
4005        self.r#type = Some(value.into());
4006        self
4007    }
4008    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4009    #[inline]
4010    ///Sets [`Self::type_name`] to `Some(value)`, consuming and returning `self`.
4011    pub fn with_type_name(
4012        mut self,
4013        value: impl Into<::buffa::alloc::string::String>,
4014    ) -> Self {
4015        self.type_name = Some(value.into());
4016        self
4017    }
4018    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4019    #[inline]
4020    ///Sets [`Self::extendee`] to `Some(value)`, consuming and returning `self`.
4021    pub fn with_extendee(
4022        mut self,
4023        value: impl Into<::buffa::alloc::string::String>,
4024    ) -> Self {
4025        self.extendee = Some(value.into());
4026        self
4027    }
4028    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4029    #[inline]
4030    ///Sets [`Self::default_value`] to `Some(value)`, consuming and returning `self`.
4031    pub fn with_default_value(
4032        mut self,
4033        value: impl Into<::buffa::alloc::string::String>,
4034    ) -> Self {
4035        self.default_value = Some(value.into());
4036        self
4037    }
4038    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4039    #[inline]
4040    ///Sets [`Self::oneof_index`] to `Some(value)`, consuming and returning `self`.
4041    pub fn with_oneof_index(mut self, value: i32) -> Self {
4042        self.oneof_index = Some(value);
4043        self
4044    }
4045    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4046    #[inline]
4047    ///Sets [`Self::json_name`] to `Some(value)`, consuming and returning `self`.
4048    pub fn with_json_name(
4049        mut self,
4050        value: impl Into<::buffa::alloc::string::String>,
4051    ) -> Self {
4052        self.json_name = Some(value.into());
4053        self
4054    }
4055    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4056    #[inline]
4057    ///Sets [`Self::proto3_optional`] to `Some(value)`, consuming and returning `self`.
4058    pub fn with_proto3_optional(mut self, value: bool) -> Self {
4059        self.proto3_optional = Some(value);
4060        self
4061    }
4062}
4063::buffa::impl_default_instance!(FieldDescriptorProto);
4064impl ::buffa::MessageName for FieldDescriptorProto {
4065    const PACKAGE: &'static str = "google.protobuf";
4066    const NAME: &'static str = "FieldDescriptorProto";
4067    const FULL_NAME: &'static str = "google.protobuf.FieldDescriptorProto";
4068    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4069}
4070impl ::buffa::Message for FieldDescriptorProto {
4071    /// Returns the total encoded size in bytes.
4072    ///
4073    /// The result is a `u32`; the protobuf specification requires all
4074    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4075    /// compliant message will never overflow this type.
4076    #[allow(clippy::let_and_return)]
4077    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4078        #[allow(unused_imports)]
4079        use ::buffa::Enumeration as _;
4080        let mut size = 0u32;
4081        if let Some(ref v) = self.name {
4082            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4083        }
4084        if let Some(ref v) = self.extendee {
4085            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4086        }
4087        if let Some(v) = self.number {
4088            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4089        }
4090        if let Some(ref v) = self.label {
4091            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
4092        }
4093        if let Some(ref v) = self.r#type {
4094            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
4095        }
4096        if let Some(ref v) = self.type_name {
4097            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4098        }
4099        if let Some(ref v) = self.default_value {
4100            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4101        }
4102        if self.options.is_set() {
4103            let __slot = __cache.reserve();
4104            let inner_size = self.options.compute_size(__cache);
4105            __cache.set(__slot, inner_size);
4106            size
4107                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4108                    + inner_size;
4109        }
4110        if let Some(v) = self.oneof_index {
4111            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4112        }
4113        if let Some(ref v) = self.json_name {
4114            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4115        }
4116        if self.proto3_optional.is_some() {
4117            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4118        }
4119        size += self.__buffa_unknown_fields.encoded_len() as u32;
4120        size
4121    }
4122    fn write_to(
4123        &self,
4124        __cache: &mut ::buffa::SizeCache,
4125        buf: &mut impl ::buffa::bytes::BufMut,
4126    ) {
4127        #[allow(unused_imports)]
4128        use ::buffa::Enumeration as _;
4129        if let Some(ref v) = self.name {
4130            ::buffa::types::put_string_field(1u32, v, buf);
4131        }
4132        if let Some(ref v) = self.extendee {
4133            ::buffa::types::put_string_field(2u32, v, buf);
4134        }
4135        if let Some(v) = self.number {
4136            ::buffa::types::put_int32_field(3u32, v, buf);
4137        }
4138        if let Some(ref v) = self.label {
4139            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
4140        }
4141        if let Some(ref v) = self.r#type {
4142            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
4143        }
4144        if let Some(ref v) = self.type_name {
4145            ::buffa::types::put_string_field(6u32, v, buf);
4146        }
4147        if let Some(ref v) = self.default_value {
4148            ::buffa::types::put_string_field(7u32, v, buf);
4149        }
4150        if self.options.is_set() {
4151            ::buffa::types::put_len_delimited_header(8u32, __cache.consume_next(), buf);
4152            self.options.write_to(__cache, buf);
4153        }
4154        if let Some(v) = self.oneof_index {
4155            ::buffa::types::put_int32_field(9u32, v, buf);
4156        }
4157        if let Some(ref v) = self.json_name {
4158            ::buffa::types::put_string_field(10u32, v, buf);
4159        }
4160        if let Some(v) = self.proto3_optional {
4161            ::buffa::types::put_bool_field(17u32, v, buf);
4162        }
4163        self.__buffa_unknown_fields.write_to(buf);
4164    }
4165    fn merge_field(
4166        &mut self,
4167        tag: ::buffa::encoding::Tag,
4168        buf: &mut impl ::buffa::bytes::Buf,
4169        ctx: ::buffa::DecodeContext<'_>,
4170    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4171        #[allow(unused_imports)]
4172        use ::buffa::bytes::Buf as _;
4173        #[allow(unused_imports)]
4174        use ::buffa::Enumeration as _;
4175        match tag.field_number() {
4176            1u32 => {
4177                ::buffa::encoding::check_wire_type(
4178                    tag,
4179                    ::buffa::encoding::WireType::LengthDelimited,
4180                )?;
4181                ::buffa::types::merge_string(
4182                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
4183                    buf,
4184                )?;
4185            }
4186            2u32 => {
4187                ::buffa::encoding::check_wire_type(
4188                    tag,
4189                    ::buffa::encoding::WireType::LengthDelimited,
4190                )?;
4191                ::buffa::types::merge_string(
4192                    self
4193                        .extendee
4194                        .get_or_insert_with(::buffa::alloc::string::String::new),
4195                    buf,
4196                )?;
4197            }
4198            3u32 => {
4199                ::buffa::encoding::check_wire_type(
4200                    tag,
4201                    ::buffa::encoding::WireType::Varint,
4202                )?;
4203                self.number = ::core::option::Option::Some(
4204                    ::buffa::types::decode_int32(buf)?,
4205                );
4206            }
4207            4u32 => {
4208                ::buffa::encoding::check_wire_type(
4209                    tag,
4210                    ::buffa::encoding::WireType::Varint,
4211                )?;
4212                let __raw = ::buffa::types::decode_int32(buf)?;
4213                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4214                    __raw,
4215                ) {
4216                    self.label = ::core::option::Option::Some(__v);
4217                } else {
4218                    self.__buffa_unknown_fields
4219                        .push(::buffa::UnknownField {
4220                            number: 4u32,
4221                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4222                        });
4223                }
4224            }
4225            5u32 => {
4226                ::buffa::encoding::check_wire_type(
4227                    tag,
4228                    ::buffa::encoding::WireType::Varint,
4229                )?;
4230                let __raw = ::buffa::types::decode_int32(buf)?;
4231                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4232                    __raw,
4233                ) {
4234                    self.r#type = ::core::option::Option::Some(__v);
4235                } else {
4236                    self.__buffa_unknown_fields
4237                        .push(::buffa::UnknownField {
4238                            number: 5u32,
4239                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4240                        });
4241                }
4242            }
4243            6u32 => {
4244                ::buffa::encoding::check_wire_type(
4245                    tag,
4246                    ::buffa::encoding::WireType::LengthDelimited,
4247                )?;
4248                ::buffa::types::merge_string(
4249                    self
4250                        .type_name
4251                        .get_or_insert_with(::buffa::alloc::string::String::new),
4252                    buf,
4253                )?;
4254            }
4255            7u32 => {
4256                ::buffa::encoding::check_wire_type(
4257                    tag,
4258                    ::buffa::encoding::WireType::LengthDelimited,
4259                )?;
4260                ::buffa::types::merge_string(
4261                    self
4262                        .default_value
4263                        .get_or_insert_with(::buffa::alloc::string::String::new),
4264                    buf,
4265                )?;
4266            }
4267            8u32 => {
4268                ::buffa::encoding::check_wire_type(
4269                    tag,
4270                    ::buffa::encoding::WireType::LengthDelimited,
4271                )?;
4272                ::buffa::Message::merge_length_delimited(
4273                    self.options.get_or_insert_default(),
4274                    buf,
4275                    ctx,
4276                )?;
4277            }
4278            9u32 => {
4279                ::buffa::encoding::check_wire_type(
4280                    tag,
4281                    ::buffa::encoding::WireType::Varint,
4282                )?;
4283                self.oneof_index = ::core::option::Option::Some(
4284                    ::buffa::types::decode_int32(buf)?,
4285                );
4286            }
4287            10u32 => {
4288                ::buffa::encoding::check_wire_type(
4289                    tag,
4290                    ::buffa::encoding::WireType::LengthDelimited,
4291                )?;
4292                ::buffa::types::merge_string(
4293                    self
4294                        .json_name
4295                        .get_or_insert_with(::buffa::alloc::string::String::new),
4296                    buf,
4297                )?;
4298            }
4299            17u32 => {
4300                ::buffa::encoding::check_wire_type(
4301                    tag,
4302                    ::buffa::encoding::WireType::Varint,
4303                )?;
4304                self.proto3_optional = ::core::option::Option::Some(
4305                    ::buffa::types::decode_bool(buf)?,
4306                );
4307            }
4308            _ => {
4309                self.__buffa_unknown_fields
4310                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4311            }
4312        }
4313        ::core::result::Result::Ok(())
4314    }
4315    fn clear(&mut self) {
4316        self.name = ::core::option::Option::None;
4317        self.extendee = ::core::option::Option::None;
4318        self.number = ::core::option::Option::None;
4319        self.label = ::core::option::Option::None;
4320        self.r#type = ::core::option::Option::None;
4321        self.type_name = ::core::option::Option::None;
4322        self.default_value = ::core::option::Option::None;
4323        self.options = ::buffa::MessageField::none();
4324        self.oneof_index = ::core::option::Option::None;
4325        self.json_name = ::core::option::Option::None;
4326        self.proto3_optional = ::core::option::Option::None;
4327        self.__buffa_unknown_fields.clear();
4328    }
4329}
4330impl ::buffa::ExtensionSet for FieldDescriptorProto {
4331    const PROTO_FQN: &'static str = "google.protobuf.FieldDescriptorProto";
4332    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4333        &self.__buffa_unknown_fields
4334    }
4335    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4336        &mut self.__buffa_unknown_fields
4337    }
4338}
4339#[cfg(feature = "text")]
4340impl ::buffa::text::TextFormat for FieldDescriptorProto {
4341    fn encode_text(
4342        &self,
4343        enc: &mut ::buffa::text::TextEncoder<'_>,
4344    ) -> ::core::fmt::Result {
4345        #[allow(unused_imports)]
4346        use ::buffa::Enumeration as _;
4347        if let ::core::option::Option::Some(ref __v) = self.name {
4348            enc.write_field_name("name")?;
4349            enc.write_string(__v)?;
4350        }
4351        if let ::core::option::Option::Some(ref __v) = self.number {
4352            enc.write_field_name("number")?;
4353            enc.write_i32(*__v)?;
4354        }
4355        if let ::core::option::Option::Some(ref __v) = self.label {
4356            enc.write_field_name("label")?;
4357            enc.write_enum_name(__v.proto_name())?;
4358        }
4359        if let ::core::option::Option::Some(ref __v) = self.r#type {
4360            enc.write_field_name("type")?;
4361            enc.write_enum_name(__v.proto_name())?;
4362        }
4363        if let ::core::option::Option::Some(ref __v) = self.type_name {
4364            enc.write_field_name("type_name")?;
4365            enc.write_string(__v)?;
4366        }
4367        if let ::core::option::Option::Some(ref __v) = self.extendee {
4368            enc.write_field_name("extendee")?;
4369            enc.write_string(__v)?;
4370        }
4371        if let ::core::option::Option::Some(ref __v) = self.default_value {
4372            enc.write_field_name("default_value")?;
4373            enc.write_string(__v)?;
4374        }
4375        if let ::core::option::Option::Some(ref __v) = self.oneof_index {
4376            enc.write_field_name("oneof_index")?;
4377            enc.write_i32(*__v)?;
4378        }
4379        if let ::core::option::Option::Some(ref __v) = self.json_name {
4380            enc.write_field_name("json_name")?;
4381            enc.write_string(__v)?;
4382        }
4383        if self.options.is_set() {
4384            enc.write_field_name("options")?;
4385            enc.write_message(&*self.options)?;
4386        }
4387        if let ::core::option::Option::Some(ref __v) = self.proto3_optional {
4388            enc.write_field_name("proto3_optional")?;
4389            enc.write_bool(*__v)?;
4390        }
4391        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
4392        ::core::result::Result::Ok(())
4393    }
4394    fn merge_text(
4395        &mut self,
4396        dec: &mut ::buffa::text::TextDecoder<'_>,
4397    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
4398        #[allow(unused_imports)]
4399        use ::buffa::Enumeration as _;
4400        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
4401            match __name {
4402                "name" => {
4403                    self.name = ::core::option::Option::Some(
4404                        dec.read_string()?.into_owned(),
4405                    );
4406                }
4407                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
4408                "label" => {
4409                    self.label = ::core::option::Option::Some(
4410                        dec.read_closed_enum_by_name::<field_descriptor_proto::Label>()?,
4411                    );
4412                }
4413                "type" => {
4414                    self.r#type = ::core::option::Option::Some(
4415                        dec.read_closed_enum_by_name::<field_descriptor_proto::Type>()?,
4416                    );
4417                }
4418                "type_name" => {
4419                    self.type_name = ::core::option::Option::Some(
4420                        dec.read_string()?.into_owned(),
4421                    );
4422                }
4423                "extendee" => {
4424                    self.extendee = ::core::option::Option::Some(
4425                        dec.read_string()?.into_owned(),
4426                    );
4427                }
4428                "default_value" => {
4429                    self.default_value = ::core::option::Option::Some(
4430                        dec.read_string()?.into_owned(),
4431                    );
4432                }
4433                "oneof_index" => {
4434                    self.oneof_index = ::core::option::Option::Some(dec.read_i32()?);
4435                }
4436                "json_name" => {
4437                    self.json_name = ::core::option::Option::Some(
4438                        dec.read_string()?.into_owned(),
4439                    );
4440                }
4441                "options" => dec.merge_message(self.options.get_or_insert_default())?,
4442                "proto3_optional" => {
4443                    self.proto3_optional = ::core::option::Option::Some(dec.read_bool()?);
4444                }
4445                _ => dec.skip_value()?,
4446            }
4447        }
4448        ::core::result::Result::Ok(())
4449    }
4450}
4451#[cfg(feature = "json")]
4452impl ::buffa::json_helpers::ProtoElemJson for FieldDescriptorProto {
4453    fn serialize_proto_json<S: ::serde::Serializer>(
4454        v: &Self,
4455        s: S,
4456    ) -> ::core::result::Result<S::Ok, S::Error> {
4457        ::serde::Serialize::serialize(v, s)
4458    }
4459    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4460        d: D,
4461    ) -> ::core::result::Result<Self, D::Error> {
4462        <Self as ::serde::Deserialize>::deserialize(d)
4463    }
4464}
4465#[cfg(feature = "json")]
4466#[doc(hidden)]
4467pub const __FIELD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4468    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4469    to_json: ::buffa::type_registry::any_to_json::<FieldDescriptorProto>,
4470    from_json: ::buffa::type_registry::any_from_json::<FieldDescriptorProto>,
4471    is_wkt: false,
4472};
4473#[cfg(feature = "text")]
4474#[doc(hidden)]
4475pub const __FIELD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
4476    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4477    text_encode: ::buffa::type_registry::any_encode_text::<FieldDescriptorProto>,
4478    text_merge: ::buffa::type_registry::any_merge_text::<FieldDescriptorProto>,
4479};
4480pub mod field_descriptor_proto {
4481    #[allow(unused_imports)]
4482    use super::*;
4483    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4484    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4485    #[repr(i32)]
4486    pub enum Type {
4487        /// 0 is reserved for errors.
4488        /// Order is weird for historical reasons.
4489        TYPE_DOUBLE = 1i32,
4490        TYPE_FLOAT = 2i32,
4491        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
4492        /// negative values are likely.
4493        TYPE_INT64 = 3i32,
4494        TYPE_UINT64 = 4i32,
4495        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
4496        /// negative values are likely.
4497        TYPE_INT32 = 5i32,
4498        TYPE_FIXED64 = 6i32,
4499        TYPE_FIXED32 = 7i32,
4500        TYPE_BOOL = 8i32,
4501        TYPE_STRING = 9i32,
4502        /// Tag-delimited aggregate.
4503        /// Group type is deprecated and not supported after google.protobuf. However, Proto3
4504        /// implementations should still be able to parse the group wire format and
4505        /// treat group fields as unknown fields.  In Editions, the group wire format
4506        /// can be enabled via the `message_encoding` feature.
4507        TYPE_GROUP = 10i32,
4508        /// Length-delimited aggregate.
4509        TYPE_MESSAGE = 11i32,
4510        /// New in version 2.
4511        TYPE_BYTES = 12i32,
4512        TYPE_UINT32 = 13i32,
4513        TYPE_ENUM = 14i32,
4514        TYPE_SFIXED32 = 15i32,
4515        TYPE_SFIXED64 = 16i32,
4516        /// Uses ZigZag encoding.
4517        TYPE_SINT32 = 17i32,
4518        /// Uses ZigZag encoding.
4519        TYPE_SINT64 = 18i32,
4520    }
4521    impl Type {
4522        ///Idiomatic alias for [`Self::TYPE_DOUBLE`]; `Debug` prints the variant name.
4523        #[allow(non_upper_case_globals)]
4524        pub const Double: Self = Self::TYPE_DOUBLE;
4525        ///Idiomatic alias for [`Self::TYPE_FLOAT`]; `Debug` prints the variant name.
4526        #[allow(non_upper_case_globals)]
4527        pub const Float: Self = Self::TYPE_FLOAT;
4528        ///Idiomatic alias for [`Self::TYPE_INT64`]; `Debug` prints the variant name.
4529        #[allow(non_upper_case_globals)]
4530        pub const Int64: Self = Self::TYPE_INT64;
4531        ///Idiomatic alias for [`Self::TYPE_UINT64`]; `Debug` prints the variant name.
4532        #[allow(non_upper_case_globals)]
4533        pub const Uint64: Self = Self::TYPE_UINT64;
4534        ///Idiomatic alias for [`Self::TYPE_INT32`]; `Debug` prints the variant name.
4535        #[allow(non_upper_case_globals)]
4536        pub const Int32: Self = Self::TYPE_INT32;
4537        ///Idiomatic alias for [`Self::TYPE_FIXED64`]; `Debug` prints the variant name.
4538        #[allow(non_upper_case_globals)]
4539        pub const Fixed64: Self = Self::TYPE_FIXED64;
4540        ///Idiomatic alias for [`Self::TYPE_FIXED32`]; `Debug` prints the variant name.
4541        #[allow(non_upper_case_globals)]
4542        pub const Fixed32: Self = Self::TYPE_FIXED32;
4543        ///Idiomatic alias for [`Self::TYPE_BOOL`]; `Debug` prints the variant name.
4544        #[allow(non_upper_case_globals)]
4545        pub const Bool: Self = Self::TYPE_BOOL;
4546        ///Idiomatic alias for [`Self::TYPE_STRING`]; `Debug` prints the variant name.
4547        #[allow(non_upper_case_globals)]
4548        pub const String: Self = Self::TYPE_STRING;
4549        ///Idiomatic alias for [`Self::TYPE_GROUP`]; `Debug` prints the variant name.
4550        #[allow(non_upper_case_globals)]
4551        pub const Group: Self = Self::TYPE_GROUP;
4552        ///Idiomatic alias for [`Self::TYPE_MESSAGE`]; `Debug` prints the variant name.
4553        #[allow(non_upper_case_globals)]
4554        pub const Message: Self = Self::TYPE_MESSAGE;
4555        ///Idiomatic alias for [`Self::TYPE_BYTES`]; `Debug` prints the variant name.
4556        #[allow(non_upper_case_globals)]
4557        pub const Bytes: Self = Self::TYPE_BYTES;
4558        ///Idiomatic alias for [`Self::TYPE_UINT32`]; `Debug` prints the variant name.
4559        #[allow(non_upper_case_globals)]
4560        pub const Uint32: Self = Self::TYPE_UINT32;
4561        ///Idiomatic alias for [`Self::TYPE_ENUM`]; `Debug` prints the variant name.
4562        #[allow(non_upper_case_globals)]
4563        pub const Enum: Self = Self::TYPE_ENUM;
4564        ///Idiomatic alias for [`Self::TYPE_SFIXED32`]; `Debug` prints the variant name.
4565        #[allow(non_upper_case_globals)]
4566        pub const Sfixed32: Self = Self::TYPE_SFIXED32;
4567        ///Idiomatic alias for [`Self::TYPE_SFIXED64`]; `Debug` prints the variant name.
4568        #[allow(non_upper_case_globals)]
4569        pub const Sfixed64: Self = Self::TYPE_SFIXED64;
4570        ///Idiomatic alias for [`Self::TYPE_SINT32`]; `Debug` prints the variant name.
4571        #[allow(non_upper_case_globals)]
4572        pub const Sint32: Self = Self::TYPE_SINT32;
4573        ///Idiomatic alias for [`Self::TYPE_SINT64`]; `Debug` prints the variant name.
4574        #[allow(non_upper_case_globals)]
4575        pub const Sint64: Self = Self::TYPE_SINT64;
4576    }
4577    impl ::core::default::Default for Type {
4578        fn default() -> Self {
4579            Self::TYPE_DOUBLE
4580        }
4581    }
4582    #[cfg(feature = "json")]
4583    const _: () = {
4584        impl ::serde::Serialize for Type {
4585            fn serialize<S: ::serde::Serializer>(
4586                &self,
4587                s: S,
4588            ) -> ::core::result::Result<S::Ok, S::Error> {
4589                s.serialize_str(::buffa::Enumeration::proto_name(self))
4590            }
4591        }
4592        impl<'de> ::serde::Deserialize<'de> for Type {
4593            fn deserialize<D: ::serde::Deserializer<'de>>(
4594                d: D,
4595            ) -> ::core::result::Result<Self, D::Error> {
4596                struct _V;
4597                impl ::serde::de::Visitor<'_> for _V {
4598                    type Value = Type;
4599                    fn expecting(
4600                        &self,
4601                        f: &mut ::core::fmt::Formatter<'_>,
4602                    ) -> ::core::fmt::Result {
4603                        f.write_str(
4604                            concat!("a string, integer, or null for ", stringify!(Type)),
4605                        )
4606                    }
4607                    fn visit_str<E: ::serde::de::Error>(
4608                        self,
4609                        v: &str,
4610                    ) -> ::core::result::Result<Type, E> {
4611                        <Type as ::buffa::Enumeration>::from_proto_name(v)
4612                            .ok_or_else(|| {
4613                                ::serde::de::Error::unknown_variant(v, &[])
4614                            })
4615                    }
4616                    fn visit_i64<E: ::serde::de::Error>(
4617                        self,
4618                        v: i64,
4619                    ) -> ::core::result::Result<Type, E> {
4620                        let v32 = i32::try_from(v)
4621                            .map_err(|_| {
4622                                ::serde::de::Error::custom(
4623                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4624                                )
4625                            })?;
4626                        <Type as ::buffa::Enumeration>::from_i32(v32)
4627                            .ok_or_else(|| {
4628                                ::serde::de::Error::custom(
4629                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4630                                )
4631                            })
4632                    }
4633                    fn visit_u64<E: ::serde::de::Error>(
4634                        self,
4635                        v: u64,
4636                    ) -> ::core::result::Result<Type, E> {
4637                        let v32 = i32::try_from(v)
4638                            .map_err(|_| {
4639                                ::serde::de::Error::custom(
4640                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4641                                )
4642                            })?;
4643                        <Type as ::buffa::Enumeration>::from_i32(v32)
4644                            .ok_or_else(|| {
4645                                ::serde::de::Error::custom(
4646                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4647                                )
4648                            })
4649                    }
4650                    fn visit_unit<E: ::serde::de::Error>(
4651                        self,
4652                    ) -> ::core::result::Result<Type, E> {
4653                        ::core::result::Result::Ok(::core::default::Default::default())
4654                    }
4655                }
4656                d.deserialize_any(_V)
4657            }
4658        }
4659        impl ::buffa::json_helpers::ProtoElemJson for Type {
4660            fn serialize_proto_json<S: ::serde::Serializer>(
4661                v: &Self,
4662                s: S,
4663            ) -> ::core::result::Result<S::Ok, S::Error> {
4664                ::serde::Serialize::serialize(v, s)
4665            }
4666            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4667                d: D,
4668            ) -> ::core::result::Result<Self, D::Error> {
4669                <Self as ::serde::Deserialize>::deserialize(d)
4670            }
4671        }
4672    };
4673    impl ::buffa::Enumeration for Type {
4674        fn from_i32(value: i32) -> ::core::option::Option<Self> {
4675            match value {
4676                1i32 => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4677                2i32 => ::core::option::Option::Some(Self::TYPE_FLOAT),
4678                3i32 => ::core::option::Option::Some(Self::TYPE_INT64),
4679                4i32 => ::core::option::Option::Some(Self::TYPE_UINT64),
4680                5i32 => ::core::option::Option::Some(Self::TYPE_INT32),
4681                6i32 => ::core::option::Option::Some(Self::TYPE_FIXED64),
4682                7i32 => ::core::option::Option::Some(Self::TYPE_FIXED32),
4683                8i32 => ::core::option::Option::Some(Self::TYPE_BOOL),
4684                9i32 => ::core::option::Option::Some(Self::TYPE_STRING),
4685                10i32 => ::core::option::Option::Some(Self::TYPE_GROUP),
4686                11i32 => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4687                12i32 => ::core::option::Option::Some(Self::TYPE_BYTES),
4688                13i32 => ::core::option::Option::Some(Self::TYPE_UINT32),
4689                14i32 => ::core::option::Option::Some(Self::TYPE_ENUM),
4690                15i32 => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4691                16i32 => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4692                17i32 => ::core::option::Option::Some(Self::TYPE_SINT32),
4693                18i32 => ::core::option::Option::Some(Self::TYPE_SINT64),
4694                _ => ::core::option::Option::None,
4695            }
4696        }
4697        fn to_i32(&self) -> i32 {
4698            *self as i32
4699        }
4700        fn proto_name(&self) -> &'static str {
4701            match self {
4702                Self::TYPE_DOUBLE => "TYPE_DOUBLE",
4703                Self::TYPE_FLOAT => "TYPE_FLOAT",
4704                Self::TYPE_INT64 => "TYPE_INT64",
4705                Self::TYPE_UINT64 => "TYPE_UINT64",
4706                Self::TYPE_INT32 => "TYPE_INT32",
4707                Self::TYPE_FIXED64 => "TYPE_FIXED64",
4708                Self::TYPE_FIXED32 => "TYPE_FIXED32",
4709                Self::TYPE_BOOL => "TYPE_BOOL",
4710                Self::TYPE_STRING => "TYPE_STRING",
4711                Self::TYPE_GROUP => "TYPE_GROUP",
4712                Self::TYPE_MESSAGE => "TYPE_MESSAGE",
4713                Self::TYPE_BYTES => "TYPE_BYTES",
4714                Self::TYPE_UINT32 => "TYPE_UINT32",
4715                Self::TYPE_ENUM => "TYPE_ENUM",
4716                Self::TYPE_SFIXED32 => "TYPE_SFIXED32",
4717                Self::TYPE_SFIXED64 => "TYPE_SFIXED64",
4718                Self::TYPE_SINT32 => "TYPE_SINT32",
4719                Self::TYPE_SINT64 => "TYPE_SINT64",
4720            }
4721        }
4722        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
4723            match name {
4724                "TYPE_DOUBLE" => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4725                "TYPE_FLOAT" => ::core::option::Option::Some(Self::TYPE_FLOAT),
4726                "TYPE_INT64" => ::core::option::Option::Some(Self::TYPE_INT64),
4727                "TYPE_UINT64" => ::core::option::Option::Some(Self::TYPE_UINT64),
4728                "TYPE_INT32" => ::core::option::Option::Some(Self::TYPE_INT32),
4729                "TYPE_FIXED64" => ::core::option::Option::Some(Self::TYPE_FIXED64),
4730                "TYPE_FIXED32" => ::core::option::Option::Some(Self::TYPE_FIXED32),
4731                "TYPE_BOOL" => ::core::option::Option::Some(Self::TYPE_BOOL),
4732                "TYPE_STRING" => ::core::option::Option::Some(Self::TYPE_STRING),
4733                "TYPE_GROUP" => ::core::option::Option::Some(Self::TYPE_GROUP),
4734                "TYPE_MESSAGE" => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4735                "TYPE_BYTES" => ::core::option::Option::Some(Self::TYPE_BYTES),
4736                "TYPE_UINT32" => ::core::option::Option::Some(Self::TYPE_UINT32),
4737                "TYPE_ENUM" => ::core::option::Option::Some(Self::TYPE_ENUM),
4738                "TYPE_SFIXED32" => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4739                "TYPE_SFIXED64" => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4740                "TYPE_SINT32" => ::core::option::Option::Some(Self::TYPE_SINT32),
4741                "TYPE_SINT64" => ::core::option::Option::Some(Self::TYPE_SINT64),
4742                _ => ::core::option::Option::None,
4743            }
4744        }
4745        fn values() -> &'static [Self] {
4746            &[
4747                Self::TYPE_DOUBLE,
4748                Self::TYPE_FLOAT,
4749                Self::TYPE_INT64,
4750                Self::TYPE_UINT64,
4751                Self::TYPE_INT32,
4752                Self::TYPE_FIXED64,
4753                Self::TYPE_FIXED32,
4754                Self::TYPE_BOOL,
4755                Self::TYPE_STRING,
4756                Self::TYPE_GROUP,
4757                Self::TYPE_MESSAGE,
4758                Self::TYPE_BYTES,
4759                Self::TYPE_UINT32,
4760                Self::TYPE_ENUM,
4761                Self::TYPE_SFIXED32,
4762                Self::TYPE_SFIXED64,
4763                Self::TYPE_SINT32,
4764                Self::TYPE_SINT64,
4765            ]
4766        }
4767    }
4768    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4769    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4770    #[repr(i32)]
4771    pub enum Label {
4772        /// 0 is reserved for errors
4773        LABEL_OPTIONAL = 1i32,
4774        LABEL_REPEATED = 3i32,
4775        /// The required label is only allowed in google.protobuf.  In proto3 and Editions
4776        /// it's explicitly prohibited.  In Editions, the `field_presence` feature
4777        /// can be used to get this behavior.
4778        LABEL_REQUIRED = 2i32,
4779    }
4780    impl Label {
4781        ///Idiomatic alias for [`Self::LABEL_OPTIONAL`]; `Debug` prints the variant name.
4782        #[allow(non_upper_case_globals)]
4783        pub const Optional: Self = Self::LABEL_OPTIONAL;
4784        ///Idiomatic alias for [`Self::LABEL_REPEATED`]; `Debug` prints the variant name.
4785        #[allow(non_upper_case_globals)]
4786        pub const Repeated: Self = Self::LABEL_REPEATED;
4787        ///Idiomatic alias for [`Self::LABEL_REQUIRED`]; `Debug` prints the variant name.
4788        #[allow(non_upper_case_globals)]
4789        pub const Required: Self = Self::LABEL_REQUIRED;
4790    }
4791    impl ::core::default::Default for Label {
4792        fn default() -> Self {
4793            Self::LABEL_OPTIONAL
4794        }
4795    }
4796    #[cfg(feature = "json")]
4797    const _: () = {
4798        impl ::serde::Serialize for Label {
4799            fn serialize<S: ::serde::Serializer>(
4800                &self,
4801                s: S,
4802            ) -> ::core::result::Result<S::Ok, S::Error> {
4803                s.serialize_str(::buffa::Enumeration::proto_name(self))
4804            }
4805        }
4806        impl<'de> ::serde::Deserialize<'de> for Label {
4807            fn deserialize<D: ::serde::Deserializer<'de>>(
4808                d: D,
4809            ) -> ::core::result::Result<Self, D::Error> {
4810                struct _V;
4811                impl ::serde::de::Visitor<'_> for _V {
4812                    type Value = Label;
4813                    fn expecting(
4814                        &self,
4815                        f: &mut ::core::fmt::Formatter<'_>,
4816                    ) -> ::core::fmt::Result {
4817                        f.write_str(
4818                            concat!("a string, integer, or null for ", stringify!(Label)),
4819                        )
4820                    }
4821                    fn visit_str<E: ::serde::de::Error>(
4822                        self,
4823                        v: &str,
4824                    ) -> ::core::result::Result<Label, E> {
4825                        <Label as ::buffa::Enumeration>::from_proto_name(v)
4826                            .ok_or_else(|| {
4827                                ::serde::de::Error::unknown_variant(v, &[])
4828                            })
4829                    }
4830                    fn visit_i64<E: ::serde::de::Error>(
4831                        self,
4832                        v: i64,
4833                    ) -> ::core::result::Result<Label, E> {
4834                        let v32 = i32::try_from(v)
4835                            .map_err(|_| {
4836                                ::serde::de::Error::custom(
4837                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4838                                )
4839                            })?;
4840                        <Label as ::buffa::Enumeration>::from_i32(v32)
4841                            .ok_or_else(|| {
4842                                ::serde::de::Error::custom(
4843                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4844                                )
4845                            })
4846                    }
4847                    fn visit_u64<E: ::serde::de::Error>(
4848                        self,
4849                        v: u64,
4850                    ) -> ::core::result::Result<Label, E> {
4851                        let v32 = i32::try_from(v)
4852                            .map_err(|_| {
4853                                ::serde::de::Error::custom(
4854                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4855                                )
4856                            })?;
4857                        <Label as ::buffa::Enumeration>::from_i32(v32)
4858                            .ok_or_else(|| {
4859                                ::serde::de::Error::custom(
4860                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4861                                )
4862                            })
4863                    }
4864                    fn visit_unit<E: ::serde::de::Error>(
4865                        self,
4866                    ) -> ::core::result::Result<Label, E> {
4867                        ::core::result::Result::Ok(::core::default::Default::default())
4868                    }
4869                }
4870                d.deserialize_any(_V)
4871            }
4872        }
4873        impl ::buffa::json_helpers::ProtoElemJson for Label {
4874            fn serialize_proto_json<S: ::serde::Serializer>(
4875                v: &Self,
4876                s: S,
4877            ) -> ::core::result::Result<S::Ok, S::Error> {
4878                ::serde::Serialize::serialize(v, s)
4879            }
4880            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4881                d: D,
4882            ) -> ::core::result::Result<Self, D::Error> {
4883                <Self as ::serde::Deserialize>::deserialize(d)
4884            }
4885        }
4886    };
4887    impl ::buffa::Enumeration for Label {
4888        fn from_i32(value: i32) -> ::core::option::Option<Self> {
4889            match value {
4890                1i32 => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
4891                3i32 => ::core::option::Option::Some(Self::LABEL_REPEATED),
4892                2i32 => ::core::option::Option::Some(Self::LABEL_REQUIRED),
4893                _ => ::core::option::Option::None,
4894            }
4895        }
4896        fn to_i32(&self) -> i32 {
4897            *self as i32
4898        }
4899        fn proto_name(&self) -> &'static str {
4900            match self {
4901                Self::LABEL_OPTIONAL => "LABEL_OPTIONAL",
4902                Self::LABEL_REPEATED => "LABEL_REPEATED",
4903                Self::LABEL_REQUIRED => "LABEL_REQUIRED",
4904            }
4905        }
4906        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
4907            match name {
4908                "LABEL_OPTIONAL" => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
4909                "LABEL_REPEATED" => ::core::option::Option::Some(Self::LABEL_REPEATED),
4910                "LABEL_REQUIRED" => ::core::option::Option::Some(Self::LABEL_REQUIRED),
4911                _ => ::core::option::Option::None,
4912            }
4913        }
4914        fn values() -> &'static [Self] {
4915            &[Self::LABEL_OPTIONAL, Self::LABEL_REPEATED, Self::LABEL_REQUIRED]
4916        }
4917    }
4918}
4919/// Describes a oneof.
4920#[derive(Clone, PartialEq, Default)]
4921#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
4922#[cfg_attr(feature = "json", serde(default))]
4923#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4924pub struct OneofDescriptorProto {
4925    /// Field 1: `name`
4926    #[cfg_attr(
4927        feature = "json",
4928        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
4929    )]
4930    pub name: ::core::option::Option<::buffa::alloc::string::String>,
4931    /// Field 2: `options`
4932    #[cfg_attr(
4933        feature = "json",
4934        serde(
4935            rename = "options",
4936            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4937        )
4938    )]
4939    pub options: ::buffa::MessageField<OneofOptions>,
4940    #[cfg_attr(feature = "json", serde(skip))]
4941    #[doc(hidden)]
4942    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4943}
4944impl ::core::fmt::Debug for OneofDescriptorProto {
4945    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4946        f.debug_struct("OneofDescriptorProto")
4947            .field("name", &self.name)
4948            .field("options", &self.options)
4949            .finish()
4950    }
4951}
4952impl OneofDescriptorProto {
4953    /// Protobuf type URL for this message, for use with `Any::pack` and
4954    /// `Any::unpack_if`.
4955    ///
4956    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4957    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
4958}
4959impl OneofDescriptorProto {
4960    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4961    #[inline]
4962    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
4963    pub fn with_name(
4964        mut self,
4965        value: impl Into<::buffa::alloc::string::String>,
4966    ) -> Self {
4967        self.name = Some(value.into());
4968        self
4969    }
4970}
4971::buffa::impl_default_instance!(OneofDescriptorProto);
4972impl ::buffa::MessageName for OneofDescriptorProto {
4973    const PACKAGE: &'static str = "google.protobuf";
4974    const NAME: &'static str = "OneofDescriptorProto";
4975    const FULL_NAME: &'static str = "google.protobuf.OneofDescriptorProto";
4976    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
4977}
4978impl ::buffa::Message for OneofDescriptorProto {
4979    /// Returns the total encoded size in bytes.
4980    ///
4981    /// The result is a `u32`; the protobuf specification requires all
4982    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4983    /// compliant message will never overflow this type.
4984    #[allow(clippy::let_and_return)]
4985    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4986        #[allow(unused_imports)]
4987        use ::buffa::Enumeration as _;
4988        let mut size = 0u32;
4989        if let Some(ref v) = self.name {
4990            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4991        }
4992        if self.options.is_set() {
4993            let __slot = __cache.reserve();
4994            let inner_size = self.options.compute_size(__cache);
4995            __cache.set(__slot, inner_size);
4996            size
4997                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4998                    + inner_size;
4999        }
5000        size += self.__buffa_unknown_fields.encoded_len() as u32;
5001        size
5002    }
5003    fn write_to(
5004        &self,
5005        __cache: &mut ::buffa::SizeCache,
5006        buf: &mut impl ::buffa::bytes::BufMut,
5007    ) {
5008        #[allow(unused_imports)]
5009        use ::buffa::Enumeration as _;
5010        if let Some(ref v) = self.name {
5011            ::buffa::types::put_string_field(1u32, v, buf);
5012        }
5013        if self.options.is_set() {
5014            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
5015            self.options.write_to(__cache, buf);
5016        }
5017        self.__buffa_unknown_fields.write_to(buf);
5018    }
5019    fn merge_field(
5020        &mut self,
5021        tag: ::buffa::encoding::Tag,
5022        buf: &mut impl ::buffa::bytes::Buf,
5023        ctx: ::buffa::DecodeContext<'_>,
5024    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5025        #[allow(unused_imports)]
5026        use ::buffa::bytes::Buf as _;
5027        #[allow(unused_imports)]
5028        use ::buffa::Enumeration as _;
5029        match tag.field_number() {
5030            1u32 => {
5031                ::buffa::encoding::check_wire_type(
5032                    tag,
5033                    ::buffa::encoding::WireType::LengthDelimited,
5034                )?;
5035                ::buffa::types::merge_string(
5036                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5037                    buf,
5038                )?;
5039            }
5040            2u32 => {
5041                ::buffa::encoding::check_wire_type(
5042                    tag,
5043                    ::buffa::encoding::WireType::LengthDelimited,
5044                )?;
5045                ::buffa::Message::merge_length_delimited(
5046                    self.options.get_or_insert_default(),
5047                    buf,
5048                    ctx,
5049                )?;
5050            }
5051            _ => {
5052                self.__buffa_unknown_fields
5053                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5054            }
5055        }
5056        ::core::result::Result::Ok(())
5057    }
5058    fn clear(&mut self) {
5059        self.name = ::core::option::Option::None;
5060        self.options = ::buffa::MessageField::none();
5061        self.__buffa_unknown_fields.clear();
5062    }
5063}
5064impl ::buffa::ExtensionSet for OneofDescriptorProto {
5065    const PROTO_FQN: &'static str = "google.protobuf.OneofDescriptorProto";
5066    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5067        &self.__buffa_unknown_fields
5068    }
5069    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5070        &mut self.__buffa_unknown_fields
5071    }
5072}
5073#[cfg(feature = "text")]
5074impl ::buffa::text::TextFormat for OneofDescriptorProto {
5075    fn encode_text(
5076        &self,
5077        enc: &mut ::buffa::text::TextEncoder<'_>,
5078    ) -> ::core::fmt::Result {
5079        #[allow(unused_imports)]
5080        use ::buffa::Enumeration as _;
5081        if let ::core::option::Option::Some(ref __v) = self.name {
5082            enc.write_field_name("name")?;
5083            enc.write_string(__v)?;
5084        }
5085        if self.options.is_set() {
5086            enc.write_field_name("options")?;
5087            enc.write_message(&*self.options)?;
5088        }
5089        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5090        ::core::result::Result::Ok(())
5091    }
5092    fn merge_text(
5093        &mut self,
5094        dec: &mut ::buffa::text::TextDecoder<'_>,
5095    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5096        #[allow(unused_imports)]
5097        use ::buffa::Enumeration as _;
5098        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5099            match __name {
5100                "name" => {
5101                    self.name = ::core::option::Option::Some(
5102                        dec.read_string()?.into_owned(),
5103                    );
5104                }
5105                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5106                _ => dec.skip_value()?,
5107            }
5108        }
5109        ::core::result::Result::Ok(())
5110    }
5111}
5112#[cfg(feature = "json")]
5113impl ::buffa::json_helpers::ProtoElemJson for OneofDescriptorProto {
5114    fn serialize_proto_json<S: ::serde::Serializer>(
5115        v: &Self,
5116        s: S,
5117    ) -> ::core::result::Result<S::Ok, S::Error> {
5118        ::serde::Serialize::serialize(v, s)
5119    }
5120    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5121        d: D,
5122    ) -> ::core::result::Result<Self, D::Error> {
5123        <Self as ::serde::Deserialize>::deserialize(d)
5124    }
5125}
5126#[cfg(feature = "json")]
5127#[doc(hidden)]
5128pub const __ONEOF_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5129    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5130    to_json: ::buffa::type_registry::any_to_json::<OneofDescriptorProto>,
5131    from_json: ::buffa::type_registry::any_from_json::<OneofDescriptorProto>,
5132    is_wkt: false,
5133};
5134#[cfg(feature = "text")]
5135#[doc(hidden)]
5136pub const __ONEOF_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5137    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5138    text_encode: ::buffa::type_registry::any_encode_text::<OneofDescriptorProto>,
5139    text_merge: ::buffa::type_registry::any_merge_text::<OneofDescriptorProto>,
5140};
5141/// Describes an enum type.
5142#[derive(Clone, PartialEq, Default)]
5143#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5144#[cfg_attr(feature = "json", serde(default))]
5145#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5146pub struct EnumDescriptorProto {
5147    /// Field 1: `name`
5148    #[cfg_attr(
5149        feature = "json",
5150        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5151    )]
5152    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5153    /// Field 2: `value`
5154    #[cfg_attr(
5155        feature = "json",
5156        serde(
5157            rename = "value",
5158            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5159            deserialize_with = "::buffa::json_helpers::null_as_default"
5160        )
5161    )]
5162    pub value: ::buffa::alloc::vec::Vec<EnumValueDescriptorProto>,
5163    /// Field 3: `options`
5164    #[cfg_attr(
5165        feature = "json",
5166        serde(
5167            rename = "options",
5168            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5169        )
5170    )]
5171    pub options: ::buffa::MessageField<EnumOptions>,
5172    /// Range of reserved numeric values. Reserved numeric values may not be used
5173    /// by enum values in the same enum declaration. Reserved ranges may not
5174    /// overlap.
5175    ///
5176    /// Field 4: `reserved_range`
5177    #[cfg_attr(
5178        feature = "json",
5179        serde(
5180            rename = "reservedRange",
5181            alias = "reserved_range",
5182            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5183            deserialize_with = "::buffa::json_helpers::null_as_default"
5184        )
5185    )]
5186    pub reserved_range: ::buffa::alloc::vec::Vec<
5187        enum_descriptor_proto::EnumReservedRange,
5188    >,
5189    /// Reserved enum value names, which may not be reused. A given name may only
5190    /// be reserved once.
5191    ///
5192    /// Field 5: `reserved_name`
5193    #[cfg_attr(
5194        feature = "json",
5195        serde(
5196            rename = "reservedName",
5197            alias = "reserved_name",
5198            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5199            deserialize_with = "::buffa::json_helpers::null_as_default"
5200        )
5201    )]
5202    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
5203    /// Support for `export` and `local` keywords on enums.
5204    ///
5205    /// Field 6: `visibility`
5206    #[cfg_attr(
5207        feature = "json",
5208        serde(
5209            rename = "visibility",
5210            with = "::buffa::json_helpers::opt_closed_enum",
5211            skip_serializing_if = "::core::option::Option::is_none"
5212        )
5213    )]
5214    pub visibility: ::core::option::Option<SymbolVisibility>,
5215    #[cfg_attr(feature = "json", serde(skip))]
5216    #[doc(hidden)]
5217    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5218}
5219impl ::core::fmt::Debug for EnumDescriptorProto {
5220    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5221        f.debug_struct("EnumDescriptorProto")
5222            .field("name", &self.name)
5223            .field("value", &self.value)
5224            .field("options", &self.options)
5225            .field("reserved_range", &self.reserved_range)
5226            .field("reserved_name", &self.reserved_name)
5227            .field("visibility", &self.visibility)
5228            .finish()
5229    }
5230}
5231impl EnumDescriptorProto {
5232    /// Protobuf type URL for this message, for use with `Any::pack` and
5233    /// `Any::unpack_if`.
5234    ///
5235    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5236    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5237}
5238impl EnumDescriptorProto {
5239    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5240    #[inline]
5241    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5242    pub fn with_name(
5243        mut self,
5244        value: impl Into<::buffa::alloc::string::String>,
5245    ) -> Self {
5246        self.name = Some(value.into());
5247        self
5248    }
5249    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5250    #[inline]
5251    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
5252    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
5253        self.visibility = Some(value.into());
5254        self
5255    }
5256}
5257::buffa::impl_default_instance!(EnumDescriptorProto);
5258impl ::buffa::MessageName for EnumDescriptorProto {
5259    const PACKAGE: &'static str = "google.protobuf";
5260    const NAME: &'static str = "EnumDescriptorProto";
5261    const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto";
5262    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5263}
5264impl ::buffa::Message for EnumDescriptorProto {
5265    /// Returns the total encoded size in bytes.
5266    ///
5267    /// The result is a `u32`; the protobuf specification requires all
5268    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5269    /// compliant message will never overflow this type.
5270    #[allow(clippy::let_and_return)]
5271    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5272        #[allow(unused_imports)]
5273        use ::buffa::Enumeration as _;
5274        let mut size = 0u32;
5275        if let Some(ref v) = self.name {
5276            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5277        }
5278        for v in &self.value {
5279            let __slot = __cache.reserve();
5280            let inner_size = v.compute_size(__cache);
5281            __cache.set(__slot, inner_size);
5282            size
5283                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5284                    + inner_size;
5285        }
5286        if self.options.is_set() {
5287            let __slot = __cache.reserve();
5288            let inner_size = self.options.compute_size(__cache);
5289            __cache.set(__slot, inner_size);
5290            size
5291                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5292                    + inner_size;
5293        }
5294        for v in &self.reserved_range {
5295            let __slot = __cache.reserve();
5296            let inner_size = v.compute_size(__cache);
5297            __cache.set(__slot, inner_size);
5298            size
5299                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5300                    + inner_size;
5301        }
5302        for v in &self.reserved_name {
5303            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5304        }
5305        if let Some(ref v) = self.visibility {
5306            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
5307        }
5308        size += self.__buffa_unknown_fields.encoded_len() as u32;
5309        size
5310    }
5311    fn write_to(
5312        &self,
5313        __cache: &mut ::buffa::SizeCache,
5314        buf: &mut impl ::buffa::bytes::BufMut,
5315    ) {
5316        #[allow(unused_imports)]
5317        use ::buffa::Enumeration as _;
5318        if let Some(ref v) = self.name {
5319            ::buffa::types::put_string_field(1u32, v, buf);
5320        }
5321        for v in &self.value {
5322            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
5323            v.write_to(__cache, buf);
5324        }
5325        if self.options.is_set() {
5326            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
5327            self.options.write_to(__cache, buf);
5328        }
5329        for v in &self.reserved_range {
5330            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
5331            v.write_to(__cache, buf);
5332        }
5333        for v in &self.reserved_name {
5334            ::buffa::types::put_string_field(5u32, v, buf);
5335        }
5336        if let Some(ref v) = self.visibility {
5337            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
5338        }
5339        self.__buffa_unknown_fields.write_to(buf);
5340    }
5341    fn merge_field(
5342        &mut self,
5343        tag: ::buffa::encoding::Tag,
5344        buf: &mut impl ::buffa::bytes::Buf,
5345        ctx: ::buffa::DecodeContext<'_>,
5346    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5347        #[allow(unused_imports)]
5348        use ::buffa::bytes::Buf as _;
5349        #[allow(unused_imports)]
5350        use ::buffa::Enumeration as _;
5351        match tag.field_number() {
5352            1u32 => {
5353                ::buffa::encoding::check_wire_type(
5354                    tag,
5355                    ::buffa::encoding::WireType::LengthDelimited,
5356                )?;
5357                ::buffa::types::merge_string(
5358                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5359                    buf,
5360                )?;
5361            }
5362            2u32 => {
5363                ::buffa::encoding::check_wire_type(
5364                    tag,
5365                    ::buffa::encoding::WireType::LengthDelimited,
5366                )?;
5367                let mut elem = ::core::default::Default::default();
5368                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5369                self.value.push(elem);
5370            }
5371            3u32 => {
5372                ::buffa::encoding::check_wire_type(
5373                    tag,
5374                    ::buffa::encoding::WireType::LengthDelimited,
5375                )?;
5376                ::buffa::Message::merge_length_delimited(
5377                    self.options.get_or_insert_default(),
5378                    buf,
5379                    ctx,
5380                )?;
5381            }
5382            4u32 => {
5383                ::buffa::encoding::check_wire_type(
5384                    tag,
5385                    ::buffa::encoding::WireType::LengthDelimited,
5386                )?;
5387                let mut elem = ::core::default::Default::default();
5388                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5389                self.reserved_range.push(elem);
5390            }
5391            5u32 => {
5392                ::buffa::encoding::check_wire_type(
5393                    tag,
5394                    ::buffa::encoding::WireType::LengthDelimited,
5395                )?;
5396                self.reserved_name.push(::buffa::types::decode_string(buf)?);
5397            }
5398            6u32 => {
5399                ::buffa::encoding::check_wire_type(
5400                    tag,
5401                    ::buffa::encoding::WireType::Varint,
5402                )?;
5403                let __raw = ::buffa::types::decode_int32(buf)?;
5404                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
5405                    __raw,
5406                ) {
5407                    self.visibility = ::core::option::Option::Some(__v);
5408                } else {
5409                    self.__buffa_unknown_fields
5410                        .push(::buffa::UnknownField {
5411                            number: 6u32,
5412                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
5413                        });
5414                }
5415            }
5416            _ => {
5417                self.__buffa_unknown_fields
5418                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5419            }
5420        }
5421        ::core::result::Result::Ok(())
5422    }
5423    fn clear(&mut self) {
5424        self.name = ::core::option::Option::None;
5425        self.value.clear();
5426        self.options = ::buffa::MessageField::none();
5427        self.reserved_range.clear();
5428        self.reserved_name.clear();
5429        self.visibility = ::core::option::Option::None;
5430        self.__buffa_unknown_fields.clear();
5431    }
5432}
5433impl ::buffa::ExtensionSet for EnumDescriptorProto {
5434    const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto";
5435    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5436        &self.__buffa_unknown_fields
5437    }
5438    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5439        &mut self.__buffa_unknown_fields
5440    }
5441}
5442#[cfg(feature = "text")]
5443impl ::buffa::text::TextFormat for EnumDescriptorProto {
5444    fn encode_text(
5445        &self,
5446        enc: &mut ::buffa::text::TextEncoder<'_>,
5447    ) -> ::core::fmt::Result {
5448        #[allow(unused_imports)]
5449        use ::buffa::Enumeration as _;
5450        if let ::core::option::Option::Some(ref __v) = self.name {
5451            enc.write_field_name("name")?;
5452            enc.write_string(__v)?;
5453        }
5454        if self.options.is_set() {
5455            enc.write_field_name("options")?;
5456            enc.write_message(&*self.options)?;
5457        }
5458        if let ::core::option::Option::Some(ref __v) = self.visibility {
5459            enc.write_field_name("visibility")?;
5460            enc.write_enum_name(__v.proto_name())?;
5461        }
5462        for __v in &self.value {
5463            enc.write_field_name("value")?;
5464            enc.write_message(__v)?;
5465        }
5466        for __v in &self.reserved_range {
5467            enc.write_field_name("reserved_range")?;
5468            enc.write_message(__v)?;
5469        }
5470        for __v in &self.reserved_name {
5471            enc.write_field_name("reserved_name")?;
5472            enc.write_string(__v)?;
5473        }
5474        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5475        ::core::result::Result::Ok(())
5476    }
5477    fn merge_text(
5478        &mut self,
5479        dec: &mut ::buffa::text::TextDecoder<'_>,
5480    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5481        #[allow(unused_imports)]
5482        use ::buffa::Enumeration as _;
5483        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5484            match __name {
5485                "name" => {
5486                    self.name = ::core::option::Option::Some(
5487                        dec.read_string()?.into_owned(),
5488                    );
5489                }
5490                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5491                "visibility" => {
5492                    self.visibility = ::core::option::Option::Some(
5493                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
5494                    );
5495                }
5496                "value" => {
5497                    dec.read_repeated_into(
5498                        &mut self.value,
5499                        |__d| {
5500                            let mut __m = ::core::default::Default::default();
5501                            __d.merge_message(&mut __m)?;
5502                            ::core::result::Result::Ok(__m)
5503                        },
5504                    )?
5505                }
5506                "reserved_range" => {
5507                    dec.read_repeated_into(
5508                        &mut self.reserved_range,
5509                        |__d| {
5510                            let mut __m = ::core::default::Default::default();
5511                            __d.merge_message(&mut __m)?;
5512                            ::core::result::Result::Ok(__m)
5513                        },
5514                    )?
5515                }
5516                "reserved_name" => {
5517                    dec.read_repeated_into(
5518                        &mut self.reserved_name,
5519                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
5520                    )?
5521                }
5522                _ => dec.skip_value()?,
5523            }
5524        }
5525        ::core::result::Result::Ok(())
5526    }
5527}
5528#[cfg(feature = "json")]
5529impl ::buffa::json_helpers::ProtoElemJson for EnumDescriptorProto {
5530    fn serialize_proto_json<S: ::serde::Serializer>(
5531        v: &Self,
5532        s: S,
5533    ) -> ::core::result::Result<S::Ok, S::Error> {
5534        ::serde::Serialize::serialize(v, s)
5535    }
5536    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5537        d: D,
5538    ) -> ::core::result::Result<Self, D::Error> {
5539        <Self as ::serde::Deserialize>::deserialize(d)
5540    }
5541}
5542#[cfg(feature = "json")]
5543#[doc(hidden)]
5544pub const __ENUM_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5545    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5546    to_json: ::buffa::type_registry::any_to_json::<EnumDescriptorProto>,
5547    from_json: ::buffa::type_registry::any_from_json::<EnumDescriptorProto>,
5548    is_wkt: false,
5549};
5550#[cfg(feature = "text")]
5551#[doc(hidden)]
5552pub const __ENUM_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5553    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5554    text_encode: ::buffa::type_registry::any_encode_text::<EnumDescriptorProto>,
5555    text_merge: ::buffa::type_registry::any_merge_text::<EnumDescriptorProto>,
5556};
5557pub mod enum_descriptor_proto {
5558    #[allow(unused_imports)]
5559    use super::*;
5560    /// Range of reserved numeric values. Reserved values may not be used by
5561    /// entries in the same enum. Reserved ranges may not overlap.
5562    ///
5563    /// Note that this is distinct from DescriptorProto.ReservedRange in that it
5564    /// is inclusive such that it can appropriately represent the entire int32
5565    /// domain.
5566    #[derive(Clone, PartialEq, Default)]
5567    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5568    #[cfg_attr(feature = "json", serde(default))]
5569    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5570    pub struct EnumReservedRange {
5571        /// Inclusive.
5572        ///
5573        /// Field 1: `start`
5574        #[cfg_attr(
5575            feature = "json",
5576            serde(
5577                rename = "start",
5578                with = "::buffa::json_helpers::opt_int32",
5579                skip_serializing_if = "::core::option::Option::is_none"
5580            )
5581        )]
5582        pub start: ::core::option::Option<i32>,
5583        /// Inclusive.
5584        ///
5585        /// Field 2: `end`
5586        #[cfg_attr(
5587            feature = "json",
5588            serde(
5589                rename = "end",
5590                with = "::buffa::json_helpers::opt_int32",
5591                skip_serializing_if = "::core::option::Option::is_none"
5592            )
5593        )]
5594        pub end: ::core::option::Option<i32>,
5595        #[cfg_attr(feature = "json", serde(skip))]
5596        #[doc(hidden)]
5597        pub __buffa_unknown_fields: ::buffa::UnknownFields,
5598    }
5599    impl ::core::fmt::Debug for EnumReservedRange {
5600        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5601            f.debug_struct("EnumReservedRange")
5602                .field("start", &self.start)
5603                .field("end", &self.end)
5604                .finish()
5605        }
5606    }
5607    impl EnumReservedRange {
5608        /// Protobuf type URL for this message, for use with `Any::pack` and
5609        /// `Any::unpack_if`.
5610        ///
5611        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5612        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5613    }
5614    impl EnumReservedRange {
5615        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5616        #[inline]
5617        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
5618        pub fn with_start(mut self, value: i32) -> Self {
5619            self.start = Some(value);
5620            self
5621        }
5622        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5623        #[inline]
5624        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
5625        pub fn with_end(mut self, value: i32) -> Self {
5626            self.end = Some(value);
5627            self
5628        }
5629    }
5630    ::buffa::impl_default_instance!(EnumReservedRange);
5631    impl ::buffa::MessageName for EnumReservedRange {
5632        const PACKAGE: &'static str = "google.protobuf";
5633        const NAME: &'static str = "EnumDescriptorProto.EnumReservedRange";
5634        const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5635        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5636    }
5637    impl ::buffa::Message for EnumReservedRange {
5638        /// Returns the total encoded size in bytes.
5639        ///
5640        /// The result is a `u32`; the protobuf specification requires all
5641        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5642        /// compliant message will never overflow this type.
5643        #[allow(clippy::let_and_return)]
5644        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5645            #[allow(unused_imports)]
5646            use ::buffa::Enumeration as _;
5647            let mut size = 0u32;
5648            if let Some(v) = self.start {
5649                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
5650            }
5651            if let Some(v) = self.end {
5652                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
5653            }
5654            size += self.__buffa_unknown_fields.encoded_len() as u32;
5655            size
5656        }
5657        fn write_to(
5658            &self,
5659            _cache: &mut ::buffa::SizeCache,
5660            buf: &mut impl ::buffa::bytes::BufMut,
5661        ) {
5662            #[allow(unused_imports)]
5663            use ::buffa::Enumeration as _;
5664            if let Some(v) = self.start {
5665                ::buffa::types::put_int32_field(1u32, v, buf);
5666            }
5667            if let Some(v) = self.end {
5668                ::buffa::types::put_int32_field(2u32, v, buf);
5669            }
5670            self.__buffa_unknown_fields.write_to(buf);
5671        }
5672        fn merge_field(
5673            &mut self,
5674            tag: ::buffa::encoding::Tag,
5675            buf: &mut impl ::buffa::bytes::Buf,
5676            ctx: ::buffa::DecodeContext<'_>,
5677        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5678            #[allow(unused_imports)]
5679            use ::buffa::bytes::Buf as _;
5680            #[allow(unused_imports)]
5681            use ::buffa::Enumeration as _;
5682            match tag.field_number() {
5683                1u32 => {
5684                    ::buffa::encoding::check_wire_type(
5685                        tag,
5686                        ::buffa::encoding::WireType::Varint,
5687                    )?;
5688                    self.start = ::core::option::Option::Some(
5689                        ::buffa::types::decode_int32(buf)?,
5690                    );
5691                }
5692                2u32 => {
5693                    ::buffa::encoding::check_wire_type(
5694                        tag,
5695                        ::buffa::encoding::WireType::Varint,
5696                    )?;
5697                    self.end = ::core::option::Option::Some(
5698                        ::buffa::types::decode_int32(buf)?,
5699                    );
5700                }
5701                _ => {
5702                    self.__buffa_unknown_fields
5703                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5704                }
5705            }
5706            ::core::result::Result::Ok(())
5707        }
5708        fn clear(&mut self) {
5709            self.start = ::core::option::Option::None;
5710            self.end = ::core::option::Option::None;
5711            self.__buffa_unknown_fields.clear();
5712        }
5713    }
5714    impl ::buffa::ExtensionSet for EnumReservedRange {
5715        const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5716        fn unknown_fields(&self) -> &::buffa::UnknownFields {
5717            &self.__buffa_unknown_fields
5718        }
5719        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5720            &mut self.__buffa_unknown_fields
5721        }
5722    }
5723    #[cfg(feature = "text")]
5724    impl ::buffa::text::TextFormat for EnumReservedRange {
5725        fn encode_text(
5726            &self,
5727            enc: &mut ::buffa::text::TextEncoder<'_>,
5728        ) -> ::core::fmt::Result {
5729            #[allow(unused_imports)]
5730            use ::buffa::Enumeration as _;
5731            if let ::core::option::Option::Some(ref __v) = self.start {
5732                enc.write_field_name("start")?;
5733                enc.write_i32(*__v)?;
5734            }
5735            if let ::core::option::Option::Some(ref __v) = self.end {
5736                enc.write_field_name("end")?;
5737                enc.write_i32(*__v)?;
5738            }
5739            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5740            ::core::result::Result::Ok(())
5741        }
5742        fn merge_text(
5743            &mut self,
5744            dec: &mut ::buffa::text::TextDecoder<'_>,
5745        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5746            #[allow(unused_imports)]
5747            use ::buffa::Enumeration as _;
5748            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5749                match __name {
5750                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
5751                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
5752                    _ => dec.skip_value()?,
5753                }
5754            }
5755            ::core::result::Result::Ok(())
5756        }
5757    }
5758    #[cfg(feature = "json")]
5759    impl ::buffa::json_helpers::ProtoElemJson for EnumReservedRange {
5760        fn serialize_proto_json<S: ::serde::Serializer>(
5761            v: &Self,
5762            s: S,
5763        ) -> ::core::result::Result<S::Ok, S::Error> {
5764            ::serde::Serialize::serialize(v, s)
5765        }
5766        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5767            d: D,
5768        ) -> ::core::result::Result<Self, D::Error> {
5769            <Self as ::serde::Deserialize>::deserialize(d)
5770        }
5771    }
5772    #[cfg(feature = "json")]
5773    #[doc(hidden)]
5774    pub const __ENUM_RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5775        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
5776        to_json: ::buffa::type_registry::any_to_json::<EnumReservedRange>,
5777        from_json: ::buffa::type_registry::any_from_json::<EnumReservedRange>,
5778        is_wkt: false,
5779    };
5780    #[cfg(feature = "text")]
5781    #[doc(hidden)]
5782    pub const __ENUM_RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5783        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
5784        text_encode: ::buffa::type_registry::any_encode_text::<EnumReservedRange>,
5785        text_merge: ::buffa::type_registry::any_merge_text::<EnumReservedRange>,
5786    };
5787    #[cfg(feature = "views")]
5788    #[doc(inline)]
5789    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeView;
5790    #[cfg(feature = "views")]
5791    #[doc(inline)]
5792    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeOwnedView;
5793}
5794/// Describes a value within an enum.
5795#[derive(Clone, PartialEq, Default)]
5796#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5797#[cfg_attr(feature = "json", serde(default))]
5798#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5799pub struct EnumValueDescriptorProto {
5800    /// Field 1: `name`
5801    #[cfg_attr(
5802        feature = "json",
5803        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5804    )]
5805    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5806    /// Field 2: `number`
5807    #[cfg_attr(
5808        feature = "json",
5809        serde(
5810            rename = "number",
5811            with = "::buffa::json_helpers::opt_int32",
5812            skip_serializing_if = "::core::option::Option::is_none"
5813        )
5814    )]
5815    pub number: ::core::option::Option<i32>,
5816    /// Field 3: `options`
5817    #[cfg_attr(
5818        feature = "json",
5819        serde(
5820            rename = "options",
5821            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5822        )
5823    )]
5824    pub options: ::buffa::MessageField<EnumValueOptions>,
5825    #[cfg_attr(feature = "json", serde(skip))]
5826    #[doc(hidden)]
5827    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5828}
5829impl ::core::fmt::Debug for EnumValueDescriptorProto {
5830    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5831        f.debug_struct("EnumValueDescriptorProto")
5832            .field("name", &self.name)
5833            .field("number", &self.number)
5834            .field("options", &self.options)
5835            .finish()
5836    }
5837}
5838impl EnumValueDescriptorProto {
5839    /// Protobuf type URL for this message, for use with `Any::pack` and
5840    /// `Any::unpack_if`.
5841    ///
5842    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5843    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
5844}
5845impl EnumValueDescriptorProto {
5846    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5847    #[inline]
5848    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5849    pub fn with_name(
5850        mut self,
5851        value: impl Into<::buffa::alloc::string::String>,
5852    ) -> Self {
5853        self.name = Some(value.into());
5854        self
5855    }
5856    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5857    #[inline]
5858    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
5859    pub fn with_number(mut self, value: i32) -> Self {
5860        self.number = Some(value);
5861        self
5862    }
5863}
5864::buffa::impl_default_instance!(EnumValueDescriptorProto);
5865impl ::buffa::MessageName for EnumValueDescriptorProto {
5866    const PACKAGE: &'static str = "google.protobuf";
5867    const NAME: &'static str = "EnumValueDescriptorProto";
5868    const FULL_NAME: &'static str = "google.protobuf.EnumValueDescriptorProto";
5869    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
5870}
5871impl ::buffa::Message for EnumValueDescriptorProto {
5872    /// Returns the total encoded size in bytes.
5873    ///
5874    /// The result is a `u32`; the protobuf specification requires all
5875    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5876    /// compliant message will never overflow this type.
5877    #[allow(clippy::let_and_return)]
5878    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5879        #[allow(unused_imports)]
5880        use ::buffa::Enumeration as _;
5881        let mut size = 0u32;
5882        if let Some(ref v) = self.name {
5883            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5884        }
5885        if let Some(v) = self.number {
5886            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
5887        }
5888        if self.options.is_set() {
5889            let __slot = __cache.reserve();
5890            let inner_size = self.options.compute_size(__cache);
5891            __cache.set(__slot, inner_size);
5892            size
5893                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5894                    + inner_size;
5895        }
5896        size += self.__buffa_unknown_fields.encoded_len() as u32;
5897        size
5898    }
5899    fn write_to(
5900        &self,
5901        __cache: &mut ::buffa::SizeCache,
5902        buf: &mut impl ::buffa::bytes::BufMut,
5903    ) {
5904        #[allow(unused_imports)]
5905        use ::buffa::Enumeration as _;
5906        if let Some(ref v) = self.name {
5907            ::buffa::types::put_string_field(1u32, v, buf);
5908        }
5909        if let Some(v) = self.number {
5910            ::buffa::types::put_int32_field(2u32, v, buf);
5911        }
5912        if self.options.is_set() {
5913            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
5914            self.options.write_to(__cache, buf);
5915        }
5916        self.__buffa_unknown_fields.write_to(buf);
5917    }
5918    fn merge_field(
5919        &mut self,
5920        tag: ::buffa::encoding::Tag,
5921        buf: &mut impl ::buffa::bytes::Buf,
5922        ctx: ::buffa::DecodeContext<'_>,
5923    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5924        #[allow(unused_imports)]
5925        use ::buffa::bytes::Buf as _;
5926        #[allow(unused_imports)]
5927        use ::buffa::Enumeration as _;
5928        match tag.field_number() {
5929            1u32 => {
5930                ::buffa::encoding::check_wire_type(
5931                    tag,
5932                    ::buffa::encoding::WireType::LengthDelimited,
5933                )?;
5934                ::buffa::types::merge_string(
5935                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5936                    buf,
5937                )?;
5938            }
5939            2u32 => {
5940                ::buffa::encoding::check_wire_type(
5941                    tag,
5942                    ::buffa::encoding::WireType::Varint,
5943                )?;
5944                self.number = ::core::option::Option::Some(
5945                    ::buffa::types::decode_int32(buf)?,
5946                );
5947            }
5948            3u32 => {
5949                ::buffa::encoding::check_wire_type(
5950                    tag,
5951                    ::buffa::encoding::WireType::LengthDelimited,
5952                )?;
5953                ::buffa::Message::merge_length_delimited(
5954                    self.options.get_or_insert_default(),
5955                    buf,
5956                    ctx,
5957                )?;
5958            }
5959            _ => {
5960                self.__buffa_unknown_fields
5961                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5962            }
5963        }
5964        ::core::result::Result::Ok(())
5965    }
5966    fn clear(&mut self) {
5967        self.name = ::core::option::Option::None;
5968        self.number = ::core::option::Option::None;
5969        self.options = ::buffa::MessageField::none();
5970        self.__buffa_unknown_fields.clear();
5971    }
5972}
5973impl ::buffa::ExtensionSet for EnumValueDescriptorProto {
5974    const PROTO_FQN: &'static str = "google.protobuf.EnumValueDescriptorProto";
5975    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5976        &self.__buffa_unknown_fields
5977    }
5978    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5979        &mut self.__buffa_unknown_fields
5980    }
5981}
5982#[cfg(feature = "text")]
5983impl ::buffa::text::TextFormat for EnumValueDescriptorProto {
5984    fn encode_text(
5985        &self,
5986        enc: &mut ::buffa::text::TextEncoder<'_>,
5987    ) -> ::core::fmt::Result {
5988        #[allow(unused_imports)]
5989        use ::buffa::Enumeration as _;
5990        if let ::core::option::Option::Some(ref __v) = self.name {
5991            enc.write_field_name("name")?;
5992            enc.write_string(__v)?;
5993        }
5994        if let ::core::option::Option::Some(ref __v) = self.number {
5995            enc.write_field_name("number")?;
5996            enc.write_i32(*__v)?;
5997        }
5998        if self.options.is_set() {
5999            enc.write_field_name("options")?;
6000            enc.write_message(&*self.options)?;
6001        }
6002        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6003        ::core::result::Result::Ok(())
6004    }
6005    fn merge_text(
6006        &mut self,
6007        dec: &mut ::buffa::text::TextDecoder<'_>,
6008    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6009        #[allow(unused_imports)]
6010        use ::buffa::Enumeration as _;
6011        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6012            match __name {
6013                "name" => {
6014                    self.name = ::core::option::Option::Some(
6015                        dec.read_string()?.into_owned(),
6016                    );
6017                }
6018                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
6019                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6020                _ => dec.skip_value()?,
6021            }
6022        }
6023        ::core::result::Result::Ok(())
6024    }
6025}
6026#[cfg(feature = "json")]
6027impl ::buffa::json_helpers::ProtoElemJson for EnumValueDescriptorProto {
6028    fn serialize_proto_json<S: ::serde::Serializer>(
6029        v: &Self,
6030        s: S,
6031    ) -> ::core::result::Result<S::Ok, S::Error> {
6032        ::serde::Serialize::serialize(v, s)
6033    }
6034    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6035        d: D,
6036    ) -> ::core::result::Result<Self, D::Error> {
6037        <Self as ::serde::Deserialize>::deserialize(d)
6038    }
6039}
6040#[cfg(feature = "json")]
6041#[doc(hidden)]
6042pub const __ENUM_VALUE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6043    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6044    to_json: ::buffa::type_registry::any_to_json::<EnumValueDescriptorProto>,
6045    from_json: ::buffa::type_registry::any_from_json::<EnumValueDescriptorProto>,
6046    is_wkt: false,
6047};
6048#[cfg(feature = "text")]
6049#[doc(hidden)]
6050pub const __ENUM_VALUE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6051    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6052    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueDescriptorProto>,
6053    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueDescriptorProto>,
6054};
6055/// Describes a service.
6056#[derive(Clone, PartialEq, Default)]
6057#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6058#[cfg_attr(feature = "json", serde(default))]
6059#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6060pub struct ServiceDescriptorProto {
6061    /// Field 1: `name`
6062    #[cfg_attr(
6063        feature = "json",
6064        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6065    )]
6066    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6067    /// Field 2: `method`
6068    #[cfg_attr(
6069        feature = "json",
6070        serde(
6071            rename = "method",
6072            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
6073            deserialize_with = "::buffa::json_helpers::null_as_default"
6074        )
6075    )]
6076    pub method: ::buffa::alloc::vec::Vec<MethodDescriptorProto>,
6077    /// Field 3: `options`
6078    #[cfg_attr(
6079        feature = "json",
6080        serde(
6081            rename = "options",
6082            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6083        )
6084    )]
6085    pub options: ::buffa::MessageField<ServiceOptions>,
6086    #[cfg_attr(feature = "json", serde(skip))]
6087    #[doc(hidden)]
6088    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6089}
6090impl ::core::fmt::Debug for ServiceDescriptorProto {
6091    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6092        f.debug_struct("ServiceDescriptorProto")
6093            .field("name", &self.name)
6094            .field("method", &self.method)
6095            .field("options", &self.options)
6096            .finish()
6097    }
6098}
6099impl ServiceDescriptorProto {
6100    /// Protobuf type URL for this message, for use with `Any::pack` and
6101    /// `Any::unpack_if`.
6102    ///
6103    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6104    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6105}
6106impl ServiceDescriptorProto {
6107    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6108    #[inline]
6109    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6110    pub fn with_name(
6111        mut self,
6112        value: impl Into<::buffa::alloc::string::String>,
6113    ) -> Self {
6114        self.name = Some(value.into());
6115        self
6116    }
6117}
6118::buffa::impl_default_instance!(ServiceDescriptorProto);
6119impl ::buffa::MessageName for ServiceDescriptorProto {
6120    const PACKAGE: &'static str = "google.protobuf";
6121    const NAME: &'static str = "ServiceDescriptorProto";
6122    const FULL_NAME: &'static str = "google.protobuf.ServiceDescriptorProto";
6123    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6124}
6125impl ::buffa::Message for ServiceDescriptorProto {
6126    /// Returns the total encoded size in bytes.
6127    ///
6128    /// The result is a `u32`; the protobuf specification requires all
6129    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6130    /// compliant message will never overflow this type.
6131    #[allow(clippy::let_and_return)]
6132    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6133        #[allow(unused_imports)]
6134        use ::buffa::Enumeration as _;
6135        let mut size = 0u32;
6136        if let Some(ref v) = self.name {
6137            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6138        }
6139        for v in &self.method {
6140            let __slot = __cache.reserve();
6141            let inner_size = v.compute_size(__cache);
6142            __cache.set(__slot, inner_size);
6143            size
6144                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6145                    + inner_size;
6146        }
6147        if self.options.is_set() {
6148            let __slot = __cache.reserve();
6149            let inner_size = self.options.compute_size(__cache);
6150            __cache.set(__slot, inner_size);
6151            size
6152                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6153                    + inner_size;
6154        }
6155        size += self.__buffa_unknown_fields.encoded_len() as u32;
6156        size
6157    }
6158    fn write_to(
6159        &self,
6160        __cache: &mut ::buffa::SizeCache,
6161        buf: &mut impl ::buffa::bytes::BufMut,
6162    ) {
6163        #[allow(unused_imports)]
6164        use ::buffa::Enumeration as _;
6165        if let Some(ref v) = self.name {
6166            ::buffa::types::put_string_field(1u32, v, buf);
6167        }
6168        for v in &self.method {
6169            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
6170            v.write_to(__cache, buf);
6171        }
6172        if self.options.is_set() {
6173            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
6174            self.options.write_to(__cache, buf);
6175        }
6176        self.__buffa_unknown_fields.write_to(buf);
6177    }
6178    fn merge_field(
6179        &mut self,
6180        tag: ::buffa::encoding::Tag,
6181        buf: &mut impl ::buffa::bytes::Buf,
6182        ctx: ::buffa::DecodeContext<'_>,
6183    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6184        #[allow(unused_imports)]
6185        use ::buffa::bytes::Buf as _;
6186        #[allow(unused_imports)]
6187        use ::buffa::Enumeration as _;
6188        match tag.field_number() {
6189            1u32 => {
6190                ::buffa::encoding::check_wire_type(
6191                    tag,
6192                    ::buffa::encoding::WireType::LengthDelimited,
6193                )?;
6194                ::buffa::types::merge_string(
6195                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6196                    buf,
6197                )?;
6198            }
6199            2u32 => {
6200                ::buffa::encoding::check_wire_type(
6201                    tag,
6202                    ::buffa::encoding::WireType::LengthDelimited,
6203                )?;
6204                let mut elem = ::core::default::Default::default();
6205                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
6206                self.method.push(elem);
6207            }
6208            3u32 => {
6209                ::buffa::encoding::check_wire_type(
6210                    tag,
6211                    ::buffa::encoding::WireType::LengthDelimited,
6212                )?;
6213                ::buffa::Message::merge_length_delimited(
6214                    self.options.get_or_insert_default(),
6215                    buf,
6216                    ctx,
6217                )?;
6218            }
6219            _ => {
6220                self.__buffa_unknown_fields
6221                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6222            }
6223        }
6224        ::core::result::Result::Ok(())
6225    }
6226    fn clear(&mut self) {
6227        self.name = ::core::option::Option::None;
6228        self.method.clear();
6229        self.options = ::buffa::MessageField::none();
6230        self.__buffa_unknown_fields.clear();
6231    }
6232}
6233impl ::buffa::ExtensionSet for ServiceDescriptorProto {
6234    const PROTO_FQN: &'static str = "google.protobuf.ServiceDescriptorProto";
6235    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6236        &self.__buffa_unknown_fields
6237    }
6238    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6239        &mut self.__buffa_unknown_fields
6240    }
6241}
6242#[cfg(feature = "text")]
6243impl ::buffa::text::TextFormat for ServiceDescriptorProto {
6244    fn encode_text(
6245        &self,
6246        enc: &mut ::buffa::text::TextEncoder<'_>,
6247    ) -> ::core::fmt::Result {
6248        #[allow(unused_imports)]
6249        use ::buffa::Enumeration as _;
6250        if let ::core::option::Option::Some(ref __v) = self.name {
6251            enc.write_field_name("name")?;
6252            enc.write_string(__v)?;
6253        }
6254        if self.options.is_set() {
6255            enc.write_field_name("options")?;
6256            enc.write_message(&*self.options)?;
6257        }
6258        for __v in &self.method {
6259            enc.write_field_name("method")?;
6260            enc.write_message(__v)?;
6261        }
6262        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6263        ::core::result::Result::Ok(())
6264    }
6265    fn merge_text(
6266        &mut self,
6267        dec: &mut ::buffa::text::TextDecoder<'_>,
6268    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6269        #[allow(unused_imports)]
6270        use ::buffa::Enumeration as _;
6271        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6272            match __name {
6273                "name" => {
6274                    self.name = ::core::option::Option::Some(
6275                        dec.read_string()?.into_owned(),
6276                    );
6277                }
6278                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6279                "method" => {
6280                    dec.read_repeated_into(
6281                        &mut self.method,
6282                        |__d| {
6283                            let mut __m = ::core::default::Default::default();
6284                            __d.merge_message(&mut __m)?;
6285                            ::core::result::Result::Ok(__m)
6286                        },
6287                    )?
6288                }
6289                _ => dec.skip_value()?,
6290            }
6291        }
6292        ::core::result::Result::Ok(())
6293    }
6294}
6295#[cfg(feature = "json")]
6296impl ::buffa::json_helpers::ProtoElemJson for ServiceDescriptorProto {
6297    fn serialize_proto_json<S: ::serde::Serializer>(
6298        v: &Self,
6299        s: S,
6300    ) -> ::core::result::Result<S::Ok, S::Error> {
6301        ::serde::Serialize::serialize(v, s)
6302    }
6303    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6304        d: D,
6305    ) -> ::core::result::Result<Self, D::Error> {
6306        <Self as ::serde::Deserialize>::deserialize(d)
6307    }
6308}
6309#[cfg(feature = "json")]
6310#[doc(hidden)]
6311pub const __SERVICE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6312    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6313    to_json: ::buffa::type_registry::any_to_json::<ServiceDescriptorProto>,
6314    from_json: ::buffa::type_registry::any_from_json::<ServiceDescriptorProto>,
6315    is_wkt: false,
6316};
6317#[cfg(feature = "text")]
6318#[doc(hidden)]
6319pub const __SERVICE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6320    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6321    text_encode: ::buffa::type_registry::any_encode_text::<ServiceDescriptorProto>,
6322    text_merge: ::buffa::type_registry::any_merge_text::<ServiceDescriptorProto>,
6323};
6324/// Describes a method of a service.
6325#[derive(Clone, PartialEq, Default)]
6326#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6327#[cfg_attr(feature = "json", serde(default))]
6328#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6329pub struct MethodDescriptorProto {
6330    /// Field 1: `name`
6331    #[cfg_attr(
6332        feature = "json",
6333        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6334    )]
6335    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6336    /// Input and output type names.  These are resolved in the same way as
6337    /// FieldDescriptorProto.type_name, but must refer to a message type.
6338    ///
6339    /// Field 2: `input_type`
6340    #[cfg_attr(
6341        feature = "json",
6342        serde(
6343            rename = "inputType",
6344            alias = "input_type",
6345            skip_serializing_if = "::core::option::Option::is_none"
6346        )
6347    )]
6348    pub input_type: ::core::option::Option<::buffa::alloc::string::String>,
6349    /// Field 3: `output_type`
6350    #[cfg_attr(
6351        feature = "json",
6352        serde(
6353            rename = "outputType",
6354            alias = "output_type",
6355            skip_serializing_if = "::core::option::Option::is_none"
6356        )
6357    )]
6358    pub output_type: ::core::option::Option<::buffa::alloc::string::String>,
6359    /// Field 4: `options`
6360    #[cfg_attr(
6361        feature = "json",
6362        serde(
6363            rename = "options",
6364            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6365        )
6366    )]
6367    pub options: ::buffa::MessageField<MethodOptions>,
6368    /// Identifies if client streams multiple client messages
6369    ///
6370    /// Field 5: `client_streaming`
6371    #[cfg_attr(
6372        feature = "json",
6373        serde(
6374            rename = "clientStreaming",
6375            alias = "client_streaming",
6376            skip_serializing_if = "::core::option::Option::is_none"
6377        )
6378    )]
6379    pub client_streaming: ::core::option::Option<bool>,
6380    /// Identifies if server streams multiple server messages
6381    ///
6382    /// Field 6: `server_streaming`
6383    #[cfg_attr(
6384        feature = "json",
6385        serde(
6386            rename = "serverStreaming",
6387            alias = "server_streaming",
6388            skip_serializing_if = "::core::option::Option::is_none"
6389        )
6390    )]
6391    pub server_streaming: ::core::option::Option<bool>,
6392    #[cfg_attr(feature = "json", serde(skip))]
6393    #[doc(hidden)]
6394    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6395}
6396impl ::core::fmt::Debug for MethodDescriptorProto {
6397    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6398        f.debug_struct("MethodDescriptorProto")
6399            .field("name", &self.name)
6400            .field("input_type", &self.input_type)
6401            .field("output_type", &self.output_type)
6402            .field("options", &self.options)
6403            .field("client_streaming", &self.client_streaming)
6404            .field("server_streaming", &self.server_streaming)
6405            .finish()
6406    }
6407}
6408impl MethodDescriptorProto {
6409    /// Protobuf type URL for this message, for use with `Any::pack` and
6410    /// `Any::unpack_if`.
6411    ///
6412    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6413    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6414}
6415impl MethodDescriptorProto {
6416    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6417    #[inline]
6418    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6419    pub fn with_name(
6420        mut self,
6421        value: impl Into<::buffa::alloc::string::String>,
6422    ) -> Self {
6423        self.name = Some(value.into());
6424        self
6425    }
6426    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6427    #[inline]
6428    ///Sets [`Self::input_type`] to `Some(value)`, consuming and returning `self`.
6429    pub fn with_input_type(
6430        mut self,
6431        value: impl Into<::buffa::alloc::string::String>,
6432    ) -> Self {
6433        self.input_type = Some(value.into());
6434        self
6435    }
6436    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6437    #[inline]
6438    ///Sets [`Self::output_type`] to `Some(value)`, consuming and returning `self`.
6439    pub fn with_output_type(
6440        mut self,
6441        value: impl Into<::buffa::alloc::string::String>,
6442    ) -> Self {
6443        self.output_type = Some(value.into());
6444        self
6445    }
6446    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6447    #[inline]
6448    ///Sets [`Self::client_streaming`] to `Some(value)`, consuming and returning `self`.
6449    pub fn with_client_streaming(mut self, value: bool) -> Self {
6450        self.client_streaming = Some(value);
6451        self
6452    }
6453    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6454    #[inline]
6455    ///Sets [`Self::server_streaming`] to `Some(value)`, consuming and returning `self`.
6456    pub fn with_server_streaming(mut self, value: bool) -> Self {
6457        self.server_streaming = Some(value);
6458        self
6459    }
6460}
6461::buffa::impl_default_instance!(MethodDescriptorProto);
6462impl ::buffa::MessageName for MethodDescriptorProto {
6463    const PACKAGE: &'static str = "google.protobuf";
6464    const NAME: &'static str = "MethodDescriptorProto";
6465    const FULL_NAME: &'static str = "google.protobuf.MethodDescriptorProto";
6466    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6467}
6468impl ::buffa::Message for MethodDescriptorProto {
6469    /// Returns the total encoded size in bytes.
6470    ///
6471    /// The result is a `u32`; the protobuf specification requires all
6472    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6473    /// compliant message will never overflow this type.
6474    #[allow(clippy::let_and_return)]
6475    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6476        #[allow(unused_imports)]
6477        use ::buffa::Enumeration as _;
6478        let mut size = 0u32;
6479        if let Some(ref v) = self.name {
6480            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6481        }
6482        if let Some(ref v) = self.input_type {
6483            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6484        }
6485        if let Some(ref v) = self.output_type {
6486            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6487        }
6488        if self.options.is_set() {
6489            let __slot = __cache.reserve();
6490            let inner_size = self.options.compute_size(__cache);
6491            __cache.set(__slot, inner_size);
6492            size
6493                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6494                    + inner_size;
6495        }
6496        if self.client_streaming.is_some() {
6497            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
6498        }
6499        if self.server_streaming.is_some() {
6500            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
6501        }
6502        size += self.__buffa_unknown_fields.encoded_len() as u32;
6503        size
6504    }
6505    fn write_to(
6506        &self,
6507        __cache: &mut ::buffa::SizeCache,
6508        buf: &mut impl ::buffa::bytes::BufMut,
6509    ) {
6510        #[allow(unused_imports)]
6511        use ::buffa::Enumeration as _;
6512        if let Some(ref v) = self.name {
6513            ::buffa::types::put_string_field(1u32, v, buf);
6514        }
6515        if let Some(ref v) = self.input_type {
6516            ::buffa::types::put_string_field(2u32, v, buf);
6517        }
6518        if let Some(ref v) = self.output_type {
6519            ::buffa::types::put_string_field(3u32, v, buf);
6520        }
6521        if self.options.is_set() {
6522            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
6523            self.options.write_to(__cache, buf);
6524        }
6525        if let Some(v) = self.client_streaming {
6526            ::buffa::types::put_bool_field(5u32, v, buf);
6527        }
6528        if let Some(v) = self.server_streaming {
6529            ::buffa::types::put_bool_field(6u32, v, buf);
6530        }
6531        self.__buffa_unknown_fields.write_to(buf);
6532    }
6533    fn merge_field(
6534        &mut self,
6535        tag: ::buffa::encoding::Tag,
6536        buf: &mut impl ::buffa::bytes::Buf,
6537        ctx: ::buffa::DecodeContext<'_>,
6538    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6539        #[allow(unused_imports)]
6540        use ::buffa::bytes::Buf as _;
6541        #[allow(unused_imports)]
6542        use ::buffa::Enumeration as _;
6543        match tag.field_number() {
6544            1u32 => {
6545                ::buffa::encoding::check_wire_type(
6546                    tag,
6547                    ::buffa::encoding::WireType::LengthDelimited,
6548                )?;
6549                ::buffa::types::merge_string(
6550                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6551                    buf,
6552                )?;
6553            }
6554            2u32 => {
6555                ::buffa::encoding::check_wire_type(
6556                    tag,
6557                    ::buffa::encoding::WireType::LengthDelimited,
6558                )?;
6559                ::buffa::types::merge_string(
6560                    self
6561                        .input_type
6562                        .get_or_insert_with(::buffa::alloc::string::String::new),
6563                    buf,
6564                )?;
6565            }
6566            3u32 => {
6567                ::buffa::encoding::check_wire_type(
6568                    tag,
6569                    ::buffa::encoding::WireType::LengthDelimited,
6570                )?;
6571                ::buffa::types::merge_string(
6572                    self
6573                        .output_type
6574                        .get_or_insert_with(::buffa::alloc::string::String::new),
6575                    buf,
6576                )?;
6577            }
6578            4u32 => {
6579                ::buffa::encoding::check_wire_type(
6580                    tag,
6581                    ::buffa::encoding::WireType::LengthDelimited,
6582                )?;
6583                ::buffa::Message::merge_length_delimited(
6584                    self.options.get_or_insert_default(),
6585                    buf,
6586                    ctx,
6587                )?;
6588            }
6589            5u32 => {
6590                ::buffa::encoding::check_wire_type(
6591                    tag,
6592                    ::buffa::encoding::WireType::Varint,
6593                )?;
6594                self.client_streaming = ::core::option::Option::Some(
6595                    ::buffa::types::decode_bool(buf)?,
6596                );
6597            }
6598            6u32 => {
6599                ::buffa::encoding::check_wire_type(
6600                    tag,
6601                    ::buffa::encoding::WireType::Varint,
6602                )?;
6603                self.server_streaming = ::core::option::Option::Some(
6604                    ::buffa::types::decode_bool(buf)?,
6605                );
6606            }
6607            _ => {
6608                self.__buffa_unknown_fields
6609                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6610            }
6611        }
6612        ::core::result::Result::Ok(())
6613    }
6614    fn clear(&mut self) {
6615        self.name = ::core::option::Option::None;
6616        self.input_type = ::core::option::Option::None;
6617        self.output_type = ::core::option::Option::None;
6618        self.options = ::buffa::MessageField::none();
6619        self.client_streaming = ::core::option::Option::None;
6620        self.server_streaming = ::core::option::Option::None;
6621        self.__buffa_unknown_fields.clear();
6622    }
6623}
6624impl ::buffa::ExtensionSet for MethodDescriptorProto {
6625    const PROTO_FQN: &'static str = "google.protobuf.MethodDescriptorProto";
6626    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6627        &self.__buffa_unknown_fields
6628    }
6629    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6630        &mut self.__buffa_unknown_fields
6631    }
6632}
6633#[cfg(feature = "text")]
6634impl ::buffa::text::TextFormat for MethodDescriptorProto {
6635    fn encode_text(
6636        &self,
6637        enc: &mut ::buffa::text::TextEncoder<'_>,
6638    ) -> ::core::fmt::Result {
6639        #[allow(unused_imports)]
6640        use ::buffa::Enumeration as _;
6641        if let ::core::option::Option::Some(ref __v) = self.name {
6642            enc.write_field_name("name")?;
6643            enc.write_string(__v)?;
6644        }
6645        if let ::core::option::Option::Some(ref __v) = self.input_type {
6646            enc.write_field_name("input_type")?;
6647            enc.write_string(__v)?;
6648        }
6649        if let ::core::option::Option::Some(ref __v) = self.output_type {
6650            enc.write_field_name("output_type")?;
6651            enc.write_string(__v)?;
6652        }
6653        if self.options.is_set() {
6654            enc.write_field_name("options")?;
6655            enc.write_message(&*self.options)?;
6656        }
6657        if let ::core::option::Option::Some(ref __v) = self.client_streaming {
6658            enc.write_field_name("client_streaming")?;
6659            enc.write_bool(*__v)?;
6660        }
6661        if let ::core::option::Option::Some(ref __v) = self.server_streaming {
6662            enc.write_field_name("server_streaming")?;
6663            enc.write_bool(*__v)?;
6664        }
6665        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6666        ::core::result::Result::Ok(())
6667    }
6668    fn merge_text(
6669        &mut self,
6670        dec: &mut ::buffa::text::TextDecoder<'_>,
6671    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6672        #[allow(unused_imports)]
6673        use ::buffa::Enumeration as _;
6674        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6675            match __name {
6676                "name" => {
6677                    self.name = ::core::option::Option::Some(
6678                        dec.read_string()?.into_owned(),
6679                    );
6680                }
6681                "input_type" => {
6682                    self.input_type = ::core::option::Option::Some(
6683                        dec.read_string()?.into_owned(),
6684                    );
6685                }
6686                "output_type" => {
6687                    self.output_type = ::core::option::Option::Some(
6688                        dec.read_string()?.into_owned(),
6689                    );
6690                }
6691                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6692                "client_streaming" => {
6693                    self.client_streaming = ::core::option::Option::Some(
6694                        dec.read_bool()?,
6695                    );
6696                }
6697                "server_streaming" => {
6698                    self.server_streaming = ::core::option::Option::Some(
6699                        dec.read_bool()?,
6700                    );
6701                }
6702                _ => dec.skip_value()?,
6703            }
6704        }
6705        ::core::result::Result::Ok(())
6706    }
6707}
6708#[cfg(feature = "json")]
6709impl ::buffa::json_helpers::ProtoElemJson for MethodDescriptorProto {
6710    fn serialize_proto_json<S: ::serde::Serializer>(
6711        v: &Self,
6712        s: S,
6713    ) -> ::core::result::Result<S::Ok, S::Error> {
6714        ::serde::Serialize::serialize(v, s)
6715    }
6716    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6717        d: D,
6718    ) -> ::core::result::Result<Self, D::Error> {
6719        <Self as ::serde::Deserialize>::deserialize(d)
6720    }
6721}
6722#[cfg(feature = "json")]
6723#[doc(hidden)]
6724pub const __METHOD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6725    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6726    to_json: ::buffa::type_registry::any_to_json::<MethodDescriptorProto>,
6727    from_json: ::buffa::type_registry::any_from_json::<MethodDescriptorProto>,
6728    is_wkt: false,
6729};
6730#[cfg(feature = "text")]
6731#[doc(hidden)]
6732pub const __METHOD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6733    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6734    text_encode: ::buffa::type_registry::any_encode_text::<MethodDescriptorProto>,
6735    text_merge: ::buffa::type_registry::any_merge_text::<MethodDescriptorProto>,
6736};
6737/// ===================================================================
6738/// Options
6739///
6740/// Each of the definitions above may have "options" attached.  These are
6741/// just annotations which may cause code to be generated slightly differently
6742/// or may contain hints for code that manipulates protocol messages.
6743///
6744/// Clients may define custom options as extensions of the *Options messages.
6745/// These extensions may not yet be known at parsing time, so the parser cannot
6746/// store the values in them.  Instead it stores them in a field in the *Options
6747/// message called uninterpreted_option. This field must have the same name
6748/// across all *Options messages. We then use this field to populate the
6749/// extensions when we build a descriptor, at which point all protos have been
6750/// parsed and so all extensions are known.
6751///
6752/// Extension numbers for custom options may be chosen as follows:
6753/// * For options which will only be used within a single application or
6754///   organization, or for experimental options, use field numbers 50000
6755///   through 99999.  It is up to you to ensure that you do not use the
6756///   same number for multiple options.
6757/// * For options which will be published and used publicly by multiple
6758///   independent entities, e-mail protobuf-global-extension-registry@google.com
6759///   to reserve extension numbers. Simply provide your project name (e.g.
6760///   Objective-C plugin) and your project website (if available) -- there's no
6761///   need to explain how you intend to use them. Usually you only need one
6762///   extension number. You can declare multiple options with only one extension
6763///   number by putting them in a sub-message. See the Custom Options section of
6764///   the docs for examples:
6765///   <https://developers.google.com/protocol-buffers/docs/proto#options>
6766///   If this turns out to be popular, a web service will be set up
6767///   to automatically assign option numbers.
6768#[derive(Clone, PartialEq, Default)]
6769#[cfg_attr(feature = "json", derive(::serde::Serialize))]
6770#[cfg_attr(feature = "json", serde(default))]
6771#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6772pub struct FileOptions {
6773    /// Sets the Java package where classes generated from this .proto will be
6774    /// placed.  By default, the proto package is used, but this is often
6775    /// inappropriate because proto packages do not normally start with backwards
6776    /// domain names.
6777    ///
6778    /// Field 1: `java_package`
6779    #[cfg_attr(
6780        feature = "json",
6781        serde(
6782            rename = "javaPackage",
6783            alias = "java_package",
6784            skip_serializing_if = "::core::option::Option::is_none"
6785        )
6786    )]
6787    pub java_package: ::core::option::Option<::buffa::alloc::string::String>,
6788    /// Controls the name of the wrapper Java class generated for the .proto file.
6789    /// That class will always contain the .proto file's getDescriptor() method as
6790    /// well as any top-level extensions defined in the .proto file.
6791    /// If java_multiple_files is disabled, then all the other classes from the
6792    /// .proto file will be nested inside the single wrapper outer class.
6793    ///
6794    /// Field 8: `java_outer_classname`
6795    #[cfg_attr(
6796        feature = "json",
6797        serde(
6798            rename = "javaOuterClassname",
6799            alias = "java_outer_classname",
6800            skip_serializing_if = "::core::option::Option::is_none"
6801        )
6802    )]
6803    pub java_outer_classname: ::core::option::Option<::buffa::alloc::string::String>,
6804    /// If enabled, then the Java code generator will generate a separate .java
6805    /// file for each top-level message, enum, and service defined in the .proto
6806    /// file.  Thus, these types will *not* be nested inside the wrapper class
6807    /// named by java_outer_classname.  However, the wrapper class will still be
6808    /// generated to contain the file's getDescriptor() method as well as any
6809    /// top-level extensions defined in the file.
6810    ///
6811    /// Field 10: `java_multiple_files`
6812    #[cfg_attr(
6813        feature = "json",
6814        serde(
6815            rename = "javaMultipleFiles",
6816            alias = "java_multiple_files",
6817            skip_serializing_if = "::core::option::Option::is_none"
6818        )
6819    )]
6820    pub java_multiple_files: ::core::option::Option<bool>,
6821    /// This option does nothing.
6822    ///
6823    /// Field 20: `java_generate_equals_and_hash`
6824    #[cfg_attr(
6825        feature = "json",
6826        serde(
6827            rename = "javaGenerateEqualsAndHash",
6828            alias = "java_generate_equals_and_hash",
6829            skip_serializing_if = "::core::option::Option::is_none"
6830        )
6831    )]
6832    pub java_generate_equals_and_hash: ::core::option::Option<bool>,
6833    /// A proto2 file can set this to true to opt in to UTF-8 checking for Java,
6834    /// which will throw an exception if invalid UTF-8 is parsed from the wire or
6835    /// assigned to a string field.
6836    ///
6837    /// TODO: clarify exactly what kinds of field types this option
6838    /// applies to, and update these docs accordingly.
6839    ///
6840    /// Proto3 files already perform these checks. Setting the option explicitly to
6841    /// false has no effect: it cannot be used to opt proto3 files out of UTF-8
6842    /// checks.
6843    ///
6844    /// Field 27: `java_string_check_utf8`
6845    #[cfg_attr(
6846        feature = "json",
6847        serde(
6848            rename = "javaStringCheckUtf8",
6849            alias = "java_string_check_utf8",
6850            skip_serializing_if = "::core::option::Option::is_none"
6851        )
6852    )]
6853    pub java_string_check_utf8: ::core::option::Option<bool>,
6854    /// Field 9: `optimize_for`
6855    #[cfg_attr(
6856        feature = "json",
6857        serde(
6858            rename = "optimizeFor",
6859            alias = "optimize_for",
6860            with = "::buffa::json_helpers::opt_closed_enum",
6861            skip_serializing_if = "::core::option::Option::is_none"
6862        )
6863    )]
6864    pub optimize_for: ::core::option::Option<file_options::OptimizeMode>,
6865    /// Sets the Go package where structs generated from this .proto will be
6866    /// placed. If omitted, the Go package will be derived from the following:
6867    ///   - The basename of the package import path, if provided.
6868    ///   - Otherwise, the package statement in the .proto file, if present.
6869    ///   - Otherwise, the basename of the .proto file, without extension.
6870    ///
6871    /// Field 11: `go_package`
6872    #[cfg_attr(
6873        feature = "json",
6874        serde(
6875            rename = "goPackage",
6876            alias = "go_package",
6877            skip_serializing_if = "::core::option::Option::is_none"
6878        )
6879    )]
6880    pub go_package: ::core::option::Option<::buffa::alloc::string::String>,
6881    /// Should generic services be generated in each language?  "Generic" services
6882    /// are not specific to any particular RPC system.  They are generated by the
6883    /// main code generators in each language (without additional plugins).
6884    /// Generic services were the only kind of service generation supported by
6885    /// early versions of google.protobuf.
6886    ///
6887    /// Generic services are now considered deprecated in favor of using plugins
6888    /// that generate code specific to your particular RPC system.  Therefore,
6889    /// these default to false.  Old code which depends on generic services should
6890    /// explicitly set them to true.
6891    ///
6892    /// Field 16: `cc_generic_services`
6893    #[cfg_attr(
6894        feature = "json",
6895        serde(
6896            rename = "ccGenericServices",
6897            alias = "cc_generic_services",
6898            skip_serializing_if = "::core::option::Option::is_none"
6899        )
6900    )]
6901    pub cc_generic_services: ::core::option::Option<bool>,
6902    /// Field 17: `java_generic_services`
6903    #[cfg_attr(
6904        feature = "json",
6905        serde(
6906            rename = "javaGenericServices",
6907            alias = "java_generic_services",
6908            skip_serializing_if = "::core::option::Option::is_none"
6909        )
6910    )]
6911    pub java_generic_services: ::core::option::Option<bool>,
6912    /// Field 18: `py_generic_services`
6913    #[cfg_attr(
6914        feature = "json",
6915        serde(
6916            rename = "pyGenericServices",
6917            alias = "py_generic_services",
6918            skip_serializing_if = "::core::option::Option::is_none"
6919        )
6920    )]
6921    pub py_generic_services: ::core::option::Option<bool>,
6922    /// Is this file deprecated?
6923    /// Depending on the target platform, this can emit Deprecated annotations
6924    /// for everything in the file, or it will be completely ignored; in the very
6925    /// least, this is a formalization for deprecating files.
6926    ///
6927    /// Field 23: `deprecated`
6928    #[cfg_attr(
6929        feature = "json",
6930        serde(
6931            rename = "deprecated",
6932            skip_serializing_if = "::core::option::Option::is_none"
6933        )
6934    )]
6935    pub deprecated: ::core::option::Option<bool>,
6936    /// Enables the use of arenas for the proto messages in this file. This applies
6937    /// only to generated classes for C++.
6938    ///
6939    /// Field 31: `cc_enable_arenas`
6940    #[cfg_attr(
6941        feature = "json",
6942        serde(
6943            rename = "ccEnableArenas",
6944            alias = "cc_enable_arenas",
6945            skip_serializing_if = "::core::option::Option::is_none"
6946        )
6947    )]
6948    pub cc_enable_arenas: ::core::option::Option<bool>,
6949    /// Sets the objective c class prefix which is prepended to all objective c
6950    /// generated classes from this .proto. There is no default.
6951    ///
6952    /// Field 36: `objc_class_prefix`
6953    #[cfg_attr(
6954        feature = "json",
6955        serde(
6956            rename = "objcClassPrefix",
6957            alias = "objc_class_prefix",
6958            skip_serializing_if = "::core::option::Option::is_none"
6959        )
6960    )]
6961    pub objc_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
6962    /// Namespace for generated classes; defaults to the package.
6963    ///
6964    /// Field 37: `csharp_namespace`
6965    #[cfg_attr(
6966        feature = "json",
6967        serde(
6968            rename = "csharpNamespace",
6969            alias = "csharp_namespace",
6970            skip_serializing_if = "::core::option::Option::is_none"
6971        )
6972    )]
6973    pub csharp_namespace: ::core::option::Option<::buffa::alloc::string::String>,
6974    /// By default Swift generators will take the proto package and CamelCase it
6975    /// replacing '.' with underscore and use that to prefix the types/symbols
6976    /// defined. When this options is provided, they will use this value instead
6977    /// to prefix the types/symbols defined.
6978    ///
6979    /// Field 39: `swift_prefix`
6980    #[cfg_attr(
6981        feature = "json",
6982        serde(
6983            rename = "swiftPrefix",
6984            alias = "swift_prefix",
6985            skip_serializing_if = "::core::option::Option::is_none"
6986        )
6987    )]
6988    pub swift_prefix: ::core::option::Option<::buffa::alloc::string::String>,
6989    /// Sets the php class prefix which is prepended to all php generated classes
6990    /// from this .proto. Default is empty.
6991    ///
6992    /// Field 40: `php_class_prefix`
6993    #[cfg_attr(
6994        feature = "json",
6995        serde(
6996            rename = "phpClassPrefix",
6997            alias = "php_class_prefix",
6998            skip_serializing_if = "::core::option::Option::is_none"
6999        )
7000    )]
7001    pub php_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7002    /// Use this option to change the namespace of php generated classes. Default
7003    /// is empty. When this option is empty, the package name will be used for
7004    /// determining the namespace.
7005    ///
7006    /// Field 41: `php_namespace`
7007    #[cfg_attr(
7008        feature = "json",
7009        serde(
7010            rename = "phpNamespace",
7011            alias = "php_namespace",
7012            skip_serializing_if = "::core::option::Option::is_none"
7013        )
7014    )]
7015    pub php_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7016    /// Use this option to change the namespace of php generated metadata classes.
7017    /// Default is empty. When this option is empty, the proto file name will be
7018    /// used for determining the namespace.
7019    ///
7020    /// Field 44: `php_metadata_namespace`
7021    #[cfg_attr(
7022        feature = "json",
7023        serde(
7024            rename = "phpMetadataNamespace",
7025            alias = "php_metadata_namespace",
7026            skip_serializing_if = "::core::option::Option::is_none"
7027        )
7028    )]
7029    pub php_metadata_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7030    /// Use this option to change the package of ruby generated classes. Default
7031    /// is empty. When this option is not set, the package name will be used for
7032    /// determining the ruby package.
7033    ///
7034    /// Field 45: `ruby_package`
7035    #[cfg_attr(
7036        feature = "json",
7037        serde(
7038            rename = "rubyPackage",
7039            alias = "ruby_package",
7040            skip_serializing_if = "::core::option::Option::is_none"
7041        )
7042    )]
7043    pub ruby_package: ::core::option::Option<::buffa::alloc::string::String>,
7044    /// Any features defined in the specific edition.
7045    /// WARNING: This field should only be used by protobuf plugins or special
7046    /// cases like the proto compiler. Other uses are discouraged and
7047    /// developers should rely on the protoreflect APIs for their client language.
7048    ///
7049    /// Field 50: `features`
7050    #[cfg_attr(
7051        feature = "json",
7052        serde(
7053            rename = "features",
7054            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7055        )
7056    )]
7057    pub features: ::buffa::MessageField<FeatureSet>,
7058    /// The parser stores options it doesn't recognize here.
7059    /// See the documentation for the "Options" section above.
7060    ///
7061    /// Field 999: `uninterpreted_option`
7062    #[cfg_attr(
7063        feature = "json",
7064        serde(
7065            rename = "uninterpretedOption",
7066            alias = "uninterpreted_option",
7067            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
7068            deserialize_with = "::buffa::json_helpers::null_as_default"
7069        )
7070    )]
7071    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
7072    #[cfg_attr(feature = "json", serde(flatten))]
7073    #[doc(hidden)]
7074    pub __buffa_unknown_fields: __FileOptionsExtJson,
7075}
7076impl ::core::fmt::Debug for FileOptions {
7077    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7078        f.debug_struct("FileOptions")
7079            .field("java_package", &self.java_package)
7080            .field("java_outer_classname", &self.java_outer_classname)
7081            .field("java_multiple_files", &self.java_multiple_files)
7082            .field("java_generate_equals_and_hash", &self.java_generate_equals_and_hash)
7083            .field("java_string_check_utf8", &self.java_string_check_utf8)
7084            .field("optimize_for", &self.optimize_for)
7085            .field("go_package", &self.go_package)
7086            .field("cc_generic_services", &self.cc_generic_services)
7087            .field("java_generic_services", &self.java_generic_services)
7088            .field("py_generic_services", &self.py_generic_services)
7089            .field("deprecated", &self.deprecated)
7090            .field("cc_enable_arenas", &self.cc_enable_arenas)
7091            .field("objc_class_prefix", &self.objc_class_prefix)
7092            .field("csharp_namespace", &self.csharp_namespace)
7093            .field("swift_prefix", &self.swift_prefix)
7094            .field("php_class_prefix", &self.php_class_prefix)
7095            .field("php_namespace", &self.php_namespace)
7096            .field("php_metadata_namespace", &self.php_metadata_namespace)
7097            .field("ruby_package", &self.ruby_package)
7098            .field("features", &self.features)
7099            .field("uninterpreted_option", &self.uninterpreted_option)
7100            .finish()
7101    }
7102}
7103impl FileOptions {
7104    /// Protobuf type URL for this message, for use with `Any::pack` and
7105    /// `Any::unpack_if`.
7106    ///
7107    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7108    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7109}
7110impl FileOptions {
7111    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7112    #[inline]
7113    ///Sets [`Self::java_package`] to `Some(value)`, consuming and returning `self`.
7114    pub fn with_java_package(
7115        mut self,
7116        value: impl Into<::buffa::alloc::string::String>,
7117    ) -> Self {
7118        self.java_package = Some(value.into());
7119        self
7120    }
7121    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7122    #[inline]
7123    ///Sets [`Self::java_outer_classname`] to `Some(value)`, consuming and returning `self`.
7124    pub fn with_java_outer_classname(
7125        mut self,
7126        value: impl Into<::buffa::alloc::string::String>,
7127    ) -> Self {
7128        self.java_outer_classname = Some(value.into());
7129        self
7130    }
7131    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7132    #[inline]
7133    ///Sets [`Self::java_multiple_files`] to `Some(value)`, consuming and returning `self`.
7134    pub fn with_java_multiple_files(mut self, value: bool) -> Self {
7135        self.java_multiple_files = Some(value);
7136        self
7137    }
7138    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7139    #[inline]
7140    ///Sets [`Self::java_generate_equals_and_hash`] to `Some(value)`, consuming and returning `self`.
7141    pub fn with_java_generate_equals_and_hash(mut self, value: bool) -> Self {
7142        self.java_generate_equals_and_hash = Some(value);
7143        self
7144    }
7145    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7146    #[inline]
7147    ///Sets [`Self::java_string_check_utf8`] to `Some(value)`, consuming and returning `self`.
7148    pub fn with_java_string_check_utf8(mut self, value: bool) -> Self {
7149        self.java_string_check_utf8 = Some(value);
7150        self
7151    }
7152    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7153    #[inline]
7154    ///Sets [`Self::optimize_for`] to `Some(value)`, consuming and returning `self`.
7155    pub fn with_optimize_for(
7156        mut self,
7157        value: impl Into<file_options::OptimizeMode>,
7158    ) -> Self {
7159        self.optimize_for = Some(value.into());
7160        self
7161    }
7162    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7163    #[inline]
7164    ///Sets [`Self::go_package`] to `Some(value)`, consuming and returning `self`.
7165    pub fn with_go_package(
7166        mut self,
7167        value: impl Into<::buffa::alloc::string::String>,
7168    ) -> Self {
7169        self.go_package = Some(value.into());
7170        self
7171    }
7172    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7173    #[inline]
7174    ///Sets [`Self::cc_generic_services`] to `Some(value)`, consuming and returning `self`.
7175    pub fn with_cc_generic_services(mut self, value: bool) -> Self {
7176        self.cc_generic_services = Some(value);
7177        self
7178    }
7179    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7180    #[inline]
7181    ///Sets [`Self::java_generic_services`] to `Some(value)`, consuming and returning `self`.
7182    pub fn with_java_generic_services(mut self, value: bool) -> Self {
7183        self.java_generic_services = Some(value);
7184        self
7185    }
7186    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7187    #[inline]
7188    ///Sets [`Self::py_generic_services`] to `Some(value)`, consuming and returning `self`.
7189    pub fn with_py_generic_services(mut self, value: bool) -> Self {
7190        self.py_generic_services = Some(value);
7191        self
7192    }
7193    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7194    #[inline]
7195    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
7196    pub fn with_deprecated(mut self, value: bool) -> Self {
7197        self.deprecated = Some(value);
7198        self
7199    }
7200    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7201    #[inline]
7202    ///Sets [`Self::cc_enable_arenas`] to `Some(value)`, consuming and returning `self`.
7203    pub fn with_cc_enable_arenas(mut self, value: bool) -> Self {
7204        self.cc_enable_arenas = Some(value);
7205        self
7206    }
7207    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7208    #[inline]
7209    ///Sets [`Self::objc_class_prefix`] to `Some(value)`, consuming and returning `self`.
7210    pub fn with_objc_class_prefix(
7211        mut self,
7212        value: impl Into<::buffa::alloc::string::String>,
7213    ) -> Self {
7214        self.objc_class_prefix = Some(value.into());
7215        self
7216    }
7217    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7218    #[inline]
7219    ///Sets [`Self::csharp_namespace`] to `Some(value)`, consuming and returning `self`.
7220    pub fn with_csharp_namespace(
7221        mut self,
7222        value: impl Into<::buffa::alloc::string::String>,
7223    ) -> Self {
7224        self.csharp_namespace = Some(value.into());
7225        self
7226    }
7227    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7228    #[inline]
7229    ///Sets [`Self::swift_prefix`] to `Some(value)`, consuming and returning `self`.
7230    pub fn with_swift_prefix(
7231        mut self,
7232        value: impl Into<::buffa::alloc::string::String>,
7233    ) -> Self {
7234        self.swift_prefix = Some(value.into());
7235        self
7236    }
7237    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7238    #[inline]
7239    ///Sets [`Self::php_class_prefix`] to `Some(value)`, consuming and returning `self`.
7240    pub fn with_php_class_prefix(
7241        mut self,
7242        value: impl Into<::buffa::alloc::string::String>,
7243    ) -> Self {
7244        self.php_class_prefix = Some(value.into());
7245        self
7246    }
7247    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7248    #[inline]
7249    ///Sets [`Self::php_namespace`] to `Some(value)`, consuming and returning `self`.
7250    pub fn with_php_namespace(
7251        mut self,
7252        value: impl Into<::buffa::alloc::string::String>,
7253    ) -> Self {
7254        self.php_namespace = Some(value.into());
7255        self
7256    }
7257    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7258    #[inline]
7259    ///Sets [`Self::php_metadata_namespace`] to `Some(value)`, consuming and returning `self`.
7260    pub fn with_php_metadata_namespace(
7261        mut self,
7262        value: impl Into<::buffa::alloc::string::String>,
7263    ) -> Self {
7264        self.php_metadata_namespace = Some(value.into());
7265        self
7266    }
7267    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7268    #[inline]
7269    ///Sets [`Self::ruby_package`] to `Some(value)`, consuming and returning `self`.
7270    pub fn with_ruby_package(
7271        mut self,
7272        value: impl Into<::buffa::alloc::string::String>,
7273    ) -> Self {
7274        self.ruby_package = Some(value.into());
7275        self
7276    }
7277}
7278::buffa::impl_default_instance!(FileOptions);
7279impl ::buffa::MessageName for FileOptions {
7280    const PACKAGE: &'static str = "google.protobuf";
7281    const NAME: &'static str = "FileOptions";
7282    const FULL_NAME: &'static str = "google.protobuf.FileOptions";
7283    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7284}
7285impl ::buffa::Message for FileOptions {
7286    /// Returns the total encoded size in bytes.
7287    ///
7288    /// The result is a `u32`; the protobuf specification requires all
7289    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7290    /// compliant message will never overflow this type.
7291    #[allow(clippy::let_and_return)]
7292    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7293        #[allow(unused_imports)]
7294        use ::buffa::Enumeration as _;
7295        let mut size = 0u32;
7296        if let Some(ref v) = self.java_package {
7297            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7298        }
7299        if let Some(ref v) = self.java_outer_classname {
7300            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7301        }
7302        if let Some(ref v) = self.optimize_for {
7303            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
7304        }
7305        if self.java_multiple_files.is_some() {
7306            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7307        }
7308        if let Some(ref v) = self.go_package {
7309            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7310        }
7311        if self.cc_generic_services.is_some() {
7312            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7313        }
7314        if self.java_generic_services.is_some() {
7315            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7316        }
7317        if self.py_generic_services.is_some() {
7318            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7319        }
7320        if self.java_generate_equals_and_hash.is_some() {
7321            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7322        }
7323        if self.deprecated.is_some() {
7324            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7325        }
7326        if self.java_string_check_utf8.is_some() {
7327            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7328        }
7329        if self.cc_enable_arenas.is_some() {
7330            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7331        }
7332        if let Some(ref v) = self.objc_class_prefix {
7333            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7334        }
7335        if let Some(ref v) = self.csharp_namespace {
7336            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7337        }
7338        if let Some(ref v) = self.swift_prefix {
7339            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7340        }
7341        if let Some(ref v) = self.php_class_prefix {
7342            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7343        }
7344        if let Some(ref v) = self.php_namespace {
7345            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7346        }
7347        if let Some(ref v) = self.php_metadata_namespace {
7348            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7349        }
7350        if let Some(ref v) = self.ruby_package {
7351            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7352        }
7353        if self.features.is_set() {
7354            let __slot = __cache.reserve();
7355            let inner_size = self.features.compute_size(__cache);
7356            __cache.set(__slot, inner_size);
7357            size
7358                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7359                    + inner_size;
7360        }
7361        for v in &self.uninterpreted_option {
7362            let __slot = __cache.reserve();
7363            let inner_size = v.compute_size(__cache);
7364            __cache.set(__slot, inner_size);
7365            size
7366                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7367                    + inner_size;
7368        }
7369        size += self.__buffa_unknown_fields.encoded_len() as u32;
7370        size
7371    }
7372    fn write_to(
7373        &self,
7374        __cache: &mut ::buffa::SizeCache,
7375        buf: &mut impl ::buffa::bytes::BufMut,
7376    ) {
7377        #[allow(unused_imports)]
7378        use ::buffa::Enumeration as _;
7379        if let Some(ref v) = self.java_package {
7380            ::buffa::types::put_string_field(1u32, v, buf);
7381        }
7382        if let Some(ref v) = self.java_outer_classname {
7383            ::buffa::types::put_string_field(8u32, v, buf);
7384        }
7385        if let Some(ref v) = self.optimize_for {
7386            ::buffa::types::put_int32_field(9u32, v.to_i32(), buf);
7387        }
7388        if let Some(v) = self.java_multiple_files {
7389            ::buffa::types::put_bool_field(10u32, v, buf);
7390        }
7391        if let Some(ref v) = self.go_package {
7392            ::buffa::types::put_string_field(11u32, v, buf);
7393        }
7394        if let Some(v) = self.cc_generic_services {
7395            ::buffa::types::put_bool_field(16u32, v, buf);
7396        }
7397        if let Some(v) = self.java_generic_services {
7398            ::buffa::types::put_bool_field(17u32, v, buf);
7399        }
7400        if let Some(v) = self.py_generic_services {
7401            ::buffa::types::put_bool_field(18u32, v, buf);
7402        }
7403        if let Some(v) = self.java_generate_equals_and_hash {
7404            ::buffa::types::put_bool_field(20u32, v, buf);
7405        }
7406        if let Some(v) = self.deprecated {
7407            ::buffa::types::put_bool_field(23u32, v, buf);
7408        }
7409        if let Some(v) = self.java_string_check_utf8 {
7410            ::buffa::types::put_bool_field(27u32, v, buf);
7411        }
7412        if let Some(v) = self.cc_enable_arenas {
7413            ::buffa::types::put_bool_field(31u32, v, buf);
7414        }
7415        if let Some(ref v) = self.objc_class_prefix {
7416            ::buffa::types::put_string_field(36u32, v, buf);
7417        }
7418        if let Some(ref v) = self.csharp_namespace {
7419            ::buffa::types::put_string_field(37u32, v, buf);
7420        }
7421        if let Some(ref v) = self.swift_prefix {
7422            ::buffa::types::put_string_field(39u32, v, buf);
7423        }
7424        if let Some(ref v) = self.php_class_prefix {
7425            ::buffa::types::put_string_field(40u32, v, buf);
7426        }
7427        if let Some(ref v) = self.php_namespace {
7428            ::buffa::types::put_string_field(41u32, v, buf);
7429        }
7430        if let Some(ref v) = self.php_metadata_namespace {
7431            ::buffa::types::put_string_field(44u32, v, buf);
7432        }
7433        if let Some(ref v) = self.ruby_package {
7434            ::buffa::types::put_string_field(45u32, v, buf);
7435        }
7436        if self.features.is_set() {
7437            ::buffa::types::put_len_delimited_header(50u32, __cache.consume_next(), buf);
7438            self.features.write_to(__cache, buf);
7439        }
7440        for v in &self.uninterpreted_option {
7441            ::buffa::types::put_len_delimited_header(
7442                999u32,
7443                __cache.consume_next(),
7444                buf,
7445            );
7446            v.write_to(__cache, buf);
7447        }
7448        self.__buffa_unknown_fields.write_to(buf);
7449    }
7450    fn merge_field(
7451        &mut self,
7452        tag: ::buffa::encoding::Tag,
7453        buf: &mut impl ::buffa::bytes::Buf,
7454        ctx: ::buffa::DecodeContext<'_>,
7455    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7456        #[allow(unused_imports)]
7457        use ::buffa::bytes::Buf as _;
7458        #[allow(unused_imports)]
7459        use ::buffa::Enumeration as _;
7460        match tag.field_number() {
7461            1u32 => {
7462                ::buffa::encoding::check_wire_type(
7463                    tag,
7464                    ::buffa::encoding::WireType::LengthDelimited,
7465                )?;
7466                ::buffa::types::merge_string(
7467                    self
7468                        .java_package
7469                        .get_or_insert_with(::buffa::alloc::string::String::new),
7470                    buf,
7471                )?;
7472            }
7473            8u32 => {
7474                ::buffa::encoding::check_wire_type(
7475                    tag,
7476                    ::buffa::encoding::WireType::LengthDelimited,
7477                )?;
7478                ::buffa::types::merge_string(
7479                    self
7480                        .java_outer_classname
7481                        .get_or_insert_with(::buffa::alloc::string::String::new),
7482                    buf,
7483                )?;
7484            }
7485            9u32 => {
7486                ::buffa::encoding::check_wire_type(
7487                    tag,
7488                    ::buffa::encoding::WireType::Varint,
7489                )?;
7490                let __raw = ::buffa::types::decode_int32(buf)?;
7491                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
7492                    __raw,
7493                ) {
7494                    self.optimize_for = ::core::option::Option::Some(__v);
7495                } else {
7496                    self.__buffa_unknown_fields
7497                        .push(::buffa::UnknownField {
7498                            number: 9u32,
7499                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
7500                        });
7501                }
7502            }
7503            10u32 => {
7504                ::buffa::encoding::check_wire_type(
7505                    tag,
7506                    ::buffa::encoding::WireType::Varint,
7507                )?;
7508                self.java_multiple_files = ::core::option::Option::Some(
7509                    ::buffa::types::decode_bool(buf)?,
7510                );
7511            }
7512            11u32 => {
7513                ::buffa::encoding::check_wire_type(
7514                    tag,
7515                    ::buffa::encoding::WireType::LengthDelimited,
7516                )?;
7517                ::buffa::types::merge_string(
7518                    self
7519                        .go_package
7520                        .get_or_insert_with(::buffa::alloc::string::String::new),
7521                    buf,
7522                )?;
7523            }
7524            16u32 => {
7525                ::buffa::encoding::check_wire_type(
7526                    tag,
7527                    ::buffa::encoding::WireType::Varint,
7528                )?;
7529                self.cc_generic_services = ::core::option::Option::Some(
7530                    ::buffa::types::decode_bool(buf)?,
7531                );
7532            }
7533            17u32 => {
7534                ::buffa::encoding::check_wire_type(
7535                    tag,
7536                    ::buffa::encoding::WireType::Varint,
7537                )?;
7538                self.java_generic_services = ::core::option::Option::Some(
7539                    ::buffa::types::decode_bool(buf)?,
7540                );
7541            }
7542            18u32 => {
7543                ::buffa::encoding::check_wire_type(
7544                    tag,
7545                    ::buffa::encoding::WireType::Varint,
7546                )?;
7547                self.py_generic_services = ::core::option::Option::Some(
7548                    ::buffa::types::decode_bool(buf)?,
7549                );
7550            }
7551            20u32 => {
7552                ::buffa::encoding::check_wire_type(
7553                    tag,
7554                    ::buffa::encoding::WireType::Varint,
7555                )?;
7556                self.java_generate_equals_and_hash = ::core::option::Option::Some(
7557                    ::buffa::types::decode_bool(buf)?,
7558                );
7559            }
7560            23u32 => {
7561                ::buffa::encoding::check_wire_type(
7562                    tag,
7563                    ::buffa::encoding::WireType::Varint,
7564                )?;
7565                self.deprecated = ::core::option::Option::Some(
7566                    ::buffa::types::decode_bool(buf)?,
7567                );
7568            }
7569            27u32 => {
7570                ::buffa::encoding::check_wire_type(
7571                    tag,
7572                    ::buffa::encoding::WireType::Varint,
7573                )?;
7574                self.java_string_check_utf8 = ::core::option::Option::Some(
7575                    ::buffa::types::decode_bool(buf)?,
7576                );
7577            }
7578            31u32 => {
7579                ::buffa::encoding::check_wire_type(
7580                    tag,
7581                    ::buffa::encoding::WireType::Varint,
7582                )?;
7583                self.cc_enable_arenas = ::core::option::Option::Some(
7584                    ::buffa::types::decode_bool(buf)?,
7585                );
7586            }
7587            36u32 => {
7588                ::buffa::encoding::check_wire_type(
7589                    tag,
7590                    ::buffa::encoding::WireType::LengthDelimited,
7591                )?;
7592                ::buffa::types::merge_string(
7593                    self
7594                        .objc_class_prefix
7595                        .get_or_insert_with(::buffa::alloc::string::String::new),
7596                    buf,
7597                )?;
7598            }
7599            37u32 => {
7600                ::buffa::encoding::check_wire_type(
7601                    tag,
7602                    ::buffa::encoding::WireType::LengthDelimited,
7603                )?;
7604                ::buffa::types::merge_string(
7605                    self
7606                        .csharp_namespace
7607                        .get_or_insert_with(::buffa::alloc::string::String::new),
7608                    buf,
7609                )?;
7610            }
7611            39u32 => {
7612                ::buffa::encoding::check_wire_type(
7613                    tag,
7614                    ::buffa::encoding::WireType::LengthDelimited,
7615                )?;
7616                ::buffa::types::merge_string(
7617                    self
7618                        .swift_prefix
7619                        .get_or_insert_with(::buffa::alloc::string::String::new),
7620                    buf,
7621                )?;
7622            }
7623            40u32 => {
7624                ::buffa::encoding::check_wire_type(
7625                    tag,
7626                    ::buffa::encoding::WireType::LengthDelimited,
7627                )?;
7628                ::buffa::types::merge_string(
7629                    self
7630                        .php_class_prefix
7631                        .get_or_insert_with(::buffa::alloc::string::String::new),
7632                    buf,
7633                )?;
7634            }
7635            41u32 => {
7636                ::buffa::encoding::check_wire_type(
7637                    tag,
7638                    ::buffa::encoding::WireType::LengthDelimited,
7639                )?;
7640                ::buffa::types::merge_string(
7641                    self
7642                        .php_namespace
7643                        .get_or_insert_with(::buffa::alloc::string::String::new),
7644                    buf,
7645                )?;
7646            }
7647            44u32 => {
7648                ::buffa::encoding::check_wire_type(
7649                    tag,
7650                    ::buffa::encoding::WireType::LengthDelimited,
7651                )?;
7652                ::buffa::types::merge_string(
7653                    self
7654                        .php_metadata_namespace
7655                        .get_or_insert_with(::buffa::alloc::string::String::new),
7656                    buf,
7657                )?;
7658            }
7659            45u32 => {
7660                ::buffa::encoding::check_wire_type(
7661                    tag,
7662                    ::buffa::encoding::WireType::LengthDelimited,
7663                )?;
7664                ::buffa::types::merge_string(
7665                    self
7666                        .ruby_package
7667                        .get_or_insert_with(::buffa::alloc::string::String::new),
7668                    buf,
7669                )?;
7670            }
7671            50u32 => {
7672                ::buffa::encoding::check_wire_type(
7673                    tag,
7674                    ::buffa::encoding::WireType::LengthDelimited,
7675                )?;
7676                ::buffa::Message::merge_length_delimited(
7677                    self.features.get_or_insert_default(),
7678                    buf,
7679                    ctx,
7680                )?;
7681            }
7682            999u32 => {
7683                ::buffa::encoding::check_wire_type(
7684                    tag,
7685                    ::buffa::encoding::WireType::LengthDelimited,
7686                )?;
7687                let mut elem = ::core::default::Default::default();
7688                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
7689                self.uninterpreted_option.push(elem);
7690            }
7691            _ => {
7692                self.__buffa_unknown_fields
7693                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
7694            }
7695        }
7696        ::core::result::Result::Ok(())
7697    }
7698    fn clear(&mut self) {
7699        self.java_package = ::core::option::Option::None;
7700        self.java_outer_classname = ::core::option::Option::None;
7701        self.optimize_for = ::core::option::Option::None;
7702        self.java_multiple_files = ::core::option::Option::None;
7703        self.go_package = ::core::option::Option::None;
7704        self.cc_generic_services = ::core::option::Option::None;
7705        self.java_generic_services = ::core::option::Option::None;
7706        self.py_generic_services = ::core::option::Option::None;
7707        self.java_generate_equals_and_hash = ::core::option::Option::None;
7708        self.deprecated = ::core::option::Option::None;
7709        self.java_string_check_utf8 = ::core::option::Option::None;
7710        self.cc_enable_arenas = ::core::option::Option::None;
7711        self.objc_class_prefix = ::core::option::Option::None;
7712        self.csharp_namespace = ::core::option::Option::None;
7713        self.swift_prefix = ::core::option::Option::None;
7714        self.php_class_prefix = ::core::option::Option::None;
7715        self.php_namespace = ::core::option::Option::None;
7716        self.php_metadata_namespace = ::core::option::Option::None;
7717        self.ruby_package = ::core::option::Option::None;
7718        self.features = ::buffa::MessageField::none();
7719        self.uninterpreted_option.clear();
7720        self.__buffa_unknown_fields.clear();
7721    }
7722}
7723impl ::buffa::ExtensionSet for FileOptions {
7724    const PROTO_FQN: &'static str = "google.protobuf.FileOptions";
7725    fn unknown_fields(&self) -> &::buffa::UnknownFields {
7726        &self.__buffa_unknown_fields
7727    }
7728    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7729        &mut self.__buffa_unknown_fields
7730    }
7731}
7732#[cfg(feature = "text")]
7733impl ::buffa::text::TextFormat for FileOptions {
7734    fn encode_text(
7735        &self,
7736        enc: &mut ::buffa::text::TextEncoder<'_>,
7737    ) -> ::core::fmt::Result {
7738        #[allow(unused_imports)]
7739        use ::buffa::Enumeration as _;
7740        if let ::core::option::Option::Some(ref __v) = self.java_package {
7741            enc.write_field_name("java_package")?;
7742            enc.write_string(__v)?;
7743        }
7744        if let ::core::option::Option::Some(ref __v) = self.java_outer_classname {
7745            enc.write_field_name("java_outer_classname")?;
7746            enc.write_string(__v)?;
7747        }
7748        if let ::core::option::Option::Some(ref __v) = self.java_multiple_files {
7749            enc.write_field_name("java_multiple_files")?;
7750            enc.write_bool(*__v)?;
7751        }
7752        if let ::core::option::Option::Some(ref __v) = self.java_generate_equals_and_hash
7753        {
7754            enc.write_field_name("java_generate_equals_and_hash")?;
7755            enc.write_bool(*__v)?;
7756        }
7757        if let ::core::option::Option::Some(ref __v) = self.java_string_check_utf8 {
7758            enc.write_field_name("java_string_check_utf8")?;
7759            enc.write_bool(*__v)?;
7760        }
7761        if let ::core::option::Option::Some(ref __v) = self.optimize_for {
7762            enc.write_field_name("optimize_for")?;
7763            enc.write_enum_name(__v.proto_name())?;
7764        }
7765        if let ::core::option::Option::Some(ref __v) = self.go_package {
7766            enc.write_field_name("go_package")?;
7767            enc.write_string(__v)?;
7768        }
7769        if let ::core::option::Option::Some(ref __v) = self.cc_generic_services {
7770            enc.write_field_name("cc_generic_services")?;
7771            enc.write_bool(*__v)?;
7772        }
7773        if let ::core::option::Option::Some(ref __v) = self.java_generic_services {
7774            enc.write_field_name("java_generic_services")?;
7775            enc.write_bool(*__v)?;
7776        }
7777        if let ::core::option::Option::Some(ref __v) = self.py_generic_services {
7778            enc.write_field_name("py_generic_services")?;
7779            enc.write_bool(*__v)?;
7780        }
7781        if let ::core::option::Option::Some(ref __v) = self.deprecated {
7782            enc.write_field_name("deprecated")?;
7783            enc.write_bool(*__v)?;
7784        }
7785        if let ::core::option::Option::Some(ref __v) = self.cc_enable_arenas {
7786            enc.write_field_name("cc_enable_arenas")?;
7787            enc.write_bool(*__v)?;
7788        }
7789        if let ::core::option::Option::Some(ref __v) = self.objc_class_prefix {
7790            enc.write_field_name("objc_class_prefix")?;
7791            enc.write_string(__v)?;
7792        }
7793        if let ::core::option::Option::Some(ref __v) = self.csharp_namespace {
7794            enc.write_field_name("csharp_namespace")?;
7795            enc.write_string(__v)?;
7796        }
7797        if let ::core::option::Option::Some(ref __v) = self.swift_prefix {
7798            enc.write_field_name("swift_prefix")?;
7799            enc.write_string(__v)?;
7800        }
7801        if let ::core::option::Option::Some(ref __v) = self.php_class_prefix {
7802            enc.write_field_name("php_class_prefix")?;
7803            enc.write_string(__v)?;
7804        }
7805        if let ::core::option::Option::Some(ref __v) = self.php_namespace {
7806            enc.write_field_name("php_namespace")?;
7807            enc.write_string(__v)?;
7808        }
7809        if let ::core::option::Option::Some(ref __v) = self.php_metadata_namespace {
7810            enc.write_field_name("php_metadata_namespace")?;
7811            enc.write_string(__v)?;
7812        }
7813        if let ::core::option::Option::Some(ref __v) = self.ruby_package {
7814            enc.write_field_name("ruby_package")?;
7815            enc.write_string(__v)?;
7816        }
7817        if self.features.is_set() {
7818            enc.write_field_name("features")?;
7819            enc.write_message(&*self.features)?;
7820        }
7821        for __v in &self.uninterpreted_option {
7822            enc.write_field_name("uninterpreted_option")?;
7823            enc.write_message(__v)?;
7824        }
7825        enc.write_extension_fields(
7826            "google.protobuf.FileOptions",
7827            &self.__buffa_unknown_fields,
7828        )?;
7829        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
7830        ::core::result::Result::Ok(())
7831    }
7832    fn merge_text(
7833        &mut self,
7834        dec: &mut ::buffa::text::TextDecoder<'_>,
7835    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
7836        #[allow(unused_imports)]
7837        use ::buffa::Enumeration as _;
7838        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
7839            match __name {
7840                "java_package" => {
7841                    self.java_package = ::core::option::Option::Some(
7842                        dec.read_string()?.into_owned(),
7843                    );
7844                }
7845                "java_outer_classname" => {
7846                    self.java_outer_classname = ::core::option::Option::Some(
7847                        dec.read_string()?.into_owned(),
7848                    );
7849                }
7850                "java_multiple_files" => {
7851                    self.java_multiple_files = ::core::option::Option::Some(
7852                        dec.read_bool()?,
7853                    );
7854                }
7855                "java_generate_equals_and_hash" => {
7856                    self.java_generate_equals_and_hash = ::core::option::Option::Some(
7857                        dec.read_bool()?,
7858                    );
7859                }
7860                "java_string_check_utf8" => {
7861                    self.java_string_check_utf8 = ::core::option::Option::Some(
7862                        dec.read_bool()?,
7863                    );
7864                }
7865                "optimize_for" => {
7866                    self.optimize_for = ::core::option::Option::Some(
7867                        dec.read_closed_enum_by_name::<file_options::OptimizeMode>()?,
7868                    );
7869                }
7870                "go_package" => {
7871                    self.go_package = ::core::option::Option::Some(
7872                        dec.read_string()?.into_owned(),
7873                    );
7874                }
7875                "cc_generic_services" => {
7876                    self.cc_generic_services = ::core::option::Option::Some(
7877                        dec.read_bool()?,
7878                    );
7879                }
7880                "java_generic_services" => {
7881                    self.java_generic_services = ::core::option::Option::Some(
7882                        dec.read_bool()?,
7883                    );
7884                }
7885                "py_generic_services" => {
7886                    self.py_generic_services = ::core::option::Option::Some(
7887                        dec.read_bool()?,
7888                    );
7889                }
7890                "deprecated" => {
7891                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
7892                }
7893                "cc_enable_arenas" => {
7894                    self.cc_enable_arenas = ::core::option::Option::Some(
7895                        dec.read_bool()?,
7896                    );
7897                }
7898                "objc_class_prefix" => {
7899                    self.objc_class_prefix = ::core::option::Option::Some(
7900                        dec.read_string()?.into_owned(),
7901                    );
7902                }
7903                "csharp_namespace" => {
7904                    self.csharp_namespace = ::core::option::Option::Some(
7905                        dec.read_string()?.into_owned(),
7906                    );
7907                }
7908                "swift_prefix" => {
7909                    self.swift_prefix = ::core::option::Option::Some(
7910                        dec.read_string()?.into_owned(),
7911                    );
7912                }
7913                "php_class_prefix" => {
7914                    self.php_class_prefix = ::core::option::Option::Some(
7915                        dec.read_string()?.into_owned(),
7916                    );
7917                }
7918                "php_namespace" => {
7919                    self.php_namespace = ::core::option::Option::Some(
7920                        dec.read_string()?.into_owned(),
7921                    );
7922                }
7923                "php_metadata_namespace" => {
7924                    self.php_metadata_namespace = ::core::option::Option::Some(
7925                        dec.read_string()?.into_owned(),
7926                    );
7927                }
7928                "ruby_package" => {
7929                    self.ruby_package = ::core::option::Option::Some(
7930                        dec.read_string()?.into_owned(),
7931                    );
7932                }
7933                "features" => dec.merge_message(self.features.get_or_insert_default())?,
7934                "uninterpreted_option" => {
7935                    dec.read_repeated_into(
7936                        &mut self.uninterpreted_option,
7937                        |__d| {
7938                            let mut __m = ::core::default::Default::default();
7939                            __d.merge_message(&mut __m)?;
7940                            ::core::result::Result::Ok(__m)
7941                        },
7942                    )?
7943                }
7944                __name if __name.starts_with('[') => {
7945                    for __r in dec.read_extension(__name, "google.protobuf.FileOptions")?
7946                    {
7947                        self.__buffa_unknown_fields.push(__r);
7948                    }
7949                }
7950                _ => dec.skip_value()?,
7951            }
7952        }
7953        ::core::result::Result::Ok(())
7954    }
7955}
7956#[cfg(feature = "json")]
7957impl<'de> serde::Deserialize<'de> for FileOptions {
7958    fn deserialize<D: serde::Deserializer<'de>>(
7959        d: D,
7960    ) -> ::core::result::Result<Self, D::Error> {
7961        struct _V;
7962        impl<'de> serde::de::Visitor<'de> for _V {
7963            type Value = FileOptions;
7964            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7965                f.write_str("struct FileOptions")
7966            }
7967            #[allow(clippy::field_reassign_with_default)]
7968            fn visit_map<A: serde::de::MapAccess<'de>>(
7969                self,
7970                mut map: A,
7971            ) -> ::core::result::Result<FileOptions, A::Error> {
7972                let mut __f_java_package: ::core::option::Option<
7973                    ::core::option::Option<::buffa::alloc::string::String>,
7974                > = None;
7975                let mut __f_java_outer_classname: ::core::option::Option<
7976                    ::core::option::Option<::buffa::alloc::string::String>,
7977                > = None;
7978                let mut __f_java_multiple_files: ::core::option::Option<
7979                    ::core::option::Option<bool>,
7980                > = None;
7981                let mut __f_java_generate_equals_and_hash: ::core::option::Option<
7982                    ::core::option::Option<bool>,
7983                > = None;
7984                let mut __f_java_string_check_utf8: ::core::option::Option<
7985                    ::core::option::Option<bool>,
7986                > = None;
7987                let mut __f_optimize_for: ::core::option::Option<
7988                    ::core::option::Option<file_options::OptimizeMode>,
7989                > = None;
7990                let mut __f_go_package: ::core::option::Option<
7991                    ::core::option::Option<::buffa::alloc::string::String>,
7992                > = None;
7993                let mut __f_cc_generic_services: ::core::option::Option<
7994                    ::core::option::Option<bool>,
7995                > = None;
7996                let mut __f_java_generic_services: ::core::option::Option<
7997                    ::core::option::Option<bool>,
7998                > = None;
7999                let mut __f_py_generic_services: ::core::option::Option<
8000                    ::core::option::Option<bool>,
8001                > = None;
8002                let mut __f_deprecated: ::core::option::Option<
8003                    ::core::option::Option<bool>,
8004                > = None;
8005                let mut __f_cc_enable_arenas: ::core::option::Option<
8006                    ::core::option::Option<bool>,
8007                > = None;
8008                let mut __f_objc_class_prefix: ::core::option::Option<
8009                    ::core::option::Option<::buffa::alloc::string::String>,
8010                > = None;
8011                let mut __f_csharp_namespace: ::core::option::Option<
8012                    ::core::option::Option<::buffa::alloc::string::String>,
8013                > = None;
8014                let mut __f_swift_prefix: ::core::option::Option<
8015                    ::core::option::Option<::buffa::alloc::string::String>,
8016                > = None;
8017                let mut __f_php_class_prefix: ::core::option::Option<
8018                    ::core::option::Option<::buffa::alloc::string::String>,
8019                > = None;
8020                let mut __f_php_namespace: ::core::option::Option<
8021                    ::core::option::Option<::buffa::alloc::string::String>,
8022                > = None;
8023                let mut __f_php_metadata_namespace: ::core::option::Option<
8024                    ::core::option::Option<::buffa::alloc::string::String>,
8025                > = None;
8026                let mut __f_ruby_package: ::core::option::Option<
8027                    ::core::option::Option<::buffa::alloc::string::String>,
8028                > = None;
8029                let mut __f_features: ::core::option::Option<
8030                    ::buffa::MessageField<FeatureSet>,
8031                > = None;
8032                let mut __f_uninterpreted_option: ::core::option::Option<
8033                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
8034                > = None;
8035                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
8036                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
8037                    match key.as_str() {
8038                        "javaPackage" | "java_package" => {
8039                            __f_java_package = Some(
8040                                map
8041                                    .next_value::<
8042                                        ::core::option::Option<::buffa::alloc::string::String>,
8043                                    >()?,
8044                            );
8045                        }
8046                        "javaOuterClassname" | "java_outer_classname" => {
8047                            __f_java_outer_classname = Some(
8048                                map
8049                                    .next_value::<
8050                                        ::core::option::Option<::buffa::alloc::string::String>,
8051                                    >()?,
8052                            );
8053                        }
8054                        "javaMultipleFiles" | "java_multiple_files" => {
8055                            __f_java_multiple_files = Some(
8056                                map.next_value::<::core::option::Option<bool>>()?,
8057                            );
8058                        }
8059                        "javaGenerateEqualsAndHash"
8060                        | "java_generate_equals_and_hash" => {
8061                            __f_java_generate_equals_and_hash = Some(
8062                                map.next_value::<::core::option::Option<bool>>()?,
8063                            );
8064                        }
8065                        "javaStringCheckUtf8" | "java_string_check_utf8" => {
8066                            __f_java_string_check_utf8 = Some(
8067                                map.next_value::<::core::option::Option<bool>>()?,
8068                            );
8069                        }
8070                        "optimizeFor" | "optimize_for" => {
8071                            __f_optimize_for = Some({
8072                                struct _S;
8073                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8074                                    type Value = ::core::option::Option<
8075                                        file_options::OptimizeMode,
8076                                    >;
8077                                    fn deserialize<D: serde::Deserializer<'de>>(
8078                                        self,
8079                                        d: D,
8080                                    ) -> ::core::result::Result<
8081                                        ::core::option::Option<file_options::OptimizeMode>,
8082                                        D::Error,
8083                                    > {
8084                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
8085                                    }
8086                                }
8087                                map.next_value_seed(_S)?
8088                            });
8089                        }
8090                        "goPackage" | "go_package" => {
8091                            __f_go_package = Some(
8092                                map
8093                                    .next_value::<
8094                                        ::core::option::Option<::buffa::alloc::string::String>,
8095                                    >()?,
8096                            );
8097                        }
8098                        "ccGenericServices" | "cc_generic_services" => {
8099                            __f_cc_generic_services = Some(
8100                                map.next_value::<::core::option::Option<bool>>()?,
8101                            );
8102                        }
8103                        "javaGenericServices" | "java_generic_services" => {
8104                            __f_java_generic_services = Some(
8105                                map.next_value::<::core::option::Option<bool>>()?,
8106                            );
8107                        }
8108                        "pyGenericServices" | "py_generic_services" => {
8109                            __f_py_generic_services = Some(
8110                                map.next_value::<::core::option::Option<bool>>()?,
8111                            );
8112                        }
8113                        "deprecated" => {
8114                            __f_deprecated = Some(
8115                                map.next_value::<::core::option::Option<bool>>()?,
8116                            );
8117                        }
8118                        "ccEnableArenas" | "cc_enable_arenas" => {
8119                            __f_cc_enable_arenas = Some(
8120                                map.next_value::<::core::option::Option<bool>>()?,
8121                            );
8122                        }
8123                        "objcClassPrefix" | "objc_class_prefix" => {
8124                            __f_objc_class_prefix = Some(
8125                                map
8126                                    .next_value::<
8127                                        ::core::option::Option<::buffa::alloc::string::String>,
8128                                    >()?,
8129                            );
8130                        }
8131                        "csharpNamespace" | "csharp_namespace" => {
8132                            __f_csharp_namespace = Some(
8133                                map
8134                                    .next_value::<
8135                                        ::core::option::Option<::buffa::alloc::string::String>,
8136                                    >()?,
8137                            );
8138                        }
8139                        "swiftPrefix" | "swift_prefix" => {
8140                            __f_swift_prefix = Some(
8141                                map
8142                                    .next_value::<
8143                                        ::core::option::Option<::buffa::alloc::string::String>,
8144                                    >()?,
8145                            );
8146                        }
8147                        "phpClassPrefix" | "php_class_prefix" => {
8148                            __f_php_class_prefix = Some(
8149                                map
8150                                    .next_value::<
8151                                        ::core::option::Option<::buffa::alloc::string::String>,
8152                                    >()?,
8153                            );
8154                        }
8155                        "phpNamespace" | "php_namespace" => {
8156                            __f_php_namespace = Some(
8157                                map
8158                                    .next_value::<
8159                                        ::core::option::Option<::buffa::alloc::string::String>,
8160                                    >()?,
8161                            );
8162                        }
8163                        "phpMetadataNamespace" | "php_metadata_namespace" => {
8164                            __f_php_metadata_namespace = Some(
8165                                map
8166                                    .next_value::<
8167                                        ::core::option::Option<::buffa::alloc::string::String>,
8168                                    >()?,
8169                            );
8170                        }
8171                        "rubyPackage" | "ruby_package" => {
8172                            __f_ruby_package = Some(
8173                                map
8174                                    .next_value::<
8175                                        ::core::option::Option<::buffa::alloc::string::String>,
8176                                    >()?,
8177                            );
8178                        }
8179                        "features" => {
8180                            __f_features = Some(
8181                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
8182                            );
8183                        }
8184                        "uninterpretedOption" | "uninterpreted_option" => {
8185                            __f_uninterpreted_option = Some({
8186                                struct _S;
8187                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8188                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
8189                                    fn deserialize<D: serde::Deserializer<'de>>(
8190                                        self,
8191                                        d: D,
8192                                    ) -> ::core::result::Result<
8193                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
8194                                        D::Error,
8195                                    > {
8196                                        ::buffa::json_helpers::null_as_default(d)
8197                                    }
8198                                }
8199                                map.next_value_seed(_S)?
8200                            });
8201                        }
8202                        __k if __k.starts_with('[') => {
8203                            let __v: ::buffa::serde_json::Value = map.next_value()?;
8204                            match ::buffa::extension_registry::deserialize_extension_key(
8205                                "google.protobuf.FileOptions",
8206                                __k,
8207                                __v,
8208                            ) {
8209                                ::core::option::Option::Some(
8210                                    ::core::result::Result::Ok(__recs),
8211                                ) => {
8212                                    for __rec in __recs {
8213                                        __ext_records.push(__rec);
8214                                    }
8215                                }
8216                                ::core::option::Option::Some(
8217                                    ::core::result::Result::Err(__e),
8218                                ) => {
8219                                    return ::core::result::Result::Err(
8220                                        <A::Error as ::serde::de::Error>::custom(__e),
8221                                    );
8222                                }
8223                                ::core::option::Option::None => {}
8224                            }
8225                        }
8226                        _ => {
8227                            map.next_value::<serde::de::IgnoredAny>()?;
8228                        }
8229                    }
8230                }
8231                let mut __r = <FileOptions as ::core::default::Default>::default();
8232                if let ::core::option::Option::Some(v) = __f_java_package {
8233                    __r.java_package = v;
8234                }
8235                if let ::core::option::Option::Some(v) = __f_java_outer_classname {
8236                    __r.java_outer_classname = v;
8237                }
8238                if let ::core::option::Option::Some(v) = __f_java_multiple_files {
8239                    __r.java_multiple_files = v;
8240                }
8241                if let ::core::option::Option::Some(v) = __f_java_generate_equals_and_hash {
8242                    __r.java_generate_equals_and_hash = v;
8243                }
8244                if let ::core::option::Option::Some(v) = __f_java_string_check_utf8 {
8245                    __r.java_string_check_utf8 = v;
8246                }
8247                if let ::core::option::Option::Some(v) = __f_optimize_for {
8248                    __r.optimize_for = v;
8249                }
8250                if let ::core::option::Option::Some(v) = __f_go_package {
8251                    __r.go_package = v;
8252                }
8253                if let ::core::option::Option::Some(v) = __f_cc_generic_services {
8254                    __r.cc_generic_services = v;
8255                }
8256                if let ::core::option::Option::Some(v) = __f_java_generic_services {
8257                    __r.java_generic_services = v;
8258                }
8259                if let ::core::option::Option::Some(v) = __f_py_generic_services {
8260                    __r.py_generic_services = v;
8261                }
8262                if let ::core::option::Option::Some(v) = __f_deprecated {
8263                    __r.deprecated = v;
8264                }
8265                if let ::core::option::Option::Some(v) = __f_cc_enable_arenas {
8266                    __r.cc_enable_arenas = v;
8267                }
8268                if let ::core::option::Option::Some(v) = __f_objc_class_prefix {
8269                    __r.objc_class_prefix = v;
8270                }
8271                if let ::core::option::Option::Some(v) = __f_csharp_namespace {
8272                    __r.csharp_namespace = v;
8273                }
8274                if let ::core::option::Option::Some(v) = __f_swift_prefix {
8275                    __r.swift_prefix = v;
8276                }
8277                if let ::core::option::Option::Some(v) = __f_php_class_prefix {
8278                    __r.php_class_prefix = v;
8279                }
8280                if let ::core::option::Option::Some(v) = __f_php_namespace {
8281                    __r.php_namespace = v;
8282                }
8283                if let ::core::option::Option::Some(v) = __f_php_metadata_namespace {
8284                    __r.php_metadata_namespace = v;
8285                }
8286                if let ::core::option::Option::Some(v) = __f_ruby_package {
8287                    __r.ruby_package = v;
8288                }
8289                if let ::core::option::Option::Some(v) = __f_features {
8290                    __r.features = v;
8291                }
8292                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
8293                    __r.uninterpreted_option = v;
8294                }
8295                for __rec in __ext_records {
8296                    __r.__buffa_unknown_fields.push(__rec);
8297                }
8298                Ok(__r)
8299            }
8300        }
8301        d.deserialize_map(_V)
8302    }
8303}
8304#[cfg(feature = "json")]
8305impl ::buffa::json_helpers::ProtoElemJson for FileOptions {
8306    fn serialize_proto_json<S: ::serde::Serializer>(
8307        v: &Self,
8308        s: S,
8309    ) -> ::core::result::Result<S::Ok, S::Error> {
8310        ::serde::Serialize::serialize(v, s)
8311    }
8312    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8313        d: D,
8314    ) -> ::core::result::Result<Self, D::Error> {
8315        <Self as ::serde::Deserialize>::deserialize(d)
8316    }
8317}
8318#[doc(hidden)]
8319#[derive(Clone, Debug, Default, PartialEq)]
8320#[repr(transparent)]
8321#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8322pub struct __FileOptionsExtJson(pub ::buffa::UnknownFields);
8323impl ::core::ops::Deref for __FileOptionsExtJson {
8324    type Target = ::buffa::UnknownFields;
8325    fn deref(&self) -> &::buffa::UnknownFields {
8326        &self.0
8327    }
8328}
8329impl ::core::ops::DerefMut for __FileOptionsExtJson {
8330    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
8331        &mut self.0
8332    }
8333}
8334impl ::core::convert::From<::buffa::UnknownFields> for __FileOptionsExtJson {
8335    fn from(u: ::buffa::UnknownFields) -> Self {
8336        Self(u)
8337    }
8338}
8339#[cfg(feature = "json")]
8340impl ::serde::Serialize for __FileOptionsExtJson {
8341    fn serialize<S: ::serde::Serializer>(
8342        &self,
8343        s: S,
8344    ) -> ::core::result::Result<S::Ok, S::Error> {
8345        ::buffa::extension_registry::serialize_extensions(
8346            "google.protobuf.FileOptions",
8347            &self.0,
8348            s,
8349        )
8350    }
8351}
8352#[cfg(feature = "json")]
8353impl<'de> ::serde::Deserialize<'de> for __FileOptionsExtJson {
8354    fn deserialize<D: ::serde::Deserializer<'de>>(
8355        d: D,
8356    ) -> ::core::result::Result<Self, D::Error> {
8357        ::buffa::extension_registry::deserialize_extensions(
8358                "google.protobuf.FileOptions",
8359                d,
8360            )
8361            .map(Self)
8362    }
8363}
8364#[cfg(feature = "json")]
8365#[doc(hidden)]
8366pub const __FILE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8367    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8368    to_json: ::buffa::type_registry::any_to_json::<FileOptions>,
8369    from_json: ::buffa::type_registry::any_from_json::<FileOptions>,
8370    is_wkt: false,
8371};
8372#[cfg(feature = "text")]
8373#[doc(hidden)]
8374pub const __FILE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
8375    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8376    text_encode: ::buffa::type_registry::any_encode_text::<FileOptions>,
8377    text_merge: ::buffa::type_registry::any_merge_text::<FileOptions>,
8378};
8379pub mod file_options {
8380    #[allow(unused_imports)]
8381    use super::*;
8382    /// Generated classes can be optimized for speed or code size.
8383    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
8384    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8385    #[repr(i32)]
8386    pub enum OptimizeMode {
8387        /// Generate complete code for parsing, serialization,
8388        SPEED = 1i32,
8389        /// etc.
8390        ///
8391        /// Use ReflectionOps to implement these methods.
8392        CODE_SIZE = 2i32,
8393        /// Generate code using MessageLite and the lite runtime.
8394        LITE_RUNTIME = 3i32,
8395    }
8396    impl OptimizeMode {
8397        ///Idiomatic alias for [`Self::SPEED`]; `Debug` prints the variant name.
8398        #[allow(non_upper_case_globals)]
8399        pub const Speed: Self = Self::SPEED;
8400        ///Idiomatic alias for [`Self::CODE_SIZE`]; `Debug` prints the variant name.
8401        #[allow(non_upper_case_globals)]
8402        pub const CodeSize: Self = Self::CODE_SIZE;
8403        ///Idiomatic alias for [`Self::LITE_RUNTIME`]; `Debug` prints the variant name.
8404        #[allow(non_upper_case_globals)]
8405        pub const LiteRuntime: Self = Self::LITE_RUNTIME;
8406    }
8407    impl ::core::default::Default for OptimizeMode {
8408        fn default() -> Self {
8409            Self::SPEED
8410        }
8411    }
8412    #[cfg(feature = "json")]
8413    const _: () = {
8414        impl ::serde::Serialize for OptimizeMode {
8415            fn serialize<S: ::serde::Serializer>(
8416                &self,
8417                s: S,
8418            ) -> ::core::result::Result<S::Ok, S::Error> {
8419                s.serialize_str(::buffa::Enumeration::proto_name(self))
8420            }
8421        }
8422        impl<'de> ::serde::Deserialize<'de> for OptimizeMode {
8423            fn deserialize<D: ::serde::Deserializer<'de>>(
8424                d: D,
8425            ) -> ::core::result::Result<Self, D::Error> {
8426                struct _V;
8427                impl ::serde::de::Visitor<'_> for _V {
8428                    type Value = OptimizeMode;
8429                    fn expecting(
8430                        &self,
8431                        f: &mut ::core::fmt::Formatter<'_>,
8432                    ) -> ::core::fmt::Result {
8433                        f.write_str(
8434                            concat!(
8435                                "a string, integer, or null for ", stringify!(OptimizeMode)
8436                            ),
8437                        )
8438                    }
8439                    fn visit_str<E: ::serde::de::Error>(
8440                        self,
8441                        v: &str,
8442                    ) -> ::core::result::Result<OptimizeMode, E> {
8443                        <OptimizeMode as ::buffa::Enumeration>::from_proto_name(v)
8444                            .ok_or_else(|| {
8445                                ::serde::de::Error::unknown_variant(v, &[])
8446                            })
8447                    }
8448                    fn visit_i64<E: ::serde::de::Error>(
8449                        self,
8450                        v: i64,
8451                    ) -> ::core::result::Result<OptimizeMode, E> {
8452                        let v32 = i32::try_from(v)
8453                            .map_err(|_| {
8454                                ::serde::de::Error::custom(
8455                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8456                                )
8457                            })?;
8458                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8459                            .ok_or_else(|| {
8460                                ::serde::de::Error::custom(
8461                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8462                                )
8463                            })
8464                    }
8465                    fn visit_u64<E: ::serde::de::Error>(
8466                        self,
8467                        v: u64,
8468                    ) -> ::core::result::Result<OptimizeMode, E> {
8469                        let v32 = i32::try_from(v)
8470                            .map_err(|_| {
8471                                ::serde::de::Error::custom(
8472                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8473                                )
8474                            })?;
8475                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8476                            .ok_or_else(|| {
8477                                ::serde::de::Error::custom(
8478                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8479                                )
8480                            })
8481                    }
8482                    fn visit_unit<E: ::serde::de::Error>(
8483                        self,
8484                    ) -> ::core::result::Result<OptimizeMode, E> {
8485                        ::core::result::Result::Ok(::core::default::Default::default())
8486                    }
8487                }
8488                d.deserialize_any(_V)
8489            }
8490        }
8491        impl ::buffa::json_helpers::ProtoElemJson for OptimizeMode {
8492            fn serialize_proto_json<S: ::serde::Serializer>(
8493                v: &Self,
8494                s: S,
8495            ) -> ::core::result::Result<S::Ok, S::Error> {
8496                ::serde::Serialize::serialize(v, s)
8497            }
8498            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8499                d: D,
8500            ) -> ::core::result::Result<Self, D::Error> {
8501                <Self as ::serde::Deserialize>::deserialize(d)
8502            }
8503        }
8504    };
8505    impl ::buffa::Enumeration for OptimizeMode {
8506        fn from_i32(value: i32) -> ::core::option::Option<Self> {
8507            match value {
8508                1i32 => ::core::option::Option::Some(Self::SPEED),
8509                2i32 => ::core::option::Option::Some(Self::CODE_SIZE),
8510                3i32 => ::core::option::Option::Some(Self::LITE_RUNTIME),
8511                _ => ::core::option::Option::None,
8512            }
8513        }
8514        fn to_i32(&self) -> i32 {
8515            *self as i32
8516        }
8517        fn proto_name(&self) -> &'static str {
8518            match self {
8519                Self::SPEED => "SPEED",
8520                Self::CODE_SIZE => "CODE_SIZE",
8521                Self::LITE_RUNTIME => "LITE_RUNTIME",
8522            }
8523        }
8524        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
8525            match name {
8526                "SPEED" => ::core::option::Option::Some(Self::SPEED),
8527                "CODE_SIZE" => ::core::option::Option::Some(Self::CODE_SIZE),
8528                "LITE_RUNTIME" => ::core::option::Option::Some(Self::LITE_RUNTIME),
8529                _ => ::core::option::Option::None,
8530            }
8531        }
8532        fn values() -> &'static [Self] {
8533            &[Self::SPEED, Self::CODE_SIZE, Self::LITE_RUNTIME]
8534        }
8535    }
8536}
8537#[derive(Clone, PartialEq, Default)]
8538#[cfg_attr(feature = "json", derive(::serde::Serialize))]
8539#[cfg_attr(feature = "json", serde(default))]
8540#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8541pub struct MessageOptions {
8542    /// Set true to use the old proto1 MessageSet wire format for extensions.
8543    /// This is provided for backwards-compatibility with the MessageSet wire
8544    /// format.  You should not use this for any other reason:  It's less
8545    /// efficient, has fewer features, and is more complicated.
8546    ///
8547    /// The message must be defined exactly as follows:
8548    ///   message Foo {
8549    /// ```text
8550    /// option message_set_wire_format = true;
8551    /// extensions 4 to max;
8552    /// ```
8553    ///   }
8554    /// Note that the message cannot have any defined fields; MessageSets only
8555    /// have extensions.
8556    ///
8557    /// All extensions of your type must be singular messages; e.g. they cannot
8558    /// be int32s, enums, or repeated messages.
8559    ///
8560    /// Because this is an option, the above two restrictions are not enforced by
8561    /// the protocol compiler.
8562    ///
8563    /// Field 1: `message_set_wire_format`
8564    #[cfg_attr(
8565        feature = "json",
8566        serde(
8567            rename = "messageSetWireFormat",
8568            alias = "message_set_wire_format",
8569            skip_serializing_if = "::core::option::Option::is_none"
8570        )
8571    )]
8572    pub message_set_wire_format: ::core::option::Option<bool>,
8573    /// Disables the generation of the standard "descriptor()" accessor, which can
8574    /// conflict with a field of the same name.  This is meant to make migration
8575    /// from proto1 easier; new code should avoid fields named "descriptor".
8576    ///
8577    /// Field 2: `no_standard_descriptor_accessor`
8578    #[cfg_attr(
8579        feature = "json",
8580        serde(
8581            rename = "noStandardDescriptorAccessor",
8582            alias = "no_standard_descriptor_accessor",
8583            skip_serializing_if = "::core::option::Option::is_none"
8584        )
8585    )]
8586    pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
8587    /// Is this message deprecated?
8588    /// Depending on the target platform, this can emit Deprecated annotations
8589    /// for the message, or it will be completely ignored; in the very least,
8590    /// this is a formalization for deprecating messages.
8591    ///
8592    /// Field 3: `deprecated`
8593    #[cfg_attr(
8594        feature = "json",
8595        serde(
8596            rename = "deprecated",
8597            skip_serializing_if = "::core::option::Option::is_none"
8598        )
8599    )]
8600    pub deprecated: ::core::option::Option<bool>,
8601    /// Whether the message is an automatically generated map entry type for the
8602    /// maps field.
8603    ///
8604    /// For maps fields:
8605    /// ```text
8606    /// map<KeyType, ValueType> map_field = 1;
8607    /// ```
8608    /// The parsed descriptor looks like:
8609    /// ```text
8610    /// message MapFieldEntry {
8611    ///     option map_entry = true;
8612    ///     optional KeyType key = 1;
8613    ///     optional ValueType value = 2;
8614    /// }
8615    /// repeated MapFieldEntry map_field = 1;
8616    /// ```
8617    ///
8618    /// Implementations may choose not to generate the map_entry=true message, but
8619    /// use a native map in the target language to hold the keys and values.
8620    /// The reflection APIs in such implementations still need to work as
8621    /// if the field is a repeated message field.
8622    ///
8623    /// NOTE: Do not set the option in .proto files. Always use the maps syntax
8624    /// instead. The option should only be implicitly set by the proto compiler
8625    /// parser.
8626    ///
8627    /// Field 7: `map_entry`
8628    #[cfg_attr(
8629        feature = "json",
8630        serde(
8631            rename = "mapEntry",
8632            alias = "map_entry",
8633            skip_serializing_if = "::core::option::Option::is_none"
8634        )
8635    )]
8636    pub map_entry: ::core::option::Option<bool>,
8637    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
8638    /// and strips underscored from the fields before comparison in proto3 only.
8639    /// The new behavior takes `json_name` into account and applies to proto2 as
8640    /// well.
8641    ///
8642    /// This should only be used as a temporary measure against broken builds due
8643    /// to the change in behavior for JSON field name conflicts.
8644    ///
8645    /// TODO This is legacy behavior we plan to remove once downstream
8646    /// teams have had time to migrate.
8647    ///
8648    /// Field 11: `deprecated_legacy_json_field_conflicts`
8649    #[cfg_attr(
8650        feature = "json",
8651        serde(
8652            rename = "deprecatedLegacyJsonFieldConflicts",
8653            alias = "deprecated_legacy_json_field_conflicts",
8654            skip_serializing_if = "::core::option::Option::is_none"
8655        )
8656    )]
8657    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
8658    /// Any features defined in the specific edition.
8659    /// WARNING: This field should only be used by protobuf plugins or special
8660    /// cases like the proto compiler. Other uses are discouraged and
8661    /// developers should rely on the protoreflect APIs for their client language.
8662    ///
8663    /// Field 12: `features`
8664    #[cfg_attr(
8665        feature = "json",
8666        serde(
8667            rename = "features",
8668            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
8669        )
8670    )]
8671    pub features: ::buffa::MessageField<FeatureSet>,
8672    /// The parser stores options it doesn't recognize here. See above.
8673    ///
8674    /// Field 999: `uninterpreted_option`
8675    #[cfg_attr(
8676        feature = "json",
8677        serde(
8678            rename = "uninterpretedOption",
8679            alias = "uninterpreted_option",
8680            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
8681            deserialize_with = "::buffa::json_helpers::null_as_default"
8682        )
8683    )]
8684    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
8685    #[cfg_attr(feature = "json", serde(flatten))]
8686    #[doc(hidden)]
8687    pub __buffa_unknown_fields: __MessageOptionsExtJson,
8688}
8689impl ::core::fmt::Debug for MessageOptions {
8690    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8691        f.debug_struct("MessageOptions")
8692            .field("message_set_wire_format", &self.message_set_wire_format)
8693            .field(
8694                "no_standard_descriptor_accessor",
8695                &self.no_standard_descriptor_accessor,
8696            )
8697            .field("deprecated", &self.deprecated)
8698            .field("map_entry", &self.map_entry)
8699            .field(
8700                "deprecated_legacy_json_field_conflicts",
8701                &self.deprecated_legacy_json_field_conflicts,
8702            )
8703            .field("features", &self.features)
8704            .field("uninterpreted_option", &self.uninterpreted_option)
8705            .finish()
8706    }
8707}
8708impl MessageOptions {
8709    /// Protobuf type URL for this message, for use with `Any::pack` and
8710    /// `Any::unpack_if`.
8711    ///
8712    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8713    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
8714}
8715impl MessageOptions {
8716    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8717    #[inline]
8718    ///Sets [`Self::message_set_wire_format`] to `Some(value)`, consuming and returning `self`.
8719    pub fn with_message_set_wire_format(mut self, value: bool) -> Self {
8720        self.message_set_wire_format = Some(value);
8721        self
8722    }
8723    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8724    #[inline]
8725    ///Sets [`Self::no_standard_descriptor_accessor`] to `Some(value)`, consuming and returning `self`.
8726    pub fn with_no_standard_descriptor_accessor(mut self, value: bool) -> Self {
8727        self.no_standard_descriptor_accessor = Some(value);
8728        self
8729    }
8730    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8731    #[inline]
8732    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
8733    pub fn with_deprecated(mut self, value: bool) -> Self {
8734        self.deprecated = Some(value);
8735        self
8736    }
8737    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8738    #[inline]
8739    ///Sets [`Self::map_entry`] to `Some(value)`, consuming and returning `self`.
8740    pub fn with_map_entry(mut self, value: bool) -> Self {
8741        self.map_entry = Some(value);
8742        self
8743    }
8744    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8745    #[inline]
8746    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
8747    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
8748        self.deprecated_legacy_json_field_conflicts = Some(value);
8749        self
8750    }
8751}
8752::buffa::impl_default_instance!(MessageOptions);
8753impl ::buffa::MessageName for MessageOptions {
8754    const PACKAGE: &'static str = "google.protobuf";
8755    const NAME: &'static str = "MessageOptions";
8756    const FULL_NAME: &'static str = "google.protobuf.MessageOptions";
8757    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
8758}
8759impl ::buffa::Message for MessageOptions {
8760    /// Returns the total encoded size in bytes.
8761    ///
8762    /// The result is a `u32`; the protobuf specification requires all
8763    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
8764    /// compliant message will never overflow this type.
8765    #[allow(clippy::let_and_return)]
8766    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
8767        #[allow(unused_imports)]
8768        use ::buffa::Enumeration as _;
8769        let mut size = 0u32;
8770        if self.message_set_wire_format.is_some() {
8771            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8772        }
8773        if self.no_standard_descriptor_accessor.is_some() {
8774            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8775        }
8776        if self.deprecated.is_some() {
8777            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8778        }
8779        if self.map_entry.is_some() {
8780            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8781        }
8782        if self.deprecated_legacy_json_field_conflicts.is_some() {
8783            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8784        }
8785        if self.features.is_set() {
8786            let __slot = __cache.reserve();
8787            let inner_size = self.features.compute_size(__cache);
8788            __cache.set(__slot, inner_size);
8789            size
8790                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
8791                    + inner_size;
8792        }
8793        for v in &self.uninterpreted_option {
8794            let __slot = __cache.reserve();
8795            let inner_size = v.compute_size(__cache);
8796            __cache.set(__slot, inner_size);
8797            size
8798                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
8799                    + inner_size;
8800        }
8801        size += self.__buffa_unknown_fields.encoded_len() as u32;
8802        size
8803    }
8804    fn write_to(
8805        &self,
8806        __cache: &mut ::buffa::SizeCache,
8807        buf: &mut impl ::buffa::bytes::BufMut,
8808    ) {
8809        #[allow(unused_imports)]
8810        use ::buffa::Enumeration as _;
8811        if let Some(v) = self.message_set_wire_format {
8812            ::buffa::types::put_bool_field(1u32, v, buf);
8813        }
8814        if let Some(v) = self.no_standard_descriptor_accessor {
8815            ::buffa::types::put_bool_field(2u32, v, buf);
8816        }
8817        if let Some(v) = self.deprecated {
8818            ::buffa::types::put_bool_field(3u32, v, buf);
8819        }
8820        if let Some(v) = self.map_entry {
8821            ::buffa::types::put_bool_field(7u32, v, buf);
8822        }
8823        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
8824            ::buffa::types::put_bool_field(11u32, v, buf);
8825        }
8826        if self.features.is_set() {
8827            ::buffa::types::put_len_delimited_header(12u32, __cache.consume_next(), buf);
8828            self.features.write_to(__cache, buf);
8829        }
8830        for v in &self.uninterpreted_option {
8831            ::buffa::types::put_len_delimited_header(
8832                999u32,
8833                __cache.consume_next(),
8834                buf,
8835            );
8836            v.write_to(__cache, buf);
8837        }
8838        self.__buffa_unknown_fields.write_to(buf);
8839    }
8840    fn merge_field(
8841        &mut self,
8842        tag: ::buffa::encoding::Tag,
8843        buf: &mut impl ::buffa::bytes::Buf,
8844        ctx: ::buffa::DecodeContext<'_>,
8845    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8846        #[allow(unused_imports)]
8847        use ::buffa::bytes::Buf as _;
8848        #[allow(unused_imports)]
8849        use ::buffa::Enumeration as _;
8850        match tag.field_number() {
8851            1u32 => {
8852                ::buffa::encoding::check_wire_type(
8853                    tag,
8854                    ::buffa::encoding::WireType::Varint,
8855                )?;
8856                self.message_set_wire_format = ::core::option::Option::Some(
8857                    ::buffa::types::decode_bool(buf)?,
8858                );
8859            }
8860            2u32 => {
8861                ::buffa::encoding::check_wire_type(
8862                    tag,
8863                    ::buffa::encoding::WireType::Varint,
8864                )?;
8865                self.no_standard_descriptor_accessor = ::core::option::Option::Some(
8866                    ::buffa::types::decode_bool(buf)?,
8867                );
8868            }
8869            3u32 => {
8870                ::buffa::encoding::check_wire_type(
8871                    tag,
8872                    ::buffa::encoding::WireType::Varint,
8873                )?;
8874                self.deprecated = ::core::option::Option::Some(
8875                    ::buffa::types::decode_bool(buf)?,
8876                );
8877            }
8878            7u32 => {
8879                ::buffa::encoding::check_wire_type(
8880                    tag,
8881                    ::buffa::encoding::WireType::Varint,
8882                )?;
8883                self.map_entry = ::core::option::Option::Some(
8884                    ::buffa::types::decode_bool(buf)?,
8885                );
8886            }
8887            11u32 => {
8888                ::buffa::encoding::check_wire_type(
8889                    tag,
8890                    ::buffa::encoding::WireType::Varint,
8891                )?;
8892                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
8893                    ::buffa::types::decode_bool(buf)?,
8894                );
8895            }
8896            12u32 => {
8897                ::buffa::encoding::check_wire_type(
8898                    tag,
8899                    ::buffa::encoding::WireType::LengthDelimited,
8900                )?;
8901                ::buffa::Message::merge_length_delimited(
8902                    self.features.get_or_insert_default(),
8903                    buf,
8904                    ctx,
8905                )?;
8906            }
8907            999u32 => {
8908                ::buffa::encoding::check_wire_type(
8909                    tag,
8910                    ::buffa::encoding::WireType::LengthDelimited,
8911                )?;
8912                let mut elem = ::core::default::Default::default();
8913                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
8914                self.uninterpreted_option.push(elem);
8915            }
8916            _ => {
8917                self.__buffa_unknown_fields
8918                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
8919            }
8920        }
8921        ::core::result::Result::Ok(())
8922    }
8923    fn clear(&mut self) {
8924        self.message_set_wire_format = ::core::option::Option::None;
8925        self.no_standard_descriptor_accessor = ::core::option::Option::None;
8926        self.deprecated = ::core::option::Option::None;
8927        self.map_entry = ::core::option::Option::None;
8928        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
8929        self.features = ::buffa::MessageField::none();
8930        self.uninterpreted_option.clear();
8931        self.__buffa_unknown_fields.clear();
8932    }
8933}
8934impl ::buffa::ExtensionSet for MessageOptions {
8935    const PROTO_FQN: &'static str = "google.protobuf.MessageOptions";
8936    fn unknown_fields(&self) -> &::buffa::UnknownFields {
8937        &self.__buffa_unknown_fields
8938    }
8939    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8940        &mut self.__buffa_unknown_fields
8941    }
8942}
8943#[cfg(feature = "text")]
8944impl ::buffa::text::TextFormat for MessageOptions {
8945    fn encode_text(
8946        &self,
8947        enc: &mut ::buffa::text::TextEncoder<'_>,
8948    ) -> ::core::fmt::Result {
8949        #[allow(unused_imports)]
8950        use ::buffa::Enumeration as _;
8951        if let ::core::option::Option::Some(ref __v) = self.message_set_wire_format {
8952            enc.write_field_name("message_set_wire_format")?;
8953            enc.write_bool(*__v)?;
8954        }
8955        if let ::core::option::Option::Some(ref __v) = self
8956            .no_standard_descriptor_accessor
8957        {
8958            enc.write_field_name("no_standard_descriptor_accessor")?;
8959            enc.write_bool(*__v)?;
8960        }
8961        if let ::core::option::Option::Some(ref __v) = self.deprecated {
8962            enc.write_field_name("deprecated")?;
8963            enc.write_bool(*__v)?;
8964        }
8965        if let ::core::option::Option::Some(ref __v) = self.map_entry {
8966            enc.write_field_name("map_entry")?;
8967            enc.write_bool(*__v)?;
8968        }
8969        if let ::core::option::Option::Some(ref __v) = self
8970            .deprecated_legacy_json_field_conflicts
8971        {
8972            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
8973            enc.write_bool(*__v)?;
8974        }
8975        if self.features.is_set() {
8976            enc.write_field_name("features")?;
8977            enc.write_message(&*self.features)?;
8978        }
8979        for __v in &self.uninterpreted_option {
8980            enc.write_field_name("uninterpreted_option")?;
8981            enc.write_message(__v)?;
8982        }
8983        enc.write_extension_fields(
8984            "google.protobuf.MessageOptions",
8985            &self.__buffa_unknown_fields,
8986        )?;
8987        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
8988        ::core::result::Result::Ok(())
8989    }
8990    fn merge_text(
8991        &mut self,
8992        dec: &mut ::buffa::text::TextDecoder<'_>,
8993    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
8994        #[allow(unused_imports)]
8995        use ::buffa::Enumeration as _;
8996        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
8997            match __name {
8998                "message_set_wire_format" => {
8999                    self.message_set_wire_format = ::core::option::Option::Some(
9000                        dec.read_bool()?,
9001                    );
9002                }
9003                "no_standard_descriptor_accessor" => {
9004                    self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9005                        dec.read_bool()?,
9006                    );
9007                }
9008                "deprecated" => {
9009                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
9010                }
9011                "map_entry" => {
9012                    self.map_entry = ::core::option::Option::Some(dec.read_bool()?);
9013                }
9014                "deprecated_legacy_json_field_conflicts" => {
9015                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9016                        dec.read_bool()?,
9017                    );
9018                }
9019                "features" => dec.merge_message(self.features.get_or_insert_default())?,
9020                "uninterpreted_option" => {
9021                    dec.read_repeated_into(
9022                        &mut self.uninterpreted_option,
9023                        |__d| {
9024                            let mut __m = ::core::default::Default::default();
9025                            __d.merge_message(&mut __m)?;
9026                            ::core::result::Result::Ok(__m)
9027                        },
9028                    )?
9029                }
9030                __name if __name.starts_with('[') => {
9031                    for __r in dec
9032                        .read_extension(__name, "google.protobuf.MessageOptions")?
9033                    {
9034                        self.__buffa_unknown_fields.push(__r);
9035                    }
9036                }
9037                _ => dec.skip_value()?,
9038            }
9039        }
9040        ::core::result::Result::Ok(())
9041    }
9042}
9043#[cfg(feature = "json")]
9044impl<'de> serde::Deserialize<'de> for MessageOptions {
9045    fn deserialize<D: serde::Deserializer<'de>>(
9046        d: D,
9047    ) -> ::core::result::Result<Self, D::Error> {
9048        struct _V;
9049        impl<'de> serde::de::Visitor<'de> for _V {
9050            type Value = MessageOptions;
9051            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9052                f.write_str("struct MessageOptions")
9053            }
9054            #[allow(clippy::field_reassign_with_default)]
9055            fn visit_map<A: serde::de::MapAccess<'de>>(
9056                self,
9057                mut map: A,
9058            ) -> ::core::result::Result<MessageOptions, A::Error> {
9059                let mut __f_message_set_wire_format: ::core::option::Option<
9060                    ::core::option::Option<bool>,
9061                > = None;
9062                let mut __f_no_standard_descriptor_accessor: ::core::option::Option<
9063                    ::core::option::Option<bool>,
9064                > = None;
9065                let mut __f_deprecated: ::core::option::Option<
9066                    ::core::option::Option<bool>,
9067                > = None;
9068                let mut __f_map_entry: ::core::option::Option<
9069                    ::core::option::Option<bool>,
9070                > = None;
9071                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
9072                    ::core::option::Option<bool>,
9073                > = None;
9074                let mut __f_features: ::core::option::Option<
9075                    ::buffa::MessageField<FeatureSet>,
9076                > = None;
9077                let mut __f_uninterpreted_option: ::core::option::Option<
9078                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
9079                > = None;
9080                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
9081                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
9082                    match key.as_str() {
9083                        "messageSetWireFormat" | "message_set_wire_format" => {
9084                            __f_message_set_wire_format = Some(
9085                                map.next_value::<::core::option::Option<bool>>()?,
9086                            );
9087                        }
9088                        "noStandardDescriptorAccessor"
9089                        | "no_standard_descriptor_accessor" => {
9090                            __f_no_standard_descriptor_accessor = Some(
9091                                map.next_value::<::core::option::Option<bool>>()?,
9092                            );
9093                        }
9094                        "deprecated" => {
9095                            __f_deprecated = Some(
9096                                map.next_value::<::core::option::Option<bool>>()?,
9097                            );
9098                        }
9099                        "mapEntry" | "map_entry" => {
9100                            __f_map_entry = Some(
9101                                map.next_value::<::core::option::Option<bool>>()?,
9102                            );
9103                        }
9104                        "deprecatedLegacyJsonFieldConflicts"
9105                        | "deprecated_legacy_json_field_conflicts" => {
9106                            __f_deprecated_legacy_json_field_conflicts = Some(
9107                                map.next_value::<::core::option::Option<bool>>()?,
9108                            );
9109                        }
9110                        "features" => {
9111                            __f_features = Some(
9112                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
9113                            );
9114                        }
9115                        "uninterpretedOption" | "uninterpreted_option" => {
9116                            __f_uninterpreted_option = Some({
9117                                struct _S;
9118                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
9119                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
9120                                    fn deserialize<D: serde::Deserializer<'de>>(
9121                                        self,
9122                                        d: D,
9123                                    ) -> ::core::result::Result<
9124                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
9125                                        D::Error,
9126                                    > {
9127                                        ::buffa::json_helpers::null_as_default(d)
9128                                    }
9129                                }
9130                                map.next_value_seed(_S)?
9131                            });
9132                        }
9133                        __k if __k.starts_with('[') => {
9134                            let __v: ::buffa::serde_json::Value = map.next_value()?;
9135                            match ::buffa::extension_registry::deserialize_extension_key(
9136                                "google.protobuf.MessageOptions",
9137                                __k,
9138                                __v,
9139                            ) {
9140                                ::core::option::Option::Some(
9141                                    ::core::result::Result::Ok(__recs),
9142                                ) => {
9143                                    for __rec in __recs {
9144                                        __ext_records.push(__rec);
9145                                    }
9146                                }
9147                                ::core::option::Option::Some(
9148                                    ::core::result::Result::Err(__e),
9149                                ) => {
9150                                    return ::core::result::Result::Err(
9151                                        <A::Error as ::serde::de::Error>::custom(__e),
9152                                    );
9153                                }
9154                                ::core::option::Option::None => {}
9155                            }
9156                        }
9157                        _ => {
9158                            map.next_value::<serde::de::IgnoredAny>()?;
9159                        }
9160                    }
9161                }
9162                let mut __r = <MessageOptions as ::core::default::Default>::default();
9163                if let ::core::option::Option::Some(v) = __f_message_set_wire_format {
9164                    __r.message_set_wire_format = v;
9165                }
9166                if let ::core::option::Option::Some(v) = __f_no_standard_descriptor_accessor {
9167                    __r.no_standard_descriptor_accessor = v;
9168                }
9169                if let ::core::option::Option::Some(v) = __f_deprecated {
9170                    __r.deprecated = v;
9171                }
9172                if let ::core::option::Option::Some(v) = __f_map_entry {
9173                    __r.map_entry = v;
9174                }
9175                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
9176                    __r.deprecated_legacy_json_field_conflicts = v;
9177                }
9178                if let ::core::option::Option::Some(v) = __f_features {
9179                    __r.features = v;
9180                }
9181                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
9182                    __r.uninterpreted_option = v;
9183                }
9184                for __rec in __ext_records {
9185                    __r.__buffa_unknown_fields.push(__rec);
9186                }
9187                Ok(__r)
9188            }
9189        }
9190        d.deserialize_map(_V)
9191    }
9192}
9193#[cfg(feature = "json")]
9194impl ::buffa::json_helpers::ProtoElemJson for MessageOptions {
9195    fn serialize_proto_json<S: ::serde::Serializer>(
9196        v: &Self,
9197        s: S,
9198    ) -> ::core::result::Result<S::Ok, S::Error> {
9199        ::serde::Serialize::serialize(v, s)
9200    }
9201    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9202        d: D,
9203    ) -> ::core::result::Result<Self, D::Error> {
9204        <Self as ::serde::Deserialize>::deserialize(d)
9205    }
9206}
9207#[doc(hidden)]
9208#[derive(Clone, Debug, Default, PartialEq)]
9209#[repr(transparent)]
9210#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9211pub struct __MessageOptionsExtJson(pub ::buffa::UnknownFields);
9212impl ::core::ops::Deref for __MessageOptionsExtJson {
9213    type Target = ::buffa::UnknownFields;
9214    fn deref(&self) -> &::buffa::UnknownFields {
9215        &self.0
9216    }
9217}
9218impl ::core::ops::DerefMut for __MessageOptionsExtJson {
9219    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
9220        &mut self.0
9221    }
9222}
9223impl ::core::convert::From<::buffa::UnknownFields> for __MessageOptionsExtJson {
9224    fn from(u: ::buffa::UnknownFields) -> Self {
9225        Self(u)
9226    }
9227}
9228#[cfg(feature = "json")]
9229impl ::serde::Serialize for __MessageOptionsExtJson {
9230    fn serialize<S: ::serde::Serializer>(
9231        &self,
9232        s: S,
9233    ) -> ::core::result::Result<S::Ok, S::Error> {
9234        ::buffa::extension_registry::serialize_extensions(
9235            "google.protobuf.MessageOptions",
9236            &self.0,
9237            s,
9238        )
9239    }
9240}
9241#[cfg(feature = "json")]
9242impl<'de> ::serde::Deserialize<'de> for __MessageOptionsExtJson {
9243    fn deserialize<D: ::serde::Deserializer<'de>>(
9244        d: D,
9245    ) -> ::core::result::Result<Self, D::Error> {
9246        ::buffa::extension_registry::deserialize_extensions(
9247                "google.protobuf.MessageOptions",
9248                d,
9249            )
9250            .map(Self)
9251    }
9252}
9253#[cfg(feature = "json")]
9254#[doc(hidden)]
9255pub const __MESSAGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9256    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9257    to_json: ::buffa::type_registry::any_to_json::<MessageOptions>,
9258    from_json: ::buffa::type_registry::any_from_json::<MessageOptions>,
9259    is_wkt: false,
9260};
9261#[cfg(feature = "text")]
9262#[doc(hidden)]
9263pub const __MESSAGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
9264    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9265    text_encode: ::buffa::type_registry::any_encode_text::<MessageOptions>,
9266    text_merge: ::buffa::type_registry::any_merge_text::<MessageOptions>,
9267};
9268#[derive(Clone, PartialEq, Default)]
9269#[cfg_attr(feature = "json", derive(::serde::Serialize))]
9270#[cfg_attr(feature = "json", serde(default))]
9271#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9272pub struct FieldOptions {
9273    /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
9274    /// The ctype option instructs the C++ code generator to use a different
9275    /// representation of the field than it normally would.  See the specific
9276    /// options below.  This option is only implemented to support use of
9277    /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
9278    /// type "bytes" in the open source release.
9279    /// TODO: make ctype actually deprecated.
9280    ///
9281    /// Field 1: `ctype`
9282    #[cfg_attr(
9283        feature = "json",
9284        serde(
9285            rename = "ctype",
9286            with = "::buffa::json_helpers::opt_closed_enum",
9287            skip_serializing_if = "::core::option::Option::is_none"
9288        )
9289    )]
9290    pub ctype: ::core::option::Option<field_options::CType>,
9291    /// The packed option can be enabled for repeated primitive fields to enable
9292    /// a more efficient representation on the wire. Rather than repeatedly
9293    /// writing the tag and type for each element, the entire array is encoded as
9294    /// a single length-delimited blob. In proto3, only explicit setting it to
9295    /// false will avoid using packed encoding.  This option is prohibited in
9296    /// Editions, but the `repeated_field_encoding` feature can be used to control
9297    /// the behavior.
9298    ///
9299    /// Field 2: `packed`
9300    #[cfg_attr(
9301        feature = "json",
9302        serde(rename = "packed", skip_serializing_if = "::core::option::Option::is_none")
9303    )]
9304    pub packed: ::core::option::Option<bool>,
9305    /// The jstype option determines the JavaScript type used for values of the
9306    /// field.  The option is permitted only for 64 bit integral and fixed types
9307    /// (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
9308    /// is represented as JavaScript string, which avoids loss of precision that
9309    /// can happen when a large value is converted to a floating point JavaScript.
9310    /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
9311    /// use the JavaScript "number" type.  The behavior of the default option
9312    /// JS_NORMAL is implementation dependent.
9313    ///
9314    /// This option is an enum to permit additional types to be added, e.g.
9315    /// goog.math.Integer.
9316    ///
9317    /// Field 6: `jstype`
9318    #[cfg_attr(
9319        feature = "json",
9320        serde(
9321            rename = "jstype",
9322            with = "::buffa::json_helpers::opt_closed_enum",
9323            skip_serializing_if = "::core::option::Option::is_none"
9324        )
9325    )]
9326    pub jstype: ::core::option::Option<field_options::JSType>,
9327    /// Should this field be parsed lazily?  Lazy applies only to message-type
9328    /// fields.  It means that when the outer message is initially parsed, the
9329    /// inner message's contents will not be parsed but instead stored in encoded
9330    /// form.  The inner message will actually be parsed when it is first accessed.
9331    ///
9332    /// This is only a hint.  Implementations are free to choose whether to use
9333    /// eager or lazy parsing regardless of the value of this option.  However,
9334    /// setting this option true suggests that the protocol author believes that
9335    /// using lazy parsing on this field is worth the additional bookkeeping
9336    /// overhead typically needed to implement it.
9337    ///
9338    /// This option does not affect the public interface of any generated code;
9339    /// all method signatures remain the same.  Furthermore, thread-safety of the
9340    /// interface is not affected by this option; const methods remain safe to
9341    /// call from multiple threads concurrently, while non-const methods continue
9342    /// to require exclusive access.
9343    ///
9344    /// Note that lazy message fields are still eagerly verified to check
9345    /// ill-formed wireformat or missing required fields. Calling IsInitialized()
9346    /// on the outer message would fail if the inner message has missing required
9347    /// fields. Failed verification would result in parsing failure (except when
9348    /// uninitialized messages are acceptable).
9349    ///
9350    /// Field 5: `lazy`
9351    #[cfg_attr(
9352        feature = "json",
9353        serde(rename = "lazy", skip_serializing_if = "::core::option::Option::is_none")
9354    )]
9355    pub lazy: ::core::option::Option<bool>,
9356    /// unverified_lazy does no correctness checks on the byte stream. This should
9357    /// only be used where lazy with verification is prohibitive for performance
9358    /// reasons.
9359    ///
9360    /// Field 15: `unverified_lazy`
9361    #[cfg_attr(
9362        feature = "json",
9363        serde(
9364            rename = "unverifiedLazy",
9365            alias = "unverified_lazy",
9366            skip_serializing_if = "::core::option::Option::is_none"
9367        )
9368    )]
9369    pub unverified_lazy: ::core::option::Option<bool>,
9370    /// Is this field deprecated?
9371    /// Depending on the target platform, this can emit Deprecated annotations
9372    /// for accessors, or it will be completely ignored; in the very least, this
9373    /// is a formalization for deprecating fields.
9374    ///
9375    /// Field 3: `deprecated`
9376    #[cfg_attr(
9377        feature = "json",
9378        serde(
9379            rename = "deprecated",
9380            skip_serializing_if = "::core::option::Option::is_none"
9381        )
9382    )]
9383    pub deprecated: ::core::option::Option<bool>,
9384    /// DEPRECATED. DO NOT USE!
9385    /// For Google-internal migration only. Do not use.
9386    ///
9387    /// Field 10: `weak`
9388    #[cfg_attr(
9389        feature = "json",
9390        serde(rename = "weak", skip_serializing_if = "::core::option::Option::is_none")
9391    )]
9392    pub weak: ::core::option::Option<bool>,
9393    /// Indicate that the field value should not be printed out when using debug
9394    /// formats, e.g. when the field contains sensitive credentials.
9395    ///
9396    /// Field 16: `debug_redact`
9397    #[cfg_attr(
9398        feature = "json",
9399        serde(
9400            rename = "debugRedact",
9401            alias = "debug_redact",
9402            skip_serializing_if = "::core::option::Option::is_none"
9403        )
9404    )]
9405    pub debug_redact: ::core::option::Option<bool>,
9406    /// Field 17: `retention`
9407    #[cfg_attr(
9408        feature = "json",
9409        serde(
9410            rename = "retention",
9411            with = "::buffa::json_helpers::opt_closed_enum",
9412            skip_serializing_if = "::core::option::Option::is_none"
9413        )
9414    )]
9415    pub retention: ::core::option::Option<field_options::OptionRetention>,
9416    /// Field 19: `targets`
9417    #[cfg_attr(
9418        feature = "json",
9419        serde(
9420            rename = "targets",
9421            with = "::buffa::json_helpers::repeated_closed_enum",
9422            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
9423        )
9424    )]
9425    pub targets: ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
9426    /// Field 20: `edition_defaults`
9427    #[cfg_attr(
9428        feature = "json",
9429        serde(
9430            rename = "editionDefaults",
9431            alias = "edition_defaults",
9432            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9433            deserialize_with = "::buffa::json_helpers::null_as_default"
9434        )
9435    )]
9436    pub edition_defaults: ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
9437    /// Any features defined in the specific edition.
9438    /// WARNING: This field should only be used by protobuf plugins or special
9439    /// cases like the proto compiler. Other uses are discouraged and
9440    /// developers should rely on the protoreflect APIs for their client language.
9441    ///
9442    /// Field 21: `features`
9443    #[cfg_attr(
9444        feature = "json",
9445        serde(
9446            rename = "features",
9447            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9448        )
9449    )]
9450    pub features: ::buffa::MessageField<FeatureSet>,
9451    /// Field 22: `feature_support`
9452    #[cfg_attr(
9453        feature = "json",
9454        serde(
9455            rename = "featureSupport",
9456            alias = "feature_support",
9457            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9458        )
9459    )]
9460    pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
9461    /// The parser stores options it doesn't recognize here. See above.
9462    ///
9463    /// Field 999: `uninterpreted_option`
9464    #[cfg_attr(
9465        feature = "json",
9466        serde(
9467            rename = "uninterpretedOption",
9468            alias = "uninterpreted_option",
9469            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9470            deserialize_with = "::buffa::json_helpers::null_as_default"
9471        )
9472    )]
9473    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
9474    #[cfg_attr(feature = "json", serde(flatten))]
9475    #[doc(hidden)]
9476    pub __buffa_unknown_fields: __FieldOptionsExtJson,
9477}
9478impl ::core::fmt::Debug for FieldOptions {
9479    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9480        f.debug_struct("FieldOptions")
9481            .field("ctype", &self.ctype)
9482            .field("packed", &self.packed)
9483            .field("jstype", &self.jstype)
9484            .field("lazy", &self.lazy)
9485            .field("unverified_lazy", &self.unverified_lazy)
9486            .field("deprecated", &self.deprecated)
9487            .field("weak", &self.weak)
9488            .field("debug_redact", &self.debug_redact)
9489            .field("retention", &self.retention)
9490            .field("targets", &self.targets)
9491            .field("edition_defaults", &self.edition_defaults)
9492            .field("features", &self.features)
9493            .field("feature_support", &self.feature_support)
9494            .field("uninterpreted_option", &self.uninterpreted_option)
9495            .finish()
9496    }
9497}
9498impl FieldOptions {
9499    /// Protobuf type URL for this message, for use with `Any::pack` and
9500    /// `Any::unpack_if`.
9501    ///
9502    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9503    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9504}
9505impl FieldOptions {
9506    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9507    #[inline]
9508    ///Sets [`Self::ctype`] to `Some(value)`, consuming and returning `self`.
9509    pub fn with_ctype(mut self, value: impl Into<field_options::CType>) -> Self {
9510        self.ctype = Some(value.into());
9511        self
9512    }
9513    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9514    #[inline]
9515    ///Sets [`Self::packed`] to `Some(value)`, consuming and returning `self`.
9516    pub fn with_packed(mut self, value: bool) -> Self {
9517        self.packed = Some(value);
9518        self
9519    }
9520    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9521    #[inline]
9522    ///Sets [`Self::jstype`] to `Some(value)`, consuming and returning `self`.
9523    pub fn with_jstype(mut self, value: impl Into<field_options::JSType>) -> Self {
9524        self.jstype = Some(value.into());
9525        self
9526    }
9527    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9528    #[inline]
9529    ///Sets [`Self::lazy`] to `Some(value)`, consuming and returning `self`.
9530    pub fn with_lazy(mut self, value: bool) -> Self {
9531        self.lazy = Some(value);
9532        self
9533    }
9534    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9535    #[inline]
9536    ///Sets [`Self::unverified_lazy`] to `Some(value)`, consuming and returning `self`.
9537    pub fn with_unverified_lazy(mut self, value: bool) -> Self {
9538        self.unverified_lazy = Some(value);
9539        self
9540    }
9541    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9542    #[inline]
9543    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
9544    pub fn with_deprecated(mut self, value: bool) -> Self {
9545        self.deprecated = Some(value);
9546        self
9547    }
9548    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9549    #[inline]
9550    ///Sets [`Self::weak`] to `Some(value)`, consuming and returning `self`.
9551    pub fn with_weak(mut self, value: bool) -> Self {
9552        self.weak = Some(value);
9553        self
9554    }
9555    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9556    #[inline]
9557    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
9558    pub fn with_debug_redact(mut self, value: bool) -> Self {
9559        self.debug_redact = Some(value);
9560        self
9561    }
9562    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9563    #[inline]
9564    ///Sets [`Self::retention`] to `Some(value)`, consuming and returning `self`.
9565    pub fn with_retention(
9566        mut self,
9567        value: impl Into<field_options::OptionRetention>,
9568    ) -> Self {
9569        self.retention = Some(value.into());
9570        self
9571    }
9572}
9573::buffa::impl_default_instance!(FieldOptions);
9574impl ::buffa::MessageName for FieldOptions {
9575    const PACKAGE: &'static str = "google.protobuf";
9576    const NAME: &'static str = "FieldOptions";
9577    const FULL_NAME: &'static str = "google.protobuf.FieldOptions";
9578    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9579}
9580impl ::buffa::Message for FieldOptions {
9581    /// Returns the total encoded size in bytes.
9582    ///
9583    /// The result is a `u32`; the protobuf specification requires all
9584    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
9585    /// compliant message will never overflow this type.
9586    #[allow(clippy::let_and_return)]
9587    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9588        #[allow(unused_imports)]
9589        use ::buffa::Enumeration as _;
9590        let mut size = 0u32;
9591        if let Some(ref v) = self.ctype {
9592            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
9593        }
9594        if self.packed.is_some() {
9595            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9596        }
9597        if self.deprecated.is_some() {
9598            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9599        }
9600        if self.lazy.is_some() {
9601            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9602        }
9603        if let Some(ref v) = self.jstype {
9604            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
9605        }
9606        if self.weak.is_some() {
9607            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9608        }
9609        if self.unverified_lazy.is_some() {
9610            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9611        }
9612        if self.debug_redact.is_some() {
9613            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9614        }
9615        if let Some(ref v) = self.retention {
9616            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
9617        }
9618        for v in &self.targets {
9619            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
9620        }
9621        for v in &self.edition_defaults {
9622            let __slot = __cache.reserve();
9623            let inner_size = v.compute_size(__cache);
9624            __cache.set(__slot, inner_size);
9625            size
9626                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9627                    + inner_size;
9628        }
9629        if self.features.is_set() {
9630            let __slot = __cache.reserve();
9631            let inner_size = self.features.compute_size(__cache);
9632            __cache.set(__slot, inner_size);
9633            size
9634                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9635                    + inner_size;
9636        }
9637        if self.feature_support.is_set() {
9638            let __slot = __cache.reserve();
9639            let inner_size = self.feature_support.compute_size(__cache);
9640            __cache.set(__slot, inner_size);
9641            size
9642                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9643                    + inner_size;
9644        }
9645        for v in &self.uninterpreted_option {
9646            let __slot = __cache.reserve();
9647            let inner_size = v.compute_size(__cache);
9648            __cache.set(__slot, inner_size);
9649            size
9650                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9651                    + inner_size;
9652        }
9653        size += self.__buffa_unknown_fields.encoded_len() as u32;
9654        size
9655    }
9656    fn write_to(
9657        &self,
9658        __cache: &mut ::buffa::SizeCache,
9659        buf: &mut impl ::buffa::bytes::BufMut,
9660    ) {
9661        #[allow(unused_imports)]
9662        use ::buffa::Enumeration as _;
9663        if let Some(ref v) = self.ctype {
9664            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
9665        }
9666        if let Some(v) = self.packed {
9667            ::buffa::types::put_bool_field(2u32, v, buf);
9668        }
9669        if let Some(v) = self.deprecated {
9670            ::buffa::types::put_bool_field(3u32, v, buf);
9671        }
9672        if let Some(v) = self.lazy {
9673            ::buffa::types::put_bool_field(5u32, v, buf);
9674        }
9675        if let Some(ref v) = self.jstype {
9676            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
9677        }
9678        if let Some(v) = self.weak {
9679            ::buffa::types::put_bool_field(10u32, v, buf);
9680        }
9681        if let Some(v) = self.unverified_lazy {
9682            ::buffa::types::put_bool_field(15u32, v, buf);
9683        }
9684        if let Some(v) = self.debug_redact {
9685            ::buffa::types::put_bool_field(16u32, v, buf);
9686        }
9687        if let Some(ref v) = self.retention {
9688            ::buffa::types::put_int32_field(17u32, v.to_i32(), buf);
9689        }
9690        for v in &self.targets {
9691            ::buffa::types::put_int32_field(19u32, v.to_i32(), buf);
9692        }
9693        for v in &self.edition_defaults {
9694            ::buffa::types::put_len_delimited_header(20u32, __cache.consume_next(), buf);
9695            v.write_to(__cache, buf);
9696        }
9697        if self.features.is_set() {
9698            ::buffa::types::put_len_delimited_header(21u32, __cache.consume_next(), buf);
9699            self.features.write_to(__cache, buf);
9700        }
9701        if self.feature_support.is_set() {
9702            ::buffa::types::put_len_delimited_header(22u32, __cache.consume_next(), buf);
9703            self.feature_support.write_to(__cache, buf);
9704        }
9705        for v in &self.uninterpreted_option {
9706            ::buffa::types::put_len_delimited_header(
9707                999u32,
9708                __cache.consume_next(),
9709                buf,
9710            );
9711            v.write_to(__cache, buf);
9712        }
9713        self.__buffa_unknown_fields.write_to(buf);
9714    }
9715    fn merge_field(
9716        &mut self,
9717        tag: ::buffa::encoding::Tag,
9718        buf: &mut impl ::buffa::bytes::Buf,
9719        ctx: ::buffa::DecodeContext<'_>,
9720    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9721        #[allow(unused_imports)]
9722        use ::buffa::bytes::Buf as _;
9723        #[allow(unused_imports)]
9724        use ::buffa::Enumeration as _;
9725        match tag.field_number() {
9726            1u32 => {
9727                ::buffa::encoding::check_wire_type(
9728                    tag,
9729                    ::buffa::encoding::WireType::Varint,
9730                )?;
9731                let __raw = ::buffa::types::decode_int32(buf)?;
9732                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
9733                    __raw,
9734                ) {
9735                    self.ctype = ::core::option::Option::Some(__v);
9736                } else {
9737                    self.__buffa_unknown_fields
9738                        .push(::buffa::UnknownField {
9739                            number: 1u32,
9740                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
9741                        });
9742                }
9743            }
9744            2u32 => {
9745                ::buffa::encoding::check_wire_type(
9746                    tag,
9747                    ::buffa::encoding::WireType::Varint,
9748                )?;
9749                self.packed = ::core::option::Option::Some(
9750                    ::buffa::types::decode_bool(buf)?,
9751                );
9752            }
9753            3u32 => {
9754                ::buffa::encoding::check_wire_type(
9755                    tag,
9756                    ::buffa::encoding::WireType::Varint,
9757                )?;
9758                self.deprecated = ::core::option::Option::Some(
9759                    ::buffa::types::decode_bool(buf)?,
9760                );
9761            }
9762            5u32 => {
9763                ::buffa::encoding::check_wire_type(
9764                    tag,
9765                    ::buffa::encoding::WireType::Varint,
9766                )?;
9767                self.lazy = ::core::option::Option::Some(
9768                    ::buffa::types::decode_bool(buf)?,
9769                );
9770            }
9771            6u32 => {
9772                ::buffa::encoding::check_wire_type(
9773                    tag,
9774                    ::buffa::encoding::WireType::Varint,
9775                )?;
9776                let __raw = ::buffa::types::decode_int32(buf)?;
9777                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
9778                    __raw,
9779                ) {
9780                    self.jstype = ::core::option::Option::Some(__v);
9781                } else {
9782                    self.__buffa_unknown_fields
9783                        .push(::buffa::UnknownField {
9784                            number: 6u32,
9785                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
9786                        });
9787                }
9788            }
9789            10u32 => {
9790                ::buffa::encoding::check_wire_type(
9791                    tag,
9792                    ::buffa::encoding::WireType::Varint,
9793                )?;
9794                self.weak = ::core::option::Option::Some(
9795                    ::buffa::types::decode_bool(buf)?,
9796                );
9797            }
9798            15u32 => {
9799                ::buffa::encoding::check_wire_type(
9800                    tag,
9801                    ::buffa::encoding::WireType::Varint,
9802                )?;
9803                self.unverified_lazy = ::core::option::Option::Some(
9804                    ::buffa::types::decode_bool(buf)?,
9805                );
9806            }
9807            16u32 => {
9808                ::buffa::encoding::check_wire_type(
9809                    tag,
9810                    ::buffa::encoding::WireType::Varint,
9811                )?;
9812                self.debug_redact = ::core::option::Option::Some(
9813                    ::buffa::types::decode_bool(buf)?,
9814                );
9815            }
9816            17u32 => {
9817                ::buffa::encoding::check_wire_type(
9818                    tag,
9819                    ::buffa::encoding::WireType::Varint,
9820                )?;
9821                let __raw = ::buffa::types::decode_int32(buf)?;
9822                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
9823                    __raw,
9824                ) {
9825                    self.retention = ::core::option::Option::Some(__v);
9826                } else {
9827                    self.__buffa_unknown_fields
9828                        .push(::buffa::UnknownField {
9829                            number: 17u32,
9830                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
9831                        });
9832                }
9833            }
9834            19u32 => {
9835                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
9836                    let len = ::buffa::encoding::decode_varint(buf)?;
9837                    let len = usize::try_from(len)
9838                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
9839                    if buf.remaining() < len {
9840                        return ::core::result::Result::Err(
9841                            ::buffa::DecodeError::UnexpectedEof,
9842                        );
9843                    }
9844                    self.targets.reserve(len);
9845                    let mut limited = buf.take(len);
9846                    while limited.has_remaining() {
9847                        let __raw = ::buffa::types::decode_int32(&mut limited)?;
9848                        if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
9849                            __raw,
9850                        ) {
9851                            self.targets.push(__v);
9852                        } else {
9853                            self.__buffa_unknown_fields
9854                                .push(::buffa::UnknownField {
9855                                    number: 19u32,
9856                                    data: ::buffa::UnknownFieldData::Varint(__raw as u64),
9857                                });
9858                        }
9859                    }
9860                    let leftover = limited.remaining();
9861                    if leftover > 0 {
9862                        limited.advance(leftover);
9863                    }
9864                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
9865                    let __raw = ::buffa::types::decode_int32(buf)?;
9866                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
9867                        __raw,
9868                    ) {
9869                        self.targets.push(__v);
9870                    } else {
9871                        self.__buffa_unknown_fields
9872                            .push(::buffa::UnknownField {
9873                                number: 19u32,
9874                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
9875                            });
9876                    }
9877                } else {
9878                    return ::core::result::Result::Err(
9879                        ::buffa::encoding::wire_type_mismatch(
9880                            tag,
9881                            ::buffa::encoding::WireType::LengthDelimited,
9882                        ),
9883                    );
9884                }
9885            }
9886            20u32 => {
9887                ::buffa::encoding::check_wire_type(
9888                    tag,
9889                    ::buffa::encoding::WireType::LengthDelimited,
9890                )?;
9891                let mut elem = ::core::default::Default::default();
9892                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
9893                self.edition_defaults.push(elem);
9894            }
9895            21u32 => {
9896                ::buffa::encoding::check_wire_type(
9897                    tag,
9898                    ::buffa::encoding::WireType::LengthDelimited,
9899                )?;
9900                ::buffa::Message::merge_length_delimited(
9901                    self.features.get_or_insert_default(),
9902                    buf,
9903                    ctx,
9904                )?;
9905            }
9906            22u32 => {
9907                ::buffa::encoding::check_wire_type(
9908                    tag,
9909                    ::buffa::encoding::WireType::LengthDelimited,
9910                )?;
9911                ::buffa::Message::merge_length_delimited(
9912                    self.feature_support.get_or_insert_default(),
9913                    buf,
9914                    ctx,
9915                )?;
9916            }
9917            999u32 => {
9918                ::buffa::encoding::check_wire_type(
9919                    tag,
9920                    ::buffa::encoding::WireType::LengthDelimited,
9921                )?;
9922                let mut elem = ::core::default::Default::default();
9923                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
9924                self.uninterpreted_option.push(elem);
9925            }
9926            _ => {
9927                self.__buffa_unknown_fields
9928                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
9929            }
9930        }
9931        ::core::result::Result::Ok(())
9932    }
9933    fn clear(&mut self) {
9934        self.ctype = ::core::option::Option::None;
9935        self.packed = ::core::option::Option::None;
9936        self.deprecated = ::core::option::Option::None;
9937        self.lazy = ::core::option::Option::None;
9938        self.jstype = ::core::option::Option::None;
9939        self.weak = ::core::option::Option::None;
9940        self.unverified_lazy = ::core::option::Option::None;
9941        self.debug_redact = ::core::option::Option::None;
9942        self.retention = ::core::option::Option::None;
9943        self.targets.clear();
9944        self.edition_defaults.clear();
9945        self.features = ::buffa::MessageField::none();
9946        self.feature_support = ::buffa::MessageField::none();
9947        self.uninterpreted_option.clear();
9948        self.__buffa_unknown_fields.clear();
9949    }
9950}
9951impl ::buffa::ExtensionSet for FieldOptions {
9952    const PROTO_FQN: &'static str = "google.protobuf.FieldOptions";
9953    fn unknown_fields(&self) -> &::buffa::UnknownFields {
9954        &self.__buffa_unknown_fields
9955    }
9956    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9957        &mut self.__buffa_unknown_fields
9958    }
9959}
9960#[cfg(feature = "text")]
9961impl ::buffa::text::TextFormat for FieldOptions {
9962    fn encode_text(
9963        &self,
9964        enc: &mut ::buffa::text::TextEncoder<'_>,
9965    ) -> ::core::fmt::Result {
9966        #[allow(unused_imports)]
9967        use ::buffa::Enumeration as _;
9968        if let ::core::option::Option::Some(ref __v) = self.ctype {
9969            enc.write_field_name("ctype")?;
9970            enc.write_enum_name(__v.proto_name())?;
9971        }
9972        if let ::core::option::Option::Some(ref __v) = self.packed {
9973            enc.write_field_name("packed")?;
9974            enc.write_bool(*__v)?;
9975        }
9976        if let ::core::option::Option::Some(ref __v) = self.jstype {
9977            enc.write_field_name("jstype")?;
9978            enc.write_enum_name(__v.proto_name())?;
9979        }
9980        if let ::core::option::Option::Some(ref __v) = self.lazy {
9981            enc.write_field_name("lazy")?;
9982            enc.write_bool(*__v)?;
9983        }
9984        if let ::core::option::Option::Some(ref __v) = self.unverified_lazy {
9985            enc.write_field_name("unverified_lazy")?;
9986            enc.write_bool(*__v)?;
9987        }
9988        if let ::core::option::Option::Some(ref __v) = self.deprecated {
9989            enc.write_field_name("deprecated")?;
9990            enc.write_bool(*__v)?;
9991        }
9992        if let ::core::option::Option::Some(ref __v) = self.weak {
9993            enc.write_field_name("weak")?;
9994            enc.write_bool(*__v)?;
9995        }
9996        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
9997            enc.write_field_name("debug_redact")?;
9998            enc.write_bool(*__v)?;
9999        }
10000        if let ::core::option::Option::Some(ref __v) = self.retention {
10001            enc.write_field_name("retention")?;
10002            enc.write_enum_name(__v.proto_name())?;
10003        }
10004        if self.features.is_set() {
10005            enc.write_field_name("features")?;
10006            enc.write_message(&*self.features)?;
10007        }
10008        if self.feature_support.is_set() {
10009            enc.write_field_name("feature_support")?;
10010            enc.write_message(&*self.feature_support)?;
10011        }
10012        for __v in &self.targets {
10013            enc.write_field_name("targets")?;
10014            enc.write_enum_name(__v.proto_name())?;
10015        }
10016        for __v in &self.edition_defaults {
10017            enc.write_field_name("edition_defaults")?;
10018            enc.write_message(__v)?;
10019        }
10020        for __v in &self.uninterpreted_option {
10021            enc.write_field_name("uninterpreted_option")?;
10022            enc.write_message(__v)?;
10023        }
10024        enc.write_extension_fields(
10025            "google.protobuf.FieldOptions",
10026            &self.__buffa_unknown_fields,
10027        )?;
10028        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
10029        ::core::result::Result::Ok(())
10030    }
10031    fn merge_text(
10032        &mut self,
10033        dec: &mut ::buffa::text::TextDecoder<'_>,
10034    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
10035        #[allow(unused_imports)]
10036        use ::buffa::Enumeration as _;
10037        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
10038            match __name {
10039                "ctype" => {
10040                    self.ctype = ::core::option::Option::Some(
10041                        dec.read_closed_enum_by_name::<field_options::CType>()?,
10042                    );
10043                }
10044                "packed" => self.packed = ::core::option::Option::Some(dec.read_bool()?),
10045                "jstype" => {
10046                    self.jstype = ::core::option::Option::Some(
10047                        dec.read_closed_enum_by_name::<field_options::JSType>()?,
10048                    );
10049                }
10050                "lazy" => self.lazy = ::core::option::Option::Some(dec.read_bool()?),
10051                "unverified_lazy" => {
10052                    self.unverified_lazy = ::core::option::Option::Some(dec.read_bool()?);
10053                }
10054                "deprecated" => {
10055                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
10056                }
10057                "weak" => self.weak = ::core::option::Option::Some(dec.read_bool()?),
10058                "debug_redact" => {
10059                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
10060                }
10061                "retention" => {
10062                    self.retention = ::core::option::Option::Some(
10063                        dec.read_closed_enum_by_name::<field_options::OptionRetention>()?,
10064                    );
10065                }
10066                "features" => dec.merge_message(self.features.get_or_insert_default())?,
10067                "feature_support" => {
10068                    dec.merge_message(self.feature_support.get_or_insert_default())?
10069                }
10070                "targets" => {
10071                    dec.read_repeated_into(
10072                        &mut self.targets,
10073                        |__d| {
10074                            __d
10075                                .read_closed_enum_by_name::<
10076                                    field_options::OptionTargetType,
10077                                >()
10078                        },
10079                    )?
10080                }
10081                "edition_defaults" => {
10082                    dec.read_repeated_into(
10083                        &mut self.edition_defaults,
10084                        |__d| {
10085                            let mut __m = ::core::default::Default::default();
10086                            __d.merge_message(&mut __m)?;
10087                            ::core::result::Result::Ok(__m)
10088                        },
10089                    )?
10090                }
10091                "uninterpreted_option" => {
10092                    dec.read_repeated_into(
10093                        &mut self.uninterpreted_option,
10094                        |__d| {
10095                            let mut __m = ::core::default::Default::default();
10096                            __d.merge_message(&mut __m)?;
10097                            ::core::result::Result::Ok(__m)
10098                        },
10099                    )?
10100                }
10101                __name if __name.starts_with('[') => {
10102                    for __r in dec
10103                        .read_extension(__name, "google.protobuf.FieldOptions")?
10104                    {
10105                        self.__buffa_unknown_fields.push(__r);
10106                    }
10107                }
10108                _ => dec.skip_value()?,
10109            }
10110        }
10111        ::core::result::Result::Ok(())
10112    }
10113}
10114#[cfg(feature = "json")]
10115impl<'de> serde::Deserialize<'de> for FieldOptions {
10116    fn deserialize<D: serde::Deserializer<'de>>(
10117        d: D,
10118    ) -> ::core::result::Result<Self, D::Error> {
10119        struct _V;
10120        impl<'de> serde::de::Visitor<'de> for _V {
10121            type Value = FieldOptions;
10122            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10123                f.write_str("struct FieldOptions")
10124            }
10125            #[allow(clippy::field_reassign_with_default)]
10126            fn visit_map<A: serde::de::MapAccess<'de>>(
10127                self,
10128                mut map: A,
10129            ) -> ::core::result::Result<FieldOptions, A::Error> {
10130                let mut __f_ctype: ::core::option::Option<
10131                    ::core::option::Option<field_options::CType>,
10132                > = None;
10133                let mut __f_packed: ::core::option::Option<
10134                    ::core::option::Option<bool>,
10135                > = None;
10136                let mut __f_jstype: ::core::option::Option<
10137                    ::core::option::Option<field_options::JSType>,
10138                > = None;
10139                let mut __f_lazy: ::core::option::Option<::core::option::Option<bool>> = None;
10140                let mut __f_unverified_lazy: ::core::option::Option<
10141                    ::core::option::Option<bool>,
10142                > = None;
10143                let mut __f_deprecated: ::core::option::Option<
10144                    ::core::option::Option<bool>,
10145                > = None;
10146                let mut __f_weak: ::core::option::Option<::core::option::Option<bool>> = None;
10147                let mut __f_debug_redact: ::core::option::Option<
10148                    ::core::option::Option<bool>,
10149                > = None;
10150                let mut __f_retention: ::core::option::Option<
10151                    ::core::option::Option<field_options::OptionRetention>,
10152                > = None;
10153                let mut __f_targets: ::core::option::Option<
10154                    ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10155                > = None;
10156                let mut __f_edition_defaults: ::core::option::Option<
10157                    ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10158                > = None;
10159                let mut __f_features: ::core::option::Option<
10160                    ::buffa::MessageField<FeatureSet>,
10161                > = None;
10162                let mut __f_feature_support: ::core::option::Option<
10163                    ::buffa::MessageField<field_options::FeatureSupport>,
10164                > = None;
10165                let mut __f_uninterpreted_option: ::core::option::Option<
10166                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
10167                > = None;
10168                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
10169                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
10170                    match key.as_str() {
10171                        "ctype" => {
10172                            __f_ctype = Some({
10173                                struct _S;
10174                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10175                                    type Value = ::core::option::Option<field_options::CType>;
10176                                    fn deserialize<D: serde::Deserializer<'de>>(
10177                                        self,
10178                                        d: D,
10179                                    ) -> ::core::result::Result<
10180                                        ::core::option::Option<field_options::CType>,
10181                                        D::Error,
10182                                    > {
10183                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10184                                    }
10185                                }
10186                                map.next_value_seed(_S)?
10187                            });
10188                        }
10189                        "packed" => {
10190                            __f_packed = Some(
10191                                map.next_value::<::core::option::Option<bool>>()?,
10192                            );
10193                        }
10194                        "jstype" => {
10195                            __f_jstype = Some({
10196                                struct _S;
10197                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10198                                    type Value = ::core::option::Option<field_options::JSType>;
10199                                    fn deserialize<D: serde::Deserializer<'de>>(
10200                                        self,
10201                                        d: D,
10202                                    ) -> ::core::result::Result<
10203                                        ::core::option::Option<field_options::JSType>,
10204                                        D::Error,
10205                                    > {
10206                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10207                                    }
10208                                }
10209                                map.next_value_seed(_S)?
10210                            });
10211                        }
10212                        "lazy" => {
10213                            __f_lazy = Some(
10214                                map.next_value::<::core::option::Option<bool>>()?,
10215                            );
10216                        }
10217                        "unverifiedLazy" | "unverified_lazy" => {
10218                            __f_unverified_lazy = Some(
10219                                map.next_value::<::core::option::Option<bool>>()?,
10220                            );
10221                        }
10222                        "deprecated" => {
10223                            __f_deprecated = Some(
10224                                map.next_value::<::core::option::Option<bool>>()?,
10225                            );
10226                        }
10227                        "weak" => {
10228                            __f_weak = Some(
10229                                map.next_value::<::core::option::Option<bool>>()?,
10230                            );
10231                        }
10232                        "debugRedact" | "debug_redact" => {
10233                            __f_debug_redact = Some(
10234                                map.next_value::<::core::option::Option<bool>>()?,
10235                            );
10236                        }
10237                        "retention" => {
10238                            __f_retention = Some({
10239                                struct _S;
10240                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10241                                    type Value = ::core::option::Option<
10242                                        field_options::OptionRetention,
10243                                    >;
10244                                    fn deserialize<D: serde::Deserializer<'de>>(
10245                                        self,
10246                                        d: D,
10247                                    ) -> ::core::result::Result<
10248                                        ::core::option::Option<field_options::OptionRetention>,
10249                                        D::Error,
10250                                    > {
10251                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10252                                    }
10253                                }
10254                                map.next_value_seed(_S)?
10255                            });
10256                        }
10257                        "targets" => {
10258                            __f_targets = Some({
10259                                struct _S;
10260                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10261                                    type Value = ::buffa::alloc::vec::Vec<
10262                                        field_options::OptionTargetType,
10263                                    >;
10264                                    fn deserialize<D: serde::Deserializer<'de>>(
10265                                        self,
10266                                        d: D,
10267                                    ) -> ::core::result::Result<
10268                                        ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10269                                        D::Error,
10270                                    > {
10271                                        ::buffa::json_helpers::repeated_closed_enum::deserialize(d)
10272                                    }
10273                                }
10274                                map.next_value_seed(_S)?
10275                            });
10276                        }
10277                        "editionDefaults" | "edition_defaults" => {
10278                            __f_edition_defaults = Some({
10279                                struct _S;
10280                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10281                                    type Value = ::buffa::alloc::vec::Vec<
10282                                        field_options::EditionDefault,
10283                                    >;
10284                                    fn deserialize<D: serde::Deserializer<'de>>(
10285                                        self,
10286                                        d: D,
10287                                    ) -> ::core::result::Result<
10288                                        ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10289                                        D::Error,
10290                                    > {
10291                                        ::buffa::json_helpers::null_as_default(d)
10292                                    }
10293                                }
10294                                map.next_value_seed(_S)?
10295                            });
10296                        }
10297                        "features" => {
10298                            __f_features = Some(
10299                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
10300                            );
10301                        }
10302                        "featureSupport" | "feature_support" => {
10303                            __f_feature_support = Some(
10304                                map
10305                                    .next_value::<
10306                                        ::buffa::MessageField<field_options::FeatureSupport>,
10307                                    >()?,
10308                            );
10309                        }
10310                        "uninterpretedOption" | "uninterpreted_option" => {
10311                            __f_uninterpreted_option = Some({
10312                                struct _S;
10313                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10314                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
10315                                    fn deserialize<D: serde::Deserializer<'de>>(
10316                                        self,
10317                                        d: D,
10318                                    ) -> ::core::result::Result<
10319                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
10320                                        D::Error,
10321                                    > {
10322                                        ::buffa::json_helpers::null_as_default(d)
10323                                    }
10324                                }
10325                                map.next_value_seed(_S)?
10326                            });
10327                        }
10328                        __k if __k.starts_with('[') => {
10329                            let __v: ::buffa::serde_json::Value = map.next_value()?;
10330                            match ::buffa::extension_registry::deserialize_extension_key(
10331                                "google.protobuf.FieldOptions",
10332                                __k,
10333                                __v,
10334                            ) {
10335                                ::core::option::Option::Some(
10336                                    ::core::result::Result::Ok(__recs),
10337                                ) => {
10338                                    for __rec in __recs {
10339                                        __ext_records.push(__rec);
10340                                    }
10341                                }
10342                                ::core::option::Option::Some(
10343                                    ::core::result::Result::Err(__e),
10344                                ) => {
10345                                    return ::core::result::Result::Err(
10346                                        <A::Error as ::serde::de::Error>::custom(__e),
10347                                    );
10348                                }
10349                                ::core::option::Option::None => {}
10350                            }
10351                        }
10352                        _ => {
10353                            map.next_value::<serde::de::IgnoredAny>()?;
10354                        }
10355                    }
10356                }
10357                let mut __r = <FieldOptions as ::core::default::Default>::default();
10358                if let ::core::option::Option::Some(v) = __f_ctype {
10359                    __r.ctype = v;
10360                }
10361                if let ::core::option::Option::Some(v) = __f_packed {
10362                    __r.packed = v;
10363                }
10364                if let ::core::option::Option::Some(v) = __f_jstype {
10365                    __r.jstype = v;
10366                }
10367                if let ::core::option::Option::Some(v) = __f_lazy {
10368                    __r.lazy = v;
10369                }
10370                if let ::core::option::Option::Some(v) = __f_unverified_lazy {
10371                    __r.unverified_lazy = v;
10372                }
10373                if let ::core::option::Option::Some(v) = __f_deprecated {
10374                    __r.deprecated = v;
10375                }
10376                if let ::core::option::Option::Some(v) = __f_weak {
10377                    __r.weak = v;
10378                }
10379                if let ::core::option::Option::Some(v) = __f_debug_redact {
10380                    __r.debug_redact = v;
10381                }
10382                if let ::core::option::Option::Some(v) = __f_retention {
10383                    __r.retention = v;
10384                }
10385                if let ::core::option::Option::Some(v) = __f_targets {
10386                    __r.targets = v;
10387                }
10388                if let ::core::option::Option::Some(v) = __f_edition_defaults {
10389                    __r.edition_defaults = v;
10390                }
10391                if let ::core::option::Option::Some(v) = __f_features {
10392                    __r.features = v;
10393                }
10394                if let ::core::option::Option::Some(v) = __f_feature_support {
10395                    __r.feature_support = v;
10396                }
10397                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
10398                    __r.uninterpreted_option = v;
10399                }
10400                for __rec in __ext_records {
10401                    __r.__buffa_unknown_fields.push(__rec);
10402                }
10403                Ok(__r)
10404            }
10405        }
10406        d.deserialize_map(_V)
10407    }
10408}
10409#[cfg(feature = "json")]
10410impl ::buffa::json_helpers::ProtoElemJson for FieldOptions {
10411    fn serialize_proto_json<S: ::serde::Serializer>(
10412        v: &Self,
10413        s: S,
10414    ) -> ::core::result::Result<S::Ok, S::Error> {
10415        ::serde::Serialize::serialize(v, s)
10416    }
10417    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10418        d: D,
10419    ) -> ::core::result::Result<Self, D::Error> {
10420        <Self as ::serde::Deserialize>::deserialize(d)
10421    }
10422}
10423#[doc(hidden)]
10424#[derive(Clone, Debug, Default, PartialEq)]
10425#[repr(transparent)]
10426#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10427pub struct __FieldOptionsExtJson(pub ::buffa::UnknownFields);
10428impl ::core::ops::Deref for __FieldOptionsExtJson {
10429    type Target = ::buffa::UnknownFields;
10430    fn deref(&self) -> &::buffa::UnknownFields {
10431        &self.0
10432    }
10433}
10434impl ::core::ops::DerefMut for __FieldOptionsExtJson {
10435    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
10436        &mut self.0
10437    }
10438}
10439impl ::core::convert::From<::buffa::UnknownFields> for __FieldOptionsExtJson {
10440    fn from(u: ::buffa::UnknownFields) -> Self {
10441        Self(u)
10442    }
10443}
10444#[cfg(feature = "json")]
10445impl ::serde::Serialize for __FieldOptionsExtJson {
10446    fn serialize<S: ::serde::Serializer>(
10447        &self,
10448        s: S,
10449    ) -> ::core::result::Result<S::Ok, S::Error> {
10450        ::buffa::extension_registry::serialize_extensions(
10451            "google.protobuf.FieldOptions",
10452            &self.0,
10453            s,
10454        )
10455    }
10456}
10457#[cfg(feature = "json")]
10458impl<'de> ::serde::Deserialize<'de> for __FieldOptionsExtJson {
10459    fn deserialize<D: ::serde::Deserializer<'de>>(
10460        d: D,
10461    ) -> ::core::result::Result<Self, D::Error> {
10462        ::buffa::extension_registry::deserialize_extensions(
10463                "google.protobuf.FieldOptions",
10464                d,
10465            )
10466            .map(Self)
10467    }
10468}
10469#[cfg(feature = "json")]
10470#[doc(hidden)]
10471pub const __FIELD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10472    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10473    to_json: ::buffa::type_registry::any_to_json::<FieldOptions>,
10474    from_json: ::buffa::type_registry::any_from_json::<FieldOptions>,
10475    is_wkt: false,
10476};
10477#[cfg(feature = "text")]
10478#[doc(hidden)]
10479pub const __FIELD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
10480    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10481    text_encode: ::buffa::type_registry::any_encode_text::<FieldOptions>,
10482    text_merge: ::buffa::type_registry::any_merge_text::<FieldOptions>,
10483};
10484pub mod field_options {
10485    #[allow(unused_imports)]
10486    use super::*;
10487    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10488    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10489    #[repr(i32)]
10490    pub enum CType {
10491        /// Default mode.
10492        STRING = 0i32,
10493        /// The option \[ctype=CORD\] may be applied to a non-repeated field of type
10494        /// "bytes". It indicates that in C++, the data should be stored in a Cord
10495        /// instead of a string.  For very large strings, this may reduce memory
10496        /// fragmentation. It may also allow better performance when parsing from a
10497        /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then
10498        /// alias the original buffer.
10499        CORD = 1i32,
10500        STRING_PIECE = 2i32,
10501    }
10502    impl CType {
10503        ///Idiomatic alias for [`Self::STRING`]; `Debug` prints the variant name.
10504        #[allow(non_upper_case_globals)]
10505        pub const String: Self = Self::STRING;
10506        ///Idiomatic alias for [`Self::CORD`]; `Debug` prints the variant name.
10507        #[allow(non_upper_case_globals)]
10508        pub const Cord: Self = Self::CORD;
10509        ///Idiomatic alias for [`Self::STRING_PIECE`]; `Debug` prints the variant name.
10510        #[allow(non_upper_case_globals)]
10511        pub const StringPiece: Self = Self::STRING_PIECE;
10512    }
10513    impl ::core::default::Default for CType {
10514        fn default() -> Self {
10515            Self::STRING
10516        }
10517    }
10518    #[cfg(feature = "json")]
10519    const _: () = {
10520        impl ::serde::Serialize for CType {
10521            fn serialize<S: ::serde::Serializer>(
10522                &self,
10523                s: S,
10524            ) -> ::core::result::Result<S::Ok, S::Error> {
10525                s.serialize_str(::buffa::Enumeration::proto_name(self))
10526            }
10527        }
10528        impl<'de> ::serde::Deserialize<'de> for CType {
10529            fn deserialize<D: ::serde::Deserializer<'de>>(
10530                d: D,
10531            ) -> ::core::result::Result<Self, D::Error> {
10532                struct _V;
10533                impl ::serde::de::Visitor<'_> for _V {
10534                    type Value = CType;
10535                    fn expecting(
10536                        &self,
10537                        f: &mut ::core::fmt::Formatter<'_>,
10538                    ) -> ::core::fmt::Result {
10539                        f.write_str(
10540                            concat!("a string, integer, or null for ", stringify!(CType)),
10541                        )
10542                    }
10543                    fn visit_str<E: ::serde::de::Error>(
10544                        self,
10545                        v: &str,
10546                    ) -> ::core::result::Result<CType, E> {
10547                        <CType as ::buffa::Enumeration>::from_proto_name(v)
10548                            .ok_or_else(|| {
10549                                ::serde::de::Error::unknown_variant(v, &[])
10550                            })
10551                    }
10552                    fn visit_i64<E: ::serde::de::Error>(
10553                        self,
10554                        v: i64,
10555                    ) -> ::core::result::Result<CType, E> {
10556                        let v32 = i32::try_from(v)
10557                            .map_err(|_| {
10558                                ::serde::de::Error::custom(
10559                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10560                                )
10561                            })?;
10562                        <CType as ::buffa::Enumeration>::from_i32(v32)
10563                            .ok_or_else(|| {
10564                                ::serde::de::Error::custom(
10565                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10566                                )
10567                            })
10568                    }
10569                    fn visit_u64<E: ::serde::de::Error>(
10570                        self,
10571                        v: u64,
10572                    ) -> ::core::result::Result<CType, E> {
10573                        let v32 = i32::try_from(v)
10574                            .map_err(|_| {
10575                                ::serde::de::Error::custom(
10576                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10577                                )
10578                            })?;
10579                        <CType as ::buffa::Enumeration>::from_i32(v32)
10580                            .ok_or_else(|| {
10581                                ::serde::de::Error::custom(
10582                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10583                                )
10584                            })
10585                    }
10586                    fn visit_unit<E: ::serde::de::Error>(
10587                        self,
10588                    ) -> ::core::result::Result<CType, E> {
10589                        ::core::result::Result::Ok(::core::default::Default::default())
10590                    }
10591                }
10592                d.deserialize_any(_V)
10593            }
10594        }
10595        impl ::buffa::json_helpers::ProtoElemJson for CType {
10596            fn serialize_proto_json<S: ::serde::Serializer>(
10597                v: &Self,
10598                s: S,
10599            ) -> ::core::result::Result<S::Ok, S::Error> {
10600                ::serde::Serialize::serialize(v, s)
10601            }
10602            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10603                d: D,
10604            ) -> ::core::result::Result<Self, D::Error> {
10605                <Self as ::serde::Deserialize>::deserialize(d)
10606            }
10607        }
10608    };
10609    impl ::buffa::Enumeration for CType {
10610        fn from_i32(value: i32) -> ::core::option::Option<Self> {
10611            match value {
10612                0i32 => ::core::option::Option::Some(Self::STRING),
10613                1i32 => ::core::option::Option::Some(Self::CORD),
10614                2i32 => ::core::option::Option::Some(Self::STRING_PIECE),
10615                _ => ::core::option::Option::None,
10616            }
10617        }
10618        fn to_i32(&self) -> i32 {
10619            *self as i32
10620        }
10621        fn proto_name(&self) -> &'static str {
10622            match self {
10623                Self::STRING => "STRING",
10624                Self::CORD => "CORD",
10625                Self::STRING_PIECE => "STRING_PIECE",
10626            }
10627        }
10628        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
10629            match name {
10630                "STRING" => ::core::option::Option::Some(Self::STRING),
10631                "CORD" => ::core::option::Option::Some(Self::CORD),
10632                "STRING_PIECE" => ::core::option::Option::Some(Self::STRING_PIECE),
10633                _ => ::core::option::Option::None,
10634            }
10635        }
10636        fn values() -> &'static [Self] {
10637            &[Self::STRING, Self::CORD, Self::STRING_PIECE]
10638        }
10639    }
10640    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10641    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10642    #[repr(i32)]
10643    pub enum JSType {
10644        /// Use the default type.
10645        JS_NORMAL = 0i32,
10646        /// Use JavaScript strings.
10647        JS_STRING = 1i32,
10648        /// Use JavaScript numbers.
10649        JS_NUMBER = 2i32,
10650    }
10651    impl JSType {
10652        ///Idiomatic alias for [`Self::JS_NORMAL`]; `Debug` prints the variant name.
10653        #[allow(non_upper_case_globals)]
10654        pub const JsNormal: Self = Self::JS_NORMAL;
10655        ///Idiomatic alias for [`Self::JS_STRING`]; `Debug` prints the variant name.
10656        #[allow(non_upper_case_globals)]
10657        pub const JsString: Self = Self::JS_STRING;
10658        ///Idiomatic alias for [`Self::JS_NUMBER`]; `Debug` prints the variant name.
10659        #[allow(non_upper_case_globals)]
10660        pub const JsNumber: Self = Self::JS_NUMBER;
10661    }
10662    impl ::core::default::Default for JSType {
10663        fn default() -> Self {
10664            Self::JS_NORMAL
10665        }
10666    }
10667    #[cfg(feature = "json")]
10668    const _: () = {
10669        impl ::serde::Serialize for JSType {
10670            fn serialize<S: ::serde::Serializer>(
10671                &self,
10672                s: S,
10673            ) -> ::core::result::Result<S::Ok, S::Error> {
10674                s.serialize_str(::buffa::Enumeration::proto_name(self))
10675            }
10676        }
10677        impl<'de> ::serde::Deserialize<'de> for JSType {
10678            fn deserialize<D: ::serde::Deserializer<'de>>(
10679                d: D,
10680            ) -> ::core::result::Result<Self, D::Error> {
10681                struct _V;
10682                impl ::serde::de::Visitor<'_> for _V {
10683                    type Value = JSType;
10684                    fn expecting(
10685                        &self,
10686                        f: &mut ::core::fmt::Formatter<'_>,
10687                    ) -> ::core::fmt::Result {
10688                        f.write_str(
10689                            concat!(
10690                                "a string, integer, or null for ", stringify!(JSType)
10691                            ),
10692                        )
10693                    }
10694                    fn visit_str<E: ::serde::de::Error>(
10695                        self,
10696                        v: &str,
10697                    ) -> ::core::result::Result<JSType, E> {
10698                        <JSType as ::buffa::Enumeration>::from_proto_name(v)
10699                            .ok_or_else(|| {
10700                                ::serde::de::Error::unknown_variant(v, &[])
10701                            })
10702                    }
10703                    fn visit_i64<E: ::serde::de::Error>(
10704                        self,
10705                        v: i64,
10706                    ) -> ::core::result::Result<JSType, E> {
10707                        let v32 = i32::try_from(v)
10708                            .map_err(|_| {
10709                                ::serde::de::Error::custom(
10710                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10711                                )
10712                            })?;
10713                        <JSType as ::buffa::Enumeration>::from_i32(v32)
10714                            .ok_or_else(|| {
10715                                ::serde::de::Error::custom(
10716                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10717                                )
10718                            })
10719                    }
10720                    fn visit_u64<E: ::serde::de::Error>(
10721                        self,
10722                        v: u64,
10723                    ) -> ::core::result::Result<JSType, E> {
10724                        let v32 = i32::try_from(v)
10725                            .map_err(|_| {
10726                                ::serde::de::Error::custom(
10727                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10728                                )
10729                            })?;
10730                        <JSType as ::buffa::Enumeration>::from_i32(v32)
10731                            .ok_or_else(|| {
10732                                ::serde::de::Error::custom(
10733                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10734                                )
10735                            })
10736                    }
10737                    fn visit_unit<E: ::serde::de::Error>(
10738                        self,
10739                    ) -> ::core::result::Result<JSType, E> {
10740                        ::core::result::Result::Ok(::core::default::Default::default())
10741                    }
10742                }
10743                d.deserialize_any(_V)
10744            }
10745        }
10746        impl ::buffa::json_helpers::ProtoElemJson for JSType {
10747            fn serialize_proto_json<S: ::serde::Serializer>(
10748                v: &Self,
10749                s: S,
10750            ) -> ::core::result::Result<S::Ok, S::Error> {
10751                ::serde::Serialize::serialize(v, s)
10752            }
10753            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10754                d: D,
10755            ) -> ::core::result::Result<Self, D::Error> {
10756                <Self as ::serde::Deserialize>::deserialize(d)
10757            }
10758        }
10759    };
10760    impl ::buffa::Enumeration for JSType {
10761        fn from_i32(value: i32) -> ::core::option::Option<Self> {
10762            match value {
10763                0i32 => ::core::option::Option::Some(Self::JS_NORMAL),
10764                1i32 => ::core::option::Option::Some(Self::JS_STRING),
10765                2i32 => ::core::option::Option::Some(Self::JS_NUMBER),
10766                _ => ::core::option::Option::None,
10767            }
10768        }
10769        fn to_i32(&self) -> i32 {
10770            *self as i32
10771        }
10772        fn proto_name(&self) -> &'static str {
10773            match self {
10774                Self::JS_NORMAL => "JS_NORMAL",
10775                Self::JS_STRING => "JS_STRING",
10776                Self::JS_NUMBER => "JS_NUMBER",
10777            }
10778        }
10779        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
10780            match name {
10781                "JS_NORMAL" => ::core::option::Option::Some(Self::JS_NORMAL),
10782                "JS_STRING" => ::core::option::Option::Some(Self::JS_STRING),
10783                "JS_NUMBER" => ::core::option::Option::Some(Self::JS_NUMBER),
10784                _ => ::core::option::Option::None,
10785            }
10786        }
10787        fn values() -> &'static [Self] {
10788            &[Self::JS_NORMAL, Self::JS_STRING, Self::JS_NUMBER]
10789        }
10790    }
10791    /// If set to RETENTION_SOURCE, the option will be omitted from the binary.
10792    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10793    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10794    #[repr(i32)]
10795    pub enum OptionRetention {
10796        RETENTION_UNKNOWN = 0i32,
10797        RETENTION_RUNTIME = 1i32,
10798        RETENTION_SOURCE = 2i32,
10799    }
10800    impl OptionRetention {
10801        ///Idiomatic alias for [`Self::RETENTION_UNKNOWN`]; `Debug` prints the variant name.
10802        #[allow(non_upper_case_globals)]
10803        pub const RetentionUnknown: Self = Self::RETENTION_UNKNOWN;
10804        ///Idiomatic alias for [`Self::RETENTION_RUNTIME`]; `Debug` prints the variant name.
10805        #[allow(non_upper_case_globals)]
10806        pub const RetentionRuntime: Self = Self::RETENTION_RUNTIME;
10807        ///Idiomatic alias for [`Self::RETENTION_SOURCE`]; `Debug` prints the variant name.
10808        #[allow(non_upper_case_globals)]
10809        pub const RetentionSource: Self = Self::RETENTION_SOURCE;
10810    }
10811    impl ::core::default::Default for OptionRetention {
10812        fn default() -> Self {
10813            Self::RETENTION_UNKNOWN
10814        }
10815    }
10816    #[cfg(feature = "json")]
10817    const _: () = {
10818        impl ::serde::Serialize for OptionRetention {
10819            fn serialize<S: ::serde::Serializer>(
10820                &self,
10821                s: S,
10822            ) -> ::core::result::Result<S::Ok, S::Error> {
10823                s.serialize_str(::buffa::Enumeration::proto_name(self))
10824            }
10825        }
10826        impl<'de> ::serde::Deserialize<'de> for OptionRetention {
10827            fn deserialize<D: ::serde::Deserializer<'de>>(
10828                d: D,
10829            ) -> ::core::result::Result<Self, D::Error> {
10830                struct _V;
10831                impl ::serde::de::Visitor<'_> for _V {
10832                    type Value = OptionRetention;
10833                    fn expecting(
10834                        &self,
10835                        f: &mut ::core::fmt::Formatter<'_>,
10836                    ) -> ::core::fmt::Result {
10837                        f.write_str(
10838                            concat!(
10839                                "a string, integer, or null for ",
10840                                stringify!(OptionRetention)
10841                            ),
10842                        )
10843                    }
10844                    fn visit_str<E: ::serde::de::Error>(
10845                        self,
10846                        v: &str,
10847                    ) -> ::core::result::Result<OptionRetention, E> {
10848                        <OptionRetention as ::buffa::Enumeration>::from_proto_name(v)
10849                            .ok_or_else(|| {
10850                                ::serde::de::Error::unknown_variant(v, &[])
10851                            })
10852                    }
10853                    fn visit_i64<E: ::serde::de::Error>(
10854                        self,
10855                        v: i64,
10856                    ) -> ::core::result::Result<OptionRetention, E> {
10857                        let v32 = i32::try_from(v)
10858                            .map_err(|_| {
10859                                ::serde::de::Error::custom(
10860                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10861                                )
10862                            })?;
10863                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
10864                            .ok_or_else(|| {
10865                                ::serde::de::Error::custom(
10866                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10867                                )
10868                            })
10869                    }
10870                    fn visit_u64<E: ::serde::de::Error>(
10871                        self,
10872                        v: u64,
10873                    ) -> ::core::result::Result<OptionRetention, E> {
10874                        let v32 = i32::try_from(v)
10875                            .map_err(|_| {
10876                                ::serde::de::Error::custom(
10877                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10878                                )
10879                            })?;
10880                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
10881                            .ok_or_else(|| {
10882                                ::serde::de::Error::custom(
10883                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10884                                )
10885                            })
10886                    }
10887                    fn visit_unit<E: ::serde::de::Error>(
10888                        self,
10889                    ) -> ::core::result::Result<OptionRetention, E> {
10890                        ::core::result::Result::Ok(::core::default::Default::default())
10891                    }
10892                }
10893                d.deserialize_any(_V)
10894            }
10895        }
10896        impl ::buffa::json_helpers::ProtoElemJson for OptionRetention {
10897            fn serialize_proto_json<S: ::serde::Serializer>(
10898                v: &Self,
10899                s: S,
10900            ) -> ::core::result::Result<S::Ok, S::Error> {
10901                ::serde::Serialize::serialize(v, s)
10902            }
10903            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10904                d: D,
10905            ) -> ::core::result::Result<Self, D::Error> {
10906                <Self as ::serde::Deserialize>::deserialize(d)
10907            }
10908        }
10909    };
10910    impl ::buffa::Enumeration for OptionRetention {
10911        fn from_i32(value: i32) -> ::core::option::Option<Self> {
10912            match value {
10913                0i32 => ::core::option::Option::Some(Self::RETENTION_UNKNOWN),
10914                1i32 => ::core::option::Option::Some(Self::RETENTION_RUNTIME),
10915                2i32 => ::core::option::Option::Some(Self::RETENTION_SOURCE),
10916                _ => ::core::option::Option::None,
10917            }
10918        }
10919        fn to_i32(&self) -> i32 {
10920            *self as i32
10921        }
10922        fn proto_name(&self) -> &'static str {
10923            match self {
10924                Self::RETENTION_UNKNOWN => "RETENTION_UNKNOWN",
10925                Self::RETENTION_RUNTIME => "RETENTION_RUNTIME",
10926                Self::RETENTION_SOURCE => "RETENTION_SOURCE",
10927            }
10928        }
10929        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
10930            match name {
10931                "RETENTION_UNKNOWN" => {
10932                    ::core::option::Option::Some(Self::RETENTION_UNKNOWN)
10933                }
10934                "RETENTION_RUNTIME" => {
10935                    ::core::option::Option::Some(Self::RETENTION_RUNTIME)
10936                }
10937                "RETENTION_SOURCE" => {
10938                    ::core::option::Option::Some(Self::RETENTION_SOURCE)
10939                }
10940                _ => ::core::option::Option::None,
10941            }
10942        }
10943        fn values() -> &'static [Self] {
10944            &[Self::RETENTION_UNKNOWN, Self::RETENTION_RUNTIME, Self::RETENTION_SOURCE]
10945        }
10946    }
10947    /// This indicates the types of entities that the field may apply to when used
10948    /// as an option. If it is unset, then the field may be freely used as an
10949    /// option on any kind of entity.
10950    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10951    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10952    #[repr(i32)]
10953    pub enum OptionTargetType {
10954        TARGET_TYPE_UNKNOWN = 0i32,
10955        TARGET_TYPE_FILE = 1i32,
10956        TARGET_TYPE_EXTENSION_RANGE = 2i32,
10957        TARGET_TYPE_MESSAGE = 3i32,
10958        TARGET_TYPE_FIELD = 4i32,
10959        TARGET_TYPE_ONEOF = 5i32,
10960        TARGET_TYPE_ENUM = 6i32,
10961        TARGET_TYPE_ENUM_ENTRY = 7i32,
10962        TARGET_TYPE_SERVICE = 8i32,
10963        TARGET_TYPE_METHOD = 9i32,
10964    }
10965    impl OptionTargetType {
10966        ///Idiomatic alias for [`Self::TARGET_TYPE_UNKNOWN`]; `Debug` prints the variant name.
10967        #[allow(non_upper_case_globals)]
10968        pub const TargetTypeUnknown: Self = Self::TARGET_TYPE_UNKNOWN;
10969        ///Idiomatic alias for [`Self::TARGET_TYPE_FILE`]; `Debug` prints the variant name.
10970        #[allow(non_upper_case_globals)]
10971        pub const TargetTypeFile: Self = Self::TARGET_TYPE_FILE;
10972        ///Idiomatic alias for [`Self::TARGET_TYPE_EXTENSION_RANGE`]; `Debug` prints the variant name.
10973        #[allow(non_upper_case_globals)]
10974        pub const TargetTypeExtensionRange: Self = Self::TARGET_TYPE_EXTENSION_RANGE;
10975        ///Idiomatic alias for [`Self::TARGET_TYPE_MESSAGE`]; `Debug` prints the variant name.
10976        #[allow(non_upper_case_globals)]
10977        pub const TargetTypeMessage: Self = Self::TARGET_TYPE_MESSAGE;
10978        ///Idiomatic alias for [`Self::TARGET_TYPE_FIELD`]; `Debug` prints the variant name.
10979        #[allow(non_upper_case_globals)]
10980        pub const TargetTypeField: Self = Self::TARGET_TYPE_FIELD;
10981        ///Idiomatic alias for [`Self::TARGET_TYPE_ONEOF`]; `Debug` prints the variant name.
10982        #[allow(non_upper_case_globals)]
10983        pub const TargetTypeOneof: Self = Self::TARGET_TYPE_ONEOF;
10984        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM`]; `Debug` prints the variant name.
10985        #[allow(non_upper_case_globals)]
10986        pub const TargetTypeEnum: Self = Self::TARGET_TYPE_ENUM;
10987        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM_ENTRY`]; `Debug` prints the variant name.
10988        #[allow(non_upper_case_globals)]
10989        pub const TargetTypeEnumEntry: Self = Self::TARGET_TYPE_ENUM_ENTRY;
10990        ///Idiomatic alias for [`Self::TARGET_TYPE_SERVICE`]; `Debug` prints the variant name.
10991        #[allow(non_upper_case_globals)]
10992        pub const TargetTypeService: Self = Self::TARGET_TYPE_SERVICE;
10993        ///Idiomatic alias for [`Self::TARGET_TYPE_METHOD`]; `Debug` prints the variant name.
10994        #[allow(non_upper_case_globals)]
10995        pub const TargetTypeMethod: Self = Self::TARGET_TYPE_METHOD;
10996    }
10997    impl ::core::default::Default for OptionTargetType {
10998        fn default() -> Self {
10999            Self::TARGET_TYPE_UNKNOWN
11000        }
11001    }
11002    #[cfg(feature = "json")]
11003    const _: () = {
11004        impl ::serde::Serialize for OptionTargetType {
11005            fn serialize<S: ::serde::Serializer>(
11006                &self,
11007                s: S,
11008            ) -> ::core::result::Result<S::Ok, S::Error> {
11009                s.serialize_str(::buffa::Enumeration::proto_name(self))
11010            }
11011        }
11012        impl<'de> ::serde::Deserialize<'de> for OptionTargetType {
11013            fn deserialize<D: ::serde::Deserializer<'de>>(
11014                d: D,
11015            ) -> ::core::result::Result<Self, D::Error> {
11016                struct _V;
11017                impl ::serde::de::Visitor<'_> for _V {
11018                    type Value = OptionTargetType;
11019                    fn expecting(
11020                        &self,
11021                        f: &mut ::core::fmt::Formatter<'_>,
11022                    ) -> ::core::fmt::Result {
11023                        f.write_str(
11024                            concat!(
11025                                "a string, integer, or null for ",
11026                                stringify!(OptionTargetType)
11027                            ),
11028                        )
11029                    }
11030                    fn visit_str<E: ::serde::de::Error>(
11031                        self,
11032                        v: &str,
11033                    ) -> ::core::result::Result<OptionTargetType, E> {
11034                        <OptionTargetType as ::buffa::Enumeration>::from_proto_name(v)
11035                            .ok_or_else(|| {
11036                                ::serde::de::Error::unknown_variant(v, &[])
11037                            })
11038                    }
11039                    fn visit_i64<E: ::serde::de::Error>(
11040                        self,
11041                        v: i64,
11042                    ) -> ::core::result::Result<OptionTargetType, E> {
11043                        let v32 = i32::try_from(v)
11044                            .map_err(|_| {
11045                                ::serde::de::Error::custom(
11046                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11047                                )
11048                            })?;
11049                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11050                            .ok_or_else(|| {
11051                                ::serde::de::Error::custom(
11052                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11053                                )
11054                            })
11055                    }
11056                    fn visit_u64<E: ::serde::de::Error>(
11057                        self,
11058                        v: u64,
11059                    ) -> ::core::result::Result<OptionTargetType, E> {
11060                        let v32 = i32::try_from(v)
11061                            .map_err(|_| {
11062                                ::serde::de::Error::custom(
11063                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11064                                )
11065                            })?;
11066                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11067                            .ok_or_else(|| {
11068                                ::serde::de::Error::custom(
11069                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11070                                )
11071                            })
11072                    }
11073                    fn visit_unit<E: ::serde::de::Error>(
11074                        self,
11075                    ) -> ::core::result::Result<OptionTargetType, E> {
11076                        ::core::result::Result::Ok(::core::default::Default::default())
11077                    }
11078                }
11079                d.deserialize_any(_V)
11080            }
11081        }
11082        impl ::buffa::json_helpers::ProtoElemJson for OptionTargetType {
11083            fn serialize_proto_json<S: ::serde::Serializer>(
11084                v: &Self,
11085                s: S,
11086            ) -> ::core::result::Result<S::Ok, S::Error> {
11087                ::serde::Serialize::serialize(v, s)
11088            }
11089            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11090                d: D,
11091            ) -> ::core::result::Result<Self, D::Error> {
11092                <Self as ::serde::Deserialize>::deserialize(d)
11093            }
11094        }
11095    };
11096    impl ::buffa::Enumeration for OptionTargetType {
11097        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11098            match value {
11099                0i32 => ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
11100                1i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FILE),
11101                2i32 => ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE),
11102                3i32 => ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
11103                4i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FIELD),
11104                5i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF),
11105                6i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM),
11106                7i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
11107                8i32 => ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE),
11108                9i32 => ::core::option::Option::Some(Self::TARGET_TYPE_METHOD),
11109                _ => ::core::option::Option::None,
11110            }
11111        }
11112        fn to_i32(&self) -> i32 {
11113            *self as i32
11114        }
11115        fn proto_name(&self) -> &'static str {
11116            match self {
11117                Self::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN",
11118                Self::TARGET_TYPE_FILE => "TARGET_TYPE_FILE",
11119                Self::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE",
11120                Self::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE",
11121                Self::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD",
11122                Self::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF",
11123                Self::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM",
11124                Self::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY",
11125                Self::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE",
11126                Self::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD",
11127            }
11128        }
11129        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11130            match name {
11131                "TARGET_TYPE_UNKNOWN" => {
11132                    ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN)
11133                }
11134                "TARGET_TYPE_FILE" => {
11135                    ::core::option::Option::Some(Self::TARGET_TYPE_FILE)
11136                }
11137                "TARGET_TYPE_EXTENSION_RANGE" => {
11138                    ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
11139                }
11140                "TARGET_TYPE_MESSAGE" => {
11141                    ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE)
11142                }
11143                "TARGET_TYPE_FIELD" => {
11144                    ::core::option::Option::Some(Self::TARGET_TYPE_FIELD)
11145                }
11146                "TARGET_TYPE_ONEOF" => {
11147                    ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF)
11148                }
11149                "TARGET_TYPE_ENUM" => {
11150                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM)
11151                }
11152                "TARGET_TYPE_ENUM_ENTRY" => {
11153                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY)
11154                }
11155                "TARGET_TYPE_SERVICE" => {
11156                    ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE)
11157                }
11158                "TARGET_TYPE_METHOD" => {
11159                    ::core::option::Option::Some(Self::TARGET_TYPE_METHOD)
11160                }
11161                _ => ::core::option::Option::None,
11162            }
11163        }
11164        fn values() -> &'static [Self] {
11165            &[
11166                Self::TARGET_TYPE_UNKNOWN,
11167                Self::TARGET_TYPE_FILE,
11168                Self::TARGET_TYPE_EXTENSION_RANGE,
11169                Self::TARGET_TYPE_MESSAGE,
11170                Self::TARGET_TYPE_FIELD,
11171                Self::TARGET_TYPE_ONEOF,
11172                Self::TARGET_TYPE_ENUM,
11173                Self::TARGET_TYPE_ENUM_ENTRY,
11174                Self::TARGET_TYPE_SERVICE,
11175                Self::TARGET_TYPE_METHOD,
11176            ]
11177        }
11178    }
11179    #[derive(Clone, PartialEq, Default)]
11180    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11181    #[cfg_attr(feature = "json", serde(default))]
11182    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11183    pub struct EditionDefault {
11184        /// Field 3: `edition`
11185        #[cfg_attr(
11186            feature = "json",
11187            serde(
11188                rename = "edition",
11189                with = "::buffa::json_helpers::opt_closed_enum",
11190                skip_serializing_if = "::core::option::Option::is_none"
11191            )
11192        )]
11193        pub edition: ::core::option::Option<super::Edition>,
11194        /// Textproto value.
11195        ///
11196        /// Field 2: `value`
11197        #[cfg_attr(
11198            feature = "json",
11199            serde(
11200                rename = "value",
11201                skip_serializing_if = "::core::option::Option::is_none"
11202            )
11203        )]
11204        pub value: ::core::option::Option<::buffa::alloc::string::String>,
11205        #[cfg_attr(feature = "json", serde(skip))]
11206        #[doc(hidden)]
11207        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11208    }
11209    impl ::core::fmt::Debug for EditionDefault {
11210        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11211            f.debug_struct("EditionDefault")
11212                .field("edition", &self.edition)
11213                .field("value", &self.value)
11214                .finish()
11215        }
11216    }
11217    impl EditionDefault {
11218        /// Protobuf type URL for this message, for use with `Any::pack` and
11219        /// `Any::unpack_if`.
11220        ///
11221        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11222        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11223    }
11224    impl EditionDefault {
11225        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11226        #[inline]
11227        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
11228        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
11229            self.edition = Some(value.into());
11230            self
11231        }
11232        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11233        #[inline]
11234        ///Sets [`Self::value`] to `Some(value)`, consuming and returning `self`.
11235        pub fn with_value(
11236            mut self,
11237            value: impl Into<::buffa::alloc::string::String>,
11238        ) -> Self {
11239            self.value = Some(value.into());
11240            self
11241        }
11242    }
11243    ::buffa::impl_default_instance!(EditionDefault);
11244    impl ::buffa::MessageName for EditionDefault {
11245        const PACKAGE: &'static str = "google.protobuf";
11246        const NAME: &'static str = "FieldOptions.EditionDefault";
11247        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11248        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11249    }
11250    impl ::buffa::Message for EditionDefault {
11251        /// Returns the total encoded size in bytes.
11252        ///
11253        /// The result is a `u32`; the protobuf specification requires all
11254        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11255        /// compliant message will never overflow this type.
11256        #[allow(clippy::let_and_return)]
11257        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11258            #[allow(unused_imports)]
11259            use ::buffa::Enumeration as _;
11260            let mut size = 0u32;
11261            if let Some(ref v) = self.value {
11262                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
11263            }
11264            if let Some(ref v) = self.edition {
11265                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
11266            }
11267            size += self.__buffa_unknown_fields.encoded_len() as u32;
11268            size
11269        }
11270        fn write_to(
11271            &self,
11272            _cache: &mut ::buffa::SizeCache,
11273            buf: &mut impl ::buffa::bytes::BufMut,
11274        ) {
11275            #[allow(unused_imports)]
11276            use ::buffa::Enumeration as _;
11277            if let Some(ref v) = self.value {
11278                ::buffa::types::put_string_field(2u32, v, buf);
11279            }
11280            if let Some(ref v) = self.edition {
11281                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
11282            }
11283            self.__buffa_unknown_fields.write_to(buf);
11284        }
11285        fn merge_field(
11286            &mut self,
11287            tag: ::buffa::encoding::Tag,
11288            buf: &mut impl ::buffa::bytes::Buf,
11289            ctx: ::buffa::DecodeContext<'_>,
11290        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11291            #[allow(unused_imports)]
11292            use ::buffa::bytes::Buf as _;
11293            #[allow(unused_imports)]
11294            use ::buffa::Enumeration as _;
11295            match tag.field_number() {
11296                2u32 => {
11297                    ::buffa::encoding::check_wire_type(
11298                        tag,
11299                        ::buffa::encoding::WireType::LengthDelimited,
11300                    )?;
11301                    ::buffa::types::merge_string(
11302                        self
11303                            .value
11304                            .get_or_insert_with(::buffa::alloc::string::String::new),
11305                        buf,
11306                    )?;
11307                }
11308                3u32 => {
11309                    ::buffa::encoding::check_wire_type(
11310                        tag,
11311                        ::buffa::encoding::WireType::Varint,
11312                    )?;
11313                    let __raw = ::buffa::types::decode_int32(buf)?;
11314                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11315                        __raw,
11316                    ) {
11317                        self.edition = ::core::option::Option::Some(__v);
11318                    } else {
11319                        self.__buffa_unknown_fields
11320                            .push(::buffa::UnknownField {
11321                                number: 3u32,
11322                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11323                            });
11324                    }
11325                }
11326                _ => {
11327                    self.__buffa_unknown_fields
11328                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11329                }
11330            }
11331            ::core::result::Result::Ok(())
11332        }
11333        fn clear(&mut self) {
11334            self.value = ::core::option::Option::None;
11335            self.edition = ::core::option::Option::None;
11336            self.__buffa_unknown_fields.clear();
11337        }
11338    }
11339    impl ::buffa::ExtensionSet for EditionDefault {
11340        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11341        fn unknown_fields(&self) -> &::buffa::UnknownFields {
11342            &self.__buffa_unknown_fields
11343        }
11344        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11345            &mut self.__buffa_unknown_fields
11346        }
11347    }
11348    #[cfg(feature = "text")]
11349    impl ::buffa::text::TextFormat for EditionDefault {
11350        fn encode_text(
11351            &self,
11352            enc: &mut ::buffa::text::TextEncoder<'_>,
11353        ) -> ::core::fmt::Result {
11354            #[allow(unused_imports)]
11355            use ::buffa::Enumeration as _;
11356            if let ::core::option::Option::Some(ref __v) = self.edition {
11357                enc.write_field_name("edition")?;
11358                enc.write_enum_name(__v.proto_name())?;
11359            }
11360            if let ::core::option::Option::Some(ref __v) = self.value {
11361                enc.write_field_name("value")?;
11362                enc.write_string(__v)?;
11363            }
11364            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
11365            ::core::result::Result::Ok(())
11366        }
11367        fn merge_text(
11368            &mut self,
11369            dec: &mut ::buffa::text::TextDecoder<'_>,
11370        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
11371            #[allow(unused_imports)]
11372            use ::buffa::Enumeration as _;
11373            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
11374                match __name {
11375                    "edition" => {
11376                        self.edition = ::core::option::Option::Some(
11377                            dec.read_closed_enum_by_name::<super::Edition>()?,
11378                        );
11379                    }
11380                    "value" => {
11381                        self.value = ::core::option::Option::Some(
11382                            dec.read_string()?.into_owned(),
11383                        );
11384                    }
11385                    _ => dec.skip_value()?,
11386                }
11387            }
11388            ::core::result::Result::Ok(())
11389        }
11390    }
11391    #[cfg(feature = "json")]
11392    impl ::buffa::json_helpers::ProtoElemJson for EditionDefault {
11393        fn serialize_proto_json<S: ::serde::Serializer>(
11394            v: &Self,
11395            s: S,
11396        ) -> ::core::result::Result<S::Ok, S::Error> {
11397            ::serde::Serialize::serialize(v, s)
11398        }
11399        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11400            d: D,
11401        ) -> ::core::result::Result<Self, D::Error> {
11402            <Self as ::serde::Deserialize>::deserialize(d)
11403        }
11404    }
11405    #[cfg(feature = "json")]
11406    #[doc(hidden)]
11407    pub const __EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11408        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11409        to_json: ::buffa::type_registry::any_to_json::<EditionDefault>,
11410        from_json: ::buffa::type_registry::any_from_json::<EditionDefault>,
11411        is_wkt: false,
11412    };
11413    #[cfg(feature = "text")]
11414    #[doc(hidden)]
11415    pub const __EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
11416        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11417        text_encode: ::buffa::type_registry::any_encode_text::<EditionDefault>,
11418        text_merge: ::buffa::type_registry::any_merge_text::<EditionDefault>,
11419    };
11420    /// Information about the support window of a feature.
11421    #[derive(Clone, PartialEq, Default)]
11422    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11423    #[cfg_attr(feature = "json", serde(default))]
11424    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11425    pub struct FeatureSupport {
11426        /// The edition that this feature was first available in.  In editions
11427        /// earlier than this one, the default assigned to EDITION_LEGACY will be
11428        /// used, and proto files will not be able to override it.
11429        ///
11430        /// Field 1: `edition_introduced`
11431        #[cfg_attr(
11432            feature = "json",
11433            serde(
11434                rename = "editionIntroduced",
11435                alias = "edition_introduced",
11436                with = "::buffa::json_helpers::opt_closed_enum",
11437                skip_serializing_if = "::core::option::Option::is_none"
11438            )
11439        )]
11440        pub edition_introduced: ::core::option::Option<super::Edition>,
11441        /// The edition this feature becomes deprecated in.  Using this after this
11442        /// edition may trigger warnings.
11443        ///
11444        /// Field 2: `edition_deprecated`
11445        #[cfg_attr(
11446            feature = "json",
11447            serde(
11448                rename = "editionDeprecated",
11449                alias = "edition_deprecated",
11450                with = "::buffa::json_helpers::opt_closed_enum",
11451                skip_serializing_if = "::core::option::Option::is_none"
11452            )
11453        )]
11454        pub edition_deprecated: ::core::option::Option<super::Edition>,
11455        /// The deprecation warning text if this feature is used after the edition it
11456        /// was marked deprecated in.
11457        ///
11458        /// Field 3: `deprecation_warning`
11459        #[cfg_attr(
11460            feature = "json",
11461            serde(
11462                rename = "deprecationWarning",
11463                alias = "deprecation_warning",
11464                skip_serializing_if = "::core::option::Option::is_none"
11465            )
11466        )]
11467        pub deprecation_warning: ::core::option::Option<::buffa::alloc::string::String>,
11468        /// The edition this feature is no longer available in.  In editions after
11469        /// this one, the last default assigned will be used, and proto files will
11470        /// not be able to override it.
11471        ///
11472        /// Field 4: `edition_removed`
11473        #[cfg_attr(
11474            feature = "json",
11475            serde(
11476                rename = "editionRemoved",
11477                alias = "edition_removed",
11478                with = "::buffa::json_helpers::opt_closed_enum",
11479                skip_serializing_if = "::core::option::Option::is_none"
11480            )
11481        )]
11482        pub edition_removed: ::core::option::Option<super::Edition>,
11483        #[cfg_attr(feature = "json", serde(skip))]
11484        #[doc(hidden)]
11485        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11486    }
11487    impl ::core::fmt::Debug for FeatureSupport {
11488        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11489            f.debug_struct("FeatureSupport")
11490                .field("edition_introduced", &self.edition_introduced)
11491                .field("edition_deprecated", &self.edition_deprecated)
11492                .field("deprecation_warning", &self.deprecation_warning)
11493                .field("edition_removed", &self.edition_removed)
11494                .finish()
11495        }
11496    }
11497    impl FeatureSupport {
11498        /// Protobuf type URL for this message, for use with `Any::pack` and
11499        /// `Any::unpack_if`.
11500        ///
11501        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11502        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11503    }
11504    impl FeatureSupport {
11505        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11506        #[inline]
11507        ///Sets [`Self::edition_introduced`] to `Some(value)`, consuming and returning `self`.
11508        pub fn with_edition_introduced(
11509            mut self,
11510            value: impl Into<super::Edition>,
11511        ) -> Self {
11512            self.edition_introduced = Some(value.into());
11513            self
11514        }
11515        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11516        #[inline]
11517        ///Sets [`Self::edition_deprecated`] to `Some(value)`, consuming and returning `self`.
11518        pub fn with_edition_deprecated(
11519            mut self,
11520            value: impl Into<super::Edition>,
11521        ) -> Self {
11522            self.edition_deprecated = Some(value.into());
11523            self
11524        }
11525        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11526        #[inline]
11527        ///Sets [`Self::deprecation_warning`] to `Some(value)`, consuming and returning `self`.
11528        pub fn with_deprecation_warning(
11529            mut self,
11530            value: impl Into<::buffa::alloc::string::String>,
11531        ) -> Self {
11532            self.deprecation_warning = Some(value.into());
11533            self
11534        }
11535        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11536        #[inline]
11537        ///Sets [`Self::edition_removed`] to `Some(value)`, consuming and returning `self`.
11538        pub fn with_edition_removed(mut self, value: impl Into<super::Edition>) -> Self {
11539            self.edition_removed = Some(value.into());
11540            self
11541        }
11542    }
11543    ::buffa::impl_default_instance!(FeatureSupport);
11544    impl ::buffa::MessageName for FeatureSupport {
11545        const PACKAGE: &'static str = "google.protobuf";
11546        const NAME: &'static str = "FieldOptions.FeatureSupport";
11547        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
11548        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11549    }
11550    impl ::buffa::Message for FeatureSupport {
11551        /// Returns the total encoded size in bytes.
11552        ///
11553        /// The result is a `u32`; the protobuf specification requires all
11554        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11555        /// compliant message will never overflow this type.
11556        #[allow(clippy::let_and_return)]
11557        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11558            #[allow(unused_imports)]
11559            use ::buffa::Enumeration as _;
11560            let mut size = 0u32;
11561            if let Some(ref v) = self.edition_introduced {
11562                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
11563            }
11564            if let Some(ref v) = self.edition_deprecated {
11565                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
11566            }
11567            if let Some(ref v) = self.deprecation_warning {
11568                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
11569            }
11570            if let Some(ref v) = self.edition_removed {
11571                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
11572            }
11573            size += self.__buffa_unknown_fields.encoded_len() as u32;
11574            size
11575        }
11576        fn write_to(
11577            &self,
11578            _cache: &mut ::buffa::SizeCache,
11579            buf: &mut impl ::buffa::bytes::BufMut,
11580        ) {
11581            #[allow(unused_imports)]
11582            use ::buffa::Enumeration as _;
11583            if let Some(ref v) = self.edition_introduced {
11584                ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
11585            }
11586            if let Some(ref v) = self.edition_deprecated {
11587                ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
11588            }
11589            if let Some(ref v) = self.deprecation_warning {
11590                ::buffa::types::put_string_field(3u32, v, buf);
11591            }
11592            if let Some(ref v) = self.edition_removed {
11593                ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
11594            }
11595            self.__buffa_unknown_fields.write_to(buf);
11596        }
11597        fn merge_field(
11598            &mut self,
11599            tag: ::buffa::encoding::Tag,
11600            buf: &mut impl ::buffa::bytes::Buf,
11601            ctx: ::buffa::DecodeContext<'_>,
11602        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11603            #[allow(unused_imports)]
11604            use ::buffa::bytes::Buf as _;
11605            #[allow(unused_imports)]
11606            use ::buffa::Enumeration as _;
11607            match tag.field_number() {
11608                1u32 => {
11609                    ::buffa::encoding::check_wire_type(
11610                        tag,
11611                        ::buffa::encoding::WireType::Varint,
11612                    )?;
11613                    let __raw = ::buffa::types::decode_int32(buf)?;
11614                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11615                        __raw,
11616                    ) {
11617                        self.edition_introduced = ::core::option::Option::Some(__v);
11618                    } else {
11619                        self.__buffa_unknown_fields
11620                            .push(::buffa::UnknownField {
11621                                number: 1u32,
11622                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11623                            });
11624                    }
11625                }
11626                2u32 => {
11627                    ::buffa::encoding::check_wire_type(
11628                        tag,
11629                        ::buffa::encoding::WireType::Varint,
11630                    )?;
11631                    let __raw = ::buffa::types::decode_int32(buf)?;
11632                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11633                        __raw,
11634                    ) {
11635                        self.edition_deprecated = ::core::option::Option::Some(__v);
11636                    } else {
11637                        self.__buffa_unknown_fields
11638                            .push(::buffa::UnknownField {
11639                                number: 2u32,
11640                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11641                            });
11642                    }
11643                }
11644                3u32 => {
11645                    ::buffa::encoding::check_wire_type(
11646                        tag,
11647                        ::buffa::encoding::WireType::LengthDelimited,
11648                    )?;
11649                    ::buffa::types::merge_string(
11650                        self
11651                            .deprecation_warning
11652                            .get_or_insert_with(::buffa::alloc::string::String::new),
11653                        buf,
11654                    )?;
11655                }
11656                4u32 => {
11657                    ::buffa::encoding::check_wire_type(
11658                        tag,
11659                        ::buffa::encoding::WireType::Varint,
11660                    )?;
11661                    let __raw = ::buffa::types::decode_int32(buf)?;
11662                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11663                        __raw,
11664                    ) {
11665                        self.edition_removed = ::core::option::Option::Some(__v);
11666                    } else {
11667                        self.__buffa_unknown_fields
11668                            .push(::buffa::UnknownField {
11669                                number: 4u32,
11670                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11671                            });
11672                    }
11673                }
11674                _ => {
11675                    self.__buffa_unknown_fields
11676                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11677                }
11678            }
11679            ::core::result::Result::Ok(())
11680        }
11681        fn clear(&mut self) {
11682            self.edition_introduced = ::core::option::Option::None;
11683            self.edition_deprecated = ::core::option::Option::None;
11684            self.deprecation_warning = ::core::option::Option::None;
11685            self.edition_removed = ::core::option::Option::None;
11686            self.__buffa_unknown_fields.clear();
11687        }
11688    }
11689    impl ::buffa::ExtensionSet for FeatureSupport {
11690        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
11691        fn unknown_fields(&self) -> &::buffa::UnknownFields {
11692            &self.__buffa_unknown_fields
11693        }
11694        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11695            &mut self.__buffa_unknown_fields
11696        }
11697    }
11698    #[cfg(feature = "text")]
11699    impl ::buffa::text::TextFormat for FeatureSupport {
11700        fn encode_text(
11701            &self,
11702            enc: &mut ::buffa::text::TextEncoder<'_>,
11703        ) -> ::core::fmt::Result {
11704            #[allow(unused_imports)]
11705            use ::buffa::Enumeration as _;
11706            if let ::core::option::Option::Some(ref __v) = self.edition_introduced {
11707                enc.write_field_name("edition_introduced")?;
11708                enc.write_enum_name(__v.proto_name())?;
11709            }
11710            if let ::core::option::Option::Some(ref __v) = self.edition_deprecated {
11711                enc.write_field_name("edition_deprecated")?;
11712                enc.write_enum_name(__v.proto_name())?;
11713            }
11714            if let ::core::option::Option::Some(ref __v) = self.deprecation_warning {
11715                enc.write_field_name("deprecation_warning")?;
11716                enc.write_string(__v)?;
11717            }
11718            if let ::core::option::Option::Some(ref __v) = self.edition_removed {
11719                enc.write_field_name("edition_removed")?;
11720                enc.write_enum_name(__v.proto_name())?;
11721            }
11722            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
11723            ::core::result::Result::Ok(())
11724        }
11725        fn merge_text(
11726            &mut self,
11727            dec: &mut ::buffa::text::TextDecoder<'_>,
11728        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
11729            #[allow(unused_imports)]
11730            use ::buffa::Enumeration as _;
11731            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
11732                match __name {
11733                    "edition_introduced" => {
11734                        self.edition_introduced = ::core::option::Option::Some(
11735                            dec.read_closed_enum_by_name::<super::Edition>()?,
11736                        );
11737                    }
11738                    "edition_deprecated" => {
11739                        self.edition_deprecated = ::core::option::Option::Some(
11740                            dec.read_closed_enum_by_name::<super::Edition>()?,
11741                        );
11742                    }
11743                    "deprecation_warning" => {
11744                        self.deprecation_warning = ::core::option::Option::Some(
11745                            dec.read_string()?.into_owned(),
11746                        );
11747                    }
11748                    "edition_removed" => {
11749                        self.edition_removed = ::core::option::Option::Some(
11750                            dec.read_closed_enum_by_name::<super::Edition>()?,
11751                        );
11752                    }
11753                    _ => dec.skip_value()?,
11754                }
11755            }
11756            ::core::result::Result::Ok(())
11757        }
11758    }
11759    #[cfg(feature = "json")]
11760    impl ::buffa::json_helpers::ProtoElemJson for FeatureSupport {
11761        fn serialize_proto_json<S: ::serde::Serializer>(
11762            v: &Self,
11763            s: S,
11764        ) -> ::core::result::Result<S::Ok, S::Error> {
11765            ::serde::Serialize::serialize(v, s)
11766        }
11767        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11768            d: D,
11769        ) -> ::core::result::Result<Self, D::Error> {
11770            <Self as ::serde::Deserialize>::deserialize(d)
11771        }
11772    }
11773    #[cfg(feature = "json")]
11774    #[doc(hidden)]
11775    pub const __FEATURE_SUPPORT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11776        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
11777        to_json: ::buffa::type_registry::any_to_json::<FeatureSupport>,
11778        from_json: ::buffa::type_registry::any_from_json::<FeatureSupport>,
11779        is_wkt: false,
11780    };
11781    #[cfg(feature = "text")]
11782    #[doc(hidden)]
11783    pub const __FEATURE_SUPPORT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
11784        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
11785        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSupport>,
11786        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSupport>,
11787    };
11788    #[cfg(feature = "views")]
11789    #[doc(inline)]
11790    pub use super::__buffa::view::field_options::EditionDefaultView;
11791    #[cfg(feature = "views")]
11792    #[doc(inline)]
11793    pub use super::__buffa::view::field_options::EditionDefaultOwnedView;
11794    #[cfg(feature = "views")]
11795    #[doc(inline)]
11796    pub use super::__buffa::view::field_options::FeatureSupportView;
11797    #[cfg(feature = "views")]
11798    #[doc(inline)]
11799    pub use super::__buffa::view::field_options::FeatureSupportOwnedView;
11800}
11801#[derive(Clone, PartialEq, Default)]
11802#[cfg_attr(feature = "json", derive(::serde::Serialize))]
11803#[cfg_attr(feature = "json", serde(default))]
11804#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11805pub struct OneofOptions {
11806    /// Any features defined in the specific edition.
11807    /// WARNING: This field should only be used by protobuf plugins or special
11808    /// cases like the proto compiler. Other uses are discouraged and
11809    /// developers should rely on the protoreflect APIs for their client language.
11810    ///
11811    /// Field 1: `features`
11812    #[cfg_attr(
11813        feature = "json",
11814        serde(
11815            rename = "features",
11816            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
11817        )
11818    )]
11819    pub features: ::buffa::MessageField<FeatureSet>,
11820    /// The parser stores options it doesn't recognize here. See above.
11821    ///
11822    /// Field 999: `uninterpreted_option`
11823    #[cfg_attr(
11824        feature = "json",
11825        serde(
11826            rename = "uninterpretedOption",
11827            alias = "uninterpreted_option",
11828            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
11829            deserialize_with = "::buffa::json_helpers::null_as_default"
11830        )
11831    )]
11832    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
11833    #[cfg_attr(feature = "json", serde(flatten))]
11834    #[doc(hidden)]
11835    pub __buffa_unknown_fields: __OneofOptionsExtJson,
11836}
11837impl ::core::fmt::Debug for OneofOptions {
11838    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11839        f.debug_struct("OneofOptions")
11840            .field("features", &self.features)
11841            .field("uninterpreted_option", &self.uninterpreted_option)
11842            .finish()
11843    }
11844}
11845impl OneofOptions {
11846    /// Protobuf type URL for this message, for use with `Any::pack` and
11847    /// `Any::unpack_if`.
11848    ///
11849    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11850    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
11851}
11852::buffa::impl_default_instance!(OneofOptions);
11853impl ::buffa::MessageName for OneofOptions {
11854    const PACKAGE: &'static str = "google.protobuf";
11855    const NAME: &'static str = "OneofOptions";
11856    const FULL_NAME: &'static str = "google.protobuf.OneofOptions";
11857    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
11858}
11859impl ::buffa::Message for OneofOptions {
11860    /// Returns the total encoded size in bytes.
11861    ///
11862    /// The result is a `u32`; the protobuf specification requires all
11863    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11864    /// compliant message will never overflow this type.
11865    #[allow(clippy::let_and_return)]
11866    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
11867        #[allow(unused_imports)]
11868        use ::buffa::Enumeration as _;
11869        let mut size = 0u32;
11870        if self.features.is_set() {
11871            let __slot = __cache.reserve();
11872            let inner_size = self.features.compute_size(__cache);
11873            __cache.set(__slot, inner_size);
11874            size
11875                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
11876                    + inner_size;
11877        }
11878        for v in &self.uninterpreted_option {
11879            let __slot = __cache.reserve();
11880            let inner_size = v.compute_size(__cache);
11881            __cache.set(__slot, inner_size);
11882            size
11883                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
11884                    + inner_size;
11885        }
11886        size += self.__buffa_unknown_fields.encoded_len() as u32;
11887        size
11888    }
11889    fn write_to(
11890        &self,
11891        __cache: &mut ::buffa::SizeCache,
11892        buf: &mut impl ::buffa::bytes::BufMut,
11893    ) {
11894        #[allow(unused_imports)]
11895        use ::buffa::Enumeration as _;
11896        if self.features.is_set() {
11897            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
11898            self.features.write_to(__cache, buf);
11899        }
11900        for v in &self.uninterpreted_option {
11901            ::buffa::types::put_len_delimited_header(
11902                999u32,
11903                __cache.consume_next(),
11904                buf,
11905            );
11906            v.write_to(__cache, buf);
11907        }
11908        self.__buffa_unknown_fields.write_to(buf);
11909    }
11910    fn merge_field(
11911        &mut self,
11912        tag: ::buffa::encoding::Tag,
11913        buf: &mut impl ::buffa::bytes::Buf,
11914        ctx: ::buffa::DecodeContext<'_>,
11915    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11916        #[allow(unused_imports)]
11917        use ::buffa::bytes::Buf as _;
11918        #[allow(unused_imports)]
11919        use ::buffa::Enumeration as _;
11920        match tag.field_number() {
11921            1u32 => {
11922                ::buffa::encoding::check_wire_type(
11923                    tag,
11924                    ::buffa::encoding::WireType::LengthDelimited,
11925                )?;
11926                ::buffa::Message::merge_length_delimited(
11927                    self.features.get_or_insert_default(),
11928                    buf,
11929                    ctx,
11930                )?;
11931            }
11932            999u32 => {
11933                ::buffa::encoding::check_wire_type(
11934                    tag,
11935                    ::buffa::encoding::WireType::LengthDelimited,
11936                )?;
11937                let mut elem = ::core::default::Default::default();
11938                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
11939                self.uninterpreted_option.push(elem);
11940            }
11941            _ => {
11942                self.__buffa_unknown_fields
11943                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11944            }
11945        }
11946        ::core::result::Result::Ok(())
11947    }
11948    fn clear(&mut self) {
11949        self.features = ::buffa::MessageField::none();
11950        self.uninterpreted_option.clear();
11951        self.__buffa_unknown_fields.clear();
11952    }
11953}
11954impl ::buffa::ExtensionSet for OneofOptions {
11955    const PROTO_FQN: &'static str = "google.protobuf.OneofOptions";
11956    fn unknown_fields(&self) -> &::buffa::UnknownFields {
11957        &self.__buffa_unknown_fields
11958    }
11959    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11960        &mut self.__buffa_unknown_fields
11961    }
11962}
11963#[cfg(feature = "text")]
11964impl ::buffa::text::TextFormat for OneofOptions {
11965    fn encode_text(
11966        &self,
11967        enc: &mut ::buffa::text::TextEncoder<'_>,
11968    ) -> ::core::fmt::Result {
11969        #[allow(unused_imports)]
11970        use ::buffa::Enumeration as _;
11971        if self.features.is_set() {
11972            enc.write_field_name("features")?;
11973            enc.write_message(&*self.features)?;
11974        }
11975        for __v in &self.uninterpreted_option {
11976            enc.write_field_name("uninterpreted_option")?;
11977            enc.write_message(__v)?;
11978        }
11979        enc.write_extension_fields(
11980            "google.protobuf.OneofOptions",
11981            &self.__buffa_unknown_fields,
11982        )?;
11983        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
11984        ::core::result::Result::Ok(())
11985    }
11986    fn merge_text(
11987        &mut self,
11988        dec: &mut ::buffa::text::TextDecoder<'_>,
11989    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
11990        #[allow(unused_imports)]
11991        use ::buffa::Enumeration as _;
11992        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
11993            match __name {
11994                "features" => dec.merge_message(self.features.get_or_insert_default())?,
11995                "uninterpreted_option" => {
11996                    dec.read_repeated_into(
11997                        &mut self.uninterpreted_option,
11998                        |__d| {
11999                            let mut __m = ::core::default::Default::default();
12000                            __d.merge_message(&mut __m)?;
12001                            ::core::result::Result::Ok(__m)
12002                        },
12003                    )?
12004                }
12005                __name if __name.starts_with('[') => {
12006                    for __r in dec
12007                        .read_extension(__name, "google.protobuf.OneofOptions")?
12008                    {
12009                        self.__buffa_unknown_fields.push(__r);
12010                    }
12011                }
12012                _ => dec.skip_value()?,
12013            }
12014        }
12015        ::core::result::Result::Ok(())
12016    }
12017}
12018#[cfg(feature = "json")]
12019impl<'de> serde::Deserialize<'de> for OneofOptions {
12020    fn deserialize<D: serde::Deserializer<'de>>(
12021        d: D,
12022    ) -> ::core::result::Result<Self, D::Error> {
12023        struct _V;
12024        impl<'de> serde::de::Visitor<'de> for _V {
12025            type Value = OneofOptions;
12026            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12027                f.write_str("struct OneofOptions")
12028            }
12029            #[allow(clippy::field_reassign_with_default)]
12030            fn visit_map<A: serde::de::MapAccess<'de>>(
12031                self,
12032                mut map: A,
12033            ) -> ::core::result::Result<OneofOptions, A::Error> {
12034                let mut __f_features: ::core::option::Option<
12035                    ::buffa::MessageField<FeatureSet>,
12036                > = None;
12037                let mut __f_uninterpreted_option: ::core::option::Option<
12038                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12039                > = None;
12040                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12041                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12042                    match key.as_str() {
12043                        "features" => {
12044                            __f_features = Some(
12045                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
12046                            );
12047                        }
12048                        "uninterpretedOption" | "uninterpreted_option" => {
12049                            __f_uninterpreted_option = Some({
12050                                struct _S;
12051                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
12052                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12053                                    fn deserialize<D: serde::Deserializer<'de>>(
12054                                        self,
12055                                        d: D,
12056                                    ) -> ::core::result::Result<
12057                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12058                                        D::Error,
12059                                    > {
12060                                        ::buffa::json_helpers::null_as_default(d)
12061                                    }
12062                                }
12063                                map.next_value_seed(_S)?
12064                            });
12065                        }
12066                        __k if __k.starts_with('[') => {
12067                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12068                            match ::buffa::extension_registry::deserialize_extension_key(
12069                                "google.protobuf.OneofOptions",
12070                                __k,
12071                                __v,
12072                            ) {
12073                                ::core::option::Option::Some(
12074                                    ::core::result::Result::Ok(__recs),
12075                                ) => {
12076                                    for __rec in __recs {
12077                                        __ext_records.push(__rec);
12078                                    }
12079                                }
12080                                ::core::option::Option::Some(
12081                                    ::core::result::Result::Err(__e),
12082                                ) => {
12083                                    return ::core::result::Result::Err(
12084                                        <A::Error as ::serde::de::Error>::custom(__e),
12085                                    );
12086                                }
12087                                ::core::option::Option::None => {}
12088                            }
12089                        }
12090                        _ => {
12091                            map.next_value::<serde::de::IgnoredAny>()?;
12092                        }
12093                    }
12094                }
12095                let mut __r = <OneofOptions as ::core::default::Default>::default();
12096                if let ::core::option::Option::Some(v) = __f_features {
12097                    __r.features = v;
12098                }
12099                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
12100                    __r.uninterpreted_option = v;
12101                }
12102                for __rec in __ext_records {
12103                    __r.__buffa_unknown_fields.push(__rec);
12104                }
12105                Ok(__r)
12106            }
12107        }
12108        d.deserialize_map(_V)
12109    }
12110}
12111#[cfg(feature = "json")]
12112impl ::buffa::json_helpers::ProtoElemJson for OneofOptions {
12113    fn serialize_proto_json<S: ::serde::Serializer>(
12114        v: &Self,
12115        s: S,
12116    ) -> ::core::result::Result<S::Ok, S::Error> {
12117        ::serde::Serialize::serialize(v, s)
12118    }
12119    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12120        d: D,
12121    ) -> ::core::result::Result<Self, D::Error> {
12122        <Self as ::serde::Deserialize>::deserialize(d)
12123    }
12124}
12125#[doc(hidden)]
12126#[derive(Clone, Debug, Default, PartialEq)]
12127#[repr(transparent)]
12128#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12129pub struct __OneofOptionsExtJson(pub ::buffa::UnknownFields);
12130impl ::core::ops::Deref for __OneofOptionsExtJson {
12131    type Target = ::buffa::UnknownFields;
12132    fn deref(&self) -> &::buffa::UnknownFields {
12133        &self.0
12134    }
12135}
12136impl ::core::ops::DerefMut for __OneofOptionsExtJson {
12137    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
12138        &mut self.0
12139    }
12140}
12141impl ::core::convert::From<::buffa::UnknownFields> for __OneofOptionsExtJson {
12142    fn from(u: ::buffa::UnknownFields) -> Self {
12143        Self(u)
12144    }
12145}
12146#[cfg(feature = "json")]
12147impl ::serde::Serialize for __OneofOptionsExtJson {
12148    fn serialize<S: ::serde::Serializer>(
12149        &self,
12150        s: S,
12151    ) -> ::core::result::Result<S::Ok, S::Error> {
12152        ::buffa::extension_registry::serialize_extensions(
12153            "google.protobuf.OneofOptions",
12154            &self.0,
12155            s,
12156        )
12157    }
12158}
12159#[cfg(feature = "json")]
12160impl<'de> ::serde::Deserialize<'de> for __OneofOptionsExtJson {
12161    fn deserialize<D: ::serde::Deserializer<'de>>(
12162        d: D,
12163    ) -> ::core::result::Result<Self, D::Error> {
12164        ::buffa::extension_registry::deserialize_extensions(
12165                "google.protobuf.OneofOptions",
12166                d,
12167            )
12168            .map(Self)
12169    }
12170}
12171#[cfg(feature = "json")]
12172#[doc(hidden)]
12173pub const __ONEOF_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12174    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12175    to_json: ::buffa::type_registry::any_to_json::<OneofOptions>,
12176    from_json: ::buffa::type_registry::any_from_json::<OneofOptions>,
12177    is_wkt: false,
12178};
12179#[cfg(feature = "text")]
12180#[doc(hidden)]
12181pub const __ONEOF_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12182    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12183    text_encode: ::buffa::type_registry::any_encode_text::<OneofOptions>,
12184    text_merge: ::buffa::type_registry::any_merge_text::<OneofOptions>,
12185};
12186#[derive(Clone, PartialEq, Default)]
12187#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12188#[cfg_attr(feature = "json", serde(default))]
12189#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12190pub struct EnumOptions {
12191    /// Set this option to true to allow mapping different tag names to the same
12192    /// value.
12193    ///
12194    /// Field 2: `allow_alias`
12195    #[cfg_attr(
12196        feature = "json",
12197        serde(
12198            rename = "allowAlias",
12199            alias = "allow_alias",
12200            skip_serializing_if = "::core::option::Option::is_none"
12201        )
12202    )]
12203    pub allow_alias: ::core::option::Option<bool>,
12204    /// Is this enum deprecated?
12205    /// Depending on the target platform, this can emit Deprecated annotations
12206    /// for the enum, or it will be completely ignored; in the very least, this
12207    /// is a formalization for deprecating enums.
12208    ///
12209    /// Field 3: `deprecated`
12210    #[cfg_attr(
12211        feature = "json",
12212        serde(
12213            rename = "deprecated",
12214            skip_serializing_if = "::core::option::Option::is_none"
12215        )
12216    )]
12217    pub deprecated: ::core::option::Option<bool>,
12218    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
12219    /// and strips underscored from the fields before comparison in proto3 only.
12220    /// The new behavior takes `json_name` into account and applies to proto2 as
12221    /// well.
12222    /// TODO Remove this legacy behavior once downstream teams have
12223    /// had time to migrate.
12224    ///
12225    /// Field 6: `deprecated_legacy_json_field_conflicts`
12226    #[cfg_attr(
12227        feature = "json",
12228        serde(
12229            rename = "deprecatedLegacyJsonFieldConflicts",
12230            alias = "deprecated_legacy_json_field_conflicts",
12231            skip_serializing_if = "::core::option::Option::is_none"
12232        )
12233    )]
12234    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
12235    /// Any features defined in the specific edition.
12236    /// WARNING: This field should only be used by protobuf plugins or special
12237    /// cases like the proto compiler. Other uses are discouraged and
12238    /// developers should rely on the protoreflect APIs for their client language.
12239    ///
12240    /// Field 7: `features`
12241    #[cfg_attr(
12242        feature = "json",
12243        serde(
12244            rename = "features",
12245            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12246        )
12247    )]
12248    pub features: ::buffa::MessageField<FeatureSet>,
12249    /// The parser stores options it doesn't recognize here. See above.
12250    ///
12251    /// Field 999: `uninterpreted_option`
12252    #[cfg_attr(
12253        feature = "json",
12254        serde(
12255            rename = "uninterpretedOption",
12256            alias = "uninterpreted_option",
12257            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12258            deserialize_with = "::buffa::json_helpers::null_as_default"
12259        )
12260    )]
12261    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12262    #[cfg_attr(feature = "json", serde(flatten))]
12263    #[doc(hidden)]
12264    pub __buffa_unknown_fields: __EnumOptionsExtJson,
12265}
12266impl ::core::fmt::Debug for EnumOptions {
12267    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12268        f.debug_struct("EnumOptions")
12269            .field("allow_alias", &self.allow_alias)
12270            .field("deprecated", &self.deprecated)
12271            .field(
12272                "deprecated_legacy_json_field_conflicts",
12273                &self.deprecated_legacy_json_field_conflicts,
12274            )
12275            .field("features", &self.features)
12276            .field("uninterpreted_option", &self.uninterpreted_option)
12277            .finish()
12278    }
12279}
12280impl EnumOptions {
12281    /// Protobuf type URL for this message, for use with `Any::pack` and
12282    /// `Any::unpack_if`.
12283    ///
12284    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12285    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12286}
12287impl EnumOptions {
12288    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12289    #[inline]
12290    ///Sets [`Self::allow_alias`] to `Some(value)`, consuming and returning `self`.
12291    pub fn with_allow_alias(mut self, value: bool) -> Self {
12292        self.allow_alias = Some(value);
12293        self
12294    }
12295    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12296    #[inline]
12297    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
12298    pub fn with_deprecated(mut self, value: bool) -> Self {
12299        self.deprecated = Some(value);
12300        self
12301    }
12302    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12303    #[inline]
12304    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
12305    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
12306        self.deprecated_legacy_json_field_conflicts = Some(value);
12307        self
12308    }
12309}
12310::buffa::impl_default_instance!(EnumOptions);
12311impl ::buffa::MessageName for EnumOptions {
12312    const PACKAGE: &'static str = "google.protobuf";
12313    const NAME: &'static str = "EnumOptions";
12314    const FULL_NAME: &'static str = "google.protobuf.EnumOptions";
12315    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12316}
12317impl ::buffa::Message for EnumOptions {
12318    /// Returns the total encoded size in bytes.
12319    ///
12320    /// The result is a `u32`; the protobuf specification requires all
12321    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12322    /// compliant message will never overflow this type.
12323    #[allow(clippy::let_and_return)]
12324    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12325        #[allow(unused_imports)]
12326        use ::buffa::Enumeration as _;
12327        let mut size = 0u32;
12328        if self.allow_alias.is_some() {
12329            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12330        }
12331        if self.deprecated.is_some() {
12332            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12333        }
12334        if self.deprecated_legacy_json_field_conflicts.is_some() {
12335            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12336        }
12337        if self.features.is_set() {
12338            let __slot = __cache.reserve();
12339            let inner_size = self.features.compute_size(__cache);
12340            __cache.set(__slot, inner_size);
12341            size
12342                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12343                    + inner_size;
12344        }
12345        for v in &self.uninterpreted_option {
12346            let __slot = __cache.reserve();
12347            let inner_size = v.compute_size(__cache);
12348            __cache.set(__slot, inner_size);
12349            size
12350                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12351                    + inner_size;
12352        }
12353        size += self.__buffa_unknown_fields.encoded_len() as u32;
12354        size
12355    }
12356    fn write_to(
12357        &self,
12358        __cache: &mut ::buffa::SizeCache,
12359        buf: &mut impl ::buffa::bytes::BufMut,
12360    ) {
12361        #[allow(unused_imports)]
12362        use ::buffa::Enumeration as _;
12363        if let Some(v) = self.allow_alias {
12364            ::buffa::types::put_bool_field(2u32, v, buf);
12365        }
12366        if let Some(v) = self.deprecated {
12367            ::buffa::types::put_bool_field(3u32, v, buf);
12368        }
12369        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
12370            ::buffa::types::put_bool_field(6u32, v, buf);
12371        }
12372        if self.features.is_set() {
12373            ::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
12374            self.features.write_to(__cache, buf);
12375        }
12376        for v in &self.uninterpreted_option {
12377            ::buffa::types::put_len_delimited_header(
12378                999u32,
12379                __cache.consume_next(),
12380                buf,
12381            );
12382            v.write_to(__cache, buf);
12383        }
12384        self.__buffa_unknown_fields.write_to(buf);
12385    }
12386    fn merge_field(
12387        &mut self,
12388        tag: ::buffa::encoding::Tag,
12389        buf: &mut impl ::buffa::bytes::Buf,
12390        ctx: ::buffa::DecodeContext<'_>,
12391    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12392        #[allow(unused_imports)]
12393        use ::buffa::bytes::Buf as _;
12394        #[allow(unused_imports)]
12395        use ::buffa::Enumeration as _;
12396        match tag.field_number() {
12397            2u32 => {
12398                ::buffa::encoding::check_wire_type(
12399                    tag,
12400                    ::buffa::encoding::WireType::Varint,
12401                )?;
12402                self.allow_alias = ::core::option::Option::Some(
12403                    ::buffa::types::decode_bool(buf)?,
12404                );
12405            }
12406            3u32 => {
12407                ::buffa::encoding::check_wire_type(
12408                    tag,
12409                    ::buffa::encoding::WireType::Varint,
12410                )?;
12411                self.deprecated = ::core::option::Option::Some(
12412                    ::buffa::types::decode_bool(buf)?,
12413                );
12414            }
12415            6u32 => {
12416                ::buffa::encoding::check_wire_type(
12417                    tag,
12418                    ::buffa::encoding::WireType::Varint,
12419                )?;
12420                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12421                    ::buffa::types::decode_bool(buf)?,
12422                );
12423            }
12424            7u32 => {
12425                ::buffa::encoding::check_wire_type(
12426                    tag,
12427                    ::buffa::encoding::WireType::LengthDelimited,
12428                )?;
12429                ::buffa::Message::merge_length_delimited(
12430                    self.features.get_or_insert_default(),
12431                    buf,
12432                    ctx,
12433                )?;
12434            }
12435            999u32 => {
12436                ::buffa::encoding::check_wire_type(
12437                    tag,
12438                    ::buffa::encoding::WireType::LengthDelimited,
12439                )?;
12440                let mut elem = ::core::default::Default::default();
12441                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
12442                self.uninterpreted_option.push(elem);
12443            }
12444            _ => {
12445                self.__buffa_unknown_fields
12446                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12447            }
12448        }
12449        ::core::result::Result::Ok(())
12450    }
12451    fn clear(&mut self) {
12452        self.allow_alias = ::core::option::Option::None;
12453        self.deprecated = ::core::option::Option::None;
12454        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
12455        self.features = ::buffa::MessageField::none();
12456        self.uninterpreted_option.clear();
12457        self.__buffa_unknown_fields.clear();
12458    }
12459}
12460impl ::buffa::ExtensionSet for EnumOptions {
12461    const PROTO_FQN: &'static str = "google.protobuf.EnumOptions";
12462    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12463        &self.__buffa_unknown_fields
12464    }
12465    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12466        &mut self.__buffa_unknown_fields
12467    }
12468}
12469#[cfg(feature = "text")]
12470impl ::buffa::text::TextFormat for EnumOptions {
12471    fn encode_text(
12472        &self,
12473        enc: &mut ::buffa::text::TextEncoder<'_>,
12474    ) -> ::core::fmt::Result {
12475        #[allow(unused_imports)]
12476        use ::buffa::Enumeration as _;
12477        if let ::core::option::Option::Some(ref __v) = self.allow_alias {
12478            enc.write_field_name("allow_alias")?;
12479            enc.write_bool(*__v)?;
12480        }
12481        if let ::core::option::Option::Some(ref __v) = self.deprecated {
12482            enc.write_field_name("deprecated")?;
12483            enc.write_bool(*__v)?;
12484        }
12485        if let ::core::option::Option::Some(ref __v) = self
12486            .deprecated_legacy_json_field_conflicts
12487        {
12488            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
12489            enc.write_bool(*__v)?;
12490        }
12491        if self.features.is_set() {
12492            enc.write_field_name("features")?;
12493            enc.write_message(&*self.features)?;
12494        }
12495        for __v in &self.uninterpreted_option {
12496            enc.write_field_name("uninterpreted_option")?;
12497            enc.write_message(__v)?;
12498        }
12499        enc.write_extension_fields(
12500            "google.protobuf.EnumOptions",
12501            &self.__buffa_unknown_fields,
12502        )?;
12503        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12504        ::core::result::Result::Ok(())
12505    }
12506    fn merge_text(
12507        &mut self,
12508        dec: &mut ::buffa::text::TextDecoder<'_>,
12509    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12510        #[allow(unused_imports)]
12511        use ::buffa::Enumeration as _;
12512        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12513            match __name {
12514                "allow_alias" => {
12515                    self.allow_alias = ::core::option::Option::Some(dec.read_bool()?);
12516                }
12517                "deprecated" => {
12518                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
12519                }
12520                "deprecated_legacy_json_field_conflicts" => {
12521                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12522                        dec.read_bool()?,
12523                    );
12524                }
12525                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12526                "uninterpreted_option" => {
12527                    dec.read_repeated_into(
12528                        &mut self.uninterpreted_option,
12529                        |__d| {
12530                            let mut __m = ::core::default::Default::default();
12531                            __d.merge_message(&mut __m)?;
12532                            ::core::result::Result::Ok(__m)
12533                        },
12534                    )?
12535                }
12536                __name if __name.starts_with('[') => {
12537                    for __r in dec.read_extension(__name, "google.protobuf.EnumOptions")?
12538                    {
12539                        self.__buffa_unknown_fields.push(__r);
12540                    }
12541                }
12542                _ => dec.skip_value()?,
12543            }
12544        }
12545        ::core::result::Result::Ok(())
12546    }
12547}
12548#[cfg(feature = "json")]
12549impl<'de> serde::Deserialize<'de> for EnumOptions {
12550    fn deserialize<D: serde::Deserializer<'de>>(
12551        d: D,
12552    ) -> ::core::result::Result<Self, D::Error> {
12553        struct _V;
12554        impl<'de> serde::de::Visitor<'de> for _V {
12555            type Value = EnumOptions;
12556            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12557                f.write_str("struct EnumOptions")
12558            }
12559            #[allow(clippy::field_reassign_with_default)]
12560            fn visit_map<A: serde::de::MapAccess<'de>>(
12561                self,
12562                mut map: A,
12563            ) -> ::core::result::Result<EnumOptions, A::Error> {
12564                let mut __f_allow_alias: ::core::option::Option<
12565                    ::core::option::Option<bool>,
12566                > = None;
12567                let mut __f_deprecated: ::core::option::Option<
12568                    ::core::option::Option<bool>,
12569                > = None;
12570                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
12571                    ::core::option::Option<bool>,
12572                > = None;
12573                let mut __f_features: ::core::option::Option<
12574                    ::buffa::MessageField<FeatureSet>,
12575                > = None;
12576                let mut __f_uninterpreted_option: ::core::option::Option<
12577                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12578                > = None;
12579                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12580                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12581                    match key.as_str() {
12582                        "allowAlias" | "allow_alias" => {
12583                            __f_allow_alias = Some(
12584                                map.next_value::<::core::option::Option<bool>>()?,
12585                            );
12586                        }
12587                        "deprecated" => {
12588                            __f_deprecated = Some(
12589                                map.next_value::<::core::option::Option<bool>>()?,
12590                            );
12591                        }
12592                        "deprecatedLegacyJsonFieldConflicts"
12593                        | "deprecated_legacy_json_field_conflicts" => {
12594                            __f_deprecated_legacy_json_field_conflicts = Some(
12595                                map.next_value::<::core::option::Option<bool>>()?,
12596                            );
12597                        }
12598                        "features" => {
12599                            __f_features = Some(
12600                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
12601                            );
12602                        }
12603                        "uninterpretedOption" | "uninterpreted_option" => {
12604                            __f_uninterpreted_option = Some({
12605                                struct _S;
12606                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
12607                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12608                                    fn deserialize<D: serde::Deserializer<'de>>(
12609                                        self,
12610                                        d: D,
12611                                    ) -> ::core::result::Result<
12612                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12613                                        D::Error,
12614                                    > {
12615                                        ::buffa::json_helpers::null_as_default(d)
12616                                    }
12617                                }
12618                                map.next_value_seed(_S)?
12619                            });
12620                        }
12621                        __k if __k.starts_with('[') => {
12622                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12623                            match ::buffa::extension_registry::deserialize_extension_key(
12624                                "google.protobuf.EnumOptions",
12625                                __k,
12626                                __v,
12627                            ) {
12628                                ::core::option::Option::Some(
12629                                    ::core::result::Result::Ok(__recs),
12630                                ) => {
12631                                    for __rec in __recs {
12632                                        __ext_records.push(__rec);
12633                                    }
12634                                }
12635                                ::core::option::Option::Some(
12636                                    ::core::result::Result::Err(__e),
12637                                ) => {
12638                                    return ::core::result::Result::Err(
12639                                        <A::Error as ::serde::de::Error>::custom(__e),
12640                                    );
12641                                }
12642                                ::core::option::Option::None => {}
12643                            }
12644                        }
12645                        _ => {
12646                            map.next_value::<serde::de::IgnoredAny>()?;
12647                        }
12648                    }
12649                }
12650                let mut __r = <EnumOptions as ::core::default::Default>::default();
12651                if let ::core::option::Option::Some(v) = __f_allow_alias {
12652                    __r.allow_alias = v;
12653                }
12654                if let ::core::option::Option::Some(v) = __f_deprecated {
12655                    __r.deprecated = v;
12656                }
12657                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
12658                    __r.deprecated_legacy_json_field_conflicts = v;
12659                }
12660                if let ::core::option::Option::Some(v) = __f_features {
12661                    __r.features = v;
12662                }
12663                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
12664                    __r.uninterpreted_option = v;
12665                }
12666                for __rec in __ext_records {
12667                    __r.__buffa_unknown_fields.push(__rec);
12668                }
12669                Ok(__r)
12670            }
12671        }
12672        d.deserialize_map(_V)
12673    }
12674}
12675#[cfg(feature = "json")]
12676impl ::buffa::json_helpers::ProtoElemJson for EnumOptions {
12677    fn serialize_proto_json<S: ::serde::Serializer>(
12678        v: &Self,
12679        s: S,
12680    ) -> ::core::result::Result<S::Ok, S::Error> {
12681        ::serde::Serialize::serialize(v, s)
12682    }
12683    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12684        d: D,
12685    ) -> ::core::result::Result<Self, D::Error> {
12686        <Self as ::serde::Deserialize>::deserialize(d)
12687    }
12688}
12689#[doc(hidden)]
12690#[derive(Clone, Debug, Default, PartialEq)]
12691#[repr(transparent)]
12692#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12693pub struct __EnumOptionsExtJson(pub ::buffa::UnknownFields);
12694impl ::core::ops::Deref for __EnumOptionsExtJson {
12695    type Target = ::buffa::UnknownFields;
12696    fn deref(&self) -> &::buffa::UnknownFields {
12697        &self.0
12698    }
12699}
12700impl ::core::ops::DerefMut for __EnumOptionsExtJson {
12701    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
12702        &mut self.0
12703    }
12704}
12705impl ::core::convert::From<::buffa::UnknownFields> for __EnumOptionsExtJson {
12706    fn from(u: ::buffa::UnknownFields) -> Self {
12707        Self(u)
12708    }
12709}
12710#[cfg(feature = "json")]
12711impl ::serde::Serialize for __EnumOptionsExtJson {
12712    fn serialize<S: ::serde::Serializer>(
12713        &self,
12714        s: S,
12715    ) -> ::core::result::Result<S::Ok, S::Error> {
12716        ::buffa::extension_registry::serialize_extensions(
12717            "google.protobuf.EnumOptions",
12718            &self.0,
12719            s,
12720        )
12721    }
12722}
12723#[cfg(feature = "json")]
12724impl<'de> ::serde::Deserialize<'de> for __EnumOptionsExtJson {
12725    fn deserialize<D: ::serde::Deserializer<'de>>(
12726        d: D,
12727    ) -> ::core::result::Result<Self, D::Error> {
12728        ::buffa::extension_registry::deserialize_extensions(
12729                "google.protobuf.EnumOptions",
12730                d,
12731            )
12732            .map(Self)
12733    }
12734}
12735#[cfg(feature = "json")]
12736#[doc(hidden)]
12737pub const __ENUM_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12738    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
12739    to_json: ::buffa::type_registry::any_to_json::<EnumOptions>,
12740    from_json: ::buffa::type_registry::any_from_json::<EnumOptions>,
12741    is_wkt: false,
12742};
12743#[cfg(feature = "text")]
12744#[doc(hidden)]
12745pub const __ENUM_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12746    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
12747    text_encode: ::buffa::type_registry::any_encode_text::<EnumOptions>,
12748    text_merge: ::buffa::type_registry::any_merge_text::<EnumOptions>,
12749};
12750#[derive(Clone, PartialEq, Default)]
12751#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12752#[cfg_attr(feature = "json", serde(default))]
12753#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12754pub struct EnumValueOptions {
12755    /// Is this enum value deprecated?
12756    /// Depending on the target platform, this can emit Deprecated annotations
12757    /// for the enum value, or it will be completely ignored; in the very least,
12758    /// this is a formalization for deprecating enum values.
12759    ///
12760    /// Field 1: `deprecated`
12761    #[cfg_attr(
12762        feature = "json",
12763        serde(
12764            rename = "deprecated",
12765            skip_serializing_if = "::core::option::Option::is_none"
12766        )
12767    )]
12768    pub deprecated: ::core::option::Option<bool>,
12769    /// Any features defined in the specific edition.
12770    /// WARNING: This field should only be used by protobuf plugins or special
12771    /// cases like the proto compiler. Other uses are discouraged and
12772    /// developers should rely on the protoreflect APIs for their client language.
12773    ///
12774    /// Field 2: `features`
12775    #[cfg_attr(
12776        feature = "json",
12777        serde(
12778            rename = "features",
12779            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12780        )
12781    )]
12782    pub features: ::buffa::MessageField<FeatureSet>,
12783    /// Indicate that fields annotated with this enum value should not be printed
12784    /// out when using debug formats, e.g. when the field contains sensitive
12785    /// credentials.
12786    ///
12787    /// Field 3: `debug_redact`
12788    #[cfg_attr(
12789        feature = "json",
12790        serde(
12791            rename = "debugRedact",
12792            alias = "debug_redact",
12793            skip_serializing_if = "::core::option::Option::is_none"
12794        )
12795    )]
12796    pub debug_redact: ::core::option::Option<bool>,
12797    /// Information about the support window of a feature value.
12798    ///
12799    /// Field 4: `feature_support`
12800    #[cfg_attr(
12801        feature = "json",
12802        serde(
12803            rename = "featureSupport",
12804            alias = "feature_support",
12805            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12806        )
12807    )]
12808    pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
12809    /// The parser stores options it doesn't recognize here. See above.
12810    ///
12811    /// Field 999: `uninterpreted_option`
12812    #[cfg_attr(
12813        feature = "json",
12814        serde(
12815            rename = "uninterpretedOption",
12816            alias = "uninterpreted_option",
12817            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12818            deserialize_with = "::buffa::json_helpers::null_as_default"
12819        )
12820    )]
12821    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12822    #[cfg_attr(feature = "json", serde(flatten))]
12823    #[doc(hidden)]
12824    pub __buffa_unknown_fields: __EnumValueOptionsExtJson,
12825}
12826impl ::core::fmt::Debug for EnumValueOptions {
12827    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12828        f.debug_struct("EnumValueOptions")
12829            .field("deprecated", &self.deprecated)
12830            .field("features", &self.features)
12831            .field("debug_redact", &self.debug_redact)
12832            .field("feature_support", &self.feature_support)
12833            .field("uninterpreted_option", &self.uninterpreted_option)
12834            .finish()
12835    }
12836}
12837impl EnumValueOptions {
12838    /// Protobuf type URL for this message, for use with `Any::pack` and
12839    /// `Any::unpack_if`.
12840    ///
12841    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12842    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
12843}
12844impl EnumValueOptions {
12845    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12846    #[inline]
12847    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
12848    pub fn with_deprecated(mut self, value: bool) -> Self {
12849        self.deprecated = Some(value);
12850        self
12851    }
12852    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12853    #[inline]
12854    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
12855    pub fn with_debug_redact(mut self, value: bool) -> Self {
12856        self.debug_redact = Some(value);
12857        self
12858    }
12859}
12860::buffa::impl_default_instance!(EnumValueOptions);
12861impl ::buffa::MessageName for EnumValueOptions {
12862    const PACKAGE: &'static str = "google.protobuf";
12863    const NAME: &'static str = "EnumValueOptions";
12864    const FULL_NAME: &'static str = "google.protobuf.EnumValueOptions";
12865    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
12866}
12867impl ::buffa::Message for EnumValueOptions {
12868    /// Returns the total encoded size in bytes.
12869    ///
12870    /// The result is a `u32`; the protobuf specification requires all
12871    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12872    /// compliant message will never overflow this type.
12873    #[allow(clippy::let_and_return)]
12874    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12875        #[allow(unused_imports)]
12876        use ::buffa::Enumeration as _;
12877        let mut size = 0u32;
12878        if self.deprecated.is_some() {
12879            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12880        }
12881        if self.features.is_set() {
12882            let __slot = __cache.reserve();
12883            let inner_size = self.features.compute_size(__cache);
12884            __cache.set(__slot, inner_size);
12885            size
12886                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12887                    + inner_size;
12888        }
12889        if self.debug_redact.is_some() {
12890            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12891        }
12892        if self.feature_support.is_set() {
12893            let __slot = __cache.reserve();
12894            let inner_size = self.feature_support.compute_size(__cache);
12895            __cache.set(__slot, inner_size);
12896            size
12897                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12898                    + inner_size;
12899        }
12900        for v in &self.uninterpreted_option {
12901            let __slot = __cache.reserve();
12902            let inner_size = v.compute_size(__cache);
12903            __cache.set(__slot, inner_size);
12904            size
12905                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12906                    + inner_size;
12907        }
12908        size += self.__buffa_unknown_fields.encoded_len() as u32;
12909        size
12910    }
12911    fn write_to(
12912        &self,
12913        __cache: &mut ::buffa::SizeCache,
12914        buf: &mut impl ::buffa::bytes::BufMut,
12915    ) {
12916        #[allow(unused_imports)]
12917        use ::buffa::Enumeration as _;
12918        if let Some(v) = self.deprecated {
12919            ::buffa::types::put_bool_field(1u32, v, buf);
12920        }
12921        if self.features.is_set() {
12922            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
12923            self.features.write_to(__cache, buf);
12924        }
12925        if let Some(v) = self.debug_redact {
12926            ::buffa::types::put_bool_field(3u32, v, buf);
12927        }
12928        if self.feature_support.is_set() {
12929            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
12930            self.feature_support.write_to(__cache, buf);
12931        }
12932        for v in &self.uninterpreted_option {
12933            ::buffa::types::put_len_delimited_header(
12934                999u32,
12935                __cache.consume_next(),
12936                buf,
12937            );
12938            v.write_to(__cache, buf);
12939        }
12940        self.__buffa_unknown_fields.write_to(buf);
12941    }
12942    fn merge_field(
12943        &mut self,
12944        tag: ::buffa::encoding::Tag,
12945        buf: &mut impl ::buffa::bytes::Buf,
12946        ctx: ::buffa::DecodeContext<'_>,
12947    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12948        #[allow(unused_imports)]
12949        use ::buffa::bytes::Buf as _;
12950        #[allow(unused_imports)]
12951        use ::buffa::Enumeration as _;
12952        match tag.field_number() {
12953            1u32 => {
12954                ::buffa::encoding::check_wire_type(
12955                    tag,
12956                    ::buffa::encoding::WireType::Varint,
12957                )?;
12958                self.deprecated = ::core::option::Option::Some(
12959                    ::buffa::types::decode_bool(buf)?,
12960                );
12961            }
12962            2u32 => {
12963                ::buffa::encoding::check_wire_type(
12964                    tag,
12965                    ::buffa::encoding::WireType::LengthDelimited,
12966                )?;
12967                ::buffa::Message::merge_length_delimited(
12968                    self.features.get_or_insert_default(),
12969                    buf,
12970                    ctx,
12971                )?;
12972            }
12973            3u32 => {
12974                ::buffa::encoding::check_wire_type(
12975                    tag,
12976                    ::buffa::encoding::WireType::Varint,
12977                )?;
12978                self.debug_redact = ::core::option::Option::Some(
12979                    ::buffa::types::decode_bool(buf)?,
12980                );
12981            }
12982            4u32 => {
12983                ::buffa::encoding::check_wire_type(
12984                    tag,
12985                    ::buffa::encoding::WireType::LengthDelimited,
12986                )?;
12987                ::buffa::Message::merge_length_delimited(
12988                    self.feature_support.get_or_insert_default(),
12989                    buf,
12990                    ctx,
12991                )?;
12992            }
12993            999u32 => {
12994                ::buffa::encoding::check_wire_type(
12995                    tag,
12996                    ::buffa::encoding::WireType::LengthDelimited,
12997                )?;
12998                let mut elem = ::core::default::Default::default();
12999                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13000                self.uninterpreted_option.push(elem);
13001            }
13002            _ => {
13003                self.__buffa_unknown_fields
13004                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13005            }
13006        }
13007        ::core::result::Result::Ok(())
13008    }
13009    fn clear(&mut self) {
13010        self.deprecated = ::core::option::Option::None;
13011        self.features = ::buffa::MessageField::none();
13012        self.debug_redact = ::core::option::Option::None;
13013        self.feature_support = ::buffa::MessageField::none();
13014        self.uninterpreted_option.clear();
13015        self.__buffa_unknown_fields.clear();
13016    }
13017}
13018impl ::buffa::ExtensionSet for EnumValueOptions {
13019    const PROTO_FQN: &'static str = "google.protobuf.EnumValueOptions";
13020    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13021        &self.__buffa_unknown_fields
13022    }
13023    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13024        &mut self.__buffa_unknown_fields
13025    }
13026}
13027#[cfg(feature = "text")]
13028impl ::buffa::text::TextFormat for EnumValueOptions {
13029    fn encode_text(
13030        &self,
13031        enc: &mut ::buffa::text::TextEncoder<'_>,
13032    ) -> ::core::fmt::Result {
13033        #[allow(unused_imports)]
13034        use ::buffa::Enumeration as _;
13035        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13036            enc.write_field_name("deprecated")?;
13037            enc.write_bool(*__v)?;
13038        }
13039        if self.features.is_set() {
13040            enc.write_field_name("features")?;
13041            enc.write_message(&*self.features)?;
13042        }
13043        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
13044            enc.write_field_name("debug_redact")?;
13045            enc.write_bool(*__v)?;
13046        }
13047        if self.feature_support.is_set() {
13048            enc.write_field_name("feature_support")?;
13049            enc.write_message(&*self.feature_support)?;
13050        }
13051        for __v in &self.uninterpreted_option {
13052            enc.write_field_name("uninterpreted_option")?;
13053            enc.write_message(__v)?;
13054        }
13055        enc.write_extension_fields(
13056            "google.protobuf.EnumValueOptions",
13057            &self.__buffa_unknown_fields,
13058        )?;
13059        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13060        ::core::result::Result::Ok(())
13061    }
13062    fn merge_text(
13063        &mut self,
13064        dec: &mut ::buffa::text::TextDecoder<'_>,
13065    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13066        #[allow(unused_imports)]
13067        use ::buffa::Enumeration as _;
13068        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13069            match __name {
13070                "deprecated" => {
13071                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13072                }
13073                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13074                "debug_redact" => {
13075                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
13076                }
13077                "feature_support" => {
13078                    dec.merge_message(self.feature_support.get_or_insert_default())?
13079                }
13080                "uninterpreted_option" => {
13081                    dec.read_repeated_into(
13082                        &mut self.uninterpreted_option,
13083                        |__d| {
13084                            let mut __m = ::core::default::Default::default();
13085                            __d.merge_message(&mut __m)?;
13086                            ::core::result::Result::Ok(__m)
13087                        },
13088                    )?
13089                }
13090                __name if __name.starts_with('[') => {
13091                    for __r in dec
13092                        .read_extension(__name, "google.protobuf.EnumValueOptions")?
13093                    {
13094                        self.__buffa_unknown_fields.push(__r);
13095                    }
13096                }
13097                _ => dec.skip_value()?,
13098            }
13099        }
13100        ::core::result::Result::Ok(())
13101    }
13102}
13103#[cfg(feature = "json")]
13104impl<'de> serde::Deserialize<'de> for EnumValueOptions {
13105    fn deserialize<D: serde::Deserializer<'de>>(
13106        d: D,
13107    ) -> ::core::result::Result<Self, D::Error> {
13108        struct _V;
13109        impl<'de> serde::de::Visitor<'de> for _V {
13110            type Value = EnumValueOptions;
13111            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13112                f.write_str("struct EnumValueOptions")
13113            }
13114            #[allow(clippy::field_reassign_with_default)]
13115            fn visit_map<A: serde::de::MapAccess<'de>>(
13116                self,
13117                mut map: A,
13118            ) -> ::core::result::Result<EnumValueOptions, A::Error> {
13119                let mut __f_deprecated: ::core::option::Option<
13120                    ::core::option::Option<bool>,
13121                > = None;
13122                let mut __f_features: ::core::option::Option<
13123                    ::buffa::MessageField<FeatureSet>,
13124                > = None;
13125                let mut __f_debug_redact: ::core::option::Option<
13126                    ::core::option::Option<bool>,
13127                > = None;
13128                let mut __f_feature_support: ::core::option::Option<
13129                    ::buffa::MessageField<field_options::FeatureSupport>,
13130                > = None;
13131                let mut __f_uninterpreted_option: ::core::option::Option<
13132                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13133                > = None;
13134                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13135                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13136                    match key.as_str() {
13137                        "deprecated" => {
13138                            __f_deprecated = Some(
13139                                map.next_value::<::core::option::Option<bool>>()?,
13140                            );
13141                        }
13142                        "features" => {
13143                            __f_features = Some(
13144                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
13145                            );
13146                        }
13147                        "debugRedact" | "debug_redact" => {
13148                            __f_debug_redact = Some(
13149                                map.next_value::<::core::option::Option<bool>>()?,
13150                            );
13151                        }
13152                        "featureSupport" | "feature_support" => {
13153                            __f_feature_support = Some(
13154                                map
13155                                    .next_value::<
13156                                        ::buffa::MessageField<field_options::FeatureSupport>,
13157                                    >()?,
13158                            );
13159                        }
13160                        "uninterpretedOption" | "uninterpreted_option" => {
13161                            __f_uninterpreted_option = Some({
13162                                struct _S;
13163                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
13164                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
13165                                    fn deserialize<D: serde::Deserializer<'de>>(
13166                                        self,
13167                                        d: D,
13168                                    ) -> ::core::result::Result<
13169                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
13170                                        D::Error,
13171                                    > {
13172                                        ::buffa::json_helpers::null_as_default(d)
13173                                    }
13174                                }
13175                                map.next_value_seed(_S)?
13176                            });
13177                        }
13178                        __k if __k.starts_with('[') => {
13179                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13180                            match ::buffa::extension_registry::deserialize_extension_key(
13181                                "google.protobuf.EnumValueOptions",
13182                                __k,
13183                                __v,
13184                            ) {
13185                                ::core::option::Option::Some(
13186                                    ::core::result::Result::Ok(__recs),
13187                                ) => {
13188                                    for __rec in __recs {
13189                                        __ext_records.push(__rec);
13190                                    }
13191                                }
13192                                ::core::option::Option::Some(
13193                                    ::core::result::Result::Err(__e),
13194                                ) => {
13195                                    return ::core::result::Result::Err(
13196                                        <A::Error as ::serde::de::Error>::custom(__e),
13197                                    );
13198                                }
13199                                ::core::option::Option::None => {}
13200                            }
13201                        }
13202                        _ => {
13203                            map.next_value::<serde::de::IgnoredAny>()?;
13204                        }
13205                    }
13206                }
13207                let mut __r = <EnumValueOptions as ::core::default::Default>::default();
13208                if let ::core::option::Option::Some(v) = __f_deprecated {
13209                    __r.deprecated = v;
13210                }
13211                if let ::core::option::Option::Some(v) = __f_features {
13212                    __r.features = v;
13213                }
13214                if let ::core::option::Option::Some(v) = __f_debug_redact {
13215                    __r.debug_redact = v;
13216                }
13217                if let ::core::option::Option::Some(v) = __f_feature_support {
13218                    __r.feature_support = v;
13219                }
13220                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13221                    __r.uninterpreted_option = v;
13222                }
13223                for __rec in __ext_records {
13224                    __r.__buffa_unknown_fields.push(__rec);
13225                }
13226                Ok(__r)
13227            }
13228        }
13229        d.deserialize_map(_V)
13230    }
13231}
13232#[cfg(feature = "json")]
13233impl ::buffa::json_helpers::ProtoElemJson for EnumValueOptions {
13234    fn serialize_proto_json<S: ::serde::Serializer>(
13235        v: &Self,
13236        s: S,
13237    ) -> ::core::result::Result<S::Ok, S::Error> {
13238        ::serde::Serialize::serialize(v, s)
13239    }
13240    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13241        d: D,
13242    ) -> ::core::result::Result<Self, D::Error> {
13243        <Self as ::serde::Deserialize>::deserialize(d)
13244    }
13245}
13246#[doc(hidden)]
13247#[derive(Clone, Debug, Default, PartialEq)]
13248#[repr(transparent)]
13249#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13250pub struct __EnumValueOptionsExtJson(pub ::buffa::UnknownFields);
13251impl ::core::ops::Deref for __EnumValueOptionsExtJson {
13252    type Target = ::buffa::UnknownFields;
13253    fn deref(&self) -> &::buffa::UnknownFields {
13254        &self.0
13255    }
13256}
13257impl ::core::ops::DerefMut for __EnumValueOptionsExtJson {
13258    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13259        &mut self.0
13260    }
13261}
13262impl ::core::convert::From<::buffa::UnknownFields> for __EnumValueOptionsExtJson {
13263    fn from(u: ::buffa::UnknownFields) -> Self {
13264        Self(u)
13265    }
13266}
13267#[cfg(feature = "json")]
13268impl ::serde::Serialize for __EnumValueOptionsExtJson {
13269    fn serialize<S: ::serde::Serializer>(
13270        &self,
13271        s: S,
13272    ) -> ::core::result::Result<S::Ok, S::Error> {
13273        ::buffa::extension_registry::serialize_extensions(
13274            "google.protobuf.EnumValueOptions",
13275            &self.0,
13276            s,
13277        )
13278    }
13279}
13280#[cfg(feature = "json")]
13281impl<'de> ::serde::Deserialize<'de> for __EnumValueOptionsExtJson {
13282    fn deserialize<D: ::serde::Deserializer<'de>>(
13283        d: D,
13284    ) -> ::core::result::Result<Self, D::Error> {
13285        ::buffa::extension_registry::deserialize_extensions(
13286                "google.protobuf.EnumValueOptions",
13287                d,
13288            )
13289            .map(Self)
13290    }
13291}
13292#[cfg(feature = "json")]
13293#[doc(hidden)]
13294pub const __ENUM_VALUE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13295    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13296    to_json: ::buffa::type_registry::any_to_json::<EnumValueOptions>,
13297    from_json: ::buffa::type_registry::any_from_json::<EnumValueOptions>,
13298    is_wkt: false,
13299};
13300#[cfg(feature = "text")]
13301#[doc(hidden)]
13302pub const __ENUM_VALUE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13303    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13304    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueOptions>,
13305    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueOptions>,
13306};
13307#[derive(Clone, PartialEq, Default)]
13308#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13309#[cfg_attr(feature = "json", serde(default))]
13310#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13311pub struct ServiceOptions {
13312    /// Any features defined in the specific edition.
13313    /// WARNING: This field should only be used by protobuf plugins or special
13314    /// cases like the proto compiler. Other uses are discouraged and
13315    /// developers should rely on the protoreflect APIs for their client language.
13316    ///
13317    /// Field 34: `features`
13318    #[cfg_attr(
13319        feature = "json",
13320        serde(
13321            rename = "features",
13322            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13323        )
13324    )]
13325    pub features: ::buffa::MessageField<FeatureSet>,
13326    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
13327    ///   framework.  We apologize for hoarding these numbers to ourselves, but
13328    ///   we were already using them long before we decided to release Protocol
13329    ///   Buffers.
13330    ///
13331    /// Is this service deprecated?
13332    /// Depending on the target platform, this can emit Deprecated annotations
13333    /// for the service, or it will be completely ignored; in the very least,
13334    /// this is a formalization for deprecating services.
13335    ///
13336    /// Field 33: `deprecated`
13337    #[cfg_attr(
13338        feature = "json",
13339        serde(
13340            rename = "deprecated",
13341            skip_serializing_if = "::core::option::Option::is_none"
13342        )
13343    )]
13344    pub deprecated: ::core::option::Option<bool>,
13345    /// The parser stores options it doesn't recognize here. See above.
13346    ///
13347    /// Field 999: `uninterpreted_option`
13348    #[cfg_attr(
13349        feature = "json",
13350        serde(
13351            rename = "uninterpretedOption",
13352            alias = "uninterpreted_option",
13353            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13354            deserialize_with = "::buffa::json_helpers::null_as_default"
13355        )
13356    )]
13357    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13358    #[cfg_attr(feature = "json", serde(flatten))]
13359    #[doc(hidden)]
13360    pub __buffa_unknown_fields: __ServiceOptionsExtJson,
13361}
13362impl ::core::fmt::Debug for ServiceOptions {
13363    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13364        f.debug_struct("ServiceOptions")
13365            .field("features", &self.features)
13366            .field("deprecated", &self.deprecated)
13367            .field("uninterpreted_option", &self.uninterpreted_option)
13368            .finish()
13369    }
13370}
13371impl ServiceOptions {
13372    /// Protobuf type URL for this message, for use with `Any::pack` and
13373    /// `Any::unpack_if`.
13374    ///
13375    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13376    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13377}
13378impl ServiceOptions {
13379    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13380    #[inline]
13381    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13382    pub fn with_deprecated(mut self, value: bool) -> Self {
13383        self.deprecated = Some(value);
13384        self
13385    }
13386}
13387::buffa::impl_default_instance!(ServiceOptions);
13388impl ::buffa::MessageName for ServiceOptions {
13389    const PACKAGE: &'static str = "google.protobuf";
13390    const NAME: &'static str = "ServiceOptions";
13391    const FULL_NAME: &'static str = "google.protobuf.ServiceOptions";
13392    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13393}
13394impl ::buffa::Message for ServiceOptions {
13395    /// Returns the total encoded size in bytes.
13396    ///
13397    /// The result is a `u32`; the protobuf specification requires all
13398    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13399    /// compliant message will never overflow this type.
13400    #[allow(clippy::let_and_return)]
13401    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13402        #[allow(unused_imports)]
13403        use ::buffa::Enumeration as _;
13404        let mut size = 0u32;
13405        if self.deprecated.is_some() {
13406            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13407        }
13408        if self.features.is_set() {
13409            let __slot = __cache.reserve();
13410            let inner_size = self.features.compute_size(__cache);
13411            __cache.set(__slot, inner_size);
13412            size
13413                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13414                    + inner_size;
13415        }
13416        for v in &self.uninterpreted_option {
13417            let __slot = __cache.reserve();
13418            let inner_size = v.compute_size(__cache);
13419            __cache.set(__slot, inner_size);
13420            size
13421                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13422                    + inner_size;
13423        }
13424        size += self.__buffa_unknown_fields.encoded_len() as u32;
13425        size
13426    }
13427    fn write_to(
13428        &self,
13429        __cache: &mut ::buffa::SizeCache,
13430        buf: &mut impl ::buffa::bytes::BufMut,
13431    ) {
13432        #[allow(unused_imports)]
13433        use ::buffa::Enumeration as _;
13434        if let Some(v) = self.deprecated {
13435            ::buffa::types::put_bool_field(33u32, v, buf);
13436        }
13437        if self.features.is_set() {
13438            ::buffa::types::put_len_delimited_header(34u32, __cache.consume_next(), buf);
13439            self.features.write_to(__cache, buf);
13440        }
13441        for v in &self.uninterpreted_option {
13442            ::buffa::types::put_len_delimited_header(
13443                999u32,
13444                __cache.consume_next(),
13445                buf,
13446            );
13447            v.write_to(__cache, buf);
13448        }
13449        self.__buffa_unknown_fields.write_to(buf);
13450    }
13451    fn merge_field(
13452        &mut self,
13453        tag: ::buffa::encoding::Tag,
13454        buf: &mut impl ::buffa::bytes::Buf,
13455        ctx: ::buffa::DecodeContext<'_>,
13456    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13457        #[allow(unused_imports)]
13458        use ::buffa::bytes::Buf as _;
13459        #[allow(unused_imports)]
13460        use ::buffa::Enumeration as _;
13461        match tag.field_number() {
13462            33u32 => {
13463                ::buffa::encoding::check_wire_type(
13464                    tag,
13465                    ::buffa::encoding::WireType::Varint,
13466                )?;
13467                self.deprecated = ::core::option::Option::Some(
13468                    ::buffa::types::decode_bool(buf)?,
13469                );
13470            }
13471            34u32 => {
13472                ::buffa::encoding::check_wire_type(
13473                    tag,
13474                    ::buffa::encoding::WireType::LengthDelimited,
13475                )?;
13476                ::buffa::Message::merge_length_delimited(
13477                    self.features.get_or_insert_default(),
13478                    buf,
13479                    ctx,
13480                )?;
13481            }
13482            999u32 => {
13483                ::buffa::encoding::check_wire_type(
13484                    tag,
13485                    ::buffa::encoding::WireType::LengthDelimited,
13486                )?;
13487                let mut elem = ::core::default::Default::default();
13488                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13489                self.uninterpreted_option.push(elem);
13490            }
13491            _ => {
13492                self.__buffa_unknown_fields
13493                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13494            }
13495        }
13496        ::core::result::Result::Ok(())
13497    }
13498    fn clear(&mut self) {
13499        self.deprecated = ::core::option::Option::None;
13500        self.features = ::buffa::MessageField::none();
13501        self.uninterpreted_option.clear();
13502        self.__buffa_unknown_fields.clear();
13503    }
13504}
13505impl ::buffa::ExtensionSet for ServiceOptions {
13506    const PROTO_FQN: &'static str = "google.protobuf.ServiceOptions";
13507    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13508        &self.__buffa_unknown_fields
13509    }
13510    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13511        &mut self.__buffa_unknown_fields
13512    }
13513}
13514#[cfg(feature = "text")]
13515impl ::buffa::text::TextFormat for ServiceOptions {
13516    fn encode_text(
13517        &self,
13518        enc: &mut ::buffa::text::TextEncoder<'_>,
13519    ) -> ::core::fmt::Result {
13520        #[allow(unused_imports)]
13521        use ::buffa::Enumeration as _;
13522        if self.features.is_set() {
13523            enc.write_field_name("features")?;
13524            enc.write_message(&*self.features)?;
13525        }
13526        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13527            enc.write_field_name("deprecated")?;
13528            enc.write_bool(*__v)?;
13529        }
13530        for __v in &self.uninterpreted_option {
13531            enc.write_field_name("uninterpreted_option")?;
13532            enc.write_message(__v)?;
13533        }
13534        enc.write_extension_fields(
13535            "google.protobuf.ServiceOptions",
13536            &self.__buffa_unknown_fields,
13537        )?;
13538        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13539        ::core::result::Result::Ok(())
13540    }
13541    fn merge_text(
13542        &mut self,
13543        dec: &mut ::buffa::text::TextDecoder<'_>,
13544    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13545        #[allow(unused_imports)]
13546        use ::buffa::Enumeration as _;
13547        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13548            match __name {
13549                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13550                "deprecated" => {
13551                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13552                }
13553                "uninterpreted_option" => {
13554                    dec.read_repeated_into(
13555                        &mut self.uninterpreted_option,
13556                        |__d| {
13557                            let mut __m = ::core::default::Default::default();
13558                            __d.merge_message(&mut __m)?;
13559                            ::core::result::Result::Ok(__m)
13560                        },
13561                    )?
13562                }
13563                __name if __name.starts_with('[') => {
13564                    for __r in dec
13565                        .read_extension(__name, "google.protobuf.ServiceOptions")?
13566                    {
13567                        self.__buffa_unknown_fields.push(__r);
13568                    }
13569                }
13570                _ => dec.skip_value()?,
13571            }
13572        }
13573        ::core::result::Result::Ok(())
13574    }
13575}
13576#[cfg(feature = "json")]
13577impl<'de> serde::Deserialize<'de> for ServiceOptions {
13578    fn deserialize<D: serde::Deserializer<'de>>(
13579        d: D,
13580    ) -> ::core::result::Result<Self, D::Error> {
13581        struct _V;
13582        impl<'de> serde::de::Visitor<'de> for _V {
13583            type Value = ServiceOptions;
13584            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13585                f.write_str("struct ServiceOptions")
13586            }
13587            #[allow(clippy::field_reassign_with_default)]
13588            fn visit_map<A: serde::de::MapAccess<'de>>(
13589                self,
13590                mut map: A,
13591            ) -> ::core::result::Result<ServiceOptions, A::Error> {
13592                let mut __f_features: ::core::option::Option<
13593                    ::buffa::MessageField<FeatureSet>,
13594                > = None;
13595                let mut __f_deprecated: ::core::option::Option<
13596                    ::core::option::Option<bool>,
13597                > = None;
13598                let mut __f_uninterpreted_option: ::core::option::Option<
13599                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13600                > = None;
13601                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13602                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13603                    match key.as_str() {
13604                        "features" => {
13605                            __f_features = Some(
13606                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
13607                            );
13608                        }
13609                        "deprecated" => {
13610                            __f_deprecated = Some(
13611                                map.next_value::<::core::option::Option<bool>>()?,
13612                            );
13613                        }
13614                        "uninterpretedOption" | "uninterpreted_option" => {
13615                            __f_uninterpreted_option = Some({
13616                                struct _S;
13617                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
13618                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
13619                                    fn deserialize<D: serde::Deserializer<'de>>(
13620                                        self,
13621                                        d: D,
13622                                    ) -> ::core::result::Result<
13623                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
13624                                        D::Error,
13625                                    > {
13626                                        ::buffa::json_helpers::null_as_default(d)
13627                                    }
13628                                }
13629                                map.next_value_seed(_S)?
13630                            });
13631                        }
13632                        __k if __k.starts_with('[') => {
13633                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13634                            match ::buffa::extension_registry::deserialize_extension_key(
13635                                "google.protobuf.ServiceOptions",
13636                                __k,
13637                                __v,
13638                            ) {
13639                                ::core::option::Option::Some(
13640                                    ::core::result::Result::Ok(__recs),
13641                                ) => {
13642                                    for __rec in __recs {
13643                                        __ext_records.push(__rec);
13644                                    }
13645                                }
13646                                ::core::option::Option::Some(
13647                                    ::core::result::Result::Err(__e),
13648                                ) => {
13649                                    return ::core::result::Result::Err(
13650                                        <A::Error as ::serde::de::Error>::custom(__e),
13651                                    );
13652                                }
13653                                ::core::option::Option::None => {}
13654                            }
13655                        }
13656                        _ => {
13657                            map.next_value::<serde::de::IgnoredAny>()?;
13658                        }
13659                    }
13660                }
13661                let mut __r = <ServiceOptions as ::core::default::Default>::default();
13662                if let ::core::option::Option::Some(v) = __f_features {
13663                    __r.features = v;
13664                }
13665                if let ::core::option::Option::Some(v) = __f_deprecated {
13666                    __r.deprecated = v;
13667                }
13668                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13669                    __r.uninterpreted_option = v;
13670                }
13671                for __rec in __ext_records {
13672                    __r.__buffa_unknown_fields.push(__rec);
13673                }
13674                Ok(__r)
13675            }
13676        }
13677        d.deserialize_map(_V)
13678    }
13679}
13680#[cfg(feature = "json")]
13681impl ::buffa::json_helpers::ProtoElemJson for ServiceOptions {
13682    fn serialize_proto_json<S: ::serde::Serializer>(
13683        v: &Self,
13684        s: S,
13685    ) -> ::core::result::Result<S::Ok, S::Error> {
13686        ::serde::Serialize::serialize(v, s)
13687    }
13688    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13689        d: D,
13690    ) -> ::core::result::Result<Self, D::Error> {
13691        <Self as ::serde::Deserialize>::deserialize(d)
13692    }
13693}
13694#[doc(hidden)]
13695#[derive(Clone, Debug, Default, PartialEq)]
13696#[repr(transparent)]
13697#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13698pub struct __ServiceOptionsExtJson(pub ::buffa::UnknownFields);
13699impl ::core::ops::Deref for __ServiceOptionsExtJson {
13700    type Target = ::buffa::UnknownFields;
13701    fn deref(&self) -> &::buffa::UnknownFields {
13702        &self.0
13703    }
13704}
13705impl ::core::ops::DerefMut for __ServiceOptionsExtJson {
13706    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13707        &mut self.0
13708    }
13709}
13710impl ::core::convert::From<::buffa::UnknownFields> for __ServiceOptionsExtJson {
13711    fn from(u: ::buffa::UnknownFields) -> Self {
13712        Self(u)
13713    }
13714}
13715#[cfg(feature = "json")]
13716impl ::serde::Serialize for __ServiceOptionsExtJson {
13717    fn serialize<S: ::serde::Serializer>(
13718        &self,
13719        s: S,
13720    ) -> ::core::result::Result<S::Ok, S::Error> {
13721        ::buffa::extension_registry::serialize_extensions(
13722            "google.protobuf.ServiceOptions",
13723            &self.0,
13724            s,
13725        )
13726    }
13727}
13728#[cfg(feature = "json")]
13729impl<'de> ::serde::Deserialize<'de> for __ServiceOptionsExtJson {
13730    fn deserialize<D: ::serde::Deserializer<'de>>(
13731        d: D,
13732    ) -> ::core::result::Result<Self, D::Error> {
13733        ::buffa::extension_registry::deserialize_extensions(
13734                "google.protobuf.ServiceOptions",
13735                d,
13736            )
13737            .map(Self)
13738    }
13739}
13740#[cfg(feature = "json")]
13741#[doc(hidden)]
13742pub const __SERVICE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13743    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
13744    to_json: ::buffa::type_registry::any_to_json::<ServiceOptions>,
13745    from_json: ::buffa::type_registry::any_from_json::<ServiceOptions>,
13746    is_wkt: false,
13747};
13748#[cfg(feature = "text")]
13749#[doc(hidden)]
13750pub const __SERVICE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13751    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
13752    text_encode: ::buffa::type_registry::any_encode_text::<ServiceOptions>,
13753    text_merge: ::buffa::type_registry::any_merge_text::<ServiceOptions>,
13754};
13755#[derive(Clone, PartialEq, Default)]
13756#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13757#[cfg_attr(feature = "json", serde(default))]
13758#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13759pub struct MethodOptions {
13760    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
13761    ///   framework.  We apologize for hoarding these numbers to ourselves, but
13762    ///   we were already using them long before we decided to release Protocol
13763    ///   Buffers.
13764    ///
13765    /// Is this method deprecated?
13766    /// Depending on the target platform, this can emit Deprecated annotations
13767    /// for the method, or it will be completely ignored; in the very least,
13768    /// this is a formalization for deprecating methods.
13769    ///
13770    /// Field 33: `deprecated`
13771    #[cfg_attr(
13772        feature = "json",
13773        serde(
13774            rename = "deprecated",
13775            skip_serializing_if = "::core::option::Option::is_none"
13776        )
13777    )]
13778    pub deprecated: ::core::option::Option<bool>,
13779    /// Field 34: `idempotency_level`
13780    #[cfg_attr(
13781        feature = "json",
13782        serde(
13783            rename = "idempotencyLevel",
13784            alias = "idempotency_level",
13785            with = "::buffa::json_helpers::opt_closed_enum",
13786            skip_serializing_if = "::core::option::Option::is_none"
13787        )
13788    )]
13789    pub idempotency_level: ::core::option::Option<method_options::IdempotencyLevel>,
13790    /// Any features defined in the specific edition.
13791    /// WARNING: This field should only be used by protobuf plugins or special
13792    /// cases like the proto compiler. Other uses are discouraged and
13793    /// developers should rely on the protoreflect APIs for their client language.
13794    ///
13795    /// Field 35: `features`
13796    #[cfg_attr(
13797        feature = "json",
13798        serde(
13799            rename = "features",
13800            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13801        )
13802    )]
13803    pub features: ::buffa::MessageField<FeatureSet>,
13804    /// The parser stores options it doesn't recognize here. See above.
13805    ///
13806    /// Field 999: `uninterpreted_option`
13807    #[cfg_attr(
13808        feature = "json",
13809        serde(
13810            rename = "uninterpretedOption",
13811            alias = "uninterpreted_option",
13812            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13813            deserialize_with = "::buffa::json_helpers::null_as_default"
13814        )
13815    )]
13816    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13817    #[cfg_attr(feature = "json", serde(flatten))]
13818    #[doc(hidden)]
13819    pub __buffa_unknown_fields: __MethodOptionsExtJson,
13820}
13821impl ::core::fmt::Debug for MethodOptions {
13822    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13823        f.debug_struct("MethodOptions")
13824            .field("deprecated", &self.deprecated)
13825            .field("idempotency_level", &self.idempotency_level)
13826            .field("features", &self.features)
13827            .field("uninterpreted_option", &self.uninterpreted_option)
13828            .finish()
13829    }
13830}
13831impl MethodOptions {
13832    /// Protobuf type URL for this message, for use with `Any::pack` and
13833    /// `Any::unpack_if`.
13834    ///
13835    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13836    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
13837}
13838impl MethodOptions {
13839    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13840    #[inline]
13841    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13842    pub fn with_deprecated(mut self, value: bool) -> Self {
13843        self.deprecated = Some(value);
13844        self
13845    }
13846    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13847    #[inline]
13848    ///Sets [`Self::idempotency_level`] to `Some(value)`, consuming and returning `self`.
13849    pub fn with_idempotency_level(
13850        mut self,
13851        value: impl Into<method_options::IdempotencyLevel>,
13852    ) -> Self {
13853        self.idempotency_level = Some(value.into());
13854        self
13855    }
13856}
13857::buffa::impl_default_instance!(MethodOptions);
13858impl ::buffa::MessageName for MethodOptions {
13859    const PACKAGE: &'static str = "google.protobuf";
13860    const NAME: &'static str = "MethodOptions";
13861    const FULL_NAME: &'static str = "google.protobuf.MethodOptions";
13862    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
13863}
13864impl ::buffa::Message for MethodOptions {
13865    /// Returns the total encoded size in bytes.
13866    ///
13867    /// The result is a `u32`; the protobuf specification requires all
13868    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13869    /// compliant message will never overflow this type.
13870    #[allow(clippy::let_and_return)]
13871    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13872        #[allow(unused_imports)]
13873        use ::buffa::Enumeration as _;
13874        let mut size = 0u32;
13875        if self.deprecated.is_some() {
13876            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13877        }
13878        if let Some(ref v) = self.idempotency_level {
13879            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
13880        }
13881        if self.features.is_set() {
13882            let __slot = __cache.reserve();
13883            let inner_size = self.features.compute_size(__cache);
13884            __cache.set(__slot, inner_size);
13885            size
13886                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13887                    + inner_size;
13888        }
13889        for v in &self.uninterpreted_option {
13890            let __slot = __cache.reserve();
13891            let inner_size = v.compute_size(__cache);
13892            __cache.set(__slot, inner_size);
13893            size
13894                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13895                    + inner_size;
13896        }
13897        size += self.__buffa_unknown_fields.encoded_len() as u32;
13898        size
13899    }
13900    fn write_to(
13901        &self,
13902        __cache: &mut ::buffa::SizeCache,
13903        buf: &mut impl ::buffa::bytes::BufMut,
13904    ) {
13905        #[allow(unused_imports)]
13906        use ::buffa::Enumeration as _;
13907        if let Some(v) = self.deprecated {
13908            ::buffa::types::put_bool_field(33u32, v, buf);
13909        }
13910        if let Some(ref v) = self.idempotency_level {
13911            ::buffa::types::put_int32_field(34u32, v.to_i32(), buf);
13912        }
13913        if self.features.is_set() {
13914            ::buffa::types::put_len_delimited_header(35u32, __cache.consume_next(), buf);
13915            self.features.write_to(__cache, buf);
13916        }
13917        for v in &self.uninterpreted_option {
13918            ::buffa::types::put_len_delimited_header(
13919                999u32,
13920                __cache.consume_next(),
13921                buf,
13922            );
13923            v.write_to(__cache, buf);
13924        }
13925        self.__buffa_unknown_fields.write_to(buf);
13926    }
13927    fn merge_field(
13928        &mut self,
13929        tag: ::buffa::encoding::Tag,
13930        buf: &mut impl ::buffa::bytes::Buf,
13931        ctx: ::buffa::DecodeContext<'_>,
13932    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13933        #[allow(unused_imports)]
13934        use ::buffa::bytes::Buf as _;
13935        #[allow(unused_imports)]
13936        use ::buffa::Enumeration as _;
13937        match tag.field_number() {
13938            33u32 => {
13939                ::buffa::encoding::check_wire_type(
13940                    tag,
13941                    ::buffa::encoding::WireType::Varint,
13942                )?;
13943                self.deprecated = ::core::option::Option::Some(
13944                    ::buffa::types::decode_bool(buf)?,
13945                );
13946            }
13947            34u32 => {
13948                ::buffa::encoding::check_wire_type(
13949                    tag,
13950                    ::buffa::encoding::WireType::Varint,
13951                )?;
13952                let __raw = ::buffa::types::decode_int32(buf)?;
13953                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
13954                    __raw,
13955                ) {
13956                    self.idempotency_level = ::core::option::Option::Some(__v);
13957                } else {
13958                    self.__buffa_unknown_fields
13959                        .push(::buffa::UnknownField {
13960                            number: 34u32,
13961                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
13962                        });
13963                }
13964            }
13965            35u32 => {
13966                ::buffa::encoding::check_wire_type(
13967                    tag,
13968                    ::buffa::encoding::WireType::LengthDelimited,
13969                )?;
13970                ::buffa::Message::merge_length_delimited(
13971                    self.features.get_or_insert_default(),
13972                    buf,
13973                    ctx,
13974                )?;
13975            }
13976            999u32 => {
13977                ::buffa::encoding::check_wire_type(
13978                    tag,
13979                    ::buffa::encoding::WireType::LengthDelimited,
13980                )?;
13981                let mut elem = ::core::default::Default::default();
13982                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13983                self.uninterpreted_option.push(elem);
13984            }
13985            _ => {
13986                self.__buffa_unknown_fields
13987                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13988            }
13989        }
13990        ::core::result::Result::Ok(())
13991    }
13992    fn clear(&mut self) {
13993        self.deprecated = ::core::option::Option::None;
13994        self.idempotency_level = ::core::option::Option::None;
13995        self.features = ::buffa::MessageField::none();
13996        self.uninterpreted_option.clear();
13997        self.__buffa_unknown_fields.clear();
13998    }
13999}
14000impl ::buffa::ExtensionSet for MethodOptions {
14001    const PROTO_FQN: &'static str = "google.protobuf.MethodOptions";
14002    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14003        &self.__buffa_unknown_fields
14004    }
14005    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14006        &mut self.__buffa_unknown_fields
14007    }
14008}
14009#[cfg(feature = "text")]
14010impl ::buffa::text::TextFormat for MethodOptions {
14011    fn encode_text(
14012        &self,
14013        enc: &mut ::buffa::text::TextEncoder<'_>,
14014    ) -> ::core::fmt::Result {
14015        #[allow(unused_imports)]
14016        use ::buffa::Enumeration as _;
14017        if let ::core::option::Option::Some(ref __v) = self.deprecated {
14018            enc.write_field_name("deprecated")?;
14019            enc.write_bool(*__v)?;
14020        }
14021        if let ::core::option::Option::Some(ref __v) = self.idempotency_level {
14022            enc.write_field_name("idempotency_level")?;
14023            enc.write_enum_name(__v.proto_name())?;
14024        }
14025        if self.features.is_set() {
14026            enc.write_field_name("features")?;
14027            enc.write_message(&*self.features)?;
14028        }
14029        for __v in &self.uninterpreted_option {
14030            enc.write_field_name("uninterpreted_option")?;
14031            enc.write_message(__v)?;
14032        }
14033        enc.write_extension_fields(
14034            "google.protobuf.MethodOptions",
14035            &self.__buffa_unknown_fields,
14036        )?;
14037        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14038        ::core::result::Result::Ok(())
14039    }
14040    fn merge_text(
14041        &mut self,
14042        dec: &mut ::buffa::text::TextDecoder<'_>,
14043    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14044        #[allow(unused_imports)]
14045        use ::buffa::Enumeration as _;
14046        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14047            match __name {
14048                "deprecated" => {
14049                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
14050                }
14051                "idempotency_level" => {
14052                    self.idempotency_level = ::core::option::Option::Some(
14053                        dec
14054                            .read_closed_enum_by_name::<
14055                                method_options::IdempotencyLevel,
14056                            >()?,
14057                    );
14058                }
14059                "features" => dec.merge_message(self.features.get_or_insert_default())?,
14060                "uninterpreted_option" => {
14061                    dec.read_repeated_into(
14062                        &mut self.uninterpreted_option,
14063                        |__d| {
14064                            let mut __m = ::core::default::Default::default();
14065                            __d.merge_message(&mut __m)?;
14066                            ::core::result::Result::Ok(__m)
14067                        },
14068                    )?
14069                }
14070                __name if __name.starts_with('[') => {
14071                    for __r in dec
14072                        .read_extension(__name, "google.protobuf.MethodOptions")?
14073                    {
14074                        self.__buffa_unknown_fields.push(__r);
14075                    }
14076                }
14077                _ => dec.skip_value()?,
14078            }
14079        }
14080        ::core::result::Result::Ok(())
14081    }
14082}
14083#[cfg(feature = "json")]
14084impl<'de> serde::Deserialize<'de> for MethodOptions {
14085    fn deserialize<D: serde::Deserializer<'de>>(
14086        d: D,
14087    ) -> ::core::result::Result<Self, D::Error> {
14088        struct _V;
14089        impl<'de> serde::de::Visitor<'de> for _V {
14090            type Value = MethodOptions;
14091            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14092                f.write_str("struct MethodOptions")
14093            }
14094            #[allow(clippy::field_reassign_with_default)]
14095            fn visit_map<A: serde::de::MapAccess<'de>>(
14096                self,
14097                mut map: A,
14098            ) -> ::core::result::Result<MethodOptions, A::Error> {
14099                let mut __f_deprecated: ::core::option::Option<
14100                    ::core::option::Option<bool>,
14101                > = None;
14102                let mut __f_idempotency_level: ::core::option::Option<
14103                    ::core::option::Option<method_options::IdempotencyLevel>,
14104                > = None;
14105                let mut __f_features: ::core::option::Option<
14106                    ::buffa::MessageField<FeatureSet>,
14107                > = None;
14108                let mut __f_uninterpreted_option: ::core::option::Option<
14109                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14110                > = None;
14111                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14112                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14113                    match key.as_str() {
14114                        "deprecated" => {
14115                            __f_deprecated = Some(
14116                                map.next_value::<::core::option::Option<bool>>()?,
14117                            );
14118                        }
14119                        "idempotencyLevel" | "idempotency_level" => {
14120                            __f_idempotency_level = Some({
14121                                struct _S;
14122                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14123                                    type Value = ::core::option::Option<
14124                                        method_options::IdempotencyLevel,
14125                                    >;
14126                                    fn deserialize<D: serde::Deserializer<'de>>(
14127                                        self,
14128                                        d: D,
14129                                    ) -> ::core::result::Result<
14130                                        ::core::option::Option<method_options::IdempotencyLevel>,
14131                                        D::Error,
14132                                    > {
14133                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
14134                                    }
14135                                }
14136                                map.next_value_seed(_S)?
14137                            });
14138                        }
14139                        "features" => {
14140                            __f_features = Some(
14141                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
14142                            );
14143                        }
14144                        "uninterpretedOption" | "uninterpreted_option" => {
14145                            __f_uninterpreted_option = Some({
14146                                struct _S;
14147                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14148                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14149                                    fn deserialize<D: serde::Deserializer<'de>>(
14150                                        self,
14151                                        d: D,
14152                                    ) -> ::core::result::Result<
14153                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14154                                        D::Error,
14155                                    > {
14156                                        ::buffa::json_helpers::null_as_default(d)
14157                                    }
14158                                }
14159                                map.next_value_seed(_S)?
14160                            });
14161                        }
14162                        __k if __k.starts_with('[') => {
14163                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14164                            match ::buffa::extension_registry::deserialize_extension_key(
14165                                "google.protobuf.MethodOptions",
14166                                __k,
14167                                __v,
14168                            ) {
14169                                ::core::option::Option::Some(
14170                                    ::core::result::Result::Ok(__recs),
14171                                ) => {
14172                                    for __rec in __recs {
14173                                        __ext_records.push(__rec);
14174                                    }
14175                                }
14176                                ::core::option::Option::Some(
14177                                    ::core::result::Result::Err(__e),
14178                                ) => {
14179                                    return ::core::result::Result::Err(
14180                                        <A::Error as ::serde::de::Error>::custom(__e),
14181                                    );
14182                                }
14183                                ::core::option::Option::None => {}
14184                            }
14185                        }
14186                        _ => {
14187                            map.next_value::<serde::de::IgnoredAny>()?;
14188                        }
14189                    }
14190                }
14191                let mut __r = <MethodOptions as ::core::default::Default>::default();
14192                if let ::core::option::Option::Some(v) = __f_deprecated {
14193                    __r.deprecated = v;
14194                }
14195                if let ::core::option::Option::Some(v) = __f_idempotency_level {
14196                    __r.idempotency_level = v;
14197                }
14198                if let ::core::option::Option::Some(v) = __f_features {
14199                    __r.features = v;
14200                }
14201                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14202                    __r.uninterpreted_option = v;
14203                }
14204                for __rec in __ext_records {
14205                    __r.__buffa_unknown_fields.push(__rec);
14206                }
14207                Ok(__r)
14208            }
14209        }
14210        d.deserialize_map(_V)
14211    }
14212}
14213#[cfg(feature = "json")]
14214impl ::buffa::json_helpers::ProtoElemJson for MethodOptions {
14215    fn serialize_proto_json<S: ::serde::Serializer>(
14216        v: &Self,
14217        s: S,
14218    ) -> ::core::result::Result<S::Ok, S::Error> {
14219        ::serde::Serialize::serialize(v, s)
14220    }
14221    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14222        d: D,
14223    ) -> ::core::result::Result<Self, D::Error> {
14224        <Self as ::serde::Deserialize>::deserialize(d)
14225    }
14226}
14227#[doc(hidden)]
14228#[derive(Clone, Debug, Default, PartialEq)]
14229#[repr(transparent)]
14230#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14231pub struct __MethodOptionsExtJson(pub ::buffa::UnknownFields);
14232impl ::core::ops::Deref for __MethodOptionsExtJson {
14233    type Target = ::buffa::UnknownFields;
14234    fn deref(&self) -> &::buffa::UnknownFields {
14235        &self.0
14236    }
14237}
14238impl ::core::ops::DerefMut for __MethodOptionsExtJson {
14239    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14240        &mut self.0
14241    }
14242}
14243impl ::core::convert::From<::buffa::UnknownFields> for __MethodOptionsExtJson {
14244    fn from(u: ::buffa::UnknownFields) -> Self {
14245        Self(u)
14246    }
14247}
14248#[cfg(feature = "json")]
14249impl ::serde::Serialize for __MethodOptionsExtJson {
14250    fn serialize<S: ::serde::Serializer>(
14251        &self,
14252        s: S,
14253    ) -> ::core::result::Result<S::Ok, S::Error> {
14254        ::buffa::extension_registry::serialize_extensions(
14255            "google.protobuf.MethodOptions",
14256            &self.0,
14257            s,
14258        )
14259    }
14260}
14261#[cfg(feature = "json")]
14262impl<'de> ::serde::Deserialize<'de> for __MethodOptionsExtJson {
14263    fn deserialize<D: ::serde::Deserializer<'de>>(
14264        d: D,
14265    ) -> ::core::result::Result<Self, D::Error> {
14266        ::buffa::extension_registry::deserialize_extensions(
14267                "google.protobuf.MethodOptions",
14268                d,
14269            )
14270            .map(Self)
14271    }
14272}
14273#[cfg(feature = "json")]
14274#[doc(hidden)]
14275pub const __METHOD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14276    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14277    to_json: ::buffa::type_registry::any_to_json::<MethodOptions>,
14278    from_json: ::buffa::type_registry::any_from_json::<MethodOptions>,
14279    is_wkt: false,
14280};
14281#[cfg(feature = "text")]
14282#[doc(hidden)]
14283pub const __METHOD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14284    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14285    text_encode: ::buffa::type_registry::any_encode_text::<MethodOptions>,
14286    text_merge: ::buffa::type_registry::any_merge_text::<MethodOptions>,
14287};
14288pub mod method_options {
14289    #[allow(unused_imports)]
14290    use super::*;
14291    /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
14292    /// or neither? HTTP based RPC implementation may choose GET verb for safe
14293    /// methods, and PUT verb for idempotent methods instead of the default POST.
14294    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
14295    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14296    #[repr(i32)]
14297    pub enum IdempotencyLevel {
14298        IDEMPOTENCY_UNKNOWN = 0i32,
14299        /// implies idempotent
14300        NO_SIDE_EFFECTS = 1i32,
14301        /// idempotent, but may have side effects
14302        IDEMPOTENT = 2i32,
14303    }
14304    impl IdempotencyLevel {
14305        ///Idiomatic alias for [`Self::IDEMPOTENCY_UNKNOWN`]; `Debug` prints the variant name.
14306        #[allow(non_upper_case_globals)]
14307        pub const IdempotencyUnknown: Self = Self::IDEMPOTENCY_UNKNOWN;
14308        ///Idiomatic alias for [`Self::NO_SIDE_EFFECTS`]; `Debug` prints the variant name.
14309        #[allow(non_upper_case_globals)]
14310        pub const NoSideEffects: Self = Self::NO_SIDE_EFFECTS;
14311        ///Idiomatic alias for [`Self::IDEMPOTENT`]; `Debug` prints the variant name.
14312        #[allow(non_upper_case_globals)]
14313        pub const Idempotent: Self = Self::IDEMPOTENT;
14314    }
14315    impl ::core::default::Default for IdempotencyLevel {
14316        fn default() -> Self {
14317            Self::IDEMPOTENCY_UNKNOWN
14318        }
14319    }
14320    #[cfg(feature = "json")]
14321    const _: () = {
14322        impl ::serde::Serialize for IdempotencyLevel {
14323            fn serialize<S: ::serde::Serializer>(
14324                &self,
14325                s: S,
14326            ) -> ::core::result::Result<S::Ok, S::Error> {
14327                s.serialize_str(::buffa::Enumeration::proto_name(self))
14328            }
14329        }
14330        impl<'de> ::serde::Deserialize<'de> for IdempotencyLevel {
14331            fn deserialize<D: ::serde::Deserializer<'de>>(
14332                d: D,
14333            ) -> ::core::result::Result<Self, D::Error> {
14334                struct _V;
14335                impl ::serde::de::Visitor<'_> for _V {
14336                    type Value = IdempotencyLevel;
14337                    fn expecting(
14338                        &self,
14339                        f: &mut ::core::fmt::Formatter<'_>,
14340                    ) -> ::core::fmt::Result {
14341                        f.write_str(
14342                            concat!(
14343                                "a string, integer, or null for ",
14344                                stringify!(IdempotencyLevel)
14345                            ),
14346                        )
14347                    }
14348                    fn visit_str<E: ::serde::de::Error>(
14349                        self,
14350                        v: &str,
14351                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14352                        <IdempotencyLevel as ::buffa::Enumeration>::from_proto_name(v)
14353                            .ok_or_else(|| {
14354                                ::serde::de::Error::unknown_variant(v, &[])
14355                            })
14356                    }
14357                    fn visit_i64<E: ::serde::de::Error>(
14358                        self,
14359                        v: i64,
14360                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14361                        let v32 = i32::try_from(v)
14362                            .map_err(|_| {
14363                                ::serde::de::Error::custom(
14364                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14365                                )
14366                            })?;
14367                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14368                            .ok_or_else(|| {
14369                                ::serde::de::Error::custom(
14370                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14371                                )
14372                            })
14373                    }
14374                    fn visit_u64<E: ::serde::de::Error>(
14375                        self,
14376                        v: u64,
14377                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14378                        let v32 = i32::try_from(v)
14379                            .map_err(|_| {
14380                                ::serde::de::Error::custom(
14381                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14382                                )
14383                            })?;
14384                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14385                            .ok_or_else(|| {
14386                                ::serde::de::Error::custom(
14387                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14388                                )
14389                            })
14390                    }
14391                    fn visit_unit<E: ::serde::de::Error>(
14392                        self,
14393                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14394                        ::core::result::Result::Ok(::core::default::Default::default())
14395                    }
14396                }
14397                d.deserialize_any(_V)
14398            }
14399        }
14400        impl ::buffa::json_helpers::ProtoElemJson for IdempotencyLevel {
14401            fn serialize_proto_json<S: ::serde::Serializer>(
14402                v: &Self,
14403                s: S,
14404            ) -> ::core::result::Result<S::Ok, S::Error> {
14405                ::serde::Serialize::serialize(v, s)
14406            }
14407            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14408                d: D,
14409            ) -> ::core::result::Result<Self, D::Error> {
14410                <Self as ::serde::Deserialize>::deserialize(d)
14411            }
14412        }
14413    };
14414    impl ::buffa::Enumeration for IdempotencyLevel {
14415        fn from_i32(value: i32) -> ::core::option::Option<Self> {
14416            match value {
14417                0i32 => ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
14418                1i32 => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14419                2i32 => ::core::option::Option::Some(Self::IDEMPOTENT),
14420                _ => ::core::option::Option::None,
14421            }
14422        }
14423        fn to_i32(&self) -> i32 {
14424            *self as i32
14425        }
14426        fn proto_name(&self) -> &'static str {
14427            match self {
14428                Self::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN",
14429                Self::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS",
14430                Self::IDEMPOTENT => "IDEMPOTENT",
14431            }
14432        }
14433        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
14434            match name {
14435                "IDEMPOTENCY_UNKNOWN" => {
14436                    ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN)
14437                }
14438                "NO_SIDE_EFFECTS" => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14439                "IDEMPOTENT" => ::core::option::Option::Some(Self::IDEMPOTENT),
14440                _ => ::core::option::Option::None,
14441            }
14442        }
14443        fn values() -> &'static [Self] {
14444            &[Self::IDEMPOTENCY_UNKNOWN, Self::NO_SIDE_EFFECTS, Self::IDEMPOTENT]
14445        }
14446    }
14447}
14448/// A message representing a option the parser does not recognize. This only
14449/// appears in options protos created by the compiler::Parser class.
14450/// DescriptorPool resolves these when building Descriptor objects. Therefore,
14451/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
14452/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
14453/// in them.
14454#[derive(Clone, PartialEq, Default)]
14455#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
14456#[cfg_attr(feature = "json", serde(default))]
14457#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14458pub struct UninterpretedOption {
14459    /// Field 2: `name`
14460    #[cfg_attr(
14461        feature = "json",
14462        serde(
14463            rename = "name",
14464            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14465            deserialize_with = "::buffa::json_helpers::null_as_default"
14466        )
14467    )]
14468    pub name: ::buffa::alloc::vec::Vec<uninterpreted_option::NamePart>,
14469    /// The value of the uninterpreted option, in whatever type the tokenizer
14470    /// identified it as during parsing. Exactly one of these should be set.
14471    ///
14472    /// Field 3: `identifier_value`
14473    #[cfg_attr(
14474        feature = "json",
14475        serde(
14476            rename = "identifierValue",
14477            alias = "identifier_value",
14478            skip_serializing_if = "::core::option::Option::is_none"
14479        )
14480    )]
14481    pub identifier_value: ::core::option::Option<::buffa::alloc::string::String>,
14482    /// Field 4: `positive_int_value`
14483    #[cfg_attr(
14484        feature = "json",
14485        serde(
14486            rename = "positiveIntValue",
14487            alias = "positive_int_value",
14488            with = "::buffa::json_helpers::opt_uint64",
14489            skip_serializing_if = "::core::option::Option::is_none"
14490        )
14491    )]
14492    pub positive_int_value: ::core::option::Option<u64>,
14493    /// Field 5: `negative_int_value`
14494    #[cfg_attr(
14495        feature = "json",
14496        serde(
14497            rename = "negativeIntValue",
14498            alias = "negative_int_value",
14499            with = "::buffa::json_helpers::opt_int64",
14500            skip_serializing_if = "::core::option::Option::is_none"
14501        )
14502    )]
14503    pub negative_int_value: ::core::option::Option<i64>,
14504    /// Field 6: `double_value`
14505    #[cfg_attr(
14506        feature = "json",
14507        serde(
14508            rename = "doubleValue",
14509            alias = "double_value",
14510            with = "::buffa::json_helpers::opt_double",
14511            skip_serializing_if = "::core::option::Option::is_none"
14512        )
14513    )]
14514    pub double_value: ::core::option::Option<f64>,
14515    /// Field 7: `string_value`
14516    #[cfg_attr(
14517        feature = "json",
14518        serde(
14519            rename = "stringValue",
14520            alias = "string_value",
14521            with = "::buffa::json_helpers::opt_bytes",
14522            skip_serializing_if = "::core::option::Option::is_none"
14523        )
14524    )]
14525    pub string_value: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
14526    /// Field 8: `aggregate_value`
14527    #[cfg_attr(
14528        feature = "json",
14529        serde(
14530            rename = "aggregateValue",
14531            alias = "aggregate_value",
14532            skip_serializing_if = "::core::option::Option::is_none"
14533        )
14534    )]
14535    pub aggregate_value: ::core::option::Option<::buffa::alloc::string::String>,
14536    #[cfg_attr(feature = "json", serde(skip))]
14537    #[doc(hidden)]
14538    pub __buffa_unknown_fields: ::buffa::UnknownFields,
14539}
14540impl ::core::fmt::Debug for UninterpretedOption {
14541    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14542        f.debug_struct("UninterpretedOption")
14543            .field("name", &self.name)
14544            .field("identifier_value", &self.identifier_value)
14545            .field("positive_int_value", &self.positive_int_value)
14546            .field("negative_int_value", &self.negative_int_value)
14547            .field("double_value", &self.double_value)
14548            .field("string_value", &self.string_value)
14549            .field("aggregate_value", &self.aggregate_value)
14550            .finish()
14551    }
14552}
14553impl UninterpretedOption {
14554    /// Protobuf type URL for this message, for use with `Any::pack` and
14555    /// `Any::unpack_if`.
14556    ///
14557    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14558    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
14559}
14560impl UninterpretedOption {
14561    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14562    #[inline]
14563    ///Sets [`Self::identifier_value`] to `Some(value)`, consuming and returning `self`.
14564    pub fn with_identifier_value(
14565        mut self,
14566        value: impl Into<::buffa::alloc::string::String>,
14567    ) -> Self {
14568        self.identifier_value = Some(value.into());
14569        self
14570    }
14571    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14572    #[inline]
14573    ///Sets [`Self::positive_int_value`] to `Some(value)`, consuming and returning `self`.
14574    pub fn with_positive_int_value(mut self, value: u64) -> Self {
14575        self.positive_int_value = Some(value);
14576        self
14577    }
14578    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14579    #[inline]
14580    ///Sets [`Self::negative_int_value`] to `Some(value)`, consuming and returning `self`.
14581    pub fn with_negative_int_value(mut self, value: i64) -> Self {
14582        self.negative_int_value = Some(value);
14583        self
14584    }
14585    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14586    #[inline]
14587    ///Sets [`Self::double_value`] to `Some(value)`, consuming and returning `self`.
14588    pub fn with_double_value(mut self, value: f64) -> Self {
14589        self.double_value = Some(value);
14590        self
14591    }
14592    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14593    #[inline]
14594    ///Sets [`Self::string_value`] to `Some(value)`, consuming and returning `self`.
14595    pub fn with_string_value(
14596        mut self,
14597        value: impl Into<::buffa::alloc::vec::Vec<u8>>,
14598    ) -> Self {
14599        self.string_value = Some(value.into());
14600        self
14601    }
14602    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14603    #[inline]
14604    ///Sets [`Self::aggregate_value`] to `Some(value)`, consuming and returning `self`.
14605    pub fn with_aggregate_value(
14606        mut self,
14607        value: impl Into<::buffa::alloc::string::String>,
14608    ) -> Self {
14609        self.aggregate_value = Some(value.into());
14610        self
14611    }
14612}
14613::buffa::impl_default_instance!(UninterpretedOption);
14614impl ::buffa::MessageName for UninterpretedOption {
14615    const PACKAGE: &'static str = "google.protobuf";
14616    const NAME: &'static str = "UninterpretedOption";
14617    const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption";
14618    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
14619}
14620impl ::buffa::Message for UninterpretedOption {
14621    /// Returns the total encoded size in bytes.
14622    ///
14623    /// The result is a `u32`; the protobuf specification requires all
14624    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
14625    /// compliant message will never overflow this type.
14626    #[allow(clippy::let_and_return)]
14627    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14628        #[allow(unused_imports)]
14629        use ::buffa::Enumeration as _;
14630        let mut size = 0u32;
14631        for v in &self.name {
14632            let __slot = __cache.reserve();
14633            let inner_size = v.compute_size(__cache);
14634            __cache.set(__slot, inner_size);
14635            size
14636                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14637                    + inner_size;
14638        }
14639        if let Some(ref v) = self.identifier_value {
14640            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
14641        }
14642        if let Some(v) = self.positive_int_value {
14643            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
14644        }
14645        if let Some(v) = self.negative_int_value {
14646            size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
14647        }
14648        if self.double_value.is_some() {
14649            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
14650        }
14651        if let Some(ref v) = self.string_value {
14652            size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
14653        }
14654        if let Some(ref v) = self.aggregate_value {
14655            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
14656        }
14657        size += self.__buffa_unknown_fields.encoded_len() as u32;
14658        size
14659    }
14660    fn write_to(
14661        &self,
14662        __cache: &mut ::buffa::SizeCache,
14663        buf: &mut impl ::buffa::bytes::BufMut,
14664    ) {
14665        #[allow(unused_imports)]
14666        use ::buffa::Enumeration as _;
14667        for v in &self.name {
14668            ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
14669            v.write_to(__cache, buf);
14670        }
14671        if let Some(ref v) = self.identifier_value {
14672            ::buffa::types::put_string_field(3u32, v, buf);
14673        }
14674        if let Some(v) = self.positive_int_value {
14675            ::buffa::types::put_uint64_field(4u32, v, buf);
14676        }
14677        if let Some(v) = self.negative_int_value {
14678            ::buffa::types::put_int64_field(5u32, v, buf);
14679        }
14680        if let Some(v) = self.double_value {
14681            ::buffa::types::put_double_field(6u32, v, buf);
14682        }
14683        if let Some(ref v) = self.string_value {
14684            ::buffa::types::put_bytes_field(7u32, v, buf);
14685        }
14686        if let Some(ref v) = self.aggregate_value {
14687            ::buffa::types::put_string_field(8u32, v, buf);
14688        }
14689        self.__buffa_unknown_fields.write_to(buf);
14690    }
14691    fn merge_field(
14692        &mut self,
14693        tag: ::buffa::encoding::Tag,
14694        buf: &mut impl ::buffa::bytes::Buf,
14695        ctx: ::buffa::DecodeContext<'_>,
14696    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14697        #[allow(unused_imports)]
14698        use ::buffa::bytes::Buf as _;
14699        #[allow(unused_imports)]
14700        use ::buffa::Enumeration as _;
14701        match tag.field_number() {
14702            2u32 => {
14703                ::buffa::encoding::check_wire_type(
14704                    tag,
14705                    ::buffa::encoding::WireType::LengthDelimited,
14706                )?;
14707                let mut elem = ::core::default::Default::default();
14708                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
14709                self.name.push(elem);
14710            }
14711            3u32 => {
14712                ::buffa::encoding::check_wire_type(
14713                    tag,
14714                    ::buffa::encoding::WireType::LengthDelimited,
14715                )?;
14716                ::buffa::types::merge_string(
14717                    self
14718                        .identifier_value
14719                        .get_or_insert_with(::buffa::alloc::string::String::new),
14720                    buf,
14721                )?;
14722            }
14723            4u32 => {
14724                ::buffa::encoding::check_wire_type(
14725                    tag,
14726                    ::buffa::encoding::WireType::Varint,
14727                )?;
14728                self.positive_int_value = ::core::option::Option::Some(
14729                    ::buffa::types::decode_uint64(buf)?,
14730                );
14731            }
14732            5u32 => {
14733                ::buffa::encoding::check_wire_type(
14734                    tag,
14735                    ::buffa::encoding::WireType::Varint,
14736                )?;
14737                self.negative_int_value = ::core::option::Option::Some(
14738                    ::buffa::types::decode_int64(buf)?,
14739                );
14740            }
14741            6u32 => {
14742                ::buffa::encoding::check_wire_type(
14743                    tag,
14744                    ::buffa::encoding::WireType::Fixed64,
14745                )?;
14746                self.double_value = ::core::option::Option::Some(
14747                    ::buffa::types::decode_double(buf)?,
14748                );
14749            }
14750            7u32 => {
14751                ::buffa::encoding::check_wire_type(
14752                    tag,
14753                    ::buffa::encoding::WireType::LengthDelimited,
14754                )?;
14755                ::buffa::types::merge_bytes(
14756                    self.string_value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
14757                    buf,
14758                )?;
14759            }
14760            8u32 => {
14761                ::buffa::encoding::check_wire_type(
14762                    tag,
14763                    ::buffa::encoding::WireType::LengthDelimited,
14764                )?;
14765                ::buffa::types::merge_string(
14766                    self
14767                        .aggregate_value
14768                        .get_or_insert_with(::buffa::alloc::string::String::new),
14769                    buf,
14770                )?;
14771            }
14772            _ => {
14773                self.__buffa_unknown_fields
14774                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
14775            }
14776        }
14777        ::core::result::Result::Ok(())
14778    }
14779    fn clear(&mut self) {
14780        self.name.clear();
14781        self.identifier_value = ::core::option::Option::None;
14782        self.positive_int_value = ::core::option::Option::None;
14783        self.negative_int_value = ::core::option::Option::None;
14784        self.double_value = ::core::option::Option::None;
14785        self.string_value = ::core::option::Option::None;
14786        self.aggregate_value = ::core::option::Option::None;
14787        self.__buffa_unknown_fields.clear();
14788    }
14789}
14790impl ::buffa::ExtensionSet for UninterpretedOption {
14791    const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption";
14792    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14793        &self.__buffa_unknown_fields
14794    }
14795    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14796        &mut self.__buffa_unknown_fields
14797    }
14798}
14799#[cfg(feature = "text")]
14800impl ::buffa::text::TextFormat for UninterpretedOption {
14801    fn encode_text(
14802        &self,
14803        enc: &mut ::buffa::text::TextEncoder<'_>,
14804    ) -> ::core::fmt::Result {
14805        #[allow(unused_imports)]
14806        use ::buffa::Enumeration as _;
14807        if let ::core::option::Option::Some(ref __v) = self.identifier_value {
14808            enc.write_field_name("identifier_value")?;
14809            enc.write_string(__v)?;
14810        }
14811        if let ::core::option::Option::Some(ref __v) = self.positive_int_value {
14812            enc.write_field_name("positive_int_value")?;
14813            enc.write_u64(*__v)?;
14814        }
14815        if let ::core::option::Option::Some(ref __v) = self.negative_int_value {
14816            enc.write_field_name("negative_int_value")?;
14817            enc.write_i64(*__v)?;
14818        }
14819        if let ::core::option::Option::Some(ref __v) = self.double_value {
14820            enc.write_field_name("double_value")?;
14821            enc.write_f64(*__v)?;
14822        }
14823        if let ::core::option::Option::Some(ref __v) = self.string_value {
14824            enc.write_field_name("string_value")?;
14825            enc.write_bytes(__v)?;
14826        }
14827        if let ::core::option::Option::Some(ref __v) = self.aggregate_value {
14828            enc.write_field_name("aggregate_value")?;
14829            enc.write_string(__v)?;
14830        }
14831        for __v in &self.name {
14832            enc.write_field_name("name")?;
14833            enc.write_message(__v)?;
14834        }
14835        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14836        ::core::result::Result::Ok(())
14837    }
14838    fn merge_text(
14839        &mut self,
14840        dec: &mut ::buffa::text::TextDecoder<'_>,
14841    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14842        #[allow(unused_imports)]
14843        use ::buffa::Enumeration as _;
14844        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14845            match __name {
14846                "identifier_value" => {
14847                    self.identifier_value = ::core::option::Option::Some(
14848                        dec.read_string()?.into_owned(),
14849                    );
14850                }
14851                "positive_int_value" => {
14852                    self.positive_int_value = ::core::option::Option::Some(
14853                        dec.read_u64()?,
14854                    );
14855                }
14856                "negative_int_value" => {
14857                    self.negative_int_value = ::core::option::Option::Some(
14858                        dec.read_i64()?,
14859                    );
14860                }
14861                "double_value" => {
14862                    self.double_value = ::core::option::Option::Some(dec.read_f64()?);
14863                }
14864                "string_value" => {
14865                    self.string_value = ::core::option::Option::Some(dec.read_bytes()?);
14866                }
14867                "aggregate_value" => {
14868                    self.aggregate_value = ::core::option::Option::Some(
14869                        dec.read_string()?.into_owned(),
14870                    );
14871                }
14872                "name" => {
14873                    dec.read_repeated_into(
14874                        &mut self.name,
14875                        |__d| {
14876                            let mut __m = ::core::default::Default::default();
14877                            __d.merge_message(&mut __m)?;
14878                            ::core::result::Result::Ok(__m)
14879                        },
14880                    )?
14881                }
14882                _ => dec.skip_value()?,
14883            }
14884        }
14885        ::core::result::Result::Ok(())
14886    }
14887}
14888#[cfg(feature = "json")]
14889impl ::buffa::json_helpers::ProtoElemJson for UninterpretedOption {
14890    fn serialize_proto_json<S: ::serde::Serializer>(
14891        v: &Self,
14892        s: S,
14893    ) -> ::core::result::Result<S::Ok, S::Error> {
14894        ::serde::Serialize::serialize(v, s)
14895    }
14896    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14897        d: D,
14898    ) -> ::core::result::Result<Self, D::Error> {
14899        <Self as ::serde::Deserialize>::deserialize(d)
14900    }
14901}
14902#[cfg(feature = "json")]
14903#[doc(hidden)]
14904pub const __UNINTERPRETED_OPTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14905    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
14906    to_json: ::buffa::type_registry::any_to_json::<UninterpretedOption>,
14907    from_json: ::buffa::type_registry::any_from_json::<UninterpretedOption>,
14908    is_wkt: false,
14909};
14910#[cfg(feature = "text")]
14911#[doc(hidden)]
14912pub const __UNINTERPRETED_OPTION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14913    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
14914    text_encode: ::buffa::type_registry::any_encode_text::<UninterpretedOption>,
14915    text_merge: ::buffa::type_registry::any_merge_text::<UninterpretedOption>,
14916};
14917pub mod uninterpreted_option {
14918    #[allow(unused_imports)]
14919    use super::*;
14920    /// The name of the uninterpreted option.  Each string represents a segment in
14921    /// a dot-separated name.  is_extension is true iff a segment represents an
14922    /// extension (denoted with parentheses in options specs in .proto files).
14923    /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["moo", false\] } represents
14924    /// "foo.(bar.baz).moo".
14925    #[derive(Clone, PartialEq, Default)]
14926    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
14927    #[cfg_attr(feature = "json", serde(default))]
14928    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14929    pub struct NamePart {
14930        /// Field 1: `name_part`
14931        #[cfg_attr(
14932            feature = "json",
14933            serde(
14934                rename = "namePart",
14935                alias = "name_part",
14936                with = "::buffa::json_helpers::proto_string"
14937            )
14938        )]
14939        pub name_part: ::buffa::alloc::string::String,
14940        /// Field 2: `is_extension`
14941        #[cfg_attr(
14942            feature = "json",
14943            serde(
14944                rename = "isExtension",
14945                alias = "is_extension",
14946                with = "::buffa::json_helpers::proto_bool"
14947            )
14948        )]
14949        pub is_extension: bool,
14950        #[cfg_attr(feature = "json", serde(skip))]
14951        #[doc(hidden)]
14952        pub __buffa_unknown_fields: ::buffa::UnknownFields,
14953    }
14954    impl ::core::fmt::Debug for NamePart {
14955        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14956            f.debug_struct("NamePart")
14957                .field("name_part", &self.name_part)
14958                .field("is_extension", &self.is_extension)
14959                .finish()
14960        }
14961    }
14962    impl NamePart {
14963        /// Protobuf type URL for this message, for use with `Any::pack` and
14964        /// `Any::unpack_if`.
14965        ///
14966        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14967        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
14968    }
14969    ::buffa::impl_default_instance!(NamePart);
14970    impl ::buffa::MessageName for NamePart {
14971        const PACKAGE: &'static str = "google.protobuf";
14972        const NAME: &'static str = "UninterpretedOption.NamePart";
14973        const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption.NamePart";
14974        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
14975    }
14976    impl ::buffa::Message for NamePart {
14977        /// Returns the total encoded size in bytes.
14978        ///
14979        /// The result is a `u32`; the protobuf specification requires all
14980        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
14981        /// compliant message will never overflow this type.
14982        #[allow(clippy::let_and_return)]
14983        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
14984            #[allow(unused_imports)]
14985            use ::buffa::Enumeration as _;
14986            let mut size = 0u32;
14987            size += 1u32 + ::buffa::types::string_encoded_len(&self.name_part) as u32;
14988            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
14989            size += self.__buffa_unknown_fields.encoded_len() as u32;
14990            size
14991        }
14992        fn write_to(
14993            &self,
14994            _cache: &mut ::buffa::SizeCache,
14995            buf: &mut impl ::buffa::bytes::BufMut,
14996        ) {
14997            #[allow(unused_imports)]
14998            use ::buffa::Enumeration as _;
14999            ::buffa::types::put_string_field(1u32, &self.name_part, buf);
15000            ::buffa::types::put_bool_field(2u32, self.is_extension, buf);
15001            self.__buffa_unknown_fields.write_to(buf);
15002        }
15003        fn merge_field(
15004            &mut self,
15005            tag: ::buffa::encoding::Tag,
15006            buf: &mut impl ::buffa::bytes::Buf,
15007            ctx: ::buffa::DecodeContext<'_>,
15008        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15009            #[allow(unused_imports)]
15010            use ::buffa::bytes::Buf as _;
15011            #[allow(unused_imports)]
15012            use ::buffa::Enumeration as _;
15013            match tag.field_number() {
15014                1u32 => {
15015                    ::buffa::encoding::check_wire_type(
15016                        tag,
15017                        ::buffa::encoding::WireType::LengthDelimited,
15018                    )?;
15019                    ::buffa::types::merge_string(&mut self.name_part, buf)?;
15020                }
15021                2u32 => {
15022                    ::buffa::encoding::check_wire_type(
15023                        tag,
15024                        ::buffa::encoding::WireType::Varint,
15025                    )?;
15026                    self.is_extension = ::buffa::types::decode_bool(buf)?;
15027                }
15028                _ => {
15029                    self.__buffa_unknown_fields
15030                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15031                }
15032            }
15033            ::core::result::Result::Ok(())
15034        }
15035        fn clear(&mut self) {
15036            self.name_part.clear();
15037            self.is_extension = false;
15038            self.__buffa_unknown_fields.clear();
15039        }
15040    }
15041    impl ::buffa::ExtensionSet for NamePart {
15042        const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption.NamePart";
15043        fn unknown_fields(&self) -> &::buffa::UnknownFields {
15044            &self.__buffa_unknown_fields
15045        }
15046        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15047            &mut self.__buffa_unknown_fields
15048        }
15049    }
15050    #[cfg(feature = "text")]
15051    impl ::buffa::text::TextFormat for NamePart {
15052        fn encode_text(
15053            &self,
15054            enc: &mut ::buffa::text::TextEncoder<'_>,
15055        ) -> ::core::fmt::Result {
15056            #[allow(unused_imports)]
15057            use ::buffa::Enumeration as _;
15058            enc.write_field_name("name_part")?;
15059            enc.write_string(&self.name_part)?;
15060            enc.write_field_name("is_extension")?;
15061            enc.write_bool(self.is_extension)?;
15062            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15063            ::core::result::Result::Ok(())
15064        }
15065        fn merge_text(
15066            &mut self,
15067            dec: &mut ::buffa::text::TextDecoder<'_>,
15068        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15069            #[allow(unused_imports)]
15070            use ::buffa::Enumeration as _;
15071            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15072                match __name {
15073                    "name_part" => self.name_part = dec.read_string()?.into_owned(),
15074                    "is_extension" => self.is_extension = dec.read_bool()?,
15075                    _ => dec.skip_value()?,
15076                }
15077            }
15078            ::core::result::Result::Ok(())
15079        }
15080    }
15081    #[cfg(feature = "json")]
15082    impl ::buffa::json_helpers::ProtoElemJson for NamePart {
15083        fn serialize_proto_json<S: ::serde::Serializer>(
15084            v: &Self,
15085            s: S,
15086        ) -> ::core::result::Result<S::Ok, S::Error> {
15087            ::serde::Serialize::serialize(v, s)
15088        }
15089        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15090            d: D,
15091        ) -> ::core::result::Result<Self, D::Error> {
15092            <Self as ::serde::Deserialize>::deserialize(d)
15093        }
15094    }
15095    #[cfg(feature = "json")]
15096    #[doc(hidden)]
15097    pub const __NAME_PART_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15098        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15099        to_json: ::buffa::type_registry::any_to_json::<NamePart>,
15100        from_json: ::buffa::type_registry::any_from_json::<NamePart>,
15101        is_wkt: false,
15102    };
15103    #[cfg(feature = "text")]
15104    #[doc(hidden)]
15105    pub const __NAME_PART_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15106        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15107        text_encode: ::buffa::type_registry::any_encode_text::<NamePart>,
15108        text_merge: ::buffa::type_registry::any_merge_text::<NamePart>,
15109    };
15110    #[cfg(feature = "views")]
15111    #[doc(inline)]
15112    pub use super::__buffa::view::uninterpreted_option::NamePartView;
15113    #[cfg(feature = "views")]
15114    #[doc(inline)]
15115    pub use super::__buffa::view::uninterpreted_option::NamePartOwnedView;
15116}
15117/// ===================================================================
15118/// Features
15119///
15120/// TODO Enums in C++ gencode (and potentially other languages) are
15121/// not well scoped.  This means that each of the feature enums below can clash
15122/// with each other.  The short names we've chosen maximize call-site
15123/// readability, but leave us very open to this scenario.  A future feature will
15124/// be designed and implemented to handle this, hopefully before we ever hit a
15125/// conflict here.
15126#[derive(Clone, PartialEq, Default)]
15127#[cfg_attr(feature = "json", derive(::serde::Serialize))]
15128#[cfg_attr(feature = "json", serde(default))]
15129#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15130pub struct FeatureSet {
15131    /// Field 1: `field_presence`
15132    #[cfg_attr(
15133        feature = "json",
15134        serde(
15135            rename = "fieldPresence",
15136            alias = "field_presence",
15137            with = "::buffa::json_helpers::opt_closed_enum",
15138            skip_serializing_if = "::core::option::Option::is_none"
15139        )
15140    )]
15141    pub field_presence: ::core::option::Option<feature_set::FieldPresence>,
15142    /// Field 2: `enum_type`
15143    #[cfg_attr(
15144        feature = "json",
15145        serde(
15146            rename = "enumType",
15147            alias = "enum_type",
15148            with = "::buffa::json_helpers::opt_closed_enum",
15149            skip_serializing_if = "::core::option::Option::is_none"
15150        )
15151    )]
15152    pub enum_type: ::core::option::Option<feature_set::EnumType>,
15153    /// Field 3: `repeated_field_encoding`
15154    #[cfg_attr(
15155        feature = "json",
15156        serde(
15157            rename = "repeatedFieldEncoding",
15158            alias = "repeated_field_encoding",
15159            with = "::buffa::json_helpers::opt_closed_enum",
15160            skip_serializing_if = "::core::option::Option::is_none"
15161        )
15162    )]
15163    pub repeated_field_encoding: ::core::option::Option<
15164        feature_set::RepeatedFieldEncoding,
15165    >,
15166    /// Field 4: `utf8_validation`
15167    #[cfg_attr(
15168        feature = "json",
15169        serde(
15170            rename = "utf8Validation",
15171            alias = "utf8_validation",
15172            with = "::buffa::json_helpers::opt_closed_enum",
15173            skip_serializing_if = "::core::option::Option::is_none"
15174        )
15175    )]
15176    pub utf8_validation: ::core::option::Option<feature_set::Utf8Validation>,
15177    /// Field 5: `message_encoding`
15178    #[cfg_attr(
15179        feature = "json",
15180        serde(
15181            rename = "messageEncoding",
15182            alias = "message_encoding",
15183            with = "::buffa::json_helpers::opt_closed_enum",
15184            skip_serializing_if = "::core::option::Option::is_none"
15185        )
15186    )]
15187    pub message_encoding: ::core::option::Option<feature_set::MessageEncoding>,
15188    /// Field 6: `json_format`
15189    #[cfg_attr(
15190        feature = "json",
15191        serde(
15192            rename = "jsonFormat",
15193            alias = "json_format",
15194            with = "::buffa::json_helpers::opt_closed_enum",
15195            skip_serializing_if = "::core::option::Option::is_none"
15196        )
15197    )]
15198    pub json_format: ::core::option::Option<feature_set::JsonFormat>,
15199    /// Field 7: `enforce_naming_style`
15200    #[cfg_attr(
15201        feature = "json",
15202        serde(
15203            rename = "enforceNamingStyle",
15204            alias = "enforce_naming_style",
15205            with = "::buffa::json_helpers::opt_closed_enum",
15206            skip_serializing_if = "::core::option::Option::is_none"
15207        )
15208    )]
15209    pub enforce_naming_style: ::core::option::Option<feature_set::EnforceNamingStyle>,
15210    /// Field 8: `default_symbol_visibility`
15211    #[cfg_attr(
15212        feature = "json",
15213        serde(
15214            rename = "defaultSymbolVisibility",
15215            alias = "default_symbol_visibility",
15216            with = "::buffa::json_helpers::opt_closed_enum",
15217            skip_serializing_if = "::core::option::Option::is_none"
15218        )
15219    )]
15220    pub default_symbol_visibility: ::core::option::Option<
15221        feature_set::visibility_feature::DefaultSymbolVisibility,
15222    >,
15223    #[cfg_attr(feature = "json", serde(flatten))]
15224    #[doc(hidden)]
15225    pub __buffa_unknown_fields: __FeatureSetExtJson,
15226}
15227impl ::core::fmt::Debug for FeatureSet {
15228    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15229        f.debug_struct("FeatureSet")
15230            .field("field_presence", &self.field_presence)
15231            .field("enum_type", &self.enum_type)
15232            .field("repeated_field_encoding", &self.repeated_field_encoding)
15233            .field("utf8_validation", &self.utf8_validation)
15234            .field("message_encoding", &self.message_encoding)
15235            .field("json_format", &self.json_format)
15236            .field("enforce_naming_style", &self.enforce_naming_style)
15237            .field("default_symbol_visibility", &self.default_symbol_visibility)
15238            .finish()
15239    }
15240}
15241impl FeatureSet {
15242    /// Protobuf type URL for this message, for use with `Any::pack` and
15243    /// `Any::unpack_if`.
15244    ///
15245    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15246    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15247}
15248impl FeatureSet {
15249    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15250    #[inline]
15251    ///Sets [`Self::field_presence`] to `Some(value)`, consuming and returning `self`.
15252    pub fn with_field_presence(
15253        mut self,
15254        value: impl Into<feature_set::FieldPresence>,
15255    ) -> Self {
15256        self.field_presence = Some(value.into());
15257        self
15258    }
15259    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15260    #[inline]
15261    ///Sets [`Self::enum_type`] to `Some(value)`, consuming and returning `self`.
15262    pub fn with_enum_type(mut self, value: impl Into<feature_set::EnumType>) -> Self {
15263        self.enum_type = Some(value.into());
15264        self
15265    }
15266    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15267    #[inline]
15268    ///Sets [`Self::repeated_field_encoding`] to `Some(value)`, consuming and returning `self`.
15269    pub fn with_repeated_field_encoding(
15270        mut self,
15271        value: impl Into<feature_set::RepeatedFieldEncoding>,
15272    ) -> Self {
15273        self.repeated_field_encoding = Some(value.into());
15274        self
15275    }
15276    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15277    #[inline]
15278    ///Sets [`Self::utf8_validation`] to `Some(value)`, consuming and returning `self`.
15279    pub fn with_utf8_validation(
15280        mut self,
15281        value: impl Into<feature_set::Utf8Validation>,
15282    ) -> Self {
15283        self.utf8_validation = Some(value.into());
15284        self
15285    }
15286    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15287    #[inline]
15288    ///Sets [`Self::message_encoding`] to `Some(value)`, consuming and returning `self`.
15289    pub fn with_message_encoding(
15290        mut self,
15291        value: impl Into<feature_set::MessageEncoding>,
15292    ) -> Self {
15293        self.message_encoding = Some(value.into());
15294        self
15295    }
15296    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15297    #[inline]
15298    ///Sets [`Self::json_format`] to `Some(value)`, consuming and returning `self`.
15299    pub fn with_json_format(
15300        mut self,
15301        value: impl Into<feature_set::JsonFormat>,
15302    ) -> Self {
15303        self.json_format = Some(value.into());
15304        self
15305    }
15306    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15307    #[inline]
15308    ///Sets [`Self::enforce_naming_style`] to `Some(value)`, consuming and returning `self`.
15309    pub fn with_enforce_naming_style(
15310        mut self,
15311        value: impl Into<feature_set::EnforceNamingStyle>,
15312    ) -> Self {
15313        self.enforce_naming_style = Some(value.into());
15314        self
15315    }
15316    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15317    #[inline]
15318    ///Sets [`Self::default_symbol_visibility`] to `Some(value)`, consuming and returning `self`.
15319    pub fn with_default_symbol_visibility(
15320        mut self,
15321        value: impl Into<feature_set::visibility_feature::DefaultSymbolVisibility>,
15322    ) -> Self {
15323        self.default_symbol_visibility = Some(value.into());
15324        self
15325    }
15326}
15327::buffa::impl_default_instance!(FeatureSet);
15328impl ::buffa::MessageName for FeatureSet {
15329    const PACKAGE: &'static str = "google.protobuf";
15330    const NAME: &'static str = "FeatureSet";
15331    const FULL_NAME: &'static str = "google.protobuf.FeatureSet";
15332    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15333}
15334impl ::buffa::Message for FeatureSet {
15335    /// Returns the total encoded size in bytes.
15336    ///
15337    /// The result is a `u32`; the protobuf specification requires all
15338    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
15339    /// compliant message will never overflow this type.
15340    #[allow(clippy::let_and_return)]
15341    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15342        #[allow(unused_imports)]
15343        use ::buffa::Enumeration as _;
15344        let mut size = 0u32;
15345        if let Some(ref v) = self.field_presence {
15346            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15347        }
15348        if let Some(ref v) = self.enum_type {
15349            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15350        }
15351        if let Some(ref v) = self.repeated_field_encoding {
15352            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15353        }
15354        if let Some(ref v) = self.utf8_validation {
15355            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15356        }
15357        if let Some(ref v) = self.message_encoding {
15358            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15359        }
15360        if let Some(ref v) = self.json_format {
15361            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15362        }
15363        if let Some(ref v) = self.enforce_naming_style {
15364            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15365        }
15366        if let Some(ref v) = self.default_symbol_visibility {
15367            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
15368        }
15369        size += self.__buffa_unknown_fields.encoded_len() as u32;
15370        size
15371    }
15372    fn write_to(
15373        &self,
15374        _cache: &mut ::buffa::SizeCache,
15375        buf: &mut impl ::buffa::bytes::BufMut,
15376    ) {
15377        #[allow(unused_imports)]
15378        use ::buffa::Enumeration as _;
15379        if let Some(ref v) = self.field_presence {
15380            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
15381        }
15382        if let Some(ref v) = self.enum_type {
15383            ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
15384        }
15385        if let Some(ref v) = self.repeated_field_encoding {
15386            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
15387        }
15388        if let Some(ref v) = self.utf8_validation {
15389            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
15390        }
15391        if let Some(ref v) = self.message_encoding {
15392            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
15393        }
15394        if let Some(ref v) = self.json_format {
15395            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
15396        }
15397        if let Some(ref v) = self.enforce_naming_style {
15398            ::buffa::types::put_int32_field(7u32, v.to_i32(), buf);
15399        }
15400        if let Some(ref v) = self.default_symbol_visibility {
15401            ::buffa::types::put_int32_field(8u32, v.to_i32(), buf);
15402        }
15403        self.__buffa_unknown_fields.write_to(buf);
15404    }
15405    fn merge_field(
15406        &mut self,
15407        tag: ::buffa::encoding::Tag,
15408        buf: &mut impl ::buffa::bytes::Buf,
15409        ctx: ::buffa::DecodeContext<'_>,
15410    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15411        #[allow(unused_imports)]
15412        use ::buffa::bytes::Buf as _;
15413        #[allow(unused_imports)]
15414        use ::buffa::Enumeration as _;
15415        match tag.field_number() {
15416            1u32 => {
15417                ::buffa::encoding::check_wire_type(
15418                    tag,
15419                    ::buffa::encoding::WireType::Varint,
15420                )?;
15421                let __raw = ::buffa::types::decode_int32(buf)?;
15422                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15423                    __raw,
15424                ) {
15425                    self.field_presence = ::core::option::Option::Some(__v);
15426                } else {
15427                    self.__buffa_unknown_fields
15428                        .push(::buffa::UnknownField {
15429                            number: 1u32,
15430                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15431                        });
15432                }
15433            }
15434            2u32 => {
15435                ::buffa::encoding::check_wire_type(
15436                    tag,
15437                    ::buffa::encoding::WireType::Varint,
15438                )?;
15439                let __raw = ::buffa::types::decode_int32(buf)?;
15440                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15441                    __raw,
15442                ) {
15443                    self.enum_type = ::core::option::Option::Some(__v);
15444                } else {
15445                    self.__buffa_unknown_fields
15446                        .push(::buffa::UnknownField {
15447                            number: 2u32,
15448                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15449                        });
15450                }
15451            }
15452            3u32 => {
15453                ::buffa::encoding::check_wire_type(
15454                    tag,
15455                    ::buffa::encoding::WireType::Varint,
15456                )?;
15457                let __raw = ::buffa::types::decode_int32(buf)?;
15458                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15459                    __raw,
15460                ) {
15461                    self.repeated_field_encoding = ::core::option::Option::Some(__v);
15462                } else {
15463                    self.__buffa_unknown_fields
15464                        .push(::buffa::UnknownField {
15465                            number: 3u32,
15466                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15467                        });
15468                }
15469            }
15470            4u32 => {
15471                ::buffa::encoding::check_wire_type(
15472                    tag,
15473                    ::buffa::encoding::WireType::Varint,
15474                )?;
15475                let __raw = ::buffa::types::decode_int32(buf)?;
15476                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15477                    __raw,
15478                ) {
15479                    self.utf8_validation = ::core::option::Option::Some(__v);
15480                } else {
15481                    self.__buffa_unknown_fields
15482                        .push(::buffa::UnknownField {
15483                            number: 4u32,
15484                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15485                        });
15486                }
15487            }
15488            5u32 => {
15489                ::buffa::encoding::check_wire_type(
15490                    tag,
15491                    ::buffa::encoding::WireType::Varint,
15492                )?;
15493                let __raw = ::buffa::types::decode_int32(buf)?;
15494                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15495                    __raw,
15496                ) {
15497                    self.message_encoding = ::core::option::Option::Some(__v);
15498                } else {
15499                    self.__buffa_unknown_fields
15500                        .push(::buffa::UnknownField {
15501                            number: 5u32,
15502                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15503                        });
15504                }
15505            }
15506            6u32 => {
15507                ::buffa::encoding::check_wire_type(
15508                    tag,
15509                    ::buffa::encoding::WireType::Varint,
15510                )?;
15511                let __raw = ::buffa::types::decode_int32(buf)?;
15512                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15513                    __raw,
15514                ) {
15515                    self.json_format = ::core::option::Option::Some(__v);
15516                } else {
15517                    self.__buffa_unknown_fields
15518                        .push(::buffa::UnknownField {
15519                            number: 6u32,
15520                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15521                        });
15522                }
15523            }
15524            7u32 => {
15525                ::buffa::encoding::check_wire_type(
15526                    tag,
15527                    ::buffa::encoding::WireType::Varint,
15528                )?;
15529                let __raw = ::buffa::types::decode_int32(buf)?;
15530                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15531                    __raw,
15532                ) {
15533                    self.enforce_naming_style = ::core::option::Option::Some(__v);
15534                } else {
15535                    self.__buffa_unknown_fields
15536                        .push(::buffa::UnknownField {
15537                            number: 7u32,
15538                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15539                        });
15540                }
15541            }
15542            8u32 => {
15543                ::buffa::encoding::check_wire_type(
15544                    tag,
15545                    ::buffa::encoding::WireType::Varint,
15546                )?;
15547                let __raw = ::buffa::types::decode_int32(buf)?;
15548                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15549                    __raw,
15550                ) {
15551                    self.default_symbol_visibility = ::core::option::Option::Some(__v);
15552                } else {
15553                    self.__buffa_unknown_fields
15554                        .push(::buffa::UnknownField {
15555                            number: 8u32,
15556                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15557                        });
15558                }
15559            }
15560            _ => {
15561                self.__buffa_unknown_fields
15562                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15563            }
15564        }
15565        ::core::result::Result::Ok(())
15566    }
15567    fn clear(&mut self) {
15568        self.field_presence = ::core::option::Option::None;
15569        self.enum_type = ::core::option::Option::None;
15570        self.repeated_field_encoding = ::core::option::Option::None;
15571        self.utf8_validation = ::core::option::Option::None;
15572        self.message_encoding = ::core::option::Option::None;
15573        self.json_format = ::core::option::Option::None;
15574        self.enforce_naming_style = ::core::option::Option::None;
15575        self.default_symbol_visibility = ::core::option::Option::None;
15576        self.__buffa_unknown_fields.clear();
15577    }
15578}
15579impl ::buffa::ExtensionSet for FeatureSet {
15580    const PROTO_FQN: &'static str = "google.protobuf.FeatureSet";
15581    fn unknown_fields(&self) -> &::buffa::UnknownFields {
15582        &self.__buffa_unknown_fields
15583    }
15584    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15585        &mut self.__buffa_unknown_fields
15586    }
15587}
15588#[cfg(feature = "text")]
15589impl ::buffa::text::TextFormat for FeatureSet {
15590    fn encode_text(
15591        &self,
15592        enc: &mut ::buffa::text::TextEncoder<'_>,
15593    ) -> ::core::fmt::Result {
15594        #[allow(unused_imports)]
15595        use ::buffa::Enumeration as _;
15596        if let ::core::option::Option::Some(ref __v) = self.field_presence {
15597            enc.write_field_name("field_presence")?;
15598            enc.write_enum_name(__v.proto_name())?;
15599        }
15600        if let ::core::option::Option::Some(ref __v) = self.enum_type {
15601            enc.write_field_name("enum_type")?;
15602            enc.write_enum_name(__v.proto_name())?;
15603        }
15604        if let ::core::option::Option::Some(ref __v) = self.repeated_field_encoding {
15605            enc.write_field_name("repeated_field_encoding")?;
15606            enc.write_enum_name(__v.proto_name())?;
15607        }
15608        if let ::core::option::Option::Some(ref __v) = self.utf8_validation {
15609            enc.write_field_name("utf8_validation")?;
15610            enc.write_enum_name(__v.proto_name())?;
15611        }
15612        if let ::core::option::Option::Some(ref __v) = self.message_encoding {
15613            enc.write_field_name("message_encoding")?;
15614            enc.write_enum_name(__v.proto_name())?;
15615        }
15616        if let ::core::option::Option::Some(ref __v) = self.json_format {
15617            enc.write_field_name("json_format")?;
15618            enc.write_enum_name(__v.proto_name())?;
15619        }
15620        if let ::core::option::Option::Some(ref __v) = self.enforce_naming_style {
15621            enc.write_field_name("enforce_naming_style")?;
15622            enc.write_enum_name(__v.proto_name())?;
15623        }
15624        if let ::core::option::Option::Some(ref __v) = self.default_symbol_visibility {
15625            enc.write_field_name("default_symbol_visibility")?;
15626            enc.write_enum_name(__v.proto_name())?;
15627        }
15628        enc.write_extension_fields(
15629            "google.protobuf.FeatureSet",
15630            &self.__buffa_unknown_fields,
15631        )?;
15632        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15633        ::core::result::Result::Ok(())
15634    }
15635    fn merge_text(
15636        &mut self,
15637        dec: &mut ::buffa::text::TextDecoder<'_>,
15638    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15639        #[allow(unused_imports)]
15640        use ::buffa::Enumeration as _;
15641        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15642            match __name {
15643                "field_presence" => {
15644                    self.field_presence = ::core::option::Option::Some(
15645                        dec.read_closed_enum_by_name::<feature_set::FieldPresence>()?,
15646                    );
15647                }
15648                "enum_type" => {
15649                    self.enum_type = ::core::option::Option::Some(
15650                        dec.read_closed_enum_by_name::<feature_set::EnumType>()?,
15651                    );
15652                }
15653                "repeated_field_encoding" => {
15654                    self.repeated_field_encoding = ::core::option::Option::Some(
15655                        dec
15656                            .read_closed_enum_by_name::<
15657                                feature_set::RepeatedFieldEncoding,
15658                            >()?,
15659                    );
15660                }
15661                "utf8_validation" => {
15662                    self.utf8_validation = ::core::option::Option::Some(
15663                        dec.read_closed_enum_by_name::<feature_set::Utf8Validation>()?,
15664                    );
15665                }
15666                "message_encoding" => {
15667                    self.message_encoding = ::core::option::Option::Some(
15668                        dec.read_closed_enum_by_name::<feature_set::MessageEncoding>()?,
15669                    );
15670                }
15671                "json_format" => {
15672                    self.json_format = ::core::option::Option::Some(
15673                        dec.read_closed_enum_by_name::<feature_set::JsonFormat>()?,
15674                    );
15675                }
15676                "enforce_naming_style" => {
15677                    self.enforce_naming_style = ::core::option::Option::Some(
15678                        dec
15679                            .read_closed_enum_by_name::<
15680                                feature_set::EnforceNamingStyle,
15681                            >()?,
15682                    );
15683                }
15684                "default_symbol_visibility" => {
15685                    self.default_symbol_visibility = ::core::option::Option::Some(
15686                        dec
15687                            .read_closed_enum_by_name::<
15688                                feature_set::visibility_feature::DefaultSymbolVisibility,
15689                            >()?,
15690                    );
15691                }
15692                __name if __name.starts_with('[') => {
15693                    for __r in dec.read_extension(__name, "google.protobuf.FeatureSet")?
15694                    {
15695                        self.__buffa_unknown_fields.push(__r);
15696                    }
15697                }
15698                _ => dec.skip_value()?,
15699            }
15700        }
15701        ::core::result::Result::Ok(())
15702    }
15703}
15704#[cfg(feature = "json")]
15705impl<'de> serde::Deserialize<'de> for FeatureSet {
15706    fn deserialize<D: serde::Deserializer<'de>>(
15707        d: D,
15708    ) -> ::core::result::Result<Self, D::Error> {
15709        struct _V;
15710        impl<'de> serde::de::Visitor<'de> for _V {
15711            type Value = FeatureSet;
15712            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15713                f.write_str("struct FeatureSet")
15714            }
15715            #[allow(clippy::field_reassign_with_default)]
15716            fn visit_map<A: serde::de::MapAccess<'de>>(
15717                self,
15718                mut map: A,
15719            ) -> ::core::result::Result<FeatureSet, A::Error> {
15720                let mut __f_field_presence: ::core::option::Option<
15721                    ::core::option::Option<feature_set::FieldPresence>,
15722                > = None;
15723                let mut __f_enum_type: ::core::option::Option<
15724                    ::core::option::Option<feature_set::EnumType>,
15725                > = None;
15726                let mut __f_repeated_field_encoding: ::core::option::Option<
15727                    ::core::option::Option<feature_set::RepeatedFieldEncoding>,
15728                > = None;
15729                let mut __f_utf8_validation: ::core::option::Option<
15730                    ::core::option::Option<feature_set::Utf8Validation>,
15731                > = None;
15732                let mut __f_message_encoding: ::core::option::Option<
15733                    ::core::option::Option<feature_set::MessageEncoding>,
15734                > = None;
15735                let mut __f_json_format: ::core::option::Option<
15736                    ::core::option::Option<feature_set::JsonFormat>,
15737                > = None;
15738                let mut __f_enforce_naming_style: ::core::option::Option<
15739                    ::core::option::Option<feature_set::EnforceNamingStyle>,
15740                > = None;
15741                let mut __f_default_symbol_visibility: ::core::option::Option<
15742                    ::core::option::Option<
15743                        feature_set::visibility_feature::DefaultSymbolVisibility,
15744                    >,
15745                > = None;
15746                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
15747                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
15748                    match key.as_str() {
15749                        "fieldPresence" | "field_presence" => {
15750                            __f_field_presence = Some({
15751                                struct _S;
15752                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15753                                    type Value = ::core::option::Option<
15754                                        feature_set::FieldPresence,
15755                                    >;
15756                                    fn deserialize<D: serde::Deserializer<'de>>(
15757                                        self,
15758                                        d: D,
15759                                    ) -> ::core::result::Result<
15760                                        ::core::option::Option<feature_set::FieldPresence>,
15761                                        D::Error,
15762                                    > {
15763                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15764                                    }
15765                                }
15766                                map.next_value_seed(_S)?
15767                            });
15768                        }
15769                        "enumType" | "enum_type" => {
15770                            __f_enum_type = Some({
15771                                struct _S;
15772                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15773                                    type Value = ::core::option::Option<feature_set::EnumType>;
15774                                    fn deserialize<D: serde::Deserializer<'de>>(
15775                                        self,
15776                                        d: D,
15777                                    ) -> ::core::result::Result<
15778                                        ::core::option::Option<feature_set::EnumType>,
15779                                        D::Error,
15780                                    > {
15781                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15782                                    }
15783                                }
15784                                map.next_value_seed(_S)?
15785                            });
15786                        }
15787                        "repeatedFieldEncoding" | "repeated_field_encoding" => {
15788                            __f_repeated_field_encoding = Some({
15789                                struct _S;
15790                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15791                                    type Value = ::core::option::Option<
15792                                        feature_set::RepeatedFieldEncoding,
15793                                    >;
15794                                    fn deserialize<D: serde::Deserializer<'de>>(
15795                                        self,
15796                                        d: D,
15797                                    ) -> ::core::result::Result<
15798                                        ::core::option::Option<feature_set::RepeatedFieldEncoding>,
15799                                        D::Error,
15800                                    > {
15801                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15802                                    }
15803                                }
15804                                map.next_value_seed(_S)?
15805                            });
15806                        }
15807                        "utf8Validation" | "utf8_validation" => {
15808                            __f_utf8_validation = Some({
15809                                struct _S;
15810                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15811                                    type Value = ::core::option::Option<
15812                                        feature_set::Utf8Validation,
15813                                    >;
15814                                    fn deserialize<D: serde::Deserializer<'de>>(
15815                                        self,
15816                                        d: D,
15817                                    ) -> ::core::result::Result<
15818                                        ::core::option::Option<feature_set::Utf8Validation>,
15819                                        D::Error,
15820                                    > {
15821                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15822                                    }
15823                                }
15824                                map.next_value_seed(_S)?
15825                            });
15826                        }
15827                        "messageEncoding" | "message_encoding" => {
15828                            __f_message_encoding = Some({
15829                                struct _S;
15830                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15831                                    type Value = ::core::option::Option<
15832                                        feature_set::MessageEncoding,
15833                                    >;
15834                                    fn deserialize<D: serde::Deserializer<'de>>(
15835                                        self,
15836                                        d: D,
15837                                    ) -> ::core::result::Result<
15838                                        ::core::option::Option<feature_set::MessageEncoding>,
15839                                        D::Error,
15840                                    > {
15841                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15842                                    }
15843                                }
15844                                map.next_value_seed(_S)?
15845                            });
15846                        }
15847                        "jsonFormat" | "json_format" => {
15848                            __f_json_format = Some({
15849                                struct _S;
15850                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15851                                    type Value = ::core::option::Option<
15852                                        feature_set::JsonFormat,
15853                                    >;
15854                                    fn deserialize<D: serde::Deserializer<'de>>(
15855                                        self,
15856                                        d: D,
15857                                    ) -> ::core::result::Result<
15858                                        ::core::option::Option<feature_set::JsonFormat>,
15859                                        D::Error,
15860                                    > {
15861                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15862                                    }
15863                                }
15864                                map.next_value_seed(_S)?
15865                            });
15866                        }
15867                        "enforceNamingStyle" | "enforce_naming_style" => {
15868                            __f_enforce_naming_style = Some({
15869                                struct _S;
15870                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15871                                    type Value = ::core::option::Option<
15872                                        feature_set::EnforceNamingStyle,
15873                                    >;
15874                                    fn deserialize<D: serde::Deserializer<'de>>(
15875                                        self,
15876                                        d: D,
15877                                    ) -> ::core::result::Result<
15878                                        ::core::option::Option<feature_set::EnforceNamingStyle>,
15879                                        D::Error,
15880                                    > {
15881                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15882                                    }
15883                                }
15884                                map.next_value_seed(_S)?
15885                            });
15886                        }
15887                        "defaultSymbolVisibility" | "default_symbol_visibility" => {
15888                            __f_default_symbol_visibility = Some({
15889                                struct _S;
15890                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15891                                    type Value = ::core::option::Option<
15892                                        feature_set::visibility_feature::DefaultSymbolVisibility,
15893                                    >;
15894                                    fn deserialize<D: serde::Deserializer<'de>>(
15895                                        self,
15896                                        d: D,
15897                                    ) -> ::core::result::Result<
15898                                        ::core::option::Option<
15899                                            feature_set::visibility_feature::DefaultSymbolVisibility,
15900                                        >,
15901                                        D::Error,
15902                                    > {
15903                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15904                                    }
15905                                }
15906                                map.next_value_seed(_S)?
15907                            });
15908                        }
15909                        __k if __k.starts_with('[') => {
15910                            let __v: ::buffa::serde_json::Value = map.next_value()?;
15911                            match ::buffa::extension_registry::deserialize_extension_key(
15912                                "google.protobuf.FeatureSet",
15913                                __k,
15914                                __v,
15915                            ) {
15916                                ::core::option::Option::Some(
15917                                    ::core::result::Result::Ok(__recs),
15918                                ) => {
15919                                    for __rec in __recs {
15920                                        __ext_records.push(__rec);
15921                                    }
15922                                }
15923                                ::core::option::Option::Some(
15924                                    ::core::result::Result::Err(__e),
15925                                ) => {
15926                                    return ::core::result::Result::Err(
15927                                        <A::Error as ::serde::de::Error>::custom(__e),
15928                                    );
15929                                }
15930                                ::core::option::Option::None => {}
15931                            }
15932                        }
15933                        _ => {
15934                            map.next_value::<serde::de::IgnoredAny>()?;
15935                        }
15936                    }
15937                }
15938                let mut __r = <FeatureSet as ::core::default::Default>::default();
15939                if let ::core::option::Option::Some(v) = __f_field_presence {
15940                    __r.field_presence = v;
15941                }
15942                if let ::core::option::Option::Some(v) = __f_enum_type {
15943                    __r.enum_type = v;
15944                }
15945                if let ::core::option::Option::Some(v) = __f_repeated_field_encoding {
15946                    __r.repeated_field_encoding = v;
15947                }
15948                if let ::core::option::Option::Some(v) = __f_utf8_validation {
15949                    __r.utf8_validation = v;
15950                }
15951                if let ::core::option::Option::Some(v) = __f_message_encoding {
15952                    __r.message_encoding = v;
15953                }
15954                if let ::core::option::Option::Some(v) = __f_json_format {
15955                    __r.json_format = v;
15956                }
15957                if let ::core::option::Option::Some(v) = __f_enforce_naming_style {
15958                    __r.enforce_naming_style = v;
15959                }
15960                if let ::core::option::Option::Some(v) = __f_default_symbol_visibility {
15961                    __r.default_symbol_visibility = v;
15962                }
15963                for __rec in __ext_records {
15964                    __r.__buffa_unknown_fields.push(__rec);
15965                }
15966                Ok(__r)
15967            }
15968        }
15969        d.deserialize_map(_V)
15970    }
15971}
15972#[cfg(feature = "json")]
15973impl ::buffa::json_helpers::ProtoElemJson for FeatureSet {
15974    fn serialize_proto_json<S: ::serde::Serializer>(
15975        v: &Self,
15976        s: S,
15977    ) -> ::core::result::Result<S::Ok, S::Error> {
15978        ::serde::Serialize::serialize(v, s)
15979    }
15980    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15981        d: D,
15982    ) -> ::core::result::Result<Self, D::Error> {
15983        <Self as ::serde::Deserialize>::deserialize(d)
15984    }
15985}
15986#[doc(hidden)]
15987#[derive(Clone, Debug, Default, PartialEq)]
15988#[repr(transparent)]
15989#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15990pub struct __FeatureSetExtJson(pub ::buffa::UnknownFields);
15991impl ::core::ops::Deref for __FeatureSetExtJson {
15992    type Target = ::buffa::UnknownFields;
15993    fn deref(&self) -> &::buffa::UnknownFields {
15994        &self.0
15995    }
15996}
15997impl ::core::ops::DerefMut for __FeatureSetExtJson {
15998    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
15999        &mut self.0
16000    }
16001}
16002impl ::core::convert::From<::buffa::UnknownFields> for __FeatureSetExtJson {
16003    fn from(u: ::buffa::UnknownFields) -> Self {
16004        Self(u)
16005    }
16006}
16007#[cfg(feature = "json")]
16008impl ::serde::Serialize for __FeatureSetExtJson {
16009    fn serialize<S: ::serde::Serializer>(
16010        &self,
16011        s: S,
16012    ) -> ::core::result::Result<S::Ok, S::Error> {
16013        ::buffa::extension_registry::serialize_extensions(
16014            "google.protobuf.FeatureSet",
16015            &self.0,
16016            s,
16017        )
16018    }
16019}
16020#[cfg(feature = "json")]
16021impl<'de> ::serde::Deserialize<'de> for __FeatureSetExtJson {
16022    fn deserialize<D: ::serde::Deserializer<'de>>(
16023        d: D,
16024    ) -> ::core::result::Result<Self, D::Error> {
16025        ::buffa::extension_registry::deserialize_extensions(
16026                "google.protobuf.FeatureSet",
16027                d,
16028            )
16029            .map(Self)
16030    }
16031}
16032#[cfg(feature = "json")]
16033#[doc(hidden)]
16034pub const __FEATURE_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
16035    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16036    to_json: ::buffa::type_registry::any_to_json::<FeatureSet>,
16037    from_json: ::buffa::type_registry::any_from_json::<FeatureSet>,
16038    is_wkt: false,
16039};
16040#[cfg(feature = "text")]
16041#[doc(hidden)]
16042pub const __FEATURE_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
16043    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16044    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSet>,
16045    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSet>,
16046};
16047pub mod feature_set {
16048    #[allow(unused_imports)]
16049    use super::*;
16050    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16051    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16052    #[repr(i32)]
16053    pub enum FieldPresence {
16054        FIELD_PRESENCE_UNKNOWN = 0i32,
16055        EXPLICIT = 1i32,
16056        IMPLICIT = 2i32,
16057        LEGACY_REQUIRED = 3i32,
16058    }
16059    impl FieldPresence {
16060        ///Idiomatic alias for [`Self::FIELD_PRESENCE_UNKNOWN`]; `Debug` prints the variant name.
16061        #[allow(non_upper_case_globals)]
16062        pub const FieldPresenceUnknown: Self = Self::FIELD_PRESENCE_UNKNOWN;
16063        ///Idiomatic alias for [`Self::EXPLICIT`]; `Debug` prints the variant name.
16064        #[allow(non_upper_case_globals)]
16065        pub const Explicit: Self = Self::EXPLICIT;
16066        ///Idiomatic alias for [`Self::IMPLICIT`]; `Debug` prints the variant name.
16067        #[allow(non_upper_case_globals)]
16068        pub const Implicit: Self = Self::IMPLICIT;
16069        ///Idiomatic alias for [`Self::LEGACY_REQUIRED`]; `Debug` prints the variant name.
16070        #[allow(non_upper_case_globals)]
16071        pub const LegacyRequired: Self = Self::LEGACY_REQUIRED;
16072    }
16073    impl ::core::default::Default for FieldPresence {
16074        fn default() -> Self {
16075            Self::FIELD_PRESENCE_UNKNOWN
16076        }
16077    }
16078    #[cfg(feature = "json")]
16079    const _: () = {
16080        impl ::serde::Serialize for FieldPresence {
16081            fn serialize<S: ::serde::Serializer>(
16082                &self,
16083                s: S,
16084            ) -> ::core::result::Result<S::Ok, S::Error> {
16085                s.serialize_str(::buffa::Enumeration::proto_name(self))
16086            }
16087        }
16088        impl<'de> ::serde::Deserialize<'de> for FieldPresence {
16089            fn deserialize<D: ::serde::Deserializer<'de>>(
16090                d: D,
16091            ) -> ::core::result::Result<Self, D::Error> {
16092                struct _V;
16093                impl ::serde::de::Visitor<'_> for _V {
16094                    type Value = FieldPresence;
16095                    fn expecting(
16096                        &self,
16097                        f: &mut ::core::fmt::Formatter<'_>,
16098                    ) -> ::core::fmt::Result {
16099                        f.write_str(
16100                            concat!(
16101                                "a string, integer, or null for ", stringify!(FieldPresence)
16102                            ),
16103                        )
16104                    }
16105                    fn visit_str<E: ::serde::de::Error>(
16106                        self,
16107                        v: &str,
16108                    ) -> ::core::result::Result<FieldPresence, E> {
16109                        <FieldPresence as ::buffa::Enumeration>::from_proto_name(v)
16110                            .ok_or_else(|| {
16111                                ::serde::de::Error::unknown_variant(v, &[])
16112                            })
16113                    }
16114                    fn visit_i64<E: ::serde::de::Error>(
16115                        self,
16116                        v: i64,
16117                    ) -> ::core::result::Result<FieldPresence, E> {
16118                        let v32 = i32::try_from(v)
16119                            .map_err(|_| {
16120                                ::serde::de::Error::custom(
16121                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16122                                )
16123                            })?;
16124                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16125                            .ok_or_else(|| {
16126                                ::serde::de::Error::custom(
16127                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16128                                )
16129                            })
16130                    }
16131                    fn visit_u64<E: ::serde::de::Error>(
16132                        self,
16133                        v: u64,
16134                    ) -> ::core::result::Result<FieldPresence, E> {
16135                        let v32 = i32::try_from(v)
16136                            .map_err(|_| {
16137                                ::serde::de::Error::custom(
16138                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16139                                )
16140                            })?;
16141                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16142                            .ok_or_else(|| {
16143                                ::serde::de::Error::custom(
16144                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16145                                )
16146                            })
16147                    }
16148                    fn visit_unit<E: ::serde::de::Error>(
16149                        self,
16150                    ) -> ::core::result::Result<FieldPresence, E> {
16151                        ::core::result::Result::Ok(::core::default::Default::default())
16152                    }
16153                }
16154                d.deserialize_any(_V)
16155            }
16156        }
16157        impl ::buffa::json_helpers::ProtoElemJson for FieldPresence {
16158            fn serialize_proto_json<S: ::serde::Serializer>(
16159                v: &Self,
16160                s: S,
16161            ) -> ::core::result::Result<S::Ok, S::Error> {
16162                ::serde::Serialize::serialize(v, s)
16163            }
16164            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16165                d: D,
16166            ) -> ::core::result::Result<Self, D::Error> {
16167                <Self as ::serde::Deserialize>::deserialize(d)
16168            }
16169        }
16170    };
16171    impl ::buffa::Enumeration for FieldPresence {
16172        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16173            match value {
16174                0i32 => ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
16175                1i32 => ::core::option::Option::Some(Self::EXPLICIT),
16176                2i32 => ::core::option::Option::Some(Self::IMPLICIT),
16177                3i32 => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16178                _ => ::core::option::Option::None,
16179            }
16180        }
16181        fn to_i32(&self) -> i32 {
16182            *self as i32
16183        }
16184        fn proto_name(&self) -> &'static str {
16185            match self {
16186                Self::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN",
16187                Self::EXPLICIT => "EXPLICIT",
16188                Self::IMPLICIT => "IMPLICIT",
16189                Self::LEGACY_REQUIRED => "LEGACY_REQUIRED",
16190            }
16191        }
16192        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16193            match name {
16194                "FIELD_PRESENCE_UNKNOWN" => {
16195                    ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN)
16196                }
16197                "EXPLICIT" => ::core::option::Option::Some(Self::EXPLICIT),
16198                "IMPLICIT" => ::core::option::Option::Some(Self::IMPLICIT),
16199                "LEGACY_REQUIRED" => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16200                _ => ::core::option::Option::None,
16201            }
16202        }
16203        fn values() -> &'static [Self] {
16204            &[
16205                Self::FIELD_PRESENCE_UNKNOWN,
16206                Self::EXPLICIT,
16207                Self::IMPLICIT,
16208                Self::LEGACY_REQUIRED,
16209            ]
16210        }
16211    }
16212    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16213    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16214    #[repr(i32)]
16215    pub enum EnumType {
16216        ENUM_TYPE_UNKNOWN = 0i32,
16217        OPEN = 1i32,
16218        CLOSED = 2i32,
16219    }
16220    impl EnumType {
16221        ///Idiomatic alias for [`Self::ENUM_TYPE_UNKNOWN`]; `Debug` prints the variant name.
16222        #[allow(non_upper_case_globals)]
16223        pub const EnumTypeUnknown: Self = Self::ENUM_TYPE_UNKNOWN;
16224        ///Idiomatic alias for [`Self::OPEN`]; `Debug` prints the variant name.
16225        #[allow(non_upper_case_globals)]
16226        pub const Open: Self = Self::OPEN;
16227        ///Idiomatic alias for [`Self::CLOSED`]; `Debug` prints the variant name.
16228        #[allow(non_upper_case_globals)]
16229        pub const Closed: Self = Self::CLOSED;
16230    }
16231    impl ::core::default::Default for EnumType {
16232        fn default() -> Self {
16233            Self::ENUM_TYPE_UNKNOWN
16234        }
16235    }
16236    #[cfg(feature = "json")]
16237    const _: () = {
16238        impl ::serde::Serialize for EnumType {
16239            fn serialize<S: ::serde::Serializer>(
16240                &self,
16241                s: S,
16242            ) -> ::core::result::Result<S::Ok, S::Error> {
16243                s.serialize_str(::buffa::Enumeration::proto_name(self))
16244            }
16245        }
16246        impl<'de> ::serde::Deserialize<'de> for EnumType {
16247            fn deserialize<D: ::serde::Deserializer<'de>>(
16248                d: D,
16249            ) -> ::core::result::Result<Self, D::Error> {
16250                struct _V;
16251                impl ::serde::de::Visitor<'_> for _V {
16252                    type Value = EnumType;
16253                    fn expecting(
16254                        &self,
16255                        f: &mut ::core::fmt::Formatter<'_>,
16256                    ) -> ::core::fmt::Result {
16257                        f.write_str(
16258                            concat!(
16259                                "a string, integer, or null for ", stringify!(EnumType)
16260                            ),
16261                        )
16262                    }
16263                    fn visit_str<E: ::serde::de::Error>(
16264                        self,
16265                        v: &str,
16266                    ) -> ::core::result::Result<EnumType, E> {
16267                        <EnumType as ::buffa::Enumeration>::from_proto_name(v)
16268                            .ok_or_else(|| {
16269                                ::serde::de::Error::unknown_variant(v, &[])
16270                            })
16271                    }
16272                    fn visit_i64<E: ::serde::de::Error>(
16273                        self,
16274                        v: i64,
16275                    ) -> ::core::result::Result<EnumType, E> {
16276                        let v32 = i32::try_from(v)
16277                            .map_err(|_| {
16278                                ::serde::de::Error::custom(
16279                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16280                                )
16281                            })?;
16282                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16283                            .ok_or_else(|| {
16284                                ::serde::de::Error::custom(
16285                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16286                                )
16287                            })
16288                    }
16289                    fn visit_u64<E: ::serde::de::Error>(
16290                        self,
16291                        v: u64,
16292                    ) -> ::core::result::Result<EnumType, E> {
16293                        let v32 = i32::try_from(v)
16294                            .map_err(|_| {
16295                                ::serde::de::Error::custom(
16296                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16297                                )
16298                            })?;
16299                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16300                            .ok_or_else(|| {
16301                                ::serde::de::Error::custom(
16302                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16303                                )
16304                            })
16305                    }
16306                    fn visit_unit<E: ::serde::de::Error>(
16307                        self,
16308                    ) -> ::core::result::Result<EnumType, E> {
16309                        ::core::result::Result::Ok(::core::default::Default::default())
16310                    }
16311                }
16312                d.deserialize_any(_V)
16313            }
16314        }
16315        impl ::buffa::json_helpers::ProtoElemJson for EnumType {
16316            fn serialize_proto_json<S: ::serde::Serializer>(
16317                v: &Self,
16318                s: S,
16319            ) -> ::core::result::Result<S::Ok, S::Error> {
16320                ::serde::Serialize::serialize(v, s)
16321            }
16322            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16323                d: D,
16324            ) -> ::core::result::Result<Self, D::Error> {
16325                <Self as ::serde::Deserialize>::deserialize(d)
16326            }
16327        }
16328    };
16329    impl ::buffa::Enumeration for EnumType {
16330        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16331            match value {
16332                0i32 => ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
16333                1i32 => ::core::option::Option::Some(Self::OPEN),
16334                2i32 => ::core::option::Option::Some(Self::CLOSED),
16335                _ => ::core::option::Option::None,
16336            }
16337        }
16338        fn to_i32(&self) -> i32 {
16339            *self as i32
16340        }
16341        fn proto_name(&self) -> &'static str {
16342            match self {
16343                Self::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN",
16344                Self::OPEN => "OPEN",
16345                Self::CLOSED => "CLOSED",
16346            }
16347        }
16348        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16349            match name {
16350                "ENUM_TYPE_UNKNOWN" => {
16351                    ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN)
16352                }
16353                "OPEN" => ::core::option::Option::Some(Self::OPEN),
16354                "CLOSED" => ::core::option::Option::Some(Self::CLOSED),
16355                _ => ::core::option::Option::None,
16356            }
16357        }
16358        fn values() -> &'static [Self] {
16359            &[Self::ENUM_TYPE_UNKNOWN, Self::OPEN, Self::CLOSED]
16360        }
16361    }
16362    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16363    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16364    #[repr(i32)]
16365    pub enum RepeatedFieldEncoding {
16366        REPEATED_FIELD_ENCODING_UNKNOWN = 0i32,
16367        PACKED = 1i32,
16368        EXPANDED = 2i32,
16369    }
16370    impl RepeatedFieldEncoding {
16371        ///Idiomatic alias for [`Self::REPEATED_FIELD_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
16372        #[allow(non_upper_case_globals)]
16373        pub const RepeatedFieldEncodingUnknown: Self = Self::REPEATED_FIELD_ENCODING_UNKNOWN;
16374        ///Idiomatic alias for [`Self::PACKED`]; `Debug` prints the variant name.
16375        #[allow(non_upper_case_globals)]
16376        pub const Packed: Self = Self::PACKED;
16377        ///Idiomatic alias for [`Self::EXPANDED`]; `Debug` prints the variant name.
16378        #[allow(non_upper_case_globals)]
16379        pub const Expanded: Self = Self::EXPANDED;
16380    }
16381    impl ::core::default::Default for RepeatedFieldEncoding {
16382        fn default() -> Self {
16383            Self::REPEATED_FIELD_ENCODING_UNKNOWN
16384        }
16385    }
16386    #[cfg(feature = "json")]
16387    const _: () = {
16388        impl ::serde::Serialize for RepeatedFieldEncoding {
16389            fn serialize<S: ::serde::Serializer>(
16390                &self,
16391                s: S,
16392            ) -> ::core::result::Result<S::Ok, S::Error> {
16393                s.serialize_str(::buffa::Enumeration::proto_name(self))
16394            }
16395        }
16396        impl<'de> ::serde::Deserialize<'de> for RepeatedFieldEncoding {
16397            fn deserialize<D: ::serde::Deserializer<'de>>(
16398                d: D,
16399            ) -> ::core::result::Result<Self, D::Error> {
16400                struct _V;
16401                impl ::serde::de::Visitor<'_> for _V {
16402                    type Value = RepeatedFieldEncoding;
16403                    fn expecting(
16404                        &self,
16405                        f: &mut ::core::fmt::Formatter<'_>,
16406                    ) -> ::core::fmt::Result {
16407                        f.write_str(
16408                            concat!(
16409                                "a string, integer, or null for ",
16410                                stringify!(RepeatedFieldEncoding)
16411                            ),
16412                        )
16413                    }
16414                    fn visit_str<E: ::serde::de::Error>(
16415                        self,
16416                        v: &str,
16417                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16418                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_proto_name(
16419                                v,
16420                            )
16421                            .ok_or_else(|| {
16422                                ::serde::de::Error::unknown_variant(v, &[])
16423                            })
16424                    }
16425                    fn visit_i64<E: ::serde::de::Error>(
16426                        self,
16427                        v: i64,
16428                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16429                        let v32 = i32::try_from(v)
16430                            .map_err(|_| {
16431                                ::serde::de::Error::custom(
16432                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16433                                )
16434                            })?;
16435                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16436                            .ok_or_else(|| {
16437                                ::serde::de::Error::custom(
16438                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16439                                )
16440                            })
16441                    }
16442                    fn visit_u64<E: ::serde::de::Error>(
16443                        self,
16444                        v: u64,
16445                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16446                        let v32 = i32::try_from(v)
16447                            .map_err(|_| {
16448                                ::serde::de::Error::custom(
16449                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16450                                )
16451                            })?;
16452                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16453                            .ok_or_else(|| {
16454                                ::serde::de::Error::custom(
16455                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16456                                )
16457                            })
16458                    }
16459                    fn visit_unit<E: ::serde::de::Error>(
16460                        self,
16461                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16462                        ::core::result::Result::Ok(::core::default::Default::default())
16463                    }
16464                }
16465                d.deserialize_any(_V)
16466            }
16467        }
16468        impl ::buffa::json_helpers::ProtoElemJson for RepeatedFieldEncoding {
16469            fn serialize_proto_json<S: ::serde::Serializer>(
16470                v: &Self,
16471                s: S,
16472            ) -> ::core::result::Result<S::Ok, S::Error> {
16473                ::serde::Serialize::serialize(v, s)
16474            }
16475            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16476                d: D,
16477            ) -> ::core::result::Result<Self, D::Error> {
16478                <Self as ::serde::Deserialize>::deserialize(d)
16479            }
16480        }
16481    };
16482    impl ::buffa::Enumeration for RepeatedFieldEncoding {
16483        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16484            match value {
16485                0i32 => {
16486                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16487                }
16488                1i32 => ::core::option::Option::Some(Self::PACKED),
16489                2i32 => ::core::option::Option::Some(Self::EXPANDED),
16490                _ => ::core::option::Option::None,
16491            }
16492        }
16493        fn to_i32(&self) -> i32 {
16494            *self as i32
16495        }
16496        fn proto_name(&self) -> &'static str {
16497            match self {
16498                Self::REPEATED_FIELD_ENCODING_UNKNOWN => {
16499                    "REPEATED_FIELD_ENCODING_UNKNOWN"
16500                }
16501                Self::PACKED => "PACKED",
16502                Self::EXPANDED => "EXPANDED",
16503            }
16504        }
16505        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16506            match name {
16507                "REPEATED_FIELD_ENCODING_UNKNOWN" => {
16508                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16509                }
16510                "PACKED" => ::core::option::Option::Some(Self::PACKED),
16511                "EXPANDED" => ::core::option::Option::Some(Self::EXPANDED),
16512                _ => ::core::option::Option::None,
16513            }
16514        }
16515        fn values() -> &'static [Self] {
16516            &[Self::REPEATED_FIELD_ENCODING_UNKNOWN, Self::PACKED, Self::EXPANDED]
16517        }
16518    }
16519    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16520    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16521    #[repr(i32)]
16522    pub enum Utf8Validation {
16523        UTF8_VALIDATION_UNKNOWN = 0i32,
16524        VERIFY = 2i32,
16525        NONE = 3i32,
16526    }
16527    impl Utf8Validation {
16528        ///Idiomatic alias for [`Self::UTF8_VALIDATION_UNKNOWN`]; `Debug` prints the variant name.
16529        #[allow(non_upper_case_globals)]
16530        pub const Utf8ValidationUnknown: Self = Self::UTF8_VALIDATION_UNKNOWN;
16531        ///Idiomatic alias for [`Self::VERIFY`]; `Debug` prints the variant name.
16532        #[allow(non_upper_case_globals)]
16533        pub const Verify: Self = Self::VERIFY;
16534        ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
16535        #[allow(non_upper_case_globals)]
16536        pub const None: Self = Self::NONE;
16537    }
16538    impl ::core::default::Default for Utf8Validation {
16539        fn default() -> Self {
16540            Self::UTF8_VALIDATION_UNKNOWN
16541        }
16542    }
16543    #[cfg(feature = "json")]
16544    const _: () = {
16545        impl ::serde::Serialize for Utf8Validation {
16546            fn serialize<S: ::serde::Serializer>(
16547                &self,
16548                s: S,
16549            ) -> ::core::result::Result<S::Ok, S::Error> {
16550                s.serialize_str(::buffa::Enumeration::proto_name(self))
16551            }
16552        }
16553        impl<'de> ::serde::Deserialize<'de> for Utf8Validation {
16554            fn deserialize<D: ::serde::Deserializer<'de>>(
16555                d: D,
16556            ) -> ::core::result::Result<Self, D::Error> {
16557                struct _V;
16558                impl ::serde::de::Visitor<'_> for _V {
16559                    type Value = Utf8Validation;
16560                    fn expecting(
16561                        &self,
16562                        f: &mut ::core::fmt::Formatter<'_>,
16563                    ) -> ::core::fmt::Result {
16564                        f.write_str(
16565                            concat!(
16566                                "a string, integer, or null for ",
16567                                stringify!(Utf8Validation)
16568                            ),
16569                        )
16570                    }
16571                    fn visit_str<E: ::serde::de::Error>(
16572                        self,
16573                        v: &str,
16574                    ) -> ::core::result::Result<Utf8Validation, E> {
16575                        <Utf8Validation as ::buffa::Enumeration>::from_proto_name(v)
16576                            .ok_or_else(|| {
16577                                ::serde::de::Error::unknown_variant(v, &[])
16578                            })
16579                    }
16580                    fn visit_i64<E: ::serde::de::Error>(
16581                        self,
16582                        v: i64,
16583                    ) -> ::core::result::Result<Utf8Validation, E> {
16584                        let v32 = i32::try_from(v)
16585                            .map_err(|_| {
16586                                ::serde::de::Error::custom(
16587                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16588                                )
16589                            })?;
16590                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
16591                            .ok_or_else(|| {
16592                                ::serde::de::Error::custom(
16593                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16594                                )
16595                            })
16596                    }
16597                    fn visit_u64<E: ::serde::de::Error>(
16598                        self,
16599                        v: u64,
16600                    ) -> ::core::result::Result<Utf8Validation, E> {
16601                        let v32 = i32::try_from(v)
16602                            .map_err(|_| {
16603                                ::serde::de::Error::custom(
16604                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16605                                )
16606                            })?;
16607                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
16608                            .ok_or_else(|| {
16609                                ::serde::de::Error::custom(
16610                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16611                                )
16612                            })
16613                    }
16614                    fn visit_unit<E: ::serde::de::Error>(
16615                        self,
16616                    ) -> ::core::result::Result<Utf8Validation, E> {
16617                        ::core::result::Result::Ok(::core::default::Default::default())
16618                    }
16619                }
16620                d.deserialize_any(_V)
16621            }
16622        }
16623        impl ::buffa::json_helpers::ProtoElemJson for Utf8Validation {
16624            fn serialize_proto_json<S: ::serde::Serializer>(
16625                v: &Self,
16626                s: S,
16627            ) -> ::core::result::Result<S::Ok, S::Error> {
16628                ::serde::Serialize::serialize(v, s)
16629            }
16630            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16631                d: D,
16632            ) -> ::core::result::Result<Self, D::Error> {
16633                <Self as ::serde::Deserialize>::deserialize(d)
16634            }
16635        }
16636    };
16637    impl ::buffa::Enumeration for Utf8Validation {
16638        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16639            match value {
16640                0i32 => ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN),
16641                2i32 => ::core::option::Option::Some(Self::VERIFY),
16642                3i32 => ::core::option::Option::Some(Self::NONE),
16643                _ => ::core::option::Option::None,
16644            }
16645        }
16646        fn to_i32(&self) -> i32 {
16647            *self as i32
16648        }
16649        fn proto_name(&self) -> &'static str {
16650            match self {
16651                Self::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN",
16652                Self::VERIFY => "VERIFY",
16653                Self::NONE => "NONE",
16654            }
16655        }
16656        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16657            match name {
16658                "UTF8_VALIDATION_UNKNOWN" => {
16659                    ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
16660                }
16661                "VERIFY" => ::core::option::Option::Some(Self::VERIFY),
16662                "NONE" => ::core::option::Option::Some(Self::NONE),
16663                _ => ::core::option::Option::None,
16664            }
16665        }
16666        fn values() -> &'static [Self] {
16667            &[Self::UTF8_VALIDATION_UNKNOWN, Self::VERIFY, Self::NONE]
16668        }
16669    }
16670    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16671    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16672    #[repr(i32)]
16673    pub enum MessageEncoding {
16674        MESSAGE_ENCODING_UNKNOWN = 0i32,
16675        LENGTH_PREFIXED = 1i32,
16676        DELIMITED = 2i32,
16677    }
16678    impl MessageEncoding {
16679        ///Idiomatic alias for [`Self::MESSAGE_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
16680        #[allow(non_upper_case_globals)]
16681        pub const MessageEncodingUnknown: Self = Self::MESSAGE_ENCODING_UNKNOWN;
16682        ///Idiomatic alias for [`Self::LENGTH_PREFIXED`]; `Debug` prints the variant name.
16683        #[allow(non_upper_case_globals)]
16684        pub const LengthPrefixed: Self = Self::LENGTH_PREFIXED;
16685        ///Idiomatic alias for [`Self::DELIMITED`]; `Debug` prints the variant name.
16686        #[allow(non_upper_case_globals)]
16687        pub const Delimited: Self = Self::DELIMITED;
16688    }
16689    impl ::core::default::Default for MessageEncoding {
16690        fn default() -> Self {
16691            Self::MESSAGE_ENCODING_UNKNOWN
16692        }
16693    }
16694    #[cfg(feature = "json")]
16695    const _: () = {
16696        impl ::serde::Serialize for MessageEncoding {
16697            fn serialize<S: ::serde::Serializer>(
16698                &self,
16699                s: S,
16700            ) -> ::core::result::Result<S::Ok, S::Error> {
16701                s.serialize_str(::buffa::Enumeration::proto_name(self))
16702            }
16703        }
16704        impl<'de> ::serde::Deserialize<'de> for MessageEncoding {
16705            fn deserialize<D: ::serde::Deserializer<'de>>(
16706                d: D,
16707            ) -> ::core::result::Result<Self, D::Error> {
16708                struct _V;
16709                impl ::serde::de::Visitor<'_> for _V {
16710                    type Value = MessageEncoding;
16711                    fn expecting(
16712                        &self,
16713                        f: &mut ::core::fmt::Formatter<'_>,
16714                    ) -> ::core::fmt::Result {
16715                        f.write_str(
16716                            concat!(
16717                                "a string, integer, or null for ",
16718                                stringify!(MessageEncoding)
16719                            ),
16720                        )
16721                    }
16722                    fn visit_str<E: ::serde::de::Error>(
16723                        self,
16724                        v: &str,
16725                    ) -> ::core::result::Result<MessageEncoding, E> {
16726                        <MessageEncoding as ::buffa::Enumeration>::from_proto_name(v)
16727                            .ok_or_else(|| {
16728                                ::serde::de::Error::unknown_variant(v, &[])
16729                            })
16730                    }
16731                    fn visit_i64<E: ::serde::de::Error>(
16732                        self,
16733                        v: i64,
16734                    ) -> ::core::result::Result<MessageEncoding, E> {
16735                        let v32 = i32::try_from(v)
16736                            .map_err(|_| {
16737                                ::serde::de::Error::custom(
16738                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16739                                )
16740                            })?;
16741                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
16742                            .ok_or_else(|| {
16743                                ::serde::de::Error::custom(
16744                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16745                                )
16746                            })
16747                    }
16748                    fn visit_u64<E: ::serde::de::Error>(
16749                        self,
16750                        v: u64,
16751                    ) -> ::core::result::Result<MessageEncoding, E> {
16752                        let v32 = i32::try_from(v)
16753                            .map_err(|_| {
16754                                ::serde::de::Error::custom(
16755                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16756                                )
16757                            })?;
16758                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
16759                            .ok_or_else(|| {
16760                                ::serde::de::Error::custom(
16761                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16762                                )
16763                            })
16764                    }
16765                    fn visit_unit<E: ::serde::de::Error>(
16766                        self,
16767                    ) -> ::core::result::Result<MessageEncoding, E> {
16768                        ::core::result::Result::Ok(::core::default::Default::default())
16769                    }
16770                }
16771                d.deserialize_any(_V)
16772            }
16773        }
16774        impl ::buffa::json_helpers::ProtoElemJson for MessageEncoding {
16775            fn serialize_proto_json<S: ::serde::Serializer>(
16776                v: &Self,
16777                s: S,
16778            ) -> ::core::result::Result<S::Ok, S::Error> {
16779                ::serde::Serialize::serialize(v, s)
16780            }
16781            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16782                d: D,
16783            ) -> ::core::result::Result<Self, D::Error> {
16784                <Self as ::serde::Deserialize>::deserialize(d)
16785            }
16786        }
16787    };
16788    impl ::buffa::Enumeration for MessageEncoding {
16789        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16790            match value {
16791                0i32 => ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN),
16792                1i32 => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
16793                2i32 => ::core::option::Option::Some(Self::DELIMITED),
16794                _ => ::core::option::Option::None,
16795            }
16796        }
16797        fn to_i32(&self) -> i32 {
16798            *self as i32
16799        }
16800        fn proto_name(&self) -> &'static str {
16801            match self {
16802                Self::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN",
16803                Self::LENGTH_PREFIXED => "LENGTH_PREFIXED",
16804                Self::DELIMITED => "DELIMITED",
16805            }
16806        }
16807        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16808            match name {
16809                "MESSAGE_ENCODING_UNKNOWN" => {
16810                    ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
16811                }
16812                "LENGTH_PREFIXED" => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
16813                "DELIMITED" => ::core::option::Option::Some(Self::DELIMITED),
16814                _ => ::core::option::Option::None,
16815            }
16816        }
16817        fn values() -> &'static [Self] {
16818            &[Self::MESSAGE_ENCODING_UNKNOWN, Self::LENGTH_PREFIXED, Self::DELIMITED]
16819        }
16820    }
16821    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16822    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16823    #[repr(i32)]
16824    pub enum JsonFormat {
16825        JSON_FORMAT_UNKNOWN = 0i32,
16826        ALLOW = 1i32,
16827        LEGACY_BEST_EFFORT = 2i32,
16828    }
16829    impl JsonFormat {
16830        ///Idiomatic alias for [`Self::JSON_FORMAT_UNKNOWN`]; `Debug` prints the variant name.
16831        #[allow(non_upper_case_globals)]
16832        pub const JsonFormatUnknown: Self = Self::JSON_FORMAT_UNKNOWN;
16833        ///Idiomatic alias for [`Self::ALLOW`]; `Debug` prints the variant name.
16834        #[allow(non_upper_case_globals)]
16835        pub const Allow: Self = Self::ALLOW;
16836        ///Idiomatic alias for [`Self::LEGACY_BEST_EFFORT`]; `Debug` prints the variant name.
16837        #[allow(non_upper_case_globals)]
16838        pub const LegacyBestEffort: Self = Self::LEGACY_BEST_EFFORT;
16839    }
16840    impl ::core::default::Default for JsonFormat {
16841        fn default() -> Self {
16842            Self::JSON_FORMAT_UNKNOWN
16843        }
16844    }
16845    #[cfg(feature = "json")]
16846    const _: () = {
16847        impl ::serde::Serialize for JsonFormat {
16848            fn serialize<S: ::serde::Serializer>(
16849                &self,
16850                s: S,
16851            ) -> ::core::result::Result<S::Ok, S::Error> {
16852                s.serialize_str(::buffa::Enumeration::proto_name(self))
16853            }
16854        }
16855        impl<'de> ::serde::Deserialize<'de> for JsonFormat {
16856            fn deserialize<D: ::serde::Deserializer<'de>>(
16857                d: D,
16858            ) -> ::core::result::Result<Self, D::Error> {
16859                struct _V;
16860                impl ::serde::de::Visitor<'_> for _V {
16861                    type Value = JsonFormat;
16862                    fn expecting(
16863                        &self,
16864                        f: &mut ::core::fmt::Formatter<'_>,
16865                    ) -> ::core::fmt::Result {
16866                        f.write_str(
16867                            concat!(
16868                                "a string, integer, or null for ", stringify!(JsonFormat)
16869                            ),
16870                        )
16871                    }
16872                    fn visit_str<E: ::serde::de::Error>(
16873                        self,
16874                        v: &str,
16875                    ) -> ::core::result::Result<JsonFormat, E> {
16876                        <JsonFormat as ::buffa::Enumeration>::from_proto_name(v)
16877                            .ok_or_else(|| {
16878                                ::serde::de::Error::unknown_variant(v, &[])
16879                            })
16880                    }
16881                    fn visit_i64<E: ::serde::de::Error>(
16882                        self,
16883                        v: i64,
16884                    ) -> ::core::result::Result<JsonFormat, E> {
16885                        let v32 = i32::try_from(v)
16886                            .map_err(|_| {
16887                                ::serde::de::Error::custom(
16888                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16889                                )
16890                            })?;
16891                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
16892                            .ok_or_else(|| {
16893                                ::serde::de::Error::custom(
16894                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16895                                )
16896                            })
16897                    }
16898                    fn visit_u64<E: ::serde::de::Error>(
16899                        self,
16900                        v: u64,
16901                    ) -> ::core::result::Result<JsonFormat, E> {
16902                        let v32 = i32::try_from(v)
16903                            .map_err(|_| {
16904                                ::serde::de::Error::custom(
16905                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16906                                )
16907                            })?;
16908                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
16909                            .ok_or_else(|| {
16910                                ::serde::de::Error::custom(
16911                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16912                                )
16913                            })
16914                    }
16915                    fn visit_unit<E: ::serde::de::Error>(
16916                        self,
16917                    ) -> ::core::result::Result<JsonFormat, E> {
16918                        ::core::result::Result::Ok(::core::default::Default::default())
16919                    }
16920                }
16921                d.deserialize_any(_V)
16922            }
16923        }
16924        impl ::buffa::json_helpers::ProtoElemJson for JsonFormat {
16925            fn serialize_proto_json<S: ::serde::Serializer>(
16926                v: &Self,
16927                s: S,
16928            ) -> ::core::result::Result<S::Ok, S::Error> {
16929                ::serde::Serialize::serialize(v, s)
16930            }
16931            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16932                d: D,
16933            ) -> ::core::result::Result<Self, D::Error> {
16934                <Self as ::serde::Deserialize>::deserialize(d)
16935            }
16936        }
16937    };
16938    impl ::buffa::Enumeration for JsonFormat {
16939        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16940            match value {
16941                0i32 => ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
16942                1i32 => ::core::option::Option::Some(Self::ALLOW),
16943                2i32 => ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT),
16944                _ => ::core::option::Option::None,
16945            }
16946        }
16947        fn to_i32(&self) -> i32 {
16948            *self as i32
16949        }
16950        fn proto_name(&self) -> &'static str {
16951            match self {
16952                Self::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN",
16953                Self::ALLOW => "ALLOW",
16954                Self::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT",
16955            }
16956        }
16957        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16958            match name {
16959                "JSON_FORMAT_UNKNOWN" => {
16960                    ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN)
16961                }
16962                "ALLOW" => ::core::option::Option::Some(Self::ALLOW),
16963                "LEGACY_BEST_EFFORT" => {
16964                    ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT)
16965                }
16966                _ => ::core::option::Option::None,
16967            }
16968        }
16969        fn values() -> &'static [Self] {
16970            &[Self::JSON_FORMAT_UNKNOWN, Self::ALLOW, Self::LEGACY_BEST_EFFORT]
16971        }
16972    }
16973    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16974    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16975    #[repr(i32)]
16976    pub enum EnforceNamingStyle {
16977        ENFORCE_NAMING_STYLE_UNKNOWN = 0i32,
16978        STYLE2024 = 1i32,
16979        STYLE_LEGACY = 2i32,
16980    }
16981    impl EnforceNamingStyle {
16982        ///Idiomatic alias for [`Self::ENFORCE_NAMING_STYLE_UNKNOWN`]; `Debug` prints the variant name.
16983        #[allow(non_upper_case_globals)]
16984        pub const EnforceNamingStyleUnknown: Self = Self::ENFORCE_NAMING_STYLE_UNKNOWN;
16985        ///Idiomatic alias for [`Self::STYLE2024`]; `Debug` prints the variant name.
16986        #[allow(non_upper_case_globals)]
16987        pub const Style2024: Self = Self::STYLE2024;
16988        ///Idiomatic alias for [`Self::STYLE_LEGACY`]; `Debug` prints the variant name.
16989        #[allow(non_upper_case_globals)]
16990        pub const StyleLegacy: Self = Self::STYLE_LEGACY;
16991    }
16992    impl ::core::default::Default for EnforceNamingStyle {
16993        fn default() -> Self {
16994            Self::ENFORCE_NAMING_STYLE_UNKNOWN
16995        }
16996    }
16997    #[cfg(feature = "json")]
16998    const _: () = {
16999        impl ::serde::Serialize for EnforceNamingStyle {
17000            fn serialize<S: ::serde::Serializer>(
17001                &self,
17002                s: S,
17003            ) -> ::core::result::Result<S::Ok, S::Error> {
17004                s.serialize_str(::buffa::Enumeration::proto_name(self))
17005            }
17006        }
17007        impl<'de> ::serde::Deserialize<'de> for EnforceNamingStyle {
17008            fn deserialize<D: ::serde::Deserializer<'de>>(
17009                d: D,
17010            ) -> ::core::result::Result<Self, D::Error> {
17011                struct _V;
17012                impl ::serde::de::Visitor<'_> for _V {
17013                    type Value = EnforceNamingStyle;
17014                    fn expecting(
17015                        &self,
17016                        f: &mut ::core::fmt::Formatter<'_>,
17017                    ) -> ::core::fmt::Result {
17018                        f.write_str(
17019                            concat!(
17020                                "a string, integer, or null for ",
17021                                stringify!(EnforceNamingStyle)
17022                            ),
17023                        )
17024                    }
17025                    fn visit_str<E: ::serde::de::Error>(
17026                        self,
17027                        v: &str,
17028                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17029                        <EnforceNamingStyle as ::buffa::Enumeration>::from_proto_name(v)
17030                            .ok_or_else(|| {
17031                                ::serde::de::Error::unknown_variant(v, &[])
17032                            })
17033                    }
17034                    fn visit_i64<E: ::serde::de::Error>(
17035                        self,
17036                        v: i64,
17037                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17038                        let v32 = i32::try_from(v)
17039                            .map_err(|_| {
17040                                ::serde::de::Error::custom(
17041                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17042                                )
17043                            })?;
17044                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17045                            .ok_or_else(|| {
17046                                ::serde::de::Error::custom(
17047                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17048                                )
17049                            })
17050                    }
17051                    fn visit_u64<E: ::serde::de::Error>(
17052                        self,
17053                        v: u64,
17054                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17055                        let v32 = i32::try_from(v)
17056                            .map_err(|_| {
17057                                ::serde::de::Error::custom(
17058                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17059                                )
17060                            })?;
17061                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17062                            .ok_or_else(|| {
17063                                ::serde::de::Error::custom(
17064                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17065                                )
17066                            })
17067                    }
17068                    fn visit_unit<E: ::serde::de::Error>(
17069                        self,
17070                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17071                        ::core::result::Result::Ok(::core::default::Default::default())
17072                    }
17073                }
17074                d.deserialize_any(_V)
17075            }
17076        }
17077        impl ::buffa::json_helpers::ProtoElemJson for EnforceNamingStyle {
17078            fn serialize_proto_json<S: ::serde::Serializer>(
17079                v: &Self,
17080                s: S,
17081            ) -> ::core::result::Result<S::Ok, S::Error> {
17082                ::serde::Serialize::serialize(v, s)
17083            }
17084            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17085                d: D,
17086            ) -> ::core::result::Result<Self, D::Error> {
17087                <Self as ::serde::Deserialize>::deserialize(d)
17088            }
17089        }
17090    };
17091    impl ::buffa::Enumeration for EnforceNamingStyle {
17092        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17093            match value {
17094                0i32 => ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN),
17095                1i32 => ::core::option::Option::Some(Self::STYLE2024),
17096                2i32 => ::core::option::Option::Some(Self::STYLE_LEGACY),
17097                _ => ::core::option::Option::None,
17098            }
17099        }
17100        fn to_i32(&self) -> i32 {
17101            *self as i32
17102        }
17103        fn proto_name(&self) -> &'static str {
17104            match self {
17105                Self::ENFORCE_NAMING_STYLE_UNKNOWN => "ENFORCE_NAMING_STYLE_UNKNOWN",
17106                Self::STYLE2024 => "STYLE2024",
17107                Self::STYLE_LEGACY => "STYLE_LEGACY",
17108            }
17109        }
17110        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17111            match name {
17112                "ENFORCE_NAMING_STYLE_UNKNOWN" => {
17113                    ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN)
17114                }
17115                "STYLE2024" => ::core::option::Option::Some(Self::STYLE2024),
17116                "STYLE_LEGACY" => ::core::option::Option::Some(Self::STYLE_LEGACY),
17117                _ => ::core::option::Option::None,
17118            }
17119        }
17120        fn values() -> &'static [Self] {
17121            &[Self::ENFORCE_NAMING_STYLE_UNKNOWN, Self::STYLE2024, Self::STYLE_LEGACY]
17122        }
17123    }
17124    #[derive(Clone, PartialEq, Default)]
17125    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17126    #[cfg_attr(feature = "json", serde(default))]
17127    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17128    pub struct VisibilityFeature {
17129        #[cfg_attr(feature = "json", serde(skip))]
17130        #[doc(hidden)]
17131        pub __buffa_unknown_fields: ::buffa::UnknownFields,
17132    }
17133    impl ::core::fmt::Debug for VisibilityFeature {
17134        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17135            f.debug_struct("VisibilityFeature").finish()
17136        }
17137    }
17138    impl VisibilityFeature {
17139        /// Protobuf type URL for this message, for use with `Any::pack` and
17140        /// `Any::unpack_if`.
17141        ///
17142        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17143        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17144    }
17145    ::buffa::impl_default_instance!(VisibilityFeature);
17146    impl ::buffa::MessageName for VisibilityFeature {
17147        const PACKAGE: &'static str = "google.protobuf";
17148        const NAME: &'static str = "FeatureSet.VisibilityFeature";
17149        const FULL_NAME: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17150        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17151    }
17152    impl ::buffa::Message for VisibilityFeature {
17153        /// Returns the total encoded size in bytes.
17154        ///
17155        /// The result is a `u32`; the protobuf specification requires all
17156        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
17157        /// compliant message will never overflow this type.
17158        #[allow(clippy::let_and_return)]
17159        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17160            #[allow(unused_imports)]
17161            use ::buffa::Enumeration as _;
17162            let mut size = 0u32;
17163            size += self.__buffa_unknown_fields.encoded_len() as u32;
17164            size
17165        }
17166        fn write_to(
17167            &self,
17168            _cache: &mut ::buffa::SizeCache,
17169            buf: &mut impl ::buffa::bytes::BufMut,
17170        ) {
17171            #[allow(unused_imports)]
17172            use ::buffa::Enumeration as _;
17173            self.__buffa_unknown_fields.write_to(buf);
17174        }
17175        fn merge_field(
17176            &mut self,
17177            tag: ::buffa::encoding::Tag,
17178            buf: &mut impl ::buffa::bytes::Buf,
17179            ctx: ::buffa::DecodeContext<'_>,
17180        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
17181            #[allow(unused_imports)]
17182            use ::buffa::bytes::Buf as _;
17183            #[allow(unused_imports)]
17184            use ::buffa::Enumeration as _;
17185            match tag.field_number() {
17186                _ => {
17187                    self.__buffa_unknown_fields
17188                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
17189                }
17190            }
17191            ::core::result::Result::Ok(())
17192        }
17193        fn clear(&mut self) {
17194            self.__buffa_unknown_fields.clear();
17195        }
17196    }
17197    impl ::buffa::ExtensionSet for VisibilityFeature {
17198        const PROTO_FQN: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17199        fn unknown_fields(&self) -> &::buffa::UnknownFields {
17200            &self.__buffa_unknown_fields
17201        }
17202        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
17203            &mut self.__buffa_unknown_fields
17204        }
17205    }
17206    #[cfg(feature = "text")]
17207    impl ::buffa::text::TextFormat for VisibilityFeature {
17208        fn encode_text(
17209            &self,
17210            enc: &mut ::buffa::text::TextEncoder<'_>,
17211        ) -> ::core::fmt::Result {
17212            #[allow(unused_imports)]
17213            use ::buffa::Enumeration as _;
17214            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
17215            ::core::result::Result::Ok(())
17216        }
17217        fn merge_text(
17218            &mut self,
17219            dec: &mut ::buffa::text::TextDecoder<'_>,
17220        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
17221            #[allow(unused_imports)]
17222            use ::buffa::Enumeration as _;
17223            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
17224                match __name {
17225                    _ => dec.skip_value()?,
17226                }
17227            }
17228            ::core::result::Result::Ok(())
17229        }
17230    }
17231    #[cfg(feature = "json")]
17232    impl ::buffa::json_helpers::ProtoElemJson for VisibilityFeature {
17233        fn serialize_proto_json<S: ::serde::Serializer>(
17234            v: &Self,
17235            s: S,
17236        ) -> ::core::result::Result<S::Ok, S::Error> {
17237            ::serde::Serialize::serialize(v, s)
17238        }
17239        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17240            d: D,
17241        ) -> ::core::result::Result<Self, D::Error> {
17242            <Self as ::serde::Deserialize>::deserialize(d)
17243        }
17244    }
17245    #[cfg(feature = "json")]
17246    #[doc(hidden)]
17247    pub const __VISIBILITY_FEATURE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
17248        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17249        to_json: ::buffa::type_registry::any_to_json::<VisibilityFeature>,
17250        from_json: ::buffa::type_registry::any_from_json::<VisibilityFeature>,
17251        is_wkt: false,
17252    };
17253    #[cfg(feature = "text")]
17254    #[doc(hidden)]
17255    pub const __VISIBILITY_FEATURE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
17256        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17257        text_encode: ::buffa::type_registry::any_encode_text::<VisibilityFeature>,
17258        text_merge: ::buffa::type_registry::any_merge_text::<VisibilityFeature>,
17259    };
17260    pub mod visibility_feature {
17261        #[allow(unused_imports)]
17262        use super::*;
17263        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17264        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17265        #[repr(i32)]
17266        pub enum DefaultSymbolVisibility {
17267            DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0i32,
17268            /// Default pre-EDITION_2024, all UNSET visibility are export.
17269            EXPORT_ALL = 1i32,
17270            /// All top-level symbols default to export, nested default to local.
17271            EXPORT_TOP_LEVEL = 2i32,
17272            /// All symbols default to local.
17273            LOCAL_ALL = 3i32,
17274            /// All symbols local by default. Nested types cannot be exported.
17275            /// With special case caveat for message { enum {} reserved 1 to max; }
17276            /// This is the recommended setting for new protos.
17277            STRICT = 4i32,
17278        }
17279        impl DefaultSymbolVisibility {
17280            ///Idiomatic alias for [`Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`]; `Debug` prints the variant name.
17281            #[allow(non_upper_case_globals)]
17282            pub const DefaultSymbolVisibilityUnknown: Self = Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
17283            ///Idiomatic alias for [`Self::EXPORT_ALL`]; `Debug` prints the variant name.
17284            #[allow(non_upper_case_globals)]
17285            pub const ExportAll: Self = Self::EXPORT_ALL;
17286            ///Idiomatic alias for [`Self::EXPORT_TOP_LEVEL`]; `Debug` prints the variant name.
17287            #[allow(non_upper_case_globals)]
17288            pub const ExportTopLevel: Self = Self::EXPORT_TOP_LEVEL;
17289            ///Idiomatic alias for [`Self::LOCAL_ALL`]; `Debug` prints the variant name.
17290            #[allow(non_upper_case_globals)]
17291            pub const LocalAll: Self = Self::LOCAL_ALL;
17292            ///Idiomatic alias for [`Self::STRICT`]; `Debug` prints the variant name.
17293            #[allow(non_upper_case_globals)]
17294            pub const Strict: Self = Self::STRICT;
17295        }
17296        impl ::core::default::Default for DefaultSymbolVisibility {
17297            fn default() -> Self {
17298                Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
17299            }
17300        }
17301        #[cfg(feature = "json")]
17302        const _: () = {
17303            impl ::serde::Serialize for DefaultSymbolVisibility {
17304                fn serialize<S: ::serde::Serializer>(
17305                    &self,
17306                    s: S,
17307                ) -> ::core::result::Result<S::Ok, S::Error> {
17308                    s.serialize_str(::buffa::Enumeration::proto_name(self))
17309                }
17310            }
17311            impl<'de> ::serde::Deserialize<'de> for DefaultSymbolVisibility {
17312                fn deserialize<D: ::serde::Deserializer<'de>>(
17313                    d: D,
17314                ) -> ::core::result::Result<Self, D::Error> {
17315                    struct _V;
17316                    impl ::serde::de::Visitor<'_> for _V {
17317                        type Value = DefaultSymbolVisibility;
17318                        fn expecting(
17319                            &self,
17320                            f: &mut ::core::fmt::Formatter<'_>,
17321                        ) -> ::core::fmt::Result {
17322                            f.write_str(
17323                                concat!(
17324                                    "a string, integer, or null for ",
17325                                    stringify!(DefaultSymbolVisibility)
17326                                ),
17327                            )
17328                        }
17329                        fn visit_str<E: ::serde::de::Error>(
17330                            self,
17331                            v: &str,
17332                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17333                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_proto_name(
17334                                    v,
17335                                )
17336                                .ok_or_else(|| {
17337                                    ::serde::de::Error::unknown_variant(v, &[])
17338                                })
17339                        }
17340                        fn visit_i64<E: ::serde::de::Error>(
17341                            self,
17342                            v: i64,
17343                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17344                            let v32 = i32::try_from(v)
17345                                .map_err(|_| {
17346                                    ::serde::de::Error::custom(
17347                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17348                                    )
17349                                })?;
17350                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17351                                    v32,
17352                                )
17353                                .ok_or_else(|| {
17354                                    ::serde::de::Error::custom(
17355                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17356                                    )
17357                                })
17358                        }
17359                        fn visit_u64<E: ::serde::de::Error>(
17360                            self,
17361                            v: u64,
17362                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17363                            let v32 = i32::try_from(v)
17364                                .map_err(|_| {
17365                                    ::serde::de::Error::custom(
17366                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17367                                    )
17368                                })?;
17369                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17370                                    v32,
17371                                )
17372                                .ok_or_else(|| {
17373                                    ::serde::de::Error::custom(
17374                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17375                                    )
17376                                })
17377                        }
17378                        fn visit_unit<E: ::serde::de::Error>(
17379                            self,
17380                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17381                            ::core::result::Result::Ok(
17382                                ::core::default::Default::default(),
17383                            )
17384                        }
17385                    }
17386                    d.deserialize_any(_V)
17387                }
17388            }
17389            impl ::buffa::json_helpers::ProtoElemJson for DefaultSymbolVisibility {
17390                fn serialize_proto_json<S: ::serde::Serializer>(
17391                    v: &Self,
17392                    s: S,
17393                ) -> ::core::result::Result<S::Ok, S::Error> {
17394                    ::serde::Serialize::serialize(v, s)
17395                }
17396                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17397                    d: D,
17398                ) -> ::core::result::Result<Self, D::Error> {
17399                    <Self as ::serde::Deserialize>::deserialize(d)
17400                }
17401            }
17402        };
17403        impl ::buffa::Enumeration for DefaultSymbolVisibility {
17404            fn from_i32(value: i32) -> ::core::option::Option<Self> {
17405                match value {
17406                    0i32 => {
17407                        ::core::option::Option::Some(
17408                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17409                        )
17410                    }
17411                    1i32 => ::core::option::Option::Some(Self::EXPORT_ALL),
17412                    2i32 => ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL),
17413                    3i32 => ::core::option::Option::Some(Self::LOCAL_ALL),
17414                    4i32 => ::core::option::Option::Some(Self::STRICT),
17415                    _ => ::core::option::Option::None,
17416                }
17417            }
17418            fn to_i32(&self) -> i32 {
17419                *self as i32
17420            }
17421            fn proto_name(&self) -> &'static str {
17422                match self {
17423                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => {
17424                        "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"
17425                    }
17426                    Self::EXPORT_ALL => "EXPORT_ALL",
17427                    Self::EXPORT_TOP_LEVEL => "EXPORT_TOP_LEVEL",
17428                    Self::LOCAL_ALL => "LOCAL_ALL",
17429                    Self::STRICT => "STRICT",
17430                }
17431            }
17432            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17433                match name {
17434                    "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => {
17435                        ::core::option::Option::Some(
17436                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17437                        )
17438                    }
17439                    "EXPORT_ALL" => ::core::option::Option::Some(Self::EXPORT_ALL),
17440                    "EXPORT_TOP_LEVEL" => {
17441                        ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL)
17442                    }
17443                    "LOCAL_ALL" => ::core::option::Option::Some(Self::LOCAL_ALL),
17444                    "STRICT" => ::core::option::Option::Some(Self::STRICT),
17445                    _ => ::core::option::Option::None,
17446                }
17447            }
17448            fn values() -> &'static [Self] {
17449                &[
17450                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17451                    Self::EXPORT_ALL,
17452                    Self::EXPORT_TOP_LEVEL,
17453                    Self::LOCAL_ALL,
17454                    Self::STRICT,
17455                ]
17456            }
17457        }
17458    }
17459    #[cfg(feature = "views")]
17460    #[doc(inline)]
17461    pub use super::__buffa::view::feature_set::VisibilityFeatureView;
17462    #[cfg(feature = "views")]
17463    #[doc(inline)]
17464    pub use super::__buffa::view::feature_set::VisibilityFeatureOwnedView;
17465}
17466/// A compiled specification for the defaults of a set of features.  These
17467/// messages are generated from FeatureSet extensions and can be used to seed
17468/// feature resolution. The resolution with this object becomes a simple search
17469/// for the closest matching edition, followed by proto merges.
17470#[derive(Clone, PartialEq, Default)]
17471#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17472#[cfg_attr(feature = "json", serde(default))]
17473#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17474pub struct FeatureSetDefaults {
17475    /// Field 1: `defaults`
17476    #[cfg_attr(
17477        feature = "json",
17478        serde(
17479            rename = "defaults",
17480            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
17481            deserialize_with = "::buffa::json_helpers::null_as_default"
17482        )
17483    )]
17484    pub defaults: ::buffa::alloc::vec::Vec<
17485        feature_set_defaults::FeatureSetEditionDefault,
17486    >,
17487    /// The minimum supported edition (inclusive) when this was constructed.
17488    /// Editions before this will not have defaults.
17489    ///
17490    /// Field 4: `minimum_edition`
17491    #[cfg_attr(
17492        feature = "json",
17493        serde(
17494            rename = "minimumEdition",
17495            alias = "minimum_edition",
17496            with = "::buffa::json_helpers::opt_closed_enum",
17497            skip_serializing_if = "::core::option::Option::is_none"
17498        )
17499    )]
17500    pub minimum_edition: ::core::option::Option<Edition>,
17501    /// The maximum known edition (inclusive) when this was constructed. Editions
17502    /// after this will not have reliable defaults.
17503    ///
17504    /// Field 5: `maximum_edition`
17505    #[cfg_attr(
17506        feature = "json",
17507        serde(
17508            rename = "maximumEdition",
17509            alias = "maximum_edition",
17510            with = "::buffa::json_helpers::opt_closed_enum",
17511            skip_serializing_if = "::core::option::Option::is_none"
17512        )
17513    )]
17514    pub maximum_edition: ::core::option::Option<Edition>,
17515    #[cfg_attr(feature = "json", serde(skip))]
17516    #[doc(hidden)]
17517    pub __buffa_unknown_fields: ::buffa::UnknownFields,
17518}
17519impl ::core::fmt::Debug for FeatureSetDefaults {
17520    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17521        f.debug_struct("FeatureSetDefaults")
17522            .field("defaults", &self.defaults)
17523            .field("minimum_edition", &self.minimum_edition)
17524            .field("maximum_edition", &self.maximum_edition)
17525            .finish()
17526    }
17527}
17528impl FeatureSetDefaults {
17529    /// Protobuf type URL for this message, for use with `Any::pack` and
17530    /// `Any::unpack_if`.
17531    ///
17532    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17533    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
17534}
17535impl FeatureSetDefaults {
17536    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
17537    #[inline]
17538    ///Sets [`Self::minimum_edition`] to `Some(value)`, consuming and returning `self`.
17539    pub fn with_minimum_edition(mut self, value: impl Into<Edition>) -> Self {
17540        self.minimum_edition = Some(value.into());
17541        self
17542    }
17543    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
17544    #[inline]
17545    ///Sets [`Self::maximum_edition`] to `Some(value)`, consuming and returning `self`.
17546    pub fn with_maximum_edition(mut self, value: impl Into<Edition>) -> Self {
17547        self.maximum_edition = Some(value.into());
17548        self
17549    }
17550}
17551::buffa::impl_default_instance!(FeatureSetDefaults);
17552impl ::buffa::MessageName for FeatureSetDefaults {
17553    const PACKAGE: &'static str = "google.protobuf";
17554    const NAME: &'static str = "FeatureSetDefaults";
17555    const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults";
17556    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
17557}
17558impl ::buffa::Message for FeatureSetDefaults {
17559    /// Returns the total encoded size in bytes.
17560    ///
17561    /// The result is a `u32`; the protobuf specification requires all
17562    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
17563    /// compliant message will never overflow this type.
17564    #[allow(clippy::let_and_return)]
17565    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
17566        #[allow(unused_imports)]
17567        use ::buffa::Enumeration as _;
17568        let mut size = 0u32;
17569        for v in &self.defaults {
17570            let __slot = __cache.reserve();
17571            let inner_size = v.compute_size(__cache);
17572            __cache.set(__slot, inner_size);
17573            size
17574                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
17575                    + inner_size;
17576        }
17577        if let Some(ref v) = self.minimum_edition {
17578            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
17579        }
17580        if let Some(ref v) = self.maximum_edition {
17581            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
17582        }
17583        size += self.__buffa_unknown_fields.encoded_len() as u32;
17584        size
17585    }
17586    fn write_to(
17587        &self,
17588        __cache: &mut ::buffa::SizeCache,
17589        buf: &mut impl ::buffa::bytes::BufMut,
17590    ) {
17591        #[allow(unused_imports)]
17592        use ::buffa::Enumeration as _;
17593        for v in &self.defaults {
17594            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
17595            v.write_to(__cache, buf);
17596        }
17597        if let Some(ref v) = self.minimum_edition {
17598            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
17599        }
17600        if let Some(ref v) = self.maximum_edition {
17601            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
17602        }
17603        self.__buffa_unknown_fields.write_to(buf);
17604    }
17605    fn merge_field(
17606        &mut self,
17607        tag: ::buffa::encoding::Tag,
17608        buf: &mut impl ::buffa::bytes::Buf,
17609        ctx: ::buffa::DecodeContext<'_>,
17610    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
17611        #[allow(unused_imports)]
17612        use ::buffa::bytes::Buf as _;
17613        #[allow(unused_imports)]
17614        use ::buffa::Enumeration as _;
17615        match tag.field_number() {
17616            1u32 => {
17617                ::buffa::encoding::check_wire_type(
17618                    tag,
17619                    ::buffa::encoding::WireType::LengthDelimited,
17620                )?;
17621                let mut elem = ::core::default::Default::default();
17622                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
17623                self.defaults.push(elem);
17624            }
17625            4u32 => {
17626                ::buffa::encoding::check_wire_type(
17627                    tag,
17628                    ::buffa::encoding::WireType::Varint,
17629                )?;
17630                let __raw = ::buffa::types::decode_int32(buf)?;
17631                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
17632                    __raw,
17633                ) {
17634                    self.minimum_edition = ::core::option::Option::Some(__v);
17635                } else {
17636                    self.__buffa_unknown_fields
17637                        .push(::buffa::UnknownField {
17638                            number: 4u32,
17639                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
17640                        });
17641                }
17642            }
17643            5u32 => {
17644                ::buffa::encoding::check_wire_type(
17645                    tag,
17646                    ::buffa::encoding::WireType::Varint,
17647                )?;
17648                let __raw = ::buffa::types::decode_int32(buf)?;
17649                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
17650                    __raw,
17651                ) {
17652                    self.maximum_edition = ::core::option::Option::Some(__v);
17653                } else {
17654                    self.__buffa_unknown_fields
17655                        .push(::buffa::UnknownField {
17656                            number: 5u32,
17657                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
17658                        });
17659                }
17660            }
17661            _ => {
17662                self.__buffa_unknown_fields
17663                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
17664            }
17665        }
17666        ::core::result::Result::Ok(())
17667    }
17668    fn clear(&mut self) {
17669        self.defaults.clear();
17670        self.minimum_edition = ::core::option::Option::None;
17671        self.maximum_edition = ::core::option::Option::None;
17672        self.__buffa_unknown_fields.clear();
17673    }
17674}
17675impl ::buffa::ExtensionSet for FeatureSetDefaults {
17676    const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults";
17677    fn unknown_fields(&self) -> &::buffa::UnknownFields {
17678        &self.__buffa_unknown_fields
17679    }
17680    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
17681        &mut self.__buffa_unknown_fields
17682    }
17683}
17684#[cfg(feature = "text")]
17685impl ::buffa::text::TextFormat for FeatureSetDefaults {
17686    fn encode_text(
17687        &self,
17688        enc: &mut ::buffa::text::TextEncoder<'_>,
17689    ) -> ::core::fmt::Result {
17690        #[allow(unused_imports)]
17691        use ::buffa::Enumeration as _;
17692        if let ::core::option::Option::Some(ref __v) = self.minimum_edition {
17693            enc.write_field_name("minimum_edition")?;
17694            enc.write_enum_name(__v.proto_name())?;
17695        }
17696        if let ::core::option::Option::Some(ref __v) = self.maximum_edition {
17697            enc.write_field_name("maximum_edition")?;
17698            enc.write_enum_name(__v.proto_name())?;
17699        }
17700        for __v in &self.defaults {
17701            enc.write_field_name("defaults")?;
17702            enc.write_message(__v)?;
17703        }
17704        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
17705        ::core::result::Result::Ok(())
17706    }
17707    fn merge_text(
17708        &mut self,
17709        dec: &mut ::buffa::text::TextDecoder<'_>,
17710    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
17711        #[allow(unused_imports)]
17712        use ::buffa::Enumeration as _;
17713        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
17714            match __name {
17715                "minimum_edition" => {
17716                    self.minimum_edition = ::core::option::Option::Some(
17717                        dec.read_closed_enum_by_name::<Edition>()?,
17718                    );
17719                }
17720                "maximum_edition" => {
17721                    self.maximum_edition = ::core::option::Option::Some(
17722                        dec.read_closed_enum_by_name::<Edition>()?,
17723                    );
17724                }
17725                "defaults" => {
17726                    dec.read_repeated_into(
17727                        &mut self.defaults,
17728                        |__d| {
17729                            let mut __m = ::core::default::Default::default();
17730                            __d.merge_message(&mut __m)?;
17731                            ::core::result::Result::Ok(__m)
17732                        },
17733                    )?
17734                }
17735                _ => dec.skip_value()?,
17736            }
17737        }
17738        ::core::result::Result::Ok(())
17739    }
17740}
17741#[cfg(feature = "json")]
17742impl ::buffa::json_helpers::ProtoElemJson for FeatureSetDefaults {
17743    fn serialize_proto_json<S: ::serde::Serializer>(
17744        v: &Self,
17745        s: S,
17746    ) -> ::core::result::Result<S::Ok, S::Error> {
17747        ::serde::Serialize::serialize(v, s)
17748    }
17749    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17750        d: D,
17751    ) -> ::core::result::Result<Self, D::Error> {
17752        <Self as ::serde::Deserialize>::deserialize(d)
17753    }
17754}
17755#[cfg(feature = "json")]
17756#[doc(hidden)]
17757pub const __FEATURE_SET_DEFAULTS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
17758    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
17759    to_json: ::buffa::type_registry::any_to_json::<FeatureSetDefaults>,
17760    from_json: ::buffa::type_registry::any_from_json::<FeatureSetDefaults>,
17761    is_wkt: false,
17762};
17763#[cfg(feature = "text")]
17764#[doc(hidden)]
17765pub const __FEATURE_SET_DEFAULTS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
17766    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
17767    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetDefaults>,
17768    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetDefaults>,
17769};
17770pub mod feature_set_defaults {
17771    #[allow(unused_imports)]
17772    use super::*;
17773    /// A map from every known edition with a unique set of defaults to its
17774    /// defaults. Not all editions may be contained here.  For a given edition,
17775    /// the defaults at the closest matching edition ordered at or before it should
17776    /// be used.  This field must be in strict ascending order by edition.
17777    #[derive(Clone, PartialEq, Default)]
17778    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17779    #[cfg_attr(feature = "json", serde(default))]
17780    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17781    pub struct FeatureSetEditionDefault {
17782        /// Field 3: `edition`
17783        #[cfg_attr(
17784            feature = "json",
17785            serde(
17786                rename = "edition",
17787                with = "::buffa::json_helpers::opt_closed_enum",
17788                skip_serializing_if = "::core::option::Option::is_none"
17789            )
17790        )]
17791        pub edition: ::core::option::Option<super::Edition>,
17792        /// Defaults of features that can be overridden in this edition.
17793        ///
17794        /// Field 4: `overridable_features`
17795        #[cfg_attr(
17796            feature = "json",
17797            serde(
17798                rename = "overridableFeatures",
17799                alias = "overridable_features",
17800                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
17801            )
17802        )]
17803        pub overridable_features: ::buffa::MessageField<super::FeatureSet>,
17804        /// Defaults of features that can't be overridden in this edition.
17805        ///
17806        /// Field 5: `fixed_features`
17807        #[cfg_attr(
17808            feature = "json",
17809            serde(
17810                rename = "fixedFeatures",
17811                alias = "fixed_features",
17812                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
17813            )
17814        )]
17815        pub fixed_features: ::buffa::MessageField<super::FeatureSet>,
17816        #[cfg_attr(feature = "json", serde(skip))]
17817        #[doc(hidden)]
17818        pub __buffa_unknown_fields: ::buffa::UnknownFields,
17819    }
17820    impl ::core::fmt::Debug for FeatureSetEditionDefault {
17821        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17822            f.debug_struct("FeatureSetEditionDefault")
17823                .field("edition", &self.edition)
17824                .field("overridable_features", &self.overridable_features)
17825                .field("fixed_features", &self.fixed_features)
17826                .finish()
17827        }
17828    }
17829    impl FeatureSetEditionDefault {
17830        /// Protobuf type URL for this message, for use with `Any::pack` and
17831        /// `Any::unpack_if`.
17832        ///
17833        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17834        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
17835    }
17836    impl FeatureSetEditionDefault {
17837        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
17838        #[inline]
17839        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
17840        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
17841            self.edition = Some(value.into());
17842            self
17843        }
17844    }
17845    ::buffa::impl_default_instance!(FeatureSetEditionDefault);
17846    impl ::buffa::MessageName for FeatureSetEditionDefault {
17847        const PACKAGE: &'static str = "google.protobuf";
17848        const NAME: &'static str = "FeatureSetDefaults.FeatureSetEditionDefault";
17849        const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
17850        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
17851    }
17852    impl ::buffa::Message for FeatureSetEditionDefault {
17853        /// Returns the total encoded size in bytes.
17854        ///
17855        /// The result is a `u32`; the protobuf specification requires all
17856        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
17857        /// compliant message will never overflow this type.
17858        #[allow(clippy::let_and_return)]
17859        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
17860            #[allow(unused_imports)]
17861            use ::buffa::Enumeration as _;
17862            let mut size = 0u32;
17863            if let Some(ref v) = self.edition {
17864                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
17865            }
17866            if self.overridable_features.is_set() {
17867                let __slot = __cache.reserve();
17868                let inner_size = self.overridable_features.compute_size(__cache);
17869                __cache.set(__slot, inner_size);
17870                size
17871                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
17872                        + inner_size;
17873            }
17874            if self.fixed_features.is_set() {
17875                let __slot = __cache.reserve();
17876                let inner_size = self.fixed_features.compute_size(__cache);
17877                __cache.set(__slot, inner_size);
17878                size
17879                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
17880                        + inner_size;
17881            }
17882            size += self.__buffa_unknown_fields.encoded_len() as u32;
17883            size
17884        }
17885        fn write_to(
17886            &self,
17887            __cache: &mut ::buffa::SizeCache,
17888            buf: &mut impl ::buffa::bytes::BufMut,
17889        ) {
17890            #[allow(unused_imports)]
17891            use ::buffa::Enumeration as _;
17892            if let Some(ref v) = self.edition {
17893                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
17894            }
17895            if self.overridable_features.is_set() {
17896                ::buffa::types::put_len_delimited_header(
17897                    4u32,
17898                    __cache.consume_next(),
17899                    buf,
17900                );
17901                self.overridable_features.write_to(__cache, buf);
17902            }
17903            if self.fixed_features.is_set() {
17904                ::buffa::types::put_len_delimited_header(
17905                    5u32,
17906                    __cache.consume_next(),
17907                    buf,
17908                );
17909                self.fixed_features.write_to(__cache, buf);
17910            }
17911            self.__buffa_unknown_fields.write_to(buf);
17912        }
17913        fn merge_field(
17914            &mut self,
17915            tag: ::buffa::encoding::Tag,
17916            buf: &mut impl ::buffa::bytes::Buf,
17917            ctx: ::buffa::DecodeContext<'_>,
17918        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
17919            #[allow(unused_imports)]
17920            use ::buffa::bytes::Buf as _;
17921            #[allow(unused_imports)]
17922            use ::buffa::Enumeration as _;
17923            match tag.field_number() {
17924                3u32 => {
17925                    ::buffa::encoding::check_wire_type(
17926                        tag,
17927                        ::buffa::encoding::WireType::Varint,
17928                    )?;
17929                    let __raw = ::buffa::types::decode_int32(buf)?;
17930                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
17931                        __raw,
17932                    ) {
17933                        self.edition = ::core::option::Option::Some(__v);
17934                    } else {
17935                        self.__buffa_unknown_fields
17936                            .push(::buffa::UnknownField {
17937                                number: 3u32,
17938                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
17939                            });
17940                    }
17941                }
17942                4u32 => {
17943                    ::buffa::encoding::check_wire_type(
17944                        tag,
17945                        ::buffa::encoding::WireType::LengthDelimited,
17946                    )?;
17947                    ::buffa::Message::merge_length_delimited(
17948                        self.overridable_features.get_or_insert_default(),
17949                        buf,
17950                        ctx,
17951                    )?;
17952                }
17953                5u32 => {
17954                    ::buffa::encoding::check_wire_type(
17955                        tag,
17956                        ::buffa::encoding::WireType::LengthDelimited,
17957                    )?;
17958                    ::buffa::Message::merge_length_delimited(
17959                        self.fixed_features.get_or_insert_default(),
17960                        buf,
17961                        ctx,
17962                    )?;
17963                }
17964                _ => {
17965                    self.__buffa_unknown_fields
17966                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
17967                }
17968            }
17969            ::core::result::Result::Ok(())
17970        }
17971        fn clear(&mut self) {
17972            self.edition = ::core::option::Option::None;
17973            self.overridable_features = ::buffa::MessageField::none();
17974            self.fixed_features = ::buffa::MessageField::none();
17975            self.__buffa_unknown_fields.clear();
17976        }
17977    }
17978    impl ::buffa::ExtensionSet for FeatureSetEditionDefault {
17979        const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
17980        fn unknown_fields(&self) -> &::buffa::UnknownFields {
17981            &self.__buffa_unknown_fields
17982        }
17983        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
17984            &mut self.__buffa_unknown_fields
17985        }
17986    }
17987    #[cfg(feature = "text")]
17988    impl ::buffa::text::TextFormat for FeatureSetEditionDefault {
17989        fn encode_text(
17990            &self,
17991            enc: &mut ::buffa::text::TextEncoder<'_>,
17992        ) -> ::core::fmt::Result {
17993            #[allow(unused_imports)]
17994            use ::buffa::Enumeration as _;
17995            if let ::core::option::Option::Some(ref __v) = self.edition {
17996                enc.write_field_name("edition")?;
17997                enc.write_enum_name(__v.proto_name())?;
17998            }
17999            if self.overridable_features.is_set() {
18000                enc.write_field_name("overridable_features")?;
18001                enc.write_message(&*self.overridable_features)?;
18002            }
18003            if self.fixed_features.is_set() {
18004                enc.write_field_name("fixed_features")?;
18005                enc.write_message(&*self.fixed_features)?;
18006            }
18007            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18008            ::core::result::Result::Ok(())
18009        }
18010        fn merge_text(
18011            &mut self,
18012            dec: &mut ::buffa::text::TextDecoder<'_>,
18013        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18014            #[allow(unused_imports)]
18015            use ::buffa::Enumeration as _;
18016            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18017                match __name {
18018                    "edition" => {
18019                        self.edition = ::core::option::Option::Some(
18020                            dec.read_closed_enum_by_name::<super::Edition>()?,
18021                        );
18022                    }
18023                    "overridable_features" => {
18024                        dec.merge_message(
18025                            self.overridable_features.get_or_insert_default(),
18026                        )?
18027                    }
18028                    "fixed_features" => {
18029                        dec.merge_message(self.fixed_features.get_or_insert_default())?
18030                    }
18031                    _ => dec.skip_value()?,
18032                }
18033            }
18034            ::core::result::Result::Ok(())
18035        }
18036    }
18037    #[cfg(feature = "json")]
18038    impl ::buffa::json_helpers::ProtoElemJson for FeatureSetEditionDefault {
18039        fn serialize_proto_json<S: ::serde::Serializer>(
18040            v: &Self,
18041            s: S,
18042        ) -> ::core::result::Result<S::Ok, S::Error> {
18043            ::serde::Serialize::serialize(v, s)
18044        }
18045        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18046            d: D,
18047        ) -> ::core::result::Result<Self, D::Error> {
18048            <Self as ::serde::Deserialize>::deserialize(d)
18049        }
18050    }
18051    #[cfg(feature = "json")]
18052    #[doc(hidden)]
18053    pub const __FEATURE_SET_EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18054        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18055        to_json: ::buffa::type_registry::any_to_json::<FeatureSetEditionDefault>,
18056        from_json: ::buffa::type_registry::any_from_json::<FeatureSetEditionDefault>,
18057        is_wkt: false,
18058    };
18059    #[cfg(feature = "text")]
18060    #[doc(hidden)]
18061    pub const __FEATURE_SET_EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18062        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18063        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetEditionDefault>,
18064        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetEditionDefault>,
18065    };
18066    #[cfg(feature = "views")]
18067    #[doc(inline)]
18068    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultView;
18069    #[cfg(feature = "views")]
18070    #[doc(inline)]
18071    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultOwnedView;
18072}
18073/// ===================================================================
18074/// Optional source code info
18075///
18076/// Encapsulates information about the original source file from which a
18077/// FileDescriptorProto was generated.
18078#[derive(Clone, PartialEq, Default)]
18079#[cfg_attr(feature = "json", derive(::serde::Serialize))]
18080#[cfg_attr(feature = "json", serde(default))]
18081#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18082pub struct SourceCodeInfo {
18083    /// A Location identifies a piece of source code in a .proto file which
18084    /// corresponds to a particular definition.  This information is intended
18085    /// to be useful to IDEs, code indexers, documentation generators, and similar
18086    /// tools.
18087    ///
18088    /// For example, say we have a file like:
18089    ///   message Foo {
18090    /// ```text
18091    /// optional string foo = 1;
18092    /// ```
18093    ///   }
18094    /// Let's look at just the field definition:
18095    ///   optional string foo = 1;
18096    ///   ^       ^^     ^^  ^  ^^^
18097    ///   a       bc     de  f  ghi
18098    /// We have the following locations:
18099    ///   span   path               represents
18100    ///   \[a,i)  \[ 4, 0, 2, 0 \]     The whole field definition.
18101    ///   \[a,b)  \[ 4, 0, 2, 0, 4 \]  The label (optional).
18102    ///   \[c,d)  \[ 4, 0, 2, 0, 5 \]  The type (string).
18103    ///   \[e,f)  \[ 4, 0, 2, 0, 1 \]  The name (foo).
18104    ///   \[g,h)  \[ 4, 0, 2, 0, 3 \]  The number (1).
18105    ///
18106    /// Notes:
18107    /// - A location may refer to a repeated field itself (i.e. not to any
18108    ///   particular index within it).  This is used whenever a set of elements are
18109    ///   logically enclosed in a single code segment.  For example, an entire
18110    ///   extend block (possibly containing multiple extension definitions) will
18111    ///   have an outer location whose path refers to the "extensions" repeated
18112    ///   field without an index.
18113    /// - Multiple locations may have the same path.  This happens when a single
18114    ///   logical declaration is spread out across multiple places.  The most
18115    ///   obvious example is the "extend" block again -- there may be multiple
18116    ///   extend blocks in the same scope, each of which will have the same path.
18117    /// - A location's span is not always a subset of its parent's span.  For
18118    ///   example, the "extendee" of an extension declaration appears at the
18119    ///   beginning of the "extend" block and is shared by all extensions within
18120    ///   the block.
18121    /// - Just because a location's span is a subset of some other location's span
18122    ///   does not mean that it is a descendant.  For example, a "group" defines
18123    ///   both a type and a field in a single declaration.  Thus, the locations
18124    ///   corresponding to the type and field and their components will overlap.
18125    /// - Code which tries to interpret locations should probably be designed to
18126    ///   ignore those that it doesn't understand, as more types of locations could
18127    ///   be recorded in the future.
18128    ///
18129    /// Field 1: `location`
18130    #[cfg_attr(
18131        feature = "json",
18132        serde(
18133            rename = "location",
18134            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18135            deserialize_with = "::buffa::json_helpers::null_as_default"
18136        )
18137    )]
18138    pub location: ::buffa::alloc::vec::Vec<source_code_info::Location>,
18139    #[cfg_attr(feature = "json", serde(flatten))]
18140    #[doc(hidden)]
18141    pub __buffa_unknown_fields: __SourceCodeInfoExtJson,
18142}
18143impl ::core::fmt::Debug for SourceCodeInfo {
18144    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18145        f.debug_struct("SourceCodeInfo").field("location", &self.location).finish()
18146    }
18147}
18148impl SourceCodeInfo {
18149    /// Protobuf type URL for this message, for use with `Any::pack` and
18150    /// `Any::unpack_if`.
18151    ///
18152    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18153    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18154}
18155::buffa::impl_default_instance!(SourceCodeInfo);
18156impl ::buffa::MessageName for SourceCodeInfo {
18157    const PACKAGE: &'static str = "google.protobuf";
18158    const NAME: &'static str = "SourceCodeInfo";
18159    const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo";
18160    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18161}
18162impl ::buffa::Message for SourceCodeInfo {
18163    /// Returns the total encoded size in bytes.
18164    ///
18165    /// The result is a `u32`; the protobuf specification requires all
18166    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
18167    /// compliant message will never overflow this type.
18168    #[allow(clippy::let_and_return)]
18169    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18170        #[allow(unused_imports)]
18171        use ::buffa::Enumeration as _;
18172        let mut size = 0u32;
18173        for v in &self.location {
18174            let __slot = __cache.reserve();
18175            let inner_size = v.compute_size(__cache);
18176            __cache.set(__slot, inner_size);
18177            size
18178                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
18179                    + inner_size;
18180        }
18181        size += self.__buffa_unknown_fields.encoded_len() as u32;
18182        size
18183    }
18184    fn write_to(
18185        &self,
18186        __cache: &mut ::buffa::SizeCache,
18187        buf: &mut impl ::buffa::bytes::BufMut,
18188    ) {
18189        #[allow(unused_imports)]
18190        use ::buffa::Enumeration as _;
18191        for v in &self.location {
18192            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
18193            v.write_to(__cache, buf);
18194        }
18195        self.__buffa_unknown_fields.write_to(buf);
18196    }
18197    fn merge_field(
18198        &mut self,
18199        tag: ::buffa::encoding::Tag,
18200        buf: &mut impl ::buffa::bytes::Buf,
18201        ctx: ::buffa::DecodeContext<'_>,
18202    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18203        #[allow(unused_imports)]
18204        use ::buffa::bytes::Buf as _;
18205        #[allow(unused_imports)]
18206        use ::buffa::Enumeration as _;
18207        match tag.field_number() {
18208            1u32 => {
18209                ::buffa::encoding::check_wire_type(
18210                    tag,
18211                    ::buffa::encoding::WireType::LengthDelimited,
18212                )?;
18213                let mut elem = ::core::default::Default::default();
18214                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
18215                self.location.push(elem);
18216            }
18217            _ => {
18218                self.__buffa_unknown_fields
18219                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18220            }
18221        }
18222        ::core::result::Result::Ok(())
18223    }
18224    fn clear(&mut self) {
18225        self.location.clear();
18226        self.__buffa_unknown_fields.clear();
18227    }
18228}
18229impl ::buffa::ExtensionSet for SourceCodeInfo {
18230    const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo";
18231    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18232        &self.__buffa_unknown_fields
18233    }
18234    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18235        &mut self.__buffa_unknown_fields
18236    }
18237}
18238#[cfg(feature = "text")]
18239impl ::buffa::text::TextFormat for SourceCodeInfo {
18240    fn encode_text(
18241        &self,
18242        enc: &mut ::buffa::text::TextEncoder<'_>,
18243    ) -> ::core::fmt::Result {
18244        #[allow(unused_imports)]
18245        use ::buffa::Enumeration as _;
18246        for __v in &self.location {
18247            enc.write_field_name("location")?;
18248            enc.write_message(__v)?;
18249        }
18250        enc.write_extension_fields(
18251            "google.protobuf.SourceCodeInfo",
18252            &self.__buffa_unknown_fields,
18253        )?;
18254        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18255        ::core::result::Result::Ok(())
18256    }
18257    fn merge_text(
18258        &mut self,
18259        dec: &mut ::buffa::text::TextDecoder<'_>,
18260    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18261        #[allow(unused_imports)]
18262        use ::buffa::Enumeration as _;
18263        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18264            match __name {
18265                "location" => {
18266                    dec.read_repeated_into(
18267                        &mut self.location,
18268                        |__d| {
18269                            let mut __m = ::core::default::Default::default();
18270                            __d.merge_message(&mut __m)?;
18271                            ::core::result::Result::Ok(__m)
18272                        },
18273                    )?
18274                }
18275                __name if __name.starts_with('[') => {
18276                    for __r in dec
18277                        .read_extension(__name, "google.protobuf.SourceCodeInfo")?
18278                    {
18279                        self.__buffa_unknown_fields.push(__r);
18280                    }
18281                }
18282                _ => dec.skip_value()?,
18283            }
18284        }
18285        ::core::result::Result::Ok(())
18286    }
18287}
18288#[cfg(feature = "json")]
18289impl<'de> serde::Deserialize<'de> for SourceCodeInfo {
18290    fn deserialize<D: serde::Deserializer<'de>>(
18291        d: D,
18292    ) -> ::core::result::Result<Self, D::Error> {
18293        struct _V;
18294        impl<'de> serde::de::Visitor<'de> for _V {
18295            type Value = SourceCodeInfo;
18296            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18297                f.write_str("struct SourceCodeInfo")
18298            }
18299            #[allow(clippy::field_reassign_with_default)]
18300            fn visit_map<A: serde::de::MapAccess<'de>>(
18301                self,
18302                mut map: A,
18303            ) -> ::core::result::Result<SourceCodeInfo, A::Error> {
18304                let mut __f_location: ::core::option::Option<
18305                    ::buffa::alloc::vec::Vec<source_code_info::Location>,
18306                > = None;
18307                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
18308                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
18309                    match key.as_str() {
18310                        "location" => {
18311                            __f_location = Some({
18312                                struct _S;
18313                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
18314                                    type Value = ::buffa::alloc::vec::Vec<
18315                                        source_code_info::Location,
18316                                    >;
18317                                    fn deserialize<D: serde::Deserializer<'de>>(
18318                                        self,
18319                                        d: D,
18320                                    ) -> ::core::result::Result<
18321                                        ::buffa::alloc::vec::Vec<source_code_info::Location>,
18322                                        D::Error,
18323                                    > {
18324                                        ::buffa::json_helpers::null_as_default(d)
18325                                    }
18326                                }
18327                                map.next_value_seed(_S)?
18328                            });
18329                        }
18330                        __k if __k.starts_with('[') => {
18331                            let __v: ::buffa::serde_json::Value = map.next_value()?;
18332                            match ::buffa::extension_registry::deserialize_extension_key(
18333                                "google.protobuf.SourceCodeInfo",
18334                                __k,
18335                                __v,
18336                            ) {
18337                                ::core::option::Option::Some(
18338                                    ::core::result::Result::Ok(__recs),
18339                                ) => {
18340                                    for __rec in __recs {
18341                                        __ext_records.push(__rec);
18342                                    }
18343                                }
18344                                ::core::option::Option::Some(
18345                                    ::core::result::Result::Err(__e),
18346                                ) => {
18347                                    return ::core::result::Result::Err(
18348                                        <A::Error as ::serde::de::Error>::custom(__e),
18349                                    );
18350                                }
18351                                ::core::option::Option::None => {}
18352                            }
18353                        }
18354                        _ => {
18355                            map.next_value::<serde::de::IgnoredAny>()?;
18356                        }
18357                    }
18358                }
18359                let mut __r = <SourceCodeInfo as ::core::default::Default>::default();
18360                if let ::core::option::Option::Some(v) = __f_location {
18361                    __r.location = v;
18362                }
18363                for __rec in __ext_records {
18364                    __r.__buffa_unknown_fields.push(__rec);
18365                }
18366                Ok(__r)
18367            }
18368        }
18369        d.deserialize_map(_V)
18370    }
18371}
18372#[cfg(feature = "json")]
18373impl ::buffa::json_helpers::ProtoElemJson for SourceCodeInfo {
18374    fn serialize_proto_json<S: ::serde::Serializer>(
18375        v: &Self,
18376        s: S,
18377    ) -> ::core::result::Result<S::Ok, S::Error> {
18378        ::serde::Serialize::serialize(v, s)
18379    }
18380    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18381        d: D,
18382    ) -> ::core::result::Result<Self, D::Error> {
18383        <Self as ::serde::Deserialize>::deserialize(d)
18384    }
18385}
18386#[doc(hidden)]
18387#[derive(Clone, Debug, Default, PartialEq)]
18388#[repr(transparent)]
18389#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18390pub struct __SourceCodeInfoExtJson(pub ::buffa::UnknownFields);
18391impl ::core::ops::Deref for __SourceCodeInfoExtJson {
18392    type Target = ::buffa::UnknownFields;
18393    fn deref(&self) -> &::buffa::UnknownFields {
18394        &self.0
18395    }
18396}
18397impl ::core::ops::DerefMut for __SourceCodeInfoExtJson {
18398    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
18399        &mut self.0
18400    }
18401}
18402impl ::core::convert::From<::buffa::UnknownFields> for __SourceCodeInfoExtJson {
18403    fn from(u: ::buffa::UnknownFields) -> Self {
18404        Self(u)
18405    }
18406}
18407#[cfg(feature = "json")]
18408impl ::serde::Serialize for __SourceCodeInfoExtJson {
18409    fn serialize<S: ::serde::Serializer>(
18410        &self,
18411        s: S,
18412    ) -> ::core::result::Result<S::Ok, S::Error> {
18413        ::buffa::extension_registry::serialize_extensions(
18414            "google.protobuf.SourceCodeInfo",
18415            &self.0,
18416            s,
18417        )
18418    }
18419}
18420#[cfg(feature = "json")]
18421impl<'de> ::serde::Deserialize<'de> for __SourceCodeInfoExtJson {
18422    fn deserialize<D: ::serde::Deserializer<'de>>(
18423        d: D,
18424    ) -> ::core::result::Result<Self, D::Error> {
18425        ::buffa::extension_registry::deserialize_extensions(
18426                "google.protobuf.SourceCodeInfo",
18427                d,
18428            )
18429            .map(Self)
18430    }
18431}
18432#[cfg(feature = "json")]
18433#[doc(hidden)]
18434pub const __SOURCE_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18435    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18436    to_json: ::buffa::type_registry::any_to_json::<SourceCodeInfo>,
18437    from_json: ::buffa::type_registry::any_from_json::<SourceCodeInfo>,
18438    is_wkt: false,
18439};
18440#[cfg(feature = "text")]
18441#[doc(hidden)]
18442pub const __SOURCE_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18443    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18444    text_encode: ::buffa::type_registry::any_encode_text::<SourceCodeInfo>,
18445    text_merge: ::buffa::type_registry::any_merge_text::<SourceCodeInfo>,
18446};
18447pub mod source_code_info {
18448    #[allow(unused_imports)]
18449    use super::*;
18450    #[derive(Clone, PartialEq, Default)]
18451    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18452    #[cfg_attr(feature = "json", serde(default))]
18453    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18454    pub struct Location {
18455        /// Identifies which part of the FileDescriptorProto was defined at this
18456        /// location.
18457        ///
18458        /// Each element is a field number or an index.  They form a path from
18459        /// the root FileDescriptorProto to the place where the definition appears.
18460        /// For example, this path:
18461        ///   \[ 4, 3, 2, 7, 1 \]
18462        /// refers to:
18463        ///   file.message_type(3)  // 4, 3
18464        /// ```text
18465        ///   .field(7)         // 2, 7
18466        ///   .name()           // 1
18467        /// ```
18468        /// This is because FileDescriptorProto.message_type has field number 4:
18469        ///   repeated DescriptorProto message_type = 4;
18470        /// and DescriptorProto.field has field number 2:
18471        ///   repeated FieldDescriptorProto field = 2;
18472        /// and FieldDescriptorProto.name has field number 1:
18473        ///   optional string name = 1;
18474        ///
18475        /// Thus, the above path gives the location of a field name.  If we removed
18476        /// the last element:
18477        ///   \[ 4, 3, 2, 7 \]
18478        /// this path refers to the whole field declaration (from the beginning
18479        /// of the label to the terminating semicolon).
18480        ///
18481        /// Field 1: `path`
18482        #[cfg_attr(
18483            feature = "json",
18484            serde(
18485                rename = "path",
18486                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18487                deserialize_with = "::buffa::json_helpers::null_as_default"
18488            )
18489        )]
18490        pub path: ::buffa::alloc::vec::Vec<i32>,
18491        /// Always has exactly three or four elements: start line, start column,
18492        /// end line (optional, otherwise assumed same as start line), end column.
18493        /// These are packed into a single field for efficiency.  Note that line
18494        /// and column numbers are zero-based -- typically you will want to add
18495        /// 1 to each before displaying to a user.
18496        ///
18497        /// Field 2: `span`
18498        #[cfg_attr(
18499            feature = "json",
18500            serde(
18501                rename = "span",
18502                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18503                deserialize_with = "::buffa::json_helpers::null_as_default"
18504            )
18505        )]
18506        pub span: ::buffa::alloc::vec::Vec<i32>,
18507        /// If this SourceCodeInfo represents a complete declaration, these are any
18508        /// comments appearing before and after the declaration which appear to be
18509        /// attached to the declaration.
18510        ///
18511        /// A series of line comments appearing on consecutive lines, with no other
18512        /// tokens appearing on those lines, will be treated as a single comment.
18513        ///
18514        /// leading_detached_comments will keep paragraphs of comments that appear
18515        /// before (but not connected to) the current element. Each paragraph,
18516        /// separated by empty lines, will be one comment element in the repeated
18517        /// field.
18518        ///
18519        /// Only the comment content is provided; comment markers (e.g. //) are
18520        /// stripped out.  For block comments, leading whitespace and an asterisk
18521        /// will be stripped from the beginning of each line other than the first.
18522        /// Newlines are included in the output.
18523        ///
18524        /// Examples:
18525        ///
18526        ///   optional int32 foo = 1;  // Comment attached to foo.
18527        ///   // Comment attached to bar.
18528        ///   optional int32 bar = 2;
18529        ///
18530        ///   optional string baz = 3;
18531        ///   // Comment attached to baz.
18532        ///   // Another line attached to baz.
18533        ///
18534        ///   // Comment attached to moo.
18535        ///   //
18536        ///   // Another line attached to moo.
18537        ///   optional double moo = 4;
18538        ///
18539        ///   // Detached comment for corge. This is not leading or trailing comments
18540        ///   // to moo or corge because there are blank lines separating it from
18541        ///   // both.
18542        ///
18543        ///   // Detached comment for corge paragraph 2.
18544        ///
18545        ///   optional string corge = 5;
18546        ///   /* Block comment attached
18547        /// ```text
18548        /// * to corge.  Leading asterisks
18549        /// * will be removed. */
18550        /// ```
18551        ///   /* Block comment attached to
18552        /// ```text
18553        /// * grault. */
18554        /// ```
18555        ///   optional int32 grault = 6;
18556        ///
18557        ///   // ignored detached comments.
18558        ///
18559        /// Field 3: `leading_comments`
18560        #[cfg_attr(
18561            feature = "json",
18562            serde(
18563                rename = "leadingComments",
18564                alias = "leading_comments",
18565                skip_serializing_if = "::core::option::Option::is_none"
18566            )
18567        )]
18568        pub leading_comments: ::core::option::Option<::buffa::alloc::string::String>,
18569        /// Field 4: `trailing_comments`
18570        #[cfg_attr(
18571            feature = "json",
18572            serde(
18573                rename = "trailingComments",
18574                alias = "trailing_comments",
18575                skip_serializing_if = "::core::option::Option::is_none"
18576            )
18577        )]
18578        pub trailing_comments: ::core::option::Option<::buffa::alloc::string::String>,
18579        /// Field 6: `leading_detached_comments`
18580        #[cfg_attr(
18581            feature = "json",
18582            serde(
18583                rename = "leadingDetachedComments",
18584                alias = "leading_detached_comments",
18585                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18586                deserialize_with = "::buffa::json_helpers::null_as_default"
18587            )
18588        )]
18589        pub leading_detached_comments: ::buffa::alloc::vec::Vec<
18590            ::buffa::alloc::string::String,
18591        >,
18592        #[cfg_attr(feature = "json", serde(skip))]
18593        #[doc(hidden)]
18594        pub __buffa_unknown_fields: ::buffa::UnknownFields,
18595    }
18596    impl ::core::fmt::Debug for Location {
18597        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18598            f.debug_struct("Location")
18599                .field("path", &self.path)
18600                .field("span", &self.span)
18601                .field("leading_comments", &self.leading_comments)
18602                .field("trailing_comments", &self.trailing_comments)
18603                .field("leading_detached_comments", &self.leading_detached_comments)
18604                .finish()
18605        }
18606    }
18607    impl Location {
18608        /// Protobuf type URL for this message, for use with `Any::pack` and
18609        /// `Any::unpack_if`.
18610        ///
18611        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18612        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
18613    }
18614    impl Location {
18615        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18616        #[inline]
18617        ///Sets [`Self::leading_comments`] to `Some(value)`, consuming and returning `self`.
18618        pub fn with_leading_comments(
18619            mut self,
18620            value: impl Into<::buffa::alloc::string::String>,
18621        ) -> Self {
18622            self.leading_comments = Some(value.into());
18623            self
18624        }
18625        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18626        #[inline]
18627        ///Sets [`Self::trailing_comments`] to `Some(value)`, consuming and returning `self`.
18628        pub fn with_trailing_comments(
18629            mut self,
18630            value: impl Into<::buffa::alloc::string::String>,
18631        ) -> Self {
18632            self.trailing_comments = Some(value.into());
18633            self
18634        }
18635    }
18636    ::buffa::impl_default_instance!(Location);
18637    impl ::buffa::MessageName for Location {
18638        const PACKAGE: &'static str = "google.protobuf";
18639        const NAME: &'static str = "SourceCodeInfo.Location";
18640        const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo.Location";
18641        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
18642    }
18643    impl ::buffa::Message for Location {
18644        /// Returns the total encoded size in bytes.
18645        ///
18646        /// The result is a `u32`; the protobuf specification requires all
18647        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
18648        /// compliant message will never overflow this type.
18649        #[allow(clippy::let_and_return)]
18650        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
18651            #[allow(unused_imports)]
18652            use ::buffa::Enumeration as _;
18653            let mut size = 0u32;
18654            if !self.path.is_empty() {
18655                let payload: u32 = self
18656                    .path
18657                    .iter()
18658                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
18659                    .sum::<u32>();
18660                size
18661                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
18662                        + payload;
18663            }
18664            if !self.span.is_empty() {
18665                let payload: u32 = self
18666                    .span
18667                    .iter()
18668                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
18669                    .sum::<u32>();
18670                size
18671                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
18672                        + payload;
18673            }
18674            if let Some(ref v) = self.leading_comments {
18675                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
18676            }
18677            if let Some(ref v) = self.trailing_comments {
18678                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
18679            }
18680            for v in &self.leading_detached_comments {
18681                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
18682            }
18683            size += self.__buffa_unknown_fields.encoded_len() as u32;
18684            size
18685        }
18686        fn write_to(
18687            &self,
18688            _cache: &mut ::buffa::SizeCache,
18689            buf: &mut impl ::buffa::bytes::BufMut,
18690        ) {
18691            #[allow(unused_imports)]
18692            use ::buffa::Enumeration as _;
18693            if !self.path.is_empty() {
18694                let payload: u32 = self
18695                    .path
18696                    .iter()
18697                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
18698                    .sum::<u32>();
18699                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
18700                for &v in &self.path {
18701                    ::buffa::types::encode_int32(v, buf);
18702                }
18703            }
18704            if !self.span.is_empty() {
18705                let payload: u32 = self
18706                    .span
18707                    .iter()
18708                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
18709                    .sum::<u32>();
18710                ::buffa::types::put_len_delimited_header(2u32, payload, buf);
18711                for &v in &self.span {
18712                    ::buffa::types::encode_int32(v, buf);
18713                }
18714            }
18715            if let Some(ref v) = self.leading_comments {
18716                ::buffa::types::put_string_field(3u32, v, buf);
18717            }
18718            if let Some(ref v) = self.trailing_comments {
18719                ::buffa::types::put_string_field(4u32, v, buf);
18720            }
18721            for v in &self.leading_detached_comments {
18722                ::buffa::types::put_string_field(6u32, v, buf);
18723            }
18724            self.__buffa_unknown_fields.write_to(buf);
18725        }
18726        fn merge_field(
18727            &mut self,
18728            tag: ::buffa::encoding::Tag,
18729            buf: &mut impl ::buffa::bytes::Buf,
18730            ctx: ::buffa::DecodeContext<'_>,
18731        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18732            #[allow(unused_imports)]
18733            use ::buffa::bytes::Buf as _;
18734            #[allow(unused_imports)]
18735            use ::buffa::Enumeration as _;
18736            match tag.field_number() {
18737                1u32 => {
18738                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
18739                        let len = ::buffa::encoding::decode_varint(buf)?;
18740                        let len = usize::try_from(len)
18741                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
18742                        if buf.remaining() < len {
18743                            return ::core::result::Result::Err(
18744                                ::buffa::DecodeError::UnexpectedEof,
18745                            );
18746                        }
18747                        self.path.reserve(len);
18748                        let mut limited = buf.take(len);
18749                        while limited.has_remaining() {
18750                            self.path.push(::buffa::types::decode_int32(&mut limited)?);
18751                        }
18752                        let leftover = limited.remaining();
18753                        if leftover > 0 {
18754                            limited.advance(leftover);
18755                        }
18756                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
18757                        self.path.push(::buffa::types::decode_int32(buf)?);
18758                    } else {
18759                        return ::core::result::Result::Err(
18760                            ::buffa::encoding::wire_type_mismatch(
18761                                tag,
18762                                ::buffa::encoding::WireType::LengthDelimited,
18763                            ),
18764                        );
18765                    }
18766                }
18767                2u32 => {
18768                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
18769                        let len = ::buffa::encoding::decode_varint(buf)?;
18770                        let len = usize::try_from(len)
18771                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
18772                        if buf.remaining() < len {
18773                            return ::core::result::Result::Err(
18774                                ::buffa::DecodeError::UnexpectedEof,
18775                            );
18776                        }
18777                        self.span.reserve(len);
18778                        let mut limited = buf.take(len);
18779                        while limited.has_remaining() {
18780                            self.span.push(::buffa::types::decode_int32(&mut limited)?);
18781                        }
18782                        let leftover = limited.remaining();
18783                        if leftover > 0 {
18784                            limited.advance(leftover);
18785                        }
18786                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
18787                        self.span.push(::buffa::types::decode_int32(buf)?);
18788                    } else {
18789                        return ::core::result::Result::Err(
18790                            ::buffa::encoding::wire_type_mismatch(
18791                                tag,
18792                                ::buffa::encoding::WireType::LengthDelimited,
18793                            ),
18794                        );
18795                    }
18796                }
18797                3u32 => {
18798                    ::buffa::encoding::check_wire_type(
18799                        tag,
18800                        ::buffa::encoding::WireType::LengthDelimited,
18801                    )?;
18802                    ::buffa::types::merge_string(
18803                        self
18804                            .leading_comments
18805                            .get_or_insert_with(::buffa::alloc::string::String::new),
18806                        buf,
18807                    )?;
18808                }
18809                4u32 => {
18810                    ::buffa::encoding::check_wire_type(
18811                        tag,
18812                        ::buffa::encoding::WireType::LengthDelimited,
18813                    )?;
18814                    ::buffa::types::merge_string(
18815                        self
18816                            .trailing_comments
18817                            .get_or_insert_with(::buffa::alloc::string::String::new),
18818                        buf,
18819                    )?;
18820                }
18821                6u32 => {
18822                    ::buffa::encoding::check_wire_type(
18823                        tag,
18824                        ::buffa::encoding::WireType::LengthDelimited,
18825                    )?;
18826                    self.leading_detached_comments
18827                        .push(::buffa::types::decode_string(buf)?);
18828                }
18829                _ => {
18830                    self.__buffa_unknown_fields
18831                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18832                }
18833            }
18834            ::core::result::Result::Ok(())
18835        }
18836        fn clear(&mut self) {
18837            self.path.clear();
18838            self.span.clear();
18839            self.leading_comments = ::core::option::Option::None;
18840            self.trailing_comments = ::core::option::Option::None;
18841            self.leading_detached_comments.clear();
18842            self.__buffa_unknown_fields.clear();
18843        }
18844    }
18845    impl ::buffa::ExtensionSet for Location {
18846        const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo.Location";
18847        fn unknown_fields(&self) -> &::buffa::UnknownFields {
18848            &self.__buffa_unknown_fields
18849        }
18850        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18851            &mut self.__buffa_unknown_fields
18852        }
18853    }
18854    #[cfg(feature = "text")]
18855    impl ::buffa::text::TextFormat for Location {
18856        fn encode_text(
18857            &self,
18858            enc: &mut ::buffa::text::TextEncoder<'_>,
18859        ) -> ::core::fmt::Result {
18860            #[allow(unused_imports)]
18861            use ::buffa::Enumeration as _;
18862            if let ::core::option::Option::Some(ref __v) = self.leading_comments {
18863                enc.write_field_name("leading_comments")?;
18864                enc.write_string(__v)?;
18865            }
18866            if let ::core::option::Option::Some(ref __v) = self.trailing_comments {
18867                enc.write_field_name("trailing_comments")?;
18868                enc.write_string(__v)?;
18869            }
18870            for __v in &self.path {
18871                enc.write_field_name("path")?;
18872                enc.write_i32(*__v)?;
18873            }
18874            for __v in &self.span {
18875                enc.write_field_name("span")?;
18876                enc.write_i32(*__v)?;
18877            }
18878            for __v in &self.leading_detached_comments {
18879                enc.write_field_name("leading_detached_comments")?;
18880                enc.write_string(__v)?;
18881            }
18882            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18883            ::core::result::Result::Ok(())
18884        }
18885        fn merge_text(
18886            &mut self,
18887            dec: &mut ::buffa::text::TextDecoder<'_>,
18888        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18889            #[allow(unused_imports)]
18890            use ::buffa::Enumeration as _;
18891            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18892                match __name {
18893                    "leading_comments" => {
18894                        self.leading_comments = ::core::option::Option::Some(
18895                            dec.read_string()?.into_owned(),
18896                        );
18897                    }
18898                    "trailing_comments" => {
18899                        self.trailing_comments = ::core::option::Option::Some(
18900                            dec.read_string()?.into_owned(),
18901                        );
18902                    }
18903                    "path" => {
18904                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
18905                    }
18906                    "span" => {
18907                        dec.read_repeated_into(&mut self.span, |__d| __d.read_i32())?
18908                    }
18909                    "leading_detached_comments" => {
18910                        dec.read_repeated_into(
18911                            &mut self.leading_detached_comments,
18912                            |__d| ::core::result::Result::Ok(
18913                                __d.read_string()?.into_owned(),
18914                            ),
18915                        )?
18916                    }
18917                    _ => dec.skip_value()?,
18918                }
18919            }
18920            ::core::result::Result::Ok(())
18921        }
18922    }
18923    #[cfg(feature = "json")]
18924    impl ::buffa::json_helpers::ProtoElemJson for Location {
18925        fn serialize_proto_json<S: ::serde::Serializer>(
18926            v: &Self,
18927            s: S,
18928        ) -> ::core::result::Result<S::Ok, S::Error> {
18929            ::serde::Serialize::serialize(v, s)
18930        }
18931        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18932            d: D,
18933        ) -> ::core::result::Result<Self, D::Error> {
18934            <Self as ::serde::Deserialize>::deserialize(d)
18935        }
18936    }
18937    #[cfg(feature = "json")]
18938    #[doc(hidden)]
18939    pub const __LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18940        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
18941        to_json: ::buffa::type_registry::any_to_json::<Location>,
18942        from_json: ::buffa::type_registry::any_from_json::<Location>,
18943        is_wkt: false,
18944    };
18945    #[cfg(feature = "text")]
18946    #[doc(hidden)]
18947    pub const __LOCATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18948        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
18949        text_encode: ::buffa::type_registry::any_encode_text::<Location>,
18950        text_merge: ::buffa::type_registry::any_merge_text::<Location>,
18951    };
18952    #[cfg(feature = "views")]
18953    #[doc(inline)]
18954    pub use super::__buffa::view::source_code_info::LocationView;
18955    #[cfg(feature = "views")]
18956    #[doc(inline)]
18957    pub use super::__buffa::view::source_code_info::LocationOwnedView;
18958}
18959/// Describes the relationship between generated code and its original source
18960/// file. A GeneratedCodeInfo message is associated with only one generated
18961/// source file, but may contain references to different source .proto files.
18962#[derive(Clone, PartialEq, Default)]
18963#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18964#[cfg_attr(feature = "json", serde(default))]
18965#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18966pub struct GeneratedCodeInfo {
18967    /// An Annotation connects some span of text in generated code to an element
18968    /// of its generating .proto file.
18969    ///
18970    /// Field 1: `annotation`
18971    #[cfg_attr(
18972        feature = "json",
18973        serde(
18974            rename = "annotation",
18975            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18976            deserialize_with = "::buffa::json_helpers::null_as_default"
18977        )
18978    )]
18979    pub annotation: ::buffa::alloc::vec::Vec<generated_code_info::Annotation>,
18980    #[cfg_attr(feature = "json", serde(skip))]
18981    #[doc(hidden)]
18982    pub __buffa_unknown_fields: ::buffa::UnknownFields,
18983}
18984impl ::core::fmt::Debug for GeneratedCodeInfo {
18985    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18986        f.debug_struct("GeneratedCodeInfo")
18987            .field("annotation", &self.annotation)
18988            .finish()
18989    }
18990}
18991impl GeneratedCodeInfo {
18992    /// Protobuf type URL for this message, for use with `Any::pack` and
18993    /// `Any::unpack_if`.
18994    ///
18995    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18996    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
18997}
18998::buffa::impl_default_instance!(GeneratedCodeInfo);
18999impl ::buffa::MessageName for GeneratedCodeInfo {
19000    const PACKAGE: &'static str = "google.protobuf";
19001    const NAME: &'static str = "GeneratedCodeInfo";
19002    const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo";
19003    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
19004}
19005impl ::buffa::Message for GeneratedCodeInfo {
19006    /// Returns the total encoded size in bytes.
19007    ///
19008    /// The result is a `u32`; the protobuf specification requires all
19009    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
19010    /// compliant message will never overflow this type.
19011    #[allow(clippy::let_and_return)]
19012    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19013        #[allow(unused_imports)]
19014        use ::buffa::Enumeration as _;
19015        let mut size = 0u32;
19016        for v in &self.annotation {
19017            let __slot = __cache.reserve();
19018            let inner_size = v.compute_size(__cache);
19019            __cache.set(__slot, inner_size);
19020            size
19021                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19022                    + inner_size;
19023        }
19024        size += self.__buffa_unknown_fields.encoded_len() as u32;
19025        size
19026    }
19027    fn write_to(
19028        &self,
19029        __cache: &mut ::buffa::SizeCache,
19030        buf: &mut impl ::buffa::bytes::BufMut,
19031    ) {
19032        #[allow(unused_imports)]
19033        use ::buffa::Enumeration as _;
19034        for v in &self.annotation {
19035            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
19036            v.write_to(__cache, buf);
19037        }
19038        self.__buffa_unknown_fields.write_to(buf);
19039    }
19040    fn merge_field(
19041        &mut self,
19042        tag: ::buffa::encoding::Tag,
19043        buf: &mut impl ::buffa::bytes::Buf,
19044        ctx: ::buffa::DecodeContext<'_>,
19045    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19046        #[allow(unused_imports)]
19047        use ::buffa::bytes::Buf as _;
19048        #[allow(unused_imports)]
19049        use ::buffa::Enumeration as _;
19050        match tag.field_number() {
19051            1u32 => {
19052                ::buffa::encoding::check_wire_type(
19053                    tag,
19054                    ::buffa::encoding::WireType::LengthDelimited,
19055                )?;
19056                let mut elem = ::core::default::Default::default();
19057                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
19058                self.annotation.push(elem);
19059            }
19060            _ => {
19061                self.__buffa_unknown_fields
19062                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19063            }
19064        }
19065        ::core::result::Result::Ok(())
19066    }
19067    fn clear(&mut self) {
19068        self.annotation.clear();
19069        self.__buffa_unknown_fields.clear();
19070    }
19071}
19072impl ::buffa::ExtensionSet for GeneratedCodeInfo {
19073    const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo";
19074    fn unknown_fields(&self) -> &::buffa::UnknownFields {
19075        &self.__buffa_unknown_fields
19076    }
19077    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19078        &mut self.__buffa_unknown_fields
19079    }
19080}
19081#[cfg(feature = "text")]
19082impl ::buffa::text::TextFormat for GeneratedCodeInfo {
19083    fn encode_text(
19084        &self,
19085        enc: &mut ::buffa::text::TextEncoder<'_>,
19086    ) -> ::core::fmt::Result {
19087        #[allow(unused_imports)]
19088        use ::buffa::Enumeration as _;
19089        for __v in &self.annotation {
19090            enc.write_field_name("annotation")?;
19091            enc.write_message(__v)?;
19092        }
19093        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19094        ::core::result::Result::Ok(())
19095    }
19096    fn merge_text(
19097        &mut self,
19098        dec: &mut ::buffa::text::TextDecoder<'_>,
19099    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19100        #[allow(unused_imports)]
19101        use ::buffa::Enumeration as _;
19102        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19103            match __name {
19104                "annotation" => {
19105                    dec.read_repeated_into(
19106                        &mut self.annotation,
19107                        |__d| {
19108                            let mut __m = ::core::default::Default::default();
19109                            __d.merge_message(&mut __m)?;
19110                            ::core::result::Result::Ok(__m)
19111                        },
19112                    )?
19113                }
19114                _ => dec.skip_value()?,
19115            }
19116        }
19117        ::core::result::Result::Ok(())
19118    }
19119}
19120#[cfg(feature = "json")]
19121impl ::buffa::json_helpers::ProtoElemJson for GeneratedCodeInfo {
19122    fn serialize_proto_json<S: ::serde::Serializer>(
19123        v: &Self,
19124        s: S,
19125    ) -> ::core::result::Result<S::Ok, S::Error> {
19126        ::serde::Serialize::serialize(v, s)
19127    }
19128    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19129        d: D,
19130    ) -> ::core::result::Result<Self, D::Error> {
19131        <Self as ::serde::Deserialize>::deserialize(d)
19132    }
19133}
19134#[cfg(feature = "json")]
19135#[doc(hidden)]
19136pub const __GENERATED_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19137    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19138    to_json: ::buffa::type_registry::any_to_json::<GeneratedCodeInfo>,
19139    from_json: ::buffa::type_registry::any_from_json::<GeneratedCodeInfo>,
19140    is_wkt: false,
19141};
19142#[cfg(feature = "text")]
19143#[doc(hidden)]
19144pub const __GENERATED_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19145    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19146    text_encode: ::buffa::type_registry::any_encode_text::<GeneratedCodeInfo>,
19147    text_merge: ::buffa::type_registry::any_merge_text::<GeneratedCodeInfo>,
19148};
19149pub mod generated_code_info {
19150    #[allow(unused_imports)]
19151    use super::*;
19152    #[derive(Clone, PartialEq, Default)]
19153    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19154    #[cfg_attr(feature = "json", serde(default))]
19155    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19156    pub struct Annotation {
19157        /// Identifies the element in the original source .proto file. This field
19158        /// is formatted the same as SourceCodeInfo.Location.path.
19159        ///
19160        /// Field 1: `path`
19161        #[cfg_attr(
19162            feature = "json",
19163            serde(
19164                rename = "path",
19165                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19166                deserialize_with = "::buffa::json_helpers::null_as_default"
19167            )
19168        )]
19169        pub path: ::buffa::alloc::vec::Vec<i32>,
19170        /// Identifies the filesystem path to the original source .proto.
19171        ///
19172        /// Field 2: `source_file`
19173        #[cfg_attr(
19174            feature = "json",
19175            serde(
19176                rename = "sourceFile",
19177                alias = "source_file",
19178                skip_serializing_if = "::core::option::Option::is_none"
19179            )
19180        )]
19181        pub source_file: ::core::option::Option<::buffa::alloc::string::String>,
19182        /// Identifies the starting offset in bytes in the generated code
19183        /// that relates to the identified object.
19184        ///
19185        /// Field 3: `begin`
19186        #[cfg_attr(
19187            feature = "json",
19188            serde(
19189                rename = "begin",
19190                with = "::buffa::json_helpers::opt_int32",
19191                skip_serializing_if = "::core::option::Option::is_none"
19192            )
19193        )]
19194        pub begin: ::core::option::Option<i32>,
19195        /// Identifies the ending offset in bytes in the generated code that
19196        /// relates to the identified object. The end offset should be one past
19197        /// the last relevant byte (so the length of the text = end - begin).
19198        ///
19199        /// Field 4: `end`
19200        #[cfg_attr(
19201            feature = "json",
19202            serde(
19203                rename = "end",
19204                with = "::buffa::json_helpers::opt_int32",
19205                skip_serializing_if = "::core::option::Option::is_none"
19206            )
19207        )]
19208        pub end: ::core::option::Option<i32>,
19209        /// Field 5: `semantic`
19210        #[cfg_attr(
19211            feature = "json",
19212            serde(
19213                rename = "semantic",
19214                with = "::buffa::json_helpers::opt_closed_enum",
19215                skip_serializing_if = "::core::option::Option::is_none"
19216            )
19217        )]
19218        pub semantic: ::core::option::Option<
19219            super::generated_code_info::annotation::Semantic,
19220        >,
19221        #[cfg_attr(feature = "json", serde(skip))]
19222        #[doc(hidden)]
19223        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19224    }
19225    impl ::core::fmt::Debug for Annotation {
19226        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19227            f.debug_struct("Annotation")
19228                .field("path", &self.path)
19229                .field("source_file", &self.source_file)
19230                .field("begin", &self.begin)
19231                .field("end", &self.end)
19232                .field("semantic", &self.semantic)
19233                .finish()
19234        }
19235    }
19236    impl Annotation {
19237        /// Protobuf type URL for this message, for use with `Any::pack` and
19238        /// `Any::unpack_if`.
19239        ///
19240        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19241        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19242    }
19243    impl Annotation {
19244        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19245        #[inline]
19246        ///Sets [`Self::source_file`] to `Some(value)`, consuming and returning `self`.
19247        pub fn with_source_file(
19248            mut self,
19249            value: impl Into<::buffa::alloc::string::String>,
19250        ) -> Self {
19251            self.source_file = Some(value.into());
19252            self
19253        }
19254        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19255        #[inline]
19256        ///Sets [`Self::begin`] to `Some(value)`, consuming and returning `self`.
19257        pub fn with_begin(mut self, value: i32) -> Self {
19258            self.begin = Some(value);
19259            self
19260        }
19261        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19262        #[inline]
19263        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
19264        pub fn with_end(mut self, value: i32) -> Self {
19265            self.end = Some(value);
19266            self
19267        }
19268        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19269        #[inline]
19270        ///Sets [`Self::semantic`] to `Some(value)`, consuming and returning `self`.
19271        pub fn with_semantic(
19272            mut self,
19273            value: impl Into<super::generated_code_info::annotation::Semantic>,
19274        ) -> Self {
19275            self.semantic = Some(value.into());
19276            self
19277        }
19278    }
19279    ::buffa::impl_default_instance!(Annotation);
19280    impl ::buffa::MessageName for Annotation {
19281        const PACKAGE: &'static str = "google.protobuf";
19282        const NAME: &'static str = "GeneratedCodeInfo.Annotation";
19283        const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
19284        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19285    }
19286    impl ::buffa::Message for Annotation {
19287        /// Returns the total encoded size in bytes.
19288        ///
19289        /// The result is a `u32`; the protobuf specification requires all
19290        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
19291        /// compliant message will never overflow this type.
19292        #[allow(clippy::let_and_return)]
19293        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19294            #[allow(unused_imports)]
19295            use ::buffa::Enumeration as _;
19296            let mut size = 0u32;
19297            if !self.path.is_empty() {
19298                let payload: u32 = self
19299                    .path
19300                    .iter()
19301                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19302                    .sum::<u32>();
19303                size
19304                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
19305                        + payload;
19306            }
19307            if let Some(ref v) = self.source_file {
19308                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
19309            }
19310            if let Some(v) = self.begin {
19311                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
19312            }
19313            if let Some(v) = self.end {
19314                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
19315            }
19316            if let Some(ref v) = self.semantic {
19317                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
19318            }
19319            size += self.__buffa_unknown_fields.encoded_len() as u32;
19320            size
19321        }
19322        fn write_to(
19323            &self,
19324            _cache: &mut ::buffa::SizeCache,
19325            buf: &mut impl ::buffa::bytes::BufMut,
19326        ) {
19327            #[allow(unused_imports)]
19328            use ::buffa::Enumeration as _;
19329            if !self.path.is_empty() {
19330                let payload: u32 = self
19331                    .path
19332                    .iter()
19333                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19334                    .sum::<u32>();
19335                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
19336                for &v in &self.path {
19337                    ::buffa::types::encode_int32(v, buf);
19338                }
19339            }
19340            if let Some(ref v) = self.source_file {
19341                ::buffa::types::put_string_field(2u32, v, buf);
19342            }
19343            if let Some(v) = self.begin {
19344                ::buffa::types::put_int32_field(3u32, v, buf);
19345            }
19346            if let Some(v) = self.end {
19347                ::buffa::types::put_int32_field(4u32, v, buf);
19348            }
19349            if let Some(ref v) = self.semantic {
19350                ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
19351            }
19352            self.__buffa_unknown_fields.write_to(buf);
19353        }
19354        fn merge_field(
19355            &mut self,
19356            tag: ::buffa::encoding::Tag,
19357            buf: &mut impl ::buffa::bytes::Buf,
19358            ctx: ::buffa::DecodeContext<'_>,
19359        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19360            #[allow(unused_imports)]
19361            use ::buffa::bytes::Buf as _;
19362            #[allow(unused_imports)]
19363            use ::buffa::Enumeration as _;
19364            match tag.field_number() {
19365                1u32 => {
19366                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19367                        let len = ::buffa::encoding::decode_varint(buf)?;
19368                        let len = usize::try_from(len)
19369                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19370                        if buf.remaining() < len {
19371                            return ::core::result::Result::Err(
19372                                ::buffa::DecodeError::UnexpectedEof,
19373                            );
19374                        }
19375                        self.path.reserve(len);
19376                        let mut limited = buf.take(len);
19377                        while limited.has_remaining() {
19378                            self.path.push(::buffa::types::decode_int32(&mut limited)?);
19379                        }
19380                        let leftover = limited.remaining();
19381                        if leftover > 0 {
19382                            limited.advance(leftover);
19383                        }
19384                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19385                        self.path.push(::buffa::types::decode_int32(buf)?);
19386                    } else {
19387                        return ::core::result::Result::Err(
19388                            ::buffa::encoding::wire_type_mismatch(
19389                                tag,
19390                                ::buffa::encoding::WireType::LengthDelimited,
19391                            ),
19392                        );
19393                    }
19394                }
19395                2u32 => {
19396                    ::buffa::encoding::check_wire_type(
19397                        tag,
19398                        ::buffa::encoding::WireType::LengthDelimited,
19399                    )?;
19400                    ::buffa::types::merge_string(
19401                        self
19402                            .source_file
19403                            .get_or_insert_with(::buffa::alloc::string::String::new),
19404                        buf,
19405                    )?;
19406                }
19407                3u32 => {
19408                    ::buffa::encoding::check_wire_type(
19409                        tag,
19410                        ::buffa::encoding::WireType::Varint,
19411                    )?;
19412                    self.begin = ::core::option::Option::Some(
19413                        ::buffa::types::decode_int32(buf)?,
19414                    );
19415                }
19416                4u32 => {
19417                    ::buffa::encoding::check_wire_type(
19418                        tag,
19419                        ::buffa::encoding::WireType::Varint,
19420                    )?;
19421                    self.end = ::core::option::Option::Some(
19422                        ::buffa::types::decode_int32(buf)?,
19423                    );
19424                }
19425                5u32 => {
19426                    ::buffa::encoding::check_wire_type(
19427                        tag,
19428                        ::buffa::encoding::WireType::Varint,
19429                    )?;
19430                    let __raw = ::buffa::types::decode_int32(buf)?;
19431                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
19432                        __raw,
19433                    ) {
19434                        self.semantic = ::core::option::Option::Some(__v);
19435                    } else {
19436                        self.__buffa_unknown_fields
19437                            .push(::buffa::UnknownField {
19438                                number: 5u32,
19439                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
19440                            });
19441                    }
19442                }
19443                _ => {
19444                    self.__buffa_unknown_fields
19445                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19446                }
19447            }
19448            ::core::result::Result::Ok(())
19449        }
19450        fn clear(&mut self) {
19451            self.path.clear();
19452            self.source_file = ::core::option::Option::None;
19453            self.begin = ::core::option::Option::None;
19454            self.end = ::core::option::Option::None;
19455            self.semantic = ::core::option::Option::None;
19456            self.__buffa_unknown_fields.clear();
19457        }
19458    }
19459    impl ::buffa::ExtensionSet for Annotation {
19460        const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
19461        fn unknown_fields(&self) -> &::buffa::UnknownFields {
19462            &self.__buffa_unknown_fields
19463        }
19464        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19465            &mut self.__buffa_unknown_fields
19466        }
19467    }
19468    #[cfg(feature = "text")]
19469    impl ::buffa::text::TextFormat for Annotation {
19470        fn encode_text(
19471            &self,
19472            enc: &mut ::buffa::text::TextEncoder<'_>,
19473        ) -> ::core::fmt::Result {
19474            #[allow(unused_imports)]
19475            use ::buffa::Enumeration as _;
19476            if let ::core::option::Option::Some(ref __v) = self.source_file {
19477                enc.write_field_name("source_file")?;
19478                enc.write_string(__v)?;
19479            }
19480            if let ::core::option::Option::Some(ref __v) = self.begin {
19481                enc.write_field_name("begin")?;
19482                enc.write_i32(*__v)?;
19483            }
19484            if let ::core::option::Option::Some(ref __v) = self.end {
19485                enc.write_field_name("end")?;
19486                enc.write_i32(*__v)?;
19487            }
19488            if let ::core::option::Option::Some(ref __v) = self.semantic {
19489                enc.write_field_name("semantic")?;
19490                enc.write_enum_name(__v.proto_name())?;
19491            }
19492            for __v in &self.path {
19493                enc.write_field_name("path")?;
19494                enc.write_i32(*__v)?;
19495            }
19496            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19497            ::core::result::Result::Ok(())
19498        }
19499        fn merge_text(
19500            &mut self,
19501            dec: &mut ::buffa::text::TextDecoder<'_>,
19502        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19503            #[allow(unused_imports)]
19504            use ::buffa::Enumeration as _;
19505            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19506                match __name {
19507                    "source_file" => {
19508                        self.source_file = ::core::option::Option::Some(
19509                            dec.read_string()?.into_owned(),
19510                        );
19511                    }
19512                    "begin" => self.begin = ::core::option::Option::Some(dec.read_i32()?),
19513                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
19514                    "semantic" => {
19515                        self.semantic = ::core::option::Option::Some(
19516                            dec
19517                                .read_closed_enum_by_name::<
19518                                    super::generated_code_info::annotation::Semantic,
19519                                >()?,
19520                        );
19521                    }
19522                    "path" => {
19523                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
19524                    }
19525                    _ => dec.skip_value()?,
19526                }
19527            }
19528            ::core::result::Result::Ok(())
19529        }
19530    }
19531    #[cfg(feature = "json")]
19532    impl ::buffa::json_helpers::ProtoElemJson for Annotation {
19533        fn serialize_proto_json<S: ::serde::Serializer>(
19534            v: &Self,
19535            s: S,
19536        ) -> ::core::result::Result<S::Ok, S::Error> {
19537            ::serde::Serialize::serialize(v, s)
19538        }
19539        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19540            d: D,
19541        ) -> ::core::result::Result<Self, D::Error> {
19542            <Self as ::serde::Deserialize>::deserialize(d)
19543        }
19544    }
19545    #[cfg(feature = "json")]
19546    #[doc(hidden)]
19547    pub const __ANNOTATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19548        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
19549        to_json: ::buffa::type_registry::any_to_json::<Annotation>,
19550        from_json: ::buffa::type_registry::any_from_json::<Annotation>,
19551        is_wkt: false,
19552    };
19553    #[cfg(feature = "text")]
19554    #[doc(hidden)]
19555    pub const __ANNOTATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19556        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
19557        text_encode: ::buffa::type_registry::any_encode_text::<Annotation>,
19558        text_merge: ::buffa::type_registry::any_merge_text::<Annotation>,
19559    };
19560    pub mod annotation {
19561        #[allow(unused_imports)]
19562        use super::*;
19563        /// Represents the identified object's effect on the element in the original
19564        /// .proto file.
19565        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
19566        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19567        #[repr(i32)]
19568        pub enum Semantic {
19569            /// There is no effect or the effect is indescribable.
19570            NONE = 0i32,
19571            /// The element is set or otherwise mutated.
19572            SET = 1i32,
19573            /// An alias to the element is returned.
19574            ALIAS = 2i32,
19575        }
19576        impl Semantic {
19577            ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
19578            #[allow(non_upper_case_globals)]
19579            pub const None: Self = Self::NONE;
19580            ///Idiomatic alias for [`Self::SET`]; `Debug` prints the variant name.
19581            #[allow(non_upper_case_globals)]
19582            pub const Set: Self = Self::SET;
19583            ///Idiomatic alias for [`Self::ALIAS`]; `Debug` prints the variant name.
19584            #[allow(non_upper_case_globals)]
19585            pub const Alias: Self = Self::ALIAS;
19586        }
19587        impl ::core::default::Default for Semantic {
19588            fn default() -> Self {
19589                Self::NONE
19590            }
19591        }
19592        #[cfg(feature = "json")]
19593        const _: () = {
19594            impl ::serde::Serialize for Semantic {
19595                fn serialize<S: ::serde::Serializer>(
19596                    &self,
19597                    s: S,
19598                ) -> ::core::result::Result<S::Ok, S::Error> {
19599                    s.serialize_str(::buffa::Enumeration::proto_name(self))
19600                }
19601            }
19602            impl<'de> ::serde::Deserialize<'de> for Semantic {
19603                fn deserialize<D: ::serde::Deserializer<'de>>(
19604                    d: D,
19605                ) -> ::core::result::Result<Self, D::Error> {
19606                    struct _V;
19607                    impl ::serde::de::Visitor<'_> for _V {
19608                        type Value = Semantic;
19609                        fn expecting(
19610                            &self,
19611                            f: &mut ::core::fmt::Formatter<'_>,
19612                        ) -> ::core::fmt::Result {
19613                            f.write_str(
19614                                concat!(
19615                                    "a string, integer, or null for ", stringify!(Semantic)
19616                                ),
19617                            )
19618                        }
19619                        fn visit_str<E: ::serde::de::Error>(
19620                            self,
19621                            v: &str,
19622                        ) -> ::core::result::Result<Semantic, E> {
19623                            <Semantic as ::buffa::Enumeration>::from_proto_name(v)
19624                                .ok_or_else(|| {
19625                                    ::serde::de::Error::unknown_variant(v, &[])
19626                                })
19627                        }
19628                        fn visit_i64<E: ::serde::de::Error>(
19629                            self,
19630                            v: i64,
19631                        ) -> ::core::result::Result<Semantic, E> {
19632                            let v32 = i32::try_from(v)
19633                                .map_err(|_| {
19634                                    ::serde::de::Error::custom(
19635                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
19636                                    )
19637                                })?;
19638                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
19639                                .ok_or_else(|| {
19640                                    ::serde::de::Error::custom(
19641                                        ::buffa::alloc::format!("unknown enum value {v32}"),
19642                                    )
19643                                })
19644                        }
19645                        fn visit_u64<E: ::serde::de::Error>(
19646                            self,
19647                            v: u64,
19648                        ) -> ::core::result::Result<Semantic, E> {
19649                            let v32 = i32::try_from(v)
19650                                .map_err(|_| {
19651                                    ::serde::de::Error::custom(
19652                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
19653                                    )
19654                                })?;
19655                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
19656                                .ok_or_else(|| {
19657                                    ::serde::de::Error::custom(
19658                                        ::buffa::alloc::format!("unknown enum value {v32}"),
19659                                    )
19660                                })
19661                        }
19662                        fn visit_unit<E: ::serde::de::Error>(
19663                            self,
19664                        ) -> ::core::result::Result<Semantic, E> {
19665                            ::core::result::Result::Ok(
19666                                ::core::default::Default::default(),
19667                            )
19668                        }
19669                    }
19670                    d.deserialize_any(_V)
19671                }
19672            }
19673            impl ::buffa::json_helpers::ProtoElemJson for Semantic {
19674                fn serialize_proto_json<S: ::serde::Serializer>(
19675                    v: &Self,
19676                    s: S,
19677                ) -> ::core::result::Result<S::Ok, S::Error> {
19678                    ::serde::Serialize::serialize(v, s)
19679                }
19680                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19681                    d: D,
19682                ) -> ::core::result::Result<Self, D::Error> {
19683                    <Self as ::serde::Deserialize>::deserialize(d)
19684                }
19685            }
19686        };
19687        impl ::buffa::Enumeration for Semantic {
19688            fn from_i32(value: i32) -> ::core::option::Option<Self> {
19689                match value {
19690                    0i32 => ::core::option::Option::Some(Self::NONE),
19691                    1i32 => ::core::option::Option::Some(Self::SET),
19692                    2i32 => ::core::option::Option::Some(Self::ALIAS),
19693                    _ => ::core::option::Option::None,
19694                }
19695            }
19696            fn to_i32(&self) -> i32 {
19697                *self as i32
19698            }
19699            fn proto_name(&self) -> &'static str {
19700                match self {
19701                    Self::NONE => "NONE",
19702                    Self::SET => "SET",
19703                    Self::ALIAS => "ALIAS",
19704                }
19705            }
19706            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
19707                match name {
19708                    "NONE" => ::core::option::Option::Some(Self::NONE),
19709                    "SET" => ::core::option::Option::Some(Self::SET),
19710                    "ALIAS" => ::core::option::Option::Some(Self::ALIAS),
19711                    _ => ::core::option::Option::None,
19712                }
19713            }
19714            fn values() -> &'static [Self] {
19715                &[Self::NONE, Self::SET, Self::ALIAS]
19716            }
19717        }
19718    }
19719    #[cfg(feature = "views")]
19720    #[doc(inline)]
19721    pub use super::__buffa::view::generated_code_info::AnnotationView;
19722    #[cfg(feature = "views")]
19723    #[doc(inline)]
19724    pub use super::__buffa::view::generated_code_info::AnnotationOwnedView;
19725}