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#[allow(non_camel_case_types)]
6#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
7#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8#[repr(i32)]
9pub enum Edition {
10    /// A placeholder for an unknown edition value.
11    EDITION_UNKNOWN = 0i32,
12    /// A placeholder edition for specifying default behaviors *before* a feature
13    /// was first introduced.  This is effectively an "infinite past".
14    EDITION_LEGACY = 900i32,
15    /// Legacy syntax "editions".  These pre-date editions, but behave much like
16    /// distinct editions.  These can't be used to specify the edition of proto
17    /// files, but feature definitions must supply proto2/proto3 defaults for
18    /// backwards compatibility.
19    EDITION_PROTO2 = 998i32,
20    EDITION_PROTO3 = 999i32,
21    /// Editions that have been released.  The specific values are arbitrary and
22    /// should not be depended on, but they will always be time-ordered for easy
23    /// comparison.
24    EDITION_2023 = 1000i32,
25    EDITION_2024 = 1001i32,
26    /// A placeholder edition for developing and testing unscheduled features.
27    EDITION_UNSTABLE = 9999i32,
28    /// Placeholder editions for testing feature resolution.  These should not be
29    /// used or relied on outside of tests.
30    EDITION_1_TEST_ONLY = 1i32,
31    EDITION_2_TEST_ONLY = 2i32,
32    EDITION_99997_TEST_ONLY = 99997i32,
33    EDITION_99998_TEST_ONLY = 99998i32,
34    EDITION_99999_TEST_ONLY = 99999i32,
35    /// Placeholder for specifying unbounded edition support.  This should only
36    /// ever be used by plugins that can expect to never require any changes to
37    /// support a new edition.
38    EDITION_MAX = 2147483647i32,
39}
40impl Edition {
41    ///Idiomatic alias for [`Self::EDITION_UNKNOWN`]; `Debug` prints the variant name.
42    #[allow(non_upper_case_globals)]
43    pub const EditionUnknown: Self = Self::EDITION_UNKNOWN;
44    ///Idiomatic alias for [`Self::EDITION_LEGACY`]; `Debug` prints the variant name.
45    #[allow(non_upper_case_globals)]
46    pub const EditionLegacy: Self = Self::EDITION_LEGACY;
47    ///Idiomatic alias for [`Self::EDITION_PROTO2`]; `Debug` prints the variant name.
48    #[allow(non_upper_case_globals)]
49    pub const EditionProto2: Self = Self::EDITION_PROTO2;
50    ///Idiomatic alias for [`Self::EDITION_PROTO3`]; `Debug` prints the variant name.
51    #[allow(non_upper_case_globals)]
52    pub const EditionProto3: Self = Self::EDITION_PROTO3;
53    ///Idiomatic alias for [`Self::EDITION_2023`]; `Debug` prints the variant name.
54    #[allow(non_upper_case_globals)]
55    pub const Edition2023: Self = Self::EDITION_2023;
56    ///Idiomatic alias for [`Self::EDITION_2024`]; `Debug` prints the variant name.
57    #[allow(non_upper_case_globals)]
58    pub const Edition2024: Self = Self::EDITION_2024;
59    ///Idiomatic alias for [`Self::EDITION_UNSTABLE`]; `Debug` prints the variant name.
60    #[allow(non_upper_case_globals)]
61    pub const EditionUnstable: Self = Self::EDITION_UNSTABLE;
62    ///Idiomatic alias for [`Self::EDITION_1_TEST_ONLY`]; `Debug` prints the variant name.
63    #[allow(non_upper_case_globals)]
64    pub const Edition1TestOnly: Self = Self::EDITION_1_TEST_ONLY;
65    ///Idiomatic alias for [`Self::EDITION_2_TEST_ONLY`]; `Debug` prints the variant name.
66    #[allow(non_upper_case_globals)]
67    pub const Edition2TestOnly: Self = Self::EDITION_2_TEST_ONLY;
68    ///Idiomatic alias for [`Self::EDITION_99997_TEST_ONLY`]; `Debug` prints the variant name.
69    #[allow(non_upper_case_globals)]
70    pub const Edition99997TestOnly: Self = Self::EDITION_99997_TEST_ONLY;
71    ///Idiomatic alias for [`Self::EDITION_99998_TEST_ONLY`]; `Debug` prints the variant name.
72    #[allow(non_upper_case_globals)]
73    pub const Edition99998TestOnly: Self = Self::EDITION_99998_TEST_ONLY;
74    ///Idiomatic alias for [`Self::EDITION_99999_TEST_ONLY`]; `Debug` prints the variant name.
75    #[allow(non_upper_case_globals)]
76    pub const Edition99999TestOnly: Self = Self::EDITION_99999_TEST_ONLY;
77    ///Idiomatic alias for [`Self::EDITION_MAX`]; `Debug` prints the variant name.
78    #[allow(non_upper_case_globals)]
79    pub const EditionMax: Self = Self::EDITION_MAX;
80}
81impl ::core::default::Default for Edition {
82    fn default() -> Self {
83        Self::EDITION_UNKNOWN
84    }
85}
86#[cfg(feature = "json")]
87const _: () = {
88    impl ::serde::Serialize for Edition {
89        fn serialize<S: ::serde::Serializer>(
90            &self,
91            s: S,
92        ) -> ::core::result::Result<S::Ok, S::Error> {
93            s.serialize_str(::buffa::Enumeration::proto_name(self))
94        }
95    }
96    impl<'de> ::serde::Deserialize<'de> for Edition {
97        fn deserialize<D: ::serde::Deserializer<'de>>(
98            d: D,
99        ) -> ::core::result::Result<Self, D::Error> {
100            struct _V;
101            impl ::serde::de::Visitor<'_> for _V {
102                type Value = Edition;
103                fn expecting(
104                    &self,
105                    f: &mut ::core::fmt::Formatter<'_>,
106                ) -> ::core::fmt::Result {
107                    f.write_str(
108                        concat!("a string, integer, or null for ", stringify!(Edition)),
109                    )
110                }
111                fn visit_str<E: ::serde::de::Error>(
112                    self,
113                    v: &str,
114                ) -> ::core::result::Result<Edition, E> {
115                    <Edition as ::buffa::Enumeration>::from_proto_name(v)
116                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
117                }
118                fn visit_i64<E: ::serde::de::Error>(
119                    self,
120                    v: i64,
121                ) -> ::core::result::Result<Edition, E> {
122                    let v32 = i32::try_from(v)
123                        .map_err(|_| {
124                            ::serde::de::Error::custom(
125                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
126                            )
127                        })?;
128                    <Edition as ::buffa::Enumeration>::from_i32(v32)
129                        .ok_or_else(|| {
130                            ::serde::de::Error::custom(
131                                ::buffa::alloc::format!("unknown enum value {v32}"),
132                            )
133                        })
134                }
135                fn visit_u64<E: ::serde::de::Error>(
136                    self,
137                    v: u64,
138                ) -> ::core::result::Result<Edition, E> {
139                    let v32 = i32::try_from(v)
140                        .map_err(|_| {
141                            ::serde::de::Error::custom(
142                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
143                            )
144                        })?;
145                    <Edition as ::buffa::Enumeration>::from_i32(v32)
146                        .ok_or_else(|| {
147                            ::serde::de::Error::custom(
148                                ::buffa::alloc::format!("unknown enum value {v32}"),
149                            )
150                        })
151                }
152                fn visit_unit<E: ::serde::de::Error>(
153                    self,
154                ) -> ::core::result::Result<Edition, E> {
155                    ::core::result::Result::Ok(::core::default::Default::default())
156                }
157            }
158            d.deserialize_any(_V)
159        }
160    }
161    impl ::buffa::json_helpers::ProtoElemJson for Edition {
162        fn serialize_proto_json<S: ::serde::Serializer>(
163            v: &Self,
164            s: S,
165        ) -> ::core::result::Result<S::Ok, S::Error> {
166            ::serde::Serialize::serialize(v, s)
167        }
168        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
169            d: D,
170        ) -> ::core::result::Result<Self, D::Error> {
171            <Self as ::serde::Deserialize>::deserialize(d)
172        }
173    }
174};
175impl ::buffa::Enumeration for Edition {
176    fn from_i32(value: i32) -> ::core::option::Option<Self> {
177        match value {
178            0i32 => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
179            900i32 => ::core::option::Option::Some(Self::EDITION_LEGACY),
180            998i32 => ::core::option::Option::Some(Self::EDITION_PROTO2),
181            999i32 => ::core::option::Option::Some(Self::EDITION_PROTO3),
182            1000i32 => ::core::option::Option::Some(Self::EDITION_2023),
183            1001i32 => ::core::option::Option::Some(Self::EDITION_2024),
184            9999i32 => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
185            1i32 => ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY),
186            2i32 => ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY),
187            99997i32 => ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY),
188            99998i32 => ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY),
189            99999i32 => ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY),
190            2147483647i32 => ::core::option::Option::Some(Self::EDITION_MAX),
191            _ => ::core::option::Option::None,
192        }
193    }
194    fn to_i32(&self) -> i32 {
195        *self as i32
196    }
197    fn proto_name(&self) -> &'static str {
198        match self {
199            Self::EDITION_UNKNOWN => "EDITION_UNKNOWN",
200            Self::EDITION_LEGACY => "EDITION_LEGACY",
201            Self::EDITION_PROTO2 => "EDITION_PROTO2",
202            Self::EDITION_PROTO3 => "EDITION_PROTO3",
203            Self::EDITION_2023 => "EDITION_2023",
204            Self::EDITION_2024 => "EDITION_2024",
205            Self::EDITION_UNSTABLE => "EDITION_UNSTABLE",
206            Self::EDITION_1_TEST_ONLY => "EDITION_1_TEST_ONLY",
207            Self::EDITION_2_TEST_ONLY => "EDITION_2_TEST_ONLY",
208            Self::EDITION_99997_TEST_ONLY => "EDITION_99997_TEST_ONLY",
209            Self::EDITION_99998_TEST_ONLY => "EDITION_99998_TEST_ONLY",
210            Self::EDITION_99999_TEST_ONLY => "EDITION_99999_TEST_ONLY",
211            Self::EDITION_MAX => "EDITION_MAX",
212        }
213    }
214    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
215        match name {
216            "EDITION_UNKNOWN" => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
217            "EDITION_LEGACY" => ::core::option::Option::Some(Self::EDITION_LEGACY),
218            "EDITION_PROTO2" => ::core::option::Option::Some(Self::EDITION_PROTO2),
219            "EDITION_PROTO3" => ::core::option::Option::Some(Self::EDITION_PROTO3),
220            "EDITION_2023" => ::core::option::Option::Some(Self::EDITION_2023),
221            "EDITION_2024" => ::core::option::Option::Some(Self::EDITION_2024),
222            "EDITION_UNSTABLE" => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
223            "EDITION_1_TEST_ONLY" => {
224                ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY)
225            }
226            "EDITION_2_TEST_ONLY" => {
227                ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY)
228            }
229            "EDITION_99997_TEST_ONLY" => {
230                ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY)
231            }
232            "EDITION_99998_TEST_ONLY" => {
233                ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY)
234            }
235            "EDITION_99999_TEST_ONLY" => {
236                ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY)
237            }
238            "EDITION_MAX" => ::core::option::Option::Some(Self::EDITION_MAX),
239            _ => ::core::option::Option::None,
240        }
241    }
242    fn values() -> &'static [Self] {
243        &[
244            Self::EDITION_UNKNOWN,
245            Self::EDITION_LEGACY,
246            Self::EDITION_PROTO2,
247            Self::EDITION_PROTO3,
248            Self::EDITION_2023,
249            Self::EDITION_2024,
250            Self::EDITION_UNSTABLE,
251            Self::EDITION_1_TEST_ONLY,
252            Self::EDITION_2_TEST_ONLY,
253            Self::EDITION_99997_TEST_ONLY,
254            Self::EDITION_99998_TEST_ONLY,
255            Self::EDITION_99999_TEST_ONLY,
256            Self::EDITION_MAX,
257        ]
258    }
259}
260/// Describes the 'visibility' of a symbol with respect to the proto import
261/// system. Symbols can only be imported when the visibility rules do not prevent
262/// it (ex: local symbols cannot be imported).  Visibility modifiers can only set
263/// on `message` and `enum` as they are the only types available to be referenced
264/// from other files.
265#[allow(non_camel_case_types)]
266#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
267#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
268#[repr(i32)]
269pub enum SymbolVisibility {
270    VISIBILITY_UNSET = 0i32,
271    VISIBILITY_LOCAL = 1i32,
272    VISIBILITY_EXPORT = 2i32,
273}
274impl SymbolVisibility {
275    ///Idiomatic alias for [`Self::VISIBILITY_UNSET`]; `Debug` prints the variant name.
276    #[allow(non_upper_case_globals)]
277    pub const VisibilityUnset: Self = Self::VISIBILITY_UNSET;
278    ///Idiomatic alias for [`Self::VISIBILITY_LOCAL`]; `Debug` prints the variant name.
279    #[allow(non_upper_case_globals)]
280    pub const VisibilityLocal: Self = Self::VISIBILITY_LOCAL;
281    ///Idiomatic alias for [`Self::VISIBILITY_EXPORT`]; `Debug` prints the variant name.
282    #[allow(non_upper_case_globals)]
283    pub const VisibilityExport: Self = Self::VISIBILITY_EXPORT;
284}
285impl ::core::default::Default for SymbolVisibility {
286    fn default() -> Self {
287        Self::VISIBILITY_UNSET
288    }
289}
290#[cfg(feature = "json")]
291const _: () = {
292    impl ::serde::Serialize for SymbolVisibility {
293        fn serialize<S: ::serde::Serializer>(
294            &self,
295            s: S,
296        ) -> ::core::result::Result<S::Ok, S::Error> {
297            s.serialize_str(::buffa::Enumeration::proto_name(self))
298        }
299    }
300    impl<'de> ::serde::Deserialize<'de> for SymbolVisibility {
301        fn deserialize<D: ::serde::Deserializer<'de>>(
302            d: D,
303        ) -> ::core::result::Result<Self, D::Error> {
304            struct _V;
305            impl ::serde::de::Visitor<'_> for _V {
306                type Value = SymbolVisibility;
307                fn expecting(
308                    &self,
309                    f: &mut ::core::fmt::Formatter<'_>,
310                ) -> ::core::fmt::Result {
311                    f.write_str(
312                        concat!(
313                            "a string, integer, or null for ",
314                            stringify!(SymbolVisibility)
315                        ),
316                    )
317                }
318                fn visit_str<E: ::serde::de::Error>(
319                    self,
320                    v: &str,
321                ) -> ::core::result::Result<SymbolVisibility, E> {
322                    <SymbolVisibility as ::buffa::Enumeration>::from_proto_name(v)
323                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
324                }
325                fn visit_i64<E: ::serde::de::Error>(
326                    self,
327                    v: i64,
328                ) -> ::core::result::Result<SymbolVisibility, E> {
329                    let v32 = i32::try_from(v)
330                        .map_err(|_| {
331                            ::serde::de::Error::custom(
332                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
333                            )
334                        })?;
335                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
336                        .ok_or_else(|| {
337                            ::serde::de::Error::custom(
338                                ::buffa::alloc::format!("unknown enum value {v32}"),
339                            )
340                        })
341                }
342                fn visit_u64<E: ::serde::de::Error>(
343                    self,
344                    v: u64,
345                ) -> ::core::result::Result<SymbolVisibility, E> {
346                    let v32 = i32::try_from(v)
347                        .map_err(|_| {
348                            ::serde::de::Error::custom(
349                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
350                            )
351                        })?;
352                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
353                        .ok_or_else(|| {
354                            ::serde::de::Error::custom(
355                                ::buffa::alloc::format!("unknown enum value {v32}"),
356                            )
357                        })
358                }
359                fn visit_unit<E: ::serde::de::Error>(
360                    self,
361                ) -> ::core::result::Result<SymbolVisibility, E> {
362                    ::core::result::Result::Ok(::core::default::Default::default())
363                }
364            }
365            d.deserialize_any(_V)
366        }
367    }
368    impl ::buffa::json_helpers::ProtoElemJson for SymbolVisibility {
369        fn serialize_proto_json<S: ::serde::Serializer>(
370            v: &Self,
371            s: S,
372        ) -> ::core::result::Result<S::Ok, S::Error> {
373            ::serde::Serialize::serialize(v, s)
374        }
375        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
376            d: D,
377        ) -> ::core::result::Result<Self, D::Error> {
378            <Self as ::serde::Deserialize>::deserialize(d)
379        }
380    }
381};
382impl ::buffa::Enumeration for SymbolVisibility {
383    fn from_i32(value: i32) -> ::core::option::Option<Self> {
384        match value {
385            0i32 => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
386            1i32 => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
387            2i32 => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
388            _ => ::core::option::Option::None,
389        }
390    }
391    fn to_i32(&self) -> i32 {
392        *self as i32
393    }
394    fn proto_name(&self) -> &'static str {
395        match self {
396            Self::VISIBILITY_UNSET => "VISIBILITY_UNSET",
397            Self::VISIBILITY_LOCAL => "VISIBILITY_LOCAL",
398            Self::VISIBILITY_EXPORT => "VISIBILITY_EXPORT",
399        }
400    }
401    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
402        match name {
403            "VISIBILITY_UNSET" => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
404            "VISIBILITY_LOCAL" => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
405            "VISIBILITY_EXPORT" => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
406            _ => ::core::option::Option::None,
407        }
408    }
409    fn values() -> &'static [Self] {
410        &[Self::VISIBILITY_UNSET, Self::VISIBILITY_LOCAL, Self::VISIBILITY_EXPORT]
411    }
412}
413/// The protocol compiler can output a FileDescriptorSet containing the .proto
414/// files it parses.
415#[derive(Clone, PartialEq, Default)]
416#[cfg_attr(feature = "json", derive(::serde::Serialize))]
417#[cfg_attr(feature = "json", serde(default))]
418#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
419pub struct FileDescriptorSet {
420    /// Field 1: `file`
421    #[cfg_attr(
422        feature = "json",
423        serde(
424            rename = "file",
425            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
426            deserialize_with = "::buffa::json_helpers::null_as_default"
427        )
428    )]
429    pub file: ::buffa::alloc::vec::Vec<FileDescriptorProto>,
430    #[cfg_attr(feature = "json", serde(flatten))]
431    #[doc(hidden)]
432    pub __buffa_unknown_fields: __FileDescriptorSetExtJson,
433}
434impl ::core::fmt::Debug for FileDescriptorSet {
435    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
436        f.debug_struct("FileDescriptorSet").field("file", &self.file).finish()
437    }
438}
439impl FileDescriptorSet {
440    /// Protobuf type URL for this message, for use with `Any::pack` and
441    /// `Any::unpack_if`.
442    ///
443    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
444    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
445}
446::buffa::impl_default_instance!(FileDescriptorSet);
447impl ::buffa::MessageName for FileDescriptorSet {
448    const PACKAGE: &'static str = "google.protobuf";
449    const NAME: &'static str = "FileDescriptorSet";
450    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorSet";
451    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
452}
453impl ::buffa::Message for FileDescriptorSet {
454    /// Returns the total encoded size in bytes.
455    ///
456    /// Accumulates in `u64` (which cannot overflow for in-memory
457    /// data) and saturates to `u32` at return, so a message whose
458    /// encoded size exceeds the 2 GiB protobuf limit yields a value
459    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
460    /// points reject, never a silently wrapped size.
461    #[allow(clippy::let_and_return)]
462    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
463        #[allow(unused_imports)]
464        use ::buffa::Enumeration as _;
465        let mut size = 0u64;
466        for v in &self.file {
467            let __slot = __cache.reserve();
468            let inner_size = v.compute_size(__cache);
469            __cache.set(__slot, inner_size);
470            size
471                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
472                    + inner_size as u64;
473        }
474        size += self.__buffa_unknown_fields.encoded_len() as u64;
475        ::buffa::saturate_size(size)
476    }
477    fn write_to(
478        &self,
479        __cache: &mut ::buffa::SizeCache,
480        buf: &mut impl ::buffa::EncodeSink,
481    ) {
482        #[allow(unused_imports)]
483        use ::buffa::Enumeration as _;
484        for v in &self.file {
485            ::buffa::types::put_len_delimited_header(
486                1u32,
487                u64::from(__cache.consume_next()),
488                buf,
489            );
490            v.write_to(__cache, buf);
491        }
492        self.__buffa_unknown_fields.write_to(buf);
493    }
494    fn merge_field(
495        &mut self,
496        tag: ::buffa::encoding::Tag,
497        buf: &mut impl ::buffa::bytes::Buf,
498        ctx: ::buffa::DecodeContext<'_>,
499    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
500        #[allow(unused_imports)]
501        use ::buffa::bytes::Buf as _;
502        #[allow(unused_imports)]
503        use ::buffa::Enumeration as _;
504        match tag.field_number() {
505            1u32 => {
506                ::buffa::encoding::check_wire_type(
507                    tag,
508                    ::buffa::encoding::WireType::LengthDelimited,
509                )?;
510                let mut elem = ::core::default::Default::default();
511                ctx.register_element_memory(
512                    ::buffa::__private::element_footprint(&elem),
513                )?;
514                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
515                self.file.push(elem);
516            }
517            _ => {
518                self.__buffa_unknown_fields
519                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
520            }
521        }
522        ::core::result::Result::Ok(())
523    }
524    fn clear(&mut self) {
525        self.file.clear();
526        self.__buffa_unknown_fields.clear();
527    }
528}
529impl ::buffa::ExtensionSet for FileDescriptorSet {
530    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorSet";
531    fn unknown_fields(&self) -> &::buffa::UnknownFields {
532        &self.__buffa_unknown_fields
533    }
534    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
535        &mut self.__buffa_unknown_fields
536    }
537}
538#[cfg(feature = "text")]
539impl ::buffa::text::TextFormat for FileDescriptorSet {
540    fn encode_text(
541        &self,
542        enc: &mut ::buffa::text::TextEncoder<'_>,
543    ) -> ::core::fmt::Result {
544        #[allow(unused_imports)]
545        use ::buffa::Enumeration as _;
546        for __v in &self.file {
547            enc.write_field_name("file")?;
548            enc.write_message(__v)?;
549        }
550        enc.write_extension_fields(
551            "google.protobuf.FileDescriptorSet",
552            &self.__buffa_unknown_fields,
553        )?;
554        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
555        ::core::result::Result::Ok(())
556    }
557    fn merge_text(
558        &mut self,
559        dec: &mut ::buffa::text::TextDecoder<'_>,
560    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
561        #[allow(unused_imports)]
562        use ::buffa::Enumeration as _;
563        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
564            match __name {
565                "file" => {
566                    dec.read_repeated_into(
567                        &mut self.file,
568                        |__d| {
569                            let mut __m = ::core::default::Default::default();
570                            __d.merge_message(&mut __m)?;
571                            ::core::result::Result::Ok(__m)
572                        },
573                    )?
574                }
575                __name if __name.starts_with('[') => {
576                    for __r in dec
577                        .read_extension(__name, "google.protobuf.FileDescriptorSet")?
578                    {
579                        self.__buffa_unknown_fields.push(__r);
580                    }
581                }
582                _ => dec.skip_value()?,
583            }
584        }
585        ::core::result::Result::Ok(())
586    }
587}
588#[cfg(feature = "json")]
589impl<'de> ::serde::Deserialize<'de> for FileDescriptorSet {
590    fn deserialize<D: ::serde::Deserializer<'de>>(
591        d: D,
592    ) -> ::core::result::Result<Self, D::Error> {
593        struct _V;
594        impl<'de> ::serde::de::Visitor<'de> for _V {
595            type Value = FileDescriptorSet;
596            fn expecting(
597                &self,
598                f: &mut ::core::fmt::Formatter<'_>,
599            ) -> ::core::fmt::Result {
600                f.write_str("struct FileDescriptorSet")
601            }
602            #[allow(clippy::field_reassign_with_default)]
603            fn visit_map<A: ::serde::de::MapAccess<'de>>(
604                self,
605                mut map: A,
606            ) -> ::core::result::Result<FileDescriptorSet, A::Error> {
607                let mut __f_file: ::core::option::Option<
608                    ::buffa::alloc::vec::Vec<FileDescriptorProto>,
609                > = None;
610                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
611                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
612                    match key.as_str() {
613                        "file" => {
614                            __f_file = Some({
615                                struct _S;
616                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
617                                    type Value = ::buffa::alloc::vec::Vec<FileDescriptorProto>;
618                                    fn deserialize<D: ::serde::Deserializer<'de>>(
619                                        self,
620                                        d: D,
621                                    ) -> ::core::result::Result<
622                                        ::buffa::alloc::vec::Vec<FileDescriptorProto>,
623                                        D::Error,
624                                    > {
625                                        ::buffa::json_helpers::null_as_default(d)
626                                    }
627                                }
628                                map.next_value_seed(_S)?
629                            });
630                        }
631                        __k if __k.starts_with('[') => {
632                            let __v: ::buffa::serde_json::Value = map.next_value()?;
633                            match ::buffa::extension_registry::deserialize_extension_key(
634                                "google.protobuf.FileDescriptorSet",
635                                __k,
636                                __v,
637                            ) {
638                                ::core::option::Option::Some(
639                                    ::core::result::Result::Ok(__recs),
640                                ) => {
641                                    for __rec in __recs {
642                                        __ext_records.push(__rec);
643                                    }
644                                }
645                                ::core::option::Option::Some(
646                                    ::core::result::Result::Err(__e),
647                                ) => {
648                                    return ::core::result::Result::Err(
649                                        <A::Error as ::serde::de::Error>::custom(__e),
650                                    );
651                                }
652                                ::core::option::Option::None => {}
653                            }
654                        }
655                        _ => {
656                            map.next_value::<::serde::de::IgnoredAny>()?;
657                        }
658                    }
659                }
660                let mut __r = <FileDescriptorSet as ::core::default::Default>::default();
661                if let ::core::option::Option::Some(v) = __f_file {
662                    __r.file = v;
663                }
664                for __rec in __ext_records {
665                    __r.__buffa_unknown_fields.push(__rec);
666                }
667                Ok(__r)
668            }
669        }
670        d.deserialize_map(_V)
671    }
672}
673#[cfg(feature = "json")]
674impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorSet {
675    fn serialize_proto_json<S: ::serde::Serializer>(
676        v: &Self,
677        s: S,
678    ) -> ::core::result::Result<S::Ok, S::Error> {
679        ::serde::Serialize::serialize(v, s)
680    }
681    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
682        d: D,
683    ) -> ::core::result::Result<Self, D::Error> {
684        <Self as ::serde::Deserialize>::deserialize(d)
685    }
686}
687#[doc(hidden)]
688#[derive(Clone, Debug, Default, PartialEq)]
689#[repr(transparent)]
690#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
691pub struct __FileDescriptorSetExtJson(pub ::buffa::UnknownFields);
692impl ::core::ops::Deref for __FileDescriptorSetExtJson {
693    type Target = ::buffa::UnknownFields;
694    fn deref(&self) -> &::buffa::UnknownFields {
695        &self.0
696    }
697}
698impl ::core::ops::DerefMut for __FileDescriptorSetExtJson {
699    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
700        &mut self.0
701    }
702}
703impl ::core::convert::From<::buffa::UnknownFields> for __FileDescriptorSetExtJson {
704    fn from(u: ::buffa::UnknownFields) -> Self {
705        Self(u)
706    }
707}
708#[cfg(feature = "json")]
709impl ::serde::Serialize for __FileDescriptorSetExtJson {
710    fn serialize<S: ::serde::Serializer>(
711        &self,
712        s: S,
713    ) -> ::core::result::Result<S::Ok, S::Error> {
714        ::buffa::extension_registry::serialize_extensions(
715            "google.protobuf.FileDescriptorSet",
716            &self.0,
717            s,
718        )
719    }
720}
721#[cfg(feature = "json")]
722impl<'de> ::serde::Deserialize<'de> for __FileDescriptorSetExtJson {
723    fn deserialize<D: ::serde::Deserializer<'de>>(
724        d: D,
725    ) -> ::core::result::Result<Self, D::Error> {
726        ::buffa::extension_registry::deserialize_extensions(
727                "google.protobuf.FileDescriptorSet",
728                d,
729            )
730            .map(Self)
731    }
732}
733#[cfg(feature = "json")]
734#[doc(hidden)]
735pub const __FILE_DESCRIPTOR_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
736    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
737    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorSet>,
738    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorSet>,
739    is_wkt: false,
740};
741#[cfg(feature = "text")]
742#[doc(hidden)]
743pub const __FILE_DESCRIPTOR_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
744    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
745    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorSet>,
746    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorSet>,
747};
748/// Describes a complete .proto file.
749#[derive(Clone, PartialEq, Default)]
750#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
751#[cfg_attr(feature = "json", serde(default))]
752#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
753pub struct FileDescriptorProto {
754    /// file name, relative to root of source tree
755    ///
756    /// Field 1: `name`
757    #[cfg_attr(
758        feature = "json",
759        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
760    )]
761    pub name: ::core::option::Option<::buffa::alloc::string::String>,
762    /// e.g. "foo", "foo.bar", etc.
763    ///
764    /// Field 2: `package`
765    #[cfg_attr(
766        feature = "json",
767        serde(
768            rename = "package",
769            skip_serializing_if = "::core::option::Option::is_none"
770        )
771    )]
772    pub package: ::core::option::Option<::buffa::alloc::string::String>,
773    /// Names of files imported by this file.
774    ///
775    /// Field 3: `dependency`
776    #[cfg_attr(
777        feature = "json",
778        serde(
779            rename = "dependency",
780            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
781            deserialize_with = "::buffa::json_helpers::null_as_default"
782        )
783    )]
784    pub dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
785    /// Indexes of the public imported files in the dependency list above.
786    ///
787    /// Field 10: `public_dependency`
788    #[cfg_attr(
789        feature = "json",
790        serde(
791            rename = "publicDependency",
792            alias = "public_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 public_dependency: ::buffa::alloc::vec::Vec<i32>,
798    /// Indexes of the weak imported files in the dependency list.
799    /// For Google-internal migration only. Do not use.
800    ///
801    /// Field 11: `weak_dependency`
802    #[cfg_attr(
803        feature = "json",
804        serde(
805            rename = "weakDependency",
806            alias = "weak_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 weak_dependency: ::buffa::alloc::vec::Vec<i32>,
812    /// Names of files imported by this file purely for the purpose of providing
813    /// option extensions. These are excluded from the dependency list above.
814    ///
815    /// Field 15: `option_dependency`
816    #[cfg_attr(
817        feature = "json",
818        serde(
819            rename = "optionDependency",
820            alias = "option_dependency",
821            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
822            deserialize_with = "::buffa::json_helpers::null_as_default"
823        )
824    )]
825    pub option_dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
826    /// All top-level definitions in this file.
827    ///
828    /// Field 4: `message_type`
829    #[cfg_attr(
830        feature = "json",
831        serde(
832            rename = "messageType",
833            alias = "message_type",
834            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
835            deserialize_with = "::buffa::json_helpers::null_as_default"
836        )
837    )]
838    pub message_type: ::buffa::alloc::vec::Vec<DescriptorProto>,
839    /// Field 5: `enum_type`
840    #[cfg_attr(
841        feature = "json",
842        serde(
843            rename = "enumType",
844            alias = "enum_type",
845            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
846            deserialize_with = "::buffa::json_helpers::null_as_default"
847        )
848    )]
849    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
850    /// Field 6: `service`
851    #[cfg_attr(
852        feature = "json",
853        serde(
854            rename = "service",
855            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
856            deserialize_with = "::buffa::json_helpers::null_as_default"
857        )
858    )]
859    pub service: ::buffa::alloc::vec::Vec<ServiceDescriptorProto>,
860    /// Field 7: `extension`
861    #[cfg_attr(
862        feature = "json",
863        serde(
864            rename = "extension",
865            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
866            deserialize_with = "::buffa::json_helpers::null_as_default"
867        )
868    )]
869    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
870    /// Field 8: `options`
871    #[cfg_attr(
872        feature = "json",
873        serde(
874            rename = "options",
875            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
876        )
877    )]
878    pub options: ::buffa::MessageField<FileOptions, ::buffa::Inline<FileOptions>>,
879    /// This field contains optional information about the original source code.
880    /// You may safely remove this entire field without harming runtime
881    /// functionality of the descriptors -- the information is needed only by
882    /// development tools.
883    ///
884    /// Field 9: `source_code_info`
885    #[cfg_attr(
886        feature = "json",
887        serde(
888            rename = "sourceCodeInfo",
889            alias = "source_code_info",
890            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
891        )
892    )]
893    pub source_code_info: ::buffa::MessageField<
894        SourceCodeInfo,
895        ::buffa::Inline<SourceCodeInfo>,
896    >,
897    /// The syntax of the proto file.
898    /// The supported values are "proto2", "proto3", and "editions".
899    ///
900    /// If `edition` is present, this value must be "editions".
901    /// WARNING: This field should only be used by protobuf plugins or special
902    /// cases like the proto compiler. Other uses are discouraged and
903    /// developers should rely on the protoreflect APIs for their client language.
904    ///
905    /// Field 12: `syntax`
906    #[cfg_attr(
907        feature = "json",
908        serde(rename = "syntax", skip_serializing_if = "::core::option::Option::is_none")
909    )]
910    pub syntax: ::core::option::Option<::buffa::alloc::string::String>,
911    /// The edition of the proto file.
912    /// WARNING: This field should only be used by protobuf plugins or special
913    /// cases like the proto compiler. Other uses are discouraged and
914    /// developers should rely on the protoreflect APIs for their client language.
915    ///
916    /// Field 14: `edition`
917    #[cfg_attr(
918        feature = "json",
919        serde(
920            rename = "edition",
921            with = "::buffa::json_helpers::opt_closed_enum",
922            skip_serializing_if = "::core::option::Option::is_none"
923        )
924    )]
925    pub edition: ::core::option::Option<Edition>,
926    #[cfg_attr(feature = "json", serde(skip))]
927    #[doc(hidden)]
928    pub __buffa_unknown_fields: ::buffa::UnknownFields,
929}
930impl ::core::fmt::Debug for FileDescriptorProto {
931    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
932        f.debug_struct("FileDescriptorProto")
933            .field("name", &self.name)
934            .field("package", &self.package)
935            .field("dependency", &self.dependency)
936            .field("public_dependency", &self.public_dependency)
937            .field("weak_dependency", &self.weak_dependency)
938            .field("option_dependency", &self.option_dependency)
939            .field("message_type", &self.message_type)
940            .field("enum_type", &self.enum_type)
941            .field("service", &self.service)
942            .field("extension", &self.extension)
943            .field("options", &self.options)
944            .field("source_code_info", &self.source_code_info)
945            .field("syntax", &self.syntax)
946            .field("edition", &self.edition)
947            .finish()
948    }
949}
950impl FileDescriptorProto {
951    /// Protobuf type URL for this message, for use with `Any::pack` and
952    /// `Any::unpack_if`.
953    ///
954    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
955    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
956}
957impl FileDescriptorProto {
958    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
959    #[inline]
960    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
961    pub fn with_name(
962        mut self,
963        value: impl Into<::buffa::alloc::string::String>,
964    ) -> Self {
965        self.name = Some(value.into());
966        self
967    }
968    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
969    #[inline]
970    ///Sets [`Self::package`] to `Some(value)`, consuming and returning `self`.
971    pub fn with_package(
972        mut self,
973        value: impl Into<::buffa::alloc::string::String>,
974    ) -> Self {
975        self.package = Some(value.into());
976        self
977    }
978    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
979    #[inline]
980    ///Sets [`Self::syntax`] to `Some(value)`, consuming and returning `self`.
981    pub fn with_syntax(
982        mut self,
983        value: impl Into<::buffa::alloc::string::String>,
984    ) -> Self {
985        self.syntax = Some(value.into());
986        self
987    }
988    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
989    #[inline]
990    ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
991    pub fn with_edition(mut self, value: impl Into<Edition>) -> Self {
992        self.edition = Some(value.into());
993        self
994    }
995}
996::buffa::impl_default_instance!(FileDescriptorProto);
997impl ::buffa::MessageName for FileDescriptorProto {
998    const PACKAGE: &'static str = "google.protobuf";
999    const NAME: &'static str = "FileDescriptorProto";
1000    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorProto";
1001    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
1002}
1003impl ::buffa::Message for FileDescriptorProto {
1004    /// Returns the total encoded size in bytes.
1005    ///
1006    /// Accumulates in `u64` (which cannot overflow for in-memory
1007    /// data) and saturates to `u32` at return, so a message whose
1008    /// encoded size exceeds the 2 GiB protobuf limit yields a value
1009    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
1010    /// points reject, never a silently wrapped size.
1011    #[allow(clippy::let_and_return)]
1012    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1013        #[allow(unused_imports)]
1014        use ::buffa::Enumeration as _;
1015        let mut size = 0u64;
1016        if let Some(ref v) = self.name {
1017            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1018        }
1019        if let Some(ref v) = self.package {
1020            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1021        }
1022        for v in &self.dependency {
1023            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1024        }
1025        for v in &self.message_type {
1026            let __slot = __cache.reserve();
1027            let inner_size = v.compute_size(__cache);
1028            __cache.set(__slot, inner_size);
1029            size
1030                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1031                    + inner_size as u64;
1032        }
1033        for v in &self.enum_type {
1034            let __slot = __cache.reserve();
1035            let inner_size = v.compute_size(__cache);
1036            __cache.set(__slot, inner_size);
1037            size
1038                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1039                    + inner_size as u64;
1040        }
1041        for v in &self.service {
1042            let __slot = __cache.reserve();
1043            let inner_size = v.compute_size(__cache);
1044            __cache.set(__slot, inner_size);
1045            size
1046                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1047                    + inner_size as u64;
1048        }
1049        for v in &self.extension {
1050            let __slot = __cache.reserve();
1051            let inner_size = v.compute_size(__cache);
1052            __cache.set(__slot, inner_size);
1053            size
1054                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1055                    + inner_size as u64;
1056        }
1057        if self.options.is_set() {
1058            let __slot = __cache.reserve();
1059            let inner_size = self.options.compute_size(__cache);
1060            __cache.set(__slot, inner_size);
1061            size
1062                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1063                    + inner_size as u64;
1064        }
1065        if self.source_code_info.is_set() {
1066            let __slot = __cache.reserve();
1067            let inner_size = self.source_code_info.compute_size(__cache);
1068            __cache.set(__slot, inner_size);
1069            size
1070                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1071                    + inner_size as u64;
1072        }
1073        for v in &self.public_dependency {
1074            size += 1u64 + ::buffa::types::int32_encoded_len(*v) as u64;
1075        }
1076        for v in &self.weak_dependency {
1077            size += 1u64 + ::buffa::types::int32_encoded_len(*v) as u64;
1078        }
1079        if let Some(ref v) = self.syntax {
1080            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1081        }
1082        if let Some(ref v) = self.edition {
1083            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
1084        }
1085        for v in &self.option_dependency {
1086            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1087        }
1088        size += self.__buffa_unknown_fields.encoded_len() as u64;
1089        ::buffa::saturate_size(size)
1090    }
1091    fn write_to(
1092        &self,
1093        __cache: &mut ::buffa::SizeCache,
1094        buf: &mut impl ::buffa::EncodeSink,
1095    ) {
1096        #[allow(unused_imports)]
1097        use ::buffa::Enumeration as _;
1098        if let Some(ref v) = self.name {
1099            ::buffa::types::put_string_field(1u32, v, buf);
1100        }
1101        if let Some(ref v) = self.package {
1102            ::buffa::types::put_string_field(2u32, v, buf);
1103        }
1104        for v in &self.dependency {
1105            ::buffa::types::put_string_field(3u32, v, buf);
1106        }
1107        for v in &self.message_type {
1108            ::buffa::types::put_len_delimited_header(
1109                4u32,
1110                u64::from(__cache.consume_next()),
1111                buf,
1112            );
1113            v.write_to(__cache, buf);
1114        }
1115        for v in &self.enum_type {
1116            ::buffa::types::put_len_delimited_header(
1117                5u32,
1118                u64::from(__cache.consume_next()),
1119                buf,
1120            );
1121            v.write_to(__cache, buf);
1122        }
1123        for v in &self.service {
1124            ::buffa::types::put_len_delimited_header(
1125                6u32,
1126                u64::from(__cache.consume_next()),
1127                buf,
1128            );
1129            v.write_to(__cache, buf);
1130        }
1131        for v in &self.extension {
1132            ::buffa::types::put_len_delimited_header(
1133                7u32,
1134                u64::from(__cache.consume_next()),
1135                buf,
1136            );
1137            v.write_to(__cache, buf);
1138        }
1139        if self.options.is_set() {
1140            ::buffa::types::put_len_delimited_header(
1141                8u32,
1142                u64::from(__cache.consume_next()),
1143                buf,
1144            );
1145            self.options.write_to(__cache, buf);
1146        }
1147        if self.source_code_info.is_set() {
1148            ::buffa::types::put_len_delimited_header(
1149                9u32,
1150                u64::from(__cache.consume_next()),
1151                buf,
1152            );
1153            self.source_code_info.write_to(__cache, buf);
1154        }
1155        for v in &self.public_dependency {
1156            ::buffa::types::put_int32_field(10u32, *v, buf);
1157        }
1158        for v in &self.weak_dependency {
1159            ::buffa::types::put_int32_field(11u32, *v, buf);
1160        }
1161        if let Some(ref v) = self.syntax {
1162            ::buffa::types::put_string_field(12u32, v, buf);
1163        }
1164        if let Some(ref v) = self.edition {
1165            ::buffa::types::put_int32_field(14u32, v.to_i32(), buf);
1166        }
1167        for v in &self.option_dependency {
1168            ::buffa::types::put_string_field(15u32, v, buf);
1169        }
1170        self.__buffa_unknown_fields.write_to(buf);
1171    }
1172    fn merge_field(
1173        &mut self,
1174        tag: ::buffa::encoding::Tag,
1175        buf: &mut impl ::buffa::bytes::Buf,
1176        ctx: ::buffa::DecodeContext<'_>,
1177    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1178        #[allow(unused_imports)]
1179        use ::buffa::bytes::Buf as _;
1180        #[allow(unused_imports)]
1181        use ::buffa::Enumeration as _;
1182        match tag.field_number() {
1183            1u32 => {
1184                ::buffa::encoding::check_wire_type(
1185                    tag,
1186                    ::buffa::encoding::WireType::LengthDelimited,
1187                )?;
1188                ::buffa::types::merge_string(
1189                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1190                    buf,
1191                )?;
1192            }
1193            2u32 => {
1194                ::buffa::encoding::check_wire_type(
1195                    tag,
1196                    ::buffa::encoding::WireType::LengthDelimited,
1197                )?;
1198                ::buffa::types::merge_string(
1199                    self.package.get_or_insert_with(::buffa::alloc::string::String::new),
1200                    buf,
1201                )?;
1202            }
1203            3u32 => {
1204                ::buffa::encoding::check_wire_type(
1205                    tag,
1206                    ::buffa::encoding::WireType::LengthDelimited,
1207                )?;
1208                let __elem = ::buffa::types::decode_string(buf)?;
1209                ctx.register_element_memory(
1210                    ::buffa::__private::element_footprint(&__elem),
1211                )?;
1212                self.dependency.push(__elem);
1213            }
1214            4u32 => {
1215                ::buffa::encoding::check_wire_type(
1216                    tag,
1217                    ::buffa::encoding::WireType::LengthDelimited,
1218                )?;
1219                let mut elem = ::core::default::Default::default();
1220                ctx.register_element_memory(
1221                    ::buffa::__private::element_footprint(&elem),
1222                )?;
1223                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1224                self.message_type.push(elem);
1225            }
1226            5u32 => {
1227                ::buffa::encoding::check_wire_type(
1228                    tag,
1229                    ::buffa::encoding::WireType::LengthDelimited,
1230                )?;
1231                let mut elem = ::core::default::Default::default();
1232                ctx.register_element_memory(
1233                    ::buffa::__private::element_footprint(&elem),
1234                )?;
1235                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1236                self.enum_type.push(elem);
1237            }
1238            6u32 => {
1239                ::buffa::encoding::check_wire_type(
1240                    tag,
1241                    ::buffa::encoding::WireType::LengthDelimited,
1242                )?;
1243                let mut elem = ::core::default::Default::default();
1244                ctx.register_element_memory(
1245                    ::buffa::__private::element_footprint(&elem),
1246                )?;
1247                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1248                self.service.push(elem);
1249            }
1250            7u32 => {
1251                ::buffa::encoding::check_wire_type(
1252                    tag,
1253                    ::buffa::encoding::WireType::LengthDelimited,
1254                )?;
1255                let mut elem = ::core::default::Default::default();
1256                ctx.register_element_memory(
1257                    ::buffa::__private::element_footprint(&elem),
1258                )?;
1259                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1260                self.extension.push(elem);
1261            }
1262            8u32 => {
1263                ::buffa::encoding::check_wire_type(
1264                    tag,
1265                    ::buffa::encoding::WireType::LengthDelimited,
1266                )?;
1267                ::buffa::Message::merge_length_delimited(
1268                    self.options.get_or_insert_default(),
1269                    buf,
1270                    ctx,
1271                )?;
1272            }
1273            9u32 => {
1274                ::buffa::encoding::check_wire_type(
1275                    tag,
1276                    ::buffa::encoding::WireType::LengthDelimited,
1277                )?;
1278                ::buffa::Message::merge_length_delimited(
1279                    self.source_code_info.get_or_insert_default(),
1280                    buf,
1281                    ctx,
1282                )?;
1283            }
1284            10u32 => {
1285                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1286                    let len = ::buffa::encoding::decode_varint(buf)?;
1287                    let len = usize::try_from(len)
1288                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1289                    if buf.remaining() < len {
1290                        return ::core::result::Result::Err(
1291                            ::buffa::DecodeError::UnexpectedEof,
1292                        );
1293                    }
1294                    if buf.chunk().len() >= len {
1295                        ::buffa::types::extend_packed_int32(
1296                            &buf.chunk()[..len],
1297                            &mut self.public_dependency,
1298                            len,
1299                        )?;
1300                        buf.advance(len);
1301                    } else {
1302                        self.public_dependency.reserve(len);
1303                        let mut limited = buf.take(len);
1304                        while limited.has_remaining() {
1305                            self.public_dependency
1306                                .push(::buffa::types::decode_int32_packed(&mut limited)?);
1307                        }
1308                        let leftover = limited.remaining();
1309                        if leftover > 0 {
1310                            limited.advance(leftover);
1311                        }
1312                    }
1313                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1314                    self.public_dependency.push(::buffa::types::decode_int32(buf)?);
1315                } else {
1316                    return ::core::result::Result::Err(
1317                        ::buffa::encoding::wire_type_mismatch(
1318                            tag,
1319                            ::buffa::encoding::WireType::LengthDelimited,
1320                        ),
1321                    );
1322                }
1323            }
1324            11u32 => {
1325                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1326                    let len = ::buffa::encoding::decode_varint(buf)?;
1327                    let len = usize::try_from(len)
1328                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1329                    if buf.remaining() < len {
1330                        return ::core::result::Result::Err(
1331                            ::buffa::DecodeError::UnexpectedEof,
1332                        );
1333                    }
1334                    if buf.chunk().len() >= len {
1335                        ::buffa::types::extend_packed_int32(
1336                            &buf.chunk()[..len],
1337                            &mut self.weak_dependency,
1338                            len,
1339                        )?;
1340                        buf.advance(len);
1341                    } else {
1342                        self.weak_dependency.reserve(len);
1343                        let mut limited = buf.take(len);
1344                        while limited.has_remaining() {
1345                            self.weak_dependency
1346                                .push(::buffa::types::decode_int32_packed(&mut limited)?);
1347                        }
1348                        let leftover = limited.remaining();
1349                        if leftover > 0 {
1350                            limited.advance(leftover);
1351                        }
1352                    }
1353                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1354                    self.weak_dependency.push(::buffa::types::decode_int32(buf)?);
1355                } else {
1356                    return ::core::result::Result::Err(
1357                        ::buffa::encoding::wire_type_mismatch(
1358                            tag,
1359                            ::buffa::encoding::WireType::LengthDelimited,
1360                        ),
1361                    );
1362                }
1363            }
1364            12u32 => {
1365                ::buffa::encoding::check_wire_type(
1366                    tag,
1367                    ::buffa::encoding::WireType::LengthDelimited,
1368                )?;
1369                ::buffa::types::merge_string(
1370                    self.syntax.get_or_insert_with(::buffa::alloc::string::String::new),
1371                    buf,
1372                )?;
1373            }
1374            14u32 => {
1375                ::buffa::encoding::check_wire_type(
1376                    tag,
1377                    ::buffa::encoding::WireType::Varint,
1378                )?;
1379                let __raw = ::buffa::types::decode_int32(buf)?;
1380                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
1381                    __raw,
1382                ) {
1383                    self.edition = ::core::option::Option::Some(__v);
1384                } else {
1385                    ctx.register_unknown_field()?;
1386                    self.__buffa_unknown_fields
1387                        .push(::buffa::UnknownField {
1388                            number: 14u32,
1389                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
1390                        });
1391                }
1392            }
1393            15u32 => {
1394                ::buffa::encoding::check_wire_type(
1395                    tag,
1396                    ::buffa::encoding::WireType::LengthDelimited,
1397                )?;
1398                let __elem = ::buffa::types::decode_string(buf)?;
1399                ctx.register_element_memory(
1400                    ::buffa::__private::element_footprint(&__elem),
1401                )?;
1402                self.option_dependency.push(__elem);
1403            }
1404            _ => {
1405                self.__buffa_unknown_fields
1406                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1407            }
1408        }
1409        ::core::result::Result::Ok(())
1410    }
1411    fn clear(&mut self) {
1412        self.name = ::core::option::Option::None;
1413        self.package = ::core::option::Option::None;
1414        self.dependency.clear();
1415        self.message_type.clear();
1416        self.enum_type.clear();
1417        self.service.clear();
1418        self.extension.clear();
1419        self.options = ::buffa::MessageField::none();
1420        self.source_code_info = ::buffa::MessageField::none();
1421        self.public_dependency.clear();
1422        self.weak_dependency.clear();
1423        self.syntax = ::core::option::Option::None;
1424        self.edition = ::core::option::Option::None;
1425        self.option_dependency.clear();
1426        self.__buffa_unknown_fields.clear();
1427    }
1428}
1429impl ::buffa::ExtensionSet for FileDescriptorProto {
1430    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto";
1431    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1432        &self.__buffa_unknown_fields
1433    }
1434    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1435        &mut self.__buffa_unknown_fields
1436    }
1437}
1438#[cfg(feature = "text")]
1439impl ::buffa::text::TextFormat for FileDescriptorProto {
1440    fn encode_text(
1441        &self,
1442        enc: &mut ::buffa::text::TextEncoder<'_>,
1443    ) -> ::core::fmt::Result {
1444        #[allow(unused_imports)]
1445        use ::buffa::Enumeration as _;
1446        if let ::core::option::Option::Some(ref __v) = self.name {
1447            enc.write_field_name("name")?;
1448            enc.write_string(__v)?;
1449        }
1450        if let ::core::option::Option::Some(ref __v) = self.package {
1451            enc.write_field_name("package")?;
1452            enc.write_string(__v)?;
1453        }
1454        if self.options.is_set() {
1455            enc.write_field_name("options")?;
1456            enc.write_message(&*self.options)?;
1457        }
1458        if self.source_code_info.is_set() {
1459            enc.write_field_name("source_code_info")?;
1460            enc.write_message(&*self.source_code_info)?;
1461        }
1462        if let ::core::option::Option::Some(ref __v) = self.syntax {
1463            enc.write_field_name("syntax")?;
1464            enc.write_string(__v)?;
1465        }
1466        if let ::core::option::Option::Some(ref __v) = self.edition {
1467            enc.write_field_name("edition")?;
1468            enc.write_enum_name(__v.proto_name())?;
1469        }
1470        for __v in &self.dependency {
1471            enc.write_field_name("dependency")?;
1472            enc.write_string(__v)?;
1473        }
1474        for __v in &self.public_dependency {
1475            enc.write_field_name("public_dependency")?;
1476            enc.write_i32(*__v)?;
1477        }
1478        for __v in &self.weak_dependency {
1479            enc.write_field_name("weak_dependency")?;
1480            enc.write_i32(*__v)?;
1481        }
1482        for __v in &self.option_dependency {
1483            enc.write_field_name("option_dependency")?;
1484            enc.write_string(__v)?;
1485        }
1486        for __v in &self.message_type {
1487            enc.write_field_name("message_type")?;
1488            enc.write_message(__v)?;
1489        }
1490        for __v in &self.enum_type {
1491            enc.write_field_name("enum_type")?;
1492            enc.write_message(__v)?;
1493        }
1494        for __v in &self.service {
1495            enc.write_field_name("service")?;
1496            enc.write_message(__v)?;
1497        }
1498        for __v in &self.extension {
1499            enc.write_field_name("extension")?;
1500            enc.write_message(__v)?;
1501        }
1502        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1503        ::core::result::Result::Ok(())
1504    }
1505    fn merge_text(
1506        &mut self,
1507        dec: &mut ::buffa::text::TextDecoder<'_>,
1508    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1509        #[allow(unused_imports)]
1510        use ::buffa::Enumeration as _;
1511        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1512            match __name {
1513                "name" => {
1514                    self.name = ::core::option::Option::Some(
1515                        dec.read_string()?.into_owned(),
1516                    );
1517                }
1518                "package" => {
1519                    self.package = ::core::option::Option::Some(
1520                        dec.read_string()?.into_owned(),
1521                    );
1522                }
1523                "options" => dec.merge_message(self.options.get_or_insert_default())?,
1524                "source_code_info" => {
1525                    dec.merge_message(self.source_code_info.get_or_insert_default())?
1526                }
1527                "syntax" => {
1528                    self.syntax = ::core::option::Option::Some(
1529                        dec.read_string()?.into_owned(),
1530                    );
1531                }
1532                "edition" => {
1533                    self.edition = ::core::option::Option::Some(
1534                        dec.read_closed_enum_by_name::<Edition>()?,
1535                    );
1536                }
1537                "dependency" => {
1538                    dec.read_repeated_into(
1539                        &mut self.dependency,
1540                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1541                    )?
1542                }
1543                "public_dependency" => {
1544                    dec.read_repeated_into(
1545                        &mut self.public_dependency,
1546                        |__d| __d.read_i32(),
1547                    )?
1548                }
1549                "weak_dependency" => {
1550                    dec.read_repeated_into(
1551                        &mut self.weak_dependency,
1552                        |__d| __d.read_i32(),
1553                    )?
1554                }
1555                "option_dependency" => {
1556                    dec.read_repeated_into(
1557                        &mut self.option_dependency,
1558                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1559                    )?
1560                }
1561                "message_type" => {
1562                    dec.read_repeated_into(
1563                        &mut self.message_type,
1564                        |__d| {
1565                            let mut __m = ::core::default::Default::default();
1566                            __d.merge_message(&mut __m)?;
1567                            ::core::result::Result::Ok(__m)
1568                        },
1569                    )?
1570                }
1571                "enum_type" => {
1572                    dec.read_repeated_into(
1573                        &mut self.enum_type,
1574                        |__d| {
1575                            let mut __m = ::core::default::Default::default();
1576                            __d.merge_message(&mut __m)?;
1577                            ::core::result::Result::Ok(__m)
1578                        },
1579                    )?
1580                }
1581                "service" => {
1582                    dec.read_repeated_into(
1583                        &mut self.service,
1584                        |__d| {
1585                            let mut __m = ::core::default::Default::default();
1586                            __d.merge_message(&mut __m)?;
1587                            ::core::result::Result::Ok(__m)
1588                        },
1589                    )?
1590                }
1591                "extension" => {
1592                    dec.read_repeated_into(
1593                        &mut self.extension,
1594                        |__d| {
1595                            let mut __m = ::core::default::Default::default();
1596                            __d.merge_message(&mut __m)?;
1597                            ::core::result::Result::Ok(__m)
1598                        },
1599                    )?
1600                }
1601                _ => dec.skip_value()?,
1602            }
1603        }
1604        ::core::result::Result::Ok(())
1605    }
1606}
1607#[cfg(feature = "json")]
1608impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorProto {
1609    fn serialize_proto_json<S: ::serde::Serializer>(
1610        v: &Self,
1611        s: S,
1612    ) -> ::core::result::Result<S::Ok, S::Error> {
1613        ::serde::Serialize::serialize(v, s)
1614    }
1615    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1616        d: D,
1617    ) -> ::core::result::Result<Self, D::Error> {
1618        <Self as ::serde::Deserialize>::deserialize(d)
1619    }
1620}
1621#[cfg(feature = "json")]
1622#[doc(hidden)]
1623pub const __FILE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1624    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1625    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorProto>,
1626    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorProto>,
1627    is_wkt: false,
1628};
1629#[cfg(feature = "text")]
1630#[doc(hidden)]
1631pub const __FILE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1632    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1633    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorProto>,
1634    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorProto>,
1635};
1636/// Describes a message type.
1637#[derive(Clone, PartialEq, Default)]
1638#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
1639#[cfg_attr(feature = "json", serde(default))]
1640#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1641pub struct DescriptorProto {
1642    /// Field 1: `name`
1643    #[cfg_attr(
1644        feature = "json",
1645        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
1646    )]
1647    pub name: ::core::option::Option<::buffa::alloc::string::String>,
1648    /// Field 2: `field`
1649    #[cfg_attr(
1650        feature = "json",
1651        serde(
1652            rename = "field",
1653            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1654            deserialize_with = "::buffa::json_helpers::null_as_default"
1655        )
1656    )]
1657    pub field: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1658    /// Field 6: `extension`
1659    #[cfg_attr(
1660        feature = "json",
1661        serde(
1662            rename = "extension",
1663            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1664            deserialize_with = "::buffa::json_helpers::null_as_default"
1665        )
1666    )]
1667    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1668    /// Field 3: `nested_type`
1669    #[cfg_attr(
1670        feature = "json",
1671        serde(
1672            rename = "nestedType",
1673            alias = "nested_type",
1674            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1675            deserialize_with = "::buffa::json_helpers::null_as_default"
1676        )
1677    )]
1678    pub nested_type: ::buffa::alloc::vec::Vec<Self>,
1679    /// Field 4: `enum_type`
1680    #[cfg_attr(
1681        feature = "json",
1682        serde(
1683            rename = "enumType",
1684            alias = "enum_type",
1685            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1686            deserialize_with = "::buffa::json_helpers::null_as_default"
1687        )
1688    )]
1689    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
1690    /// Field 5: `extension_range`
1691    #[cfg_attr(
1692        feature = "json",
1693        serde(
1694            rename = "extensionRange",
1695            alias = "extension_range",
1696            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1697            deserialize_with = "::buffa::json_helpers::null_as_default"
1698        )
1699    )]
1700    pub extension_range: ::buffa::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
1701    /// Field 8: `oneof_decl`
1702    #[cfg_attr(
1703        feature = "json",
1704        serde(
1705            rename = "oneofDecl",
1706            alias = "oneof_decl",
1707            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1708            deserialize_with = "::buffa::json_helpers::null_as_default"
1709        )
1710    )]
1711    pub oneof_decl: ::buffa::alloc::vec::Vec<OneofDescriptorProto>,
1712    /// Field 7: `options`
1713    #[cfg_attr(
1714        feature = "json",
1715        serde(
1716            rename = "options",
1717            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1718        )
1719    )]
1720    pub options: ::buffa::MessageField<MessageOptions, ::buffa::Inline<MessageOptions>>,
1721    /// Field 9: `reserved_range`
1722    #[cfg_attr(
1723        feature = "json",
1724        serde(
1725            rename = "reservedRange",
1726            alias = "reserved_range",
1727            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1728            deserialize_with = "::buffa::json_helpers::null_as_default"
1729        )
1730    )]
1731    pub reserved_range: ::buffa::alloc::vec::Vec<descriptor_proto::ReservedRange>,
1732    /// Reserved field names, which may not be used by fields in the same message.
1733    /// A given name may only be reserved once.
1734    ///
1735    /// Field 10: `reserved_name`
1736    #[cfg_attr(
1737        feature = "json",
1738        serde(
1739            rename = "reservedName",
1740            alias = "reserved_name",
1741            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1742            deserialize_with = "::buffa::json_helpers::null_as_default"
1743        )
1744    )]
1745    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1746    /// Support for `export` and `local` keywords on enums.
1747    ///
1748    /// Field 11: `visibility`
1749    #[cfg_attr(
1750        feature = "json",
1751        serde(
1752            rename = "visibility",
1753            with = "::buffa::json_helpers::opt_closed_enum",
1754            skip_serializing_if = "::core::option::Option::is_none"
1755        )
1756    )]
1757    pub visibility: ::core::option::Option<SymbolVisibility>,
1758    #[cfg_attr(feature = "json", serde(skip))]
1759    #[doc(hidden)]
1760    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1761}
1762impl ::core::fmt::Debug for DescriptorProto {
1763    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1764        f.debug_struct("DescriptorProto")
1765            .field("name", &self.name)
1766            .field("field", &self.field)
1767            .field("extension", &self.extension)
1768            .field("nested_type", &self.nested_type)
1769            .field("enum_type", &self.enum_type)
1770            .field("extension_range", &self.extension_range)
1771            .field("oneof_decl", &self.oneof_decl)
1772            .field("options", &self.options)
1773            .field("reserved_range", &self.reserved_range)
1774            .field("reserved_name", &self.reserved_name)
1775            .field("visibility", &self.visibility)
1776            .finish()
1777    }
1778}
1779impl DescriptorProto {
1780    /// Protobuf type URL for this message, for use with `Any::pack` and
1781    /// `Any::unpack_if`.
1782    ///
1783    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1784    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1785}
1786impl DescriptorProto {
1787    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1788    #[inline]
1789    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
1790    pub fn with_name(
1791        mut self,
1792        value: impl Into<::buffa::alloc::string::String>,
1793    ) -> Self {
1794        self.name = Some(value.into());
1795        self
1796    }
1797    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1798    #[inline]
1799    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
1800    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
1801        self.visibility = Some(value.into());
1802        self
1803    }
1804}
1805::buffa::impl_default_instance!(DescriptorProto);
1806impl ::buffa::MessageName for DescriptorProto {
1807    const PACKAGE: &'static str = "google.protobuf";
1808    const NAME: &'static str = "DescriptorProto";
1809    const FULL_NAME: &'static str = "google.protobuf.DescriptorProto";
1810    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1811}
1812impl ::buffa::Message for DescriptorProto {
1813    /// Returns the total encoded size in bytes.
1814    ///
1815    /// Accumulates in `u64` (which cannot overflow for in-memory
1816    /// data) and saturates to `u32` at return, so a message whose
1817    /// encoded size exceeds the 2 GiB protobuf limit yields a value
1818    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
1819    /// points reject, never a silently wrapped size.
1820    #[allow(clippy::let_and_return)]
1821    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1822        #[allow(unused_imports)]
1823        use ::buffa::Enumeration as _;
1824        let mut size = 0u64;
1825        if let Some(ref v) = self.name {
1826            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1827        }
1828        for v in &self.field {
1829            let __slot = __cache.reserve();
1830            let inner_size = v.compute_size(__cache);
1831            __cache.set(__slot, inner_size);
1832            size
1833                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1834                    + inner_size as u64;
1835        }
1836        for v in &self.nested_type {
1837            let __slot = __cache.reserve();
1838            let inner_size = v.compute_size(__cache);
1839            __cache.set(__slot, inner_size);
1840            size
1841                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1842                    + inner_size as u64;
1843        }
1844        for v in &self.enum_type {
1845            let __slot = __cache.reserve();
1846            let inner_size = v.compute_size(__cache);
1847            __cache.set(__slot, inner_size);
1848            size
1849                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1850                    + inner_size as u64;
1851        }
1852        for v in &self.extension_range {
1853            let __slot = __cache.reserve();
1854            let inner_size = v.compute_size(__cache);
1855            __cache.set(__slot, inner_size);
1856            size
1857                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1858                    + inner_size as u64;
1859        }
1860        for v in &self.extension {
1861            let __slot = __cache.reserve();
1862            let inner_size = v.compute_size(__cache);
1863            __cache.set(__slot, inner_size);
1864            size
1865                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1866                    + inner_size as u64;
1867        }
1868        if self.options.is_set() {
1869            let __slot = __cache.reserve();
1870            let inner_size = self.options.compute_size(__cache);
1871            __cache.set(__slot, inner_size);
1872            size
1873                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1874                    + inner_size as u64;
1875        }
1876        for v in &self.oneof_decl {
1877            let __slot = __cache.reserve();
1878            let inner_size = v.compute_size(__cache);
1879            __cache.set(__slot, inner_size);
1880            size
1881                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1882                    + inner_size as u64;
1883        }
1884        for v in &self.reserved_range {
1885            let __slot = __cache.reserve();
1886            let inner_size = v.compute_size(__cache);
1887            __cache.set(__slot, inner_size);
1888            size
1889                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1890                    + inner_size as u64;
1891        }
1892        for v in &self.reserved_name {
1893            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1894        }
1895        if let Some(ref v) = self.visibility {
1896            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
1897        }
1898        size += self.__buffa_unknown_fields.encoded_len() as u64;
1899        ::buffa::saturate_size(size)
1900    }
1901    fn write_to(
1902        &self,
1903        __cache: &mut ::buffa::SizeCache,
1904        buf: &mut impl ::buffa::EncodeSink,
1905    ) {
1906        #[allow(unused_imports)]
1907        use ::buffa::Enumeration as _;
1908        if let Some(ref v) = self.name {
1909            ::buffa::types::put_string_field(1u32, v, buf);
1910        }
1911        for v in &self.field {
1912            ::buffa::types::put_len_delimited_header(
1913                2u32,
1914                u64::from(__cache.consume_next()),
1915                buf,
1916            );
1917            v.write_to(__cache, buf);
1918        }
1919        for v in &self.nested_type {
1920            ::buffa::types::put_len_delimited_header(
1921                3u32,
1922                u64::from(__cache.consume_next()),
1923                buf,
1924            );
1925            v.write_to(__cache, buf);
1926        }
1927        for v in &self.enum_type {
1928            ::buffa::types::put_len_delimited_header(
1929                4u32,
1930                u64::from(__cache.consume_next()),
1931                buf,
1932            );
1933            v.write_to(__cache, buf);
1934        }
1935        for v in &self.extension_range {
1936            ::buffa::types::put_len_delimited_header(
1937                5u32,
1938                u64::from(__cache.consume_next()),
1939                buf,
1940            );
1941            v.write_to(__cache, buf);
1942        }
1943        for v in &self.extension {
1944            ::buffa::types::put_len_delimited_header(
1945                6u32,
1946                u64::from(__cache.consume_next()),
1947                buf,
1948            );
1949            v.write_to(__cache, buf);
1950        }
1951        if self.options.is_set() {
1952            ::buffa::types::put_len_delimited_header(
1953                7u32,
1954                u64::from(__cache.consume_next()),
1955                buf,
1956            );
1957            self.options.write_to(__cache, buf);
1958        }
1959        for v in &self.oneof_decl {
1960            ::buffa::types::put_len_delimited_header(
1961                8u32,
1962                u64::from(__cache.consume_next()),
1963                buf,
1964            );
1965            v.write_to(__cache, buf);
1966        }
1967        for v in &self.reserved_range {
1968            ::buffa::types::put_len_delimited_header(
1969                9u32,
1970                u64::from(__cache.consume_next()),
1971                buf,
1972            );
1973            v.write_to(__cache, buf);
1974        }
1975        for v in &self.reserved_name {
1976            ::buffa::types::put_string_field(10u32, v, buf);
1977        }
1978        if let Some(ref v) = self.visibility {
1979            ::buffa::types::put_int32_field(11u32, v.to_i32(), buf);
1980        }
1981        self.__buffa_unknown_fields.write_to(buf);
1982    }
1983    fn merge_field(
1984        &mut self,
1985        tag: ::buffa::encoding::Tag,
1986        buf: &mut impl ::buffa::bytes::Buf,
1987        ctx: ::buffa::DecodeContext<'_>,
1988    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1989        #[allow(unused_imports)]
1990        use ::buffa::bytes::Buf as _;
1991        #[allow(unused_imports)]
1992        use ::buffa::Enumeration as _;
1993        match tag.field_number() {
1994            1u32 => {
1995                ::buffa::encoding::check_wire_type(
1996                    tag,
1997                    ::buffa::encoding::WireType::LengthDelimited,
1998                )?;
1999                ::buffa::types::merge_string(
2000                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
2001                    buf,
2002                )?;
2003            }
2004            2u32 => {
2005                ::buffa::encoding::check_wire_type(
2006                    tag,
2007                    ::buffa::encoding::WireType::LengthDelimited,
2008                )?;
2009                let mut elem = ::core::default::Default::default();
2010                ctx.register_element_memory(
2011                    ::buffa::__private::element_footprint(&elem),
2012                )?;
2013                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2014                self.field.push(elem);
2015            }
2016            3u32 => {
2017                ::buffa::encoding::check_wire_type(
2018                    tag,
2019                    ::buffa::encoding::WireType::LengthDelimited,
2020                )?;
2021                let mut elem = ::core::default::Default::default();
2022                ctx.register_element_memory(
2023                    ::buffa::__private::element_footprint(&elem),
2024                )?;
2025                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2026                self.nested_type.push(elem);
2027            }
2028            4u32 => {
2029                ::buffa::encoding::check_wire_type(
2030                    tag,
2031                    ::buffa::encoding::WireType::LengthDelimited,
2032                )?;
2033                let mut elem = ::core::default::Default::default();
2034                ctx.register_element_memory(
2035                    ::buffa::__private::element_footprint(&elem),
2036                )?;
2037                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2038                self.enum_type.push(elem);
2039            }
2040            5u32 => {
2041                ::buffa::encoding::check_wire_type(
2042                    tag,
2043                    ::buffa::encoding::WireType::LengthDelimited,
2044                )?;
2045                let mut elem = ::core::default::Default::default();
2046                ctx.register_element_memory(
2047                    ::buffa::__private::element_footprint(&elem),
2048                )?;
2049                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2050                self.extension_range.push(elem);
2051            }
2052            6u32 => {
2053                ::buffa::encoding::check_wire_type(
2054                    tag,
2055                    ::buffa::encoding::WireType::LengthDelimited,
2056                )?;
2057                let mut elem = ::core::default::Default::default();
2058                ctx.register_element_memory(
2059                    ::buffa::__private::element_footprint(&elem),
2060                )?;
2061                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2062                self.extension.push(elem);
2063            }
2064            7u32 => {
2065                ::buffa::encoding::check_wire_type(
2066                    tag,
2067                    ::buffa::encoding::WireType::LengthDelimited,
2068                )?;
2069                ::buffa::Message::merge_length_delimited(
2070                    self.options.get_or_insert_default(),
2071                    buf,
2072                    ctx,
2073                )?;
2074            }
2075            8u32 => {
2076                ::buffa::encoding::check_wire_type(
2077                    tag,
2078                    ::buffa::encoding::WireType::LengthDelimited,
2079                )?;
2080                let mut elem = ::core::default::Default::default();
2081                ctx.register_element_memory(
2082                    ::buffa::__private::element_footprint(&elem),
2083                )?;
2084                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2085                self.oneof_decl.push(elem);
2086            }
2087            9u32 => {
2088                ::buffa::encoding::check_wire_type(
2089                    tag,
2090                    ::buffa::encoding::WireType::LengthDelimited,
2091                )?;
2092                let mut elem = ::core::default::Default::default();
2093                ctx.register_element_memory(
2094                    ::buffa::__private::element_footprint(&elem),
2095                )?;
2096                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2097                self.reserved_range.push(elem);
2098            }
2099            10u32 => {
2100                ::buffa::encoding::check_wire_type(
2101                    tag,
2102                    ::buffa::encoding::WireType::LengthDelimited,
2103                )?;
2104                let __elem = ::buffa::types::decode_string(buf)?;
2105                ctx.register_element_memory(
2106                    ::buffa::__private::element_footprint(&__elem),
2107                )?;
2108                self.reserved_name.push(__elem);
2109            }
2110            11u32 => {
2111                ::buffa::encoding::check_wire_type(
2112                    tag,
2113                    ::buffa::encoding::WireType::Varint,
2114                )?;
2115                let __raw = ::buffa::types::decode_int32(buf)?;
2116                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
2117                    __raw,
2118                ) {
2119                    self.visibility = ::core::option::Option::Some(__v);
2120                } else {
2121                    ctx.register_unknown_field()?;
2122                    self.__buffa_unknown_fields
2123                        .push(::buffa::UnknownField {
2124                            number: 11u32,
2125                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
2126                        });
2127                }
2128            }
2129            _ => {
2130                self.__buffa_unknown_fields
2131                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2132            }
2133        }
2134        ::core::result::Result::Ok(())
2135    }
2136    fn clear(&mut self) {
2137        self.name = ::core::option::Option::None;
2138        self.field.clear();
2139        self.nested_type.clear();
2140        self.enum_type.clear();
2141        self.extension_range.clear();
2142        self.extension.clear();
2143        self.options = ::buffa::MessageField::none();
2144        self.oneof_decl.clear();
2145        self.reserved_range.clear();
2146        self.reserved_name.clear();
2147        self.visibility = ::core::option::Option::None;
2148        self.__buffa_unknown_fields.clear();
2149    }
2150}
2151impl ::buffa::ExtensionSet for DescriptorProto {
2152    const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto";
2153    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2154        &self.__buffa_unknown_fields
2155    }
2156    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2157        &mut self.__buffa_unknown_fields
2158    }
2159}
2160#[cfg(feature = "text")]
2161impl ::buffa::text::TextFormat for DescriptorProto {
2162    fn encode_text(
2163        &self,
2164        enc: &mut ::buffa::text::TextEncoder<'_>,
2165    ) -> ::core::fmt::Result {
2166        #[allow(unused_imports)]
2167        use ::buffa::Enumeration as _;
2168        if let ::core::option::Option::Some(ref __v) = self.name {
2169            enc.write_field_name("name")?;
2170            enc.write_string(__v)?;
2171        }
2172        if self.options.is_set() {
2173            enc.write_field_name("options")?;
2174            enc.write_message(&*self.options)?;
2175        }
2176        if let ::core::option::Option::Some(ref __v) = self.visibility {
2177            enc.write_field_name("visibility")?;
2178            enc.write_enum_name(__v.proto_name())?;
2179        }
2180        for __v in &self.field {
2181            enc.write_field_name("field")?;
2182            enc.write_message(__v)?;
2183        }
2184        for __v in &self.extension {
2185            enc.write_field_name("extension")?;
2186            enc.write_message(__v)?;
2187        }
2188        for __v in &self.nested_type {
2189            enc.write_field_name("nested_type")?;
2190            enc.write_message(__v)?;
2191        }
2192        for __v in &self.enum_type {
2193            enc.write_field_name("enum_type")?;
2194            enc.write_message(__v)?;
2195        }
2196        for __v in &self.extension_range {
2197            enc.write_field_name("extension_range")?;
2198            enc.write_message(__v)?;
2199        }
2200        for __v in &self.oneof_decl {
2201            enc.write_field_name("oneof_decl")?;
2202            enc.write_message(__v)?;
2203        }
2204        for __v in &self.reserved_range {
2205            enc.write_field_name("reserved_range")?;
2206            enc.write_message(__v)?;
2207        }
2208        for __v in &self.reserved_name {
2209            enc.write_field_name("reserved_name")?;
2210            enc.write_string(__v)?;
2211        }
2212        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2213        ::core::result::Result::Ok(())
2214    }
2215    fn merge_text(
2216        &mut self,
2217        dec: &mut ::buffa::text::TextDecoder<'_>,
2218    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2219        #[allow(unused_imports)]
2220        use ::buffa::Enumeration as _;
2221        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2222            match __name {
2223                "name" => {
2224                    self.name = ::core::option::Option::Some(
2225                        dec.read_string()?.into_owned(),
2226                    );
2227                }
2228                "options" => dec.merge_message(self.options.get_or_insert_default())?,
2229                "visibility" => {
2230                    self.visibility = ::core::option::Option::Some(
2231                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
2232                    );
2233                }
2234                "field" => {
2235                    dec.read_repeated_into(
2236                        &mut self.field,
2237                        |__d| {
2238                            let mut __m = ::core::default::Default::default();
2239                            __d.merge_message(&mut __m)?;
2240                            ::core::result::Result::Ok(__m)
2241                        },
2242                    )?
2243                }
2244                "extension" => {
2245                    dec.read_repeated_into(
2246                        &mut self.extension,
2247                        |__d| {
2248                            let mut __m = ::core::default::Default::default();
2249                            __d.merge_message(&mut __m)?;
2250                            ::core::result::Result::Ok(__m)
2251                        },
2252                    )?
2253                }
2254                "nested_type" => {
2255                    dec.read_repeated_into(
2256                        &mut self.nested_type,
2257                        |__d| {
2258                            let mut __m = ::core::default::Default::default();
2259                            __d.merge_message(&mut __m)?;
2260                            ::core::result::Result::Ok(__m)
2261                        },
2262                    )?
2263                }
2264                "enum_type" => {
2265                    dec.read_repeated_into(
2266                        &mut self.enum_type,
2267                        |__d| {
2268                            let mut __m = ::core::default::Default::default();
2269                            __d.merge_message(&mut __m)?;
2270                            ::core::result::Result::Ok(__m)
2271                        },
2272                    )?
2273                }
2274                "extension_range" => {
2275                    dec.read_repeated_into(
2276                        &mut self.extension_range,
2277                        |__d| {
2278                            let mut __m = ::core::default::Default::default();
2279                            __d.merge_message(&mut __m)?;
2280                            ::core::result::Result::Ok(__m)
2281                        },
2282                    )?
2283                }
2284                "oneof_decl" => {
2285                    dec.read_repeated_into(
2286                        &mut self.oneof_decl,
2287                        |__d| {
2288                            let mut __m = ::core::default::Default::default();
2289                            __d.merge_message(&mut __m)?;
2290                            ::core::result::Result::Ok(__m)
2291                        },
2292                    )?
2293                }
2294                "reserved_range" => {
2295                    dec.read_repeated_into(
2296                        &mut self.reserved_range,
2297                        |__d| {
2298                            let mut __m = ::core::default::Default::default();
2299                            __d.merge_message(&mut __m)?;
2300                            ::core::result::Result::Ok(__m)
2301                        },
2302                    )?
2303                }
2304                "reserved_name" => {
2305                    dec.read_repeated_into(
2306                        &mut self.reserved_name,
2307                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
2308                    )?
2309                }
2310                _ => dec.skip_value()?,
2311            }
2312        }
2313        ::core::result::Result::Ok(())
2314    }
2315}
2316#[cfg(feature = "json")]
2317impl ::buffa::json_helpers::ProtoElemJson for DescriptorProto {
2318    fn serialize_proto_json<S: ::serde::Serializer>(
2319        v: &Self,
2320        s: S,
2321    ) -> ::core::result::Result<S::Ok, S::Error> {
2322        ::serde::Serialize::serialize(v, s)
2323    }
2324    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2325        d: D,
2326    ) -> ::core::result::Result<Self, D::Error> {
2327        <Self as ::serde::Deserialize>::deserialize(d)
2328    }
2329}
2330#[cfg(feature = "json")]
2331#[doc(hidden)]
2332pub const __DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2333    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2334    to_json: ::buffa::type_registry::any_to_json::<DescriptorProto>,
2335    from_json: ::buffa::type_registry::any_from_json::<DescriptorProto>,
2336    is_wkt: false,
2337};
2338#[cfg(feature = "text")]
2339#[doc(hidden)]
2340pub const __DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2341    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2342    text_encode: ::buffa::type_registry::any_encode_text::<DescriptorProto>,
2343    text_merge: ::buffa::type_registry::any_merge_text::<DescriptorProto>,
2344};
2345pub mod descriptor_proto {
2346    #[allow(unused_imports)]
2347    use super::*;
2348    #[derive(Clone, PartialEq, Default)]
2349    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2350    #[cfg_attr(feature = "json", serde(default))]
2351    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2352    pub struct ExtensionRange {
2353        /// Inclusive.
2354        ///
2355        /// Field 1: `start`
2356        #[cfg_attr(
2357            feature = "json",
2358            serde(
2359                rename = "start",
2360                with = "::buffa::json_helpers::opt_int32",
2361                skip_serializing_if = "::core::option::Option::is_none"
2362            )
2363        )]
2364        pub start: ::core::option::Option<i32>,
2365        /// Exclusive.
2366        ///
2367        /// Field 2: `end`
2368        #[cfg_attr(
2369            feature = "json",
2370            serde(
2371                rename = "end",
2372                with = "::buffa::json_helpers::opt_int32",
2373                skip_serializing_if = "::core::option::Option::is_none"
2374            )
2375        )]
2376        pub end: ::core::option::Option<i32>,
2377        /// Field 3: `options`
2378        #[cfg_attr(
2379            feature = "json",
2380            serde(
2381                rename = "options",
2382                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2383            )
2384        )]
2385        pub options: ::buffa::MessageField<
2386            super::ExtensionRangeOptions,
2387            ::buffa::Inline<super::ExtensionRangeOptions>,
2388        >,
2389        #[cfg_attr(feature = "json", serde(skip))]
2390        #[doc(hidden)]
2391        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2392    }
2393    impl ::core::fmt::Debug for ExtensionRange {
2394        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2395            f.debug_struct("ExtensionRange")
2396                .field("start", &self.start)
2397                .field("end", &self.end)
2398                .field("options", &self.options)
2399                .finish()
2400        }
2401    }
2402    impl ExtensionRange {
2403        /// Protobuf type URL for this message, for use with `Any::pack` and
2404        /// `Any::unpack_if`.
2405        ///
2406        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2407        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2408    }
2409    impl ExtensionRange {
2410        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2411        #[inline]
2412        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2413        pub fn with_start(mut self, value: i32) -> Self {
2414            self.start = Some(value);
2415            self
2416        }
2417        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2418        #[inline]
2419        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2420        pub fn with_end(mut self, value: i32) -> Self {
2421            self.end = Some(value);
2422            self
2423        }
2424    }
2425    ::buffa::impl_default_instance!(ExtensionRange);
2426    impl ::buffa::MessageName for ExtensionRange {
2427        const PACKAGE: &'static str = "google.protobuf";
2428        const NAME: &'static str = "DescriptorProto.ExtensionRange";
2429        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2430        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2431    }
2432    impl ::buffa::Message for ExtensionRange {
2433        /// Returns the total encoded size in bytes.
2434        ///
2435        /// Accumulates in `u64` (which cannot overflow for in-memory
2436        /// data) and saturates to `u32` at return, so a message whose
2437        /// encoded size exceeds the 2 GiB protobuf limit yields a value
2438        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2439        /// points reject, never a silently wrapped size.
2440        #[allow(clippy::let_and_return)]
2441        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2442            #[allow(unused_imports)]
2443            use ::buffa::Enumeration as _;
2444            let mut size = 0u64;
2445            if let Some(v) = self.start {
2446                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2447            }
2448            if let Some(v) = self.end {
2449                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2450            }
2451            if self.options.is_set() {
2452                let __slot = __cache.reserve();
2453                let inner_size = self.options.compute_size(__cache);
2454                __cache.set(__slot, inner_size);
2455                size
2456                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2457                        + inner_size as u64;
2458            }
2459            size += self.__buffa_unknown_fields.encoded_len() as u64;
2460            ::buffa::saturate_size(size)
2461        }
2462        fn write_to(
2463            &self,
2464            __cache: &mut ::buffa::SizeCache,
2465            buf: &mut impl ::buffa::EncodeSink,
2466        ) {
2467            #[allow(unused_imports)]
2468            use ::buffa::Enumeration as _;
2469            if let Some(v) = self.start {
2470                ::buffa::types::put_int32_field(1u32, v, buf);
2471            }
2472            if let Some(v) = self.end {
2473                ::buffa::types::put_int32_field(2u32, v, buf);
2474            }
2475            if self.options.is_set() {
2476                ::buffa::types::put_len_delimited_header(
2477                    3u32,
2478                    u64::from(__cache.consume_next()),
2479                    buf,
2480                );
2481                self.options.write_to(__cache, buf);
2482            }
2483            self.__buffa_unknown_fields.write_to(buf);
2484        }
2485        fn merge_field(
2486            &mut self,
2487            tag: ::buffa::encoding::Tag,
2488            buf: &mut impl ::buffa::bytes::Buf,
2489            ctx: ::buffa::DecodeContext<'_>,
2490        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2491            #[allow(unused_imports)]
2492            use ::buffa::bytes::Buf as _;
2493            #[allow(unused_imports)]
2494            use ::buffa::Enumeration as _;
2495            match tag.field_number() {
2496                1u32 => {
2497                    ::buffa::encoding::check_wire_type(
2498                        tag,
2499                        ::buffa::encoding::WireType::Varint,
2500                    )?;
2501                    self.start = ::core::option::Option::Some(
2502                        ::buffa::types::decode_int32(buf)?,
2503                    );
2504                }
2505                2u32 => {
2506                    ::buffa::encoding::check_wire_type(
2507                        tag,
2508                        ::buffa::encoding::WireType::Varint,
2509                    )?;
2510                    self.end = ::core::option::Option::Some(
2511                        ::buffa::types::decode_int32(buf)?,
2512                    );
2513                }
2514                3u32 => {
2515                    ::buffa::encoding::check_wire_type(
2516                        tag,
2517                        ::buffa::encoding::WireType::LengthDelimited,
2518                    )?;
2519                    ::buffa::Message::merge_length_delimited(
2520                        self.options.get_or_insert_default(),
2521                        buf,
2522                        ctx,
2523                    )?;
2524                }
2525                _ => {
2526                    self.__buffa_unknown_fields
2527                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2528                }
2529            }
2530            ::core::result::Result::Ok(())
2531        }
2532        fn clear(&mut self) {
2533            self.start = ::core::option::Option::None;
2534            self.end = ::core::option::Option::None;
2535            self.options = ::buffa::MessageField::none();
2536            self.__buffa_unknown_fields.clear();
2537        }
2538    }
2539    impl ::buffa::ExtensionSet for ExtensionRange {
2540        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2541        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2542            &self.__buffa_unknown_fields
2543        }
2544        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2545            &mut self.__buffa_unknown_fields
2546        }
2547    }
2548    #[cfg(feature = "text")]
2549    impl ::buffa::text::TextFormat for ExtensionRange {
2550        fn encode_text(
2551            &self,
2552            enc: &mut ::buffa::text::TextEncoder<'_>,
2553        ) -> ::core::fmt::Result {
2554            #[allow(unused_imports)]
2555            use ::buffa::Enumeration as _;
2556            if let ::core::option::Option::Some(ref __v) = self.start {
2557                enc.write_field_name("start")?;
2558                enc.write_i32(*__v)?;
2559            }
2560            if let ::core::option::Option::Some(ref __v) = self.end {
2561                enc.write_field_name("end")?;
2562                enc.write_i32(*__v)?;
2563            }
2564            if self.options.is_set() {
2565                enc.write_field_name("options")?;
2566                enc.write_message(&*self.options)?;
2567            }
2568            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2569            ::core::result::Result::Ok(())
2570        }
2571        fn merge_text(
2572            &mut self,
2573            dec: &mut ::buffa::text::TextDecoder<'_>,
2574        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2575            #[allow(unused_imports)]
2576            use ::buffa::Enumeration as _;
2577            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2578                match __name {
2579                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2580                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2581                    "options" => dec.merge_message(self.options.get_or_insert_default())?,
2582                    _ => dec.skip_value()?,
2583                }
2584            }
2585            ::core::result::Result::Ok(())
2586        }
2587    }
2588    #[cfg(feature = "json")]
2589    impl ::buffa::json_helpers::ProtoElemJson for ExtensionRange {
2590        fn serialize_proto_json<S: ::serde::Serializer>(
2591            v: &Self,
2592            s: S,
2593        ) -> ::core::result::Result<S::Ok, S::Error> {
2594            ::serde::Serialize::serialize(v, s)
2595        }
2596        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2597            d: D,
2598        ) -> ::core::result::Result<Self, D::Error> {
2599            <Self as ::serde::Deserialize>::deserialize(d)
2600        }
2601    }
2602    #[cfg(feature = "json")]
2603    #[doc(hidden)]
2604    pub const __EXTENSION_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2605        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2606        to_json: ::buffa::type_registry::any_to_json::<ExtensionRange>,
2607        from_json: ::buffa::type_registry::any_from_json::<ExtensionRange>,
2608        is_wkt: false,
2609    };
2610    #[cfg(feature = "text")]
2611    #[doc(hidden)]
2612    pub const __EXTENSION_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2613        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2614        text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRange>,
2615        text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRange>,
2616    };
2617    /// Range of reserved tag numbers. Reserved tag numbers may not be used by
2618    /// fields or extension ranges in the same message. Reserved ranges may
2619    /// not overlap.
2620    #[derive(Clone, PartialEq, Default)]
2621    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2622    #[cfg_attr(feature = "json", serde(default))]
2623    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2624    pub struct ReservedRange {
2625        /// Inclusive.
2626        ///
2627        /// Field 1: `start`
2628        #[cfg_attr(
2629            feature = "json",
2630            serde(
2631                rename = "start",
2632                with = "::buffa::json_helpers::opt_int32",
2633                skip_serializing_if = "::core::option::Option::is_none"
2634            )
2635        )]
2636        pub start: ::core::option::Option<i32>,
2637        /// Exclusive.
2638        ///
2639        /// Field 2: `end`
2640        #[cfg_attr(
2641            feature = "json",
2642            serde(
2643                rename = "end",
2644                with = "::buffa::json_helpers::opt_int32",
2645                skip_serializing_if = "::core::option::Option::is_none"
2646            )
2647        )]
2648        pub end: ::core::option::Option<i32>,
2649        #[cfg_attr(feature = "json", serde(skip))]
2650        #[doc(hidden)]
2651        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2652    }
2653    impl ::core::fmt::Debug for ReservedRange {
2654        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2655            f.debug_struct("ReservedRange")
2656                .field("start", &self.start)
2657                .field("end", &self.end)
2658                .finish()
2659        }
2660    }
2661    impl ReservedRange {
2662        /// Protobuf type URL for this message, for use with `Any::pack` and
2663        /// `Any::unpack_if`.
2664        ///
2665        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2666        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2667    }
2668    impl ReservedRange {
2669        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2670        #[inline]
2671        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2672        pub fn with_start(mut self, value: i32) -> Self {
2673            self.start = Some(value);
2674            self
2675        }
2676        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2677        #[inline]
2678        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2679        pub fn with_end(mut self, value: i32) -> Self {
2680            self.end = Some(value);
2681            self
2682        }
2683    }
2684    ::buffa::impl_default_instance!(ReservedRange);
2685    impl ::buffa::MessageName for ReservedRange {
2686        const PACKAGE: &'static str = "google.protobuf";
2687        const NAME: &'static str = "DescriptorProto.ReservedRange";
2688        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2689        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2690    }
2691    impl ::buffa::Message for ReservedRange {
2692        /// Returns the total encoded size in bytes.
2693        ///
2694        /// Accumulates in `u64` (which cannot overflow for in-memory
2695        /// data) and saturates to `u32` at return, so a message whose
2696        /// encoded size exceeds the 2 GiB protobuf limit yields a value
2697        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2698        /// points reject, never a silently wrapped size.
2699        #[allow(clippy::let_and_return)]
2700        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2701            #[allow(unused_imports)]
2702            use ::buffa::Enumeration as _;
2703            let mut size = 0u64;
2704            if let Some(v) = self.start {
2705                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2706            }
2707            if let Some(v) = self.end {
2708                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2709            }
2710            size += self.__buffa_unknown_fields.encoded_len() as u64;
2711            ::buffa::saturate_size(size)
2712        }
2713        fn write_to(
2714            &self,
2715            _cache: &mut ::buffa::SizeCache,
2716            buf: &mut impl ::buffa::EncodeSink,
2717        ) {
2718            #[allow(unused_imports)]
2719            use ::buffa::Enumeration as _;
2720            if let Some(v) = self.start {
2721                ::buffa::types::put_int32_field(1u32, v, buf);
2722            }
2723            if let Some(v) = self.end {
2724                ::buffa::types::put_int32_field(2u32, v, buf);
2725            }
2726            self.__buffa_unknown_fields.write_to(buf);
2727        }
2728        fn merge_field(
2729            &mut self,
2730            tag: ::buffa::encoding::Tag,
2731            buf: &mut impl ::buffa::bytes::Buf,
2732            ctx: ::buffa::DecodeContext<'_>,
2733        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2734            #[allow(unused_imports)]
2735            use ::buffa::bytes::Buf as _;
2736            #[allow(unused_imports)]
2737            use ::buffa::Enumeration as _;
2738            match tag.field_number() {
2739                1u32 => {
2740                    ::buffa::encoding::check_wire_type(
2741                        tag,
2742                        ::buffa::encoding::WireType::Varint,
2743                    )?;
2744                    self.start = ::core::option::Option::Some(
2745                        ::buffa::types::decode_int32(buf)?,
2746                    );
2747                }
2748                2u32 => {
2749                    ::buffa::encoding::check_wire_type(
2750                        tag,
2751                        ::buffa::encoding::WireType::Varint,
2752                    )?;
2753                    self.end = ::core::option::Option::Some(
2754                        ::buffa::types::decode_int32(buf)?,
2755                    );
2756                }
2757                _ => {
2758                    self.__buffa_unknown_fields
2759                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2760                }
2761            }
2762            ::core::result::Result::Ok(())
2763        }
2764        fn clear(&mut self) {
2765            self.start = ::core::option::Option::None;
2766            self.end = ::core::option::Option::None;
2767            self.__buffa_unknown_fields.clear();
2768        }
2769    }
2770    impl ::buffa::ExtensionSet for ReservedRange {
2771        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2772        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2773            &self.__buffa_unknown_fields
2774        }
2775        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2776            &mut self.__buffa_unknown_fields
2777        }
2778    }
2779    #[cfg(feature = "text")]
2780    impl ::buffa::text::TextFormat for ReservedRange {
2781        fn encode_text(
2782            &self,
2783            enc: &mut ::buffa::text::TextEncoder<'_>,
2784        ) -> ::core::fmt::Result {
2785            #[allow(unused_imports)]
2786            use ::buffa::Enumeration as _;
2787            if let ::core::option::Option::Some(ref __v) = self.start {
2788                enc.write_field_name("start")?;
2789                enc.write_i32(*__v)?;
2790            }
2791            if let ::core::option::Option::Some(ref __v) = self.end {
2792                enc.write_field_name("end")?;
2793                enc.write_i32(*__v)?;
2794            }
2795            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2796            ::core::result::Result::Ok(())
2797        }
2798        fn merge_text(
2799            &mut self,
2800            dec: &mut ::buffa::text::TextDecoder<'_>,
2801        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2802            #[allow(unused_imports)]
2803            use ::buffa::Enumeration as _;
2804            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2805                match __name {
2806                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2807                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2808                    _ => dec.skip_value()?,
2809                }
2810            }
2811            ::core::result::Result::Ok(())
2812        }
2813    }
2814    #[cfg(feature = "json")]
2815    impl ::buffa::json_helpers::ProtoElemJson for ReservedRange {
2816        fn serialize_proto_json<S: ::serde::Serializer>(
2817            v: &Self,
2818            s: S,
2819        ) -> ::core::result::Result<S::Ok, S::Error> {
2820            ::serde::Serialize::serialize(v, s)
2821        }
2822        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2823            d: D,
2824        ) -> ::core::result::Result<Self, D::Error> {
2825            <Self as ::serde::Deserialize>::deserialize(d)
2826        }
2827    }
2828    #[cfg(feature = "json")]
2829    #[doc(hidden)]
2830    pub const __RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2831        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2832        to_json: ::buffa::type_registry::any_to_json::<ReservedRange>,
2833        from_json: ::buffa::type_registry::any_from_json::<ReservedRange>,
2834        is_wkt: false,
2835    };
2836    #[cfg(feature = "text")]
2837    #[doc(hidden)]
2838    pub const __RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2839        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2840        text_encode: ::buffa::type_registry::any_encode_text::<ReservedRange>,
2841        text_merge: ::buffa::type_registry::any_merge_text::<ReservedRange>,
2842    };
2843    #[cfg(feature = "views")]
2844    #[doc(inline)]
2845    pub use super::__buffa::view::descriptor_proto::ExtensionRangeView;
2846    #[cfg(feature = "views")]
2847    #[doc(inline)]
2848    pub use super::__buffa::view::descriptor_proto::ExtensionRangeOwnedView;
2849    #[cfg(feature = "views")]
2850    #[doc(inline)]
2851    pub use super::__buffa::view::descriptor_proto::ReservedRangeView;
2852    #[cfg(feature = "views")]
2853    #[doc(inline)]
2854    pub use super::__buffa::view::descriptor_proto::ReservedRangeOwnedView;
2855}
2856#[derive(Clone, PartialEq, Default)]
2857#[cfg_attr(feature = "json", derive(::serde::Serialize))]
2858#[cfg_attr(feature = "json", serde(default))]
2859#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2860pub struct ExtensionRangeOptions {
2861    /// The parser stores options it doesn't recognize here. See above.
2862    ///
2863    /// Field 999: `uninterpreted_option`
2864    #[cfg_attr(
2865        feature = "json",
2866        serde(
2867            rename = "uninterpretedOption",
2868            alias = "uninterpreted_option",
2869            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2870            deserialize_with = "::buffa::json_helpers::null_as_default"
2871        )
2872    )]
2873    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
2874    /// For external users: DO NOT USE. We are in the process of open sourcing
2875    /// extension declaration and executing internal cleanups before it can be
2876    /// used externally.
2877    ///
2878    /// Field 2: `declaration`
2879    #[cfg_attr(
2880        feature = "json",
2881        serde(
2882            rename = "declaration",
2883            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2884            deserialize_with = "::buffa::json_helpers::null_as_default"
2885        )
2886    )]
2887    pub declaration: ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
2888    /// Any features defined in the specific edition.
2889    ///
2890    /// Field 50: `features`
2891    #[cfg_attr(
2892        feature = "json",
2893        serde(
2894            rename = "features",
2895            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2896        )
2897    )]
2898    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
2899    /// The verification state of the range.
2900    /// TODO: flip the default to DECLARATION once all empty ranges
2901    /// are marked as UNVERIFIED.
2902    ///
2903    /// Field 3: `verification`
2904    #[cfg_attr(
2905        feature = "json",
2906        serde(
2907            rename = "verification",
2908            with = "::buffa::json_helpers::opt_closed_enum",
2909            skip_serializing_if = "::core::option::Option::is_none"
2910        )
2911    )]
2912    pub verification: ::core::option::Option<extension_range_options::VerificationState>,
2913    #[cfg_attr(feature = "json", serde(flatten))]
2914    #[doc(hidden)]
2915    pub __buffa_unknown_fields: __ExtensionRangeOptionsExtJson,
2916}
2917impl ::core::fmt::Debug for ExtensionRangeOptions {
2918    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2919        f.debug_struct("ExtensionRangeOptions")
2920            .field("uninterpreted_option", &self.uninterpreted_option)
2921            .field("declaration", &self.declaration)
2922            .field("features", &self.features)
2923            .field("verification", &self.verification)
2924            .finish()
2925    }
2926}
2927impl ExtensionRangeOptions {
2928    /// Protobuf type URL for this message, for use with `Any::pack` and
2929    /// `Any::unpack_if`.
2930    ///
2931    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2932    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2933}
2934impl ExtensionRangeOptions {
2935    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2936    #[inline]
2937    ///Sets [`Self::verification`] to `Some(value)`, consuming and returning `self`.
2938    pub fn with_verification(
2939        mut self,
2940        value: impl Into<extension_range_options::VerificationState>,
2941    ) -> Self {
2942        self.verification = Some(value.into());
2943        self
2944    }
2945}
2946::buffa::impl_default_instance!(ExtensionRangeOptions);
2947impl ::buffa::MessageName for ExtensionRangeOptions {
2948    const PACKAGE: &'static str = "google.protobuf";
2949    const NAME: &'static str = "ExtensionRangeOptions";
2950    const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions";
2951    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2952}
2953impl ::buffa::Message for ExtensionRangeOptions {
2954    /// Returns the total encoded size in bytes.
2955    ///
2956    /// Accumulates in `u64` (which cannot overflow for in-memory
2957    /// data) and saturates to `u32` at return, so a message whose
2958    /// encoded size exceeds the 2 GiB protobuf limit yields a value
2959    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2960    /// points reject, never a silently wrapped size.
2961    #[allow(clippy::let_and_return)]
2962    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2963        #[allow(unused_imports)]
2964        use ::buffa::Enumeration as _;
2965        let mut size = 0u64;
2966        for v in &self.declaration {
2967            let __slot = __cache.reserve();
2968            let inner_size = v.compute_size(__cache);
2969            __cache.set(__slot, inner_size);
2970            size
2971                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2972                    + inner_size as u64;
2973        }
2974        if let Some(ref v) = self.verification {
2975            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
2976        }
2977        if self.features.is_set() {
2978            let __slot = __cache.reserve();
2979            let inner_size = self.features.compute_size(__cache);
2980            __cache.set(__slot, inner_size);
2981            size
2982                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2983                    + inner_size as u64;
2984        }
2985        for v in &self.uninterpreted_option {
2986            let __slot = __cache.reserve();
2987            let inner_size = v.compute_size(__cache);
2988            __cache.set(__slot, inner_size);
2989            size
2990                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2991                    + inner_size as u64;
2992        }
2993        size += self.__buffa_unknown_fields.encoded_len() as u64;
2994        ::buffa::saturate_size(size)
2995    }
2996    fn write_to(
2997        &self,
2998        __cache: &mut ::buffa::SizeCache,
2999        buf: &mut impl ::buffa::EncodeSink,
3000    ) {
3001        #[allow(unused_imports)]
3002        use ::buffa::Enumeration as _;
3003        for v in &self.declaration {
3004            ::buffa::types::put_len_delimited_header(
3005                2u32,
3006                u64::from(__cache.consume_next()),
3007                buf,
3008            );
3009            v.write_to(__cache, buf);
3010        }
3011        if let Some(ref v) = self.verification {
3012            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
3013        }
3014        if self.features.is_set() {
3015            ::buffa::types::put_len_delimited_header(
3016                50u32,
3017                u64::from(__cache.consume_next()),
3018                buf,
3019            );
3020            self.features.write_to(__cache, buf);
3021        }
3022        for v in &self.uninterpreted_option {
3023            ::buffa::types::put_len_delimited_header(
3024                999u32,
3025                u64::from(__cache.consume_next()),
3026                buf,
3027            );
3028            v.write_to(__cache, buf);
3029        }
3030        self.__buffa_unknown_fields.write_to(buf);
3031    }
3032    fn merge_field(
3033        &mut self,
3034        tag: ::buffa::encoding::Tag,
3035        buf: &mut impl ::buffa::bytes::Buf,
3036        ctx: ::buffa::DecodeContext<'_>,
3037    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3038        #[allow(unused_imports)]
3039        use ::buffa::bytes::Buf as _;
3040        #[allow(unused_imports)]
3041        use ::buffa::Enumeration as _;
3042        match tag.field_number() {
3043            2u32 => {
3044                ::buffa::encoding::check_wire_type(
3045                    tag,
3046                    ::buffa::encoding::WireType::LengthDelimited,
3047                )?;
3048                let mut elem = ::core::default::Default::default();
3049                ctx.register_element_memory(
3050                    ::buffa::__private::element_footprint(&elem),
3051                )?;
3052                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
3053                self.declaration.push(elem);
3054            }
3055            3u32 => {
3056                ::buffa::encoding::check_wire_type(
3057                    tag,
3058                    ::buffa::encoding::WireType::Varint,
3059                )?;
3060                let __raw = ::buffa::types::decode_int32(buf)?;
3061                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
3062                    __raw,
3063                ) {
3064                    self.verification = ::core::option::Option::Some(__v);
3065                } else {
3066                    ctx.register_unknown_field()?;
3067                    self.__buffa_unknown_fields
3068                        .push(::buffa::UnknownField {
3069                            number: 3u32,
3070                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
3071                        });
3072                }
3073            }
3074            50u32 => {
3075                ::buffa::encoding::check_wire_type(
3076                    tag,
3077                    ::buffa::encoding::WireType::LengthDelimited,
3078                )?;
3079                ::buffa::Message::merge_length_delimited(
3080                    self.features.get_or_insert_default(),
3081                    buf,
3082                    ctx,
3083                )?;
3084            }
3085            999u32 => {
3086                ::buffa::encoding::check_wire_type(
3087                    tag,
3088                    ::buffa::encoding::WireType::LengthDelimited,
3089                )?;
3090                let mut elem = ::core::default::Default::default();
3091                ctx.register_element_memory(
3092                    ::buffa::__private::element_footprint(&elem),
3093                )?;
3094                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
3095                self.uninterpreted_option.push(elem);
3096            }
3097            _ => {
3098                self.__buffa_unknown_fields
3099                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3100            }
3101        }
3102        ::core::result::Result::Ok(())
3103    }
3104    fn clear(&mut self) {
3105        self.declaration.clear();
3106        self.verification = ::core::option::Option::None;
3107        self.features = ::buffa::MessageField::none();
3108        self.uninterpreted_option.clear();
3109        self.__buffa_unknown_fields.clear();
3110    }
3111}
3112impl ::buffa::ExtensionSet for ExtensionRangeOptions {
3113    const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions";
3114    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3115        &self.__buffa_unknown_fields
3116    }
3117    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3118        &mut self.__buffa_unknown_fields
3119    }
3120}
3121#[cfg(feature = "text")]
3122impl ::buffa::text::TextFormat for ExtensionRangeOptions {
3123    fn encode_text(
3124        &self,
3125        enc: &mut ::buffa::text::TextEncoder<'_>,
3126    ) -> ::core::fmt::Result {
3127        #[allow(unused_imports)]
3128        use ::buffa::Enumeration as _;
3129        if self.features.is_set() {
3130            enc.write_field_name("features")?;
3131            enc.write_message(&*self.features)?;
3132        }
3133        if let ::core::option::Option::Some(ref __v) = self.verification {
3134            enc.write_field_name("verification")?;
3135            enc.write_enum_name(__v.proto_name())?;
3136        }
3137        for __v in &self.uninterpreted_option {
3138            enc.write_field_name("uninterpreted_option")?;
3139            enc.write_message(__v)?;
3140        }
3141        for __v in &self.declaration {
3142            enc.write_field_name("declaration")?;
3143            enc.write_message(__v)?;
3144        }
3145        enc.write_extension_fields(
3146            "google.protobuf.ExtensionRangeOptions",
3147            &self.__buffa_unknown_fields,
3148        )?;
3149        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3150        ::core::result::Result::Ok(())
3151    }
3152    fn merge_text(
3153        &mut self,
3154        dec: &mut ::buffa::text::TextDecoder<'_>,
3155    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3156        #[allow(unused_imports)]
3157        use ::buffa::Enumeration as _;
3158        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3159            match __name {
3160                "features" => dec.merge_message(self.features.get_or_insert_default())?,
3161                "verification" => {
3162                    self.verification = ::core::option::Option::Some(
3163                        dec
3164                            .read_closed_enum_by_name::<
3165                                extension_range_options::VerificationState,
3166                            >()?,
3167                    );
3168                }
3169                "uninterpreted_option" => {
3170                    dec.read_repeated_into(
3171                        &mut self.uninterpreted_option,
3172                        |__d| {
3173                            let mut __m = ::core::default::Default::default();
3174                            __d.merge_message(&mut __m)?;
3175                            ::core::result::Result::Ok(__m)
3176                        },
3177                    )?
3178                }
3179                "declaration" => {
3180                    dec.read_repeated_into(
3181                        &mut self.declaration,
3182                        |__d| {
3183                            let mut __m = ::core::default::Default::default();
3184                            __d.merge_message(&mut __m)?;
3185                            ::core::result::Result::Ok(__m)
3186                        },
3187                    )?
3188                }
3189                __name if __name.starts_with('[') => {
3190                    for __r in dec
3191                        .read_extension(__name, "google.protobuf.ExtensionRangeOptions")?
3192                    {
3193                        self.__buffa_unknown_fields.push(__r);
3194                    }
3195                }
3196                _ => dec.skip_value()?,
3197            }
3198        }
3199        ::core::result::Result::Ok(())
3200    }
3201}
3202#[cfg(feature = "json")]
3203impl<'de> ::serde::Deserialize<'de> for ExtensionRangeOptions {
3204    fn deserialize<D: ::serde::Deserializer<'de>>(
3205        d: D,
3206    ) -> ::core::result::Result<Self, D::Error> {
3207        struct _V;
3208        impl<'de> ::serde::de::Visitor<'de> for _V {
3209            type Value = ExtensionRangeOptions;
3210            fn expecting(
3211                &self,
3212                f: &mut ::core::fmt::Formatter<'_>,
3213            ) -> ::core::fmt::Result {
3214                f.write_str("struct ExtensionRangeOptions")
3215            }
3216            #[allow(clippy::field_reassign_with_default)]
3217            fn visit_map<A: ::serde::de::MapAccess<'de>>(
3218                self,
3219                mut map: A,
3220            ) -> ::core::result::Result<ExtensionRangeOptions, A::Error> {
3221                let mut __f_uninterpreted_option: ::core::option::Option<
3222                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
3223                > = None;
3224                let mut __f_declaration: ::core::option::Option<
3225                    ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
3226                > = None;
3227                let mut __f_features: ::core::option::Option<
3228                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
3229                > = None;
3230                let mut __f_verification: ::core::option::Option<
3231                    ::core::option::Option<extension_range_options::VerificationState>,
3232                > = None;
3233                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
3234                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
3235                    match key.as_str() {
3236                        "uninterpretedOption" | "uninterpreted_option" => {
3237                            __f_uninterpreted_option = Some({
3238                                struct _S;
3239                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
3240                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
3241                                    fn deserialize<D: ::serde::Deserializer<'de>>(
3242                                        self,
3243                                        d: D,
3244                                    ) -> ::core::result::Result<
3245                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
3246                                        D::Error,
3247                                    > {
3248                                        ::buffa::json_helpers::null_as_default(d)
3249                                    }
3250                                }
3251                                map.next_value_seed(_S)?
3252                            });
3253                        }
3254                        "declaration" => {
3255                            __f_declaration = Some({
3256                                struct _S;
3257                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
3258                                    type Value = ::buffa::alloc::vec::Vec<
3259                                        extension_range_options::Declaration,
3260                                    >;
3261                                    fn deserialize<D: ::serde::Deserializer<'de>>(
3262                                        self,
3263                                        d: D,
3264                                    ) -> ::core::result::Result<
3265                                        ::buffa::alloc::vec::Vec<
3266                                            extension_range_options::Declaration,
3267                                        >,
3268                                        D::Error,
3269                                    > {
3270                                        ::buffa::json_helpers::null_as_default(d)
3271                                    }
3272                                }
3273                                map.next_value_seed(_S)?
3274                            });
3275                        }
3276                        "features" => {
3277                            __f_features = Some(
3278                                map
3279                                    .next_value::<
3280                                        ::buffa::MessageField<
3281                                            FeatureSet,
3282                                            ::buffa::Inline<FeatureSet>,
3283                                        >,
3284                                    >()?,
3285                            );
3286                        }
3287                        "verification" => {
3288                            __f_verification = Some({
3289                                struct _S;
3290                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
3291                                    type Value = ::core::option::Option<
3292                                        extension_range_options::VerificationState,
3293                                    >;
3294                                    fn deserialize<D: ::serde::Deserializer<'de>>(
3295                                        self,
3296                                        d: D,
3297                                    ) -> ::core::result::Result<
3298                                        ::core::option::Option<
3299                                            extension_range_options::VerificationState,
3300                                        >,
3301                                        D::Error,
3302                                    > {
3303                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
3304                                    }
3305                                }
3306                                map.next_value_seed(_S)?
3307                            });
3308                        }
3309                        __k if __k.starts_with('[') => {
3310                            let __v: ::buffa::serde_json::Value = map.next_value()?;
3311                            match ::buffa::extension_registry::deserialize_extension_key(
3312                                "google.protobuf.ExtensionRangeOptions",
3313                                __k,
3314                                __v,
3315                            ) {
3316                                ::core::option::Option::Some(
3317                                    ::core::result::Result::Ok(__recs),
3318                                ) => {
3319                                    for __rec in __recs {
3320                                        __ext_records.push(__rec);
3321                                    }
3322                                }
3323                                ::core::option::Option::Some(
3324                                    ::core::result::Result::Err(__e),
3325                                ) => {
3326                                    return ::core::result::Result::Err(
3327                                        <A::Error as ::serde::de::Error>::custom(__e),
3328                                    );
3329                                }
3330                                ::core::option::Option::None => {}
3331                            }
3332                        }
3333                        _ => {
3334                            map.next_value::<::serde::de::IgnoredAny>()?;
3335                        }
3336                    }
3337                }
3338                let mut __r = <ExtensionRangeOptions as ::core::default::Default>::default();
3339                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
3340                    __r.uninterpreted_option = v;
3341                }
3342                if let ::core::option::Option::Some(v) = __f_declaration {
3343                    __r.declaration = v;
3344                }
3345                if let ::core::option::Option::Some(v) = __f_features {
3346                    __r.features = v;
3347                }
3348                if let ::core::option::Option::Some(v) = __f_verification {
3349                    __r.verification = v;
3350                }
3351                for __rec in __ext_records {
3352                    __r.__buffa_unknown_fields.push(__rec);
3353                }
3354                Ok(__r)
3355            }
3356        }
3357        d.deserialize_map(_V)
3358    }
3359}
3360#[cfg(feature = "json")]
3361impl ::buffa::json_helpers::ProtoElemJson for ExtensionRangeOptions {
3362    fn serialize_proto_json<S: ::serde::Serializer>(
3363        v: &Self,
3364        s: S,
3365    ) -> ::core::result::Result<S::Ok, S::Error> {
3366        ::serde::Serialize::serialize(v, s)
3367    }
3368    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3369        d: D,
3370    ) -> ::core::result::Result<Self, D::Error> {
3371        <Self as ::serde::Deserialize>::deserialize(d)
3372    }
3373}
3374#[doc(hidden)]
3375#[derive(Clone, Debug, Default, PartialEq)]
3376#[repr(transparent)]
3377#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3378pub struct __ExtensionRangeOptionsExtJson(pub ::buffa::UnknownFields);
3379impl ::core::ops::Deref for __ExtensionRangeOptionsExtJson {
3380    type Target = ::buffa::UnknownFields;
3381    fn deref(&self) -> &::buffa::UnknownFields {
3382        &self.0
3383    }
3384}
3385impl ::core::ops::DerefMut for __ExtensionRangeOptionsExtJson {
3386    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
3387        &mut self.0
3388    }
3389}
3390impl ::core::convert::From<::buffa::UnknownFields> for __ExtensionRangeOptionsExtJson {
3391    fn from(u: ::buffa::UnknownFields) -> Self {
3392        Self(u)
3393    }
3394}
3395#[cfg(feature = "json")]
3396impl ::serde::Serialize for __ExtensionRangeOptionsExtJson {
3397    fn serialize<S: ::serde::Serializer>(
3398        &self,
3399        s: S,
3400    ) -> ::core::result::Result<S::Ok, S::Error> {
3401        ::buffa::extension_registry::serialize_extensions(
3402            "google.protobuf.ExtensionRangeOptions",
3403            &self.0,
3404            s,
3405        )
3406    }
3407}
3408#[cfg(feature = "json")]
3409impl<'de> ::serde::Deserialize<'de> for __ExtensionRangeOptionsExtJson {
3410    fn deserialize<D: ::serde::Deserializer<'de>>(
3411        d: D,
3412    ) -> ::core::result::Result<Self, D::Error> {
3413        ::buffa::extension_registry::deserialize_extensions(
3414                "google.protobuf.ExtensionRangeOptions",
3415                d,
3416            )
3417            .map(Self)
3418    }
3419}
3420#[cfg(feature = "json")]
3421#[doc(hidden)]
3422pub const __EXTENSION_RANGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3423    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3424    to_json: ::buffa::type_registry::any_to_json::<ExtensionRangeOptions>,
3425    from_json: ::buffa::type_registry::any_from_json::<ExtensionRangeOptions>,
3426    is_wkt: false,
3427};
3428#[cfg(feature = "text")]
3429#[doc(hidden)]
3430pub const __EXTENSION_RANGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3431    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3432    text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRangeOptions>,
3433    text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRangeOptions>,
3434};
3435pub mod extension_range_options {
3436    #[allow(unused_imports)]
3437    use super::*;
3438    /// The verification state of the extension range.
3439    #[allow(non_camel_case_types)]
3440    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
3441    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3442    #[repr(i32)]
3443    pub enum VerificationState {
3444        /// All the extensions of the range must be declared.
3445        DECLARATION = 0i32,
3446        UNVERIFIED = 1i32,
3447    }
3448    impl VerificationState {
3449        ///Idiomatic alias for [`Self::DECLARATION`]; `Debug` prints the variant name.
3450        #[allow(non_upper_case_globals)]
3451        pub const Declaration: Self = Self::DECLARATION;
3452        ///Idiomatic alias for [`Self::UNVERIFIED`]; `Debug` prints the variant name.
3453        #[allow(non_upper_case_globals)]
3454        pub const Unverified: Self = Self::UNVERIFIED;
3455    }
3456    impl ::core::default::Default for VerificationState {
3457        fn default() -> Self {
3458            Self::DECLARATION
3459        }
3460    }
3461    #[cfg(feature = "json")]
3462    const _: () = {
3463        impl ::serde::Serialize for VerificationState {
3464            fn serialize<S: ::serde::Serializer>(
3465                &self,
3466                s: S,
3467            ) -> ::core::result::Result<S::Ok, S::Error> {
3468                s.serialize_str(::buffa::Enumeration::proto_name(self))
3469            }
3470        }
3471        impl<'de> ::serde::Deserialize<'de> for VerificationState {
3472            fn deserialize<D: ::serde::Deserializer<'de>>(
3473                d: D,
3474            ) -> ::core::result::Result<Self, D::Error> {
3475                struct _V;
3476                impl ::serde::de::Visitor<'_> for _V {
3477                    type Value = VerificationState;
3478                    fn expecting(
3479                        &self,
3480                        f: &mut ::core::fmt::Formatter<'_>,
3481                    ) -> ::core::fmt::Result {
3482                        f.write_str(
3483                            concat!(
3484                                "a string, integer, or null for ",
3485                                stringify!(VerificationState)
3486                            ),
3487                        )
3488                    }
3489                    fn visit_str<E: ::serde::de::Error>(
3490                        self,
3491                        v: &str,
3492                    ) -> ::core::result::Result<VerificationState, E> {
3493                        <VerificationState as ::buffa::Enumeration>::from_proto_name(v)
3494                            .ok_or_else(|| {
3495                                ::serde::de::Error::unknown_variant(v, &[])
3496                            })
3497                    }
3498                    fn visit_i64<E: ::serde::de::Error>(
3499                        self,
3500                        v: i64,
3501                    ) -> ::core::result::Result<VerificationState, E> {
3502                        let v32 = i32::try_from(v)
3503                            .map_err(|_| {
3504                                ::serde::de::Error::custom(
3505                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3506                                )
3507                            })?;
3508                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3509                            .ok_or_else(|| {
3510                                ::serde::de::Error::custom(
3511                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3512                                )
3513                            })
3514                    }
3515                    fn visit_u64<E: ::serde::de::Error>(
3516                        self,
3517                        v: u64,
3518                    ) -> ::core::result::Result<VerificationState, E> {
3519                        let v32 = i32::try_from(v)
3520                            .map_err(|_| {
3521                                ::serde::de::Error::custom(
3522                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3523                                )
3524                            })?;
3525                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3526                            .ok_or_else(|| {
3527                                ::serde::de::Error::custom(
3528                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3529                                )
3530                            })
3531                    }
3532                    fn visit_unit<E: ::serde::de::Error>(
3533                        self,
3534                    ) -> ::core::result::Result<VerificationState, E> {
3535                        ::core::result::Result::Ok(::core::default::Default::default())
3536                    }
3537                }
3538                d.deserialize_any(_V)
3539            }
3540        }
3541        impl ::buffa::json_helpers::ProtoElemJson for VerificationState {
3542            fn serialize_proto_json<S: ::serde::Serializer>(
3543                v: &Self,
3544                s: S,
3545            ) -> ::core::result::Result<S::Ok, S::Error> {
3546                ::serde::Serialize::serialize(v, s)
3547            }
3548            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3549                d: D,
3550            ) -> ::core::result::Result<Self, D::Error> {
3551                <Self as ::serde::Deserialize>::deserialize(d)
3552            }
3553        }
3554    };
3555    impl ::buffa::Enumeration for VerificationState {
3556        fn from_i32(value: i32) -> ::core::option::Option<Self> {
3557            match value {
3558                0i32 => ::core::option::Option::Some(Self::DECLARATION),
3559                1i32 => ::core::option::Option::Some(Self::UNVERIFIED),
3560                _ => ::core::option::Option::None,
3561            }
3562        }
3563        fn to_i32(&self) -> i32 {
3564            *self as i32
3565        }
3566        fn proto_name(&self) -> &'static str {
3567            match self {
3568                Self::DECLARATION => "DECLARATION",
3569                Self::UNVERIFIED => "UNVERIFIED",
3570            }
3571        }
3572        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
3573            match name {
3574                "DECLARATION" => ::core::option::Option::Some(Self::DECLARATION),
3575                "UNVERIFIED" => ::core::option::Option::Some(Self::UNVERIFIED),
3576                _ => ::core::option::Option::None,
3577            }
3578        }
3579        fn values() -> &'static [Self] {
3580            &[Self::DECLARATION, Self::UNVERIFIED]
3581        }
3582    }
3583    #[derive(Clone, PartialEq, Default)]
3584    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3585    #[cfg_attr(feature = "json", serde(default))]
3586    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3587    pub struct Declaration {
3588        /// The extension number declared within the extension range.
3589        ///
3590        /// Field 1: `number`
3591        #[cfg_attr(
3592            feature = "json",
3593            serde(
3594                rename = "number",
3595                with = "::buffa::json_helpers::opt_int32",
3596                skip_serializing_if = "::core::option::Option::is_none"
3597            )
3598        )]
3599        pub number: ::core::option::Option<i32>,
3600        /// The fully-qualified name of the extension field. There must be a leading
3601        /// dot in front of the full name.
3602        ///
3603        /// Field 2: `full_name`
3604        #[cfg_attr(
3605            feature = "json",
3606            serde(
3607                rename = "fullName",
3608                alias = "full_name",
3609                skip_serializing_if = "::core::option::Option::is_none"
3610            )
3611        )]
3612        pub full_name: ::core::option::Option<::buffa::alloc::string::String>,
3613        /// The fully-qualified type name of the extension field. Unlike
3614        /// Metadata.type, Declaration.type must have a leading dot for messages
3615        /// and enums.
3616        ///
3617        /// Field 3: `type`
3618        #[cfg_attr(
3619            feature = "json",
3620            serde(
3621                rename = "type",
3622                skip_serializing_if = "::core::option::Option::is_none"
3623            )
3624        )]
3625        pub r#type: ::core::option::Option<::buffa::alloc::string::String>,
3626        /// If true, indicates that the number is reserved in the extension range,
3627        /// and any extension field with the number will fail to compile. Set this
3628        /// when a declared extension field is deleted.
3629        ///
3630        /// Field 5: `reserved`
3631        #[cfg_attr(
3632            feature = "json",
3633            serde(
3634                rename = "reserved",
3635                skip_serializing_if = "::core::option::Option::is_none"
3636            )
3637        )]
3638        pub reserved: ::core::option::Option<bool>,
3639        /// If true, indicates that the extension must be defined as repeated.
3640        /// Otherwise the extension must be defined as optional.
3641        ///
3642        /// Field 6: `repeated`
3643        #[cfg_attr(
3644            feature = "json",
3645            serde(
3646                rename = "repeated",
3647                skip_serializing_if = "::core::option::Option::is_none"
3648            )
3649        )]
3650        pub repeated: ::core::option::Option<bool>,
3651        #[cfg_attr(feature = "json", serde(skip))]
3652        #[doc(hidden)]
3653        pub __buffa_unknown_fields: ::buffa::UnknownFields,
3654    }
3655    impl ::core::fmt::Debug for Declaration {
3656        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3657            f.debug_struct("Declaration")
3658                .field("number", &self.number)
3659                .field("full_name", &self.full_name)
3660                .field("type", &self.r#type)
3661                .field("reserved", &self.reserved)
3662                .field("repeated", &self.repeated)
3663                .finish()
3664        }
3665    }
3666    impl Declaration {
3667        /// Protobuf type URL for this message, for use with `Any::pack` and
3668        /// `Any::unpack_if`.
3669        ///
3670        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3671        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3672    }
3673    impl Declaration {
3674        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3675        #[inline]
3676        ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
3677        pub fn with_number(mut self, value: i32) -> Self {
3678            self.number = Some(value);
3679            self
3680        }
3681        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3682        #[inline]
3683        ///Sets [`Self::full_name`] to `Some(value)`, consuming and returning `self`.
3684        pub fn with_full_name(
3685            mut self,
3686            value: impl Into<::buffa::alloc::string::String>,
3687        ) -> Self {
3688            self.full_name = Some(value.into());
3689            self
3690        }
3691        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3692        #[inline]
3693        ///Sets `type` to `Some(value)`, consuming and returning `self`.
3694        pub fn with_type(
3695            mut self,
3696            value: impl Into<::buffa::alloc::string::String>,
3697        ) -> Self {
3698            self.r#type = Some(value.into());
3699            self
3700        }
3701        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3702        #[inline]
3703        ///Sets [`Self::reserved`] to `Some(value)`, consuming and returning `self`.
3704        pub fn with_reserved(mut self, value: bool) -> Self {
3705            self.reserved = Some(value);
3706            self
3707        }
3708        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3709        #[inline]
3710        ///Sets [`Self::repeated`] to `Some(value)`, consuming and returning `self`.
3711        pub fn with_repeated(mut self, value: bool) -> Self {
3712            self.repeated = Some(value);
3713            self
3714        }
3715    }
3716    ::buffa::impl_default_instance!(Declaration);
3717    impl ::buffa::MessageName for Declaration {
3718        const PACKAGE: &'static str = "google.protobuf";
3719        const NAME: &'static str = "ExtensionRangeOptions.Declaration";
3720        const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3721        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3722    }
3723    impl ::buffa::Message for Declaration {
3724        /// Returns the total encoded size in bytes.
3725        ///
3726        /// Accumulates in `u64` (which cannot overflow for in-memory
3727        /// data) and saturates to `u32` at return, so a message whose
3728        /// encoded size exceeds the 2 GiB protobuf limit yields a value
3729        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
3730        /// points reject, never a silently wrapped size.
3731        #[allow(clippy::let_and_return)]
3732        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3733            #[allow(unused_imports)]
3734            use ::buffa::Enumeration as _;
3735            let mut size = 0u64;
3736            if let Some(v) = self.number {
3737                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
3738            }
3739            if let Some(ref v) = self.full_name {
3740                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
3741            }
3742            if let Some(ref v) = self.r#type {
3743                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
3744            }
3745            if self.reserved.is_some() {
3746                size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
3747            }
3748            if self.repeated.is_some() {
3749                size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
3750            }
3751            size += self.__buffa_unknown_fields.encoded_len() as u64;
3752            ::buffa::saturate_size(size)
3753        }
3754        fn write_to(
3755            &self,
3756            _cache: &mut ::buffa::SizeCache,
3757            buf: &mut impl ::buffa::EncodeSink,
3758        ) {
3759            #[allow(unused_imports)]
3760            use ::buffa::Enumeration as _;
3761            if let Some(v) = self.number {
3762                ::buffa::types::put_int32_field(1u32, v, buf);
3763            }
3764            if let Some(ref v) = self.full_name {
3765                ::buffa::types::put_string_field(2u32, v, buf);
3766            }
3767            if let Some(ref v) = self.r#type {
3768                ::buffa::types::put_string_field(3u32, v, buf);
3769            }
3770            if let Some(v) = self.reserved {
3771                ::buffa::types::put_bool_field(5u32, v, buf);
3772            }
3773            if let Some(v) = self.repeated {
3774                ::buffa::types::put_bool_field(6u32, v, buf);
3775            }
3776            self.__buffa_unknown_fields.write_to(buf);
3777        }
3778        fn merge_field(
3779            &mut self,
3780            tag: ::buffa::encoding::Tag,
3781            buf: &mut impl ::buffa::bytes::Buf,
3782            ctx: ::buffa::DecodeContext<'_>,
3783        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3784            #[allow(unused_imports)]
3785            use ::buffa::bytes::Buf as _;
3786            #[allow(unused_imports)]
3787            use ::buffa::Enumeration as _;
3788            match tag.field_number() {
3789                1u32 => {
3790                    ::buffa::encoding::check_wire_type(
3791                        tag,
3792                        ::buffa::encoding::WireType::Varint,
3793                    )?;
3794                    self.number = ::core::option::Option::Some(
3795                        ::buffa::types::decode_int32(buf)?,
3796                    );
3797                }
3798                2u32 => {
3799                    ::buffa::encoding::check_wire_type(
3800                        tag,
3801                        ::buffa::encoding::WireType::LengthDelimited,
3802                    )?;
3803                    ::buffa::types::merge_string(
3804                        self
3805                            .full_name
3806                            .get_or_insert_with(::buffa::alloc::string::String::new),
3807                        buf,
3808                    )?;
3809                }
3810                3u32 => {
3811                    ::buffa::encoding::check_wire_type(
3812                        tag,
3813                        ::buffa::encoding::WireType::LengthDelimited,
3814                    )?;
3815                    ::buffa::types::merge_string(
3816                        self
3817                            .r#type
3818                            .get_or_insert_with(::buffa::alloc::string::String::new),
3819                        buf,
3820                    )?;
3821                }
3822                5u32 => {
3823                    ::buffa::encoding::check_wire_type(
3824                        tag,
3825                        ::buffa::encoding::WireType::Varint,
3826                    )?;
3827                    self.reserved = ::core::option::Option::Some(
3828                        ::buffa::types::decode_bool(buf)?,
3829                    );
3830                }
3831                6u32 => {
3832                    ::buffa::encoding::check_wire_type(
3833                        tag,
3834                        ::buffa::encoding::WireType::Varint,
3835                    )?;
3836                    self.repeated = ::core::option::Option::Some(
3837                        ::buffa::types::decode_bool(buf)?,
3838                    );
3839                }
3840                _ => {
3841                    self.__buffa_unknown_fields
3842                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3843                }
3844            }
3845            ::core::result::Result::Ok(())
3846        }
3847        fn clear(&mut self) {
3848            self.number = ::core::option::Option::None;
3849            self.full_name = ::core::option::Option::None;
3850            self.r#type = ::core::option::Option::None;
3851            self.reserved = ::core::option::Option::None;
3852            self.repeated = ::core::option::Option::None;
3853            self.__buffa_unknown_fields.clear();
3854        }
3855    }
3856    impl ::buffa::ExtensionSet for Declaration {
3857        const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3858        fn unknown_fields(&self) -> &::buffa::UnknownFields {
3859            &self.__buffa_unknown_fields
3860        }
3861        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3862            &mut self.__buffa_unknown_fields
3863        }
3864    }
3865    #[cfg(feature = "text")]
3866    impl ::buffa::text::TextFormat for Declaration {
3867        fn encode_text(
3868            &self,
3869            enc: &mut ::buffa::text::TextEncoder<'_>,
3870        ) -> ::core::fmt::Result {
3871            #[allow(unused_imports)]
3872            use ::buffa::Enumeration as _;
3873            if let ::core::option::Option::Some(ref __v) = self.number {
3874                enc.write_field_name("number")?;
3875                enc.write_i32(*__v)?;
3876            }
3877            if let ::core::option::Option::Some(ref __v) = self.full_name {
3878                enc.write_field_name("full_name")?;
3879                enc.write_string(__v)?;
3880            }
3881            if let ::core::option::Option::Some(ref __v) = self.r#type {
3882                enc.write_field_name("type")?;
3883                enc.write_string(__v)?;
3884            }
3885            if let ::core::option::Option::Some(ref __v) = self.reserved {
3886                enc.write_field_name("reserved")?;
3887                enc.write_bool(*__v)?;
3888            }
3889            if let ::core::option::Option::Some(ref __v) = self.repeated {
3890                enc.write_field_name("repeated")?;
3891                enc.write_bool(*__v)?;
3892            }
3893            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3894            ::core::result::Result::Ok(())
3895        }
3896        fn merge_text(
3897            &mut self,
3898            dec: &mut ::buffa::text::TextDecoder<'_>,
3899        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3900            #[allow(unused_imports)]
3901            use ::buffa::Enumeration as _;
3902            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3903                match __name {
3904                    "number" => {
3905                        self.number = ::core::option::Option::Some(dec.read_i32()?);
3906                    }
3907                    "full_name" => {
3908                        self.full_name = ::core::option::Option::Some(
3909                            dec.read_string()?.into_owned(),
3910                        );
3911                    }
3912                    "type" => {
3913                        self.r#type = ::core::option::Option::Some(
3914                            dec.read_string()?.into_owned(),
3915                        );
3916                    }
3917                    "reserved" => {
3918                        self.reserved = ::core::option::Option::Some(dec.read_bool()?);
3919                    }
3920                    "repeated" => {
3921                        self.repeated = ::core::option::Option::Some(dec.read_bool()?);
3922                    }
3923                    _ => dec.skip_value()?,
3924                }
3925            }
3926            ::core::result::Result::Ok(())
3927        }
3928    }
3929    #[cfg(feature = "json")]
3930    impl ::buffa::json_helpers::ProtoElemJson for Declaration {
3931        fn serialize_proto_json<S: ::serde::Serializer>(
3932            v: &Self,
3933            s: S,
3934        ) -> ::core::result::Result<S::Ok, S::Error> {
3935            ::serde::Serialize::serialize(v, s)
3936        }
3937        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3938            d: D,
3939        ) -> ::core::result::Result<Self, D::Error> {
3940            <Self as ::serde::Deserialize>::deserialize(d)
3941        }
3942    }
3943    #[cfg(feature = "json")]
3944    #[doc(hidden)]
3945    pub const __DECLARATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3946        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3947        to_json: ::buffa::type_registry::any_to_json::<Declaration>,
3948        from_json: ::buffa::type_registry::any_from_json::<Declaration>,
3949        is_wkt: false,
3950    };
3951    #[cfg(feature = "text")]
3952    #[doc(hidden)]
3953    pub const __DECLARATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3954        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3955        text_encode: ::buffa::type_registry::any_encode_text::<Declaration>,
3956        text_merge: ::buffa::type_registry::any_merge_text::<Declaration>,
3957    };
3958    #[cfg(feature = "views")]
3959    #[doc(inline)]
3960    pub use super::__buffa::view::extension_range_options::DeclarationView;
3961    #[cfg(feature = "views")]
3962    #[doc(inline)]
3963    pub use super::__buffa::view::extension_range_options::DeclarationOwnedView;
3964}
3965/// Describes a field within a message.
3966#[derive(Clone, PartialEq, Default)]
3967#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3968#[cfg_attr(feature = "json", serde(default))]
3969#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3970pub struct FieldDescriptorProto {
3971    /// Field 1: `name`
3972    #[cfg_attr(
3973        feature = "json",
3974        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
3975    )]
3976    pub name: ::core::option::Option<::buffa::alloc::string::String>,
3977    /// Field 3: `number`
3978    #[cfg_attr(
3979        feature = "json",
3980        serde(
3981            rename = "number",
3982            with = "::buffa::json_helpers::opt_int32",
3983            skip_serializing_if = "::core::option::Option::is_none"
3984        )
3985    )]
3986    pub number: ::core::option::Option<i32>,
3987    /// Field 4: `label`
3988    #[cfg_attr(
3989        feature = "json",
3990        serde(
3991            rename = "label",
3992            with = "::buffa::json_helpers::opt_closed_enum",
3993            skip_serializing_if = "::core::option::Option::is_none"
3994        )
3995    )]
3996    pub label: ::core::option::Option<field_descriptor_proto::Label>,
3997    /// If type_name is set, this need not be set.  If both this and type_name
3998    /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
3999    ///
4000    /// Field 5: `type`
4001    #[cfg_attr(
4002        feature = "json",
4003        serde(
4004            rename = "type",
4005            with = "::buffa::json_helpers::opt_closed_enum",
4006            skip_serializing_if = "::core::option::Option::is_none"
4007        )
4008    )]
4009    pub r#type: ::core::option::Option<field_descriptor_proto::Type>,
4010    /// For message and enum types, this is the name of the type.  If the name
4011    /// starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
4012    /// rules are used to find the type (i.e. first the nested types within this
4013    /// message are searched, then within the parent, on up to the root
4014    /// namespace).
4015    ///
4016    /// Field 6: `type_name`
4017    #[cfg_attr(
4018        feature = "json",
4019        serde(
4020            rename = "typeName",
4021            alias = "type_name",
4022            skip_serializing_if = "::core::option::Option::is_none"
4023        )
4024    )]
4025    pub type_name: ::core::option::Option<::buffa::alloc::string::String>,
4026    /// For extensions, this is the name of the type being extended.  It is
4027    /// resolved in the same manner as type_name.
4028    ///
4029    /// Field 2: `extendee`
4030    #[cfg_attr(
4031        feature = "json",
4032        serde(
4033            rename = "extendee",
4034            skip_serializing_if = "::core::option::Option::is_none"
4035        )
4036    )]
4037    pub extendee: ::core::option::Option<::buffa::alloc::string::String>,
4038    /// For numeric types, contains the original text representation of the value.
4039    /// For booleans, "true" or "false".
4040    /// For strings, contains the default text contents (not escaped in any way).
4041    /// For bytes, contains the C escaped value.  All bytes \>= 128 are escaped.
4042    ///
4043    /// Field 7: `default_value`
4044    #[cfg_attr(
4045        feature = "json",
4046        serde(
4047            rename = "defaultValue",
4048            alias = "default_value",
4049            skip_serializing_if = "::core::option::Option::is_none"
4050        )
4051    )]
4052    pub default_value: ::core::option::Option<::buffa::alloc::string::String>,
4053    /// If set, gives the index of a oneof in the containing type's oneof_decl
4054    /// list.  This field is a member of that oneof.
4055    ///
4056    /// Field 9: `oneof_index`
4057    #[cfg_attr(
4058        feature = "json",
4059        serde(
4060            rename = "oneofIndex",
4061            alias = "oneof_index",
4062            with = "::buffa::json_helpers::opt_int32",
4063            skip_serializing_if = "::core::option::Option::is_none"
4064        )
4065    )]
4066    pub oneof_index: ::core::option::Option<i32>,
4067    /// JSON name of this field. The value is set by protocol compiler. If the
4068    /// user has set a "json_name" option on this field, that option's value
4069    /// will be used. Otherwise, it's deduced from the field's name by converting
4070    /// it to camelCase.
4071    ///
4072    /// Field 10: `json_name`
4073    #[cfg_attr(
4074        feature = "json",
4075        serde(
4076            rename = "jsonName",
4077            alias = "json_name",
4078            skip_serializing_if = "::core::option::Option::is_none"
4079        )
4080    )]
4081    pub json_name: ::core::option::Option<::buffa::alloc::string::String>,
4082    /// Field 8: `options`
4083    #[cfg_attr(
4084        feature = "json",
4085        serde(
4086            rename = "options",
4087            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4088        )
4089    )]
4090    pub options: ::buffa::MessageField<FieldOptions, ::buffa::Inline<FieldOptions>>,
4091    /// If true, this is a proto3 "optional". When a proto3 field is optional, it
4092    /// tracks presence regardless of field type.
4093    ///
4094    /// When proto3_optional is true, this field must belong to a oneof to signal
4095    /// to old proto3 clients that presence is tracked for this field. This oneof
4096    /// is known as a "synthetic" oneof, and this field must be its sole member
4097    /// (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
4098    /// exist in the descriptor only, and do not generate any API. Synthetic oneofs
4099    /// must be ordered after all "real" oneofs.
4100    ///
4101    /// For message fields, proto3_optional doesn't create any semantic change,
4102    /// since non-repeated message fields always track presence. However it still
4103    /// indicates the semantic detail of whether the user wrote "optional" or not.
4104    /// This can be useful for round-tripping the .proto file. For consistency we
4105    /// give message fields a synthetic oneof also, even though it is not required
4106    /// to track presence. This is especially important because the parser can't
4107    /// tell if a field is a message or an enum, so it must always create a
4108    /// synthetic oneof.
4109    ///
4110    /// Proto2 optional fields do not set this flag, because they already indicate
4111    /// optional with `LABEL_OPTIONAL`.
4112    ///
4113    /// Field 17: `proto3_optional`
4114    #[cfg_attr(
4115        feature = "json",
4116        serde(
4117            rename = "proto3Optional",
4118            alias = "proto3_optional",
4119            skip_serializing_if = "::core::option::Option::is_none"
4120        )
4121    )]
4122    pub proto3_optional: ::core::option::Option<bool>,
4123    #[cfg_attr(feature = "json", serde(skip))]
4124    #[doc(hidden)]
4125    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4126}
4127impl ::core::fmt::Debug for FieldDescriptorProto {
4128    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4129        f.debug_struct("FieldDescriptorProto")
4130            .field("name", &self.name)
4131            .field("number", &self.number)
4132            .field("label", &self.label)
4133            .field("type", &self.r#type)
4134            .field("type_name", &self.type_name)
4135            .field("extendee", &self.extendee)
4136            .field("default_value", &self.default_value)
4137            .field("oneof_index", &self.oneof_index)
4138            .field("json_name", &self.json_name)
4139            .field("options", &self.options)
4140            .field("proto3_optional", &self.proto3_optional)
4141            .finish()
4142    }
4143}
4144impl FieldDescriptorProto {
4145    /// Protobuf type URL for this message, for use with `Any::pack` and
4146    /// `Any::unpack_if`.
4147    ///
4148    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4149    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4150}
4151impl FieldDescriptorProto {
4152    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4153    #[inline]
4154    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
4155    pub fn with_name(
4156        mut self,
4157        value: impl Into<::buffa::alloc::string::String>,
4158    ) -> Self {
4159        self.name = Some(value.into());
4160        self
4161    }
4162    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4163    #[inline]
4164    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
4165    pub fn with_number(mut self, value: i32) -> Self {
4166        self.number = Some(value);
4167        self
4168    }
4169    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4170    #[inline]
4171    ///Sets [`Self::label`] to `Some(value)`, consuming and returning `self`.
4172    pub fn with_label(
4173        mut self,
4174        value: impl Into<field_descriptor_proto::Label>,
4175    ) -> Self {
4176        self.label = Some(value.into());
4177        self
4178    }
4179    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4180    #[inline]
4181    ///Sets `type` to `Some(value)`, consuming and returning `self`.
4182    pub fn with_type(mut self, value: impl Into<field_descriptor_proto::Type>) -> Self {
4183        self.r#type = Some(value.into());
4184        self
4185    }
4186    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4187    #[inline]
4188    ///Sets [`Self::type_name`] to `Some(value)`, consuming and returning `self`.
4189    pub fn with_type_name(
4190        mut self,
4191        value: impl Into<::buffa::alloc::string::String>,
4192    ) -> Self {
4193        self.type_name = Some(value.into());
4194        self
4195    }
4196    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4197    #[inline]
4198    ///Sets [`Self::extendee`] to `Some(value)`, consuming and returning `self`.
4199    pub fn with_extendee(
4200        mut self,
4201        value: impl Into<::buffa::alloc::string::String>,
4202    ) -> Self {
4203        self.extendee = Some(value.into());
4204        self
4205    }
4206    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4207    #[inline]
4208    ///Sets [`Self::default_value`] to `Some(value)`, consuming and returning `self`.
4209    pub fn with_default_value(
4210        mut self,
4211        value: impl Into<::buffa::alloc::string::String>,
4212    ) -> Self {
4213        self.default_value = Some(value.into());
4214        self
4215    }
4216    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4217    #[inline]
4218    ///Sets [`Self::oneof_index`] to `Some(value)`, consuming and returning `self`.
4219    pub fn with_oneof_index(mut self, value: i32) -> Self {
4220        self.oneof_index = Some(value);
4221        self
4222    }
4223    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4224    #[inline]
4225    ///Sets [`Self::json_name`] to `Some(value)`, consuming and returning `self`.
4226    pub fn with_json_name(
4227        mut self,
4228        value: impl Into<::buffa::alloc::string::String>,
4229    ) -> Self {
4230        self.json_name = Some(value.into());
4231        self
4232    }
4233    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4234    #[inline]
4235    ///Sets [`Self::proto3_optional`] to `Some(value)`, consuming and returning `self`.
4236    pub fn with_proto3_optional(mut self, value: bool) -> Self {
4237        self.proto3_optional = Some(value);
4238        self
4239    }
4240}
4241::buffa::impl_default_instance!(FieldDescriptorProto);
4242impl ::buffa::MessageName for FieldDescriptorProto {
4243    const PACKAGE: &'static str = "google.protobuf";
4244    const NAME: &'static str = "FieldDescriptorProto";
4245    const FULL_NAME: &'static str = "google.protobuf.FieldDescriptorProto";
4246    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4247}
4248impl ::buffa::Message for FieldDescriptorProto {
4249    /// Returns the total encoded size in bytes.
4250    ///
4251    /// Accumulates in `u64` (which cannot overflow for in-memory
4252    /// data) and saturates to `u32` at return, so a message whose
4253    /// encoded size exceeds the 2 GiB protobuf limit yields a value
4254    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
4255    /// points reject, never a silently wrapped size.
4256    #[allow(clippy::let_and_return)]
4257    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4258        #[allow(unused_imports)]
4259        use ::buffa::Enumeration as _;
4260        let mut size = 0u64;
4261        if let Some(ref v) = self.name {
4262            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4263        }
4264        if let Some(ref v) = self.extendee {
4265            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4266        }
4267        if let Some(v) = self.number {
4268            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
4269        }
4270        if let Some(ref v) = self.label {
4271            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
4272        }
4273        if let Some(ref v) = self.r#type {
4274            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
4275        }
4276        if let Some(ref v) = self.type_name {
4277            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4278        }
4279        if let Some(ref v) = self.default_value {
4280            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4281        }
4282        if self.options.is_set() {
4283            let __slot = __cache.reserve();
4284            let inner_size = self.options.compute_size(__cache);
4285            __cache.set(__slot, inner_size);
4286            size
4287                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
4288                    + inner_size as u64;
4289        }
4290        if let Some(v) = self.oneof_index {
4291            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
4292        }
4293        if let Some(ref v) = self.json_name {
4294            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4295        }
4296        if self.proto3_optional.is_some() {
4297            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
4298        }
4299        size += self.__buffa_unknown_fields.encoded_len() as u64;
4300        ::buffa::saturate_size(size)
4301    }
4302    fn write_to(
4303        &self,
4304        __cache: &mut ::buffa::SizeCache,
4305        buf: &mut impl ::buffa::EncodeSink,
4306    ) {
4307        #[allow(unused_imports)]
4308        use ::buffa::Enumeration as _;
4309        if let Some(ref v) = self.name {
4310            ::buffa::types::put_string_field(1u32, v, buf);
4311        }
4312        if let Some(ref v) = self.extendee {
4313            ::buffa::types::put_string_field(2u32, v, buf);
4314        }
4315        if let Some(v) = self.number {
4316            ::buffa::types::put_int32_field(3u32, v, buf);
4317        }
4318        if let Some(ref v) = self.label {
4319            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
4320        }
4321        if let Some(ref v) = self.r#type {
4322            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
4323        }
4324        if let Some(ref v) = self.type_name {
4325            ::buffa::types::put_string_field(6u32, v, buf);
4326        }
4327        if let Some(ref v) = self.default_value {
4328            ::buffa::types::put_string_field(7u32, v, buf);
4329        }
4330        if self.options.is_set() {
4331            ::buffa::types::put_len_delimited_header(
4332                8u32,
4333                u64::from(__cache.consume_next()),
4334                buf,
4335            );
4336            self.options.write_to(__cache, buf);
4337        }
4338        if let Some(v) = self.oneof_index {
4339            ::buffa::types::put_int32_field(9u32, v, buf);
4340        }
4341        if let Some(ref v) = self.json_name {
4342            ::buffa::types::put_string_field(10u32, v, buf);
4343        }
4344        if let Some(v) = self.proto3_optional {
4345            ::buffa::types::put_bool_field(17u32, v, buf);
4346        }
4347        self.__buffa_unknown_fields.write_to(buf);
4348    }
4349    fn merge_field(
4350        &mut self,
4351        tag: ::buffa::encoding::Tag,
4352        buf: &mut impl ::buffa::bytes::Buf,
4353        ctx: ::buffa::DecodeContext<'_>,
4354    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4355        #[allow(unused_imports)]
4356        use ::buffa::bytes::Buf as _;
4357        #[allow(unused_imports)]
4358        use ::buffa::Enumeration as _;
4359        match tag.field_number() {
4360            1u32 => {
4361                ::buffa::encoding::check_wire_type(
4362                    tag,
4363                    ::buffa::encoding::WireType::LengthDelimited,
4364                )?;
4365                ::buffa::types::merge_string(
4366                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
4367                    buf,
4368                )?;
4369            }
4370            2u32 => {
4371                ::buffa::encoding::check_wire_type(
4372                    tag,
4373                    ::buffa::encoding::WireType::LengthDelimited,
4374                )?;
4375                ::buffa::types::merge_string(
4376                    self
4377                        .extendee
4378                        .get_or_insert_with(::buffa::alloc::string::String::new),
4379                    buf,
4380                )?;
4381            }
4382            3u32 => {
4383                ::buffa::encoding::check_wire_type(
4384                    tag,
4385                    ::buffa::encoding::WireType::Varint,
4386                )?;
4387                self.number = ::core::option::Option::Some(
4388                    ::buffa::types::decode_int32(buf)?,
4389                );
4390            }
4391            4u32 => {
4392                ::buffa::encoding::check_wire_type(
4393                    tag,
4394                    ::buffa::encoding::WireType::Varint,
4395                )?;
4396                let __raw = ::buffa::types::decode_int32(buf)?;
4397                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4398                    __raw,
4399                ) {
4400                    self.label = ::core::option::Option::Some(__v);
4401                } else {
4402                    ctx.register_unknown_field()?;
4403                    self.__buffa_unknown_fields
4404                        .push(::buffa::UnknownField {
4405                            number: 4u32,
4406                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4407                        });
4408                }
4409            }
4410            5u32 => {
4411                ::buffa::encoding::check_wire_type(
4412                    tag,
4413                    ::buffa::encoding::WireType::Varint,
4414                )?;
4415                let __raw = ::buffa::types::decode_int32(buf)?;
4416                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4417                    __raw,
4418                ) {
4419                    self.r#type = ::core::option::Option::Some(__v);
4420                } else {
4421                    ctx.register_unknown_field()?;
4422                    self.__buffa_unknown_fields
4423                        .push(::buffa::UnknownField {
4424                            number: 5u32,
4425                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4426                        });
4427                }
4428            }
4429            6u32 => {
4430                ::buffa::encoding::check_wire_type(
4431                    tag,
4432                    ::buffa::encoding::WireType::LengthDelimited,
4433                )?;
4434                ::buffa::types::merge_string(
4435                    self
4436                        .type_name
4437                        .get_or_insert_with(::buffa::alloc::string::String::new),
4438                    buf,
4439                )?;
4440            }
4441            7u32 => {
4442                ::buffa::encoding::check_wire_type(
4443                    tag,
4444                    ::buffa::encoding::WireType::LengthDelimited,
4445                )?;
4446                ::buffa::types::merge_string(
4447                    self
4448                        .default_value
4449                        .get_or_insert_with(::buffa::alloc::string::String::new),
4450                    buf,
4451                )?;
4452            }
4453            8u32 => {
4454                ::buffa::encoding::check_wire_type(
4455                    tag,
4456                    ::buffa::encoding::WireType::LengthDelimited,
4457                )?;
4458                ::buffa::Message::merge_length_delimited(
4459                    self.options.get_or_insert_default(),
4460                    buf,
4461                    ctx,
4462                )?;
4463            }
4464            9u32 => {
4465                ::buffa::encoding::check_wire_type(
4466                    tag,
4467                    ::buffa::encoding::WireType::Varint,
4468                )?;
4469                self.oneof_index = ::core::option::Option::Some(
4470                    ::buffa::types::decode_int32(buf)?,
4471                );
4472            }
4473            10u32 => {
4474                ::buffa::encoding::check_wire_type(
4475                    tag,
4476                    ::buffa::encoding::WireType::LengthDelimited,
4477                )?;
4478                ::buffa::types::merge_string(
4479                    self
4480                        .json_name
4481                        .get_or_insert_with(::buffa::alloc::string::String::new),
4482                    buf,
4483                )?;
4484            }
4485            17u32 => {
4486                ::buffa::encoding::check_wire_type(
4487                    tag,
4488                    ::buffa::encoding::WireType::Varint,
4489                )?;
4490                self.proto3_optional = ::core::option::Option::Some(
4491                    ::buffa::types::decode_bool(buf)?,
4492                );
4493            }
4494            _ => {
4495                self.__buffa_unknown_fields
4496                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4497            }
4498        }
4499        ::core::result::Result::Ok(())
4500    }
4501    fn clear(&mut self) {
4502        self.name = ::core::option::Option::None;
4503        self.extendee = ::core::option::Option::None;
4504        self.number = ::core::option::Option::None;
4505        self.label = ::core::option::Option::None;
4506        self.r#type = ::core::option::Option::None;
4507        self.type_name = ::core::option::Option::None;
4508        self.default_value = ::core::option::Option::None;
4509        self.options = ::buffa::MessageField::none();
4510        self.oneof_index = ::core::option::Option::None;
4511        self.json_name = ::core::option::Option::None;
4512        self.proto3_optional = ::core::option::Option::None;
4513        self.__buffa_unknown_fields.clear();
4514    }
4515}
4516impl ::buffa::ExtensionSet for FieldDescriptorProto {
4517    const PROTO_FQN: &'static str = "google.protobuf.FieldDescriptorProto";
4518    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4519        &self.__buffa_unknown_fields
4520    }
4521    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4522        &mut self.__buffa_unknown_fields
4523    }
4524}
4525#[cfg(feature = "text")]
4526impl ::buffa::text::TextFormat for FieldDescriptorProto {
4527    fn encode_text(
4528        &self,
4529        enc: &mut ::buffa::text::TextEncoder<'_>,
4530    ) -> ::core::fmt::Result {
4531        #[allow(unused_imports)]
4532        use ::buffa::Enumeration as _;
4533        if let ::core::option::Option::Some(ref __v) = self.name {
4534            enc.write_field_name("name")?;
4535            enc.write_string(__v)?;
4536        }
4537        if let ::core::option::Option::Some(ref __v) = self.number {
4538            enc.write_field_name("number")?;
4539            enc.write_i32(*__v)?;
4540        }
4541        if let ::core::option::Option::Some(ref __v) = self.label {
4542            enc.write_field_name("label")?;
4543            enc.write_enum_name(__v.proto_name())?;
4544        }
4545        if let ::core::option::Option::Some(ref __v) = self.r#type {
4546            enc.write_field_name("type")?;
4547            enc.write_enum_name(__v.proto_name())?;
4548        }
4549        if let ::core::option::Option::Some(ref __v) = self.type_name {
4550            enc.write_field_name("type_name")?;
4551            enc.write_string(__v)?;
4552        }
4553        if let ::core::option::Option::Some(ref __v) = self.extendee {
4554            enc.write_field_name("extendee")?;
4555            enc.write_string(__v)?;
4556        }
4557        if let ::core::option::Option::Some(ref __v) = self.default_value {
4558            enc.write_field_name("default_value")?;
4559            enc.write_string(__v)?;
4560        }
4561        if let ::core::option::Option::Some(ref __v) = self.oneof_index {
4562            enc.write_field_name("oneof_index")?;
4563            enc.write_i32(*__v)?;
4564        }
4565        if let ::core::option::Option::Some(ref __v) = self.json_name {
4566            enc.write_field_name("json_name")?;
4567            enc.write_string(__v)?;
4568        }
4569        if self.options.is_set() {
4570            enc.write_field_name("options")?;
4571            enc.write_message(&*self.options)?;
4572        }
4573        if let ::core::option::Option::Some(ref __v) = self.proto3_optional {
4574            enc.write_field_name("proto3_optional")?;
4575            enc.write_bool(*__v)?;
4576        }
4577        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
4578        ::core::result::Result::Ok(())
4579    }
4580    fn merge_text(
4581        &mut self,
4582        dec: &mut ::buffa::text::TextDecoder<'_>,
4583    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
4584        #[allow(unused_imports)]
4585        use ::buffa::Enumeration as _;
4586        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
4587            match __name {
4588                "name" => {
4589                    self.name = ::core::option::Option::Some(
4590                        dec.read_string()?.into_owned(),
4591                    );
4592                }
4593                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
4594                "label" => {
4595                    self.label = ::core::option::Option::Some(
4596                        dec.read_closed_enum_by_name::<field_descriptor_proto::Label>()?,
4597                    );
4598                }
4599                "type" => {
4600                    self.r#type = ::core::option::Option::Some(
4601                        dec.read_closed_enum_by_name::<field_descriptor_proto::Type>()?,
4602                    );
4603                }
4604                "type_name" => {
4605                    self.type_name = ::core::option::Option::Some(
4606                        dec.read_string()?.into_owned(),
4607                    );
4608                }
4609                "extendee" => {
4610                    self.extendee = ::core::option::Option::Some(
4611                        dec.read_string()?.into_owned(),
4612                    );
4613                }
4614                "default_value" => {
4615                    self.default_value = ::core::option::Option::Some(
4616                        dec.read_string()?.into_owned(),
4617                    );
4618                }
4619                "oneof_index" => {
4620                    self.oneof_index = ::core::option::Option::Some(dec.read_i32()?);
4621                }
4622                "json_name" => {
4623                    self.json_name = ::core::option::Option::Some(
4624                        dec.read_string()?.into_owned(),
4625                    );
4626                }
4627                "options" => dec.merge_message(self.options.get_or_insert_default())?,
4628                "proto3_optional" => {
4629                    self.proto3_optional = ::core::option::Option::Some(dec.read_bool()?);
4630                }
4631                _ => dec.skip_value()?,
4632            }
4633        }
4634        ::core::result::Result::Ok(())
4635    }
4636}
4637#[cfg(feature = "json")]
4638impl ::buffa::json_helpers::ProtoElemJson for FieldDescriptorProto {
4639    fn serialize_proto_json<S: ::serde::Serializer>(
4640        v: &Self,
4641        s: S,
4642    ) -> ::core::result::Result<S::Ok, S::Error> {
4643        ::serde::Serialize::serialize(v, s)
4644    }
4645    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4646        d: D,
4647    ) -> ::core::result::Result<Self, D::Error> {
4648        <Self as ::serde::Deserialize>::deserialize(d)
4649    }
4650}
4651#[cfg(feature = "json")]
4652#[doc(hidden)]
4653pub const __FIELD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4654    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4655    to_json: ::buffa::type_registry::any_to_json::<FieldDescriptorProto>,
4656    from_json: ::buffa::type_registry::any_from_json::<FieldDescriptorProto>,
4657    is_wkt: false,
4658};
4659#[cfg(feature = "text")]
4660#[doc(hidden)]
4661pub const __FIELD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
4662    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4663    text_encode: ::buffa::type_registry::any_encode_text::<FieldDescriptorProto>,
4664    text_merge: ::buffa::type_registry::any_merge_text::<FieldDescriptorProto>,
4665};
4666pub mod field_descriptor_proto {
4667    #[allow(unused_imports)]
4668    use super::*;
4669    #[allow(non_camel_case_types)]
4670    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4671    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4672    #[repr(i32)]
4673    pub enum Type {
4674        /// 0 is reserved for errors.
4675        /// Order is weird for historical reasons.
4676        TYPE_DOUBLE = 1i32,
4677        TYPE_FLOAT = 2i32,
4678        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
4679        /// negative values are likely.
4680        TYPE_INT64 = 3i32,
4681        TYPE_UINT64 = 4i32,
4682        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
4683        /// negative values are likely.
4684        TYPE_INT32 = 5i32,
4685        TYPE_FIXED64 = 6i32,
4686        TYPE_FIXED32 = 7i32,
4687        TYPE_BOOL = 8i32,
4688        TYPE_STRING = 9i32,
4689        /// Tag-delimited aggregate.
4690        /// Group type is deprecated and not supported after google.protobuf. However, Proto3
4691        /// implementations should still be able to parse the group wire format and
4692        /// treat group fields as unknown fields.  In Editions, the group wire format
4693        /// can be enabled via the `message_encoding` feature.
4694        TYPE_GROUP = 10i32,
4695        /// Length-delimited aggregate.
4696        TYPE_MESSAGE = 11i32,
4697        /// New in version 2.
4698        TYPE_BYTES = 12i32,
4699        TYPE_UINT32 = 13i32,
4700        TYPE_ENUM = 14i32,
4701        TYPE_SFIXED32 = 15i32,
4702        TYPE_SFIXED64 = 16i32,
4703        /// Uses ZigZag encoding.
4704        TYPE_SINT32 = 17i32,
4705        /// Uses ZigZag encoding.
4706        TYPE_SINT64 = 18i32,
4707    }
4708    impl Type {
4709        ///Idiomatic alias for [`Self::TYPE_DOUBLE`]; `Debug` prints the variant name.
4710        #[allow(non_upper_case_globals)]
4711        pub const Double: Self = Self::TYPE_DOUBLE;
4712        ///Idiomatic alias for [`Self::TYPE_FLOAT`]; `Debug` prints the variant name.
4713        #[allow(non_upper_case_globals)]
4714        pub const Float: Self = Self::TYPE_FLOAT;
4715        ///Idiomatic alias for [`Self::TYPE_INT64`]; `Debug` prints the variant name.
4716        #[allow(non_upper_case_globals)]
4717        pub const Int64: Self = Self::TYPE_INT64;
4718        ///Idiomatic alias for [`Self::TYPE_UINT64`]; `Debug` prints the variant name.
4719        #[allow(non_upper_case_globals)]
4720        pub const Uint64: Self = Self::TYPE_UINT64;
4721        ///Idiomatic alias for [`Self::TYPE_INT32`]; `Debug` prints the variant name.
4722        #[allow(non_upper_case_globals)]
4723        pub const Int32: Self = Self::TYPE_INT32;
4724        ///Idiomatic alias for [`Self::TYPE_FIXED64`]; `Debug` prints the variant name.
4725        #[allow(non_upper_case_globals)]
4726        pub const Fixed64: Self = Self::TYPE_FIXED64;
4727        ///Idiomatic alias for [`Self::TYPE_FIXED32`]; `Debug` prints the variant name.
4728        #[allow(non_upper_case_globals)]
4729        pub const Fixed32: Self = Self::TYPE_FIXED32;
4730        ///Idiomatic alias for [`Self::TYPE_BOOL`]; `Debug` prints the variant name.
4731        #[allow(non_upper_case_globals)]
4732        pub const Bool: Self = Self::TYPE_BOOL;
4733        ///Idiomatic alias for [`Self::TYPE_STRING`]; `Debug` prints the variant name.
4734        #[allow(non_upper_case_globals)]
4735        pub const String: Self = Self::TYPE_STRING;
4736        ///Idiomatic alias for [`Self::TYPE_GROUP`]; `Debug` prints the variant name.
4737        #[allow(non_upper_case_globals)]
4738        pub const Group: Self = Self::TYPE_GROUP;
4739        ///Idiomatic alias for [`Self::TYPE_MESSAGE`]; `Debug` prints the variant name.
4740        #[allow(non_upper_case_globals)]
4741        pub const Message: Self = Self::TYPE_MESSAGE;
4742        ///Idiomatic alias for [`Self::TYPE_BYTES`]; `Debug` prints the variant name.
4743        #[allow(non_upper_case_globals)]
4744        pub const Bytes: Self = Self::TYPE_BYTES;
4745        ///Idiomatic alias for [`Self::TYPE_UINT32`]; `Debug` prints the variant name.
4746        #[allow(non_upper_case_globals)]
4747        pub const Uint32: Self = Self::TYPE_UINT32;
4748        ///Idiomatic alias for [`Self::TYPE_ENUM`]; `Debug` prints the variant name.
4749        #[allow(non_upper_case_globals)]
4750        pub const Enum: Self = Self::TYPE_ENUM;
4751        ///Idiomatic alias for [`Self::TYPE_SFIXED32`]; `Debug` prints the variant name.
4752        #[allow(non_upper_case_globals)]
4753        pub const Sfixed32: Self = Self::TYPE_SFIXED32;
4754        ///Idiomatic alias for [`Self::TYPE_SFIXED64`]; `Debug` prints the variant name.
4755        #[allow(non_upper_case_globals)]
4756        pub const Sfixed64: Self = Self::TYPE_SFIXED64;
4757        ///Idiomatic alias for [`Self::TYPE_SINT32`]; `Debug` prints the variant name.
4758        #[allow(non_upper_case_globals)]
4759        pub const Sint32: Self = Self::TYPE_SINT32;
4760        ///Idiomatic alias for [`Self::TYPE_SINT64`]; `Debug` prints the variant name.
4761        #[allow(non_upper_case_globals)]
4762        pub const Sint64: Self = Self::TYPE_SINT64;
4763    }
4764    impl ::core::default::Default for Type {
4765        fn default() -> Self {
4766            Self::TYPE_DOUBLE
4767        }
4768    }
4769    #[cfg(feature = "json")]
4770    const _: () = {
4771        impl ::serde::Serialize for Type {
4772            fn serialize<S: ::serde::Serializer>(
4773                &self,
4774                s: S,
4775            ) -> ::core::result::Result<S::Ok, S::Error> {
4776                s.serialize_str(::buffa::Enumeration::proto_name(self))
4777            }
4778        }
4779        impl<'de> ::serde::Deserialize<'de> for Type {
4780            fn deserialize<D: ::serde::Deserializer<'de>>(
4781                d: D,
4782            ) -> ::core::result::Result<Self, D::Error> {
4783                struct _V;
4784                impl ::serde::de::Visitor<'_> for _V {
4785                    type Value = Type;
4786                    fn expecting(
4787                        &self,
4788                        f: &mut ::core::fmt::Formatter<'_>,
4789                    ) -> ::core::fmt::Result {
4790                        f.write_str(
4791                            concat!("a string, integer, or null for ", stringify!(Type)),
4792                        )
4793                    }
4794                    fn visit_str<E: ::serde::de::Error>(
4795                        self,
4796                        v: &str,
4797                    ) -> ::core::result::Result<Type, E> {
4798                        <Type as ::buffa::Enumeration>::from_proto_name(v)
4799                            .ok_or_else(|| {
4800                                ::serde::de::Error::unknown_variant(v, &[])
4801                            })
4802                    }
4803                    fn visit_i64<E: ::serde::de::Error>(
4804                        self,
4805                        v: i64,
4806                    ) -> ::core::result::Result<Type, E> {
4807                        let v32 = i32::try_from(v)
4808                            .map_err(|_| {
4809                                ::serde::de::Error::custom(
4810                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4811                                )
4812                            })?;
4813                        <Type as ::buffa::Enumeration>::from_i32(v32)
4814                            .ok_or_else(|| {
4815                                ::serde::de::Error::custom(
4816                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4817                                )
4818                            })
4819                    }
4820                    fn visit_u64<E: ::serde::de::Error>(
4821                        self,
4822                        v: u64,
4823                    ) -> ::core::result::Result<Type, E> {
4824                        let v32 = i32::try_from(v)
4825                            .map_err(|_| {
4826                                ::serde::de::Error::custom(
4827                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4828                                )
4829                            })?;
4830                        <Type as ::buffa::Enumeration>::from_i32(v32)
4831                            .ok_or_else(|| {
4832                                ::serde::de::Error::custom(
4833                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4834                                )
4835                            })
4836                    }
4837                    fn visit_unit<E: ::serde::de::Error>(
4838                        self,
4839                    ) -> ::core::result::Result<Type, E> {
4840                        ::core::result::Result::Ok(::core::default::Default::default())
4841                    }
4842                }
4843                d.deserialize_any(_V)
4844            }
4845        }
4846        impl ::buffa::json_helpers::ProtoElemJson for Type {
4847            fn serialize_proto_json<S: ::serde::Serializer>(
4848                v: &Self,
4849                s: S,
4850            ) -> ::core::result::Result<S::Ok, S::Error> {
4851                ::serde::Serialize::serialize(v, s)
4852            }
4853            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4854                d: D,
4855            ) -> ::core::result::Result<Self, D::Error> {
4856                <Self as ::serde::Deserialize>::deserialize(d)
4857            }
4858        }
4859    };
4860    impl ::buffa::Enumeration for Type {
4861        fn from_i32(value: i32) -> ::core::option::Option<Self> {
4862            match value {
4863                1i32 => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4864                2i32 => ::core::option::Option::Some(Self::TYPE_FLOAT),
4865                3i32 => ::core::option::Option::Some(Self::TYPE_INT64),
4866                4i32 => ::core::option::Option::Some(Self::TYPE_UINT64),
4867                5i32 => ::core::option::Option::Some(Self::TYPE_INT32),
4868                6i32 => ::core::option::Option::Some(Self::TYPE_FIXED64),
4869                7i32 => ::core::option::Option::Some(Self::TYPE_FIXED32),
4870                8i32 => ::core::option::Option::Some(Self::TYPE_BOOL),
4871                9i32 => ::core::option::Option::Some(Self::TYPE_STRING),
4872                10i32 => ::core::option::Option::Some(Self::TYPE_GROUP),
4873                11i32 => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4874                12i32 => ::core::option::Option::Some(Self::TYPE_BYTES),
4875                13i32 => ::core::option::Option::Some(Self::TYPE_UINT32),
4876                14i32 => ::core::option::Option::Some(Self::TYPE_ENUM),
4877                15i32 => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4878                16i32 => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4879                17i32 => ::core::option::Option::Some(Self::TYPE_SINT32),
4880                18i32 => ::core::option::Option::Some(Self::TYPE_SINT64),
4881                _ => ::core::option::Option::None,
4882            }
4883        }
4884        fn to_i32(&self) -> i32 {
4885            *self as i32
4886        }
4887        fn proto_name(&self) -> &'static str {
4888            match self {
4889                Self::TYPE_DOUBLE => "TYPE_DOUBLE",
4890                Self::TYPE_FLOAT => "TYPE_FLOAT",
4891                Self::TYPE_INT64 => "TYPE_INT64",
4892                Self::TYPE_UINT64 => "TYPE_UINT64",
4893                Self::TYPE_INT32 => "TYPE_INT32",
4894                Self::TYPE_FIXED64 => "TYPE_FIXED64",
4895                Self::TYPE_FIXED32 => "TYPE_FIXED32",
4896                Self::TYPE_BOOL => "TYPE_BOOL",
4897                Self::TYPE_STRING => "TYPE_STRING",
4898                Self::TYPE_GROUP => "TYPE_GROUP",
4899                Self::TYPE_MESSAGE => "TYPE_MESSAGE",
4900                Self::TYPE_BYTES => "TYPE_BYTES",
4901                Self::TYPE_UINT32 => "TYPE_UINT32",
4902                Self::TYPE_ENUM => "TYPE_ENUM",
4903                Self::TYPE_SFIXED32 => "TYPE_SFIXED32",
4904                Self::TYPE_SFIXED64 => "TYPE_SFIXED64",
4905                Self::TYPE_SINT32 => "TYPE_SINT32",
4906                Self::TYPE_SINT64 => "TYPE_SINT64",
4907            }
4908        }
4909        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
4910            match name {
4911                "TYPE_DOUBLE" => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4912                "TYPE_FLOAT" => ::core::option::Option::Some(Self::TYPE_FLOAT),
4913                "TYPE_INT64" => ::core::option::Option::Some(Self::TYPE_INT64),
4914                "TYPE_UINT64" => ::core::option::Option::Some(Self::TYPE_UINT64),
4915                "TYPE_INT32" => ::core::option::Option::Some(Self::TYPE_INT32),
4916                "TYPE_FIXED64" => ::core::option::Option::Some(Self::TYPE_FIXED64),
4917                "TYPE_FIXED32" => ::core::option::Option::Some(Self::TYPE_FIXED32),
4918                "TYPE_BOOL" => ::core::option::Option::Some(Self::TYPE_BOOL),
4919                "TYPE_STRING" => ::core::option::Option::Some(Self::TYPE_STRING),
4920                "TYPE_GROUP" => ::core::option::Option::Some(Self::TYPE_GROUP),
4921                "TYPE_MESSAGE" => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4922                "TYPE_BYTES" => ::core::option::Option::Some(Self::TYPE_BYTES),
4923                "TYPE_UINT32" => ::core::option::Option::Some(Self::TYPE_UINT32),
4924                "TYPE_ENUM" => ::core::option::Option::Some(Self::TYPE_ENUM),
4925                "TYPE_SFIXED32" => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4926                "TYPE_SFIXED64" => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4927                "TYPE_SINT32" => ::core::option::Option::Some(Self::TYPE_SINT32),
4928                "TYPE_SINT64" => ::core::option::Option::Some(Self::TYPE_SINT64),
4929                _ => ::core::option::Option::None,
4930            }
4931        }
4932        fn values() -> &'static [Self] {
4933            &[
4934                Self::TYPE_DOUBLE,
4935                Self::TYPE_FLOAT,
4936                Self::TYPE_INT64,
4937                Self::TYPE_UINT64,
4938                Self::TYPE_INT32,
4939                Self::TYPE_FIXED64,
4940                Self::TYPE_FIXED32,
4941                Self::TYPE_BOOL,
4942                Self::TYPE_STRING,
4943                Self::TYPE_GROUP,
4944                Self::TYPE_MESSAGE,
4945                Self::TYPE_BYTES,
4946                Self::TYPE_UINT32,
4947                Self::TYPE_ENUM,
4948                Self::TYPE_SFIXED32,
4949                Self::TYPE_SFIXED64,
4950                Self::TYPE_SINT32,
4951                Self::TYPE_SINT64,
4952            ]
4953        }
4954    }
4955    #[allow(non_camel_case_types)]
4956    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4957    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4958    #[repr(i32)]
4959    pub enum Label {
4960        /// 0 is reserved for errors
4961        LABEL_OPTIONAL = 1i32,
4962        LABEL_REPEATED = 3i32,
4963        /// The required label is only allowed in google.protobuf.  In proto3 and Editions
4964        /// it's explicitly prohibited.  In Editions, the `field_presence` feature
4965        /// can be used to get this behavior.
4966        LABEL_REQUIRED = 2i32,
4967    }
4968    impl Label {
4969        ///Idiomatic alias for [`Self::LABEL_OPTIONAL`]; `Debug` prints the variant name.
4970        #[allow(non_upper_case_globals)]
4971        pub const Optional: Self = Self::LABEL_OPTIONAL;
4972        ///Idiomatic alias for [`Self::LABEL_REPEATED`]; `Debug` prints the variant name.
4973        #[allow(non_upper_case_globals)]
4974        pub const Repeated: Self = Self::LABEL_REPEATED;
4975        ///Idiomatic alias for [`Self::LABEL_REQUIRED`]; `Debug` prints the variant name.
4976        #[allow(non_upper_case_globals)]
4977        pub const Required: Self = Self::LABEL_REQUIRED;
4978    }
4979    impl ::core::default::Default for Label {
4980        fn default() -> Self {
4981            Self::LABEL_OPTIONAL
4982        }
4983    }
4984    #[cfg(feature = "json")]
4985    const _: () = {
4986        impl ::serde::Serialize for Label {
4987            fn serialize<S: ::serde::Serializer>(
4988                &self,
4989                s: S,
4990            ) -> ::core::result::Result<S::Ok, S::Error> {
4991                s.serialize_str(::buffa::Enumeration::proto_name(self))
4992            }
4993        }
4994        impl<'de> ::serde::Deserialize<'de> for Label {
4995            fn deserialize<D: ::serde::Deserializer<'de>>(
4996                d: D,
4997            ) -> ::core::result::Result<Self, D::Error> {
4998                struct _V;
4999                impl ::serde::de::Visitor<'_> for _V {
5000                    type Value = Label;
5001                    fn expecting(
5002                        &self,
5003                        f: &mut ::core::fmt::Formatter<'_>,
5004                    ) -> ::core::fmt::Result {
5005                        f.write_str(
5006                            concat!("a string, integer, or null for ", stringify!(Label)),
5007                        )
5008                    }
5009                    fn visit_str<E: ::serde::de::Error>(
5010                        self,
5011                        v: &str,
5012                    ) -> ::core::result::Result<Label, E> {
5013                        <Label as ::buffa::Enumeration>::from_proto_name(v)
5014                            .ok_or_else(|| {
5015                                ::serde::de::Error::unknown_variant(v, &[])
5016                            })
5017                    }
5018                    fn visit_i64<E: ::serde::de::Error>(
5019                        self,
5020                        v: i64,
5021                    ) -> ::core::result::Result<Label, E> {
5022                        let v32 = i32::try_from(v)
5023                            .map_err(|_| {
5024                                ::serde::de::Error::custom(
5025                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5026                                )
5027                            })?;
5028                        <Label as ::buffa::Enumeration>::from_i32(v32)
5029                            .ok_or_else(|| {
5030                                ::serde::de::Error::custom(
5031                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5032                                )
5033                            })
5034                    }
5035                    fn visit_u64<E: ::serde::de::Error>(
5036                        self,
5037                        v: u64,
5038                    ) -> ::core::result::Result<Label, E> {
5039                        let v32 = i32::try_from(v)
5040                            .map_err(|_| {
5041                                ::serde::de::Error::custom(
5042                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5043                                )
5044                            })?;
5045                        <Label as ::buffa::Enumeration>::from_i32(v32)
5046                            .ok_or_else(|| {
5047                                ::serde::de::Error::custom(
5048                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5049                                )
5050                            })
5051                    }
5052                    fn visit_unit<E: ::serde::de::Error>(
5053                        self,
5054                    ) -> ::core::result::Result<Label, E> {
5055                        ::core::result::Result::Ok(::core::default::Default::default())
5056                    }
5057                }
5058                d.deserialize_any(_V)
5059            }
5060        }
5061        impl ::buffa::json_helpers::ProtoElemJson for Label {
5062            fn serialize_proto_json<S: ::serde::Serializer>(
5063                v: &Self,
5064                s: S,
5065            ) -> ::core::result::Result<S::Ok, S::Error> {
5066                ::serde::Serialize::serialize(v, s)
5067            }
5068            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5069                d: D,
5070            ) -> ::core::result::Result<Self, D::Error> {
5071                <Self as ::serde::Deserialize>::deserialize(d)
5072            }
5073        }
5074    };
5075    impl ::buffa::Enumeration for Label {
5076        fn from_i32(value: i32) -> ::core::option::Option<Self> {
5077            match value {
5078                1i32 => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5079                3i32 => ::core::option::Option::Some(Self::LABEL_REPEATED),
5080                2i32 => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5081                _ => ::core::option::Option::None,
5082            }
5083        }
5084        fn to_i32(&self) -> i32 {
5085            *self as i32
5086        }
5087        fn proto_name(&self) -> &'static str {
5088            match self {
5089                Self::LABEL_OPTIONAL => "LABEL_OPTIONAL",
5090                Self::LABEL_REPEATED => "LABEL_REPEATED",
5091                Self::LABEL_REQUIRED => "LABEL_REQUIRED",
5092            }
5093        }
5094        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
5095            match name {
5096                "LABEL_OPTIONAL" => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5097                "LABEL_REPEATED" => ::core::option::Option::Some(Self::LABEL_REPEATED),
5098                "LABEL_REQUIRED" => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5099                _ => ::core::option::Option::None,
5100            }
5101        }
5102        fn values() -> &'static [Self] {
5103            &[Self::LABEL_OPTIONAL, Self::LABEL_REPEATED, Self::LABEL_REQUIRED]
5104        }
5105    }
5106}
5107/// Describes a oneof.
5108#[derive(Clone, PartialEq, Default)]
5109#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5110#[cfg_attr(feature = "json", serde(default))]
5111#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5112pub struct OneofDescriptorProto {
5113    /// Field 1: `name`
5114    #[cfg_attr(
5115        feature = "json",
5116        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5117    )]
5118    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5119    /// Field 2: `options`
5120    #[cfg_attr(
5121        feature = "json",
5122        serde(
5123            rename = "options",
5124            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5125        )
5126    )]
5127    pub options: ::buffa::MessageField<OneofOptions, ::buffa::Inline<OneofOptions>>,
5128    #[cfg_attr(feature = "json", serde(skip))]
5129    #[doc(hidden)]
5130    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5131}
5132impl ::core::fmt::Debug for OneofDescriptorProto {
5133    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5134        f.debug_struct("OneofDescriptorProto")
5135            .field("name", &self.name)
5136            .field("options", &self.options)
5137            .finish()
5138    }
5139}
5140impl OneofDescriptorProto {
5141    /// Protobuf type URL for this message, for use with `Any::pack` and
5142    /// `Any::unpack_if`.
5143    ///
5144    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5145    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5146}
5147impl OneofDescriptorProto {
5148    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5149    #[inline]
5150    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5151    pub fn with_name(
5152        mut self,
5153        value: impl Into<::buffa::alloc::string::String>,
5154    ) -> Self {
5155        self.name = Some(value.into());
5156        self
5157    }
5158}
5159::buffa::impl_default_instance!(OneofDescriptorProto);
5160impl ::buffa::MessageName for OneofDescriptorProto {
5161    const PACKAGE: &'static str = "google.protobuf";
5162    const NAME: &'static str = "OneofDescriptorProto";
5163    const FULL_NAME: &'static str = "google.protobuf.OneofDescriptorProto";
5164    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5165}
5166impl ::buffa::Message for OneofDescriptorProto {
5167    /// Returns the total encoded size in bytes.
5168    ///
5169    /// Accumulates in `u64` (which cannot overflow for in-memory
5170    /// data) and saturates to `u32` at return, so a message whose
5171    /// encoded size exceeds the 2 GiB protobuf limit yields a value
5172    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5173    /// points reject, never a silently wrapped size.
5174    #[allow(clippy::let_and_return)]
5175    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5176        #[allow(unused_imports)]
5177        use ::buffa::Enumeration as _;
5178        let mut size = 0u64;
5179        if let Some(ref v) = self.name {
5180            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5181        }
5182        if self.options.is_set() {
5183            let __slot = __cache.reserve();
5184            let inner_size = self.options.compute_size(__cache);
5185            __cache.set(__slot, inner_size);
5186            size
5187                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5188                    + inner_size as u64;
5189        }
5190        size += self.__buffa_unknown_fields.encoded_len() as u64;
5191        ::buffa::saturate_size(size)
5192    }
5193    fn write_to(
5194        &self,
5195        __cache: &mut ::buffa::SizeCache,
5196        buf: &mut impl ::buffa::EncodeSink,
5197    ) {
5198        #[allow(unused_imports)]
5199        use ::buffa::Enumeration as _;
5200        if let Some(ref v) = self.name {
5201            ::buffa::types::put_string_field(1u32, v, buf);
5202        }
5203        if self.options.is_set() {
5204            ::buffa::types::put_len_delimited_header(
5205                2u32,
5206                u64::from(__cache.consume_next()),
5207                buf,
5208            );
5209            self.options.write_to(__cache, buf);
5210        }
5211        self.__buffa_unknown_fields.write_to(buf);
5212    }
5213    fn merge_field(
5214        &mut self,
5215        tag: ::buffa::encoding::Tag,
5216        buf: &mut impl ::buffa::bytes::Buf,
5217        ctx: ::buffa::DecodeContext<'_>,
5218    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5219        #[allow(unused_imports)]
5220        use ::buffa::bytes::Buf as _;
5221        #[allow(unused_imports)]
5222        use ::buffa::Enumeration as _;
5223        match tag.field_number() {
5224            1u32 => {
5225                ::buffa::encoding::check_wire_type(
5226                    tag,
5227                    ::buffa::encoding::WireType::LengthDelimited,
5228                )?;
5229                ::buffa::types::merge_string(
5230                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5231                    buf,
5232                )?;
5233            }
5234            2u32 => {
5235                ::buffa::encoding::check_wire_type(
5236                    tag,
5237                    ::buffa::encoding::WireType::LengthDelimited,
5238                )?;
5239                ::buffa::Message::merge_length_delimited(
5240                    self.options.get_or_insert_default(),
5241                    buf,
5242                    ctx,
5243                )?;
5244            }
5245            _ => {
5246                self.__buffa_unknown_fields
5247                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5248            }
5249        }
5250        ::core::result::Result::Ok(())
5251    }
5252    fn clear(&mut self) {
5253        self.name = ::core::option::Option::None;
5254        self.options = ::buffa::MessageField::none();
5255        self.__buffa_unknown_fields.clear();
5256    }
5257}
5258impl ::buffa::ExtensionSet for OneofDescriptorProto {
5259    const PROTO_FQN: &'static str = "google.protobuf.OneofDescriptorProto";
5260    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5261        &self.__buffa_unknown_fields
5262    }
5263    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5264        &mut self.__buffa_unknown_fields
5265    }
5266}
5267#[cfg(feature = "text")]
5268impl ::buffa::text::TextFormat for OneofDescriptorProto {
5269    fn encode_text(
5270        &self,
5271        enc: &mut ::buffa::text::TextEncoder<'_>,
5272    ) -> ::core::fmt::Result {
5273        #[allow(unused_imports)]
5274        use ::buffa::Enumeration as _;
5275        if let ::core::option::Option::Some(ref __v) = self.name {
5276            enc.write_field_name("name")?;
5277            enc.write_string(__v)?;
5278        }
5279        if self.options.is_set() {
5280            enc.write_field_name("options")?;
5281            enc.write_message(&*self.options)?;
5282        }
5283        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5284        ::core::result::Result::Ok(())
5285    }
5286    fn merge_text(
5287        &mut self,
5288        dec: &mut ::buffa::text::TextDecoder<'_>,
5289    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5290        #[allow(unused_imports)]
5291        use ::buffa::Enumeration as _;
5292        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5293            match __name {
5294                "name" => {
5295                    self.name = ::core::option::Option::Some(
5296                        dec.read_string()?.into_owned(),
5297                    );
5298                }
5299                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5300                _ => dec.skip_value()?,
5301            }
5302        }
5303        ::core::result::Result::Ok(())
5304    }
5305}
5306#[cfg(feature = "json")]
5307impl ::buffa::json_helpers::ProtoElemJson for OneofDescriptorProto {
5308    fn serialize_proto_json<S: ::serde::Serializer>(
5309        v: &Self,
5310        s: S,
5311    ) -> ::core::result::Result<S::Ok, S::Error> {
5312        ::serde::Serialize::serialize(v, s)
5313    }
5314    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5315        d: D,
5316    ) -> ::core::result::Result<Self, D::Error> {
5317        <Self as ::serde::Deserialize>::deserialize(d)
5318    }
5319}
5320#[cfg(feature = "json")]
5321#[doc(hidden)]
5322pub const __ONEOF_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5323    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5324    to_json: ::buffa::type_registry::any_to_json::<OneofDescriptorProto>,
5325    from_json: ::buffa::type_registry::any_from_json::<OneofDescriptorProto>,
5326    is_wkt: false,
5327};
5328#[cfg(feature = "text")]
5329#[doc(hidden)]
5330pub const __ONEOF_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5331    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5332    text_encode: ::buffa::type_registry::any_encode_text::<OneofDescriptorProto>,
5333    text_merge: ::buffa::type_registry::any_merge_text::<OneofDescriptorProto>,
5334};
5335/// Describes an enum type.
5336#[derive(Clone, PartialEq, Default)]
5337#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5338#[cfg_attr(feature = "json", serde(default))]
5339#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5340pub struct EnumDescriptorProto {
5341    /// Field 1: `name`
5342    #[cfg_attr(
5343        feature = "json",
5344        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5345    )]
5346    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5347    /// Field 2: `value`
5348    #[cfg_attr(
5349        feature = "json",
5350        serde(
5351            rename = "value",
5352            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5353            deserialize_with = "::buffa::json_helpers::null_as_default"
5354        )
5355    )]
5356    pub value: ::buffa::alloc::vec::Vec<EnumValueDescriptorProto>,
5357    /// Field 3: `options`
5358    #[cfg_attr(
5359        feature = "json",
5360        serde(
5361            rename = "options",
5362            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5363        )
5364    )]
5365    pub options: ::buffa::MessageField<EnumOptions, ::buffa::Inline<EnumOptions>>,
5366    /// Range of reserved numeric values. Reserved numeric values may not be used
5367    /// by enum values in the same enum declaration. Reserved ranges may not
5368    /// overlap.
5369    ///
5370    /// Field 4: `reserved_range`
5371    #[cfg_attr(
5372        feature = "json",
5373        serde(
5374            rename = "reservedRange",
5375            alias = "reserved_range",
5376            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5377            deserialize_with = "::buffa::json_helpers::null_as_default"
5378        )
5379    )]
5380    pub reserved_range: ::buffa::alloc::vec::Vec<
5381        enum_descriptor_proto::EnumReservedRange,
5382    >,
5383    /// Reserved enum value names, which may not be reused. A given name may only
5384    /// be reserved once.
5385    ///
5386    /// Field 5: `reserved_name`
5387    #[cfg_attr(
5388        feature = "json",
5389        serde(
5390            rename = "reservedName",
5391            alias = "reserved_name",
5392            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5393            deserialize_with = "::buffa::json_helpers::null_as_default"
5394        )
5395    )]
5396    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
5397    /// Support for `export` and `local` keywords on enums.
5398    ///
5399    /// Field 6: `visibility`
5400    #[cfg_attr(
5401        feature = "json",
5402        serde(
5403            rename = "visibility",
5404            with = "::buffa::json_helpers::opt_closed_enum",
5405            skip_serializing_if = "::core::option::Option::is_none"
5406        )
5407    )]
5408    pub visibility: ::core::option::Option<SymbolVisibility>,
5409    #[cfg_attr(feature = "json", serde(skip))]
5410    #[doc(hidden)]
5411    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5412}
5413impl ::core::fmt::Debug for EnumDescriptorProto {
5414    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5415        f.debug_struct("EnumDescriptorProto")
5416            .field("name", &self.name)
5417            .field("value", &self.value)
5418            .field("options", &self.options)
5419            .field("reserved_range", &self.reserved_range)
5420            .field("reserved_name", &self.reserved_name)
5421            .field("visibility", &self.visibility)
5422            .finish()
5423    }
5424}
5425impl EnumDescriptorProto {
5426    /// Protobuf type URL for this message, for use with `Any::pack` and
5427    /// `Any::unpack_if`.
5428    ///
5429    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5430    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5431}
5432impl EnumDescriptorProto {
5433    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5434    #[inline]
5435    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5436    pub fn with_name(
5437        mut self,
5438        value: impl Into<::buffa::alloc::string::String>,
5439    ) -> Self {
5440        self.name = Some(value.into());
5441        self
5442    }
5443    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5444    #[inline]
5445    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
5446    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
5447        self.visibility = Some(value.into());
5448        self
5449    }
5450}
5451::buffa::impl_default_instance!(EnumDescriptorProto);
5452impl ::buffa::MessageName for EnumDescriptorProto {
5453    const PACKAGE: &'static str = "google.protobuf";
5454    const NAME: &'static str = "EnumDescriptorProto";
5455    const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto";
5456    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5457}
5458impl ::buffa::Message for EnumDescriptorProto {
5459    /// Returns the total encoded size in bytes.
5460    ///
5461    /// Accumulates in `u64` (which cannot overflow for in-memory
5462    /// data) and saturates to `u32` at return, so a message whose
5463    /// encoded size exceeds the 2 GiB protobuf limit yields a value
5464    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5465    /// points reject, never a silently wrapped size.
5466    #[allow(clippy::let_and_return)]
5467    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5468        #[allow(unused_imports)]
5469        use ::buffa::Enumeration as _;
5470        let mut size = 0u64;
5471        if let Some(ref v) = self.name {
5472            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5473        }
5474        for v in &self.value {
5475            let __slot = __cache.reserve();
5476            let inner_size = v.compute_size(__cache);
5477            __cache.set(__slot, inner_size);
5478            size
5479                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5480                    + inner_size as u64;
5481        }
5482        if self.options.is_set() {
5483            let __slot = __cache.reserve();
5484            let inner_size = self.options.compute_size(__cache);
5485            __cache.set(__slot, inner_size);
5486            size
5487                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5488                    + inner_size as u64;
5489        }
5490        for v in &self.reserved_range {
5491            let __slot = __cache.reserve();
5492            let inner_size = v.compute_size(__cache);
5493            __cache.set(__slot, inner_size);
5494            size
5495                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5496                    + inner_size as u64;
5497        }
5498        for v in &self.reserved_name {
5499            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5500        }
5501        if let Some(ref v) = self.visibility {
5502            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
5503        }
5504        size += self.__buffa_unknown_fields.encoded_len() as u64;
5505        ::buffa::saturate_size(size)
5506    }
5507    fn write_to(
5508        &self,
5509        __cache: &mut ::buffa::SizeCache,
5510        buf: &mut impl ::buffa::EncodeSink,
5511    ) {
5512        #[allow(unused_imports)]
5513        use ::buffa::Enumeration as _;
5514        if let Some(ref v) = self.name {
5515            ::buffa::types::put_string_field(1u32, v, buf);
5516        }
5517        for v in &self.value {
5518            ::buffa::types::put_len_delimited_header(
5519                2u32,
5520                u64::from(__cache.consume_next()),
5521                buf,
5522            );
5523            v.write_to(__cache, buf);
5524        }
5525        if self.options.is_set() {
5526            ::buffa::types::put_len_delimited_header(
5527                3u32,
5528                u64::from(__cache.consume_next()),
5529                buf,
5530            );
5531            self.options.write_to(__cache, buf);
5532        }
5533        for v in &self.reserved_range {
5534            ::buffa::types::put_len_delimited_header(
5535                4u32,
5536                u64::from(__cache.consume_next()),
5537                buf,
5538            );
5539            v.write_to(__cache, buf);
5540        }
5541        for v in &self.reserved_name {
5542            ::buffa::types::put_string_field(5u32, v, buf);
5543        }
5544        if let Some(ref v) = self.visibility {
5545            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
5546        }
5547        self.__buffa_unknown_fields.write_to(buf);
5548    }
5549    fn merge_field(
5550        &mut self,
5551        tag: ::buffa::encoding::Tag,
5552        buf: &mut impl ::buffa::bytes::Buf,
5553        ctx: ::buffa::DecodeContext<'_>,
5554    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5555        #[allow(unused_imports)]
5556        use ::buffa::bytes::Buf as _;
5557        #[allow(unused_imports)]
5558        use ::buffa::Enumeration as _;
5559        match tag.field_number() {
5560            1u32 => {
5561                ::buffa::encoding::check_wire_type(
5562                    tag,
5563                    ::buffa::encoding::WireType::LengthDelimited,
5564                )?;
5565                ::buffa::types::merge_string(
5566                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5567                    buf,
5568                )?;
5569            }
5570            2u32 => {
5571                ::buffa::encoding::check_wire_type(
5572                    tag,
5573                    ::buffa::encoding::WireType::LengthDelimited,
5574                )?;
5575                let mut elem = ::core::default::Default::default();
5576                ctx.register_element_memory(
5577                    ::buffa::__private::element_footprint(&elem),
5578                )?;
5579                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5580                self.value.push(elem);
5581            }
5582            3u32 => {
5583                ::buffa::encoding::check_wire_type(
5584                    tag,
5585                    ::buffa::encoding::WireType::LengthDelimited,
5586                )?;
5587                ::buffa::Message::merge_length_delimited(
5588                    self.options.get_or_insert_default(),
5589                    buf,
5590                    ctx,
5591                )?;
5592            }
5593            4u32 => {
5594                ::buffa::encoding::check_wire_type(
5595                    tag,
5596                    ::buffa::encoding::WireType::LengthDelimited,
5597                )?;
5598                let mut elem = ::core::default::Default::default();
5599                ctx.register_element_memory(
5600                    ::buffa::__private::element_footprint(&elem),
5601                )?;
5602                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5603                self.reserved_range.push(elem);
5604            }
5605            5u32 => {
5606                ::buffa::encoding::check_wire_type(
5607                    tag,
5608                    ::buffa::encoding::WireType::LengthDelimited,
5609                )?;
5610                let __elem = ::buffa::types::decode_string(buf)?;
5611                ctx.register_element_memory(
5612                    ::buffa::__private::element_footprint(&__elem),
5613                )?;
5614                self.reserved_name.push(__elem);
5615            }
5616            6u32 => {
5617                ::buffa::encoding::check_wire_type(
5618                    tag,
5619                    ::buffa::encoding::WireType::Varint,
5620                )?;
5621                let __raw = ::buffa::types::decode_int32(buf)?;
5622                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
5623                    __raw,
5624                ) {
5625                    self.visibility = ::core::option::Option::Some(__v);
5626                } else {
5627                    ctx.register_unknown_field()?;
5628                    self.__buffa_unknown_fields
5629                        .push(::buffa::UnknownField {
5630                            number: 6u32,
5631                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
5632                        });
5633                }
5634            }
5635            _ => {
5636                self.__buffa_unknown_fields
5637                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5638            }
5639        }
5640        ::core::result::Result::Ok(())
5641    }
5642    fn clear(&mut self) {
5643        self.name = ::core::option::Option::None;
5644        self.value.clear();
5645        self.options = ::buffa::MessageField::none();
5646        self.reserved_range.clear();
5647        self.reserved_name.clear();
5648        self.visibility = ::core::option::Option::None;
5649        self.__buffa_unknown_fields.clear();
5650    }
5651}
5652impl ::buffa::ExtensionSet for EnumDescriptorProto {
5653    const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto";
5654    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5655        &self.__buffa_unknown_fields
5656    }
5657    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5658        &mut self.__buffa_unknown_fields
5659    }
5660}
5661#[cfg(feature = "text")]
5662impl ::buffa::text::TextFormat for EnumDescriptorProto {
5663    fn encode_text(
5664        &self,
5665        enc: &mut ::buffa::text::TextEncoder<'_>,
5666    ) -> ::core::fmt::Result {
5667        #[allow(unused_imports)]
5668        use ::buffa::Enumeration as _;
5669        if let ::core::option::Option::Some(ref __v) = self.name {
5670            enc.write_field_name("name")?;
5671            enc.write_string(__v)?;
5672        }
5673        if self.options.is_set() {
5674            enc.write_field_name("options")?;
5675            enc.write_message(&*self.options)?;
5676        }
5677        if let ::core::option::Option::Some(ref __v) = self.visibility {
5678            enc.write_field_name("visibility")?;
5679            enc.write_enum_name(__v.proto_name())?;
5680        }
5681        for __v in &self.value {
5682            enc.write_field_name("value")?;
5683            enc.write_message(__v)?;
5684        }
5685        for __v in &self.reserved_range {
5686            enc.write_field_name("reserved_range")?;
5687            enc.write_message(__v)?;
5688        }
5689        for __v in &self.reserved_name {
5690            enc.write_field_name("reserved_name")?;
5691            enc.write_string(__v)?;
5692        }
5693        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5694        ::core::result::Result::Ok(())
5695    }
5696    fn merge_text(
5697        &mut self,
5698        dec: &mut ::buffa::text::TextDecoder<'_>,
5699    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5700        #[allow(unused_imports)]
5701        use ::buffa::Enumeration as _;
5702        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5703            match __name {
5704                "name" => {
5705                    self.name = ::core::option::Option::Some(
5706                        dec.read_string()?.into_owned(),
5707                    );
5708                }
5709                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5710                "visibility" => {
5711                    self.visibility = ::core::option::Option::Some(
5712                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
5713                    );
5714                }
5715                "value" => {
5716                    dec.read_repeated_into(
5717                        &mut self.value,
5718                        |__d| {
5719                            let mut __m = ::core::default::Default::default();
5720                            __d.merge_message(&mut __m)?;
5721                            ::core::result::Result::Ok(__m)
5722                        },
5723                    )?
5724                }
5725                "reserved_range" => {
5726                    dec.read_repeated_into(
5727                        &mut self.reserved_range,
5728                        |__d| {
5729                            let mut __m = ::core::default::Default::default();
5730                            __d.merge_message(&mut __m)?;
5731                            ::core::result::Result::Ok(__m)
5732                        },
5733                    )?
5734                }
5735                "reserved_name" => {
5736                    dec.read_repeated_into(
5737                        &mut self.reserved_name,
5738                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
5739                    )?
5740                }
5741                _ => dec.skip_value()?,
5742            }
5743        }
5744        ::core::result::Result::Ok(())
5745    }
5746}
5747#[cfg(feature = "json")]
5748impl ::buffa::json_helpers::ProtoElemJson for EnumDescriptorProto {
5749    fn serialize_proto_json<S: ::serde::Serializer>(
5750        v: &Self,
5751        s: S,
5752    ) -> ::core::result::Result<S::Ok, S::Error> {
5753        ::serde::Serialize::serialize(v, s)
5754    }
5755    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5756        d: D,
5757    ) -> ::core::result::Result<Self, D::Error> {
5758        <Self as ::serde::Deserialize>::deserialize(d)
5759    }
5760}
5761#[cfg(feature = "json")]
5762#[doc(hidden)]
5763pub const __ENUM_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5764    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5765    to_json: ::buffa::type_registry::any_to_json::<EnumDescriptorProto>,
5766    from_json: ::buffa::type_registry::any_from_json::<EnumDescriptorProto>,
5767    is_wkt: false,
5768};
5769#[cfg(feature = "text")]
5770#[doc(hidden)]
5771pub const __ENUM_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5772    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5773    text_encode: ::buffa::type_registry::any_encode_text::<EnumDescriptorProto>,
5774    text_merge: ::buffa::type_registry::any_merge_text::<EnumDescriptorProto>,
5775};
5776pub mod enum_descriptor_proto {
5777    #[allow(unused_imports)]
5778    use super::*;
5779    /// Range of reserved numeric values. Reserved values may not be used by
5780    /// entries in the same enum. Reserved ranges may not overlap.
5781    ///
5782    /// Note that this is distinct from DescriptorProto.ReservedRange in that it
5783    /// is inclusive such that it can appropriately represent the entire int32
5784    /// domain.
5785    #[derive(Clone, PartialEq, Default)]
5786    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5787    #[cfg_attr(feature = "json", serde(default))]
5788    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5789    pub struct EnumReservedRange {
5790        /// Inclusive.
5791        ///
5792        /// Field 1: `start`
5793        #[cfg_attr(
5794            feature = "json",
5795            serde(
5796                rename = "start",
5797                with = "::buffa::json_helpers::opt_int32",
5798                skip_serializing_if = "::core::option::Option::is_none"
5799            )
5800        )]
5801        pub start: ::core::option::Option<i32>,
5802        /// Inclusive.
5803        ///
5804        /// Field 2: `end`
5805        #[cfg_attr(
5806            feature = "json",
5807            serde(
5808                rename = "end",
5809                with = "::buffa::json_helpers::opt_int32",
5810                skip_serializing_if = "::core::option::Option::is_none"
5811            )
5812        )]
5813        pub end: ::core::option::Option<i32>,
5814        #[cfg_attr(feature = "json", serde(skip))]
5815        #[doc(hidden)]
5816        pub __buffa_unknown_fields: ::buffa::UnknownFields,
5817    }
5818    impl ::core::fmt::Debug for EnumReservedRange {
5819        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5820            f.debug_struct("EnumReservedRange")
5821                .field("start", &self.start)
5822                .field("end", &self.end)
5823                .finish()
5824        }
5825    }
5826    impl EnumReservedRange {
5827        /// Protobuf type URL for this message, for use with `Any::pack` and
5828        /// `Any::unpack_if`.
5829        ///
5830        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5831        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5832    }
5833    impl EnumReservedRange {
5834        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5835        #[inline]
5836        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
5837        pub fn with_start(mut self, value: i32) -> Self {
5838            self.start = Some(value);
5839            self
5840        }
5841        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5842        #[inline]
5843        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
5844        pub fn with_end(mut self, value: i32) -> Self {
5845            self.end = Some(value);
5846            self
5847        }
5848    }
5849    ::buffa::impl_default_instance!(EnumReservedRange);
5850    impl ::buffa::MessageName for EnumReservedRange {
5851        const PACKAGE: &'static str = "google.protobuf";
5852        const NAME: &'static str = "EnumDescriptorProto.EnumReservedRange";
5853        const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5854        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5855    }
5856    impl ::buffa::Message for EnumReservedRange {
5857        /// Returns the total encoded size in bytes.
5858        ///
5859        /// Accumulates in `u64` (which cannot overflow for in-memory
5860        /// data) and saturates to `u32` at return, so a message whose
5861        /// encoded size exceeds the 2 GiB protobuf limit yields a value
5862        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5863        /// points reject, never a silently wrapped size.
5864        #[allow(clippy::let_and_return)]
5865        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5866            #[allow(unused_imports)]
5867            use ::buffa::Enumeration as _;
5868            let mut size = 0u64;
5869            if let Some(v) = self.start {
5870                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
5871            }
5872            if let Some(v) = self.end {
5873                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
5874            }
5875            size += self.__buffa_unknown_fields.encoded_len() as u64;
5876            ::buffa::saturate_size(size)
5877        }
5878        fn write_to(
5879            &self,
5880            _cache: &mut ::buffa::SizeCache,
5881            buf: &mut impl ::buffa::EncodeSink,
5882        ) {
5883            #[allow(unused_imports)]
5884            use ::buffa::Enumeration as _;
5885            if let Some(v) = self.start {
5886                ::buffa::types::put_int32_field(1u32, v, buf);
5887            }
5888            if let Some(v) = self.end {
5889                ::buffa::types::put_int32_field(2u32, v, buf);
5890            }
5891            self.__buffa_unknown_fields.write_to(buf);
5892        }
5893        fn merge_field(
5894            &mut self,
5895            tag: ::buffa::encoding::Tag,
5896            buf: &mut impl ::buffa::bytes::Buf,
5897            ctx: ::buffa::DecodeContext<'_>,
5898        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5899            #[allow(unused_imports)]
5900            use ::buffa::bytes::Buf as _;
5901            #[allow(unused_imports)]
5902            use ::buffa::Enumeration as _;
5903            match tag.field_number() {
5904                1u32 => {
5905                    ::buffa::encoding::check_wire_type(
5906                        tag,
5907                        ::buffa::encoding::WireType::Varint,
5908                    )?;
5909                    self.start = ::core::option::Option::Some(
5910                        ::buffa::types::decode_int32(buf)?,
5911                    );
5912                }
5913                2u32 => {
5914                    ::buffa::encoding::check_wire_type(
5915                        tag,
5916                        ::buffa::encoding::WireType::Varint,
5917                    )?;
5918                    self.end = ::core::option::Option::Some(
5919                        ::buffa::types::decode_int32(buf)?,
5920                    );
5921                }
5922                _ => {
5923                    self.__buffa_unknown_fields
5924                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5925                }
5926            }
5927            ::core::result::Result::Ok(())
5928        }
5929        fn clear(&mut self) {
5930            self.start = ::core::option::Option::None;
5931            self.end = ::core::option::Option::None;
5932            self.__buffa_unknown_fields.clear();
5933        }
5934    }
5935    impl ::buffa::ExtensionSet for EnumReservedRange {
5936        const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5937        fn unknown_fields(&self) -> &::buffa::UnknownFields {
5938            &self.__buffa_unknown_fields
5939        }
5940        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5941            &mut self.__buffa_unknown_fields
5942        }
5943    }
5944    #[cfg(feature = "text")]
5945    impl ::buffa::text::TextFormat for EnumReservedRange {
5946        fn encode_text(
5947            &self,
5948            enc: &mut ::buffa::text::TextEncoder<'_>,
5949        ) -> ::core::fmt::Result {
5950            #[allow(unused_imports)]
5951            use ::buffa::Enumeration as _;
5952            if let ::core::option::Option::Some(ref __v) = self.start {
5953                enc.write_field_name("start")?;
5954                enc.write_i32(*__v)?;
5955            }
5956            if let ::core::option::Option::Some(ref __v) = self.end {
5957                enc.write_field_name("end")?;
5958                enc.write_i32(*__v)?;
5959            }
5960            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5961            ::core::result::Result::Ok(())
5962        }
5963        fn merge_text(
5964            &mut self,
5965            dec: &mut ::buffa::text::TextDecoder<'_>,
5966        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5967            #[allow(unused_imports)]
5968            use ::buffa::Enumeration as _;
5969            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5970                match __name {
5971                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
5972                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
5973                    _ => dec.skip_value()?,
5974                }
5975            }
5976            ::core::result::Result::Ok(())
5977        }
5978    }
5979    #[cfg(feature = "json")]
5980    impl ::buffa::json_helpers::ProtoElemJson for EnumReservedRange {
5981        fn serialize_proto_json<S: ::serde::Serializer>(
5982            v: &Self,
5983            s: S,
5984        ) -> ::core::result::Result<S::Ok, S::Error> {
5985            ::serde::Serialize::serialize(v, s)
5986        }
5987        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5988            d: D,
5989        ) -> ::core::result::Result<Self, D::Error> {
5990            <Self as ::serde::Deserialize>::deserialize(d)
5991        }
5992    }
5993    #[cfg(feature = "json")]
5994    #[doc(hidden)]
5995    pub const __ENUM_RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5996        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
5997        to_json: ::buffa::type_registry::any_to_json::<EnumReservedRange>,
5998        from_json: ::buffa::type_registry::any_from_json::<EnumReservedRange>,
5999        is_wkt: false,
6000    };
6001    #[cfg(feature = "text")]
6002    #[doc(hidden)]
6003    pub const __ENUM_RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6004        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
6005        text_encode: ::buffa::type_registry::any_encode_text::<EnumReservedRange>,
6006        text_merge: ::buffa::type_registry::any_merge_text::<EnumReservedRange>,
6007    };
6008    #[cfg(feature = "views")]
6009    #[doc(inline)]
6010    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeView;
6011    #[cfg(feature = "views")]
6012    #[doc(inline)]
6013    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeOwnedView;
6014}
6015/// Describes a value within an enum.
6016#[derive(Clone, PartialEq, Default)]
6017#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6018#[cfg_attr(feature = "json", serde(default))]
6019#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6020pub struct EnumValueDescriptorProto {
6021    /// Field 1: `name`
6022    #[cfg_attr(
6023        feature = "json",
6024        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6025    )]
6026    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6027    /// Field 2: `number`
6028    #[cfg_attr(
6029        feature = "json",
6030        serde(
6031            rename = "number",
6032            with = "::buffa::json_helpers::opt_int32",
6033            skip_serializing_if = "::core::option::Option::is_none"
6034        )
6035    )]
6036    pub number: ::core::option::Option<i32>,
6037    /// Field 3: `options`
6038    #[cfg_attr(
6039        feature = "json",
6040        serde(
6041            rename = "options",
6042            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6043        )
6044    )]
6045    pub options: ::buffa::MessageField<
6046        EnumValueOptions,
6047        ::buffa::Inline<EnumValueOptions>,
6048    >,
6049    #[cfg_attr(feature = "json", serde(skip))]
6050    #[doc(hidden)]
6051    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6052}
6053impl ::core::fmt::Debug for EnumValueDescriptorProto {
6054    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6055        f.debug_struct("EnumValueDescriptorProto")
6056            .field("name", &self.name)
6057            .field("number", &self.number)
6058            .field("options", &self.options)
6059            .finish()
6060    }
6061}
6062impl EnumValueDescriptorProto {
6063    /// Protobuf type URL for this message, for use with `Any::pack` and
6064    /// `Any::unpack_if`.
6065    ///
6066    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6067    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6068}
6069impl EnumValueDescriptorProto {
6070    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6071    #[inline]
6072    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6073    pub fn with_name(
6074        mut self,
6075        value: impl Into<::buffa::alloc::string::String>,
6076    ) -> Self {
6077        self.name = Some(value.into());
6078        self
6079    }
6080    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6081    #[inline]
6082    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
6083    pub fn with_number(mut self, value: i32) -> Self {
6084        self.number = Some(value);
6085        self
6086    }
6087}
6088::buffa::impl_default_instance!(EnumValueDescriptorProto);
6089impl ::buffa::MessageName for EnumValueDescriptorProto {
6090    const PACKAGE: &'static str = "google.protobuf";
6091    const NAME: &'static str = "EnumValueDescriptorProto";
6092    const FULL_NAME: &'static str = "google.protobuf.EnumValueDescriptorProto";
6093    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6094}
6095impl ::buffa::Message for EnumValueDescriptorProto {
6096    /// Returns the total encoded size in bytes.
6097    ///
6098    /// Accumulates in `u64` (which cannot overflow for in-memory
6099    /// data) and saturates to `u32` at return, so a message whose
6100    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6101    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6102    /// points reject, never a silently wrapped size.
6103    #[allow(clippy::let_and_return)]
6104    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6105        #[allow(unused_imports)]
6106        use ::buffa::Enumeration as _;
6107        let mut size = 0u64;
6108        if let Some(ref v) = self.name {
6109            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6110        }
6111        if let Some(v) = self.number {
6112            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
6113        }
6114        if self.options.is_set() {
6115            let __slot = __cache.reserve();
6116            let inner_size = self.options.compute_size(__cache);
6117            __cache.set(__slot, inner_size);
6118            size
6119                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6120                    + inner_size as u64;
6121        }
6122        size += self.__buffa_unknown_fields.encoded_len() as u64;
6123        ::buffa::saturate_size(size)
6124    }
6125    fn write_to(
6126        &self,
6127        __cache: &mut ::buffa::SizeCache,
6128        buf: &mut impl ::buffa::EncodeSink,
6129    ) {
6130        #[allow(unused_imports)]
6131        use ::buffa::Enumeration as _;
6132        if let Some(ref v) = self.name {
6133            ::buffa::types::put_string_field(1u32, v, buf);
6134        }
6135        if let Some(v) = self.number {
6136            ::buffa::types::put_int32_field(2u32, v, buf);
6137        }
6138        if self.options.is_set() {
6139            ::buffa::types::put_len_delimited_header(
6140                3u32,
6141                u64::from(__cache.consume_next()),
6142                buf,
6143            );
6144            self.options.write_to(__cache, buf);
6145        }
6146        self.__buffa_unknown_fields.write_to(buf);
6147    }
6148    fn merge_field(
6149        &mut self,
6150        tag: ::buffa::encoding::Tag,
6151        buf: &mut impl ::buffa::bytes::Buf,
6152        ctx: ::buffa::DecodeContext<'_>,
6153    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6154        #[allow(unused_imports)]
6155        use ::buffa::bytes::Buf as _;
6156        #[allow(unused_imports)]
6157        use ::buffa::Enumeration as _;
6158        match tag.field_number() {
6159            1u32 => {
6160                ::buffa::encoding::check_wire_type(
6161                    tag,
6162                    ::buffa::encoding::WireType::LengthDelimited,
6163                )?;
6164                ::buffa::types::merge_string(
6165                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6166                    buf,
6167                )?;
6168            }
6169            2u32 => {
6170                ::buffa::encoding::check_wire_type(
6171                    tag,
6172                    ::buffa::encoding::WireType::Varint,
6173                )?;
6174                self.number = ::core::option::Option::Some(
6175                    ::buffa::types::decode_int32(buf)?,
6176                );
6177            }
6178            3u32 => {
6179                ::buffa::encoding::check_wire_type(
6180                    tag,
6181                    ::buffa::encoding::WireType::LengthDelimited,
6182                )?;
6183                ::buffa::Message::merge_length_delimited(
6184                    self.options.get_or_insert_default(),
6185                    buf,
6186                    ctx,
6187                )?;
6188            }
6189            _ => {
6190                self.__buffa_unknown_fields
6191                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6192            }
6193        }
6194        ::core::result::Result::Ok(())
6195    }
6196    fn clear(&mut self) {
6197        self.name = ::core::option::Option::None;
6198        self.number = ::core::option::Option::None;
6199        self.options = ::buffa::MessageField::none();
6200        self.__buffa_unknown_fields.clear();
6201    }
6202}
6203impl ::buffa::ExtensionSet for EnumValueDescriptorProto {
6204    const PROTO_FQN: &'static str = "google.protobuf.EnumValueDescriptorProto";
6205    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6206        &self.__buffa_unknown_fields
6207    }
6208    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6209        &mut self.__buffa_unknown_fields
6210    }
6211}
6212#[cfg(feature = "text")]
6213impl ::buffa::text::TextFormat for EnumValueDescriptorProto {
6214    fn encode_text(
6215        &self,
6216        enc: &mut ::buffa::text::TextEncoder<'_>,
6217    ) -> ::core::fmt::Result {
6218        #[allow(unused_imports)]
6219        use ::buffa::Enumeration as _;
6220        if let ::core::option::Option::Some(ref __v) = self.name {
6221            enc.write_field_name("name")?;
6222            enc.write_string(__v)?;
6223        }
6224        if let ::core::option::Option::Some(ref __v) = self.number {
6225            enc.write_field_name("number")?;
6226            enc.write_i32(*__v)?;
6227        }
6228        if self.options.is_set() {
6229            enc.write_field_name("options")?;
6230            enc.write_message(&*self.options)?;
6231        }
6232        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6233        ::core::result::Result::Ok(())
6234    }
6235    fn merge_text(
6236        &mut self,
6237        dec: &mut ::buffa::text::TextDecoder<'_>,
6238    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6239        #[allow(unused_imports)]
6240        use ::buffa::Enumeration as _;
6241        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6242            match __name {
6243                "name" => {
6244                    self.name = ::core::option::Option::Some(
6245                        dec.read_string()?.into_owned(),
6246                    );
6247                }
6248                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
6249                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6250                _ => dec.skip_value()?,
6251            }
6252        }
6253        ::core::result::Result::Ok(())
6254    }
6255}
6256#[cfg(feature = "json")]
6257impl ::buffa::json_helpers::ProtoElemJson for EnumValueDescriptorProto {
6258    fn serialize_proto_json<S: ::serde::Serializer>(
6259        v: &Self,
6260        s: S,
6261    ) -> ::core::result::Result<S::Ok, S::Error> {
6262        ::serde::Serialize::serialize(v, s)
6263    }
6264    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6265        d: D,
6266    ) -> ::core::result::Result<Self, D::Error> {
6267        <Self as ::serde::Deserialize>::deserialize(d)
6268    }
6269}
6270#[cfg(feature = "json")]
6271#[doc(hidden)]
6272pub const __ENUM_VALUE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6273    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6274    to_json: ::buffa::type_registry::any_to_json::<EnumValueDescriptorProto>,
6275    from_json: ::buffa::type_registry::any_from_json::<EnumValueDescriptorProto>,
6276    is_wkt: false,
6277};
6278#[cfg(feature = "text")]
6279#[doc(hidden)]
6280pub const __ENUM_VALUE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6281    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6282    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueDescriptorProto>,
6283    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueDescriptorProto>,
6284};
6285/// Describes a service.
6286#[derive(Clone, PartialEq, Default)]
6287#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6288#[cfg_attr(feature = "json", serde(default))]
6289#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6290pub struct ServiceDescriptorProto {
6291    /// Field 1: `name`
6292    #[cfg_attr(
6293        feature = "json",
6294        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6295    )]
6296    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6297    /// Field 2: `method`
6298    #[cfg_attr(
6299        feature = "json",
6300        serde(
6301            rename = "method",
6302            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
6303            deserialize_with = "::buffa::json_helpers::null_as_default"
6304        )
6305    )]
6306    pub method: ::buffa::alloc::vec::Vec<MethodDescriptorProto>,
6307    /// Field 3: `options`
6308    #[cfg_attr(
6309        feature = "json",
6310        serde(
6311            rename = "options",
6312            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6313        )
6314    )]
6315    pub options: ::buffa::MessageField<ServiceOptions, ::buffa::Inline<ServiceOptions>>,
6316    #[cfg_attr(feature = "json", serde(skip))]
6317    #[doc(hidden)]
6318    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6319}
6320impl ::core::fmt::Debug for ServiceDescriptorProto {
6321    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6322        f.debug_struct("ServiceDescriptorProto")
6323            .field("name", &self.name)
6324            .field("method", &self.method)
6325            .field("options", &self.options)
6326            .finish()
6327    }
6328}
6329impl ServiceDescriptorProto {
6330    /// Protobuf type URL for this message, for use with `Any::pack` and
6331    /// `Any::unpack_if`.
6332    ///
6333    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6334    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6335}
6336impl ServiceDescriptorProto {
6337    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6338    #[inline]
6339    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6340    pub fn with_name(
6341        mut self,
6342        value: impl Into<::buffa::alloc::string::String>,
6343    ) -> Self {
6344        self.name = Some(value.into());
6345        self
6346    }
6347}
6348::buffa::impl_default_instance!(ServiceDescriptorProto);
6349impl ::buffa::MessageName for ServiceDescriptorProto {
6350    const PACKAGE: &'static str = "google.protobuf";
6351    const NAME: &'static str = "ServiceDescriptorProto";
6352    const FULL_NAME: &'static str = "google.protobuf.ServiceDescriptorProto";
6353    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6354}
6355impl ::buffa::Message for ServiceDescriptorProto {
6356    /// Returns the total encoded size in bytes.
6357    ///
6358    /// Accumulates in `u64` (which cannot overflow for in-memory
6359    /// data) and saturates to `u32` at return, so a message whose
6360    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6361    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6362    /// points reject, never a silently wrapped size.
6363    #[allow(clippy::let_and_return)]
6364    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6365        #[allow(unused_imports)]
6366        use ::buffa::Enumeration as _;
6367        let mut size = 0u64;
6368        if let Some(ref v) = self.name {
6369            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6370        }
6371        for v in &self.method {
6372            let __slot = __cache.reserve();
6373            let inner_size = v.compute_size(__cache);
6374            __cache.set(__slot, inner_size);
6375            size
6376                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6377                    + inner_size as u64;
6378        }
6379        if self.options.is_set() {
6380            let __slot = __cache.reserve();
6381            let inner_size = self.options.compute_size(__cache);
6382            __cache.set(__slot, inner_size);
6383            size
6384                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6385                    + inner_size as u64;
6386        }
6387        size += self.__buffa_unknown_fields.encoded_len() as u64;
6388        ::buffa::saturate_size(size)
6389    }
6390    fn write_to(
6391        &self,
6392        __cache: &mut ::buffa::SizeCache,
6393        buf: &mut impl ::buffa::EncodeSink,
6394    ) {
6395        #[allow(unused_imports)]
6396        use ::buffa::Enumeration as _;
6397        if let Some(ref v) = self.name {
6398            ::buffa::types::put_string_field(1u32, v, buf);
6399        }
6400        for v in &self.method {
6401            ::buffa::types::put_len_delimited_header(
6402                2u32,
6403                u64::from(__cache.consume_next()),
6404                buf,
6405            );
6406            v.write_to(__cache, buf);
6407        }
6408        if self.options.is_set() {
6409            ::buffa::types::put_len_delimited_header(
6410                3u32,
6411                u64::from(__cache.consume_next()),
6412                buf,
6413            );
6414            self.options.write_to(__cache, buf);
6415        }
6416        self.__buffa_unknown_fields.write_to(buf);
6417    }
6418    fn merge_field(
6419        &mut self,
6420        tag: ::buffa::encoding::Tag,
6421        buf: &mut impl ::buffa::bytes::Buf,
6422        ctx: ::buffa::DecodeContext<'_>,
6423    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6424        #[allow(unused_imports)]
6425        use ::buffa::bytes::Buf as _;
6426        #[allow(unused_imports)]
6427        use ::buffa::Enumeration as _;
6428        match tag.field_number() {
6429            1u32 => {
6430                ::buffa::encoding::check_wire_type(
6431                    tag,
6432                    ::buffa::encoding::WireType::LengthDelimited,
6433                )?;
6434                ::buffa::types::merge_string(
6435                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6436                    buf,
6437                )?;
6438            }
6439            2u32 => {
6440                ::buffa::encoding::check_wire_type(
6441                    tag,
6442                    ::buffa::encoding::WireType::LengthDelimited,
6443                )?;
6444                let mut elem = ::core::default::Default::default();
6445                ctx.register_element_memory(
6446                    ::buffa::__private::element_footprint(&elem),
6447                )?;
6448                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
6449                self.method.push(elem);
6450            }
6451            3u32 => {
6452                ::buffa::encoding::check_wire_type(
6453                    tag,
6454                    ::buffa::encoding::WireType::LengthDelimited,
6455                )?;
6456                ::buffa::Message::merge_length_delimited(
6457                    self.options.get_or_insert_default(),
6458                    buf,
6459                    ctx,
6460                )?;
6461            }
6462            _ => {
6463                self.__buffa_unknown_fields
6464                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6465            }
6466        }
6467        ::core::result::Result::Ok(())
6468    }
6469    fn clear(&mut self) {
6470        self.name = ::core::option::Option::None;
6471        self.method.clear();
6472        self.options = ::buffa::MessageField::none();
6473        self.__buffa_unknown_fields.clear();
6474    }
6475}
6476impl ::buffa::ExtensionSet for ServiceDescriptorProto {
6477    const PROTO_FQN: &'static str = "google.protobuf.ServiceDescriptorProto";
6478    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6479        &self.__buffa_unknown_fields
6480    }
6481    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6482        &mut self.__buffa_unknown_fields
6483    }
6484}
6485#[cfg(feature = "text")]
6486impl ::buffa::text::TextFormat for ServiceDescriptorProto {
6487    fn encode_text(
6488        &self,
6489        enc: &mut ::buffa::text::TextEncoder<'_>,
6490    ) -> ::core::fmt::Result {
6491        #[allow(unused_imports)]
6492        use ::buffa::Enumeration as _;
6493        if let ::core::option::Option::Some(ref __v) = self.name {
6494            enc.write_field_name("name")?;
6495            enc.write_string(__v)?;
6496        }
6497        if self.options.is_set() {
6498            enc.write_field_name("options")?;
6499            enc.write_message(&*self.options)?;
6500        }
6501        for __v in &self.method {
6502            enc.write_field_name("method")?;
6503            enc.write_message(__v)?;
6504        }
6505        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6506        ::core::result::Result::Ok(())
6507    }
6508    fn merge_text(
6509        &mut self,
6510        dec: &mut ::buffa::text::TextDecoder<'_>,
6511    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6512        #[allow(unused_imports)]
6513        use ::buffa::Enumeration as _;
6514        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6515            match __name {
6516                "name" => {
6517                    self.name = ::core::option::Option::Some(
6518                        dec.read_string()?.into_owned(),
6519                    );
6520                }
6521                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6522                "method" => {
6523                    dec.read_repeated_into(
6524                        &mut self.method,
6525                        |__d| {
6526                            let mut __m = ::core::default::Default::default();
6527                            __d.merge_message(&mut __m)?;
6528                            ::core::result::Result::Ok(__m)
6529                        },
6530                    )?
6531                }
6532                _ => dec.skip_value()?,
6533            }
6534        }
6535        ::core::result::Result::Ok(())
6536    }
6537}
6538#[cfg(feature = "json")]
6539impl ::buffa::json_helpers::ProtoElemJson for ServiceDescriptorProto {
6540    fn serialize_proto_json<S: ::serde::Serializer>(
6541        v: &Self,
6542        s: S,
6543    ) -> ::core::result::Result<S::Ok, S::Error> {
6544        ::serde::Serialize::serialize(v, s)
6545    }
6546    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6547        d: D,
6548    ) -> ::core::result::Result<Self, D::Error> {
6549        <Self as ::serde::Deserialize>::deserialize(d)
6550    }
6551}
6552#[cfg(feature = "json")]
6553#[doc(hidden)]
6554pub const __SERVICE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6555    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6556    to_json: ::buffa::type_registry::any_to_json::<ServiceDescriptorProto>,
6557    from_json: ::buffa::type_registry::any_from_json::<ServiceDescriptorProto>,
6558    is_wkt: false,
6559};
6560#[cfg(feature = "text")]
6561#[doc(hidden)]
6562pub const __SERVICE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6563    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6564    text_encode: ::buffa::type_registry::any_encode_text::<ServiceDescriptorProto>,
6565    text_merge: ::buffa::type_registry::any_merge_text::<ServiceDescriptorProto>,
6566};
6567/// Describes a method of a service.
6568#[derive(Clone, PartialEq, Default)]
6569#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6570#[cfg_attr(feature = "json", serde(default))]
6571#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6572pub struct MethodDescriptorProto {
6573    /// Field 1: `name`
6574    #[cfg_attr(
6575        feature = "json",
6576        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6577    )]
6578    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6579    /// Input and output type names.  These are resolved in the same way as
6580    /// FieldDescriptorProto.type_name, but must refer to a message type.
6581    ///
6582    /// Field 2: `input_type`
6583    #[cfg_attr(
6584        feature = "json",
6585        serde(
6586            rename = "inputType",
6587            alias = "input_type",
6588            skip_serializing_if = "::core::option::Option::is_none"
6589        )
6590    )]
6591    pub input_type: ::core::option::Option<::buffa::alloc::string::String>,
6592    /// Field 3: `output_type`
6593    #[cfg_attr(
6594        feature = "json",
6595        serde(
6596            rename = "outputType",
6597            alias = "output_type",
6598            skip_serializing_if = "::core::option::Option::is_none"
6599        )
6600    )]
6601    pub output_type: ::core::option::Option<::buffa::alloc::string::String>,
6602    /// Field 4: `options`
6603    #[cfg_attr(
6604        feature = "json",
6605        serde(
6606            rename = "options",
6607            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6608        )
6609    )]
6610    pub options: ::buffa::MessageField<MethodOptions, ::buffa::Inline<MethodOptions>>,
6611    /// Identifies if client streams multiple client messages
6612    ///
6613    /// Field 5: `client_streaming`
6614    #[cfg_attr(
6615        feature = "json",
6616        serde(
6617            rename = "clientStreaming",
6618            alias = "client_streaming",
6619            skip_serializing_if = "::core::option::Option::is_none"
6620        )
6621    )]
6622    pub client_streaming: ::core::option::Option<bool>,
6623    /// Identifies if server streams multiple server messages
6624    ///
6625    /// Field 6: `server_streaming`
6626    #[cfg_attr(
6627        feature = "json",
6628        serde(
6629            rename = "serverStreaming",
6630            alias = "server_streaming",
6631            skip_serializing_if = "::core::option::Option::is_none"
6632        )
6633    )]
6634    pub server_streaming: ::core::option::Option<bool>,
6635    #[cfg_attr(feature = "json", serde(skip))]
6636    #[doc(hidden)]
6637    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6638}
6639impl ::core::fmt::Debug for MethodDescriptorProto {
6640    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6641        f.debug_struct("MethodDescriptorProto")
6642            .field("name", &self.name)
6643            .field("input_type", &self.input_type)
6644            .field("output_type", &self.output_type)
6645            .field("options", &self.options)
6646            .field("client_streaming", &self.client_streaming)
6647            .field("server_streaming", &self.server_streaming)
6648            .finish()
6649    }
6650}
6651impl MethodDescriptorProto {
6652    /// Protobuf type URL for this message, for use with `Any::pack` and
6653    /// `Any::unpack_if`.
6654    ///
6655    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6656    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6657}
6658impl MethodDescriptorProto {
6659    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6660    #[inline]
6661    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6662    pub fn with_name(
6663        mut self,
6664        value: impl Into<::buffa::alloc::string::String>,
6665    ) -> Self {
6666        self.name = Some(value.into());
6667        self
6668    }
6669    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6670    #[inline]
6671    ///Sets [`Self::input_type`] to `Some(value)`, consuming and returning `self`.
6672    pub fn with_input_type(
6673        mut self,
6674        value: impl Into<::buffa::alloc::string::String>,
6675    ) -> Self {
6676        self.input_type = Some(value.into());
6677        self
6678    }
6679    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6680    #[inline]
6681    ///Sets [`Self::output_type`] to `Some(value)`, consuming and returning `self`.
6682    pub fn with_output_type(
6683        mut self,
6684        value: impl Into<::buffa::alloc::string::String>,
6685    ) -> Self {
6686        self.output_type = Some(value.into());
6687        self
6688    }
6689    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6690    #[inline]
6691    ///Sets [`Self::client_streaming`] to `Some(value)`, consuming and returning `self`.
6692    pub fn with_client_streaming(mut self, value: bool) -> Self {
6693        self.client_streaming = Some(value);
6694        self
6695    }
6696    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6697    #[inline]
6698    ///Sets [`Self::server_streaming`] to `Some(value)`, consuming and returning `self`.
6699    pub fn with_server_streaming(mut self, value: bool) -> Self {
6700        self.server_streaming = Some(value);
6701        self
6702    }
6703}
6704::buffa::impl_default_instance!(MethodDescriptorProto);
6705impl ::buffa::MessageName for MethodDescriptorProto {
6706    const PACKAGE: &'static str = "google.protobuf";
6707    const NAME: &'static str = "MethodDescriptorProto";
6708    const FULL_NAME: &'static str = "google.protobuf.MethodDescriptorProto";
6709    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6710}
6711impl ::buffa::Message for MethodDescriptorProto {
6712    /// Returns the total encoded size in bytes.
6713    ///
6714    /// Accumulates in `u64` (which cannot overflow for in-memory
6715    /// data) and saturates to `u32` at return, so a message whose
6716    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6717    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6718    /// points reject, never a silently wrapped size.
6719    #[allow(clippy::let_and_return)]
6720    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6721        #[allow(unused_imports)]
6722        use ::buffa::Enumeration as _;
6723        let mut size = 0u64;
6724        if let Some(ref v) = self.name {
6725            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6726        }
6727        if let Some(ref v) = self.input_type {
6728            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6729        }
6730        if let Some(ref v) = self.output_type {
6731            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6732        }
6733        if self.options.is_set() {
6734            let __slot = __cache.reserve();
6735            let inner_size = self.options.compute_size(__cache);
6736            __cache.set(__slot, inner_size);
6737            size
6738                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6739                    + inner_size as u64;
6740        }
6741        if self.client_streaming.is_some() {
6742            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
6743        }
6744        if self.server_streaming.is_some() {
6745            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
6746        }
6747        size += self.__buffa_unknown_fields.encoded_len() as u64;
6748        ::buffa::saturate_size(size)
6749    }
6750    fn write_to(
6751        &self,
6752        __cache: &mut ::buffa::SizeCache,
6753        buf: &mut impl ::buffa::EncodeSink,
6754    ) {
6755        #[allow(unused_imports)]
6756        use ::buffa::Enumeration as _;
6757        if let Some(ref v) = self.name {
6758            ::buffa::types::put_string_field(1u32, v, buf);
6759        }
6760        if let Some(ref v) = self.input_type {
6761            ::buffa::types::put_string_field(2u32, v, buf);
6762        }
6763        if let Some(ref v) = self.output_type {
6764            ::buffa::types::put_string_field(3u32, v, buf);
6765        }
6766        if self.options.is_set() {
6767            ::buffa::types::put_len_delimited_header(
6768                4u32,
6769                u64::from(__cache.consume_next()),
6770                buf,
6771            );
6772            self.options.write_to(__cache, buf);
6773        }
6774        if let Some(v) = self.client_streaming {
6775            ::buffa::types::put_bool_field(5u32, v, buf);
6776        }
6777        if let Some(v) = self.server_streaming {
6778            ::buffa::types::put_bool_field(6u32, v, buf);
6779        }
6780        self.__buffa_unknown_fields.write_to(buf);
6781    }
6782    fn merge_field(
6783        &mut self,
6784        tag: ::buffa::encoding::Tag,
6785        buf: &mut impl ::buffa::bytes::Buf,
6786        ctx: ::buffa::DecodeContext<'_>,
6787    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6788        #[allow(unused_imports)]
6789        use ::buffa::bytes::Buf as _;
6790        #[allow(unused_imports)]
6791        use ::buffa::Enumeration as _;
6792        match tag.field_number() {
6793            1u32 => {
6794                ::buffa::encoding::check_wire_type(
6795                    tag,
6796                    ::buffa::encoding::WireType::LengthDelimited,
6797                )?;
6798                ::buffa::types::merge_string(
6799                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6800                    buf,
6801                )?;
6802            }
6803            2u32 => {
6804                ::buffa::encoding::check_wire_type(
6805                    tag,
6806                    ::buffa::encoding::WireType::LengthDelimited,
6807                )?;
6808                ::buffa::types::merge_string(
6809                    self
6810                        .input_type
6811                        .get_or_insert_with(::buffa::alloc::string::String::new),
6812                    buf,
6813                )?;
6814            }
6815            3u32 => {
6816                ::buffa::encoding::check_wire_type(
6817                    tag,
6818                    ::buffa::encoding::WireType::LengthDelimited,
6819                )?;
6820                ::buffa::types::merge_string(
6821                    self
6822                        .output_type
6823                        .get_or_insert_with(::buffa::alloc::string::String::new),
6824                    buf,
6825                )?;
6826            }
6827            4u32 => {
6828                ::buffa::encoding::check_wire_type(
6829                    tag,
6830                    ::buffa::encoding::WireType::LengthDelimited,
6831                )?;
6832                ::buffa::Message::merge_length_delimited(
6833                    self.options.get_or_insert_default(),
6834                    buf,
6835                    ctx,
6836                )?;
6837            }
6838            5u32 => {
6839                ::buffa::encoding::check_wire_type(
6840                    tag,
6841                    ::buffa::encoding::WireType::Varint,
6842                )?;
6843                self.client_streaming = ::core::option::Option::Some(
6844                    ::buffa::types::decode_bool(buf)?,
6845                );
6846            }
6847            6u32 => {
6848                ::buffa::encoding::check_wire_type(
6849                    tag,
6850                    ::buffa::encoding::WireType::Varint,
6851                )?;
6852                self.server_streaming = ::core::option::Option::Some(
6853                    ::buffa::types::decode_bool(buf)?,
6854                );
6855            }
6856            _ => {
6857                self.__buffa_unknown_fields
6858                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6859            }
6860        }
6861        ::core::result::Result::Ok(())
6862    }
6863    fn clear(&mut self) {
6864        self.name = ::core::option::Option::None;
6865        self.input_type = ::core::option::Option::None;
6866        self.output_type = ::core::option::Option::None;
6867        self.options = ::buffa::MessageField::none();
6868        self.client_streaming = ::core::option::Option::None;
6869        self.server_streaming = ::core::option::Option::None;
6870        self.__buffa_unknown_fields.clear();
6871    }
6872}
6873impl ::buffa::ExtensionSet for MethodDescriptorProto {
6874    const PROTO_FQN: &'static str = "google.protobuf.MethodDescriptorProto";
6875    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6876        &self.__buffa_unknown_fields
6877    }
6878    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6879        &mut self.__buffa_unknown_fields
6880    }
6881}
6882#[cfg(feature = "text")]
6883impl ::buffa::text::TextFormat for MethodDescriptorProto {
6884    fn encode_text(
6885        &self,
6886        enc: &mut ::buffa::text::TextEncoder<'_>,
6887    ) -> ::core::fmt::Result {
6888        #[allow(unused_imports)]
6889        use ::buffa::Enumeration as _;
6890        if let ::core::option::Option::Some(ref __v) = self.name {
6891            enc.write_field_name("name")?;
6892            enc.write_string(__v)?;
6893        }
6894        if let ::core::option::Option::Some(ref __v) = self.input_type {
6895            enc.write_field_name("input_type")?;
6896            enc.write_string(__v)?;
6897        }
6898        if let ::core::option::Option::Some(ref __v) = self.output_type {
6899            enc.write_field_name("output_type")?;
6900            enc.write_string(__v)?;
6901        }
6902        if self.options.is_set() {
6903            enc.write_field_name("options")?;
6904            enc.write_message(&*self.options)?;
6905        }
6906        if let ::core::option::Option::Some(ref __v) = self.client_streaming {
6907            enc.write_field_name("client_streaming")?;
6908            enc.write_bool(*__v)?;
6909        }
6910        if let ::core::option::Option::Some(ref __v) = self.server_streaming {
6911            enc.write_field_name("server_streaming")?;
6912            enc.write_bool(*__v)?;
6913        }
6914        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6915        ::core::result::Result::Ok(())
6916    }
6917    fn merge_text(
6918        &mut self,
6919        dec: &mut ::buffa::text::TextDecoder<'_>,
6920    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6921        #[allow(unused_imports)]
6922        use ::buffa::Enumeration as _;
6923        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6924            match __name {
6925                "name" => {
6926                    self.name = ::core::option::Option::Some(
6927                        dec.read_string()?.into_owned(),
6928                    );
6929                }
6930                "input_type" => {
6931                    self.input_type = ::core::option::Option::Some(
6932                        dec.read_string()?.into_owned(),
6933                    );
6934                }
6935                "output_type" => {
6936                    self.output_type = ::core::option::Option::Some(
6937                        dec.read_string()?.into_owned(),
6938                    );
6939                }
6940                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6941                "client_streaming" => {
6942                    self.client_streaming = ::core::option::Option::Some(
6943                        dec.read_bool()?,
6944                    );
6945                }
6946                "server_streaming" => {
6947                    self.server_streaming = ::core::option::Option::Some(
6948                        dec.read_bool()?,
6949                    );
6950                }
6951                _ => dec.skip_value()?,
6952            }
6953        }
6954        ::core::result::Result::Ok(())
6955    }
6956}
6957#[cfg(feature = "json")]
6958impl ::buffa::json_helpers::ProtoElemJson for MethodDescriptorProto {
6959    fn serialize_proto_json<S: ::serde::Serializer>(
6960        v: &Self,
6961        s: S,
6962    ) -> ::core::result::Result<S::Ok, S::Error> {
6963        ::serde::Serialize::serialize(v, s)
6964    }
6965    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6966        d: D,
6967    ) -> ::core::result::Result<Self, D::Error> {
6968        <Self as ::serde::Deserialize>::deserialize(d)
6969    }
6970}
6971#[cfg(feature = "json")]
6972#[doc(hidden)]
6973pub const __METHOD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6974    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6975    to_json: ::buffa::type_registry::any_to_json::<MethodDescriptorProto>,
6976    from_json: ::buffa::type_registry::any_from_json::<MethodDescriptorProto>,
6977    is_wkt: false,
6978};
6979#[cfg(feature = "text")]
6980#[doc(hidden)]
6981pub const __METHOD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6982    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6983    text_encode: ::buffa::type_registry::any_encode_text::<MethodDescriptorProto>,
6984    text_merge: ::buffa::type_registry::any_merge_text::<MethodDescriptorProto>,
6985};
6986/// ===================================================================
6987/// Options
6988///
6989/// Each of the definitions above may have "options" attached.  These are
6990/// just annotations which may cause code to be generated slightly differently
6991/// or may contain hints for code that manipulates protocol messages.
6992///
6993/// Clients may define custom options as extensions of the *Options messages.
6994/// These extensions may not yet be known at parsing time, so the parser cannot
6995/// store the values in them.  Instead it stores them in a field in the *Options
6996/// message called uninterpreted_option. This field must have the same name
6997/// across all *Options messages. We then use this field to populate the
6998/// extensions when we build a descriptor, at which point all protos have been
6999/// parsed and so all extensions are known.
7000///
7001/// Extension numbers for custom options may be chosen as follows:
7002/// * For options which will only be used within a single application or
7003///   organization, or for experimental options, use field numbers 50000
7004///   through 99999.  It is up to you to ensure that you do not use the
7005///   same number for multiple options.
7006/// * For options which will be published and used publicly by multiple
7007///   independent entities, e-mail protobuf-global-extension-registry@google.com
7008///   to reserve extension numbers. Simply provide your project name (e.g.
7009///   Objective-C plugin) and your project website (if available) -- there's no
7010///   need to explain how you intend to use them. Usually you only need one
7011///   extension number. You can declare multiple options with only one extension
7012///   number by putting them in a sub-message. See the Custom Options section of
7013///   the docs for examples:
7014///   <https://developers.google.com/protocol-buffers/docs/proto#options>
7015///   If this turns out to be popular, a web service will be set up
7016///   to automatically assign option numbers.
7017#[derive(Clone, PartialEq, Default)]
7018#[cfg_attr(feature = "json", derive(::serde::Serialize))]
7019#[cfg_attr(feature = "json", serde(default))]
7020#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
7021pub struct FileOptions {
7022    /// Sets the Java package where classes generated from this .proto will be
7023    /// placed.  By default, the proto package is used, but this is often
7024    /// inappropriate because proto packages do not normally start with backwards
7025    /// domain names.
7026    ///
7027    /// Field 1: `java_package`
7028    #[cfg_attr(
7029        feature = "json",
7030        serde(
7031            rename = "javaPackage",
7032            alias = "java_package",
7033            skip_serializing_if = "::core::option::Option::is_none"
7034        )
7035    )]
7036    pub java_package: ::core::option::Option<::buffa::alloc::string::String>,
7037    /// Controls the name of the wrapper Java class generated for the .proto file.
7038    /// That class will always contain the .proto file's getDescriptor() method as
7039    /// well as any top-level extensions defined in the .proto file.
7040    /// If java_multiple_files is disabled, then all the other classes from the
7041    /// .proto file will be nested inside the single wrapper outer class.
7042    ///
7043    /// Field 8: `java_outer_classname`
7044    #[cfg_attr(
7045        feature = "json",
7046        serde(
7047            rename = "javaOuterClassname",
7048            alias = "java_outer_classname",
7049            skip_serializing_if = "::core::option::Option::is_none"
7050        )
7051    )]
7052    pub java_outer_classname: ::core::option::Option<::buffa::alloc::string::String>,
7053    /// If enabled, then the Java code generator will generate a separate .java
7054    /// file for each top-level message, enum, and service defined in the .proto
7055    /// file.  Thus, these types will *not* be nested inside the wrapper class
7056    /// named by java_outer_classname.  However, the wrapper class will still be
7057    /// generated to contain the file's getDescriptor() method as well as any
7058    /// top-level extensions defined in the file.
7059    ///
7060    /// Field 10: `java_multiple_files`
7061    #[cfg_attr(
7062        feature = "json",
7063        serde(
7064            rename = "javaMultipleFiles",
7065            alias = "java_multiple_files",
7066            skip_serializing_if = "::core::option::Option::is_none"
7067        )
7068    )]
7069    pub java_multiple_files: ::core::option::Option<bool>,
7070    /// This option does nothing.
7071    ///
7072    /// Field 20: `java_generate_equals_and_hash`
7073    #[cfg_attr(
7074        feature = "json",
7075        serde(
7076            rename = "javaGenerateEqualsAndHash",
7077            alias = "java_generate_equals_and_hash",
7078            skip_serializing_if = "::core::option::Option::is_none"
7079        )
7080    )]
7081    pub java_generate_equals_and_hash: ::core::option::Option<bool>,
7082    /// A proto2 file can set this to true to opt in to UTF-8 checking for Java,
7083    /// which will throw an exception if invalid UTF-8 is parsed from the wire or
7084    /// assigned to a string field.
7085    ///
7086    /// TODO: clarify exactly what kinds of field types this option
7087    /// applies to, and update these docs accordingly.
7088    ///
7089    /// Proto3 files already perform these checks. Setting the option explicitly to
7090    /// false has no effect: it cannot be used to opt proto3 files out of UTF-8
7091    /// checks.
7092    ///
7093    /// Field 27: `java_string_check_utf8`
7094    #[cfg_attr(
7095        feature = "json",
7096        serde(
7097            rename = "javaStringCheckUtf8",
7098            alias = "java_string_check_utf8",
7099            skip_serializing_if = "::core::option::Option::is_none"
7100        )
7101    )]
7102    pub java_string_check_utf8: ::core::option::Option<bool>,
7103    /// Field 9: `optimize_for`
7104    #[cfg_attr(
7105        feature = "json",
7106        serde(
7107            rename = "optimizeFor",
7108            alias = "optimize_for",
7109            with = "::buffa::json_helpers::opt_closed_enum",
7110            skip_serializing_if = "::core::option::Option::is_none"
7111        )
7112    )]
7113    pub optimize_for: ::core::option::Option<file_options::OptimizeMode>,
7114    /// Sets the Go package where structs generated from this .proto will be
7115    /// placed. If omitted, the Go package will be derived from the following:
7116    ///   - The basename of the package import path, if provided.
7117    ///   - Otherwise, the package statement in the .proto file, if present.
7118    ///   - Otherwise, the basename of the .proto file, without extension.
7119    ///
7120    /// Field 11: `go_package`
7121    #[cfg_attr(
7122        feature = "json",
7123        serde(
7124            rename = "goPackage",
7125            alias = "go_package",
7126            skip_serializing_if = "::core::option::Option::is_none"
7127        )
7128    )]
7129    pub go_package: ::core::option::Option<::buffa::alloc::string::String>,
7130    /// Should generic services be generated in each language?  "Generic" services
7131    /// are not specific to any particular RPC system.  They are generated by the
7132    /// main code generators in each language (without additional plugins).
7133    /// Generic services were the only kind of service generation supported by
7134    /// early versions of google.protobuf.
7135    ///
7136    /// Generic services are now considered deprecated in favor of using plugins
7137    /// that generate code specific to your particular RPC system.  Therefore,
7138    /// these default to false.  Old code which depends on generic services should
7139    /// explicitly set them to true.
7140    ///
7141    /// Field 16: `cc_generic_services`
7142    #[cfg_attr(
7143        feature = "json",
7144        serde(
7145            rename = "ccGenericServices",
7146            alias = "cc_generic_services",
7147            skip_serializing_if = "::core::option::Option::is_none"
7148        )
7149    )]
7150    pub cc_generic_services: ::core::option::Option<bool>,
7151    /// Field 17: `java_generic_services`
7152    #[cfg_attr(
7153        feature = "json",
7154        serde(
7155            rename = "javaGenericServices",
7156            alias = "java_generic_services",
7157            skip_serializing_if = "::core::option::Option::is_none"
7158        )
7159    )]
7160    pub java_generic_services: ::core::option::Option<bool>,
7161    /// Field 18: `py_generic_services`
7162    #[cfg_attr(
7163        feature = "json",
7164        serde(
7165            rename = "pyGenericServices",
7166            alias = "py_generic_services",
7167            skip_serializing_if = "::core::option::Option::is_none"
7168        )
7169    )]
7170    pub py_generic_services: ::core::option::Option<bool>,
7171    /// Is this file deprecated?
7172    /// Depending on the target platform, this can emit Deprecated annotations
7173    /// for everything in the file, or it will be completely ignored; in the very
7174    /// least, this is a formalization for deprecating files.
7175    ///
7176    /// Field 23: `deprecated`
7177    #[cfg_attr(
7178        feature = "json",
7179        serde(
7180            rename = "deprecated",
7181            skip_serializing_if = "::core::option::Option::is_none"
7182        )
7183    )]
7184    pub deprecated: ::core::option::Option<bool>,
7185    /// Enables the use of arenas for the proto messages in this file. This applies
7186    /// only to generated classes for C++.
7187    ///
7188    /// Field 31: `cc_enable_arenas`
7189    #[cfg_attr(
7190        feature = "json",
7191        serde(
7192            rename = "ccEnableArenas",
7193            alias = "cc_enable_arenas",
7194            skip_serializing_if = "::core::option::Option::is_none"
7195        )
7196    )]
7197    pub cc_enable_arenas: ::core::option::Option<bool>,
7198    /// Sets the objective c class prefix which is prepended to all objective c
7199    /// generated classes from this .proto. There is no default.
7200    ///
7201    /// Field 36: `objc_class_prefix`
7202    #[cfg_attr(
7203        feature = "json",
7204        serde(
7205            rename = "objcClassPrefix",
7206            alias = "objc_class_prefix",
7207            skip_serializing_if = "::core::option::Option::is_none"
7208        )
7209    )]
7210    pub objc_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7211    /// Namespace for generated classes; defaults to the package.
7212    ///
7213    /// Field 37: `csharp_namespace`
7214    #[cfg_attr(
7215        feature = "json",
7216        serde(
7217            rename = "csharpNamespace",
7218            alias = "csharp_namespace",
7219            skip_serializing_if = "::core::option::Option::is_none"
7220        )
7221    )]
7222    pub csharp_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7223    /// By default Swift generators will take the proto package and CamelCase it
7224    /// replacing '.' with underscore and use that to prefix the types/symbols
7225    /// defined. When this options is provided, they will use this value instead
7226    /// to prefix the types/symbols defined.
7227    ///
7228    /// Field 39: `swift_prefix`
7229    #[cfg_attr(
7230        feature = "json",
7231        serde(
7232            rename = "swiftPrefix",
7233            alias = "swift_prefix",
7234            skip_serializing_if = "::core::option::Option::is_none"
7235        )
7236    )]
7237    pub swift_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7238    /// Sets the php class prefix which is prepended to all php generated classes
7239    /// from this .proto. Default is empty.
7240    ///
7241    /// Field 40: `php_class_prefix`
7242    #[cfg_attr(
7243        feature = "json",
7244        serde(
7245            rename = "phpClassPrefix",
7246            alias = "php_class_prefix",
7247            skip_serializing_if = "::core::option::Option::is_none"
7248        )
7249    )]
7250    pub php_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7251    /// Use this option to change the namespace of php generated classes. Default
7252    /// is empty. When this option is empty, the package name will be used for
7253    /// determining the namespace.
7254    ///
7255    /// Field 41: `php_namespace`
7256    #[cfg_attr(
7257        feature = "json",
7258        serde(
7259            rename = "phpNamespace",
7260            alias = "php_namespace",
7261            skip_serializing_if = "::core::option::Option::is_none"
7262        )
7263    )]
7264    pub php_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7265    /// Use this option to change the namespace of php generated metadata classes.
7266    /// Default is empty. When this option is empty, the proto file name will be
7267    /// used for determining the namespace.
7268    ///
7269    /// Field 44: `php_metadata_namespace`
7270    #[cfg_attr(
7271        feature = "json",
7272        serde(
7273            rename = "phpMetadataNamespace",
7274            alias = "php_metadata_namespace",
7275            skip_serializing_if = "::core::option::Option::is_none"
7276        )
7277    )]
7278    pub php_metadata_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7279    /// Use this option to change the package of ruby generated classes. Default
7280    /// is empty. When this option is not set, the package name will be used for
7281    /// determining the ruby package.
7282    ///
7283    /// Field 45: `ruby_package`
7284    #[cfg_attr(
7285        feature = "json",
7286        serde(
7287            rename = "rubyPackage",
7288            alias = "ruby_package",
7289            skip_serializing_if = "::core::option::Option::is_none"
7290        )
7291    )]
7292    pub ruby_package: ::core::option::Option<::buffa::alloc::string::String>,
7293    /// Any features defined in the specific edition.
7294    /// WARNING: This field should only be used by protobuf plugins or special
7295    /// cases like the proto compiler. Other uses are discouraged and
7296    /// developers should rely on the protoreflect APIs for their client language.
7297    ///
7298    /// Field 50: `features`
7299    #[cfg_attr(
7300        feature = "json",
7301        serde(
7302            rename = "features",
7303            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7304        )
7305    )]
7306    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
7307    /// The parser stores options it doesn't recognize here.
7308    /// See the documentation for the "Options" section above.
7309    ///
7310    /// Field 999: `uninterpreted_option`
7311    #[cfg_attr(
7312        feature = "json",
7313        serde(
7314            rename = "uninterpretedOption",
7315            alias = "uninterpreted_option",
7316            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
7317            deserialize_with = "::buffa::json_helpers::null_as_default"
7318        )
7319    )]
7320    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
7321    #[cfg_attr(feature = "json", serde(flatten))]
7322    #[doc(hidden)]
7323    pub __buffa_unknown_fields: __FileOptionsExtJson,
7324}
7325impl ::core::fmt::Debug for FileOptions {
7326    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7327        f.debug_struct("FileOptions")
7328            .field("java_package", &self.java_package)
7329            .field("java_outer_classname", &self.java_outer_classname)
7330            .field("java_multiple_files", &self.java_multiple_files)
7331            .field("java_generate_equals_and_hash", &self.java_generate_equals_and_hash)
7332            .field("java_string_check_utf8", &self.java_string_check_utf8)
7333            .field("optimize_for", &self.optimize_for)
7334            .field("go_package", &self.go_package)
7335            .field("cc_generic_services", &self.cc_generic_services)
7336            .field("java_generic_services", &self.java_generic_services)
7337            .field("py_generic_services", &self.py_generic_services)
7338            .field("deprecated", &self.deprecated)
7339            .field("cc_enable_arenas", &self.cc_enable_arenas)
7340            .field("objc_class_prefix", &self.objc_class_prefix)
7341            .field("csharp_namespace", &self.csharp_namespace)
7342            .field("swift_prefix", &self.swift_prefix)
7343            .field("php_class_prefix", &self.php_class_prefix)
7344            .field("php_namespace", &self.php_namespace)
7345            .field("php_metadata_namespace", &self.php_metadata_namespace)
7346            .field("ruby_package", &self.ruby_package)
7347            .field("features", &self.features)
7348            .field("uninterpreted_option", &self.uninterpreted_option)
7349            .finish()
7350    }
7351}
7352impl FileOptions {
7353    /// Protobuf type URL for this message, for use with `Any::pack` and
7354    /// `Any::unpack_if`.
7355    ///
7356    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7357    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7358}
7359impl FileOptions {
7360    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7361    #[inline]
7362    ///Sets [`Self::java_package`] to `Some(value)`, consuming and returning `self`.
7363    pub fn with_java_package(
7364        mut self,
7365        value: impl Into<::buffa::alloc::string::String>,
7366    ) -> Self {
7367        self.java_package = Some(value.into());
7368        self
7369    }
7370    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7371    #[inline]
7372    ///Sets [`Self::java_outer_classname`] to `Some(value)`, consuming and returning `self`.
7373    pub fn with_java_outer_classname(
7374        mut self,
7375        value: impl Into<::buffa::alloc::string::String>,
7376    ) -> Self {
7377        self.java_outer_classname = Some(value.into());
7378        self
7379    }
7380    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7381    #[inline]
7382    ///Sets [`Self::java_multiple_files`] to `Some(value)`, consuming and returning `self`.
7383    pub fn with_java_multiple_files(mut self, value: bool) -> Self {
7384        self.java_multiple_files = Some(value);
7385        self
7386    }
7387    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7388    #[inline]
7389    ///Sets [`Self::java_generate_equals_and_hash`] to `Some(value)`, consuming and returning `self`.
7390    pub fn with_java_generate_equals_and_hash(mut self, value: bool) -> Self {
7391        self.java_generate_equals_and_hash = Some(value);
7392        self
7393    }
7394    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7395    #[inline]
7396    ///Sets [`Self::java_string_check_utf8`] to `Some(value)`, consuming and returning `self`.
7397    pub fn with_java_string_check_utf8(mut self, value: bool) -> Self {
7398        self.java_string_check_utf8 = Some(value);
7399        self
7400    }
7401    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7402    #[inline]
7403    ///Sets [`Self::optimize_for`] to `Some(value)`, consuming and returning `self`.
7404    pub fn with_optimize_for(
7405        mut self,
7406        value: impl Into<file_options::OptimizeMode>,
7407    ) -> Self {
7408        self.optimize_for = Some(value.into());
7409        self
7410    }
7411    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7412    #[inline]
7413    ///Sets [`Self::go_package`] to `Some(value)`, consuming and returning `self`.
7414    pub fn with_go_package(
7415        mut self,
7416        value: impl Into<::buffa::alloc::string::String>,
7417    ) -> Self {
7418        self.go_package = Some(value.into());
7419        self
7420    }
7421    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7422    #[inline]
7423    ///Sets [`Self::cc_generic_services`] to `Some(value)`, consuming and returning `self`.
7424    pub fn with_cc_generic_services(mut self, value: bool) -> Self {
7425        self.cc_generic_services = Some(value);
7426        self
7427    }
7428    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7429    #[inline]
7430    ///Sets [`Self::java_generic_services`] to `Some(value)`, consuming and returning `self`.
7431    pub fn with_java_generic_services(mut self, value: bool) -> Self {
7432        self.java_generic_services = Some(value);
7433        self
7434    }
7435    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7436    #[inline]
7437    ///Sets [`Self::py_generic_services`] to `Some(value)`, consuming and returning `self`.
7438    pub fn with_py_generic_services(mut self, value: bool) -> Self {
7439        self.py_generic_services = Some(value);
7440        self
7441    }
7442    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7443    #[inline]
7444    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
7445    pub fn with_deprecated(mut self, value: bool) -> Self {
7446        self.deprecated = Some(value);
7447        self
7448    }
7449    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7450    #[inline]
7451    ///Sets [`Self::cc_enable_arenas`] to `Some(value)`, consuming and returning `self`.
7452    pub fn with_cc_enable_arenas(mut self, value: bool) -> Self {
7453        self.cc_enable_arenas = Some(value);
7454        self
7455    }
7456    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7457    #[inline]
7458    ///Sets [`Self::objc_class_prefix`] to `Some(value)`, consuming and returning `self`.
7459    pub fn with_objc_class_prefix(
7460        mut self,
7461        value: impl Into<::buffa::alloc::string::String>,
7462    ) -> Self {
7463        self.objc_class_prefix = Some(value.into());
7464        self
7465    }
7466    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7467    #[inline]
7468    ///Sets [`Self::csharp_namespace`] to `Some(value)`, consuming and returning `self`.
7469    pub fn with_csharp_namespace(
7470        mut self,
7471        value: impl Into<::buffa::alloc::string::String>,
7472    ) -> Self {
7473        self.csharp_namespace = Some(value.into());
7474        self
7475    }
7476    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7477    #[inline]
7478    ///Sets [`Self::swift_prefix`] to `Some(value)`, consuming and returning `self`.
7479    pub fn with_swift_prefix(
7480        mut self,
7481        value: impl Into<::buffa::alloc::string::String>,
7482    ) -> Self {
7483        self.swift_prefix = Some(value.into());
7484        self
7485    }
7486    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7487    #[inline]
7488    ///Sets [`Self::php_class_prefix`] to `Some(value)`, consuming and returning `self`.
7489    pub fn with_php_class_prefix(
7490        mut self,
7491        value: impl Into<::buffa::alloc::string::String>,
7492    ) -> Self {
7493        self.php_class_prefix = Some(value.into());
7494        self
7495    }
7496    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7497    #[inline]
7498    ///Sets [`Self::php_namespace`] to `Some(value)`, consuming and returning `self`.
7499    pub fn with_php_namespace(
7500        mut self,
7501        value: impl Into<::buffa::alloc::string::String>,
7502    ) -> Self {
7503        self.php_namespace = Some(value.into());
7504        self
7505    }
7506    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7507    #[inline]
7508    ///Sets [`Self::php_metadata_namespace`] to `Some(value)`, consuming and returning `self`.
7509    pub fn with_php_metadata_namespace(
7510        mut self,
7511        value: impl Into<::buffa::alloc::string::String>,
7512    ) -> Self {
7513        self.php_metadata_namespace = Some(value.into());
7514        self
7515    }
7516    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7517    #[inline]
7518    ///Sets [`Self::ruby_package`] to `Some(value)`, consuming and returning `self`.
7519    pub fn with_ruby_package(
7520        mut self,
7521        value: impl Into<::buffa::alloc::string::String>,
7522    ) -> Self {
7523        self.ruby_package = Some(value.into());
7524        self
7525    }
7526}
7527::buffa::impl_default_instance!(FileOptions);
7528impl ::buffa::MessageName for FileOptions {
7529    const PACKAGE: &'static str = "google.protobuf";
7530    const NAME: &'static str = "FileOptions";
7531    const FULL_NAME: &'static str = "google.protobuf.FileOptions";
7532    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7533}
7534impl ::buffa::Message for FileOptions {
7535    /// Returns the total encoded size in bytes.
7536    ///
7537    /// Accumulates in `u64` (which cannot overflow for in-memory
7538    /// data) and saturates to `u32` at return, so a message whose
7539    /// encoded size exceeds the 2 GiB protobuf limit yields a value
7540    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
7541    /// points reject, never a silently wrapped size.
7542    #[allow(clippy::let_and_return)]
7543    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7544        #[allow(unused_imports)]
7545        use ::buffa::Enumeration as _;
7546        let mut size = 0u64;
7547        if let Some(ref v) = self.java_package {
7548            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7549        }
7550        if let Some(ref v) = self.java_outer_classname {
7551            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7552        }
7553        if let Some(ref v) = self.optimize_for {
7554            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
7555        }
7556        if self.java_multiple_files.is_some() {
7557            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7558        }
7559        if let Some(ref v) = self.go_package {
7560            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7561        }
7562        if self.cc_generic_services.is_some() {
7563            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7564        }
7565        if self.java_generic_services.is_some() {
7566            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7567        }
7568        if self.py_generic_services.is_some() {
7569            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7570        }
7571        if self.java_generate_equals_and_hash.is_some() {
7572            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7573        }
7574        if self.deprecated.is_some() {
7575            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7576        }
7577        if self.java_string_check_utf8.is_some() {
7578            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7579        }
7580        if self.cc_enable_arenas.is_some() {
7581            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7582        }
7583        if let Some(ref v) = self.objc_class_prefix {
7584            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7585        }
7586        if let Some(ref v) = self.csharp_namespace {
7587            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7588        }
7589        if let Some(ref v) = self.swift_prefix {
7590            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7591        }
7592        if let Some(ref v) = self.php_class_prefix {
7593            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7594        }
7595        if let Some(ref v) = self.php_namespace {
7596            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7597        }
7598        if let Some(ref v) = self.php_metadata_namespace {
7599            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7600        }
7601        if let Some(ref v) = self.ruby_package {
7602            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7603        }
7604        if self.features.is_set() {
7605            let __slot = __cache.reserve();
7606            let inner_size = self.features.compute_size(__cache);
7607            __cache.set(__slot, inner_size);
7608            size
7609                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
7610                    + inner_size as u64;
7611        }
7612        for v in &self.uninterpreted_option {
7613            let __slot = __cache.reserve();
7614            let inner_size = v.compute_size(__cache);
7615            __cache.set(__slot, inner_size);
7616            size
7617                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
7618                    + inner_size as u64;
7619        }
7620        size += self.__buffa_unknown_fields.encoded_len() as u64;
7621        ::buffa::saturate_size(size)
7622    }
7623    fn write_to(
7624        &self,
7625        __cache: &mut ::buffa::SizeCache,
7626        buf: &mut impl ::buffa::EncodeSink,
7627    ) {
7628        #[allow(unused_imports)]
7629        use ::buffa::Enumeration as _;
7630        if let Some(ref v) = self.java_package {
7631            ::buffa::types::put_string_field(1u32, v, buf);
7632        }
7633        if let Some(ref v) = self.java_outer_classname {
7634            ::buffa::types::put_string_field(8u32, v, buf);
7635        }
7636        if let Some(ref v) = self.optimize_for {
7637            ::buffa::types::put_int32_field(9u32, v.to_i32(), buf);
7638        }
7639        if let Some(v) = self.java_multiple_files {
7640            ::buffa::types::put_bool_field(10u32, v, buf);
7641        }
7642        if let Some(ref v) = self.go_package {
7643            ::buffa::types::put_string_field(11u32, v, buf);
7644        }
7645        if let Some(v) = self.cc_generic_services {
7646            ::buffa::types::put_bool_field(16u32, v, buf);
7647        }
7648        if let Some(v) = self.java_generic_services {
7649            ::buffa::types::put_bool_field(17u32, v, buf);
7650        }
7651        if let Some(v) = self.py_generic_services {
7652            ::buffa::types::put_bool_field(18u32, v, buf);
7653        }
7654        if let Some(v) = self.java_generate_equals_and_hash {
7655            ::buffa::types::put_bool_field(20u32, v, buf);
7656        }
7657        if let Some(v) = self.deprecated {
7658            ::buffa::types::put_bool_field(23u32, v, buf);
7659        }
7660        if let Some(v) = self.java_string_check_utf8 {
7661            ::buffa::types::put_bool_field(27u32, v, buf);
7662        }
7663        if let Some(v) = self.cc_enable_arenas {
7664            ::buffa::types::put_bool_field(31u32, v, buf);
7665        }
7666        if let Some(ref v) = self.objc_class_prefix {
7667            ::buffa::types::put_string_field(36u32, v, buf);
7668        }
7669        if let Some(ref v) = self.csharp_namespace {
7670            ::buffa::types::put_string_field(37u32, v, buf);
7671        }
7672        if let Some(ref v) = self.swift_prefix {
7673            ::buffa::types::put_string_field(39u32, v, buf);
7674        }
7675        if let Some(ref v) = self.php_class_prefix {
7676            ::buffa::types::put_string_field(40u32, v, buf);
7677        }
7678        if let Some(ref v) = self.php_namespace {
7679            ::buffa::types::put_string_field(41u32, v, buf);
7680        }
7681        if let Some(ref v) = self.php_metadata_namespace {
7682            ::buffa::types::put_string_field(44u32, v, buf);
7683        }
7684        if let Some(ref v) = self.ruby_package {
7685            ::buffa::types::put_string_field(45u32, v, buf);
7686        }
7687        if self.features.is_set() {
7688            ::buffa::types::put_len_delimited_header(
7689                50u32,
7690                u64::from(__cache.consume_next()),
7691                buf,
7692            );
7693            self.features.write_to(__cache, buf);
7694        }
7695        for v in &self.uninterpreted_option {
7696            ::buffa::types::put_len_delimited_header(
7697                999u32,
7698                u64::from(__cache.consume_next()),
7699                buf,
7700            );
7701            v.write_to(__cache, buf);
7702        }
7703        self.__buffa_unknown_fields.write_to(buf);
7704    }
7705    fn merge_field(
7706        &mut self,
7707        tag: ::buffa::encoding::Tag,
7708        buf: &mut impl ::buffa::bytes::Buf,
7709        ctx: ::buffa::DecodeContext<'_>,
7710    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7711        #[allow(unused_imports)]
7712        use ::buffa::bytes::Buf as _;
7713        #[allow(unused_imports)]
7714        use ::buffa::Enumeration as _;
7715        match tag.field_number() {
7716            1u32 => {
7717                ::buffa::encoding::check_wire_type(
7718                    tag,
7719                    ::buffa::encoding::WireType::LengthDelimited,
7720                )?;
7721                ::buffa::types::merge_string(
7722                    self
7723                        .java_package
7724                        .get_or_insert_with(::buffa::alloc::string::String::new),
7725                    buf,
7726                )?;
7727            }
7728            8u32 => {
7729                ::buffa::encoding::check_wire_type(
7730                    tag,
7731                    ::buffa::encoding::WireType::LengthDelimited,
7732                )?;
7733                ::buffa::types::merge_string(
7734                    self
7735                        .java_outer_classname
7736                        .get_or_insert_with(::buffa::alloc::string::String::new),
7737                    buf,
7738                )?;
7739            }
7740            9u32 => {
7741                ::buffa::encoding::check_wire_type(
7742                    tag,
7743                    ::buffa::encoding::WireType::Varint,
7744                )?;
7745                let __raw = ::buffa::types::decode_int32(buf)?;
7746                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
7747                    __raw,
7748                ) {
7749                    self.optimize_for = ::core::option::Option::Some(__v);
7750                } else {
7751                    ctx.register_unknown_field()?;
7752                    self.__buffa_unknown_fields
7753                        .push(::buffa::UnknownField {
7754                            number: 9u32,
7755                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
7756                        });
7757                }
7758            }
7759            10u32 => {
7760                ::buffa::encoding::check_wire_type(
7761                    tag,
7762                    ::buffa::encoding::WireType::Varint,
7763                )?;
7764                self.java_multiple_files = ::core::option::Option::Some(
7765                    ::buffa::types::decode_bool(buf)?,
7766                );
7767            }
7768            11u32 => {
7769                ::buffa::encoding::check_wire_type(
7770                    tag,
7771                    ::buffa::encoding::WireType::LengthDelimited,
7772                )?;
7773                ::buffa::types::merge_string(
7774                    self
7775                        .go_package
7776                        .get_or_insert_with(::buffa::alloc::string::String::new),
7777                    buf,
7778                )?;
7779            }
7780            16u32 => {
7781                ::buffa::encoding::check_wire_type(
7782                    tag,
7783                    ::buffa::encoding::WireType::Varint,
7784                )?;
7785                self.cc_generic_services = ::core::option::Option::Some(
7786                    ::buffa::types::decode_bool(buf)?,
7787                );
7788            }
7789            17u32 => {
7790                ::buffa::encoding::check_wire_type(
7791                    tag,
7792                    ::buffa::encoding::WireType::Varint,
7793                )?;
7794                self.java_generic_services = ::core::option::Option::Some(
7795                    ::buffa::types::decode_bool(buf)?,
7796                );
7797            }
7798            18u32 => {
7799                ::buffa::encoding::check_wire_type(
7800                    tag,
7801                    ::buffa::encoding::WireType::Varint,
7802                )?;
7803                self.py_generic_services = ::core::option::Option::Some(
7804                    ::buffa::types::decode_bool(buf)?,
7805                );
7806            }
7807            20u32 => {
7808                ::buffa::encoding::check_wire_type(
7809                    tag,
7810                    ::buffa::encoding::WireType::Varint,
7811                )?;
7812                self.java_generate_equals_and_hash = ::core::option::Option::Some(
7813                    ::buffa::types::decode_bool(buf)?,
7814                );
7815            }
7816            23u32 => {
7817                ::buffa::encoding::check_wire_type(
7818                    tag,
7819                    ::buffa::encoding::WireType::Varint,
7820                )?;
7821                self.deprecated = ::core::option::Option::Some(
7822                    ::buffa::types::decode_bool(buf)?,
7823                );
7824            }
7825            27u32 => {
7826                ::buffa::encoding::check_wire_type(
7827                    tag,
7828                    ::buffa::encoding::WireType::Varint,
7829                )?;
7830                self.java_string_check_utf8 = ::core::option::Option::Some(
7831                    ::buffa::types::decode_bool(buf)?,
7832                );
7833            }
7834            31u32 => {
7835                ::buffa::encoding::check_wire_type(
7836                    tag,
7837                    ::buffa::encoding::WireType::Varint,
7838                )?;
7839                self.cc_enable_arenas = ::core::option::Option::Some(
7840                    ::buffa::types::decode_bool(buf)?,
7841                );
7842            }
7843            36u32 => {
7844                ::buffa::encoding::check_wire_type(
7845                    tag,
7846                    ::buffa::encoding::WireType::LengthDelimited,
7847                )?;
7848                ::buffa::types::merge_string(
7849                    self
7850                        .objc_class_prefix
7851                        .get_or_insert_with(::buffa::alloc::string::String::new),
7852                    buf,
7853                )?;
7854            }
7855            37u32 => {
7856                ::buffa::encoding::check_wire_type(
7857                    tag,
7858                    ::buffa::encoding::WireType::LengthDelimited,
7859                )?;
7860                ::buffa::types::merge_string(
7861                    self
7862                        .csharp_namespace
7863                        .get_or_insert_with(::buffa::alloc::string::String::new),
7864                    buf,
7865                )?;
7866            }
7867            39u32 => {
7868                ::buffa::encoding::check_wire_type(
7869                    tag,
7870                    ::buffa::encoding::WireType::LengthDelimited,
7871                )?;
7872                ::buffa::types::merge_string(
7873                    self
7874                        .swift_prefix
7875                        .get_or_insert_with(::buffa::alloc::string::String::new),
7876                    buf,
7877                )?;
7878            }
7879            40u32 => {
7880                ::buffa::encoding::check_wire_type(
7881                    tag,
7882                    ::buffa::encoding::WireType::LengthDelimited,
7883                )?;
7884                ::buffa::types::merge_string(
7885                    self
7886                        .php_class_prefix
7887                        .get_or_insert_with(::buffa::alloc::string::String::new),
7888                    buf,
7889                )?;
7890            }
7891            41u32 => {
7892                ::buffa::encoding::check_wire_type(
7893                    tag,
7894                    ::buffa::encoding::WireType::LengthDelimited,
7895                )?;
7896                ::buffa::types::merge_string(
7897                    self
7898                        .php_namespace
7899                        .get_or_insert_with(::buffa::alloc::string::String::new),
7900                    buf,
7901                )?;
7902            }
7903            44u32 => {
7904                ::buffa::encoding::check_wire_type(
7905                    tag,
7906                    ::buffa::encoding::WireType::LengthDelimited,
7907                )?;
7908                ::buffa::types::merge_string(
7909                    self
7910                        .php_metadata_namespace
7911                        .get_or_insert_with(::buffa::alloc::string::String::new),
7912                    buf,
7913                )?;
7914            }
7915            45u32 => {
7916                ::buffa::encoding::check_wire_type(
7917                    tag,
7918                    ::buffa::encoding::WireType::LengthDelimited,
7919                )?;
7920                ::buffa::types::merge_string(
7921                    self
7922                        .ruby_package
7923                        .get_or_insert_with(::buffa::alloc::string::String::new),
7924                    buf,
7925                )?;
7926            }
7927            50u32 => {
7928                ::buffa::encoding::check_wire_type(
7929                    tag,
7930                    ::buffa::encoding::WireType::LengthDelimited,
7931                )?;
7932                ::buffa::Message::merge_length_delimited(
7933                    self.features.get_or_insert_default(),
7934                    buf,
7935                    ctx,
7936                )?;
7937            }
7938            999u32 => {
7939                ::buffa::encoding::check_wire_type(
7940                    tag,
7941                    ::buffa::encoding::WireType::LengthDelimited,
7942                )?;
7943                let mut elem = ::core::default::Default::default();
7944                ctx.register_element_memory(
7945                    ::buffa::__private::element_footprint(&elem),
7946                )?;
7947                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
7948                self.uninterpreted_option.push(elem);
7949            }
7950            _ => {
7951                self.__buffa_unknown_fields
7952                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
7953            }
7954        }
7955        ::core::result::Result::Ok(())
7956    }
7957    fn clear(&mut self) {
7958        self.java_package = ::core::option::Option::None;
7959        self.java_outer_classname = ::core::option::Option::None;
7960        self.optimize_for = ::core::option::Option::None;
7961        self.java_multiple_files = ::core::option::Option::None;
7962        self.go_package = ::core::option::Option::None;
7963        self.cc_generic_services = ::core::option::Option::None;
7964        self.java_generic_services = ::core::option::Option::None;
7965        self.py_generic_services = ::core::option::Option::None;
7966        self.java_generate_equals_and_hash = ::core::option::Option::None;
7967        self.deprecated = ::core::option::Option::None;
7968        self.java_string_check_utf8 = ::core::option::Option::None;
7969        self.cc_enable_arenas = ::core::option::Option::None;
7970        self.objc_class_prefix = ::core::option::Option::None;
7971        self.csharp_namespace = ::core::option::Option::None;
7972        self.swift_prefix = ::core::option::Option::None;
7973        self.php_class_prefix = ::core::option::Option::None;
7974        self.php_namespace = ::core::option::Option::None;
7975        self.php_metadata_namespace = ::core::option::Option::None;
7976        self.ruby_package = ::core::option::Option::None;
7977        self.features = ::buffa::MessageField::none();
7978        self.uninterpreted_option.clear();
7979        self.__buffa_unknown_fields.clear();
7980    }
7981}
7982impl ::buffa::ExtensionSet for FileOptions {
7983    const PROTO_FQN: &'static str = "google.protobuf.FileOptions";
7984    fn unknown_fields(&self) -> &::buffa::UnknownFields {
7985        &self.__buffa_unknown_fields
7986    }
7987    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7988        &mut self.__buffa_unknown_fields
7989    }
7990}
7991#[cfg(feature = "text")]
7992impl ::buffa::text::TextFormat for FileOptions {
7993    fn encode_text(
7994        &self,
7995        enc: &mut ::buffa::text::TextEncoder<'_>,
7996    ) -> ::core::fmt::Result {
7997        #[allow(unused_imports)]
7998        use ::buffa::Enumeration as _;
7999        if let ::core::option::Option::Some(ref __v) = self.java_package {
8000            enc.write_field_name("java_package")?;
8001            enc.write_string(__v)?;
8002        }
8003        if let ::core::option::Option::Some(ref __v) = self.java_outer_classname {
8004            enc.write_field_name("java_outer_classname")?;
8005            enc.write_string(__v)?;
8006        }
8007        if let ::core::option::Option::Some(ref __v) = self.java_multiple_files {
8008            enc.write_field_name("java_multiple_files")?;
8009            enc.write_bool(*__v)?;
8010        }
8011        if let ::core::option::Option::Some(ref __v) = self.java_generate_equals_and_hash
8012        {
8013            enc.write_field_name("java_generate_equals_and_hash")?;
8014            enc.write_bool(*__v)?;
8015        }
8016        if let ::core::option::Option::Some(ref __v) = self.java_string_check_utf8 {
8017            enc.write_field_name("java_string_check_utf8")?;
8018            enc.write_bool(*__v)?;
8019        }
8020        if let ::core::option::Option::Some(ref __v) = self.optimize_for {
8021            enc.write_field_name("optimize_for")?;
8022            enc.write_enum_name(__v.proto_name())?;
8023        }
8024        if let ::core::option::Option::Some(ref __v) = self.go_package {
8025            enc.write_field_name("go_package")?;
8026            enc.write_string(__v)?;
8027        }
8028        if let ::core::option::Option::Some(ref __v) = self.cc_generic_services {
8029            enc.write_field_name("cc_generic_services")?;
8030            enc.write_bool(*__v)?;
8031        }
8032        if let ::core::option::Option::Some(ref __v) = self.java_generic_services {
8033            enc.write_field_name("java_generic_services")?;
8034            enc.write_bool(*__v)?;
8035        }
8036        if let ::core::option::Option::Some(ref __v) = self.py_generic_services {
8037            enc.write_field_name("py_generic_services")?;
8038            enc.write_bool(*__v)?;
8039        }
8040        if let ::core::option::Option::Some(ref __v) = self.deprecated {
8041            enc.write_field_name("deprecated")?;
8042            enc.write_bool(*__v)?;
8043        }
8044        if let ::core::option::Option::Some(ref __v) = self.cc_enable_arenas {
8045            enc.write_field_name("cc_enable_arenas")?;
8046            enc.write_bool(*__v)?;
8047        }
8048        if let ::core::option::Option::Some(ref __v) = self.objc_class_prefix {
8049            enc.write_field_name("objc_class_prefix")?;
8050            enc.write_string(__v)?;
8051        }
8052        if let ::core::option::Option::Some(ref __v) = self.csharp_namespace {
8053            enc.write_field_name("csharp_namespace")?;
8054            enc.write_string(__v)?;
8055        }
8056        if let ::core::option::Option::Some(ref __v) = self.swift_prefix {
8057            enc.write_field_name("swift_prefix")?;
8058            enc.write_string(__v)?;
8059        }
8060        if let ::core::option::Option::Some(ref __v) = self.php_class_prefix {
8061            enc.write_field_name("php_class_prefix")?;
8062            enc.write_string(__v)?;
8063        }
8064        if let ::core::option::Option::Some(ref __v) = self.php_namespace {
8065            enc.write_field_name("php_namespace")?;
8066            enc.write_string(__v)?;
8067        }
8068        if let ::core::option::Option::Some(ref __v) = self.php_metadata_namespace {
8069            enc.write_field_name("php_metadata_namespace")?;
8070            enc.write_string(__v)?;
8071        }
8072        if let ::core::option::Option::Some(ref __v) = self.ruby_package {
8073            enc.write_field_name("ruby_package")?;
8074            enc.write_string(__v)?;
8075        }
8076        if self.features.is_set() {
8077            enc.write_field_name("features")?;
8078            enc.write_message(&*self.features)?;
8079        }
8080        for __v in &self.uninterpreted_option {
8081            enc.write_field_name("uninterpreted_option")?;
8082            enc.write_message(__v)?;
8083        }
8084        enc.write_extension_fields(
8085            "google.protobuf.FileOptions",
8086            &self.__buffa_unknown_fields,
8087        )?;
8088        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
8089        ::core::result::Result::Ok(())
8090    }
8091    fn merge_text(
8092        &mut self,
8093        dec: &mut ::buffa::text::TextDecoder<'_>,
8094    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
8095        #[allow(unused_imports)]
8096        use ::buffa::Enumeration as _;
8097        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
8098            match __name {
8099                "java_package" => {
8100                    self.java_package = ::core::option::Option::Some(
8101                        dec.read_string()?.into_owned(),
8102                    );
8103                }
8104                "java_outer_classname" => {
8105                    self.java_outer_classname = ::core::option::Option::Some(
8106                        dec.read_string()?.into_owned(),
8107                    );
8108                }
8109                "java_multiple_files" => {
8110                    self.java_multiple_files = ::core::option::Option::Some(
8111                        dec.read_bool()?,
8112                    );
8113                }
8114                "java_generate_equals_and_hash" => {
8115                    self.java_generate_equals_and_hash = ::core::option::Option::Some(
8116                        dec.read_bool()?,
8117                    );
8118                }
8119                "java_string_check_utf8" => {
8120                    self.java_string_check_utf8 = ::core::option::Option::Some(
8121                        dec.read_bool()?,
8122                    );
8123                }
8124                "optimize_for" => {
8125                    self.optimize_for = ::core::option::Option::Some(
8126                        dec.read_closed_enum_by_name::<file_options::OptimizeMode>()?,
8127                    );
8128                }
8129                "go_package" => {
8130                    self.go_package = ::core::option::Option::Some(
8131                        dec.read_string()?.into_owned(),
8132                    );
8133                }
8134                "cc_generic_services" => {
8135                    self.cc_generic_services = ::core::option::Option::Some(
8136                        dec.read_bool()?,
8137                    );
8138                }
8139                "java_generic_services" => {
8140                    self.java_generic_services = ::core::option::Option::Some(
8141                        dec.read_bool()?,
8142                    );
8143                }
8144                "py_generic_services" => {
8145                    self.py_generic_services = ::core::option::Option::Some(
8146                        dec.read_bool()?,
8147                    );
8148                }
8149                "deprecated" => {
8150                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
8151                }
8152                "cc_enable_arenas" => {
8153                    self.cc_enable_arenas = ::core::option::Option::Some(
8154                        dec.read_bool()?,
8155                    );
8156                }
8157                "objc_class_prefix" => {
8158                    self.objc_class_prefix = ::core::option::Option::Some(
8159                        dec.read_string()?.into_owned(),
8160                    );
8161                }
8162                "csharp_namespace" => {
8163                    self.csharp_namespace = ::core::option::Option::Some(
8164                        dec.read_string()?.into_owned(),
8165                    );
8166                }
8167                "swift_prefix" => {
8168                    self.swift_prefix = ::core::option::Option::Some(
8169                        dec.read_string()?.into_owned(),
8170                    );
8171                }
8172                "php_class_prefix" => {
8173                    self.php_class_prefix = ::core::option::Option::Some(
8174                        dec.read_string()?.into_owned(),
8175                    );
8176                }
8177                "php_namespace" => {
8178                    self.php_namespace = ::core::option::Option::Some(
8179                        dec.read_string()?.into_owned(),
8180                    );
8181                }
8182                "php_metadata_namespace" => {
8183                    self.php_metadata_namespace = ::core::option::Option::Some(
8184                        dec.read_string()?.into_owned(),
8185                    );
8186                }
8187                "ruby_package" => {
8188                    self.ruby_package = ::core::option::Option::Some(
8189                        dec.read_string()?.into_owned(),
8190                    );
8191                }
8192                "features" => dec.merge_message(self.features.get_or_insert_default())?,
8193                "uninterpreted_option" => {
8194                    dec.read_repeated_into(
8195                        &mut self.uninterpreted_option,
8196                        |__d| {
8197                            let mut __m = ::core::default::Default::default();
8198                            __d.merge_message(&mut __m)?;
8199                            ::core::result::Result::Ok(__m)
8200                        },
8201                    )?
8202                }
8203                __name if __name.starts_with('[') => {
8204                    for __r in dec.read_extension(__name, "google.protobuf.FileOptions")?
8205                    {
8206                        self.__buffa_unknown_fields.push(__r);
8207                    }
8208                }
8209                _ => dec.skip_value()?,
8210            }
8211        }
8212        ::core::result::Result::Ok(())
8213    }
8214}
8215#[cfg(feature = "json")]
8216impl<'de> ::serde::Deserialize<'de> for FileOptions {
8217    fn deserialize<D: ::serde::Deserializer<'de>>(
8218        d: D,
8219    ) -> ::core::result::Result<Self, D::Error> {
8220        struct _V;
8221        impl<'de> ::serde::de::Visitor<'de> for _V {
8222            type Value = FileOptions;
8223            fn expecting(
8224                &self,
8225                f: &mut ::core::fmt::Formatter<'_>,
8226            ) -> ::core::fmt::Result {
8227                f.write_str("struct FileOptions")
8228            }
8229            #[allow(clippy::field_reassign_with_default)]
8230            fn visit_map<A: ::serde::de::MapAccess<'de>>(
8231                self,
8232                mut map: A,
8233            ) -> ::core::result::Result<FileOptions, A::Error> {
8234                let mut __f_java_package: ::core::option::Option<
8235                    ::core::option::Option<::buffa::alloc::string::String>,
8236                > = None;
8237                let mut __f_java_outer_classname: ::core::option::Option<
8238                    ::core::option::Option<::buffa::alloc::string::String>,
8239                > = None;
8240                let mut __f_java_multiple_files: ::core::option::Option<
8241                    ::core::option::Option<bool>,
8242                > = None;
8243                let mut __f_java_generate_equals_and_hash: ::core::option::Option<
8244                    ::core::option::Option<bool>,
8245                > = None;
8246                let mut __f_java_string_check_utf8: ::core::option::Option<
8247                    ::core::option::Option<bool>,
8248                > = None;
8249                let mut __f_optimize_for: ::core::option::Option<
8250                    ::core::option::Option<file_options::OptimizeMode>,
8251                > = None;
8252                let mut __f_go_package: ::core::option::Option<
8253                    ::core::option::Option<::buffa::alloc::string::String>,
8254                > = None;
8255                let mut __f_cc_generic_services: ::core::option::Option<
8256                    ::core::option::Option<bool>,
8257                > = None;
8258                let mut __f_java_generic_services: ::core::option::Option<
8259                    ::core::option::Option<bool>,
8260                > = None;
8261                let mut __f_py_generic_services: ::core::option::Option<
8262                    ::core::option::Option<bool>,
8263                > = None;
8264                let mut __f_deprecated: ::core::option::Option<
8265                    ::core::option::Option<bool>,
8266                > = None;
8267                let mut __f_cc_enable_arenas: ::core::option::Option<
8268                    ::core::option::Option<bool>,
8269                > = None;
8270                let mut __f_objc_class_prefix: ::core::option::Option<
8271                    ::core::option::Option<::buffa::alloc::string::String>,
8272                > = None;
8273                let mut __f_csharp_namespace: ::core::option::Option<
8274                    ::core::option::Option<::buffa::alloc::string::String>,
8275                > = None;
8276                let mut __f_swift_prefix: ::core::option::Option<
8277                    ::core::option::Option<::buffa::alloc::string::String>,
8278                > = None;
8279                let mut __f_php_class_prefix: ::core::option::Option<
8280                    ::core::option::Option<::buffa::alloc::string::String>,
8281                > = None;
8282                let mut __f_php_namespace: ::core::option::Option<
8283                    ::core::option::Option<::buffa::alloc::string::String>,
8284                > = None;
8285                let mut __f_php_metadata_namespace: ::core::option::Option<
8286                    ::core::option::Option<::buffa::alloc::string::String>,
8287                > = None;
8288                let mut __f_ruby_package: ::core::option::Option<
8289                    ::core::option::Option<::buffa::alloc::string::String>,
8290                > = None;
8291                let mut __f_features: ::core::option::Option<
8292                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
8293                > = None;
8294                let mut __f_uninterpreted_option: ::core::option::Option<
8295                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
8296                > = None;
8297                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
8298                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
8299                    match key.as_str() {
8300                        "javaPackage" | "java_package" => {
8301                            __f_java_package = Some(
8302                                map
8303                                    .next_value::<
8304                                        ::core::option::Option<::buffa::alloc::string::String>,
8305                                    >()?,
8306                            );
8307                        }
8308                        "javaOuterClassname" | "java_outer_classname" => {
8309                            __f_java_outer_classname = Some(
8310                                map
8311                                    .next_value::<
8312                                        ::core::option::Option<::buffa::alloc::string::String>,
8313                                    >()?,
8314                            );
8315                        }
8316                        "javaMultipleFiles" | "java_multiple_files" => {
8317                            __f_java_multiple_files = Some(
8318                                map.next_value::<::core::option::Option<bool>>()?,
8319                            );
8320                        }
8321                        "javaGenerateEqualsAndHash"
8322                        | "java_generate_equals_and_hash" => {
8323                            __f_java_generate_equals_and_hash = Some(
8324                                map.next_value::<::core::option::Option<bool>>()?,
8325                            );
8326                        }
8327                        "javaStringCheckUtf8" | "java_string_check_utf8" => {
8328                            __f_java_string_check_utf8 = Some(
8329                                map.next_value::<::core::option::Option<bool>>()?,
8330                            );
8331                        }
8332                        "optimizeFor" | "optimize_for" => {
8333                            __f_optimize_for = Some({
8334                                struct _S;
8335                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
8336                                    type Value = ::core::option::Option<
8337                                        file_options::OptimizeMode,
8338                                    >;
8339                                    fn deserialize<D: ::serde::Deserializer<'de>>(
8340                                        self,
8341                                        d: D,
8342                                    ) -> ::core::result::Result<
8343                                        ::core::option::Option<file_options::OptimizeMode>,
8344                                        D::Error,
8345                                    > {
8346                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
8347                                    }
8348                                }
8349                                map.next_value_seed(_S)?
8350                            });
8351                        }
8352                        "goPackage" | "go_package" => {
8353                            __f_go_package = Some(
8354                                map
8355                                    .next_value::<
8356                                        ::core::option::Option<::buffa::alloc::string::String>,
8357                                    >()?,
8358                            );
8359                        }
8360                        "ccGenericServices" | "cc_generic_services" => {
8361                            __f_cc_generic_services = Some(
8362                                map.next_value::<::core::option::Option<bool>>()?,
8363                            );
8364                        }
8365                        "javaGenericServices" | "java_generic_services" => {
8366                            __f_java_generic_services = Some(
8367                                map.next_value::<::core::option::Option<bool>>()?,
8368                            );
8369                        }
8370                        "pyGenericServices" | "py_generic_services" => {
8371                            __f_py_generic_services = Some(
8372                                map.next_value::<::core::option::Option<bool>>()?,
8373                            );
8374                        }
8375                        "deprecated" => {
8376                            __f_deprecated = Some(
8377                                map.next_value::<::core::option::Option<bool>>()?,
8378                            );
8379                        }
8380                        "ccEnableArenas" | "cc_enable_arenas" => {
8381                            __f_cc_enable_arenas = Some(
8382                                map.next_value::<::core::option::Option<bool>>()?,
8383                            );
8384                        }
8385                        "objcClassPrefix" | "objc_class_prefix" => {
8386                            __f_objc_class_prefix = Some(
8387                                map
8388                                    .next_value::<
8389                                        ::core::option::Option<::buffa::alloc::string::String>,
8390                                    >()?,
8391                            );
8392                        }
8393                        "csharpNamespace" | "csharp_namespace" => {
8394                            __f_csharp_namespace = Some(
8395                                map
8396                                    .next_value::<
8397                                        ::core::option::Option<::buffa::alloc::string::String>,
8398                                    >()?,
8399                            );
8400                        }
8401                        "swiftPrefix" | "swift_prefix" => {
8402                            __f_swift_prefix = Some(
8403                                map
8404                                    .next_value::<
8405                                        ::core::option::Option<::buffa::alloc::string::String>,
8406                                    >()?,
8407                            );
8408                        }
8409                        "phpClassPrefix" | "php_class_prefix" => {
8410                            __f_php_class_prefix = Some(
8411                                map
8412                                    .next_value::<
8413                                        ::core::option::Option<::buffa::alloc::string::String>,
8414                                    >()?,
8415                            );
8416                        }
8417                        "phpNamespace" | "php_namespace" => {
8418                            __f_php_namespace = Some(
8419                                map
8420                                    .next_value::<
8421                                        ::core::option::Option<::buffa::alloc::string::String>,
8422                                    >()?,
8423                            );
8424                        }
8425                        "phpMetadataNamespace" | "php_metadata_namespace" => {
8426                            __f_php_metadata_namespace = Some(
8427                                map
8428                                    .next_value::<
8429                                        ::core::option::Option<::buffa::alloc::string::String>,
8430                                    >()?,
8431                            );
8432                        }
8433                        "rubyPackage" | "ruby_package" => {
8434                            __f_ruby_package = Some(
8435                                map
8436                                    .next_value::<
8437                                        ::core::option::Option<::buffa::alloc::string::String>,
8438                                    >()?,
8439                            );
8440                        }
8441                        "features" => {
8442                            __f_features = Some(
8443                                map
8444                                    .next_value::<
8445                                        ::buffa::MessageField<
8446                                            FeatureSet,
8447                                            ::buffa::Inline<FeatureSet>,
8448                                        >,
8449                                    >()?,
8450                            );
8451                        }
8452                        "uninterpretedOption" | "uninterpreted_option" => {
8453                            __f_uninterpreted_option = Some({
8454                                struct _S;
8455                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
8456                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
8457                                    fn deserialize<D: ::serde::Deserializer<'de>>(
8458                                        self,
8459                                        d: D,
8460                                    ) -> ::core::result::Result<
8461                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
8462                                        D::Error,
8463                                    > {
8464                                        ::buffa::json_helpers::null_as_default(d)
8465                                    }
8466                                }
8467                                map.next_value_seed(_S)?
8468                            });
8469                        }
8470                        __k if __k.starts_with('[') => {
8471                            let __v: ::buffa::serde_json::Value = map.next_value()?;
8472                            match ::buffa::extension_registry::deserialize_extension_key(
8473                                "google.protobuf.FileOptions",
8474                                __k,
8475                                __v,
8476                            ) {
8477                                ::core::option::Option::Some(
8478                                    ::core::result::Result::Ok(__recs),
8479                                ) => {
8480                                    for __rec in __recs {
8481                                        __ext_records.push(__rec);
8482                                    }
8483                                }
8484                                ::core::option::Option::Some(
8485                                    ::core::result::Result::Err(__e),
8486                                ) => {
8487                                    return ::core::result::Result::Err(
8488                                        <A::Error as ::serde::de::Error>::custom(__e),
8489                                    );
8490                                }
8491                                ::core::option::Option::None => {}
8492                            }
8493                        }
8494                        _ => {
8495                            map.next_value::<::serde::de::IgnoredAny>()?;
8496                        }
8497                    }
8498                }
8499                let mut __r = <FileOptions as ::core::default::Default>::default();
8500                if let ::core::option::Option::Some(v) = __f_java_package {
8501                    __r.java_package = v;
8502                }
8503                if let ::core::option::Option::Some(v) = __f_java_outer_classname {
8504                    __r.java_outer_classname = v;
8505                }
8506                if let ::core::option::Option::Some(v) = __f_java_multiple_files {
8507                    __r.java_multiple_files = v;
8508                }
8509                if let ::core::option::Option::Some(v) = __f_java_generate_equals_and_hash {
8510                    __r.java_generate_equals_and_hash = v;
8511                }
8512                if let ::core::option::Option::Some(v) = __f_java_string_check_utf8 {
8513                    __r.java_string_check_utf8 = v;
8514                }
8515                if let ::core::option::Option::Some(v) = __f_optimize_for {
8516                    __r.optimize_for = v;
8517                }
8518                if let ::core::option::Option::Some(v) = __f_go_package {
8519                    __r.go_package = v;
8520                }
8521                if let ::core::option::Option::Some(v) = __f_cc_generic_services {
8522                    __r.cc_generic_services = v;
8523                }
8524                if let ::core::option::Option::Some(v) = __f_java_generic_services {
8525                    __r.java_generic_services = v;
8526                }
8527                if let ::core::option::Option::Some(v) = __f_py_generic_services {
8528                    __r.py_generic_services = v;
8529                }
8530                if let ::core::option::Option::Some(v) = __f_deprecated {
8531                    __r.deprecated = v;
8532                }
8533                if let ::core::option::Option::Some(v) = __f_cc_enable_arenas {
8534                    __r.cc_enable_arenas = v;
8535                }
8536                if let ::core::option::Option::Some(v) = __f_objc_class_prefix {
8537                    __r.objc_class_prefix = v;
8538                }
8539                if let ::core::option::Option::Some(v) = __f_csharp_namespace {
8540                    __r.csharp_namespace = v;
8541                }
8542                if let ::core::option::Option::Some(v) = __f_swift_prefix {
8543                    __r.swift_prefix = v;
8544                }
8545                if let ::core::option::Option::Some(v) = __f_php_class_prefix {
8546                    __r.php_class_prefix = v;
8547                }
8548                if let ::core::option::Option::Some(v) = __f_php_namespace {
8549                    __r.php_namespace = v;
8550                }
8551                if let ::core::option::Option::Some(v) = __f_php_metadata_namespace {
8552                    __r.php_metadata_namespace = v;
8553                }
8554                if let ::core::option::Option::Some(v) = __f_ruby_package {
8555                    __r.ruby_package = v;
8556                }
8557                if let ::core::option::Option::Some(v) = __f_features {
8558                    __r.features = v;
8559                }
8560                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
8561                    __r.uninterpreted_option = v;
8562                }
8563                for __rec in __ext_records {
8564                    __r.__buffa_unknown_fields.push(__rec);
8565                }
8566                Ok(__r)
8567            }
8568        }
8569        d.deserialize_map(_V)
8570    }
8571}
8572#[cfg(feature = "json")]
8573impl ::buffa::json_helpers::ProtoElemJson for FileOptions {
8574    fn serialize_proto_json<S: ::serde::Serializer>(
8575        v: &Self,
8576        s: S,
8577    ) -> ::core::result::Result<S::Ok, S::Error> {
8578        ::serde::Serialize::serialize(v, s)
8579    }
8580    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8581        d: D,
8582    ) -> ::core::result::Result<Self, D::Error> {
8583        <Self as ::serde::Deserialize>::deserialize(d)
8584    }
8585}
8586#[doc(hidden)]
8587#[derive(Clone, Debug, Default, PartialEq)]
8588#[repr(transparent)]
8589#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8590pub struct __FileOptionsExtJson(pub ::buffa::UnknownFields);
8591impl ::core::ops::Deref for __FileOptionsExtJson {
8592    type Target = ::buffa::UnknownFields;
8593    fn deref(&self) -> &::buffa::UnknownFields {
8594        &self.0
8595    }
8596}
8597impl ::core::ops::DerefMut for __FileOptionsExtJson {
8598    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
8599        &mut self.0
8600    }
8601}
8602impl ::core::convert::From<::buffa::UnknownFields> for __FileOptionsExtJson {
8603    fn from(u: ::buffa::UnknownFields) -> Self {
8604        Self(u)
8605    }
8606}
8607#[cfg(feature = "json")]
8608impl ::serde::Serialize for __FileOptionsExtJson {
8609    fn serialize<S: ::serde::Serializer>(
8610        &self,
8611        s: S,
8612    ) -> ::core::result::Result<S::Ok, S::Error> {
8613        ::buffa::extension_registry::serialize_extensions(
8614            "google.protobuf.FileOptions",
8615            &self.0,
8616            s,
8617        )
8618    }
8619}
8620#[cfg(feature = "json")]
8621impl<'de> ::serde::Deserialize<'de> for __FileOptionsExtJson {
8622    fn deserialize<D: ::serde::Deserializer<'de>>(
8623        d: D,
8624    ) -> ::core::result::Result<Self, D::Error> {
8625        ::buffa::extension_registry::deserialize_extensions(
8626                "google.protobuf.FileOptions",
8627                d,
8628            )
8629            .map(Self)
8630    }
8631}
8632#[cfg(feature = "json")]
8633#[doc(hidden)]
8634pub const __FILE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8635    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8636    to_json: ::buffa::type_registry::any_to_json::<FileOptions>,
8637    from_json: ::buffa::type_registry::any_from_json::<FileOptions>,
8638    is_wkt: false,
8639};
8640#[cfg(feature = "text")]
8641#[doc(hidden)]
8642pub const __FILE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
8643    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8644    text_encode: ::buffa::type_registry::any_encode_text::<FileOptions>,
8645    text_merge: ::buffa::type_registry::any_merge_text::<FileOptions>,
8646};
8647pub mod file_options {
8648    #[allow(unused_imports)]
8649    use super::*;
8650    /// Generated classes can be optimized for speed or code size.
8651    #[allow(non_camel_case_types)]
8652    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
8653    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8654    #[repr(i32)]
8655    pub enum OptimizeMode {
8656        /// Generate complete code for parsing, serialization,
8657        SPEED = 1i32,
8658        /// etc.
8659        ///
8660        /// Use ReflectionOps to implement these methods.
8661        CODE_SIZE = 2i32,
8662        /// Generate code using MessageLite and the lite runtime.
8663        LITE_RUNTIME = 3i32,
8664    }
8665    impl OptimizeMode {
8666        ///Idiomatic alias for [`Self::SPEED`]; `Debug` prints the variant name.
8667        #[allow(non_upper_case_globals)]
8668        pub const Speed: Self = Self::SPEED;
8669        ///Idiomatic alias for [`Self::CODE_SIZE`]; `Debug` prints the variant name.
8670        #[allow(non_upper_case_globals)]
8671        pub const CodeSize: Self = Self::CODE_SIZE;
8672        ///Idiomatic alias for [`Self::LITE_RUNTIME`]; `Debug` prints the variant name.
8673        #[allow(non_upper_case_globals)]
8674        pub const LiteRuntime: Self = Self::LITE_RUNTIME;
8675    }
8676    impl ::core::default::Default for OptimizeMode {
8677        fn default() -> Self {
8678            Self::SPEED
8679        }
8680    }
8681    #[cfg(feature = "json")]
8682    const _: () = {
8683        impl ::serde::Serialize for OptimizeMode {
8684            fn serialize<S: ::serde::Serializer>(
8685                &self,
8686                s: S,
8687            ) -> ::core::result::Result<S::Ok, S::Error> {
8688                s.serialize_str(::buffa::Enumeration::proto_name(self))
8689            }
8690        }
8691        impl<'de> ::serde::Deserialize<'de> for OptimizeMode {
8692            fn deserialize<D: ::serde::Deserializer<'de>>(
8693                d: D,
8694            ) -> ::core::result::Result<Self, D::Error> {
8695                struct _V;
8696                impl ::serde::de::Visitor<'_> for _V {
8697                    type Value = OptimizeMode;
8698                    fn expecting(
8699                        &self,
8700                        f: &mut ::core::fmt::Formatter<'_>,
8701                    ) -> ::core::fmt::Result {
8702                        f.write_str(
8703                            concat!(
8704                                "a string, integer, or null for ", stringify!(OptimizeMode)
8705                            ),
8706                        )
8707                    }
8708                    fn visit_str<E: ::serde::de::Error>(
8709                        self,
8710                        v: &str,
8711                    ) -> ::core::result::Result<OptimizeMode, E> {
8712                        <OptimizeMode as ::buffa::Enumeration>::from_proto_name(v)
8713                            .ok_or_else(|| {
8714                                ::serde::de::Error::unknown_variant(v, &[])
8715                            })
8716                    }
8717                    fn visit_i64<E: ::serde::de::Error>(
8718                        self,
8719                        v: i64,
8720                    ) -> ::core::result::Result<OptimizeMode, E> {
8721                        let v32 = i32::try_from(v)
8722                            .map_err(|_| {
8723                                ::serde::de::Error::custom(
8724                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8725                                )
8726                            })?;
8727                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8728                            .ok_or_else(|| {
8729                                ::serde::de::Error::custom(
8730                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8731                                )
8732                            })
8733                    }
8734                    fn visit_u64<E: ::serde::de::Error>(
8735                        self,
8736                        v: u64,
8737                    ) -> ::core::result::Result<OptimizeMode, E> {
8738                        let v32 = i32::try_from(v)
8739                            .map_err(|_| {
8740                                ::serde::de::Error::custom(
8741                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8742                                )
8743                            })?;
8744                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8745                            .ok_or_else(|| {
8746                                ::serde::de::Error::custom(
8747                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8748                                )
8749                            })
8750                    }
8751                    fn visit_unit<E: ::serde::de::Error>(
8752                        self,
8753                    ) -> ::core::result::Result<OptimizeMode, E> {
8754                        ::core::result::Result::Ok(::core::default::Default::default())
8755                    }
8756                }
8757                d.deserialize_any(_V)
8758            }
8759        }
8760        impl ::buffa::json_helpers::ProtoElemJson for OptimizeMode {
8761            fn serialize_proto_json<S: ::serde::Serializer>(
8762                v: &Self,
8763                s: S,
8764            ) -> ::core::result::Result<S::Ok, S::Error> {
8765                ::serde::Serialize::serialize(v, s)
8766            }
8767            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8768                d: D,
8769            ) -> ::core::result::Result<Self, D::Error> {
8770                <Self as ::serde::Deserialize>::deserialize(d)
8771            }
8772        }
8773    };
8774    impl ::buffa::Enumeration for OptimizeMode {
8775        fn from_i32(value: i32) -> ::core::option::Option<Self> {
8776            match value {
8777                1i32 => ::core::option::Option::Some(Self::SPEED),
8778                2i32 => ::core::option::Option::Some(Self::CODE_SIZE),
8779                3i32 => ::core::option::Option::Some(Self::LITE_RUNTIME),
8780                _ => ::core::option::Option::None,
8781            }
8782        }
8783        fn to_i32(&self) -> i32 {
8784            *self as i32
8785        }
8786        fn proto_name(&self) -> &'static str {
8787            match self {
8788                Self::SPEED => "SPEED",
8789                Self::CODE_SIZE => "CODE_SIZE",
8790                Self::LITE_RUNTIME => "LITE_RUNTIME",
8791            }
8792        }
8793        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
8794            match name {
8795                "SPEED" => ::core::option::Option::Some(Self::SPEED),
8796                "CODE_SIZE" => ::core::option::Option::Some(Self::CODE_SIZE),
8797                "LITE_RUNTIME" => ::core::option::Option::Some(Self::LITE_RUNTIME),
8798                _ => ::core::option::Option::None,
8799            }
8800        }
8801        fn values() -> &'static [Self] {
8802            &[Self::SPEED, Self::CODE_SIZE, Self::LITE_RUNTIME]
8803        }
8804    }
8805}
8806#[derive(Clone, PartialEq, Default)]
8807#[cfg_attr(feature = "json", derive(::serde::Serialize))]
8808#[cfg_attr(feature = "json", serde(default))]
8809#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8810pub struct MessageOptions {
8811    /// Set true to use the old proto1 MessageSet wire format for extensions.
8812    /// This is provided for backwards-compatibility with the MessageSet wire
8813    /// format.  You should not use this for any other reason:  It's less
8814    /// efficient, has fewer features, and is more complicated.
8815    ///
8816    /// The message must be defined exactly as follows:
8817    ///   message Foo {
8818    /// ```text
8819    /// option message_set_wire_format = true;
8820    /// extensions 4 to max;
8821    /// ```
8822    ///   }
8823    /// Note that the message cannot have any defined fields; MessageSets only
8824    /// have extensions.
8825    ///
8826    /// All extensions of your type must be singular messages; e.g. they cannot
8827    /// be int32s, enums, or repeated messages.
8828    ///
8829    /// Because this is an option, the above two restrictions are not enforced by
8830    /// the protocol compiler.
8831    ///
8832    /// Field 1: `message_set_wire_format`
8833    #[cfg_attr(
8834        feature = "json",
8835        serde(
8836            rename = "messageSetWireFormat",
8837            alias = "message_set_wire_format",
8838            skip_serializing_if = "::core::option::Option::is_none"
8839        )
8840    )]
8841    pub message_set_wire_format: ::core::option::Option<bool>,
8842    /// Disables the generation of the standard "descriptor()" accessor, which can
8843    /// conflict with a field of the same name.  This is meant to make migration
8844    /// from proto1 easier; new code should avoid fields named "descriptor".
8845    ///
8846    /// Field 2: `no_standard_descriptor_accessor`
8847    #[cfg_attr(
8848        feature = "json",
8849        serde(
8850            rename = "noStandardDescriptorAccessor",
8851            alias = "no_standard_descriptor_accessor",
8852            skip_serializing_if = "::core::option::Option::is_none"
8853        )
8854    )]
8855    pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
8856    /// Is this message deprecated?
8857    /// Depending on the target platform, this can emit Deprecated annotations
8858    /// for the message, or it will be completely ignored; in the very least,
8859    /// this is a formalization for deprecating messages.
8860    ///
8861    /// Field 3: `deprecated`
8862    #[cfg_attr(
8863        feature = "json",
8864        serde(
8865            rename = "deprecated",
8866            skip_serializing_if = "::core::option::Option::is_none"
8867        )
8868    )]
8869    pub deprecated: ::core::option::Option<bool>,
8870    /// Whether the message is an automatically generated map entry type for the
8871    /// maps field.
8872    ///
8873    /// For maps fields:
8874    /// ```text
8875    /// map<KeyType, ValueType> map_field = 1;
8876    /// ```
8877    /// The parsed descriptor looks like:
8878    /// ```text
8879    /// message MapFieldEntry {
8880    ///     option map_entry = true;
8881    ///     optional KeyType key = 1;
8882    ///     optional ValueType value = 2;
8883    /// }
8884    /// repeated MapFieldEntry map_field = 1;
8885    /// ```
8886    ///
8887    /// Implementations may choose not to generate the map_entry=true message, but
8888    /// use a native map in the target language to hold the keys and values.
8889    /// The reflection APIs in such implementations still need to work as
8890    /// if the field is a repeated message field.
8891    ///
8892    /// NOTE: Do not set the option in .proto files. Always use the maps syntax
8893    /// instead. The option should only be implicitly set by the proto compiler
8894    /// parser.
8895    ///
8896    /// Field 7: `map_entry`
8897    #[cfg_attr(
8898        feature = "json",
8899        serde(
8900            rename = "mapEntry",
8901            alias = "map_entry",
8902            skip_serializing_if = "::core::option::Option::is_none"
8903        )
8904    )]
8905    pub map_entry: ::core::option::Option<bool>,
8906    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
8907    /// and strips underscored from the fields before comparison in proto3 only.
8908    /// The new behavior takes `json_name` into account and applies to proto2 as
8909    /// well.
8910    ///
8911    /// This should only be used as a temporary measure against broken builds due
8912    /// to the change in behavior for JSON field name conflicts.
8913    ///
8914    /// TODO This is legacy behavior we plan to remove once downstream
8915    /// teams have had time to migrate.
8916    ///
8917    /// Field 11: `deprecated_legacy_json_field_conflicts`
8918    #[cfg_attr(
8919        feature = "json",
8920        serde(
8921            rename = "deprecatedLegacyJsonFieldConflicts",
8922            alias = "deprecated_legacy_json_field_conflicts",
8923            skip_serializing_if = "::core::option::Option::is_none"
8924        )
8925    )]
8926    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
8927    /// Any features defined in the specific edition.
8928    /// WARNING: This field should only be used by protobuf plugins or special
8929    /// cases like the proto compiler. Other uses are discouraged and
8930    /// developers should rely on the protoreflect APIs for their client language.
8931    ///
8932    /// Field 12: `features`
8933    #[cfg_attr(
8934        feature = "json",
8935        serde(
8936            rename = "features",
8937            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
8938        )
8939    )]
8940    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
8941    /// The parser stores options it doesn't recognize here. See above.
8942    ///
8943    /// Field 999: `uninterpreted_option`
8944    #[cfg_attr(
8945        feature = "json",
8946        serde(
8947            rename = "uninterpretedOption",
8948            alias = "uninterpreted_option",
8949            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
8950            deserialize_with = "::buffa::json_helpers::null_as_default"
8951        )
8952    )]
8953    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
8954    #[cfg_attr(feature = "json", serde(flatten))]
8955    #[doc(hidden)]
8956    pub __buffa_unknown_fields: __MessageOptionsExtJson,
8957}
8958impl ::core::fmt::Debug for MessageOptions {
8959    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8960        f.debug_struct("MessageOptions")
8961            .field("message_set_wire_format", &self.message_set_wire_format)
8962            .field(
8963                "no_standard_descriptor_accessor",
8964                &self.no_standard_descriptor_accessor,
8965            )
8966            .field("deprecated", &self.deprecated)
8967            .field("map_entry", &self.map_entry)
8968            .field(
8969                "deprecated_legacy_json_field_conflicts",
8970                &self.deprecated_legacy_json_field_conflicts,
8971            )
8972            .field("features", &self.features)
8973            .field("uninterpreted_option", &self.uninterpreted_option)
8974            .finish()
8975    }
8976}
8977impl MessageOptions {
8978    /// Protobuf type URL for this message, for use with `Any::pack` and
8979    /// `Any::unpack_if`.
8980    ///
8981    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8982    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
8983}
8984impl MessageOptions {
8985    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8986    #[inline]
8987    ///Sets [`Self::message_set_wire_format`] to `Some(value)`, consuming and returning `self`.
8988    pub fn with_message_set_wire_format(mut self, value: bool) -> Self {
8989        self.message_set_wire_format = Some(value);
8990        self
8991    }
8992    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8993    #[inline]
8994    ///Sets [`Self::no_standard_descriptor_accessor`] to `Some(value)`, consuming and returning `self`.
8995    pub fn with_no_standard_descriptor_accessor(mut self, value: bool) -> Self {
8996        self.no_standard_descriptor_accessor = Some(value);
8997        self
8998    }
8999    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9000    #[inline]
9001    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
9002    pub fn with_deprecated(mut self, value: bool) -> Self {
9003        self.deprecated = Some(value);
9004        self
9005    }
9006    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9007    #[inline]
9008    ///Sets [`Self::map_entry`] to `Some(value)`, consuming and returning `self`.
9009    pub fn with_map_entry(mut self, value: bool) -> Self {
9010        self.map_entry = Some(value);
9011        self
9012    }
9013    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9014    #[inline]
9015    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
9016    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
9017        self.deprecated_legacy_json_field_conflicts = Some(value);
9018        self
9019    }
9020}
9021::buffa::impl_default_instance!(MessageOptions);
9022impl ::buffa::MessageName for MessageOptions {
9023    const PACKAGE: &'static str = "google.protobuf";
9024    const NAME: &'static str = "MessageOptions";
9025    const FULL_NAME: &'static str = "google.protobuf.MessageOptions";
9026    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
9027}
9028impl ::buffa::Message for MessageOptions {
9029    /// Returns the total encoded size in bytes.
9030    ///
9031    /// Accumulates in `u64` (which cannot overflow for in-memory
9032    /// data) and saturates to `u32` at return, so a message whose
9033    /// encoded size exceeds the 2 GiB protobuf limit yields a value
9034    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
9035    /// points reject, never a silently wrapped size.
9036    #[allow(clippy::let_and_return)]
9037    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9038        #[allow(unused_imports)]
9039        use ::buffa::Enumeration as _;
9040        let mut size = 0u64;
9041        if self.message_set_wire_format.is_some() {
9042            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9043        }
9044        if self.no_standard_descriptor_accessor.is_some() {
9045            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9046        }
9047        if self.deprecated.is_some() {
9048            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9049        }
9050        if self.map_entry.is_some() {
9051            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9052        }
9053        if self.deprecated_legacy_json_field_conflicts.is_some() {
9054            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9055        }
9056        if self.features.is_set() {
9057            let __slot = __cache.reserve();
9058            let inner_size = self.features.compute_size(__cache);
9059            __cache.set(__slot, inner_size);
9060            size
9061                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9062                    + inner_size as u64;
9063        }
9064        for v in &self.uninterpreted_option {
9065            let __slot = __cache.reserve();
9066            let inner_size = v.compute_size(__cache);
9067            __cache.set(__slot, inner_size);
9068            size
9069                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9070                    + inner_size as u64;
9071        }
9072        size += self.__buffa_unknown_fields.encoded_len() as u64;
9073        ::buffa::saturate_size(size)
9074    }
9075    fn write_to(
9076        &self,
9077        __cache: &mut ::buffa::SizeCache,
9078        buf: &mut impl ::buffa::EncodeSink,
9079    ) {
9080        #[allow(unused_imports)]
9081        use ::buffa::Enumeration as _;
9082        if let Some(v) = self.message_set_wire_format {
9083            ::buffa::types::put_bool_field(1u32, v, buf);
9084        }
9085        if let Some(v) = self.no_standard_descriptor_accessor {
9086            ::buffa::types::put_bool_field(2u32, v, buf);
9087        }
9088        if let Some(v) = self.deprecated {
9089            ::buffa::types::put_bool_field(3u32, v, buf);
9090        }
9091        if let Some(v) = self.map_entry {
9092            ::buffa::types::put_bool_field(7u32, v, buf);
9093        }
9094        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
9095            ::buffa::types::put_bool_field(11u32, v, buf);
9096        }
9097        if self.features.is_set() {
9098            ::buffa::types::put_len_delimited_header(
9099                12u32,
9100                u64::from(__cache.consume_next()),
9101                buf,
9102            );
9103            self.features.write_to(__cache, buf);
9104        }
9105        for v in &self.uninterpreted_option {
9106            ::buffa::types::put_len_delimited_header(
9107                999u32,
9108                u64::from(__cache.consume_next()),
9109                buf,
9110            );
9111            v.write_to(__cache, buf);
9112        }
9113        self.__buffa_unknown_fields.write_to(buf);
9114    }
9115    fn merge_field(
9116        &mut self,
9117        tag: ::buffa::encoding::Tag,
9118        buf: &mut impl ::buffa::bytes::Buf,
9119        ctx: ::buffa::DecodeContext<'_>,
9120    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9121        #[allow(unused_imports)]
9122        use ::buffa::bytes::Buf as _;
9123        #[allow(unused_imports)]
9124        use ::buffa::Enumeration as _;
9125        match tag.field_number() {
9126            1u32 => {
9127                ::buffa::encoding::check_wire_type(
9128                    tag,
9129                    ::buffa::encoding::WireType::Varint,
9130                )?;
9131                self.message_set_wire_format = ::core::option::Option::Some(
9132                    ::buffa::types::decode_bool(buf)?,
9133                );
9134            }
9135            2u32 => {
9136                ::buffa::encoding::check_wire_type(
9137                    tag,
9138                    ::buffa::encoding::WireType::Varint,
9139                )?;
9140                self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9141                    ::buffa::types::decode_bool(buf)?,
9142                );
9143            }
9144            3u32 => {
9145                ::buffa::encoding::check_wire_type(
9146                    tag,
9147                    ::buffa::encoding::WireType::Varint,
9148                )?;
9149                self.deprecated = ::core::option::Option::Some(
9150                    ::buffa::types::decode_bool(buf)?,
9151                );
9152            }
9153            7u32 => {
9154                ::buffa::encoding::check_wire_type(
9155                    tag,
9156                    ::buffa::encoding::WireType::Varint,
9157                )?;
9158                self.map_entry = ::core::option::Option::Some(
9159                    ::buffa::types::decode_bool(buf)?,
9160                );
9161            }
9162            11u32 => {
9163                ::buffa::encoding::check_wire_type(
9164                    tag,
9165                    ::buffa::encoding::WireType::Varint,
9166                )?;
9167                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9168                    ::buffa::types::decode_bool(buf)?,
9169                );
9170            }
9171            12u32 => {
9172                ::buffa::encoding::check_wire_type(
9173                    tag,
9174                    ::buffa::encoding::WireType::LengthDelimited,
9175                )?;
9176                ::buffa::Message::merge_length_delimited(
9177                    self.features.get_or_insert_default(),
9178                    buf,
9179                    ctx,
9180                )?;
9181            }
9182            999u32 => {
9183                ::buffa::encoding::check_wire_type(
9184                    tag,
9185                    ::buffa::encoding::WireType::LengthDelimited,
9186                )?;
9187                let mut elem = ::core::default::Default::default();
9188                ctx.register_element_memory(
9189                    ::buffa::__private::element_footprint(&elem),
9190                )?;
9191                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
9192                self.uninterpreted_option.push(elem);
9193            }
9194            _ => {
9195                self.__buffa_unknown_fields
9196                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
9197            }
9198        }
9199        ::core::result::Result::Ok(())
9200    }
9201    fn clear(&mut self) {
9202        self.message_set_wire_format = ::core::option::Option::None;
9203        self.no_standard_descriptor_accessor = ::core::option::Option::None;
9204        self.deprecated = ::core::option::Option::None;
9205        self.map_entry = ::core::option::Option::None;
9206        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
9207        self.features = ::buffa::MessageField::none();
9208        self.uninterpreted_option.clear();
9209        self.__buffa_unknown_fields.clear();
9210    }
9211}
9212impl ::buffa::ExtensionSet for MessageOptions {
9213    const PROTO_FQN: &'static str = "google.protobuf.MessageOptions";
9214    fn unknown_fields(&self) -> &::buffa::UnknownFields {
9215        &self.__buffa_unknown_fields
9216    }
9217    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9218        &mut self.__buffa_unknown_fields
9219    }
9220}
9221#[cfg(feature = "text")]
9222impl ::buffa::text::TextFormat for MessageOptions {
9223    fn encode_text(
9224        &self,
9225        enc: &mut ::buffa::text::TextEncoder<'_>,
9226    ) -> ::core::fmt::Result {
9227        #[allow(unused_imports)]
9228        use ::buffa::Enumeration as _;
9229        if let ::core::option::Option::Some(ref __v) = self.message_set_wire_format {
9230            enc.write_field_name("message_set_wire_format")?;
9231            enc.write_bool(*__v)?;
9232        }
9233        if let ::core::option::Option::Some(ref __v) = self
9234            .no_standard_descriptor_accessor
9235        {
9236            enc.write_field_name("no_standard_descriptor_accessor")?;
9237            enc.write_bool(*__v)?;
9238        }
9239        if let ::core::option::Option::Some(ref __v) = self.deprecated {
9240            enc.write_field_name("deprecated")?;
9241            enc.write_bool(*__v)?;
9242        }
9243        if let ::core::option::Option::Some(ref __v) = self.map_entry {
9244            enc.write_field_name("map_entry")?;
9245            enc.write_bool(*__v)?;
9246        }
9247        if let ::core::option::Option::Some(ref __v) = self
9248            .deprecated_legacy_json_field_conflicts
9249        {
9250            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
9251            enc.write_bool(*__v)?;
9252        }
9253        if self.features.is_set() {
9254            enc.write_field_name("features")?;
9255            enc.write_message(&*self.features)?;
9256        }
9257        for __v in &self.uninterpreted_option {
9258            enc.write_field_name("uninterpreted_option")?;
9259            enc.write_message(__v)?;
9260        }
9261        enc.write_extension_fields(
9262            "google.protobuf.MessageOptions",
9263            &self.__buffa_unknown_fields,
9264        )?;
9265        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
9266        ::core::result::Result::Ok(())
9267    }
9268    fn merge_text(
9269        &mut self,
9270        dec: &mut ::buffa::text::TextDecoder<'_>,
9271    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
9272        #[allow(unused_imports)]
9273        use ::buffa::Enumeration as _;
9274        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
9275            match __name {
9276                "message_set_wire_format" => {
9277                    self.message_set_wire_format = ::core::option::Option::Some(
9278                        dec.read_bool()?,
9279                    );
9280                }
9281                "no_standard_descriptor_accessor" => {
9282                    self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9283                        dec.read_bool()?,
9284                    );
9285                }
9286                "deprecated" => {
9287                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
9288                }
9289                "map_entry" => {
9290                    self.map_entry = ::core::option::Option::Some(dec.read_bool()?);
9291                }
9292                "deprecated_legacy_json_field_conflicts" => {
9293                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9294                        dec.read_bool()?,
9295                    );
9296                }
9297                "features" => dec.merge_message(self.features.get_or_insert_default())?,
9298                "uninterpreted_option" => {
9299                    dec.read_repeated_into(
9300                        &mut self.uninterpreted_option,
9301                        |__d| {
9302                            let mut __m = ::core::default::Default::default();
9303                            __d.merge_message(&mut __m)?;
9304                            ::core::result::Result::Ok(__m)
9305                        },
9306                    )?
9307                }
9308                __name if __name.starts_with('[') => {
9309                    for __r in dec
9310                        .read_extension(__name, "google.protobuf.MessageOptions")?
9311                    {
9312                        self.__buffa_unknown_fields.push(__r);
9313                    }
9314                }
9315                _ => dec.skip_value()?,
9316            }
9317        }
9318        ::core::result::Result::Ok(())
9319    }
9320}
9321#[cfg(feature = "json")]
9322impl<'de> ::serde::Deserialize<'de> for MessageOptions {
9323    fn deserialize<D: ::serde::Deserializer<'de>>(
9324        d: D,
9325    ) -> ::core::result::Result<Self, D::Error> {
9326        struct _V;
9327        impl<'de> ::serde::de::Visitor<'de> for _V {
9328            type Value = MessageOptions;
9329            fn expecting(
9330                &self,
9331                f: &mut ::core::fmt::Formatter<'_>,
9332            ) -> ::core::fmt::Result {
9333                f.write_str("struct MessageOptions")
9334            }
9335            #[allow(clippy::field_reassign_with_default)]
9336            fn visit_map<A: ::serde::de::MapAccess<'de>>(
9337                self,
9338                mut map: A,
9339            ) -> ::core::result::Result<MessageOptions, A::Error> {
9340                let mut __f_message_set_wire_format: ::core::option::Option<
9341                    ::core::option::Option<bool>,
9342                > = None;
9343                let mut __f_no_standard_descriptor_accessor: ::core::option::Option<
9344                    ::core::option::Option<bool>,
9345                > = None;
9346                let mut __f_deprecated: ::core::option::Option<
9347                    ::core::option::Option<bool>,
9348                > = None;
9349                let mut __f_map_entry: ::core::option::Option<
9350                    ::core::option::Option<bool>,
9351                > = None;
9352                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
9353                    ::core::option::Option<bool>,
9354                > = None;
9355                let mut __f_features: ::core::option::Option<
9356                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
9357                > = None;
9358                let mut __f_uninterpreted_option: ::core::option::Option<
9359                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
9360                > = None;
9361                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
9362                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
9363                    match key.as_str() {
9364                        "messageSetWireFormat" | "message_set_wire_format" => {
9365                            __f_message_set_wire_format = Some(
9366                                map.next_value::<::core::option::Option<bool>>()?,
9367                            );
9368                        }
9369                        "noStandardDescriptorAccessor"
9370                        | "no_standard_descriptor_accessor" => {
9371                            __f_no_standard_descriptor_accessor = Some(
9372                                map.next_value::<::core::option::Option<bool>>()?,
9373                            );
9374                        }
9375                        "deprecated" => {
9376                            __f_deprecated = Some(
9377                                map.next_value::<::core::option::Option<bool>>()?,
9378                            );
9379                        }
9380                        "mapEntry" | "map_entry" => {
9381                            __f_map_entry = Some(
9382                                map.next_value::<::core::option::Option<bool>>()?,
9383                            );
9384                        }
9385                        "deprecatedLegacyJsonFieldConflicts"
9386                        | "deprecated_legacy_json_field_conflicts" => {
9387                            __f_deprecated_legacy_json_field_conflicts = Some(
9388                                map.next_value::<::core::option::Option<bool>>()?,
9389                            );
9390                        }
9391                        "features" => {
9392                            __f_features = Some(
9393                                map
9394                                    .next_value::<
9395                                        ::buffa::MessageField<
9396                                            FeatureSet,
9397                                            ::buffa::Inline<FeatureSet>,
9398                                        >,
9399                                    >()?,
9400                            );
9401                        }
9402                        "uninterpretedOption" | "uninterpreted_option" => {
9403                            __f_uninterpreted_option = Some({
9404                                struct _S;
9405                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
9406                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
9407                                    fn deserialize<D: ::serde::Deserializer<'de>>(
9408                                        self,
9409                                        d: D,
9410                                    ) -> ::core::result::Result<
9411                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
9412                                        D::Error,
9413                                    > {
9414                                        ::buffa::json_helpers::null_as_default(d)
9415                                    }
9416                                }
9417                                map.next_value_seed(_S)?
9418                            });
9419                        }
9420                        __k if __k.starts_with('[') => {
9421                            let __v: ::buffa::serde_json::Value = map.next_value()?;
9422                            match ::buffa::extension_registry::deserialize_extension_key(
9423                                "google.protobuf.MessageOptions",
9424                                __k,
9425                                __v,
9426                            ) {
9427                                ::core::option::Option::Some(
9428                                    ::core::result::Result::Ok(__recs),
9429                                ) => {
9430                                    for __rec in __recs {
9431                                        __ext_records.push(__rec);
9432                                    }
9433                                }
9434                                ::core::option::Option::Some(
9435                                    ::core::result::Result::Err(__e),
9436                                ) => {
9437                                    return ::core::result::Result::Err(
9438                                        <A::Error as ::serde::de::Error>::custom(__e),
9439                                    );
9440                                }
9441                                ::core::option::Option::None => {}
9442                            }
9443                        }
9444                        _ => {
9445                            map.next_value::<::serde::de::IgnoredAny>()?;
9446                        }
9447                    }
9448                }
9449                let mut __r = <MessageOptions as ::core::default::Default>::default();
9450                if let ::core::option::Option::Some(v) = __f_message_set_wire_format {
9451                    __r.message_set_wire_format = v;
9452                }
9453                if let ::core::option::Option::Some(v) = __f_no_standard_descriptor_accessor {
9454                    __r.no_standard_descriptor_accessor = v;
9455                }
9456                if let ::core::option::Option::Some(v) = __f_deprecated {
9457                    __r.deprecated = v;
9458                }
9459                if let ::core::option::Option::Some(v) = __f_map_entry {
9460                    __r.map_entry = v;
9461                }
9462                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
9463                    __r.deprecated_legacy_json_field_conflicts = v;
9464                }
9465                if let ::core::option::Option::Some(v) = __f_features {
9466                    __r.features = v;
9467                }
9468                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
9469                    __r.uninterpreted_option = v;
9470                }
9471                for __rec in __ext_records {
9472                    __r.__buffa_unknown_fields.push(__rec);
9473                }
9474                Ok(__r)
9475            }
9476        }
9477        d.deserialize_map(_V)
9478    }
9479}
9480#[cfg(feature = "json")]
9481impl ::buffa::json_helpers::ProtoElemJson for MessageOptions {
9482    fn serialize_proto_json<S: ::serde::Serializer>(
9483        v: &Self,
9484        s: S,
9485    ) -> ::core::result::Result<S::Ok, S::Error> {
9486        ::serde::Serialize::serialize(v, s)
9487    }
9488    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9489        d: D,
9490    ) -> ::core::result::Result<Self, D::Error> {
9491        <Self as ::serde::Deserialize>::deserialize(d)
9492    }
9493}
9494#[doc(hidden)]
9495#[derive(Clone, Debug, Default, PartialEq)]
9496#[repr(transparent)]
9497#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9498pub struct __MessageOptionsExtJson(pub ::buffa::UnknownFields);
9499impl ::core::ops::Deref for __MessageOptionsExtJson {
9500    type Target = ::buffa::UnknownFields;
9501    fn deref(&self) -> &::buffa::UnknownFields {
9502        &self.0
9503    }
9504}
9505impl ::core::ops::DerefMut for __MessageOptionsExtJson {
9506    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
9507        &mut self.0
9508    }
9509}
9510impl ::core::convert::From<::buffa::UnknownFields> for __MessageOptionsExtJson {
9511    fn from(u: ::buffa::UnknownFields) -> Self {
9512        Self(u)
9513    }
9514}
9515#[cfg(feature = "json")]
9516impl ::serde::Serialize for __MessageOptionsExtJson {
9517    fn serialize<S: ::serde::Serializer>(
9518        &self,
9519        s: S,
9520    ) -> ::core::result::Result<S::Ok, S::Error> {
9521        ::buffa::extension_registry::serialize_extensions(
9522            "google.protobuf.MessageOptions",
9523            &self.0,
9524            s,
9525        )
9526    }
9527}
9528#[cfg(feature = "json")]
9529impl<'de> ::serde::Deserialize<'de> for __MessageOptionsExtJson {
9530    fn deserialize<D: ::serde::Deserializer<'de>>(
9531        d: D,
9532    ) -> ::core::result::Result<Self, D::Error> {
9533        ::buffa::extension_registry::deserialize_extensions(
9534                "google.protobuf.MessageOptions",
9535                d,
9536            )
9537            .map(Self)
9538    }
9539}
9540#[cfg(feature = "json")]
9541#[doc(hidden)]
9542pub const __MESSAGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9543    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9544    to_json: ::buffa::type_registry::any_to_json::<MessageOptions>,
9545    from_json: ::buffa::type_registry::any_from_json::<MessageOptions>,
9546    is_wkt: false,
9547};
9548#[cfg(feature = "text")]
9549#[doc(hidden)]
9550pub const __MESSAGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
9551    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9552    text_encode: ::buffa::type_registry::any_encode_text::<MessageOptions>,
9553    text_merge: ::buffa::type_registry::any_merge_text::<MessageOptions>,
9554};
9555#[derive(Clone, PartialEq, Default)]
9556#[cfg_attr(feature = "json", derive(::serde::Serialize))]
9557#[cfg_attr(feature = "json", serde(default))]
9558#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9559pub struct FieldOptions {
9560    /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
9561    /// The ctype option instructs the C++ code generator to use a different
9562    /// representation of the field than it normally would.  See the specific
9563    /// options below.  This option is only implemented to support use of
9564    /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
9565    /// type "bytes" in the open source release.
9566    /// TODO: make ctype actually deprecated.
9567    ///
9568    /// Field 1: `ctype`
9569    #[cfg_attr(
9570        feature = "json",
9571        serde(
9572            rename = "ctype",
9573            with = "::buffa::json_helpers::opt_closed_enum",
9574            skip_serializing_if = "::core::option::Option::is_none"
9575        )
9576    )]
9577    pub ctype: ::core::option::Option<field_options::CType>,
9578    /// The packed option can be enabled for repeated primitive fields to enable
9579    /// a more efficient representation on the wire. Rather than repeatedly
9580    /// writing the tag and type for each element, the entire array is encoded as
9581    /// a single length-delimited blob. In proto3, only explicit setting it to
9582    /// false will avoid using packed encoding.  This option is prohibited in
9583    /// Editions, but the `repeated_field_encoding` feature can be used to control
9584    /// the behavior.
9585    ///
9586    /// Field 2: `packed`
9587    #[cfg_attr(
9588        feature = "json",
9589        serde(rename = "packed", skip_serializing_if = "::core::option::Option::is_none")
9590    )]
9591    pub packed: ::core::option::Option<bool>,
9592    /// The jstype option determines the JavaScript type used for values of the
9593    /// field.  The option is permitted only for 64 bit integral and fixed types
9594    /// (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
9595    /// is represented as JavaScript string, which avoids loss of precision that
9596    /// can happen when a large value is converted to a floating point JavaScript.
9597    /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
9598    /// use the JavaScript "number" type.  The behavior of the default option
9599    /// JS_NORMAL is implementation dependent.
9600    ///
9601    /// This option is an enum to permit additional types to be added, e.g.
9602    /// goog.math.Integer.
9603    ///
9604    /// Field 6: `jstype`
9605    #[cfg_attr(
9606        feature = "json",
9607        serde(
9608            rename = "jstype",
9609            with = "::buffa::json_helpers::opt_closed_enum",
9610            skip_serializing_if = "::core::option::Option::is_none"
9611        )
9612    )]
9613    pub jstype: ::core::option::Option<field_options::JSType>,
9614    /// Should this field be parsed lazily?  Lazy applies only to message-type
9615    /// fields.  It means that when the outer message is initially parsed, the
9616    /// inner message's contents will not be parsed but instead stored in encoded
9617    /// form.  The inner message will actually be parsed when it is first accessed.
9618    ///
9619    /// This is only a hint.  Implementations are free to choose whether to use
9620    /// eager or lazy parsing regardless of the value of this option.  However,
9621    /// setting this option true suggests that the protocol author believes that
9622    /// using lazy parsing on this field is worth the additional bookkeeping
9623    /// overhead typically needed to implement it.
9624    ///
9625    /// This option does not affect the public interface of any generated code;
9626    /// all method signatures remain the same.  Furthermore, thread-safety of the
9627    /// interface is not affected by this option; const methods remain safe to
9628    /// call from multiple threads concurrently, while non-const methods continue
9629    /// to require exclusive access.
9630    ///
9631    /// Note that lazy message fields are still eagerly verified to check
9632    /// ill-formed wireformat or missing required fields. Calling IsInitialized()
9633    /// on the outer message would fail if the inner message has missing required
9634    /// fields. Failed verification would result in parsing failure (except when
9635    /// uninitialized messages are acceptable).
9636    ///
9637    /// Field 5: `lazy`
9638    #[cfg_attr(
9639        feature = "json",
9640        serde(rename = "lazy", skip_serializing_if = "::core::option::Option::is_none")
9641    )]
9642    pub lazy: ::core::option::Option<bool>,
9643    /// unverified_lazy does no correctness checks on the byte stream. This should
9644    /// only be used where lazy with verification is prohibitive for performance
9645    /// reasons.
9646    ///
9647    /// Field 15: `unverified_lazy`
9648    #[cfg_attr(
9649        feature = "json",
9650        serde(
9651            rename = "unverifiedLazy",
9652            alias = "unverified_lazy",
9653            skip_serializing_if = "::core::option::Option::is_none"
9654        )
9655    )]
9656    pub unverified_lazy: ::core::option::Option<bool>,
9657    /// Is this field deprecated?
9658    /// Depending on the target platform, this can emit Deprecated annotations
9659    /// for accessors, or it will be completely ignored; in the very least, this
9660    /// is a formalization for deprecating fields.
9661    ///
9662    /// Field 3: `deprecated`
9663    #[cfg_attr(
9664        feature = "json",
9665        serde(
9666            rename = "deprecated",
9667            skip_serializing_if = "::core::option::Option::is_none"
9668        )
9669    )]
9670    pub deprecated: ::core::option::Option<bool>,
9671    /// DEPRECATED. DO NOT USE!
9672    /// For Google-internal migration only. Do not use.
9673    ///
9674    /// Field 10: `weak`
9675    #[cfg_attr(
9676        feature = "json",
9677        serde(rename = "weak", skip_serializing_if = "::core::option::Option::is_none")
9678    )]
9679    pub weak: ::core::option::Option<bool>,
9680    /// Indicate that the field value should not be printed out when using debug
9681    /// formats, e.g. when the field contains sensitive credentials.
9682    ///
9683    /// Field 16: `debug_redact`
9684    #[cfg_attr(
9685        feature = "json",
9686        serde(
9687            rename = "debugRedact",
9688            alias = "debug_redact",
9689            skip_serializing_if = "::core::option::Option::is_none"
9690        )
9691    )]
9692    pub debug_redact: ::core::option::Option<bool>,
9693    /// Field 17: `retention`
9694    #[cfg_attr(
9695        feature = "json",
9696        serde(
9697            rename = "retention",
9698            with = "::buffa::json_helpers::opt_closed_enum",
9699            skip_serializing_if = "::core::option::Option::is_none"
9700        )
9701    )]
9702    pub retention: ::core::option::Option<field_options::OptionRetention>,
9703    /// Field 19: `targets`
9704    #[cfg_attr(
9705        feature = "json",
9706        serde(
9707            rename = "targets",
9708            with = "::buffa::json_helpers::repeated_closed_enum",
9709            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
9710        )
9711    )]
9712    pub targets: ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
9713    /// Field 20: `edition_defaults`
9714    #[cfg_attr(
9715        feature = "json",
9716        serde(
9717            rename = "editionDefaults",
9718            alias = "edition_defaults",
9719            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9720            deserialize_with = "::buffa::json_helpers::null_as_default"
9721        )
9722    )]
9723    pub edition_defaults: ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
9724    /// Any features defined in the specific edition.
9725    /// WARNING: This field should only be used by protobuf plugins or special
9726    /// cases like the proto compiler. Other uses are discouraged and
9727    /// developers should rely on the protoreflect APIs for their client language.
9728    ///
9729    /// Field 21: `features`
9730    #[cfg_attr(
9731        feature = "json",
9732        serde(
9733            rename = "features",
9734            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9735        )
9736    )]
9737    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
9738    /// Field 22: `feature_support`
9739    #[cfg_attr(
9740        feature = "json",
9741        serde(
9742            rename = "featureSupport",
9743            alias = "feature_support",
9744            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9745        )
9746    )]
9747    pub feature_support: ::buffa::MessageField<
9748        field_options::FeatureSupport,
9749        ::buffa::Inline<field_options::FeatureSupport>,
9750    >,
9751    /// The parser stores options it doesn't recognize here. See above.
9752    ///
9753    /// Field 999: `uninterpreted_option`
9754    #[cfg_attr(
9755        feature = "json",
9756        serde(
9757            rename = "uninterpretedOption",
9758            alias = "uninterpreted_option",
9759            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9760            deserialize_with = "::buffa::json_helpers::null_as_default"
9761        )
9762    )]
9763    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
9764    #[cfg_attr(feature = "json", serde(flatten))]
9765    #[doc(hidden)]
9766    pub __buffa_unknown_fields: __FieldOptionsExtJson,
9767}
9768impl ::core::fmt::Debug for FieldOptions {
9769    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9770        f.debug_struct("FieldOptions")
9771            .field("ctype", &self.ctype)
9772            .field("packed", &self.packed)
9773            .field("jstype", &self.jstype)
9774            .field("lazy", &self.lazy)
9775            .field("unverified_lazy", &self.unverified_lazy)
9776            .field("deprecated", &self.deprecated)
9777            .field("weak", &self.weak)
9778            .field("debug_redact", &self.debug_redact)
9779            .field("retention", &self.retention)
9780            .field("targets", &self.targets)
9781            .field("edition_defaults", &self.edition_defaults)
9782            .field("features", &self.features)
9783            .field("feature_support", &self.feature_support)
9784            .field("uninterpreted_option", &self.uninterpreted_option)
9785            .finish()
9786    }
9787}
9788impl FieldOptions {
9789    /// Protobuf type URL for this message, for use with `Any::pack` and
9790    /// `Any::unpack_if`.
9791    ///
9792    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9793    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9794}
9795impl FieldOptions {
9796    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9797    #[inline]
9798    ///Sets [`Self::ctype`] to `Some(value)`, consuming and returning `self`.
9799    pub fn with_ctype(mut self, value: impl Into<field_options::CType>) -> Self {
9800        self.ctype = Some(value.into());
9801        self
9802    }
9803    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9804    #[inline]
9805    ///Sets [`Self::packed`] to `Some(value)`, consuming and returning `self`.
9806    pub fn with_packed(mut self, value: bool) -> Self {
9807        self.packed = Some(value);
9808        self
9809    }
9810    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9811    #[inline]
9812    ///Sets [`Self::jstype`] to `Some(value)`, consuming and returning `self`.
9813    pub fn with_jstype(mut self, value: impl Into<field_options::JSType>) -> Self {
9814        self.jstype = Some(value.into());
9815        self
9816    }
9817    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9818    #[inline]
9819    ///Sets [`Self::lazy`] to `Some(value)`, consuming and returning `self`.
9820    pub fn with_lazy(mut self, value: bool) -> Self {
9821        self.lazy = Some(value);
9822        self
9823    }
9824    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9825    #[inline]
9826    ///Sets [`Self::unverified_lazy`] to `Some(value)`, consuming and returning `self`.
9827    pub fn with_unverified_lazy(mut self, value: bool) -> Self {
9828        self.unverified_lazy = Some(value);
9829        self
9830    }
9831    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9832    #[inline]
9833    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
9834    pub fn with_deprecated(mut self, value: bool) -> Self {
9835        self.deprecated = Some(value);
9836        self
9837    }
9838    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9839    #[inline]
9840    ///Sets [`Self::weak`] to `Some(value)`, consuming and returning `self`.
9841    pub fn with_weak(mut self, value: bool) -> Self {
9842        self.weak = Some(value);
9843        self
9844    }
9845    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9846    #[inline]
9847    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
9848    pub fn with_debug_redact(mut self, value: bool) -> Self {
9849        self.debug_redact = Some(value);
9850        self
9851    }
9852    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9853    #[inline]
9854    ///Sets [`Self::retention`] to `Some(value)`, consuming and returning `self`.
9855    pub fn with_retention(
9856        mut self,
9857        value: impl Into<field_options::OptionRetention>,
9858    ) -> Self {
9859        self.retention = Some(value.into());
9860        self
9861    }
9862}
9863::buffa::impl_default_instance!(FieldOptions);
9864impl ::buffa::MessageName for FieldOptions {
9865    const PACKAGE: &'static str = "google.protobuf";
9866    const NAME: &'static str = "FieldOptions";
9867    const FULL_NAME: &'static str = "google.protobuf.FieldOptions";
9868    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9869}
9870impl ::buffa::Message for FieldOptions {
9871    /// Returns the total encoded size in bytes.
9872    ///
9873    /// Accumulates in `u64` (which cannot overflow for in-memory
9874    /// data) and saturates to `u32` at return, so a message whose
9875    /// encoded size exceeds the 2 GiB protobuf limit yields a value
9876    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
9877    /// points reject, never a silently wrapped size.
9878    #[allow(clippy::let_and_return)]
9879    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9880        #[allow(unused_imports)]
9881        use ::buffa::Enumeration as _;
9882        let mut size = 0u64;
9883        if let Some(ref v) = self.ctype {
9884            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9885        }
9886        if self.packed.is_some() {
9887            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9888        }
9889        if self.deprecated.is_some() {
9890            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9891        }
9892        if self.lazy.is_some() {
9893            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9894        }
9895        if let Some(ref v) = self.jstype {
9896            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9897        }
9898        if self.weak.is_some() {
9899            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9900        }
9901        if self.unverified_lazy.is_some() {
9902            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9903        }
9904        if self.debug_redact.is_some() {
9905            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9906        }
9907        if let Some(ref v) = self.retention {
9908            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9909        }
9910        for v in &self.targets {
9911            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9912        }
9913        for v in &self.edition_defaults {
9914            let __slot = __cache.reserve();
9915            let inner_size = v.compute_size(__cache);
9916            __cache.set(__slot, inner_size);
9917            size
9918                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9919                    + inner_size as u64;
9920        }
9921        if self.features.is_set() {
9922            let __slot = __cache.reserve();
9923            let inner_size = self.features.compute_size(__cache);
9924            __cache.set(__slot, inner_size);
9925            size
9926                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9927                    + inner_size as u64;
9928        }
9929        if self.feature_support.is_set() {
9930            let __slot = __cache.reserve();
9931            let inner_size = self.feature_support.compute_size(__cache);
9932            __cache.set(__slot, inner_size);
9933            size
9934                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9935                    + inner_size as u64;
9936        }
9937        for v in &self.uninterpreted_option {
9938            let __slot = __cache.reserve();
9939            let inner_size = v.compute_size(__cache);
9940            __cache.set(__slot, inner_size);
9941            size
9942                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9943                    + inner_size as u64;
9944        }
9945        size += self.__buffa_unknown_fields.encoded_len() as u64;
9946        ::buffa::saturate_size(size)
9947    }
9948    fn write_to(
9949        &self,
9950        __cache: &mut ::buffa::SizeCache,
9951        buf: &mut impl ::buffa::EncodeSink,
9952    ) {
9953        #[allow(unused_imports)]
9954        use ::buffa::Enumeration as _;
9955        if let Some(ref v) = self.ctype {
9956            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
9957        }
9958        if let Some(v) = self.packed {
9959            ::buffa::types::put_bool_field(2u32, v, buf);
9960        }
9961        if let Some(v) = self.deprecated {
9962            ::buffa::types::put_bool_field(3u32, v, buf);
9963        }
9964        if let Some(v) = self.lazy {
9965            ::buffa::types::put_bool_field(5u32, v, buf);
9966        }
9967        if let Some(ref v) = self.jstype {
9968            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
9969        }
9970        if let Some(v) = self.weak {
9971            ::buffa::types::put_bool_field(10u32, v, buf);
9972        }
9973        if let Some(v) = self.unverified_lazy {
9974            ::buffa::types::put_bool_field(15u32, v, buf);
9975        }
9976        if let Some(v) = self.debug_redact {
9977            ::buffa::types::put_bool_field(16u32, v, buf);
9978        }
9979        if let Some(ref v) = self.retention {
9980            ::buffa::types::put_int32_field(17u32, v.to_i32(), buf);
9981        }
9982        for v in &self.targets {
9983            ::buffa::types::put_int32_field(19u32, v.to_i32(), buf);
9984        }
9985        for v in &self.edition_defaults {
9986            ::buffa::types::put_len_delimited_header(
9987                20u32,
9988                u64::from(__cache.consume_next()),
9989                buf,
9990            );
9991            v.write_to(__cache, buf);
9992        }
9993        if self.features.is_set() {
9994            ::buffa::types::put_len_delimited_header(
9995                21u32,
9996                u64::from(__cache.consume_next()),
9997                buf,
9998            );
9999            self.features.write_to(__cache, buf);
10000        }
10001        if self.feature_support.is_set() {
10002            ::buffa::types::put_len_delimited_header(
10003                22u32,
10004                u64::from(__cache.consume_next()),
10005                buf,
10006            );
10007            self.feature_support.write_to(__cache, buf);
10008        }
10009        for v in &self.uninterpreted_option {
10010            ::buffa::types::put_len_delimited_header(
10011                999u32,
10012                u64::from(__cache.consume_next()),
10013                buf,
10014            );
10015            v.write_to(__cache, buf);
10016        }
10017        self.__buffa_unknown_fields.write_to(buf);
10018    }
10019    fn merge_field(
10020        &mut self,
10021        tag: ::buffa::encoding::Tag,
10022        buf: &mut impl ::buffa::bytes::Buf,
10023        ctx: ::buffa::DecodeContext<'_>,
10024    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10025        #[allow(unused_imports)]
10026        use ::buffa::bytes::Buf as _;
10027        #[allow(unused_imports)]
10028        use ::buffa::Enumeration as _;
10029        match tag.field_number() {
10030            1u32 => {
10031                ::buffa::encoding::check_wire_type(
10032                    tag,
10033                    ::buffa::encoding::WireType::Varint,
10034                )?;
10035                let __raw = ::buffa::types::decode_int32(buf)?;
10036                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10037                    __raw,
10038                ) {
10039                    self.ctype = ::core::option::Option::Some(__v);
10040                } else {
10041                    ctx.register_unknown_field()?;
10042                    self.__buffa_unknown_fields
10043                        .push(::buffa::UnknownField {
10044                            number: 1u32,
10045                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10046                        });
10047                }
10048            }
10049            2u32 => {
10050                ::buffa::encoding::check_wire_type(
10051                    tag,
10052                    ::buffa::encoding::WireType::Varint,
10053                )?;
10054                self.packed = ::core::option::Option::Some(
10055                    ::buffa::types::decode_bool(buf)?,
10056                );
10057            }
10058            3u32 => {
10059                ::buffa::encoding::check_wire_type(
10060                    tag,
10061                    ::buffa::encoding::WireType::Varint,
10062                )?;
10063                self.deprecated = ::core::option::Option::Some(
10064                    ::buffa::types::decode_bool(buf)?,
10065                );
10066            }
10067            5u32 => {
10068                ::buffa::encoding::check_wire_type(
10069                    tag,
10070                    ::buffa::encoding::WireType::Varint,
10071                )?;
10072                self.lazy = ::core::option::Option::Some(
10073                    ::buffa::types::decode_bool(buf)?,
10074                );
10075            }
10076            6u32 => {
10077                ::buffa::encoding::check_wire_type(
10078                    tag,
10079                    ::buffa::encoding::WireType::Varint,
10080                )?;
10081                let __raw = ::buffa::types::decode_int32(buf)?;
10082                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10083                    __raw,
10084                ) {
10085                    self.jstype = ::core::option::Option::Some(__v);
10086                } else {
10087                    ctx.register_unknown_field()?;
10088                    self.__buffa_unknown_fields
10089                        .push(::buffa::UnknownField {
10090                            number: 6u32,
10091                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10092                        });
10093                }
10094            }
10095            10u32 => {
10096                ::buffa::encoding::check_wire_type(
10097                    tag,
10098                    ::buffa::encoding::WireType::Varint,
10099                )?;
10100                self.weak = ::core::option::Option::Some(
10101                    ::buffa::types::decode_bool(buf)?,
10102                );
10103            }
10104            15u32 => {
10105                ::buffa::encoding::check_wire_type(
10106                    tag,
10107                    ::buffa::encoding::WireType::Varint,
10108                )?;
10109                self.unverified_lazy = ::core::option::Option::Some(
10110                    ::buffa::types::decode_bool(buf)?,
10111                );
10112            }
10113            16u32 => {
10114                ::buffa::encoding::check_wire_type(
10115                    tag,
10116                    ::buffa::encoding::WireType::Varint,
10117                )?;
10118                self.debug_redact = ::core::option::Option::Some(
10119                    ::buffa::types::decode_bool(buf)?,
10120                );
10121            }
10122            17u32 => {
10123                ::buffa::encoding::check_wire_type(
10124                    tag,
10125                    ::buffa::encoding::WireType::Varint,
10126                )?;
10127                let __raw = ::buffa::types::decode_int32(buf)?;
10128                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10129                    __raw,
10130                ) {
10131                    self.retention = ::core::option::Option::Some(__v);
10132                } else {
10133                    ctx.register_unknown_field()?;
10134                    self.__buffa_unknown_fields
10135                        .push(::buffa::UnknownField {
10136                            number: 17u32,
10137                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10138                        });
10139                }
10140            }
10141            19u32 => {
10142                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
10143                    let len = ::buffa::encoding::decode_varint(buf)?;
10144                    let len = usize::try_from(len)
10145                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
10146                    if buf.remaining() < len {
10147                        return ::core::result::Result::Err(
10148                            ::buffa::DecodeError::UnexpectedEof,
10149                        );
10150                    }
10151                    self.targets.reserve(len);
10152                    let mut limited = buf.take(len);
10153                    while limited.has_remaining() {
10154                        let __raw = ::buffa::types::decode_int32(&mut limited)?;
10155                        if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10156                            __raw,
10157                        ) {
10158                            self.targets.push(__v);
10159                        } else {
10160                            ctx.register_unknown_field()?;
10161                            self.__buffa_unknown_fields
10162                                .push(::buffa::UnknownField {
10163                                    number: 19u32,
10164                                    data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10165                                });
10166                        }
10167                    }
10168                    let leftover = limited.remaining();
10169                    if leftover > 0 {
10170                        limited.advance(leftover);
10171                    }
10172                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
10173                    let __raw = ::buffa::types::decode_int32(buf)?;
10174                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10175                        __raw,
10176                    ) {
10177                        self.targets.push(__v);
10178                    } else {
10179                        ctx.register_unknown_field()?;
10180                        self.__buffa_unknown_fields
10181                            .push(::buffa::UnknownField {
10182                                number: 19u32,
10183                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10184                            });
10185                    }
10186                } else {
10187                    return ::core::result::Result::Err(
10188                        ::buffa::encoding::wire_type_mismatch(
10189                            tag,
10190                            ::buffa::encoding::WireType::LengthDelimited,
10191                        ),
10192                    );
10193                }
10194            }
10195            20u32 => {
10196                ::buffa::encoding::check_wire_type(
10197                    tag,
10198                    ::buffa::encoding::WireType::LengthDelimited,
10199                )?;
10200                let mut elem = ::core::default::Default::default();
10201                ctx.register_element_memory(
10202                    ::buffa::__private::element_footprint(&elem),
10203                )?;
10204                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
10205                self.edition_defaults.push(elem);
10206            }
10207            21u32 => {
10208                ::buffa::encoding::check_wire_type(
10209                    tag,
10210                    ::buffa::encoding::WireType::LengthDelimited,
10211                )?;
10212                ::buffa::Message::merge_length_delimited(
10213                    self.features.get_or_insert_default(),
10214                    buf,
10215                    ctx,
10216                )?;
10217            }
10218            22u32 => {
10219                ::buffa::encoding::check_wire_type(
10220                    tag,
10221                    ::buffa::encoding::WireType::LengthDelimited,
10222                )?;
10223                ::buffa::Message::merge_length_delimited(
10224                    self.feature_support.get_or_insert_default(),
10225                    buf,
10226                    ctx,
10227                )?;
10228            }
10229            999u32 => {
10230                ::buffa::encoding::check_wire_type(
10231                    tag,
10232                    ::buffa::encoding::WireType::LengthDelimited,
10233                )?;
10234                let mut elem = ::core::default::Default::default();
10235                ctx.register_element_memory(
10236                    ::buffa::__private::element_footprint(&elem),
10237                )?;
10238                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
10239                self.uninterpreted_option.push(elem);
10240            }
10241            _ => {
10242                self.__buffa_unknown_fields
10243                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
10244            }
10245        }
10246        ::core::result::Result::Ok(())
10247    }
10248    fn clear(&mut self) {
10249        self.ctype = ::core::option::Option::None;
10250        self.packed = ::core::option::Option::None;
10251        self.deprecated = ::core::option::Option::None;
10252        self.lazy = ::core::option::Option::None;
10253        self.jstype = ::core::option::Option::None;
10254        self.weak = ::core::option::Option::None;
10255        self.unverified_lazy = ::core::option::Option::None;
10256        self.debug_redact = ::core::option::Option::None;
10257        self.retention = ::core::option::Option::None;
10258        self.targets.clear();
10259        self.edition_defaults.clear();
10260        self.features = ::buffa::MessageField::none();
10261        self.feature_support = ::buffa::MessageField::none();
10262        self.uninterpreted_option.clear();
10263        self.__buffa_unknown_fields.clear();
10264    }
10265}
10266impl ::buffa::ExtensionSet for FieldOptions {
10267    const PROTO_FQN: &'static str = "google.protobuf.FieldOptions";
10268    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10269        &self.__buffa_unknown_fields
10270    }
10271    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10272        &mut self.__buffa_unknown_fields
10273    }
10274}
10275#[cfg(feature = "text")]
10276impl ::buffa::text::TextFormat for FieldOptions {
10277    fn encode_text(
10278        &self,
10279        enc: &mut ::buffa::text::TextEncoder<'_>,
10280    ) -> ::core::fmt::Result {
10281        #[allow(unused_imports)]
10282        use ::buffa::Enumeration as _;
10283        if let ::core::option::Option::Some(ref __v) = self.ctype {
10284            enc.write_field_name("ctype")?;
10285            enc.write_enum_name(__v.proto_name())?;
10286        }
10287        if let ::core::option::Option::Some(ref __v) = self.packed {
10288            enc.write_field_name("packed")?;
10289            enc.write_bool(*__v)?;
10290        }
10291        if let ::core::option::Option::Some(ref __v) = self.jstype {
10292            enc.write_field_name("jstype")?;
10293            enc.write_enum_name(__v.proto_name())?;
10294        }
10295        if let ::core::option::Option::Some(ref __v) = self.lazy {
10296            enc.write_field_name("lazy")?;
10297            enc.write_bool(*__v)?;
10298        }
10299        if let ::core::option::Option::Some(ref __v) = self.unverified_lazy {
10300            enc.write_field_name("unverified_lazy")?;
10301            enc.write_bool(*__v)?;
10302        }
10303        if let ::core::option::Option::Some(ref __v) = self.deprecated {
10304            enc.write_field_name("deprecated")?;
10305            enc.write_bool(*__v)?;
10306        }
10307        if let ::core::option::Option::Some(ref __v) = self.weak {
10308            enc.write_field_name("weak")?;
10309            enc.write_bool(*__v)?;
10310        }
10311        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
10312            enc.write_field_name("debug_redact")?;
10313            enc.write_bool(*__v)?;
10314        }
10315        if let ::core::option::Option::Some(ref __v) = self.retention {
10316            enc.write_field_name("retention")?;
10317            enc.write_enum_name(__v.proto_name())?;
10318        }
10319        if self.features.is_set() {
10320            enc.write_field_name("features")?;
10321            enc.write_message(&*self.features)?;
10322        }
10323        if self.feature_support.is_set() {
10324            enc.write_field_name("feature_support")?;
10325            enc.write_message(&*self.feature_support)?;
10326        }
10327        for __v in &self.targets {
10328            enc.write_field_name("targets")?;
10329            enc.write_enum_name(__v.proto_name())?;
10330        }
10331        for __v in &self.edition_defaults {
10332            enc.write_field_name("edition_defaults")?;
10333            enc.write_message(__v)?;
10334        }
10335        for __v in &self.uninterpreted_option {
10336            enc.write_field_name("uninterpreted_option")?;
10337            enc.write_message(__v)?;
10338        }
10339        enc.write_extension_fields(
10340            "google.protobuf.FieldOptions",
10341            &self.__buffa_unknown_fields,
10342        )?;
10343        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
10344        ::core::result::Result::Ok(())
10345    }
10346    fn merge_text(
10347        &mut self,
10348        dec: &mut ::buffa::text::TextDecoder<'_>,
10349    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
10350        #[allow(unused_imports)]
10351        use ::buffa::Enumeration as _;
10352        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
10353            match __name {
10354                "ctype" => {
10355                    self.ctype = ::core::option::Option::Some(
10356                        dec.read_closed_enum_by_name::<field_options::CType>()?,
10357                    );
10358                }
10359                "packed" => self.packed = ::core::option::Option::Some(dec.read_bool()?),
10360                "jstype" => {
10361                    self.jstype = ::core::option::Option::Some(
10362                        dec.read_closed_enum_by_name::<field_options::JSType>()?,
10363                    );
10364                }
10365                "lazy" => self.lazy = ::core::option::Option::Some(dec.read_bool()?),
10366                "unverified_lazy" => {
10367                    self.unverified_lazy = ::core::option::Option::Some(dec.read_bool()?);
10368                }
10369                "deprecated" => {
10370                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
10371                }
10372                "weak" => self.weak = ::core::option::Option::Some(dec.read_bool()?),
10373                "debug_redact" => {
10374                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
10375                }
10376                "retention" => {
10377                    self.retention = ::core::option::Option::Some(
10378                        dec.read_closed_enum_by_name::<field_options::OptionRetention>()?,
10379                    );
10380                }
10381                "features" => dec.merge_message(self.features.get_or_insert_default())?,
10382                "feature_support" => {
10383                    dec.merge_message(self.feature_support.get_or_insert_default())?
10384                }
10385                "targets" => {
10386                    dec.read_repeated_into(
10387                        &mut self.targets,
10388                        |__d| {
10389                            __d
10390                                .read_closed_enum_by_name::<
10391                                    field_options::OptionTargetType,
10392                                >()
10393                        },
10394                    )?
10395                }
10396                "edition_defaults" => {
10397                    dec.read_repeated_into(
10398                        &mut self.edition_defaults,
10399                        |__d| {
10400                            let mut __m = ::core::default::Default::default();
10401                            __d.merge_message(&mut __m)?;
10402                            ::core::result::Result::Ok(__m)
10403                        },
10404                    )?
10405                }
10406                "uninterpreted_option" => {
10407                    dec.read_repeated_into(
10408                        &mut self.uninterpreted_option,
10409                        |__d| {
10410                            let mut __m = ::core::default::Default::default();
10411                            __d.merge_message(&mut __m)?;
10412                            ::core::result::Result::Ok(__m)
10413                        },
10414                    )?
10415                }
10416                __name if __name.starts_with('[') => {
10417                    for __r in dec
10418                        .read_extension(__name, "google.protobuf.FieldOptions")?
10419                    {
10420                        self.__buffa_unknown_fields.push(__r);
10421                    }
10422                }
10423                _ => dec.skip_value()?,
10424            }
10425        }
10426        ::core::result::Result::Ok(())
10427    }
10428}
10429#[cfg(feature = "json")]
10430impl<'de> ::serde::Deserialize<'de> for FieldOptions {
10431    fn deserialize<D: ::serde::Deserializer<'de>>(
10432        d: D,
10433    ) -> ::core::result::Result<Self, D::Error> {
10434        struct _V;
10435        impl<'de> ::serde::de::Visitor<'de> for _V {
10436            type Value = FieldOptions;
10437            fn expecting(
10438                &self,
10439                f: &mut ::core::fmt::Formatter<'_>,
10440            ) -> ::core::fmt::Result {
10441                f.write_str("struct FieldOptions")
10442            }
10443            #[allow(clippy::field_reassign_with_default)]
10444            fn visit_map<A: ::serde::de::MapAccess<'de>>(
10445                self,
10446                mut map: A,
10447            ) -> ::core::result::Result<FieldOptions, A::Error> {
10448                let mut __f_ctype: ::core::option::Option<
10449                    ::core::option::Option<field_options::CType>,
10450                > = None;
10451                let mut __f_packed: ::core::option::Option<
10452                    ::core::option::Option<bool>,
10453                > = None;
10454                let mut __f_jstype: ::core::option::Option<
10455                    ::core::option::Option<field_options::JSType>,
10456                > = None;
10457                let mut __f_lazy: ::core::option::Option<::core::option::Option<bool>> = None;
10458                let mut __f_unverified_lazy: ::core::option::Option<
10459                    ::core::option::Option<bool>,
10460                > = None;
10461                let mut __f_deprecated: ::core::option::Option<
10462                    ::core::option::Option<bool>,
10463                > = None;
10464                let mut __f_weak: ::core::option::Option<::core::option::Option<bool>> = None;
10465                let mut __f_debug_redact: ::core::option::Option<
10466                    ::core::option::Option<bool>,
10467                > = None;
10468                let mut __f_retention: ::core::option::Option<
10469                    ::core::option::Option<field_options::OptionRetention>,
10470                > = None;
10471                let mut __f_targets: ::core::option::Option<
10472                    ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10473                > = None;
10474                let mut __f_edition_defaults: ::core::option::Option<
10475                    ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10476                > = None;
10477                let mut __f_features: ::core::option::Option<
10478                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
10479                > = None;
10480                let mut __f_feature_support: ::core::option::Option<
10481                    ::buffa::MessageField<
10482                        field_options::FeatureSupport,
10483                        ::buffa::Inline<field_options::FeatureSupport>,
10484                    >,
10485                > = None;
10486                let mut __f_uninterpreted_option: ::core::option::Option<
10487                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
10488                > = None;
10489                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
10490                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
10491                    match key.as_str() {
10492                        "ctype" => {
10493                            __f_ctype = Some({
10494                                struct _S;
10495                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10496                                    type Value = ::core::option::Option<field_options::CType>;
10497                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10498                                        self,
10499                                        d: D,
10500                                    ) -> ::core::result::Result<
10501                                        ::core::option::Option<field_options::CType>,
10502                                        D::Error,
10503                                    > {
10504                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10505                                    }
10506                                }
10507                                map.next_value_seed(_S)?
10508                            });
10509                        }
10510                        "packed" => {
10511                            __f_packed = Some(
10512                                map.next_value::<::core::option::Option<bool>>()?,
10513                            );
10514                        }
10515                        "jstype" => {
10516                            __f_jstype = Some({
10517                                struct _S;
10518                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10519                                    type Value = ::core::option::Option<field_options::JSType>;
10520                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10521                                        self,
10522                                        d: D,
10523                                    ) -> ::core::result::Result<
10524                                        ::core::option::Option<field_options::JSType>,
10525                                        D::Error,
10526                                    > {
10527                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10528                                    }
10529                                }
10530                                map.next_value_seed(_S)?
10531                            });
10532                        }
10533                        "lazy" => {
10534                            __f_lazy = Some(
10535                                map.next_value::<::core::option::Option<bool>>()?,
10536                            );
10537                        }
10538                        "unverifiedLazy" | "unverified_lazy" => {
10539                            __f_unverified_lazy = Some(
10540                                map.next_value::<::core::option::Option<bool>>()?,
10541                            );
10542                        }
10543                        "deprecated" => {
10544                            __f_deprecated = Some(
10545                                map.next_value::<::core::option::Option<bool>>()?,
10546                            );
10547                        }
10548                        "weak" => {
10549                            __f_weak = Some(
10550                                map.next_value::<::core::option::Option<bool>>()?,
10551                            );
10552                        }
10553                        "debugRedact" | "debug_redact" => {
10554                            __f_debug_redact = Some(
10555                                map.next_value::<::core::option::Option<bool>>()?,
10556                            );
10557                        }
10558                        "retention" => {
10559                            __f_retention = Some({
10560                                struct _S;
10561                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10562                                    type Value = ::core::option::Option<
10563                                        field_options::OptionRetention,
10564                                    >;
10565                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10566                                        self,
10567                                        d: D,
10568                                    ) -> ::core::result::Result<
10569                                        ::core::option::Option<field_options::OptionRetention>,
10570                                        D::Error,
10571                                    > {
10572                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10573                                    }
10574                                }
10575                                map.next_value_seed(_S)?
10576                            });
10577                        }
10578                        "targets" => {
10579                            __f_targets = Some({
10580                                struct _S;
10581                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10582                                    type Value = ::buffa::alloc::vec::Vec<
10583                                        field_options::OptionTargetType,
10584                                    >;
10585                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10586                                        self,
10587                                        d: D,
10588                                    ) -> ::core::result::Result<
10589                                        ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10590                                        D::Error,
10591                                    > {
10592                                        ::buffa::json_helpers::repeated_closed_enum::deserialize(d)
10593                                    }
10594                                }
10595                                map.next_value_seed(_S)?
10596                            });
10597                        }
10598                        "editionDefaults" | "edition_defaults" => {
10599                            __f_edition_defaults = Some({
10600                                struct _S;
10601                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10602                                    type Value = ::buffa::alloc::vec::Vec<
10603                                        field_options::EditionDefault,
10604                                    >;
10605                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10606                                        self,
10607                                        d: D,
10608                                    ) -> ::core::result::Result<
10609                                        ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10610                                        D::Error,
10611                                    > {
10612                                        ::buffa::json_helpers::null_as_default(d)
10613                                    }
10614                                }
10615                                map.next_value_seed(_S)?
10616                            });
10617                        }
10618                        "features" => {
10619                            __f_features = Some(
10620                                map
10621                                    .next_value::<
10622                                        ::buffa::MessageField<
10623                                            FeatureSet,
10624                                            ::buffa::Inline<FeatureSet>,
10625                                        >,
10626                                    >()?,
10627                            );
10628                        }
10629                        "featureSupport" | "feature_support" => {
10630                            __f_feature_support = Some(
10631                                map
10632                                    .next_value::<
10633                                        ::buffa::MessageField<
10634                                            field_options::FeatureSupport,
10635                                            ::buffa::Inline<field_options::FeatureSupport>,
10636                                        >,
10637                                    >()?,
10638                            );
10639                        }
10640                        "uninterpretedOption" | "uninterpreted_option" => {
10641                            __f_uninterpreted_option = Some({
10642                                struct _S;
10643                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
10644                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
10645                                    fn deserialize<D: ::serde::Deserializer<'de>>(
10646                                        self,
10647                                        d: D,
10648                                    ) -> ::core::result::Result<
10649                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
10650                                        D::Error,
10651                                    > {
10652                                        ::buffa::json_helpers::null_as_default(d)
10653                                    }
10654                                }
10655                                map.next_value_seed(_S)?
10656                            });
10657                        }
10658                        __k if __k.starts_with('[') => {
10659                            let __v: ::buffa::serde_json::Value = map.next_value()?;
10660                            match ::buffa::extension_registry::deserialize_extension_key(
10661                                "google.protobuf.FieldOptions",
10662                                __k,
10663                                __v,
10664                            ) {
10665                                ::core::option::Option::Some(
10666                                    ::core::result::Result::Ok(__recs),
10667                                ) => {
10668                                    for __rec in __recs {
10669                                        __ext_records.push(__rec);
10670                                    }
10671                                }
10672                                ::core::option::Option::Some(
10673                                    ::core::result::Result::Err(__e),
10674                                ) => {
10675                                    return ::core::result::Result::Err(
10676                                        <A::Error as ::serde::de::Error>::custom(__e),
10677                                    );
10678                                }
10679                                ::core::option::Option::None => {}
10680                            }
10681                        }
10682                        _ => {
10683                            map.next_value::<::serde::de::IgnoredAny>()?;
10684                        }
10685                    }
10686                }
10687                let mut __r = <FieldOptions as ::core::default::Default>::default();
10688                if let ::core::option::Option::Some(v) = __f_ctype {
10689                    __r.ctype = v;
10690                }
10691                if let ::core::option::Option::Some(v) = __f_packed {
10692                    __r.packed = v;
10693                }
10694                if let ::core::option::Option::Some(v) = __f_jstype {
10695                    __r.jstype = v;
10696                }
10697                if let ::core::option::Option::Some(v) = __f_lazy {
10698                    __r.lazy = v;
10699                }
10700                if let ::core::option::Option::Some(v) = __f_unverified_lazy {
10701                    __r.unverified_lazy = v;
10702                }
10703                if let ::core::option::Option::Some(v) = __f_deprecated {
10704                    __r.deprecated = v;
10705                }
10706                if let ::core::option::Option::Some(v) = __f_weak {
10707                    __r.weak = v;
10708                }
10709                if let ::core::option::Option::Some(v) = __f_debug_redact {
10710                    __r.debug_redact = v;
10711                }
10712                if let ::core::option::Option::Some(v) = __f_retention {
10713                    __r.retention = v;
10714                }
10715                if let ::core::option::Option::Some(v) = __f_targets {
10716                    __r.targets = v;
10717                }
10718                if let ::core::option::Option::Some(v) = __f_edition_defaults {
10719                    __r.edition_defaults = v;
10720                }
10721                if let ::core::option::Option::Some(v) = __f_features {
10722                    __r.features = v;
10723                }
10724                if let ::core::option::Option::Some(v) = __f_feature_support {
10725                    __r.feature_support = v;
10726                }
10727                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
10728                    __r.uninterpreted_option = v;
10729                }
10730                for __rec in __ext_records {
10731                    __r.__buffa_unknown_fields.push(__rec);
10732                }
10733                Ok(__r)
10734            }
10735        }
10736        d.deserialize_map(_V)
10737    }
10738}
10739#[cfg(feature = "json")]
10740impl ::buffa::json_helpers::ProtoElemJson for FieldOptions {
10741    fn serialize_proto_json<S: ::serde::Serializer>(
10742        v: &Self,
10743        s: S,
10744    ) -> ::core::result::Result<S::Ok, S::Error> {
10745        ::serde::Serialize::serialize(v, s)
10746    }
10747    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10748        d: D,
10749    ) -> ::core::result::Result<Self, D::Error> {
10750        <Self as ::serde::Deserialize>::deserialize(d)
10751    }
10752}
10753#[doc(hidden)]
10754#[derive(Clone, Debug, Default, PartialEq)]
10755#[repr(transparent)]
10756#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10757pub struct __FieldOptionsExtJson(pub ::buffa::UnknownFields);
10758impl ::core::ops::Deref for __FieldOptionsExtJson {
10759    type Target = ::buffa::UnknownFields;
10760    fn deref(&self) -> &::buffa::UnknownFields {
10761        &self.0
10762    }
10763}
10764impl ::core::ops::DerefMut for __FieldOptionsExtJson {
10765    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
10766        &mut self.0
10767    }
10768}
10769impl ::core::convert::From<::buffa::UnknownFields> for __FieldOptionsExtJson {
10770    fn from(u: ::buffa::UnknownFields) -> Self {
10771        Self(u)
10772    }
10773}
10774#[cfg(feature = "json")]
10775impl ::serde::Serialize for __FieldOptionsExtJson {
10776    fn serialize<S: ::serde::Serializer>(
10777        &self,
10778        s: S,
10779    ) -> ::core::result::Result<S::Ok, S::Error> {
10780        ::buffa::extension_registry::serialize_extensions(
10781            "google.protobuf.FieldOptions",
10782            &self.0,
10783            s,
10784        )
10785    }
10786}
10787#[cfg(feature = "json")]
10788impl<'de> ::serde::Deserialize<'de> for __FieldOptionsExtJson {
10789    fn deserialize<D: ::serde::Deserializer<'de>>(
10790        d: D,
10791    ) -> ::core::result::Result<Self, D::Error> {
10792        ::buffa::extension_registry::deserialize_extensions(
10793                "google.protobuf.FieldOptions",
10794                d,
10795            )
10796            .map(Self)
10797    }
10798}
10799#[cfg(feature = "json")]
10800#[doc(hidden)]
10801pub const __FIELD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10802    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10803    to_json: ::buffa::type_registry::any_to_json::<FieldOptions>,
10804    from_json: ::buffa::type_registry::any_from_json::<FieldOptions>,
10805    is_wkt: false,
10806};
10807#[cfg(feature = "text")]
10808#[doc(hidden)]
10809pub const __FIELD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
10810    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10811    text_encode: ::buffa::type_registry::any_encode_text::<FieldOptions>,
10812    text_merge: ::buffa::type_registry::any_merge_text::<FieldOptions>,
10813};
10814pub mod field_options {
10815    #[allow(unused_imports)]
10816    use super::*;
10817    #[allow(non_camel_case_types)]
10818    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10819    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10820    #[repr(i32)]
10821    pub enum CType {
10822        /// Default mode.
10823        STRING = 0i32,
10824        /// The option \[ctype=CORD\] may be applied to a non-repeated field of type
10825        /// "bytes". It indicates that in C++, the data should be stored in a Cord
10826        /// instead of a string.  For very large strings, this may reduce memory
10827        /// fragmentation. It may also allow better performance when parsing from a
10828        /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then
10829        /// alias the original buffer.
10830        CORD = 1i32,
10831        STRING_PIECE = 2i32,
10832    }
10833    impl CType {
10834        ///Idiomatic alias for [`Self::STRING`]; `Debug` prints the variant name.
10835        #[allow(non_upper_case_globals)]
10836        pub const String: Self = Self::STRING;
10837        ///Idiomatic alias for [`Self::CORD`]; `Debug` prints the variant name.
10838        #[allow(non_upper_case_globals)]
10839        pub const Cord: Self = Self::CORD;
10840        ///Idiomatic alias for [`Self::STRING_PIECE`]; `Debug` prints the variant name.
10841        #[allow(non_upper_case_globals)]
10842        pub const StringPiece: Self = Self::STRING_PIECE;
10843    }
10844    impl ::core::default::Default for CType {
10845        fn default() -> Self {
10846            Self::STRING
10847        }
10848    }
10849    #[cfg(feature = "json")]
10850    const _: () = {
10851        impl ::serde::Serialize for CType {
10852            fn serialize<S: ::serde::Serializer>(
10853                &self,
10854                s: S,
10855            ) -> ::core::result::Result<S::Ok, S::Error> {
10856                s.serialize_str(::buffa::Enumeration::proto_name(self))
10857            }
10858        }
10859        impl<'de> ::serde::Deserialize<'de> for CType {
10860            fn deserialize<D: ::serde::Deserializer<'de>>(
10861                d: D,
10862            ) -> ::core::result::Result<Self, D::Error> {
10863                struct _V;
10864                impl ::serde::de::Visitor<'_> for _V {
10865                    type Value = CType;
10866                    fn expecting(
10867                        &self,
10868                        f: &mut ::core::fmt::Formatter<'_>,
10869                    ) -> ::core::fmt::Result {
10870                        f.write_str(
10871                            concat!("a string, integer, or null for ", stringify!(CType)),
10872                        )
10873                    }
10874                    fn visit_str<E: ::serde::de::Error>(
10875                        self,
10876                        v: &str,
10877                    ) -> ::core::result::Result<CType, E> {
10878                        <CType as ::buffa::Enumeration>::from_proto_name(v)
10879                            .ok_or_else(|| {
10880                                ::serde::de::Error::unknown_variant(v, &[])
10881                            })
10882                    }
10883                    fn visit_i64<E: ::serde::de::Error>(
10884                        self,
10885                        v: i64,
10886                    ) -> ::core::result::Result<CType, E> {
10887                        let v32 = i32::try_from(v)
10888                            .map_err(|_| {
10889                                ::serde::de::Error::custom(
10890                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10891                                )
10892                            })?;
10893                        <CType as ::buffa::Enumeration>::from_i32(v32)
10894                            .ok_or_else(|| {
10895                                ::serde::de::Error::custom(
10896                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10897                                )
10898                            })
10899                    }
10900                    fn visit_u64<E: ::serde::de::Error>(
10901                        self,
10902                        v: u64,
10903                    ) -> ::core::result::Result<CType, E> {
10904                        let v32 = i32::try_from(v)
10905                            .map_err(|_| {
10906                                ::serde::de::Error::custom(
10907                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10908                                )
10909                            })?;
10910                        <CType as ::buffa::Enumeration>::from_i32(v32)
10911                            .ok_or_else(|| {
10912                                ::serde::de::Error::custom(
10913                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10914                                )
10915                            })
10916                    }
10917                    fn visit_unit<E: ::serde::de::Error>(
10918                        self,
10919                    ) -> ::core::result::Result<CType, E> {
10920                        ::core::result::Result::Ok(::core::default::Default::default())
10921                    }
10922                }
10923                d.deserialize_any(_V)
10924            }
10925        }
10926        impl ::buffa::json_helpers::ProtoElemJson for CType {
10927            fn serialize_proto_json<S: ::serde::Serializer>(
10928                v: &Self,
10929                s: S,
10930            ) -> ::core::result::Result<S::Ok, S::Error> {
10931                ::serde::Serialize::serialize(v, s)
10932            }
10933            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10934                d: D,
10935            ) -> ::core::result::Result<Self, D::Error> {
10936                <Self as ::serde::Deserialize>::deserialize(d)
10937            }
10938        }
10939    };
10940    impl ::buffa::Enumeration for CType {
10941        fn from_i32(value: i32) -> ::core::option::Option<Self> {
10942            match value {
10943                0i32 => ::core::option::Option::Some(Self::STRING),
10944                1i32 => ::core::option::Option::Some(Self::CORD),
10945                2i32 => ::core::option::Option::Some(Self::STRING_PIECE),
10946                _ => ::core::option::Option::None,
10947            }
10948        }
10949        fn to_i32(&self) -> i32 {
10950            *self as i32
10951        }
10952        fn proto_name(&self) -> &'static str {
10953            match self {
10954                Self::STRING => "STRING",
10955                Self::CORD => "CORD",
10956                Self::STRING_PIECE => "STRING_PIECE",
10957            }
10958        }
10959        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
10960            match name {
10961                "STRING" => ::core::option::Option::Some(Self::STRING),
10962                "CORD" => ::core::option::Option::Some(Self::CORD),
10963                "STRING_PIECE" => ::core::option::Option::Some(Self::STRING_PIECE),
10964                _ => ::core::option::Option::None,
10965            }
10966        }
10967        fn values() -> &'static [Self] {
10968            &[Self::STRING, Self::CORD, Self::STRING_PIECE]
10969        }
10970    }
10971    #[allow(non_camel_case_types)]
10972    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10973    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10974    #[repr(i32)]
10975    pub enum JSType {
10976        /// Use the default type.
10977        JS_NORMAL = 0i32,
10978        /// Use JavaScript strings.
10979        JS_STRING = 1i32,
10980        /// Use JavaScript numbers.
10981        JS_NUMBER = 2i32,
10982    }
10983    impl JSType {
10984        ///Idiomatic alias for [`Self::JS_NORMAL`]; `Debug` prints the variant name.
10985        #[allow(non_upper_case_globals)]
10986        pub const JsNormal: Self = Self::JS_NORMAL;
10987        ///Idiomatic alias for [`Self::JS_STRING`]; `Debug` prints the variant name.
10988        #[allow(non_upper_case_globals)]
10989        pub const JsString: Self = Self::JS_STRING;
10990        ///Idiomatic alias for [`Self::JS_NUMBER`]; `Debug` prints the variant name.
10991        #[allow(non_upper_case_globals)]
10992        pub const JsNumber: Self = Self::JS_NUMBER;
10993    }
10994    impl ::core::default::Default for JSType {
10995        fn default() -> Self {
10996            Self::JS_NORMAL
10997        }
10998    }
10999    #[cfg(feature = "json")]
11000    const _: () = {
11001        impl ::serde::Serialize for JSType {
11002            fn serialize<S: ::serde::Serializer>(
11003                &self,
11004                s: S,
11005            ) -> ::core::result::Result<S::Ok, S::Error> {
11006                s.serialize_str(::buffa::Enumeration::proto_name(self))
11007            }
11008        }
11009        impl<'de> ::serde::Deserialize<'de> for JSType {
11010            fn deserialize<D: ::serde::Deserializer<'de>>(
11011                d: D,
11012            ) -> ::core::result::Result<Self, D::Error> {
11013                struct _V;
11014                impl ::serde::de::Visitor<'_> for _V {
11015                    type Value = JSType;
11016                    fn expecting(
11017                        &self,
11018                        f: &mut ::core::fmt::Formatter<'_>,
11019                    ) -> ::core::fmt::Result {
11020                        f.write_str(
11021                            concat!(
11022                                "a string, integer, or null for ", stringify!(JSType)
11023                            ),
11024                        )
11025                    }
11026                    fn visit_str<E: ::serde::de::Error>(
11027                        self,
11028                        v: &str,
11029                    ) -> ::core::result::Result<JSType, E> {
11030                        <JSType as ::buffa::Enumeration>::from_proto_name(v)
11031                            .ok_or_else(|| {
11032                                ::serde::de::Error::unknown_variant(v, &[])
11033                            })
11034                    }
11035                    fn visit_i64<E: ::serde::de::Error>(
11036                        self,
11037                        v: i64,
11038                    ) -> ::core::result::Result<JSType, E> {
11039                        let v32 = i32::try_from(v)
11040                            .map_err(|_| {
11041                                ::serde::de::Error::custom(
11042                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11043                                )
11044                            })?;
11045                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11046                            .ok_or_else(|| {
11047                                ::serde::de::Error::custom(
11048                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11049                                )
11050                            })
11051                    }
11052                    fn visit_u64<E: ::serde::de::Error>(
11053                        self,
11054                        v: u64,
11055                    ) -> ::core::result::Result<JSType, E> {
11056                        let v32 = i32::try_from(v)
11057                            .map_err(|_| {
11058                                ::serde::de::Error::custom(
11059                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11060                                )
11061                            })?;
11062                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11063                            .ok_or_else(|| {
11064                                ::serde::de::Error::custom(
11065                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11066                                )
11067                            })
11068                    }
11069                    fn visit_unit<E: ::serde::de::Error>(
11070                        self,
11071                    ) -> ::core::result::Result<JSType, E> {
11072                        ::core::result::Result::Ok(::core::default::Default::default())
11073                    }
11074                }
11075                d.deserialize_any(_V)
11076            }
11077        }
11078        impl ::buffa::json_helpers::ProtoElemJson for JSType {
11079            fn serialize_proto_json<S: ::serde::Serializer>(
11080                v: &Self,
11081                s: S,
11082            ) -> ::core::result::Result<S::Ok, S::Error> {
11083                ::serde::Serialize::serialize(v, s)
11084            }
11085            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11086                d: D,
11087            ) -> ::core::result::Result<Self, D::Error> {
11088                <Self as ::serde::Deserialize>::deserialize(d)
11089            }
11090        }
11091    };
11092    impl ::buffa::Enumeration for JSType {
11093        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11094            match value {
11095                0i32 => ::core::option::Option::Some(Self::JS_NORMAL),
11096                1i32 => ::core::option::Option::Some(Self::JS_STRING),
11097                2i32 => ::core::option::Option::Some(Self::JS_NUMBER),
11098                _ => ::core::option::Option::None,
11099            }
11100        }
11101        fn to_i32(&self) -> i32 {
11102            *self as i32
11103        }
11104        fn proto_name(&self) -> &'static str {
11105            match self {
11106                Self::JS_NORMAL => "JS_NORMAL",
11107                Self::JS_STRING => "JS_STRING",
11108                Self::JS_NUMBER => "JS_NUMBER",
11109            }
11110        }
11111        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11112            match name {
11113                "JS_NORMAL" => ::core::option::Option::Some(Self::JS_NORMAL),
11114                "JS_STRING" => ::core::option::Option::Some(Self::JS_STRING),
11115                "JS_NUMBER" => ::core::option::Option::Some(Self::JS_NUMBER),
11116                _ => ::core::option::Option::None,
11117            }
11118        }
11119        fn values() -> &'static [Self] {
11120            &[Self::JS_NORMAL, Self::JS_STRING, Self::JS_NUMBER]
11121        }
11122    }
11123    /// If set to RETENTION_SOURCE, the option will be omitted from the binary.
11124    #[allow(non_camel_case_types)]
11125    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11126    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11127    #[repr(i32)]
11128    pub enum OptionRetention {
11129        RETENTION_UNKNOWN = 0i32,
11130        RETENTION_RUNTIME = 1i32,
11131        RETENTION_SOURCE = 2i32,
11132    }
11133    impl OptionRetention {
11134        ///Idiomatic alias for [`Self::RETENTION_UNKNOWN`]; `Debug` prints the variant name.
11135        #[allow(non_upper_case_globals)]
11136        pub const RetentionUnknown: Self = Self::RETENTION_UNKNOWN;
11137        ///Idiomatic alias for [`Self::RETENTION_RUNTIME`]; `Debug` prints the variant name.
11138        #[allow(non_upper_case_globals)]
11139        pub const RetentionRuntime: Self = Self::RETENTION_RUNTIME;
11140        ///Idiomatic alias for [`Self::RETENTION_SOURCE`]; `Debug` prints the variant name.
11141        #[allow(non_upper_case_globals)]
11142        pub const RetentionSource: Self = Self::RETENTION_SOURCE;
11143    }
11144    impl ::core::default::Default for OptionRetention {
11145        fn default() -> Self {
11146            Self::RETENTION_UNKNOWN
11147        }
11148    }
11149    #[cfg(feature = "json")]
11150    const _: () = {
11151        impl ::serde::Serialize for OptionRetention {
11152            fn serialize<S: ::serde::Serializer>(
11153                &self,
11154                s: S,
11155            ) -> ::core::result::Result<S::Ok, S::Error> {
11156                s.serialize_str(::buffa::Enumeration::proto_name(self))
11157            }
11158        }
11159        impl<'de> ::serde::Deserialize<'de> for OptionRetention {
11160            fn deserialize<D: ::serde::Deserializer<'de>>(
11161                d: D,
11162            ) -> ::core::result::Result<Self, D::Error> {
11163                struct _V;
11164                impl ::serde::de::Visitor<'_> for _V {
11165                    type Value = OptionRetention;
11166                    fn expecting(
11167                        &self,
11168                        f: &mut ::core::fmt::Formatter<'_>,
11169                    ) -> ::core::fmt::Result {
11170                        f.write_str(
11171                            concat!(
11172                                "a string, integer, or null for ",
11173                                stringify!(OptionRetention)
11174                            ),
11175                        )
11176                    }
11177                    fn visit_str<E: ::serde::de::Error>(
11178                        self,
11179                        v: &str,
11180                    ) -> ::core::result::Result<OptionRetention, E> {
11181                        <OptionRetention as ::buffa::Enumeration>::from_proto_name(v)
11182                            .ok_or_else(|| {
11183                                ::serde::de::Error::unknown_variant(v, &[])
11184                            })
11185                    }
11186                    fn visit_i64<E: ::serde::de::Error>(
11187                        self,
11188                        v: i64,
11189                    ) -> ::core::result::Result<OptionRetention, E> {
11190                        let v32 = i32::try_from(v)
11191                            .map_err(|_| {
11192                                ::serde::de::Error::custom(
11193                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11194                                )
11195                            })?;
11196                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11197                            .ok_or_else(|| {
11198                                ::serde::de::Error::custom(
11199                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11200                                )
11201                            })
11202                    }
11203                    fn visit_u64<E: ::serde::de::Error>(
11204                        self,
11205                        v: u64,
11206                    ) -> ::core::result::Result<OptionRetention, E> {
11207                        let v32 = i32::try_from(v)
11208                            .map_err(|_| {
11209                                ::serde::de::Error::custom(
11210                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11211                                )
11212                            })?;
11213                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11214                            .ok_or_else(|| {
11215                                ::serde::de::Error::custom(
11216                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11217                                )
11218                            })
11219                    }
11220                    fn visit_unit<E: ::serde::de::Error>(
11221                        self,
11222                    ) -> ::core::result::Result<OptionRetention, E> {
11223                        ::core::result::Result::Ok(::core::default::Default::default())
11224                    }
11225                }
11226                d.deserialize_any(_V)
11227            }
11228        }
11229        impl ::buffa::json_helpers::ProtoElemJson for OptionRetention {
11230            fn serialize_proto_json<S: ::serde::Serializer>(
11231                v: &Self,
11232                s: S,
11233            ) -> ::core::result::Result<S::Ok, S::Error> {
11234                ::serde::Serialize::serialize(v, s)
11235            }
11236            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11237                d: D,
11238            ) -> ::core::result::Result<Self, D::Error> {
11239                <Self as ::serde::Deserialize>::deserialize(d)
11240            }
11241        }
11242    };
11243    impl ::buffa::Enumeration for OptionRetention {
11244        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11245            match value {
11246                0i32 => ::core::option::Option::Some(Self::RETENTION_UNKNOWN),
11247                1i32 => ::core::option::Option::Some(Self::RETENTION_RUNTIME),
11248                2i32 => ::core::option::Option::Some(Self::RETENTION_SOURCE),
11249                _ => ::core::option::Option::None,
11250            }
11251        }
11252        fn to_i32(&self) -> i32 {
11253            *self as i32
11254        }
11255        fn proto_name(&self) -> &'static str {
11256            match self {
11257                Self::RETENTION_UNKNOWN => "RETENTION_UNKNOWN",
11258                Self::RETENTION_RUNTIME => "RETENTION_RUNTIME",
11259                Self::RETENTION_SOURCE => "RETENTION_SOURCE",
11260            }
11261        }
11262        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11263            match name {
11264                "RETENTION_UNKNOWN" => {
11265                    ::core::option::Option::Some(Self::RETENTION_UNKNOWN)
11266                }
11267                "RETENTION_RUNTIME" => {
11268                    ::core::option::Option::Some(Self::RETENTION_RUNTIME)
11269                }
11270                "RETENTION_SOURCE" => {
11271                    ::core::option::Option::Some(Self::RETENTION_SOURCE)
11272                }
11273                _ => ::core::option::Option::None,
11274            }
11275        }
11276        fn values() -> &'static [Self] {
11277            &[Self::RETENTION_UNKNOWN, Self::RETENTION_RUNTIME, Self::RETENTION_SOURCE]
11278        }
11279    }
11280    /// This indicates the types of entities that the field may apply to when used
11281    /// as an option. If it is unset, then the field may be freely used as an
11282    /// option on any kind of entity.
11283    #[allow(non_camel_case_types)]
11284    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11285    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11286    #[repr(i32)]
11287    pub enum OptionTargetType {
11288        TARGET_TYPE_UNKNOWN = 0i32,
11289        TARGET_TYPE_FILE = 1i32,
11290        TARGET_TYPE_EXTENSION_RANGE = 2i32,
11291        TARGET_TYPE_MESSAGE = 3i32,
11292        TARGET_TYPE_FIELD = 4i32,
11293        TARGET_TYPE_ONEOF = 5i32,
11294        TARGET_TYPE_ENUM = 6i32,
11295        TARGET_TYPE_ENUM_ENTRY = 7i32,
11296        TARGET_TYPE_SERVICE = 8i32,
11297        TARGET_TYPE_METHOD = 9i32,
11298    }
11299    impl OptionTargetType {
11300        ///Idiomatic alias for [`Self::TARGET_TYPE_UNKNOWN`]; `Debug` prints the variant name.
11301        #[allow(non_upper_case_globals)]
11302        pub const TargetTypeUnknown: Self = Self::TARGET_TYPE_UNKNOWN;
11303        ///Idiomatic alias for [`Self::TARGET_TYPE_FILE`]; `Debug` prints the variant name.
11304        #[allow(non_upper_case_globals)]
11305        pub const TargetTypeFile: Self = Self::TARGET_TYPE_FILE;
11306        ///Idiomatic alias for [`Self::TARGET_TYPE_EXTENSION_RANGE`]; `Debug` prints the variant name.
11307        #[allow(non_upper_case_globals)]
11308        pub const TargetTypeExtensionRange: Self = Self::TARGET_TYPE_EXTENSION_RANGE;
11309        ///Idiomatic alias for [`Self::TARGET_TYPE_MESSAGE`]; `Debug` prints the variant name.
11310        #[allow(non_upper_case_globals)]
11311        pub const TargetTypeMessage: Self = Self::TARGET_TYPE_MESSAGE;
11312        ///Idiomatic alias for [`Self::TARGET_TYPE_FIELD`]; `Debug` prints the variant name.
11313        #[allow(non_upper_case_globals)]
11314        pub const TargetTypeField: Self = Self::TARGET_TYPE_FIELD;
11315        ///Idiomatic alias for [`Self::TARGET_TYPE_ONEOF`]; `Debug` prints the variant name.
11316        #[allow(non_upper_case_globals)]
11317        pub const TargetTypeOneof: Self = Self::TARGET_TYPE_ONEOF;
11318        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM`]; `Debug` prints the variant name.
11319        #[allow(non_upper_case_globals)]
11320        pub const TargetTypeEnum: Self = Self::TARGET_TYPE_ENUM;
11321        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM_ENTRY`]; `Debug` prints the variant name.
11322        #[allow(non_upper_case_globals)]
11323        pub const TargetTypeEnumEntry: Self = Self::TARGET_TYPE_ENUM_ENTRY;
11324        ///Idiomatic alias for [`Self::TARGET_TYPE_SERVICE`]; `Debug` prints the variant name.
11325        #[allow(non_upper_case_globals)]
11326        pub const TargetTypeService: Self = Self::TARGET_TYPE_SERVICE;
11327        ///Idiomatic alias for [`Self::TARGET_TYPE_METHOD`]; `Debug` prints the variant name.
11328        #[allow(non_upper_case_globals)]
11329        pub const TargetTypeMethod: Self = Self::TARGET_TYPE_METHOD;
11330    }
11331    impl ::core::default::Default for OptionTargetType {
11332        fn default() -> Self {
11333            Self::TARGET_TYPE_UNKNOWN
11334        }
11335    }
11336    #[cfg(feature = "json")]
11337    const _: () = {
11338        impl ::serde::Serialize for OptionTargetType {
11339            fn serialize<S: ::serde::Serializer>(
11340                &self,
11341                s: S,
11342            ) -> ::core::result::Result<S::Ok, S::Error> {
11343                s.serialize_str(::buffa::Enumeration::proto_name(self))
11344            }
11345        }
11346        impl<'de> ::serde::Deserialize<'de> for OptionTargetType {
11347            fn deserialize<D: ::serde::Deserializer<'de>>(
11348                d: D,
11349            ) -> ::core::result::Result<Self, D::Error> {
11350                struct _V;
11351                impl ::serde::de::Visitor<'_> for _V {
11352                    type Value = OptionTargetType;
11353                    fn expecting(
11354                        &self,
11355                        f: &mut ::core::fmt::Formatter<'_>,
11356                    ) -> ::core::fmt::Result {
11357                        f.write_str(
11358                            concat!(
11359                                "a string, integer, or null for ",
11360                                stringify!(OptionTargetType)
11361                            ),
11362                        )
11363                    }
11364                    fn visit_str<E: ::serde::de::Error>(
11365                        self,
11366                        v: &str,
11367                    ) -> ::core::result::Result<OptionTargetType, E> {
11368                        <OptionTargetType as ::buffa::Enumeration>::from_proto_name(v)
11369                            .ok_or_else(|| {
11370                                ::serde::de::Error::unknown_variant(v, &[])
11371                            })
11372                    }
11373                    fn visit_i64<E: ::serde::de::Error>(
11374                        self,
11375                        v: i64,
11376                    ) -> ::core::result::Result<OptionTargetType, E> {
11377                        let v32 = i32::try_from(v)
11378                            .map_err(|_| {
11379                                ::serde::de::Error::custom(
11380                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11381                                )
11382                            })?;
11383                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11384                            .ok_or_else(|| {
11385                                ::serde::de::Error::custom(
11386                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11387                                )
11388                            })
11389                    }
11390                    fn visit_u64<E: ::serde::de::Error>(
11391                        self,
11392                        v: u64,
11393                    ) -> ::core::result::Result<OptionTargetType, E> {
11394                        let v32 = i32::try_from(v)
11395                            .map_err(|_| {
11396                                ::serde::de::Error::custom(
11397                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11398                                )
11399                            })?;
11400                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11401                            .ok_or_else(|| {
11402                                ::serde::de::Error::custom(
11403                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11404                                )
11405                            })
11406                    }
11407                    fn visit_unit<E: ::serde::de::Error>(
11408                        self,
11409                    ) -> ::core::result::Result<OptionTargetType, E> {
11410                        ::core::result::Result::Ok(::core::default::Default::default())
11411                    }
11412                }
11413                d.deserialize_any(_V)
11414            }
11415        }
11416        impl ::buffa::json_helpers::ProtoElemJson for OptionTargetType {
11417            fn serialize_proto_json<S: ::serde::Serializer>(
11418                v: &Self,
11419                s: S,
11420            ) -> ::core::result::Result<S::Ok, S::Error> {
11421                ::serde::Serialize::serialize(v, s)
11422            }
11423            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11424                d: D,
11425            ) -> ::core::result::Result<Self, D::Error> {
11426                <Self as ::serde::Deserialize>::deserialize(d)
11427            }
11428        }
11429    };
11430    impl ::buffa::Enumeration for OptionTargetType {
11431        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11432            match value {
11433                0i32 => ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
11434                1i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FILE),
11435                2i32 => ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE),
11436                3i32 => ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
11437                4i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FIELD),
11438                5i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF),
11439                6i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM),
11440                7i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
11441                8i32 => ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE),
11442                9i32 => ::core::option::Option::Some(Self::TARGET_TYPE_METHOD),
11443                _ => ::core::option::Option::None,
11444            }
11445        }
11446        fn to_i32(&self) -> i32 {
11447            *self as i32
11448        }
11449        fn proto_name(&self) -> &'static str {
11450            match self {
11451                Self::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN",
11452                Self::TARGET_TYPE_FILE => "TARGET_TYPE_FILE",
11453                Self::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE",
11454                Self::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE",
11455                Self::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD",
11456                Self::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF",
11457                Self::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM",
11458                Self::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY",
11459                Self::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE",
11460                Self::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD",
11461            }
11462        }
11463        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11464            match name {
11465                "TARGET_TYPE_UNKNOWN" => {
11466                    ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN)
11467                }
11468                "TARGET_TYPE_FILE" => {
11469                    ::core::option::Option::Some(Self::TARGET_TYPE_FILE)
11470                }
11471                "TARGET_TYPE_EXTENSION_RANGE" => {
11472                    ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
11473                }
11474                "TARGET_TYPE_MESSAGE" => {
11475                    ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE)
11476                }
11477                "TARGET_TYPE_FIELD" => {
11478                    ::core::option::Option::Some(Self::TARGET_TYPE_FIELD)
11479                }
11480                "TARGET_TYPE_ONEOF" => {
11481                    ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF)
11482                }
11483                "TARGET_TYPE_ENUM" => {
11484                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM)
11485                }
11486                "TARGET_TYPE_ENUM_ENTRY" => {
11487                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY)
11488                }
11489                "TARGET_TYPE_SERVICE" => {
11490                    ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE)
11491                }
11492                "TARGET_TYPE_METHOD" => {
11493                    ::core::option::Option::Some(Self::TARGET_TYPE_METHOD)
11494                }
11495                _ => ::core::option::Option::None,
11496            }
11497        }
11498        fn values() -> &'static [Self] {
11499            &[
11500                Self::TARGET_TYPE_UNKNOWN,
11501                Self::TARGET_TYPE_FILE,
11502                Self::TARGET_TYPE_EXTENSION_RANGE,
11503                Self::TARGET_TYPE_MESSAGE,
11504                Self::TARGET_TYPE_FIELD,
11505                Self::TARGET_TYPE_ONEOF,
11506                Self::TARGET_TYPE_ENUM,
11507                Self::TARGET_TYPE_ENUM_ENTRY,
11508                Self::TARGET_TYPE_SERVICE,
11509                Self::TARGET_TYPE_METHOD,
11510            ]
11511        }
11512    }
11513    #[derive(Clone, PartialEq, Default)]
11514    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11515    #[cfg_attr(feature = "json", serde(default))]
11516    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11517    pub struct EditionDefault {
11518        /// Field 3: `edition`
11519        #[cfg_attr(
11520            feature = "json",
11521            serde(
11522                rename = "edition",
11523                with = "::buffa::json_helpers::opt_closed_enum",
11524                skip_serializing_if = "::core::option::Option::is_none"
11525            )
11526        )]
11527        pub edition: ::core::option::Option<super::Edition>,
11528        /// Textproto value.
11529        ///
11530        /// Field 2: `value`
11531        #[cfg_attr(
11532            feature = "json",
11533            serde(
11534                rename = "value",
11535                skip_serializing_if = "::core::option::Option::is_none"
11536            )
11537        )]
11538        pub value: ::core::option::Option<::buffa::alloc::string::String>,
11539        #[cfg_attr(feature = "json", serde(skip))]
11540        #[doc(hidden)]
11541        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11542    }
11543    impl ::core::fmt::Debug for EditionDefault {
11544        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11545            f.debug_struct("EditionDefault")
11546                .field("edition", &self.edition)
11547                .field("value", &self.value)
11548                .finish()
11549        }
11550    }
11551    impl EditionDefault {
11552        /// Protobuf type URL for this message, for use with `Any::pack` and
11553        /// `Any::unpack_if`.
11554        ///
11555        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11556        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11557    }
11558    impl EditionDefault {
11559        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11560        #[inline]
11561        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
11562        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
11563            self.edition = Some(value.into());
11564            self
11565        }
11566        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11567        #[inline]
11568        ///Sets [`Self::value`] to `Some(value)`, consuming and returning `self`.
11569        pub fn with_value(
11570            mut self,
11571            value: impl Into<::buffa::alloc::string::String>,
11572        ) -> Self {
11573            self.value = Some(value.into());
11574            self
11575        }
11576    }
11577    ::buffa::impl_default_instance!(EditionDefault);
11578    impl ::buffa::MessageName for EditionDefault {
11579        const PACKAGE: &'static str = "google.protobuf";
11580        const NAME: &'static str = "FieldOptions.EditionDefault";
11581        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11582        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11583    }
11584    impl ::buffa::Message for EditionDefault {
11585        /// Returns the total encoded size in bytes.
11586        ///
11587        /// Accumulates in `u64` (which cannot overflow for in-memory
11588        /// data) and saturates to `u32` at return, so a message whose
11589        /// encoded size exceeds the 2 GiB protobuf limit yields a value
11590        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
11591        /// points reject, never a silently wrapped size.
11592        #[allow(clippy::let_and_return)]
11593        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11594            #[allow(unused_imports)]
11595            use ::buffa::Enumeration as _;
11596            let mut size = 0u64;
11597            if let Some(ref v) = self.value {
11598                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
11599            }
11600            if let Some(ref v) = self.edition {
11601                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11602            }
11603            size += self.__buffa_unknown_fields.encoded_len() as u64;
11604            ::buffa::saturate_size(size)
11605        }
11606        fn write_to(
11607            &self,
11608            _cache: &mut ::buffa::SizeCache,
11609            buf: &mut impl ::buffa::EncodeSink,
11610        ) {
11611            #[allow(unused_imports)]
11612            use ::buffa::Enumeration as _;
11613            if let Some(ref v) = self.value {
11614                ::buffa::types::put_string_field(2u32, v, buf);
11615            }
11616            if let Some(ref v) = self.edition {
11617                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
11618            }
11619            self.__buffa_unknown_fields.write_to(buf);
11620        }
11621        fn merge_field(
11622            &mut self,
11623            tag: ::buffa::encoding::Tag,
11624            buf: &mut impl ::buffa::bytes::Buf,
11625            ctx: ::buffa::DecodeContext<'_>,
11626        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11627            #[allow(unused_imports)]
11628            use ::buffa::bytes::Buf as _;
11629            #[allow(unused_imports)]
11630            use ::buffa::Enumeration as _;
11631            match tag.field_number() {
11632                2u32 => {
11633                    ::buffa::encoding::check_wire_type(
11634                        tag,
11635                        ::buffa::encoding::WireType::LengthDelimited,
11636                    )?;
11637                    ::buffa::types::merge_string(
11638                        self
11639                            .value
11640                            .get_or_insert_with(::buffa::alloc::string::String::new),
11641                        buf,
11642                    )?;
11643                }
11644                3u32 => {
11645                    ::buffa::encoding::check_wire_type(
11646                        tag,
11647                        ::buffa::encoding::WireType::Varint,
11648                    )?;
11649                    let __raw = ::buffa::types::decode_int32(buf)?;
11650                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11651                        __raw,
11652                    ) {
11653                        self.edition = ::core::option::Option::Some(__v);
11654                    } else {
11655                        ctx.register_unknown_field()?;
11656                        self.__buffa_unknown_fields
11657                            .push(::buffa::UnknownField {
11658                                number: 3u32,
11659                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11660                            });
11661                    }
11662                }
11663                _ => {
11664                    self.__buffa_unknown_fields
11665                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11666                }
11667            }
11668            ::core::result::Result::Ok(())
11669        }
11670        fn clear(&mut self) {
11671            self.value = ::core::option::Option::None;
11672            self.edition = ::core::option::Option::None;
11673            self.__buffa_unknown_fields.clear();
11674        }
11675    }
11676    impl ::buffa::ExtensionSet for EditionDefault {
11677        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11678        fn unknown_fields(&self) -> &::buffa::UnknownFields {
11679            &self.__buffa_unknown_fields
11680        }
11681        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11682            &mut self.__buffa_unknown_fields
11683        }
11684    }
11685    #[cfg(feature = "text")]
11686    impl ::buffa::text::TextFormat for EditionDefault {
11687        fn encode_text(
11688            &self,
11689            enc: &mut ::buffa::text::TextEncoder<'_>,
11690        ) -> ::core::fmt::Result {
11691            #[allow(unused_imports)]
11692            use ::buffa::Enumeration as _;
11693            if let ::core::option::Option::Some(ref __v) = self.edition {
11694                enc.write_field_name("edition")?;
11695                enc.write_enum_name(__v.proto_name())?;
11696            }
11697            if let ::core::option::Option::Some(ref __v) = self.value {
11698                enc.write_field_name("value")?;
11699                enc.write_string(__v)?;
11700            }
11701            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
11702            ::core::result::Result::Ok(())
11703        }
11704        fn merge_text(
11705            &mut self,
11706            dec: &mut ::buffa::text::TextDecoder<'_>,
11707        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
11708            #[allow(unused_imports)]
11709            use ::buffa::Enumeration as _;
11710            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
11711                match __name {
11712                    "edition" => {
11713                        self.edition = ::core::option::Option::Some(
11714                            dec.read_closed_enum_by_name::<super::Edition>()?,
11715                        );
11716                    }
11717                    "value" => {
11718                        self.value = ::core::option::Option::Some(
11719                            dec.read_string()?.into_owned(),
11720                        );
11721                    }
11722                    _ => dec.skip_value()?,
11723                }
11724            }
11725            ::core::result::Result::Ok(())
11726        }
11727    }
11728    #[cfg(feature = "json")]
11729    impl ::buffa::json_helpers::ProtoElemJson for EditionDefault {
11730        fn serialize_proto_json<S: ::serde::Serializer>(
11731            v: &Self,
11732            s: S,
11733        ) -> ::core::result::Result<S::Ok, S::Error> {
11734            ::serde::Serialize::serialize(v, s)
11735        }
11736        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11737            d: D,
11738        ) -> ::core::result::Result<Self, D::Error> {
11739            <Self as ::serde::Deserialize>::deserialize(d)
11740        }
11741    }
11742    #[cfg(feature = "json")]
11743    #[doc(hidden)]
11744    pub const __EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11745        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11746        to_json: ::buffa::type_registry::any_to_json::<EditionDefault>,
11747        from_json: ::buffa::type_registry::any_from_json::<EditionDefault>,
11748        is_wkt: false,
11749    };
11750    #[cfg(feature = "text")]
11751    #[doc(hidden)]
11752    pub const __EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
11753        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11754        text_encode: ::buffa::type_registry::any_encode_text::<EditionDefault>,
11755        text_merge: ::buffa::type_registry::any_merge_text::<EditionDefault>,
11756    };
11757    /// Information about the support window of a feature.
11758    #[derive(Clone, PartialEq, Default)]
11759    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11760    #[cfg_attr(feature = "json", serde(default))]
11761    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11762    pub struct FeatureSupport {
11763        /// The edition that this feature was first available in.  In editions
11764        /// earlier than this one, the default assigned to EDITION_LEGACY will be
11765        /// used, and proto files will not be able to override it.
11766        ///
11767        /// Field 1: `edition_introduced`
11768        #[cfg_attr(
11769            feature = "json",
11770            serde(
11771                rename = "editionIntroduced",
11772                alias = "edition_introduced",
11773                with = "::buffa::json_helpers::opt_closed_enum",
11774                skip_serializing_if = "::core::option::Option::is_none"
11775            )
11776        )]
11777        pub edition_introduced: ::core::option::Option<super::Edition>,
11778        /// The edition this feature becomes deprecated in.  Using this after this
11779        /// edition may trigger warnings.
11780        ///
11781        /// Field 2: `edition_deprecated`
11782        #[cfg_attr(
11783            feature = "json",
11784            serde(
11785                rename = "editionDeprecated",
11786                alias = "edition_deprecated",
11787                with = "::buffa::json_helpers::opt_closed_enum",
11788                skip_serializing_if = "::core::option::Option::is_none"
11789            )
11790        )]
11791        pub edition_deprecated: ::core::option::Option<super::Edition>,
11792        /// The deprecation warning text if this feature is used after the edition it
11793        /// was marked deprecated in.
11794        ///
11795        /// Field 3: `deprecation_warning`
11796        #[cfg_attr(
11797            feature = "json",
11798            serde(
11799                rename = "deprecationWarning",
11800                alias = "deprecation_warning",
11801                skip_serializing_if = "::core::option::Option::is_none"
11802            )
11803        )]
11804        pub deprecation_warning: ::core::option::Option<::buffa::alloc::string::String>,
11805        /// The edition this feature is no longer available in.  In editions after
11806        /// this one, the last default assigned will be used, and proto files will
11807        /// not be able to override it.
11808        ///
11809        /// Field 4: `edition_removed`
11810        #[cfg_attr(
11811            feature = "json",
11812            serde(
11813                rename = "editionRemoved",
11814                alias = "edition_removed",
11815                with = "::buffa::json_helpers::opt_closed_enum",
11816                skip_serializing_if = "::core::option::Option::is_none"
11817            )
11818        )]
11819        pub edition_removed: ::core::option::Option<super::Edition>,
11820        #[cfg_attr(feature = "json", serde(skip))]
11821        #[doc(hidden)]
11822        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11823    }
11824    impl ::core::fmt::Debug for FeatureSupport {
11825        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11826            f.debug_struct("FeatureSupport")
11827                .field("edition_introduced", &self.edition_introduced)
11828                .field("edition_deprecated", &self.edition_deprecated)
11829                .field("deprecation_warning", &self.deprecation_warning)
11830                .field("edition_removed", &self.edition_removed)
11831                .finish()
11832        }
11833    }
11834    impl FeatureSupport {
11835        /// Protobuf type URL for this message, for use with `Any::pack` and
11836        /// `Any::unpack_if`.
11837        ///
11838        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11839        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11840    }
11841    impl FeatureSupport {
11842        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11843        #[inline]
11844        ///Sets [`Self::edition_introduced`] to `Some(value)`, consuming and returning `self`.
11845        pub fn with_edition_introduced(
11846            mut self,
11847            value: impl Into<super::Edition>,
11848        ) -> Self {
11849            self.edition_introduced = Some(value.into());
11850            self
11851        }
11852        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11853        #[inline]
11854        ///Sets [`Self::edition_deprecated`] to `Some(value)`, consuming and returning `self`.
11855        pub fn with_edition_deprecated(
11856            mut self,
11857            value: impl Into<super::Edition>,
11858        ) -> Self {
11859            self.edition_deprecated = Some(value.into());
11860            self
11861        }
11862        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11863        #[inline]
11864        ///Sets [`Self::deprecation_warning`] to `Some(value)`, consuming and returning `self`.
11865        pub fn with_deprecation_warning(
11866            mut self,
11867            value: impl Into<::buffa::alloc::string::String>,
11868        ) -> Self {
11869            self.deprecation_warning = Some(value.into());
11870            self
11871        }
11872        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11873        #[inline]
11874        ///Sets [`Self::edition_removed`] to `Some(value)`, consuming and returning `self`.
11875        pub fn with_edition_removed(mut self, value: impl Into<super::Edition>) -> Self {
11876            self.edition_removed = Some(value.into());
11877            self
11878        }
11879    }
11880    ::buffa::impl_default_instance!(FeatureSupport);
11881    impl ::buffa::MessageName for FeatureSupport {
11882        const PACKAGE: &'static str = "google.protobuf";
11883        const NAME: &'static str = "FieldOptions.FeatureSupport";
11884        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
11885        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11886    }
11887    impl ::buffa::Message for FeatureSupport {
11888        /// Returns the total encoded size in bytes.
11889        ///
11890        /// Accumulates in `u64` (which cannot overflow for in-memory
11891        /// data) and saturates to `u32` at return, so a message whose
11892        /// encoded size exceeds the 2 GiB protobuf limit yields a value
11893        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
11894        /// points reject, never a silently wrapped size.
11895        #[allow(clippy::let_and_return)]
11896        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11897            #[allow(unused_imports)]
11898            use ::buffa::Enumeration as _;
11899            let mut size = 0u64;
11900            if let Some(ref v) = self.edition_introduced {
11901                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11902            }
11903            if let Some(ref v) = self.edition_deprecated {
11904                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11905            }
11906            if let Some(ref v) = self.deprecation_warning {
11907                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
11908            }
11909            if let Some(ref v) = self.edition_removed {
11910                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11911            }
11912            size += self.__buffa_unknown_fields.encoded_len() as u64;
11913            ::buffa::saturate_size(size)
11914        }
11915        fn write_to(
11916            &self,
11917            _cache: &mut ::buffa::SizeCache,
11918            buf: &mut impl ::buffa::EncodeSink,
11919        ) {
11920            #[allow(unused_imports)]
11921            use ::buffa::Enumeration as _;
11922            if let Some(ref v) = self.edition_introduced {
11923                ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
11924            }
11925            if let Some(ref v) = self.edition_deprecated {
11926                ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
11927            }
11928            if let Some(ref v) = self.deprecation_warning {
11929                ::buffa::types::put_string_field(3u32, v, buf);
11930            }
11931            if let Some(ref v) = self.edition_removed {
11932                ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
11933            }
11934            self.__buffa_unknown_fields.write_to(buf);
11935        }
11936        fn merge_field(
11937            &mut self,
11938            tag: ::buffa::encoding::Tag,
11939            buf: &mut impl ::buffa::bytes::Buf,
11940            ctx: ::buffa::DecodeContext<'_>,
11941        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11942            #[allow(unused_imports)]
11943            use ::buffa::bytes::Buf as _;
11944            #[allow(unused_imports)]
11945            use ::buffa::Enumeration as _;
11946            match tag.field_number() {
11947                1u32 => {
11948                    ::buffa::encoding::check_wire_type(
11949                        tag,
11950                        ::buffa::encoding::WireType::Varint,
11951                    )?;
11952                    let __raw = ::buffa::types::decode_int32(buf)?;
11953                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11954                        __raw,
11955                    ) {
11956                        self.edition_introduced = ::core::option::Option::Some(__v);
11957                    } else {
11958                        ctx.register_unknown_field()?;
11959                        self.__buffa_unknown_fields
11960                            .push(::buffa::UnknownField {
11961                                number: 1u32,
11962                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11963                            });
11964                    }
11965                }
11966                2u32 => {
11967                    ::buffa::encoding::check_wire_type(
11968                        tag,
11969                        ::buffa::encoding::WireType::Varint,
11970                    )?;
11971                    let __raw = ::buffa::types::decode_int32(buf)?;
11972                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11973                        __raw,
11974                    ) {
11975                        self.edition_deprecated = ::core::option::Option::Some(__v);
11976                    } else {
11977                        ctx.register_unknown_field()?;
11978                        self.__buffa_unknown_fields
11979                            .push(::buffa::UnknownField {
11980                                number: 2u32,
11981                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11982                            });
11983                    }
11984                }
11985                3u32 => {
11986                    ::buffa::encoding::check_wire_type(
11987                        tag,
11988                        ::buffa::encoding::WireType::LengthDelimited,
11989                    )?;
11990                    ::buffa::types::merge_string(
11991                        self
11992                            .deprecation_warning
11993                            .get_or_insert_with(::buffa::alloc::string::String::new),
11994                        buf,
11995                    )?;
11996                }
11997                4u32 => {
11998                    ::buffa::encoding::check_wire_type(
11999                        tag,
12000                        ::buffa::encoding::WireType::Varint,
12001                    )?;
12002                    let __raw = ::buffa::types::decode_int32(buf)?;
12003                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
12004                        __raw,
12005                    ) {
12006                        self.edition_removed = ::core::option::Option::Some(__v);
12007                    } else {
12008                        ctx.register_unknown_field()?;
12009                        self.__buffa_unknown_fields
12010                            .push(::buffa::UnknownField {
12011                                number: 4u32,
12012                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
12013                            });
12014                    }
12015                }
12016                _ => {
12017                    self.__buffa_unknown_fields
12018                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12019                }
12020            }
12021            ::core::result::Result::Ok(())
12022        }
12023        fn clear(&mut self) {
12024            self.edition_introduced = ::core::option::Option::None;
12025            self.edition_deprecated = ::core::option::Option::None;
12026            self.deprecation_warning = ::core::option::Option::None;
12027            self.edition_removed = ::core::option::Option::None;
12028            self.__buffa_unknown_fields.clear();
12029        }
12030    }
12031    impl ::buffa::ExtensionSet for FeatureSupport {
12032        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
12033        fn unknown_fields(&self) -> &::buffa::UnknownFields {
12034            &self.__buffa_unknown_fields
12035        }
12036        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12037            &mut self.__buffa_unknown_fields
12038        }
12039    }
12040    #[cfg(feature = "text")]
12041    impl ::buffa::text::TextFormat for FeatureSupport {
12042        fn encode_text(
12043            &self,
12044            enc: &mut ::buffa::text::TextEncoder<'_>,
12045        ) -> ::core::fmt::Result {
12046            #[allow(unused_imports)]
12047            use ::buffa::Enumeration as _;
12048            if let ::core::option::Option::Some(ref __v) = self.edition_introduced {
12049                enc.write_field_name("edition_introduced")?;
12050                enc.write_enum_name(__v.proto_name())?;
12051            }
12052            if let ::core::option::Option::Some(ref __v) = self.edition_deprecated {
12053                enc.write_field_name("edition_deprecated")?;
12054                enc.write_enum_name(__v.proto_name())?;
12055            }
12056            if let ::core::option::Option::Some(ref __v) = self.deprecation_warning {
12057                enc.write_field_name("deprecation_warning")?;
12058                enc.write_string(__v)?;
12059            }
12060            if let ::core::option::Option::Some(ref __v) = self.edition_removed {
12061                enc.write_field_name("edition_removed")?;
12062                enc.write_enum_name(__v.proto_name())?;
12063            }
12064            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12065            ::core::result::Result::Ok(())
12066        }
12067        fn merge_text(
12068            &mut self,
12069            dec: &mut ::buffa::text::TextDecoder<'_>,
12070        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12071            #[allow(unused_imports)]
12072            use ::buffa::Enumeration as _;
12073            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12074                match __name {
12075                    "edition_introduced" => {
12076                        self.edition_introduced = ::core::option::Option::Some(
12077                            dec.read_closed_enum_by_name::<super::Edition>()?,
12078                        );
12079                    }
12080                    "edition_deprecated" => {
12081                        self.edition_deprecated = ::core::option::Option::Some(
12082                            dec.read_closed_enum_by_name::<super::Edition>()?,
12083                        );
12084                    }
12085                    "deprecation_warning" => {
12086                        self.deprecation_warning = ::core::option::Option::Some(
12087                            dec.read_string()?.into_owned(),
12088                        );
12089                    }
12090                    "edition_removed" => {
12091                        self.edition_removed = ::core::option::Option::Some(
12092                            dec.read_closed_enum_by_name::<super::Edition>()?,
12093                        );
12094                    }
12095                    _ => dec.skip_value()?,
12096                }
12097            }
12098            ::core::result::Result::Ok(())
12099        }
12100    }
12101    #[cfg(feature = "json")]
12102    impl ::buffa::json_helpers::ProtoElemJson for FeatureSupport {
12103        fn serialize_proto_json<S: ::serde::Serializer>(
12104            v: &Self,
12105            s: S,
12106        ) -> ::core::result::Result<S::Ok, S::Error> {
12107            ::serde::Serialize::serialize(v, s)
12108        }
12109        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12110            d: D,
12111        ) -> ::core::result::Result<Self, D::Error> {
12112            <Self as ::serde::Deserialize>::deserialize(d)
12113        }
12114    }
12115    #[cfg(feature = "json")]
12116    #[doc(hidden)]
12117    pub const __FEATURE_SUPPORT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12118        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12119        to_json: ::buffa::type_registry::any_to_json::<FeatureSupport>,
12120        from_json: ::buffa::type_registry::any_from_json::<FeatureSupport>,
12121        is_wkt: false,
12122    };
12123    #[cfg(feature = "text")]
12124    #[doc(hidden)]
12125    pub const __FEATURE_SUPPORT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12126        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12127        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSupport>,
12128        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSupport>,
12129    };
12130    #[cfg(feature = "views")]
12131    #[doc(inline)]
12132    pub use super::__buffa::view::field_options::EditionDefaultView;
12133    #[cfg(feature = "views")]
12134    #[doc(inline)]
12135    pub use super::__buffa::view::field_options::EditionDefaultOwnedView;
12136    #[cfg(feature = "views")]
12137    #[doc(inline)]
12138    pub use super::__buffa::view::field_options::FeatureSupportView;
12139    #[cfg(feature = "views")]
12140    #[doc(inline)]
12141    pub use super::__buffa::view::field_options::FeatureSupportOwnedView;
12142}
12143#[derive(Clone, PartialEq, Default)]
12144#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12145#[cfg_attr(feature = "json", serde(default))]
12146#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12147pub struct OneofOptions {
12148    /// Any features defined in the specific edition.
12149    /// WARNING: This field should only be used by protobuf plugins or special
12150    /// cases like the proto compiler. Other uses are discouraged and
12151    /// developers should rely on the protoreflect APIs for their client language.
12152    ///
12153    /// Field 1: `features`
12154    #[cfg_attr(
12155        feature = "json",
12156        serde(
12157            rename = "features",
12158            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12159        )
12160    )]
12161    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12162    /// The parser stores options it doesn't recognize here. See above.
12163    ///
12164    /// Field 999: `uninterpreted_option`
12165    #[cfg_attr(
12166        feature = "json",
12167        serde(
12168            rename = "uninterpretedOption",
12169            alias = "uninterpreted_option",
12170            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12171            deserialize_with = "::buffa::json_helpers::null_as_default"
12172        )
12173    )]
12174    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12175    #[cfg_attr(feature = "json", serde(flatten))]
12176    #[doc(hidden)]
12177    pub __buffa_unknown_fields: __OneofOptionsExtJson,
12178}
12179impl ::core::fmt::Debug for OneofOptions {
12180    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12181        f.debug_struct("OneofOptions")
12182            .field("features", &self.features)
12183            .field("uninterpreted_option", &self.uninterpreted_option)
12184            .finish()
12185    }
12186}
12187impl OneofOptions {
12188    /// Protobuf type URL for this message, for use with `Any::pack` and
12189    /// `Any::unpack_if`.
12190    ///
12191    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12192    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12193}
12194::buffa::impl_default_instance!(OneofOptions);
12195impl ::buffa::MessageName for OneofOptions {
12196    const PACKAGE: &'static str = "google.protobuf";
12197    const NAME: &'static str = "OneofOptions";
12198    const FULL_NAME: &'static str = "google.protobuf.OneofOptions";
12199    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12200}
12201impl ::buffa::Message for OneofOptions {
12202    /// Returns the total encoded size in bytes.
12203    ///
12204    /// Accumulates in `u64` (which cannot overflow for in-memory
12205    /// data) and saturates to `u32` at return, so a message whose
12206    /// encoded size exceeds the 2 GiB protobuf limit yields a value
12207    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
12208    /// points reject, never a silently wrapped size.
12209    #[allow(clippy::let_and_return)]
12210    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12211        #[allow(unused_imports)]
12212        use ::buffa::Enumeration as _;
12213        let mut size = 0u64;
12214        if self.features.is_set() {
12215            let __slot = __cache.reserve();
12216            let inner_size = self.features.compute_size(__cache);
12217            __cache.set(__slot, inner_size);
12218            size
12219                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12220                    + inner_size as u64;
12221        }
12222        for v in &self.uninterpreted_option {
12223            let __slot = __cache.reserve();
12224            let inner_size = v.compute_size(__cache);
12225            __cache.set(__slot, inner_size);
12226            size
12227                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12228                    + inner_size as u64;
12229        }
12230        size += self.__buffa_unknown_fields.encoded_len() as u64;
12231        ::buffa::saturate_size(size)
12232    }
12233    fn write_to(
12234        &self,
12235        __cache: &mut ::buffa::SizeCache,
12236        buf: &mut impl ::buffa::EncodeSink,
12237    ) {
12238        #[allow(unused_imports)]
12239        use ::buffa::Enumeration as _;
12240        if self.features.is_set() {
12241            ::buffa::types::put_len_delimited_header(
12242                1u32,
12243                u64::from(__cache.consume_next()),
12244                buf,
12245            );
12246            self.features.write_to(__cache, buf);
12247        }
12248        for v in &self.uninterpreted_option {
12249            ::buffa::types::put_len_delimited_header(
12250                999u32,
12251                u64::from(__cache.consume_next()),
12252                buf,
12253            );
12254            v.write_to(__cache, buf);
12255        }
12256        self.__buffa_unknown_fields.write_to(buf);
12257    }
12258    fn merge_field(
12259        &mut self,
12260        tag: ::buffa::encoding::Tag,
12261        buf: &mut impl ::buffa::bytes::Buf,
12262        ctx: ::buffa::DecodeContext<'_>,
12263    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12264        #[allow(unused_imports)]
12265        use ::buffa::bytes::Buf as _;
12266        #[allow(unused_imports)]
12267        use ::buffa::Enumeration as _;
12268        match tag.field_number() {
12269            1u32 => {
12270                ::buffa::encoding::check_wire_type(
12271                    tag,
12272                    ::buffa::encoding::WireType::LengthDelimited,
12273                )?;
12274                ::buffa::Message::merge_length_delimited(
12275                    self.features.get_or_insert_default(),
12276                    buf,
12277                    ctx,
12278                )?;
12279            }
12280            999u32 => {
12281                ::buffa::encoding::check_wire_type(
12282                    tag,
12283                    ::buffa::encoding::WireType::LengthDelimited,
12284                )?;
12285                let mut elem = ::core::default::Default::default();
12286                ctx.register_element_memory(
12287                    ::buffa::__private::element_footprint(&elem),
12288                )?;
12289                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
12290                self.uninterpreted_option.push(elem);
12291            }
12292            _ => {
12293                self.__buffa_unknown_fields
12294                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12295            }
12296        }
12297        ::core::result::Result::Ok(())
12298    }
12299    fn clear(&mut self) {
12300        self.features = ::buffa::MessageField::none();
12301        self.uninterpreted_option.clear();
12302        self.__buffa_unknown_fields.clear();
12303    }
12304}
12305impl ::buffa::ExtensionSet for OneofOptions {
12306    const PROTO_FQN: &'static str = "google.protobuf.OneofOptions";
12307    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12308        &self.__buffa_unknown_fields
12309    }
12310    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12311        &mut self.__buffa_unknown_fields
12312    }
12313}
12314#[cfg(feature = "text")]
12315impl ::buffa::text::TextFormat for OneofOptions {
12316    fn encode_text(
12317        &self,
12318        enc: &mut ::buffa::text::TextEncoder<'_>,
12319    ) -> ::core::fmt::Result {
12320        #[allow(unused_imports)]
12321        use ::buffa::Enumeration as _;
12322        if self.features.is_set() {
12323            enc.write_field_name("features")?;
12324            enc.write_message(&*self.features)?;
12325        }
12326        for __v in &self.uninterpreted_option {
12327            enc.write_field_name("uninterpreted_option")?;
12328            enc.write_message(__v)?;
12329        }
12330        enc.write_extension_fields(
12331            "google.protobuf.OneofOptions",
12332            &self.__buffa_unknown_fields,
12333        )?;
12334        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12335        ::core::result::Result::Ok(())
12336    }
12337    fn merge_text(
12338        &mut self,
12339        dec: &mut ::buffa::text::TextDecoder<'_>,
12340    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12341        #[allow(unused_imports)]
12342        use ::buffa::Enumeration as _;
12343        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12344            match __name {
12345                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12346                "uninterpreted_option" => {
12347                    dec.read_repeated_into(
12348                        &mut self.uninterpreted_option,
12349                        |__d| {
12350                            let mut __m = ::core::default::Default::default();
12351                            __d.merge_message(&mut __m)?;
12352                            ::core::result::Result::Ok(__m)
12353                        },
12354                    )?
12355                }
12356                __name if __name.starts_with('[') => {
12357                    for __r in dec
12358                        .read_extension(__name, "google.protobuf.OneofOptions")?
12359                    {
12360                        self.__buffa_unknown_fields.push(__r);
12361                    }
12362                }
12363                _ => dec.skip_value()?,
12364            }
12365        }
12366        ::core::result::Result::Ok(())
12367    }
12368}
12369#[cfg(feature = "json")]
12370impl<'de> ::serde::Deserialize<'de> for OneofOptions {
12371    fn deserialize<D: ::serde::Deserializer<'de>>(
12372        d: D,
12373    ) -> ::core::result::Result<Self, D::Error> {
12374        struct _V;
12375        impl<'de> ::serde::de::Visitor<'de> for _V {
12376            type Value = OneofOptions;
12377            fn expecting(
12378                &self,
12379                f: &mut ::core::fmt::Formatter<'_>,
12380            ) -> ::core::fmt::Result {
12381                f.write_str("struct OneofOptions")
12382            }
12383            #[allow(clippy::field_reassign_with_default)]
12384            fn visit_map<A: ::serde::de::MapAccess<'de>>(
12385                self,
12386                mut map: A,
12387            ) -> ::core::result::Result<OneofOptions, A::Error> {
12388                let mut __f_features: ::core::option::Option<
12389                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12390                > = None;
12391                let mut __f_uninterpreted_option: ::core::option::Option<
12392                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12393                > = None;
12394                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12395                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12396                    match key.as_str() {
12397                        "features" => {
12398                            __f_features = Some(
12399                                map
12400                                    .next_value::<
12401                                        ::buffa::MessageField<
12402                                            FeatureSet,
12403                                            ::buffa::Inline<FeatureSet>,
12404                                        >,
12405                                    >()?,
12406                            );
12407                        }
12408                        "uninterpretedOption" | "uninterpreted_option" => {
12409                            __f_uninterpreted_option = Some({
12410                                struct _S;
12411                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
12412                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12413                                    fn deserialize<D: ::serde::Deserializer<'de>>(
12414                                        self,
12415                                        d: D,
12416                                    ) -> ::core::result::Result<
12417                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12418                                        D::Error,
12419                                    > {
12420                                        ::buffa::json_helpers::null_as_default(d)
12421                                    }
12422                                }
12423                                map.next_value_seed(_S)?
12424                            });
12425                        }
12426                        __k if __k.starts_with('[') => {
12427                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12428                            match ::buffa::extension_registry::deserialize_extension_key(
12429                                "google.protobuf.OneofOptions",
12430                                __k,
12431                                __v,
12432                            ) {
12433                                ::core::option::Option::Some(
12434                                    ::core::result::Result::Ok(__recs),
12435                                ) => {
12436                                    for __rec in __recs {
12437                                        __ext_records.push(__rec);
12438                                    }
12439                                }
12440                                ::core::option::Option::Some(
12441                                    ::core::result::Result::Err(__e),
12442                                ) => {
12443                                    return ::core::result::Result::Err(
12444                                        <A::Error as ::serde::de::Error>::custom(__e),
12445                                    );
12446                                }
12447                                ::core::option::Option::None => {}
12448                            }
12449                        }
12450                        _ => {
12451                            map.next_value::<::serde::de::IgnoredAny>()?;
12452                        }
12453                    }
12454                }
12455                let mut __r = <OneofOptions as ::core::default::Default>::default();
12456                if let ::core::option::Option::Some(v) = __f_features {
12457                    __r.features = v;
12458                }
12459                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
12460                    __r.uninterpreted_option = v;
12461                }
12462                for __rec in __ext_records {
12463                    __r.__buffa_unknown_fields.push(__rec);
12464                }
12465                Ok(__r)
12466            }
12467        }
12468        d.deserialize_map(_V)
12469    }
12470}
12471#[cfg(feature = "json")]
12472impl ::buffa::json_helpers::ProtoElemJson for OneofOptions {
12473    fn serialize_proto_json<S: ::serde::Serializer>(
12474        v: &Self,
12475        s: S,
12476    ) -> ::core::result::Result<S::Ok, S::Error> {
12477        ::serde::Serialize::serialize(v, s)
12478    }
12479    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12480        d: D,
12481    ) -> ::core::result::Result<Self, D::Error> {
12482        <Self as ::serde::Deserialize>::deserialize(d)
12483    }
12484}
12485#[doc(hidden)]
12486#[derive(Clone, Debug, Default, PartialEq)]
12487#[repr(transparent)]
12488#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12489pub struct __OneofOptionsExtJson(pub ::buffa::UnknownFields);
12490impl ::core::ops::Deref for __OneofOptionsExtJson {
12491    type Target = ::buffa::UnknownFields;
12492    fn deref(&self) -> &::buffa::UnknownFields {
12493        &self.0
12494    }
12495}
12496impl ::core::ops::DerefMut for __OneofOptionsExtJson {
12497    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
12498        &mut self.0
12499    }
12500}
12501impl ::core::convert::From<::buffa::UnknownFields> for __OneofOptionsExtJson {
12502    fn from(u: ::buffa::UnknownFields) -> Self {
12503        Self(u)
12504    }
12505}
12506#[cfg(feature = "json")]
12507impl ::serde::Serialize for __OneofOptionsExtJson {
12508    fn serialize<S: ::serde::Serializer>(
12509        &self,
12510        s: S,
12511    ) -> ::core::result::Result<S::Ok, S::Error> {
12512        ::buffa::extension_registry::serialize_extensions(
12513            "google.protobuf.OneofOptions",
12514            &self.0,
12515            s,
12516        )
12517    }
12518}
12519#[cfg(feature = "json")]
12520impl<'de> ::serde::Deserialize<'de> for __OneofOptionsExtJson {
12521    fn deserialize<D: ::serde::Deserializer<'de>>(
12522        d: D,
12523    ) -> ::core::result::Result<Self, D::Error> {
12524        ::buffa::extension_registry::deserialize_extensions(
12525                "google.protobuf.OneofOptions",
12526                d,
12527            )
12528            .map(Self)
12529    }
12530}
12531#[cfg(feature = "json")]
12532#[doc(hidden)]
12533pub const __ONEOF_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12534    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12535    to_json: ::buffa::type_registry::any_to_json::<OneofOptions>,
12536    from_json: ::buffa::type_registry::any_from_json::<OneofOptions>,
12537    is_wkt: false,
12538};
12539#[cfg(feature = "text")]
12540#[doc(hidden)]
12541pub const __ONEOF_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12542    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12543    text_encode: ::buffa::type_registry::any_encode_text::<OneofOptions>,
12544    text_merge: ::buffa::type_registry::any_merge_text::<OneofOptions>,
12545};
12546#[derive(Clone, PartialEq, Default)]
12547#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12548#[cfg_attr(feature = "json", serde(default))]
12549#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12550pub struct EnumOptions {
12551    /// Set this option to true to allow mapping different tag names to the same
12552    /// value.
12553    ///
12554    /// Field 2: `allow_alias`
12555    #[cfg_attr(
12556        feature = "json",
12557        serde(
12558            rename = "allowAlias",
12559            alias = "allow_alias",
12560            skip_serializing_if = "::core::option::Option::is_none"
12561        )
12562    )]
12563    pub allow_alias: ::core::option::Option<bool>,
12564    /// Is this enum deprecated?
12565    /// Depending on the target platform, this can emit Deprecated annotations
12566    /// for the enum, or it will be completely ignored; in the very least, this
12567    /// is a formalization for deprecating enums.
12568    ///
12569    /// Field 3: `deprecated`
12570    #[cfg_attr(
12571        feature = "json",
12572        serde(
12573            rename = "deprecated",
12574            skip_serializing_if = "::core::option::Option::is_none"
12575        )
12576    )]
12577    pub deprecated: ::core::option::Option<bool>,
12578    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
12579    /// and strips underscored from the fields before comparison in proto3 only.
12580    /// The new behavior takes `json_name` into account and applies to proto2 as
12581    /// well.
12582    /// TODO Remove this legacy behavior once downstream teams have
12583    /// had time to migrate.
12584    ///
12585    /// Field 6: `deprecated_legacy_json_field_conflicts`
12586    #[cfg_attr(
12587        feature = "json",
12588        serde(
12589            rename = "deprecatedLegacyJsonFieldConflicts",
12590            alias = "deprecated_legacy_json_field_conflicts",
12591            skip_serializing_if = "::core::option::Option::is_none"
12592        )
12593    )]
12594    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
12595    /// Any features defined in the specific edition.
12596    /// WARNING: This field should only be used by protobuf plugins or special
12597    /// cases like the proto compiler. Other uses are discouraged and
12598    /// developers should rely on the protoreflect APIs for their client language.
12599    ///
12600    /// Field 7: `features`
12601    #[cfg_attr(
12602        feature = "json",
12603        serde(
12604            rename = "features",
12605            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12606        )
12607    )]
12608    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12609    /// The parser stores options it doesn't recognize here. See above.
12610    ///
12611    /// Field 999: `uninterpreted_option`
12612    #[cfg_attr(
12613        feature = "json",
12614        serde(
12615            rename = "uninterpretedOption",
12616            alias = "uninterpreted_option",
12617            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12618            deserialize_with = "::buffa::json_helpers::null_as_default"
12619        )
12620    )]
12621    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12622    #[cfg_attr(feature = "json", serde(flatten))]
12623    #[doc(hidden)]
12624    pub __buffa_unknown_fields: __EnumOptionsExtJson,
12625}
12626impl ::core::fmt::Debug for EnumOptions {
12627    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12628        f.debug_struct("EnumOptions")
12629            .field("allow_alias", &self.allow_alias)
12630            .field("deprecated", &self.deprecated)
12631            .field(
12632                "deprecated_legacy_json_field_conflicts",
12633                &self.deprecated_legacy_json_field_conflicts,
12634            )
12635            .field("features", &self.features)
12636            .field("uninterpreted_option", &self.uninterpreted_option)
12637            .finish()
12638    }
12639}
12640impl EnumOptions {
12641    /// Protobuf type URL for this message, for use with `Any::pack` and
12642    /// `Any::unpack_if`.
12643    ///
12644    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12645    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12646}
12647impl EnumOptions {
12648    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12649    #[inline]
12650    ///Sets [`Self::allow_alias`] to `Some(value)`, consuming and returning `self`.
12651    pub fn with_allow_alias(mut self, value: bool) -> Self {
12652        self.allow_alias = Some(value);
12653        self
12654    }
12655    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12656    #[inline]
12657    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
12658    pub fn with_deprecated(mut self, value: bool) -> Self {
12659        self.deprecated = Some(value);
12660        self
12661    }
12662    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12663    #[inline]
12664    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
12665    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
12666        self.deprecated_legacy_json_field_conflicts = Some(value);
12667        self
12668    }
12669}
12670::buffa::impl_default_instance!(EnumOptions);
12671impl ::buffa::MessageName for EnumOptions {
12672    const PACKAGE: &'static str = "google.protobuf";
12673    const NAME: &'static str = "EnumOptions";
12674    const FULL_NAME: &'static str = "google.protobuf.EnumOptions";
12675    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12676}
12677impl ::buffa::Message for EnumOptions {
12678    /// Returns the total encoded size in bytes.
12679    ///
12680    /// Accumulates in `u64` (which cannot overflow for in-memory
12681    /// data) and saturates to `u32` at return, so a message whose
12682    /// encoded size exceeds the 2 GiB protobuf limit yields a value
12683    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
12684    /// points reject, never a silently wrapped size.
12685    #[allow(clippy::let_and_return)]
12686    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12687        #[allow(unused_imports)]
12688        use ::buffa::Enumeration as _;
12689        let mut size = 0u64;
12690        if self.allow_alias.is_some() {
12691            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12692        }
12693        if self.deprecated.is_some() {
12694            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12695        }
12696        if self.deprecated_legacy_json_field_conflicts.is_some() {
12697            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12698        }
12699        if self.features.is_set() {
12700            let __slot = __cache.reserve();
12701            let inner_size = self.features.compute_size(__cache);
12702            __cache.set(__slot, inner_size);
12703            size
12704                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12705                    + inner_size as u64;
12706        }
12707        for v in &self.uninterpreted_option {
12708            let __slot = __cache.reserve();
12709            let inner_size = v.compute_size(__cache);
12710            __cache.set(__slot, inner_size);
12711            size
12712                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12713                    + inner_size as u64;
12714        }
12715        size += self.__buffa_unknown_fields.encoded_len() as u64;
12716        ::buffa::saturate_size(size)
12717    }
12718    fn write_to(
12719        &self,
12720        __cache: &mut ::buffa::SizeCache,
12721        buf: &mut impl ::buffa::EncodeSink,
12722    ) {
12723        #[allow(unused_imports)]
12724        use ::buffa::Enumeration as _;
12725        if let Some(v) = self.allow_alias {
12726            ::buffa::types::put_bool_field(2u32, v, buf);
12727        }
12728        if let Some(v) = self.deprecated {
12729            ::buffa::types::put_bool_field(3u32, v, buf);
12730        }
12731        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
12732            ::buffa::types::put_bool_field(6u32, v, buf);
12733        }
12734        if self.features.is_set() {
12735            ::buffa::types::put_len_delimited_header(
12736                7u32,
12737                u64::from(__cache.consume_next()),
12738                buf,
12739            );
12740            self.features.write_to(__cache, buf);
12741        }
12742        for v in &self.uninterpreted_option {
12743            ::buffa::types::put_len_delimited_header(
12744                999u32,
12745                u64::from(__cache.consume_next()),
12746                buf,
12747            );
12748            v.write_to(__cache, buf);
12749        }
12750        self.__buffa_unknown_fields.write_to(buf);
12751    }
12752    fn merge_field(
12753        &mut self,
12754        tag: ::buffa::encoding::Tag,
12755        buf: &mut impl ::buffa::bytes::Buf,
12756        ctx: ::buffa::DecodeContext<'_>,
12757    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12758        #[allow(unused_imports)]
12759        use ::buffa::bytes::Buf as _;
12760        #[allow(unused_imports)]
12761        use ::buffa::Enumeration as _;
12762        match tag.field_number() {
12763            2u32 => {
12764                ::buffa::encoding::check_wire_type(
12765                    tag,
12766                    ::buffa::encoding::WireType::Varint,
12767                )?;
12768                self.allow_alias = ::core::option::Option::Some(
12769                    ::buffa::types::decode_bool(buf)?,
12770                );
12771            }
12772            3u32 => {
12773                ::buffa::encoding::check_wire_type(
12774                    tag,
12775                    ::buffa::encoding::WireType::Varint,
12776                )?;
12777                self.deprecated = ::core::option::Option::Some(
12778                    ::buffa::types::decode_bool(buf)?,
12779                );
12780            }
12781            6u32 => {
12782                ::buffa::encoding::check_wire_type(
12783                    tag,
12784                    ::buffa::encoding::WireType::Varint,
12785                )?;
12786                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12787                    ::buffa::types::decode_bool(buf)?,
12788                );
12789            }
12790            7u32 => {
12791                ::buffa::encoding::check_wire_type(
12792                    tag,
12793                    ::buffa::encoding::WireType::LengthDelimited,
12794                )?;
12795                ::buffa::Message::merge_length_delimited(
12796                    self.features.get_or_insert_default(),
12797                    buf,
12798                    ctx,
12799                )?;
12800            }
12801            999u32 => {
12802                ::buffa::encoding::check_wire_type(
12803                    tag,
12804                    ::buffa::encoding::WireType::LengthDelimited,
12805                )?;
12806                let mut elem = ::core::default::Default::default();
12807                ctx.register_element_memory(
12808                    ::buffa::__private::element_footprint(&elem),
12809                )?;
12810                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
12811                self.uninterpreted_option.push(elem);
12812            }
12813            _ => {
12814                self.__buffa_unknown_fields
12815                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12816            }
12817        }
12818        ::core::result::Result::Ok(())
12819    }
12820    fn clear(&mut self) {
12821        self.allow_alias = ::core::option::Option::None;
12822        self.deprecated = ::core::option::Option::None;
12823        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
12824        self.features = ::buffa::MessageField::none();
12825        self.uninterpreted_option.clear();
12826        self.__buffa_unknown_fields.clear();
12827    }
12828}
12829impl ::buffa::ExtensionSet for EnumOptions {
12830    const PROTO_FQN: &'static str = "google.protobuf.EnumOptions";
12831    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12832        &self.__buffa_unknown_fields
12833    }
12834    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12835        &mut self.__buffa_unknown_fields
12836    }
12837}
12838#[cfg(feature = "text")]
12839impl ::buffa::text::TextFormat for EnumOptions {
12840    fn encode_text(
12841        &self,
12842        enc: &mut ::buffa::text::TextEncoder<'_>,
12843    ) -> ::core::fmt::Result {
12844        #[allow(unused_imports)]
12845        use ::buffa::Enumeration as _;
12846        if let ::core::option::Option::Some(ref __v) = self.allow_alias {
12847            enc.write_field_name("allow_alias")?;
12848            enc.write_bool(*__v)?;
12849        }
12850        if let ::core::option::Option::Some(ref __v) = self.deprecated {
12851            enc.write_field_name("deprecated")?;
12852            enc.write_bool(*__v)?;
12853        }
12854        if let ::core::option::Option::Some(ref __v) = self
12855            .deprecated_legacy_json_field_conflicts
12856        {
12857            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
12858            enc.write_bool(*__v)?;
12859        }
12860        if self.features.is_set() {
12861            enc.write_field_name("features")?;
12862            enc.write_message(&*self.features)?;
12863        }
12864        for __v in &self.uninterpreted_option {
12865            enc.write_field_name("uninterpreted_option")?;
12866            enc.write_message(__v)?;
12867        }
12868        enc.write_extension_fields(
12869            "google.protobuf.EnumOptions",
12870            &self.__buffa_unknown_fields,
12871        )?;
12872        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12873        ::core::result::Result::Ok(())
12874    }
12875    fn merge_text(
12876        &mut self,
12877        dec: &mut ::buffa::text::TextDecoder<'_>,
12878    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12879        #[allow(unused_imports)]
12880        use ::buffa::Enumeration as _;
12881        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12882            match __name {
12883                "allow_alias" => {
12884                    self.allow_alias = ::core::option::Option::Some(dec.read_bool()?);
12885                }
12886                "deprecated" => {
12887                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
12888                }
12889                "deprecated_legacy_json_field_conflicts" => {
12890                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12891                        dec.read_bool()?,
12892                    );
12893                }
12894                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12895                "uninterpreted_option" => {
12896                    dec.read_repeated_into(
12897                        &mut self.uninterpreted_option,
12898                        |__d| {
12899                            let mut __m = ::core::default::Default::default();
12900                            __d.merge_message(&mut __m)?;
12901                            ::core::result::Result::Ok(__m)
12902                        },
12903                    )?
12904                }
12905                __name if __name.starts_with('[') => {
12906                    for __r in dec.read_extension(__name, "google.protobuf.EnumOptions")?
12907                    {
12908                        self.__buffa_unknown_fields.push(__r);
12909                    }
12910                }
12911                _ => dec.skip_value()?,
12912            }
12913        }
12914        ::core::result::Result::Ok(())
12915    }
12916}
12917#[cfg(feature = "json")]
12918impl<'de> ::serde::Deserialize<'de> for EnumOptions {
12919    fn deserialize<D: ::serde::Deserializer<'de>>(
12920        d: D,
12921    ) -> ::core::result::Result<Self, D::Error> {
12922        struct _V;
12923        impl<'de> ::serde::de::Visitor<'de> for _V {
12924            type Value = EnumOptions;
12925            fn expecting(
12926                &self,
12927                f: &mut ::core::fmt::Formatter<'_>,
12928            ) -> ::core::fmt::Result {
12929                f.write_str("struct EnumOptions")
12930            }
12931            #[allow(clippy::field_reassign_with_default)]
12932            fn visit_map<A: ::serde::de::MapAccess<'de>>(
12933                self,
12934                mut map: A,
12935            ) -> ::core::result::Result<EnumOptions, A::Error> {
12936                let mut __f_allow_alias: ::core::option::Option<
12937                    ::core::option::Option<bool>,
12938                > = None;
12939                let mut __f_deprecated: ::core::option::Option<
12940                    ::core::option::Option<bool>,
12941                > = None;
12942                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
12943                    ::core::option::Option<bool>,
12944                > = None;
12945                let mut __f_features: ::core::option::Option<
12946                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12947                > = None;
12948                let mut __f_uninterpreted_option: ::core::option::Option<
12949                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12950                > = None;
12951                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12952                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12953                    match key.as_str() {
12954                        "allowAlias" | "allow_alias" => {
12955                            __f_allow_alias = Some(
12956                                map.next_value::<::core::option::Option<bool>>()?,
12957                            );
12958                        }
12959                        "deprecated" => {
12960                            __f_deprecated = Some(
12961                                map.next_value::<::core::option::Option<bool>>()?,
12962                            );
12963                        }
12964                        "deprecatedLegacyJsonFieldConflicts"
12965                        | "deprecated_legacy_json_field_conflicts" => {
12966                            __f_deprecated_legacy_json_field_conflicts = Some(
12967                                map.next_value::<::core::option::Option<bool>>()?,
12968                            );
12969                        }
12970                        "features" => {
12971                            __f_features = Some(
12972                                map
12973                                    .next_value::<
12974                                        ::buffa::MessageField<
12975                                            FeatureSet,
12976                                            ::buffa::Inline<FeatureSet>,
12977                                        >,
12978                                    >()?,
12979                            );
12980                        }
12981                        "uninterpretedOption" | "uninterpreted_option" => {
12982                            __f_uninterpreted_option = Some({
12983                                struct _S;
12984                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
12985                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12986                                    fn deserialize<D: ::serde::Deserializer<'de>>(
12987                                        self,
12988                                        d: D,
12989                                    ) -> ::core::result::Result<
12990                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12991                                        D::Error,
12992                                    > {
12993                                        ::buffa::json_helpers::null_as_default(d)
12994                                    }
12995                                }
12996                                map.next_value_seed(_S)?
12997                            });
12998                        }
12999                        __k if __k.starts_with('[') => {
13000                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13001                            match ::buffa::extension_registry::deserialize_extension_key(
13002                                "google.protobuf.EnumOptions",
13003                                __k,
13004                                __v,
13005                            ) {
13006                                ::core::option::Option::Some(
13007                                    ::core::result::Result::Ok(__recs),
13008                                ) => {
13009                                    for __rec in __recs {
13010                                        __ext_records.push(__rec);
13011                                    }
13012                                }
13013                                ::core::option::Option::Some(
13014                                    ::core::result::Result::Err(__e),
13015                                ) => {
13016                                    return ::core::result::Result::Err(
13017                                        <A::Error as ::serde::de::Error>::custom(__e),
13018                                    );
13019                                }
13020                                ::core::option::Option::None => {}
13021                            }
13022                        }
13023                        _ => {
13024                            map.next_value::<::serde::de::IgnoredAny>()?;
13025                        }
13026                    }
13027                }
13028                let mut __r = <EnumOptions as ::core::default::Default>::default();
13029                if let ::core::option::Option::Some(v) = __f_allow_alias {
13030                    __r.allow_alias = v;
13031                }
13032                if let ::core::option::Option::Some(v) = __f_deprecated {
13033                    __r.deprecated = v;
13034                }
13035                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
13036                    __r.deprecated_legacy_json_field_conflicts = v;
13037                }
13038                if let ::core::option::Option::Some(v) = __f_features {
13039                    __r.features = v;
13040                }
13041                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13042                    __r.uninterpreted_option = v;
13043                }
13044                for __rec in __ext_records {
13045                    __r.__buffa_unknown_fields.push(__rec);
13046                }
13047                Ok(__r)
13048            }
13049        }
13050        d.deserialize_map(_V)
13051    }
13052}
13053#[cfg(feature = "json")]
13054impl ::buffa::json_helpers::ProtoElemJson for EnumOptions {
13055    fn serialize_proto_json<S: ::serde::Serializer>(
13056        v: &Self,
13057        s: S,
13058    ) -> ::core::result::Result<S::Ok, S::Error> {
13059        ::serde::Serialize::serialize(v, s)
13060    }
13061    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13062        d: D,
13063    ) -> ::core::result::Result<Self, D::Error> {
13064        <Self as ::serde::Deserialize>::deserialize(d)
13065    }
13066}
13067#[doc(hidden)]
13068#[derive(Clone, Debug, Default, PartialEq)]
13069#[repr(transparent)]
13070#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13071pub struct __EnumOptionsExtJson(pub ::buffa::UnknownFields);
13072impl ::core::ops::Deref for __EnumOptionsExtJson {
13073    type Target = ::buffa::UnknownFields;
13074    fn deref(&self) -> &::buffa::UnknownFields {
13075        &self.0
13076    }
13077}
13078impl ::core::ops::DerefMut for __EnumOptionsExtJson {
13079    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13080        &mut self.0
13081    }
13082}
13083impl ::core::convert::From<::buffa::UnknownFields> for __EnumOptionsExtJson {
13084    fn from(u: ::buffa::UnknownFields) -> Self {
13085        Self(u)
13086    }
13087}
13088#[cfg(feature = "json")]
13089impl ::serde::Serialize for __EnumOptionsExtJson {
13090    fn serialize<S: ::serde::Serializer>(
13091        &self,
13092        s: S,
13093    ) -> ::core::result::Result<S::Ok, S::Error> {
13094        ::buffa::extension_registry::serialize_extensions(
13095            "google.protobuf.EnumOptions",
13096            &self.0,
13097            s,
13098        )
13099    }
13100}
13101#[cfg(feature = "json")]
13102impl<'de> ::serde::Deserialize<'de> for __EnumOptionsExtJson {
13103    fn deserialize<D: ::serde::Deserializer<'de>>(
13104        d: D,
13105    ) -> ::core::result::Result<Self, D::Error> {
13106        ::buffa::extension_registry::deserialize_extensions(
13107                "google.protobuf.EnumOptions",
13108                d,
13109            )
13110            .map(Self)
13111    }
13112}
13113#[cfg(feature = "json")]
13114#[doc(hidden)]
13115pub const __ENUM_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13116    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13117    to_json: ::buffa::type_registry::any_to_json::<EnumOptions>,
13118    from_json: ::buffa::type_registry::any_from_json::<EnumOptions>,
13119    is_wkt: false,
13120};
13121#[cfg(feature = "text")]
13122#[doc(hidden)]
13123pub const __ENUM_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13124    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13125    text_encode: ::buffa::type_registry::any_encode_text::<EnumOptions>,
13126    text_merge: ::buffa::type_registry::any_merge_text::<EnumOptions>,
13127};
13128#[derive(Clone, PartialEq, Default)]
13129#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13130#[cfg_attr(feature = "json", serde(default))]
13131#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13132pub struct EnumValueOptions {
13133    /// Is this enum value deprecated?
13134    /// Depending on the target platform, this can emit Deprecated annotations
13135    /// for the enum value, or it will be completely ignored; in the very least,
13136    /// this is a formalization for deprecating enum values.
13137    ///
13138    /// Field 1: `deprecated`
13139    #[cfg_attr(
13140        feature = "json",
13141        serde(
13142            rename = "deprecated",
13143            skip_serializing_if = "::core::option::Option::is_none"
13144        )
13145    )]
13146    pub deprecated: ::core::option::Option<bool>,
13147    /// Any features defined in the specific edition.
13148    /// WARNING: This field should only be used by protobuf plugins or special
13149    /// cases like the proto compiler. Other uses are discouraged and
13150    /// developers should rely on the protoreflect APIs for their client language.
13151    ///
13152    /// Field 2: `features`
13153    #[cfg_attr(
13154        feature = "json",
13155        serde(
13156            rename = "features",
13157            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13158        )
13159    )]
13160    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13161    /// Indicate that fields annotated with this enum value should not be printed
13162    /// out when using debug formats, e.g. when the field contains sensitive
13163    /// credentials.
13164    ///
13165    /// Field 3: `debug_redact`
13166    #[cfg_attr(
13167        feature = "json",
13168        serde(
13169            rename = "debugRedact",
13170            alias = "debug_redact",
13171            skip_serializing_if = "::core::option::Option::is_none"
13172        )
13173    )]
13174    pub debug_redact: ::core::option::Option<bool>,
13175    /// Information about the support window of a feature value.
13176    ///
13177    /// Field 4: `feature_support`
13178    #[cfg_attr(
13179        feature = "json",
13180        serde(
13181            rename = "featureSupport",
13182            alias = "feature_support",
13183            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13184        )
13185    )]
13186    pub feature_support: ::buffa::MessageField<
13187        field_options::FeatureSupport,
13188        ::buffa::Inline<field_options::FeatureSupport>,
13189    >,
13190    /// The parser stores options it doesn't recognize here. See above.
13191    ///
13192    /// Field 999: `uninterpreted_option`
13193    #[cfg_attr(
13194        feature = "json",
13195        serde(
13196            rename = "uninterpretedOption",
13197            alias = "uninterpreted_option",
13198            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13199            deserialize_with = "::buffa::json_helpers::null_as_default"
13200        )
13201    )]
13202    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13203    #[cfg_attr(feature = "json", serde(flatten))]
13204    #[doc(hidden)]
13205    pub __buffa_unknown_fields: __EnumValueOptionsExtJson,
13206}
13207impl ::core::fmt::Debug for EnumValueOptions {
13208    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13209        f.debug_struct("EnumValueOptions")
13210            .field("deprecated", &self.deprecated)
13211            .field("features", &self.features)
13212            .field("debug_redact", &self.debug_redact)
13213            .field("feature_support", &self.feature_support)
13214            .field("uninterpreted_option", &self.uninterpreted_option)
13215            .finish()
13216    }
13217}
13218impl EnumValueOptions {
13219    /// Protobuf type URL for this message, for use with `Any::pack` and
13220    /// `Any::unpack_if`.
13221    ///
13222    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13223    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13224}
13225impl EnumValueOptions {
13226    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13227    #[inline]
13228    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13229    pub fn with_deprecated(mut self, value: bool) -> Self {
13230        self.deprecated = Some(value);
13231        self
13232    }
13233    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13234    #[inline]
13235    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
13236    pub fn with_debug_redact(mut self, value: bool) -> Self {
13237        self.debug_redact = Some(value);
13238        self
13239    }
13240}
13241::buffa::impl_default_instance!(EnumValueOptions);
13242impl ::buffa::MessageName for EnumValueOptions {
13243    const PACKAGE: &'static str = "google.protobuf";
13244    const NAME: &'static str = "EnumValueOptions";
13245    const FULL_NAME: &'static str = "google.protobuf.EnumValueOptions";
13246    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13247}
13248impl ::buffa::Message for EnumValueOptions {
13249    /// Returns the total encoded size in bytes.
13250    ///
13251    /// Accumulates in `u64` (which cannot overflow for in-memory
13252    /// data) and saturates to `u32` at return, so a message whose
13253    /// encoded size exceeds the 2 GiB protobuf limit yields a value
13254    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
13255    /// points reject, never a silently wrapped size.
13256    #[allow(clippy::let_and_return)]
13257    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13258        #[allow(unused_imports)]
13259        use ::buffa::Enumeration as _;
13260        let mut size = 0u64;
13261        if self.deprecated.is_some() {
13262            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13263        }
13264        if self.features.is_set() {
13265            let __slot = __cache.reserve();
13266            let inner_size = self.features.compute_size(__cache);
13267            __cache.set(__slot, inner_size);
13268            size
13269                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13270                    + inner_size as u64;
13271        }
13272        if self.debug_redact.is_some() {
13273            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13274        }
13275        if self.feature_support.is_set() {
13276            let __slot = __cache.reserve();
13277            let inner_size = self.feature_support.compute_size(__cache);
13278            __cache.set(__slot, inner_size);
13279            size
13280                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13281                    + inner_size as u64;
13282        }
13283        for v in &self.uninterpreted_option {
13284            let __slot = __cache.reserve();
13285            let inner_size = v.compute_size(__cache);
13286            __cache.set(__slot, inner_size);
13287            size
13288                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13289                    + inner_size as u64;
13290        }
13291        size += self.__buffa_unknown_fields.encoded_len() as u64;
13292        ::buffa::saturate_size(size)
13293    }
13294    fn write_to(
13295        &self,
13296        __cache: &mut ::buffa::SizeCache,
13297        buf: &mut impl ::buffa::EncodeSink,
13298    ) {
13299        #[allow(unused_imports)]
13300        use ::buffa::Enumeration as _;
13301        if let Some(v) = self.deprecated {
13302            ::buffa::types::put_bool_field(1u32, v, buf);
13303        }
13304        if self.features.is_set() {
13305            ::buffa::types::put_len_delimited_header(
13306                2u32,
13307                u64::from(__cache.consume_next()),
13308                buf,
13309            );
13310            self.features.write_to(__cache, buf);
13311        }
13312        if let Some(v) = self.debug_redact {
13313            ::buffa::types::put_bool_field(3u32, v, buf);
13314        }
13315        if self.feature_support.is_set() {
13316            ::buffa::types::put_len_delimited_header(
13317                4u32,
13318                u64::from(__cache.consume_next()),
13319                buf,
13320            );
13321            self.feature_support.write_to(__cache, buf);
13322        }
13323        for v in &self.uninterpreted_option {
13324            ::buffa::types::put_len_delimited_header(
13325                999u32,
13326                u64::from(__cache.consume_next()),
13327                buf,
13328            );
13329            v.write_to(__cache, buf);
13330        }
13331        self.__buffa_unknown_fields.write_to(buf);
13332    }
13333    fn merge_field(
13334        &mut self,
13335        tag: ::buffa::encoding::Tag,
13336        buf: &mut impl ::buffa::bytes::Buf,
13337        ctx: ::buffa::DecodeContext<'_>,
13338    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13339        #[allow(unused_imports)]
13340        use ::buffa::bytes::Buf as _;
13341        #[allow(unused_imports)]
13342        use ::buffa::Enumeration as _;
13343        match tag.field_number() {
13344            1u32 => {
13345                ::buffa::encoding::check_wire_type(
13346                    tag,
13347                    ::buffa::encoding::WireType::Varint,
13348                )?;
13349                self.deprecated = ::core::option::Option::Some(
13350                    ::buffa::types::decode_bool(buf)?,
13351                );
13352            }
13353            2u32 => {
13354                ::buffa::encoding::check_wire_type(
13355                    tag,
13356                    ::buffa::encoding::WireType::LengthDelimited,
13357                )?;
13358                ::buffa::Message::merge_length_delimited(
13359                    self.features.get_or_insert_default(),
13360                    buf,
13361                    ctx,
13362                )?;
13363            }
13364            3u32 => {
13365                ::buffa::encoding::check_wire_type(
13366                    tag,
13367                    ::buffa::encoding::WireType::Varint,
13368                )?;
13369                self.debug_redact = ::core::option::Option::Some(
13370                    ::buffa::types::decode_bool(buf)?,
13371                );
13372            }
13373            4u32 => {
13374                ::buffa::encoding::check_wire_type(
13375                    tag,
13376                    ::buffa::encoding::WireType::LengthDelimited,
13377                )?;
13378                ::buffa::Message::merge_length_delimited(
13379                    self.feature_support.get_or_insert_default(),
13380                    buf,
13381                    ctx,
13382                )?;
13383            }
13384            999u32 => {
13385                ::buffa::encoding::check_wire_type(
13386                    tag,
13387                    ::buffa::encoding::WireType::LengthDelimited,
13388                )?;
13389                let mut elem = ::core::default::Default::default();
13390                ctx.register_element_memory(
13391                    ::buffa::__private::element_footprint(&elem),
13392                )?;
13393                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13394                self.uninterpreted_option.push(elem);
13395            }
13396            _ => {
13397                self.__buffa_unknown_fields
13398                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13399            }
13400        }
13401        ::core::result::Result::Ok(())
13402    }
13403    fn clear(&mut self) {
13404        self.deprecated = ::core::option::Option::None;
13405        self.features = ::buffa::MessageField::none();
13406        self.debug_redact = ::core::option::Option::None;
13407        self.feature_support = ::buffa::MessageField::none();
13408        self.uninterpreted_option.clear();
13409        self.__buffa_unknown_fields.clear();
13410    }
13411}
13412impl ::buffa::ExtensionSet for EnumValueOptions {
13413    const PROTO_FQN: &'static str = "google.protobuf.EnumValueOptions";
13414    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13415        &self.__buffa_unknown_fields
13416    }
13417    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13418        &mut self.__buffa_unknown_fields
13419    }
13420}
13421#[cfg(feature = "text")]
13422impl ::buffa::text::TextFormat for EnumValueOptions {
13423    fn encode_text(
13424        &self,
13425        enc: &mut ::buffa::text::TextEncoder<'_>,
13426    ) -> ::core::fmt::Result {
13427        #[allow(unused_imports)]
13428        use ::buffa::Enumeration as _;
13429        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13430            enc.write_field_name("deprecated")?;
13431            enc.write_bool(*__v)?;
13432        }
13433        if self.features.is_set() {
13434            enc.write_field_name("features")?;
13435            enc.write_message(&*self.features)?;
13436        }
13437        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
13438            enc.write_field_name("debug_redact")?;
13439            enc.write_bool(*__v)?;
13440        }
13441        if self.feature_support.is_set() {
13442            enc.write_field_name("feature_support")?;
13443            enc.write_message(&*self.feature_support)?;
13444        }
13445        for __v in &self.uninterpreted_option {
13446            enc.write_field_name("uninterpreted_option")?;
13447            enc.write_message(__v)?;
13448        }
13449        enc.write_extension_fields(
13450            "google.protobuf.EnumValueOptions",
13451            &self.__buffa_unknown_fields,
13452        )?;
13453        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13454        ::core::result::Result::Ok(())
13455    }
13456    fn merge_text(
13457        &mut self,
13458        dec: &mut ::buffa::text::TextDecoder<'_>,
13459    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13460        #[allow(unused_imports)]
13461        use ::buffa::Enumeration as _;
13462        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13463            match __name {
13464                "deprecated" => {
13465                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13466                }
13467                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13468                "debug_redact" => {
13469                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
13470                }
13471                "feature_support" => {
13472                    dec.merge_message(self.feature_support.get_or_insert_default())?
13473                }
13474                "uninterpreted_option" => {
13475                    dec.read_repeated_into(
13476                        &mut self.uninterpreted_option,
13477                        |__d| {
13478                            let mut __m = ::core::default::Default::default();
13479                            __d.merge_message(&mut __m)?;
13480                            ::core::result::Result::Ok(__m)
13481                        },
13482                    )?
13483                }
13484                __name if __name.starts_with('[') => {
13485                    for __r in dec
13486                        .read_extension(__name, "google.protobuf.EnumValueOptions")?
13487                    {
13488                        self.__buffa_unknown_fields.push(__r);
13489                    }
13490                }
13491                _ => dec.skip_value()?,
13492            }
13493        }
13494        ::core::result::Result::Ok(())
13495    }
13496}
13497#[cfg(feature = "json")]
13498impl<'de> ::serde::Deserialize<'de> for EnumValueOptions {
13499    fn deserialize<D: ::serde::Deserializer<'de>>(
13500        d: D,
13501    ) -> ::core::result::Result<Self, D::Error> {
13502        struct _V;
13503        impl<'de> ::serde::de::Visitor<'de> for _V {
13504            type Value = EnumValueOptions;
13505            fn expecting(
13506                &self,
13507                f: &mut ::core::fmt::Formatter<'_>,
13508            ) -> ::core::fmt::Result {
13509                f.write_str("struct EnumValueOptions")
13510            }
13511            #[allow(clippy::field_reassign_with_default)]
13512            fn visit_map<A: ::serde::de::MapAccess<'de>>(
13513                self,
13514                mut map: A,
13515            ) -> ::core::result::Result<EnumValueOptions, A::Error> {
13516                let mut __f_deprecated: ::core::option::Option<
13517                    ::core::option::Option<bool>,
13518                > = None;
13519                let mut __f_features: ::core::option::Option<
13520                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13521                > = None;
13522                let mut __f_debug_redact: ::core::option::Option<
13523                    ::core::option::Option<bool>,
13524                > = None;
13525                let mut __f_feature_support: ::core::option::Option<
13526                    ::buffa::MessageField<
13527                        field_options::FeatureSupport,
13528                        ::buffa::Inline<field_options::FeatureSupport>,
13529                    >,
13530                > = None;
13531                let mut __f_uninterpreted_option: ::core::option::Option<
13532                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13533                > = None;
13534                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13535                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13536                    match key.as_str() {
13537                        "deprecated" => {
13538                            __f_deprecated = Some(
13539                                map.next_value::<::core::option::Option<bool>>()?,
13540                            );
13541                        }
13542                        "features" => {
13543                            __f_features = Some(
13544                                map
13545                                    .next_value::<
13546                                        ::buffa::MessageField<
13547                                            FeatureSet,
13548                                            ::buffa::Inline<FeatureSet>,
13549                                        >,
13550                                    >()?,
13551                            );
13552                        }
13553                        "debugRedact" | "debug_redact" => {
13554                            __f_debug_redact = Some(
13555                                map.next_value::<::core::option::Option<bool>>()?,
13556                            );
13557                        }
13558                        "featureSupport" | "feature_support" => {
13559                            __f_feature_support = Some(
13560                                map
13561                                    .next_value::<
13562                                        ::buffa::MessageField<
13563                                            field_options::FeatureSupport,
13564                                            ::buffa::Inline<field_options::FeatureSupport>,
13565                                        >,
13566                                    >()?,
13567                            );
13568                        }
13569                        "uninterpretedOption" | "uninterpreted_option" => {
13570                            __f_uninterpreted_option = Some({
13571                                struct _S;
13572                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
13573                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
13574                                    fn deserialize<D: ::serde::Deserializer<'de>>(
13575                                        self,
13576                                        d: D,
13577                                    ) -> ::core::result::Result<
13578                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
13579                                        D::Error,
13580                                    > {
13581                                        ::buffa::json_helpers::null_as_default(d)
13582                                    }
13583                                }
13584                                map.next_value_seed(_S)?
13585                            });
13586                        }
13587                        __k if __k.starts_with('[') => {
13588                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13589                            match ::buffa::extension_registry::deserialize_extension_key(
13590                                "google.protobuf.EnumValueOptions",
13591                                __k,
13592                                __v,
13593                            ) {
13594                                ::core::option::Option::Some(
13595                                    ::core::result::Result::Ok(__recs),
13596                                ) => {
13597                                    for __rec in __recs {
13598                                        __ext_records.push(__rec);
13599                                    }
13600                                }
13601                                ::core::option::Option::Some(
13602                                    ::core::result::Result::Err(__e),
13603                                ) => {
13604                                    return ::core::result::Result::Err(
13605                                        <A::Error as ::serde::de::Error>::custom(__e),
13606                                    );
13607                                }
13608                                ::core::option::Option::None => {}
13609                            }
13610                        }
13611                        _ => {
13612                            map.next_value::<::serde::de::IgnoredAny>()?;
13613                        }
13614                    }
13615                }
13616                let mut __r = <EnumValueOptions as ::core::default::Default>::default();
13617                if let ::core::option::Option::Some(v) = __f_deprecated {
13618                    __r.deprecated = v;
13619                }
13620                if let ::core::option::Option::Some(v) = __f_features {
13621                    __r.features = v;
13622                }
13623                if let ::core::option::Option::Some(v) = __f_debug_redact {
13624                    __r.debug_redact = v;
13625                }
13626                if let ::core::option::Option::Some(v) = __f_feature_support {
13627                    __r.feature_support = v;
13628                }
13629                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13630                    __r.uninterpreted_option = v;
13631                }
13632                for __rec in __ext_records {
13633                    __r.__buffa_unknown_fields.push(__rec);
13634                }
13635                Ok(__r)
13636            }
13637        }
13638        d.deserialize_map(_V)
13639    }
13640}
13641#[cfg(feature = "json")]
13642impl ::buffa::json_helpers::ProtoElemJson for EnumValueOptions {
13643    fn serialize_proto_json<S: ::serde::Serializer>(
13644        v: &Self,
13645        s: S,
13646    ) -> ::core::result::Result<S::Ok, S::Error> {
13647        ::serde::Serialize::serialize(v, s)
13648    }
13649    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13650        d: D,
13651    ) -> ::core::result::Result<Self, D::Error> {
13652        <Self as ::serde::Deserialize>::deserialize(d)
13653    }
13654}
13655#[doc(hidden)]
13656#[derive(Clone, Debug, Default, PartialEq)]
13657#[repr(transparent)]
13658#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13659pub struct __EnumValueOptionsExtJson(pub ::buffa::UnknownFields);
13660impl ::core::ops::Deref for __EnumValueOptionsExtJson {
13661    type Target = ::buffa::UnknownFields;
13662    fn deref(&self) -> &::buffa::UnknownFields {
13663        &self.0
13664    }
13665}
13666impl ::core::ops::DerefMut for __EnumValueOptionsExtJson {
13667    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13668        &mut self.0
13669    }
13670}
13671impl ::core::convert::From<::buffa::UnknownFields> for __EnumValueOptionsExtJson {
13672    fn from(u: ::buffa::UnknownFields) -> Self {
13673        Self(u)
13674    }
13675}
13676#[cfg(feature = "json")]
13677impl ::serde::Serialize for __EnumValueOptionsExtJson {
13678    fn serialize<S: ::serde::Serializer>(
13679        &self,
13680        s: S,
13681    ) -> ::core::result::Result<S::Ok, S::Error> {
13682        ::buffa::extension_registry::serialize_extensions(
13683            "google.protobuf.EnumValueOptions",
13684            &self.0,
13685            s,
13686        )
13687    }
13688}
13689#[cfg(feature = "json")]
13690impl<'de> ::serde::Deserialize<'de> for __EnumValueOptionsExtJson {
13691    fn deserialize<D: ::serde::Deserializer<'de>>(
13692        d: D,
13693    ) -> ::core::result::Result<Self, D::Error> {
13694        ::buffa::extension_registry::deserialize_extensions(
13695                "google.protobuf.EnumValueOptions",
13696                d,
13697            )
13698            .map(Self)
13699    }
13700}
13701#[cfg(feature = "json")]
13702#[doc(hidden)]
13703pub const __ENUM_VALUE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13704    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13705    to_json: ::buffa::type_registry::any_to_json::<EnumValueOptions>,
13706    from_json: ::buffa::type_registry::any_from_json::<EnumValueOptions>,
13707    is_wkt: false,
13708};
13709#[cfg(feature = "text")]
13710#[doc(hidden)]
13711pub const __ENUM_VALUE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13712    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13713    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueOptions>,
13714    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueOptions>,
13715};
13716#[derive(Clone, PartialEq, Default)]
13717#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13718#[cfg_attr(feature = "json", serde(default))]
13719#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13720pub struct ServiceOptions {
13721    /// Any features defined in the specific edition.
13722    /// WARNING: This field should only be used by protobuf plugins or special
13723    /// cases like the proto compiler. Other uses are discouraged and
13724    /// developers should rely on the protoreflect APIs for their client language.
13725    ///
13726    /// Field 34: `features`
13727    #[cfg_attr(
13728        feature = "json",
13729        serde(
13730            rename = "features",
13731            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13732        )
13733    )]
13734    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13735    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
13736    ///   framework.  We apologize for hoarding these numbers to ourselves, but
13737    ///   we were already using them long before we decided to release Protocol
13738    ///   Buffers.
13739    ///
13740    /// Is this service deprecated?
13741    /// Depending on the target platform, this can emit Deprecated annotations
13742    /// for the service, or it will be completely ignored; in the very least,
13743    /// this is a formalization for deprecating services.
13744    ///
13745    /// Field 33: `deprecated`
13746    #[cfg_attr(
13747        feature = "json",
13748        serde(
13749            rename = "deprecated",
13750            skip_serializing_if = "::core::option::Option::is_none"
13751        )
13752    )]
13753    pub deprecated: ::core::option::Option<bool>,
13754    /// The parser stores options it doesn't recognize here. See above.
13755    ///
13756    /// Field 999: `uninterpreted_option`
13757    #[cfg_attr(
13758        feature = "json",
13759        serde(
13760            rename = "uninterpretedOption",
13761            alias = "uninterpreted_option",
13762            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13763            deserialize_with = "::buffa::json_helpers::null_as_default"
13764        )
13765    )]
13766    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13767    #[cfg_attr(feature = "json", serde(flatten))]
13768    #[doc(hidden)]
13769    pub __buffa_unknown_fields: __ServiceOptionsExtJson,
13770}
13771impl ::core::fmt::Debug for ServiceOptions {
13772    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13773        f.debug_struct("ServiceOptions")
13774            .field("features", &self.features)
13775            .field("deprecated", &self.deprecated)
13776            .field("uninterpreted_option", &self.uninterpreted_option)
13777            .finish()
13778    }
13779}
13780impl ServiceOptions {
13781    /// Protobuf type URL for this message, for use with `Any::pack` and
13782    /// `Any::unpack_if`.
13783    ///
13784    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13785    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13786}
13787impl ServiceOptions {
13788    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13789    #[inline]
13790    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13791    pub fn with_deprecated(mut self, value: bool) -> Self {
13792        self.deprecated = Some(value);
13793        self
13794    }
13795}
13796::buffa::impl_default_instance!(ServiceOptions);
13797impl ::buffa::MessageName for ServiceOptions {
13798    const PACKAGE: &'static str = "google.protobuf";
13799    const NAME: &'static str = "ServiceOptions";
13800    const FULL_NAME: &'static str = "google.protobuf.ServiceOptions";
13801    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13802}
13803impl ::buffa::Message for ServiceOptions {
13804    /// Returns the total encoded size in bytes.
13805    ///
13806    /// Accumulates in `u64` (which cannot overflow for in-memory
13807    /// data) and saturates to `u32` at return, so a message whose
13808    /// encoded size exceeds the 2 GiB protobuf limit yields a value
13809    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
13810    /// points reject, never a silently wrapped size.
13811    #[allow(clippy::let_and_return)]
13812    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13813        #[allow(unused_imports)]
13814        use ::buffa::Enumeration as _;
13815        let mut size = 0u64;
13816        if self.deprecated.is_some() {
13817            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13818        }
13819        if self.features.is_set() {
13820            let __slot = __cache.reserve();
13821            let inner_size = self.features.compute_size(__cache);
13822            __cache.set(__slot, inner_size);
13823            size
13824                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13825                    + inner_size as u64;
13826        }
13827        for v in &self.uninterpreted_option {
13828            let __slot = __cache.reserve();
13829            let inner_size = v.compute_size(__cache);
13830            __cache.set(__slot, inner_size);
13831            size
13832                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13833                    + inner_size as u64;
13834        }
13835        size += self.__buffa_unknown_fields.encoded_len() as u64;
13836        ::buffa::saturate_size(size)
13837    }
13838    fn write_to(
13839        &self,
13840        __cache: &mut ::buffa::SizeCache,
13841        buf: &mut impl ::buffa::EncodeSink,
13842    ) {
13843        #[allow(unused_imports)]
13844        use ::buffa::Enumeration as _;
13845        if let Some(v) = self.deprecated {
13846            ::buffa::types::put_bool_field(33u32, v, buf);
13847        }
13848        if self.features.is_set() {
13849            ::buffa::types::put_len_delimited_header(
13850                34u32,
13851                u64::from(__cache.consume_next()),
13852                buf,
13853            );
13854            self.features.write_to(__cache, buf);
13855        }
13856        for v in &self.uninterpreted_option {
13857            ::buffa::types::put_len_delimited_header(
13858                999u32,
13859                u64::from(__cache.consume_next()),
13860                buf,
13861            );
13862            v.write_to(__cache, buf);
13863        }
13864        self.__buffa_unknown_fields.write_to(buf);
13865    }
13866    fn merge_field(
13867        &mut self,
13868        tag: ::buffa::encoding::Tag,
13869        buf: &mut impl ::buffa::bytes::Buf,
13870        ctx: ::buffa::DecodeContext<'_>,
13871    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13872        #[allow(unused_imports)]
13873        use ::buffa::bytes::Buf as _;
13874        #[allow(unused_imports)]
13875        use ::buffa::Enumeration as _;
13876        match tag.field_number() {
13877            33u32 => {
13878                ::buffa::encoding::check_wire_type(
13879                    tag,
13880                    ::buffa::encoding::WireType::Varint,
13881                )?;
13882                self.deprecated = ::core::option::Option::Some(
13883                    ::buffa::types::decode_bool(buf)?,
13884                );
13885            }
13886            34u32 => {
13887                ::buffa::encoding::check_wire_type(
13888                    tag,
13889                    ::buffa::encoding::WireType::LengthDelimited,
13890                )?;
13891                ::buffa::Message::merge_length_delimited(
13892                    self.features.get_or_insert_default(),
13893                    buf,
13894                    ctx,
13895                )?;
13896            }
13897            999u32 => {
13898                ::buffa::encoding::check_wire_type(
13899                    tag,
13900                    ::buffa::encoding::WireType::LengthDelimited,
13901                )?;
13902                let mut elem = ::core::default::Default::default();
13903                ctx.register_element_memory(
13904                    ::buffa::__private::element_footprint(&elem),
13905                )?;
13906                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13907                self.uninterpreted_option.push(elem);
13908            }
13909            _ => {
13910                self.__buffa_unknown_fields
13911                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13912            }
13913        }
13914        ::core::result::Result::Ok(())
13915    }
13916    fn clear(&mut self) {
13917        self.deprecated = ::core::option::Option::None;
13918        self.features = ::buffa::MessageField::none();
13919        self.uninterpreted_option.clear();
13920        self.__buffa_unknown_fields.clear();
13921    }
13922}
13923impl ::buffa::ExtensionSet for ServiceOptions {
13924    const PROTO_FQN: &'static str = "google.protobuf.ServiceOptions";
13925    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13926        &self.__buffa_unknown_fields
13927    }
13928    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13929        &mut self.__buffa_unknown_fields
13930    }
13931}
13932#[cfg(feature = "text")]
13933impl ::buffa::text::TextFormat for ServiceOptions {
13934    fn encode_text(
13935        &self,
13936        enc: &mut ::buffa::text::TextEncoder<'_>,
13937    ) -> ::core::fmt::Result {
13938        #[allow(unused_imports)]
13939        use ::buffa::Enumeration as _;
13940        if self.features.is_set() {
13941            enc.write_field_name("features")?;
13942            enc.write_message(&*self.features)?;
13943        }
13944        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13945            enc.write_field_name("deprecated")?;
13946            enc.write_bool(*__v)?;
13947        }
13948        for __v in &self.uninterpreted_option {
13949            enc.write_field_name("uninterpreted_option")?;
13950            enc.write_message(__v)?;
13951        }
13952        enc.write_extension_fields(
13953            "google.protobuf.ServiceOptions",
13954            &self.__buffa_unknown_fields,
13955        )?;
13956        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13957        ::core::result::Result::Ok(())
13958    }
13959    fn merge_text(
13960        &mut self,
13961        dec: &mut ::buffa::text::TextDecoder<'_>,
13962    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13963        #[allow(unused_imports)]
13964        use ::buffa::Enumeration as _;
13965        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13966            match __name {
13967                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13968                "deprecated" => {
13969                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13970                }
13971                "uninterpreted_option" => {
13972                    dec.read_repeated_into(
13973                        &mut self.uninterpreted_option,
13974                        |__d| {
13975                            let mut __m = ::core::default::Default::default();
13976                            __d.merge_message(&mut __m)?;
13977                            ::core::result::Result::Ok(__m)
13978                        },
13979                    )?
13980                }
13981                __name if __name.starts_with('[') => {
13982                    for __r in dec
13983                        .read_extension(__name, "google.protobuf.ServiceOptions")?
13984                    {
13985                        self.__buffa_unknown_fields.push(__r);
13986                    }
13987                }
13988                _ => dec.skip_value()?,
13989            }
13990        }
13991        ::core::result::Result::Ok(())
13992    }
13993}
13994#[cfg(feature = "json")]
13995impl<'de> ::serde::Deserialize<'de> for ServiceOptions {
13996    fn deserialize<D: ::serde::Deserializer<'de>>(
13997        d: D,
13998    ) -> ::core::result::Result<Self, D::Error> {
13999        struct _V;
14000        impl<'de> ::serde::de::Visitor<'de> for _V {
14001            type Value = ServiceOptions;
14002            fn expecting(
14003                &self,
14004                f: &mut ::core::fmt::Formatter<'_>,
14005            ) -> ::core::fmt::Result {
14006                f.write_str("struct ServiceOptions")
14007            }
14008            #[allow(clippy::field_reassign_with_default)]
14009            fn visit_map<A: ::serde::de::MapAccess<'de>>(
14010                self,
14011                mut map: A,
14012            ) -> ::core::result::Result<ServiceOptions, A::Error> {
14013                let mut __f_features: ::core::option::Option<
14014                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
14015                > = None;
14016                let mut __f_deprecated: ::core::option::Option<
14017                    ::core::option::Option<bool>,
14018                > = None;
14019                let mut __f_uninterpreted_option: ::core::option::Option<
14020                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14021                > = None;
14022                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14023                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14024                    match key.as_str() {
14025                        "features" => {
14026                            __f_features = Some(
14027                                map
14028                                    .next_value::<
14029                                        ::buffa::MessageField<
14030                                            FeatureSet,
14031                                            ::buffa::Inline<FeatureSet>,
14032                                        >,
14033                                    >()?,
14034                            );
14035                        }
14036                        "deprecated" => {
14037                            __f_deprecated = Some(
14038                                map.next_value::<::core::option::Option<bool>>()?,
14039                            );
14040                        }
14041                        "uninterpretedOption" | "uninterpreted_option" => {
14042                            __f_uninterpreted_option = Some({
14043                                struct _S;
14044                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
14045                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14046                                    fn deserialize<D: ::serde::Deserializer<'de>>(
14047                                        self,
14048                                        d: D,
14049                                    ) -> ::core::result::Result<
14050                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14051                                        D::Error,
14052                                    > {
14053                                        ::buffa::json_helpers::null_as_default(d)
14054                                    }
14055                                }
14056                                map.next_value_seed(_S)?
14057                            });
14058                        }
14059                        __k if __k.starts_with('[') => {
14060                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14061                            match ::buffa::extension_registry::deserialize_extension_key(
14062                                "google.protobuf.ServiceOptions",
14063                                __k,
14064                                __v,
14065                            ) {
14066                                ::core::option::Option::Some(
14067                                    ::core::result::Result::Ok(__recs),
14068                                ) => {
14069                                    for __rec in __recs {
14070                                        __ext_records.push(__rec);
14071                                    }
14072                                }
14073                                ::core::option::Option::Some(
14074                                    ::core::result::Result::Err(__e),
14075                                ) => {
14076                                    return ::core::result::Result::Err(
14077                                        <A::Error as ::serde::de::Error>::custom(__e),
14078                                    );
14079                                }
14080                                ::core::option::Option::None => {}
14081                            }
14082                        }
14083                        _ => {
14084                            map.next_value::<::serde::de::IgnoredAny>()?;
14085                        }
14086                    }
14087                }
14088                let mut __r = <ServiceOptions as ::core::default::Default>::default();
14089                if let ::core::option::Option::Some(v) = __f_features {
14090                    __r.features = v;
14091                }
14092                if let ::core::option::Option::Some(v) = __f_deprecated {
14093                    __r.deprecated = v;
14094                }
14095                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14096                    __r.uninterpreted_option = v;
14097                }
14098                for __rec in __ext_records {
14099                    __r.__buffa_unknown_fields.push(__rec);
14100                }
14101                Ok(__r)
14102            }
14103        }
14104        d.deserialize_map(_V)
14105    }
14106}
14107#[cfg(feature = "json")]
14108impl ::buffa::json_helpers::ProtoElemJson for ServiceOptions {
14109    fn serialize_proto_json<S: ::serde::Serializer>(
14110        v: &Self,
14111        s: S,
14112    ) -> ::core::result::Result<S::Ok, S::Error> {
14113        ::serde::Serialize::serialize(v, s)
14114    }
14115    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14116        d: D,
14117    ) -> ::core::result::Result<Self, D::Error> {
14118        <Self as ::serde::Deserialize>::deserialize(d)
14119    }
14120}
14121#[doc(hidden)]
14122#[derive(Clone, Debug, Default, PartialEq)]
14123#[repr(transparent)]
14124#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14125pub struct __ServiceOptionsExtJson(pub ::buffa::UnknownFields);
14126impl ::core::ops::Deref for __ServiceOptionsExtJson {
14127    type Target = ::buffa::UnknownFields;
14128    fn deref(&self) -> &::buffa::UnknownFields {
14129        &self.0
14130    }
14131}
14132impl ::core::ops::DerefMut for __ServiceOptionsExtJson {
14133    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14134        &mut self.0
14135    }
14136}
14137impl ::core::convert::From<::buffa::UnknownFields> for __ServiceOptionsExtJson {
14138    fn from(u: ::buffa::UnknownFields) -> Self {
14139        Self(u)
14140    }
14141}
14142#[cfg(feature = "json")]
14143impl ::serde::Serialize for __ServiceOptionsExtJson {
14144    fn serialize<S: ::serde::Serializer>(
14145        &self,
14146        s: S,
14147    ) -> ::core::result::Result<S::Ok, S::Error> {
14148        ::buffa::extension_registry::serialize_extensions(
14149            "google.protobuf.ServiceOptions",
14150            &self.0,
14151            s,
14152        )
14153    }
14154}
14155#[cfg(feature = "json")]
14156impl<'de> ::serde::Deserialize<'de> for __ServiceOptionsExtJson {
14157    fn deserialize<D: ::serde::Deserializer<'de>>(
14158        d: D,
14159    ) -> ::core::result::Result<Self, D::Error> {
14160        ::buffa::extension_registry::deserialize_extensions(
14161                "google.protobuf.ServiceOptions",
14162                d,
14163            )
14164            .map(Self)
14165    }
14166}
14167#[cfg(feature = "json")]
14168#[doc(hidden)]
14169pub const __SERVICE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14170    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14171    to_json: ::buffa::type_registry::any_to_json::<ServiceOptions>,
14172    from_json: ::buffa::type_registry::any_from_json::<ServiceOptions>,
14173    is_wkt: false,
14174};
14175#[cfg(feature = "text")]
14176#[doc(hidden)]
14177pub const __SERVICE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14178    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14179    text_encode: ::buffa::type_registry::any_encode_text::<ServiceOptions>,
14180    text_merge: ::buffa::type_registry::any_merge_text::<ServiceOptions>,
14181};
14182#[derive(Clone, PartialEq, Default)]
14183#[cfg_attr(feature = "json", derive(::serde::Serialize))]
14184#[cfg_attr(feature = "json", serde(default))]
14185#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14186pub struct MethodOptions {
14187    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
14188    ///   framework.  We apologize for hoarding these numbers to ourselves, but
14189    ///   we were already using them long before we decided to release Protocol
14190    ///   Buffers.
14191    ///
14192    /// Is this method deprecated?
14193    /// Depending on the target platform, this can emit Deprecated annotations
14194    /// for the method, or it will be completely ignored; in the very least,
14195    /// this is a formalization for deprecating methods.
14196    ///
14197    /// Field 33: `deprecated`
14198    #[cfg_attr(
14199        feature = "json",
14200        serde(
14201            rename = "deprecated",
14202            skip_serializing_if = "::core::option::Option::is_none"
14203        )
14204    )]
14205    pub deprecated: ::core::option::Option<bool>,
14206    /// Field 34: `idempotency_level`
14207    #[cfg_attr(
14208        feature = "json",
14209        serde(
14210            rename = "idempotencyLevel",
14211            alias = "idempotency_level",
14212            with = "::buffa::json_helpers::opt_closed_enum",
14213            skip_serializing_if = "::core::option::Option::is_none"
14214        )
14215    )]
14216    pub idempotency_level: ::core::option::Option<method_options::IdempotencyLevel>,
14217    /// Any features defined in the specific edition.
14218    /// WARNING: This field should only be used by protobuf plugins or special
14219    /// cases like the proto compiler. Other uses are discouraged and
14220    /// developers should rely on the protoreflect APIs for their client language.
14221    ///
14222    /// Field 35: `features`
14223    #[cfg_attr(
14224        feature = "json",
14225        serde(
14226            rename = "features",
14227            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
14228        )
14229    )]
14230    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
14231    /// The parser stores options it doesn't recognize here. See above.
14232    ///
14233    /// Field 999: `uninterpreted_option`
14234    #[cfg_attr(
14235        feature = "json",
14236        serde(
14237            rename = "uninterpretedOption",
14238            alias = "uninterpreted_option",
14239            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14240            deserialize_with = "::buffa::json_helpers::null_as_default"
14241        )
14242    )]
14243    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
14244    #[cfg_attr(feature = "json", serde(flatten))]
14245    #[doc(hidden)]
14246    pub __buffa_unknown_fields: __MethodOptionsExtJson,
14247}
14248impl ::core::fmt::Debug for MethodOptions {
14249    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14250        f.debug_struct("MethodOptions")
14251            .field("deprecated", &self.deprecated)
14252            .field("idempotency_level", &self.idempotency_level)
14253            .field("features", &self.features)
14254            .field("uninterpreted_option", &self.uninterpreted_option)
14255            .finish()
14256    }
14257}
14258impl MethodOptions {
14259    /// Protobuf type URL for this message, for use with `Any::pack` and
14260    /// `Any::unpack_if`.
14261    ///
14262    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14263    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14264}
14265impl MethodOptions {
14266    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14267    #[inline]
14268    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
14269    pub fn with_deprecated(mut self, value: bool) -> Self {
14270        self.deprecated = Some(value);
14271        self
14272    }
14273    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14274    #[inline]
14275    ///Sets [`Self::idempotency_level`] to `Some(value)`, consuming and returning `self`.
14276    pub fn with_idempotency_level(
14277        mut self,
14278        value: impl Into<method_options::IdempotencyLevel>,
14279    ) -> Self {
14280        self.idempotency_level = Some(value.into());
14281        self
14282    }
14283}
14284::buffa::impl_default_instance!(MethodOptions);
14285impl ::buffa::MessageName for MethodOptions {
14286    const PACKAGE: &'static str = "google.protobuf";
14287    const NAME: &'static str = "MethodOptions";
14288    const FULL_NAME: &'static str = "google.protobuf.MethodOptions";
14289    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14290}
14291impl ::buffa::Message for MethodOptions {
14292    /// Returns the total encoded size in bytes.
14293    ///
14294    /// Accumulates in `u64` (which cannot overflow for in-memory
14295    /// data) and saturates to `u32` at return, so a message whose
14296    /// encoded size exceeds the 2 GiB protobuf limit yields a value
14297    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
14298    /// points reject, never a silently wrapped size.
14299    #[allow(clippy::let_and_return)]
14300    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14301        #[allow(unused_imports)]
14302        use ::buffa::Enumeration as _;
14303        let mut size = 0u64;
14304        if self.deprecated.is_some() {
14305            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
14306        }
14307        if let Some(ref v) = self.idempotency_level {
14308            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
14309        }
14310        if self.features.is_set() {
14311            let __slot = __cache.reserve();
14312            let inner_size = self.features.compute_size(__cache);
14313            __cache.set(__slot, inner_size);
14314            size
14315                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
14316                    + inner_size as u64;
14317        }
14318        for v in &self.uninterpreted_option {
14319            let __slot = __cache.reserve();
14320            let inner_size = v.compute_size(__cache);
14321            __cache.set(__slot, inner_size);
14322            size
14323                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
14324                    + inner_size as u64;
14325        }
14326        size += self.__buffa_unknown_fields.encoded_len() as u64;
14327        ::buffa::saturate_size(size)
14328    }
14329    fn write_to(
14330        &self,
14331        __cache: &mut ::buffa::SizeCache,
14332        buf: &mut impl ::buffa::EncodeSink,
14333    ) {
14334        #[allow(unused_imports)]
14335        use ::buffa::Enumeration as _;
14336        if let Some(v) = self.deprecated {
14337            ::buffa::types::put_bool_field(33u32, v, buf);
14338        }
14339        if let Some(ref v) = self.idempotency_level {
14340            ::buffa::types::put_int32_field(34u32, v.to_i32(), buf);
14341        }
14342        if self.features.is_set() {
14343            ::buffa::types::put_len_delimited_header(
14344                35u32,
14345                u64::from(__cache.consume_next()),
14346                buf,
14347            );
14348            self.features.write_to(__cache, buf);
14349        }
14350        for v in &self.uninterpreted_option {
14351            ::buffa::types::put_len_delimited_header(
14352                999u32,
14353                u64::from(__cache.consume_next()),
14354                buf,
14355            );
14356            v.write_to(__cache, buf);
14357        }
14358        self.__buffa_unknown_fields.write_to(buf);
14359    }
14360    fn merge_field(
14361        &mut self,
14362        tag: ::buffa::encoding::Tag,
14363        buf: &mut impl ::buffa::bytes::Buf,
14364        ctx: ::buffa::DecodeContext<'_>,
14365    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14366        #[allow(unused_imports)]
14367        use ::buffa::bytes::Buf as _;
14368        #[allow(unused_imports)]
14369        use ::buffa::Enumeration as _;
14370        match tag.field_number() {
14371            33u32 => {
14372                ::buffa::encoding::check_wire_type(
14373                    tag,
14374                    ::buffa::encoding::WireType::Varint,
14375                )?;
14376                self.deprecated = ::core::option::Option::Some(
14377                    ::buffa::types::decode_bool(buf)?,
14378                );
14379            }
14380            34u32 => {
14381                ::buffa::encoding::check_wire_type(
14382                    tag,
14383                    ::buffa::encoding::WireType::Varint,
14384                )?;
14385                let __raw = ::buffa::types::decode_int32(buf)?;
14386                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
14387                    __raw,
14388                ) {
14389                    self.idempotency_level = ::core::option::Option::Some(__v);
14390                } else {
14391                    ctx.register_unknown_field()?;
14392                    self.__buffa_unknown_fields
14393                        .push(::buffa::UnknownField {
14394                            number: 34u32,
14395                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
14396                        });
14397                }
14398            }
14399            35u32 => {
14400                ::buffa::encoding::check_wire_type(
14401                    tag,
14402                    ::buffa::encoding::WireType::LengthDelimited,
14403                )?;
14404                ::buffa::Message::merge_length_delimited(
14405                    self.features.get_or_insert_default(),
14406                    buf,
14407                    ctx,
14408                )?;
14409            }
14410            999u32 => {
14411                ::buffa::encoding::check_wire_type(
14412                    tag,
14413                    ::buffa::encoding::WireType::LengthDelimited,
14414                )?;
14415                let mut elem = ::core::default::Default::default();
14416                ctx.register_element_memory(
14417                    ::buffa::__private::element_footprint(&elem),
14418                )?;
14419                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
14420                self.uninterpreted_option.push(elem);
14421            }
14422            _ => {
14423                self.__buffa_unknown_fields
14424                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
14425            }
14426        }
14427        ::core::result::Result::Ok(())
14428    }
14429    fn clear(&mut self) {
14430        self.deprecated = ::core::option::Option::None;
14431        self.idempotency_level = ::core::option::Option::None;
14432        self.features = ::buffa::MessageField::none();
14433        self.uninterpreted_option.clear();
14434        self.__buffa_unknown_fields.clear();
14435    }
14436}
14437impl ::buffa::ExtensionSet for MethodOptions {
14438    const PROTO_FQN: &'static str = "google.protobuf.MethodOptions";
14439    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14440        &self.__buffa_unknown_fields
14441    }
14442    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14443        &mut self.__buffa_unknown_fields
14444    }
14445}
14446#[cfg(feature = "text")]
14447impl ::buffa::text::TextFormat for MethodOptions {
14448    fn encode_text(
14449        &self,
14450        enc: &mut ::buffa::text::TextEncoder<'_>,
14451    ) -> ::core::fmt::Result {
14452        #[allow(unused_imports)]
14453        use ::buffa::Enumeration as _;
14454        if let ::core::option::Option::Some(ref __v) = self.deprecated {
14455            enc.write_field_name("deprecated")?;
14456            enc.write_bool(*__v)?;
14457        }
14458        if let ::core::option::Option::Some(ref __v) = self.idempotency_level {
14459            enc.write_field_name("idempotency_level")?;
14460            enc.write_enum_name(__v.proto_name())?;
14461        }
14462        if self.features.is_set() {
14463            enc.write_field_name("features")?;
14464            enc.write_message(&*self.features)?;
14465        }
14466        for __v in &self.uninterpreted_option {
14467            enc.write_field_name("uninterpreted_option")?;
14468            enc.write_message(__v)?;
14469        }
14470        enc.write_extension_fields(
14471            "google.protobuf.MethodOptions",
14472            &self.__buffa_unknown_fields,
14473        )?;
14474        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14475        ::core::result::Result::Ok(())
14476    }
14477    fn merge_text(
14478        &mut self,
14479        dec: &mut ::buffa::text::TextDecoder<'_>,
14480    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14481        #[allow(unused_imports)]
14482        use ::buffa::Enumeration as _;
14483        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14484            match __name {
14485                "deprecated" => {
14486                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
14487                }
14488                "idempotency_level" => {
14489                    self.idempotency_level = ::core::option::Option::Some(
14490                        dec
14491                            .read_closed_enum_by_name::<
14492                                method_options::IdempotencyLevel,
14493                            >()?,
14494                    );
14495                }
14496                "features" => dec.merge_message(self.features.get_or_insert_default())?,
14497                "uninterpreted_option" => {
14498                    dec.read_repeated_into(
14499                        &mut self.uninterpreted_option,
14500                        |__d| {
14501                            let mut __m = ::core::default::Default::default();
14502                            __d.merge_message(&mut __m)?;
14503                            ::core::result::Result::Ok(__m)
14504                        },
14505                    )?
14506                }
14507                __name if __name.starts_with('[') => {
14508                    for __r in dec
14509                        .read_extension(__name, "google.protobuf.MethodOptions")?
14510                    {
14511                        self.__buffa_unknown_fields.push(__r);
14512                    }
14513                }
14514                _ => dec.skip_value()?,
14515            }
14516        }
14517        ::core::result::Result::Ok(())
14518    }
14519}
14520#[cfg(feature = "json")]
14521impl<'de> ::serde::Deserialize<'de> for MethodOptions {
14522    fn deserialize<D: ::serde::Deserializer<'de>>(
14523        d: D,
14524    ) -> ::core::result::Result<Self, D::Error> {
14525        struct _V;
14526        impl<'de> ::serde::de::Visitor<'de> for _V {
14527            type Value = MethodOptions;
14528            fn expecting(
14529                &self,
14530                f: &mut ::core::fmt::Formatter<'_>,
14531            ) -> ::core::fmt::Result {
14532                f.write_str("struct MethodOptions")
14533            }
14534            #[allow(clippy::field_reassign_with_default)]
14535            fn visit_map<A: ::serde::de::MapAccess<'de>>(
14536                self,
14537                mut map: A,
14538            ) -> ::core::result::Result<MethodOptions, A::Error> {
14539                let mut __f_deprecated: ::core::option::Option<
14540                    ::core::option::Option<bool>,
14541                > = None;
14542                let mut __f_idempotency_level: ::core::option::Option<
14543                    ::core::option::Option<method_options::IdempotencyLevel>,
14544                > = None;
14545                let mut __f_features: ::core::option::Option<
14546                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
14547                > = None;
14548                let mut __f_uninterpreted_option: ::core::option::Option<
14549                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14550                > = None;
14551                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14552                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14553                    match key.as_str() {
14554                        "deprecated" => {
14555                            __f_deprecated = Some(
14556                                map.next_value::<::core::option::Option<bool>>()?,
14557                            );
14558                        }
14559                        "idempotencyLevel" | "idempotency_level" => {
14560                            __f_idempotency_level = Some({
14561                                struct _S;
14562                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
14563                                    type Value = ::core::option::Option<
14564                                        method_options::IdempotencyLevel,
14565                                    >;
14566                                    fn deserialize<D: ::serde::Deserializer<'de>>(
14567                                        self,
14568                                        d: D,
14569                                    ) -> ::core::result::Result<
14570                                        ::core::option::Option<method_options::IdempotencyLevel>,
14571                                        D::Error,
14572                                    > {
14573                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
14574                                    }
14575                                }
14576                                map.next_value_seed(_S)?
14577                            });
14578                        }
14579                        "features" => {
14580                            __f_features = Some(
14581                                map
14582                                    .next_value::<
14583                                        ::buffa::MessageField<
14584                                            FeatureSet,
14585                                            ::buffa::Inline<FeatureSet>,
14586                                        >,
14587                                    >()?,
14588                            );
14589                        }
14590                        "uninterpretedOption" | "uninterpreted_option" => {
14591                            __f_uninterpreted_option = Some({
14592                                struct _S;
14593                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
14594                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14595                                    fn deserialize<D: ::serde::Deserializer<'de>>(
14596                                        self,
14597                                        d: D,
14598                                    ) -> ::core::result::Result<
14599                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14600                                        D::Error,
14601                                    > {
14602                                        ::buffa::json_helpers::null_as_default(d)
14603                                    }
14604                                }
14605                                map.next_value_seed(_S)?
14606                            });
14607                        }
14608                        __k if __k.starts_with('[') => {
14609                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14610                            match ::buffa::extension_registry::deserialize_extension_key(
14611                                "google.protobuf.MethodOptions",
14612                                __k,
14613                                __v,
14614                            ) {
14615                                ::core::option::Option::Some(
14616                                    ::core::result::Result::Ok(__recs),
14617                                ) => {
14618                                    for __rec in __recs {
14619                                        __ext_records.push(__rec);
14620                                    }
14621                                }
14622                                ::core::option::Option::Some(
14623                                    ::core::result::Result::Err(__e),
14624                                ) => {
14625                                    return ::core::result::Result::Err(
14626                                        <A::Error as ::serde::de::Error>::custom(__e),
14627                                    );
14628                                }
14629                                ::core::option::Option::None => {}
14630                            }
14631                        }
14632                        _ => {
14633                            map.next_value::<::serde::de::IgnoredAny>()?;
14634                        }
14635                    }
14636                }
14637                let mut __r = <MethodOptions as ::core::default::Default>::default();
14638                if let ::core::option::Option::Some(v) = __f_deprecated {
14639                    __r.deprecated = v;
14640                }
14641                if let ::core::option::Option::Some(v) = __f_idempotency_level {
14642                    __r.idempotency_level = v;
14643                }
14644                if let ::core::option::Option::Some(v) = __f_features {
14645                    __r.features = v;
14646                }
14647                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14648                    __r.uninterpreted_option = v;
14649                }
14650                for __rec in __ext_records {
14651                    __r.__buffa_unknown_fields.push(__rec);
14652                }
14653                Ok(__r)
14654            }
14655        }
14656        d.deserialize_map(_V)
14657    }
14658}
14659#[cfg(feature = "json")]
14660impl ::buffa::json_helpers::ProtoElemJson for MethodOptions {
14661    fn serialize_proto_json<S: ::serde::Serializer>(
14662        v: &Self,
14663        s: S,
14664    ) -> ::core::result::Result<S::Ok, S::Error> {
14665        ::serde::Serialize::serialize(v, s)
14666    }
14667    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14668        d: D,
14669    ) -> ::core::result::Result<Self, D::Error> {
14670        <Self as ::serde::Deserialize>::deserialize(d)
14671    }
14672}
14673#[doc(hidden)]
14674#[derive(Clone, Debug, Default, PartialEq)]
14675#[repr(transparent)]
14676#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14677pub struct __MethodOptionsExtJson(pub ::buffa::UnknownFields);
14678impl ::core::ops::Deref for __MethodOptionsExtJson {
14679    type Target = ::buffa::UnknownFields;
14680    fn deref(&self) -> &::buffa::UnknownFields {
14681        &self.0
14682    }
14683}
14684impl ::core::ops::DerefMut for __MethodOptionsExtJson {
14685    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14686        &mut self.0
14687    }
14688}
14689impl ::core::convert::From<::buffa::UnknownFields> for __MethodOptionsExtJson {
14690    fn from(u: ::buffa::UnknownFields) -> Self {
14691        Self(u)
14692    }
14693}
14694#[cfg(feature = "json")]
14695impl ::serde::Serialize for __MethodOptionsExtJson {
14696    fn serialize<S: ::serde::Serializer>(
14697        &self,
14698        s: S,
14699    ) -> ::core::result::Result<S::Ok, S::Error> {
14700        ::buffa::extension_registry::serialize_extensions(
14701            "google.protobuf.MethodOptions",
14702            &self.0,
14703            s,
14704        )
14705    }
14706}
14707#[cfg(feature = "json")]
14708impl<'de> ::serde::Deserialize<'de> for __MethodOptionsExtJson {
14709    fn deserialize<D: ::serde::Deserializer<'de>>(
14710        d: D,
14711    ) -> ::core::result::Result<Self, D::Error> {
14712        ::buffa::extension_registry::deserialize_extensions(
14713                "google.protobuf.MethodOptions",
14714                d,
14715            )
14716            .map(Self)
14717    }
14718}
14719#[cfg(feature = "json")]
14720#[doc(hidden)]
14721pub const __METHOD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14722    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14723    to_json: ::buffa::type_registry::any_to_json::<MethodOptions>,
14724    from_json: ::buffa::type_registry::any_from_json::<MethodOptions>,
14725    is_wkt: false,
14726};
14727#[cfg(feature = "text")]
14728#[doc(hidden)]
14729pub const __METHOD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14730    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14731    text_encode: ::buffa::type_registry::any_encode_text::<MethodOptions>,
14732    text_merge: ::buffa::type_registry::any_merge_text::<MethodOptions>,
14733};
14734pub mod method_options {
14735    #[allow(unused_imports)]
14736    use super::*;
14737    /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
14738    /// or neither? HTTP based RPC implementation may choose GET verb for safe
14739    /// methods, and PUT verb for idempotent methods instead of the default POST.
14740    #[allow(non_camel_case_types)]
14741    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
14742    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14743    #[repr(i32)]
14744    pub enum IdempotencyLevel {
14745        IDEMPOTENCY_UNKNOWN = 0i32,
14746        /// implies idempotent
14747        NO_SIDE_EFFECTS = 1i32,
14748        /// idempotent, but may have side effects
14749        IDEMPOTENT = 2i32,
14750    }
14751    impl IdempotencyLevel {
14752        ///Idiomatic alias for [`Self::IDEMPOTENCY_UNKNOWN`]; `Debug` prints the variant name.
14753        #[allow(non_upper_case_globals)]
14754        pub const IdempotencyUnknown: Self = Self::IDEMPOTENCY_UNKNOWN;
14755        ///Idiomatic alias for [`Self::NO_SIDE_EFFECTS`]; `Debug` prints the variant name.
14756        #[allow(non_upper_case_globals)]
14757        pub const NoSideEffects: Self = Self::NO_SIDE_EFFECTS;
14758        ///Idiomatic alias for [`Self::IDEMPOTENT`]; `Debug` prints the variant name.
14759        #[allow(non_upper_case_globals)]
14760        pub const Idempotent: Self = Self::IDEMPOTENT;
14761    }
14762    impl ::core::default::Default for IdempotencyLevel {
14763        fn default() -> Self {
14764            Self::IDEMPOTENCY_UNKNOWN
14765        }
14766    }
14767    #[cfg(feature = "json")]
14768    const _: () = {
14769        impl ::serde::Serialize for IdempotencyLevel {
14770            fn serialize<S: ::serde::Serializer>(
14771                &self,
14772                s: S,
14773            ) -> ::core::result::Result<S::Ok, S::Error> {
14774                s.serialize_str(::buffa::Enumeration::proto_name(self))
14775            }
14776        }
14777        impl<'de> ::serde::Deserialize<'de> for IdempotencyLevel {
14778            fn deserialize<D: ::serde::Deserializer<'de>>(
14779                d: D,
14780            ) -> ::core::result::Result<Self, D::Error> {
14781                struct _V;
14782                impl ::serde::de::Visitor<'_> for _V {
14783                    type Value = IdempotencyLevel;
14784                    fn expecting(
14785                        &self,
14786                        f: &mut ::core::fmt::Formatter<'_>,
14787                    ) -> ::core::fmt::Result {
14788                        f.write_str(
14789                            concat!(
14790                                "a string, integer, or null for ",
14791                                stringify!(IdempotencyLevel)
14792                            ),
14793                        )
14794                    }
14795                    fn visit_str<E: ::serde::de::Error>(
14796                        self,
14797                        v: &str,
14798                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14799                        <IdempotencyLevel as ::buffa::Enumeration>::from_proto_name(v)
14800                            .ok_or_else(|| {
14801                                ::serde::de::Error::unknown_variant(v, &[])
14802                            })
14803                    }
14804                    fn visit_i64<E: ::serde::de::Error>(
14805                        self,
14806                        v: i64,
14807                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14808                        let v32 = i32::try_from(v)
14809                            .map_err(|_| {
14810                                ::serde::de::Error::custom(
14811                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14812                                )
14813                            })?;
14814                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14815                            .ok_or_else(|| {
14816                                ::serde::de::Error::custom(
14817                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14818                                )
14819                            })
14820                    }
14821                    fn visit_u64<E: ::serde::de::Error>(
14822                        self,
14823                        v: u64,
14824                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14825                        let v32 = i32::try_from(v)
14826                            .map_err(|_| {
14827                                ::serde::de::Error::custom(
14828                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14829                                )
14830                            })?;
14831                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14832                            .ok_or_else(|| {
14833                                ::serde::de::Error::custom(
14834                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14835                                )
14836                            })
14837                    }
14838                    fn visit_unit<E: ::serde::de::Error>(
14839                        self,
14840                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14841                        ::core::result::Result::Ok(::core::default::Default::default())
14842                    }
14843                }
14844                d.deserialize_any(_V)
14845            }
14846        }
14847        impl ::buffa::json_helpers::ProtoElemJson for IdempotencyLevel {
14848            fn serialize_proto_json<S: ::serde::Serializer>(
14849                v: &Self,
14850                s: S,
14851            ) -> ::core::result::Result<S::Ok, S::Error> {
14852                ::serde::Serialize::serialize(v, s)
14853            }
14854            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14855                d: D,
14856            ) -> ::core::result::Result<Self, D::Error> {
14857                <Self as ::serde::Deserialize>::deserialize(d)
14858            }
14859        }
14860    };
14861    impl ::buffa::Enumeration for IdempotencyLevel {
14862        fn from_i32(value: i32) -> ::core::option::Option<Self> {
14863            match value {
14864                0i32 => ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
14865                1i32 => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14866                2i32 => ::core::option::Option::Some(Self::IDEMPOTENT),
14867                _ => ::core::option::Option::None,
14868            }
14869        }
14870        fn to_i32(&self) -> i32 {
14871            *self as i32
14872        }
14873        fn proto_name(&self) -> &'static str {
14874            match self {
14875                Self::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN",
14876                Self::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS",
14877                Self::IDEMPOTENT => "IDEMPOTENT",
14878            }
14879        }
14880        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
14881            match name {
14882                "IDEMPOTENCY_UNKNOWN" => {
14883                    ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN)
14884                }
14885                "NO_SIDE_EFFECTS" => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14886                "IDEMPOTENT" => ::core::option::Option::Some(Self::IDEMPOTENT),
14887                _ => ::core::option::Option::None,
14888            }
14889        }
14890        fn values() -> &'static [Self] {
14891            &[Self::IDEMPOTENCY_UNKNOWN, Self::NO_SIDE_EFFECTS, Self::IDEMPOTENT]
14892        }
14893    }
14894}
14895/// A message representing a option the parser does not recognize. This only
14896/// appears in options protos created by the compiler::Parser class.
14897/// DescriptorPool resolves these when building Descriptor objects. Therefore,
14898/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
14899/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
14900/// in them.
14901#[derive(Clone, PartialEq, Default)]
14902#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
14903#[cfg_attr(feature = "json", serde(default))]
14904#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14905pub struct UninterpretedOption {
14906    /// Field 2: `name`
14907    #[cfg_attr(
14908        feature = "json",
14909        serde(
14910            rename = "name",
14911            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14912            deserialize_with = "::buffa::json_helpers::null_as_default"
14913        )
14914    )]
14915    pub name: ::buffa::alloc::vec::Vec<uninterpreted_option::NamePart>,
14916    /// The value of the uninterpreted option, in whatever type the tokenizer
14917    /// identified it as during parsing. Exactly one of these should be set.
14918    ///
14919    /// Field 3: `identifier_value`
14920    #[cfg_attr(
14921        feature = "json",
14922        serde(
14923            rename = "identifierValue",
14924            alias = "identifier_value",
14925            skip_serializing_if = "::core::option::Option::is_none"
14926        )
14927    )]
14928    pub identifier_value: ::core::option::Option<::buffa::alloc::string::String>,
14929    /// Field 4: `positive_int_value`
14930    #[cfg_attr(
14931        feature = "json",
14932        serde(
14933            rename = "positiveIntValue",
14934            alias = "positive_int_value",
14935            with = "::buffa::json_helpers::opt_uint64",
14936            skip_serializing_if = "::core::option::Option::is_none"
14937        )
14938    )]
14939    pub positive_int_value: ::core::option::Option<u64>,
14940    /// Field 5: `negative_int_value`
14941    #[cfg_attr(
14942        feature = "json",
14943        serde(
14944            rename = "negativeIntValue",
14945            alias = "negative_int_value",
14946            with = "::buffa::json_helpers::opt_int64",
14947            skip_serializing_if = "::core::option::Option::is_none"
14948        )
14949    )]
14950    pub negative_int_value: ::core::option::Option<i64>,
14951    /// Field 6: `double_value`
14952    #[cfg_attr(
14953        feature = "json",
14954        serde(
14955            rename = "doubleValue",
14956            alias = "double_value",
14957            with = "::buffa::json_helpers::opt_double",
14958            skip_serializing_if = "::core::option::Option::is_none"
14959        )
14960    )]
14961    pub double_value: ::core::option::Option<f64>,
14962    /// Field 7: `string_value`
14963    #[cfg_attr(
14964        feature = "json",
14965        serde(
14966            rename = "stringValue",
14967            alias = "string_value",
14968            with = "::buffa::json_helpers::opt_bytes",
14969            skip_serializing_if = "::core::option::Option::is_none"
14970        )
14971    )]
14972    pub string_value: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
14973    /// Field 8: `aggregate_value`
14974    #[cfg_attr(
14975        feature = "json",
14976        serde(
14977            rename = "aggregateValue",
14978            alias = "aggregate_value",
14979            skip_serializing_if = "::core::option::Option::is_none"
14980        )
14981    )]
14982    pub aggregate_value: ::core::option::Option<::buffa::alloc::string::String>,
14983    #[cfg_attr(feature = "json", serde(skip))]
14984    #[doc(hidden)]
14985    pub __buffa_unknown_fields: ::buffa::UnknownFields,
14986}
14987impl ::core::fmt::Debug for UninterpretedOption {
14988    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14989        f.debug_struct("UninterpretedOption")
14990            .field("name", &self.name)
14991            .field("identifier_value", &self.identifier_value)
14992            .field("positive_int_value", &self.positive_int_value)
14993            .field("negative_int_value", &self.negative_int_value)
14994            .field("double_value", &self.double_value)
14995            .field("string_value", &self.string_value)
14996            .field("aggregate_value", &self.aggregate_value)
14997            .finish()
14998    }
14999}
15000impl UninterpretedOption {
15001    /// Protobuf type URL for this message, for use with `Any::pack` and
15002    /// `Any::unpack_if`.
15003    ///
15004    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15005    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
15006}
15007impl UninterpretedOption {
15008    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15009    #[inline]
15010    ///Sets [`Self::identifier_value`] to `Some(value)`, consuming and returning `self`.
15011    pub fn with_identifier_value(
15012        mut self,
15013        value: impl Into<::buffa::alloc::string::String>,
15014    ) -> Self {
15015        self.identifier_value = Some(value.into());
15016        self
15017    }
15018    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15019    #[inline]
15020    ///Sets [`Self::positive_int_value`] to `Some(value)`, consuming and returning `self`.
15021    pub fn with_positive_int_value(mut self, value: u64) -> Self {
15022        self.positive_int_value = Some(value);
15023        self
15024    }
15025    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15026    #[inline]
15027    ///Sets [`Self::negative_int_value`] to `Some(value)`, consuming and returning `self`.
15028    pub fn with_negative_int_value(mut self, value: i64) -> Self {
15029        self.negative_int_value = Some(value);
15030        self
15031    }
15032    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15033    #[inline]
15034    ///Sets [`Self::double_value`] to `Some(value)`, consuming and returning `self`.
15035    pub fn with_double_value(mut self, value: f64) -> Self {
15036        self.double_value = Some(value);
15037        self
15038    }
15039    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15040    #[inline]
15041    ///Sets [`Self::string_value`] to `Some(value)`, consuming and returning `self`.
15042    pub fn with_string_value(
15043        mut self,
15044        value: impl Into<::buffa::alloc::vec::Vec<u8>>,
15045    ) -> Self {
15046        self.string_value = Some(value.into());
15047        self
15048    }
15049    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15050    #[inline]
15051    ///Sets [`Self::aggregate_value`] to `Some(value)`, consuming and returning `self`.
15052    pub fn with_aggregate_value(
15053        mut self,
15054        value: impl Into<::buffa::alloc::string::String>,
15055    ) -> Self {
15056        self.aggregate_value = Some(value.into());
15057        self
15058    }
15059}
15060::buffa::impl_default_instance!(UninterpretedOption);
15061impl ::buffa::MessageName for UninterpretedOption {
15062    const PACKAGE: &'static str = "google.protobuf";
15063    const NAME: &'static str = "UninterpretedOption";
15064    const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption";
15065    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
15066}
15067impl ::buffa::Message for UninterpretedOption {
15068    /// Returns the total encoded size in bytes.
15069    ///
15070    /// Accumulates in `u64` (which cannot overflow for in-memory
15071    /// data) and saturates to `u32` at return, so a message whose
15072    /// encoded size exceeds the 2 GiB protobuf limit yields a value
15073    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15074    /// points reject, never a silently wrapped size.
15075    #[allow(clippy::let_and_return)]
15076    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
15077        #[allow(unused_imports)]
15078        use ::buffa::Enumeration as _;
15079        let mut size = 0u64;
15080        for v in &self.name {
15081            let __slot = __cache.reserve();
15082            let inner_size = v.compute_size(__cache);
15083            __cache.set(__slot, inner_size);
15084            size
15085                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
15086                    + inner_size as u64;
15087        }
15088        if let Some(ref v) = self.identifier_value {
15089            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
15090        }
15091        if let Some(v) = self.positive_int_value {
15092            size += 1u64 + ::buffa::types::uint64_encoded_len(v) as u64;
15093        }
15094        if let Some(v) = self.negative_int_value {
15095            size += 1u64 + ::buffa::types::int64_encoded_len(v) as u64;
15096        }
15097        if self.double_value.is_some() {
15098            size += 1u64 + ::buffa::types::FIXED64_ENCODED_LEN as u64;
15099        }
15100        if let Some(ref v) = self.string_value {
15101            size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
15102        }
15103        if let Some(ref v) = self.aggregate_value {
15104            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
15105        }
15106        size += self.__buffa_unknown_fields.encoded_len() as u64;
15107        ::buffa::saturate_size(size)
15108    }
15109    fn write_to(
15110        &self,
15111        __cache: &mut ::buffa::SizeCache,
15112        buf: &mut impl ::buffa::EncodeSink,
15113    ) {
15114        #[allow(unused_imports)]
15115        use ::buffa::Enumeration as _;
15116        for v in &self.name {
15117            ::buffa::types::put_len_delimited_header(
15118                2u32,
15119                u64::from(__cache.consume_next()),
15120                buf,
15121            );
15122            v.write_to(__cache, buf);
15123        }
15124        if let Some(ref v) = self.identifier_value {
15125            ::buffa::types::put_string_field(3u32, v, buf);
15126        }
15127        if let Some(v) = self.positive_int_value {
15128            ::buffa::types::put_uint64_field(4u32, v, buf);
15129        }
15130        if let Some(v) = self.negative_int_value {
15131            ::buffa::types::put_int64_field(5u32, v, buf);
15132        }
15133        if let Some(v) = self.double_value {
15134            ::buffa::types::put_double_field(6u32, v, buf);
15135        }
15136        if let Some(ref v) = self.string_value {
15137            ::buffa::types::put_shared_bytes_field(7u32, v, buf);
15138        }
15139        if let Some(ref v) = self.aggregate_value {
15140            ::buffa::types::put_string_field(8u32, v, buf);
15141        }
15142        self.__buffa_unknown_fields.write_to(buf);
15143    }
15144    fn merge_field(
15145        &mut self,
15146        tag: ::buffa::encoding::Tag,
15147        buf: &mut impl ::buffa::bytes::Buf,
15148        ctx: ::buffa::DecodeContext<'_>,
15149    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15150        #[allow(unused_imports)]
15151        use ::buffa::bytes::Buf as _;
15152        #[allow(unused_imports)]
15153        use ::buffa::Enumeration as _;
15154        match tag.field_number() {
15155            2u32 => {
15156                ::buffa::encoding::check_wire_type(
15157                    tag,
15158                    ::buffa::encoding::WireType::LengthDelimited,
15159                )?;
15160                let mut elem = ::core::default::Default::default();
15161                ctx.register_element_memory(
15162                    ::buffa::__private::element_footprint(&elem),
15163                )?;
15164                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
15165                self.name.push(elem);
15166            }
15167            3u32 => {
15168                ::buffa::encoding::check_wire_type(
15169                    tag,
15170                    ::buffa::encoding::WireType::LengthDelimited,
15171                )?;
15172                ::buffa::types::merge_string(
15173                    self
15174                        .identifier_value
15175                        .get_or_insert_with(::buffa::alloc::string::String::new),
15176                    buf,
15177                )?;
15178            }
15179            4u32 => {
15180                ::buffa::encoding::check_wire_type(
15181                    tag,
15182                    ::buffa::encoding::WireType::Varint,
15183                )?;
15184                self.positive_int_value = ::core::option::Option::Some(
15185                    ::buffa::types::decode_uint64(buf)?,
15186                );
15187            }
15188            5u32 => {
15189                ::buffa::encoding::check_wire_type(
15190                    tag,
15191                    ::buffa::encoding::WireType::Varint,
15192                )?;
15193                self.negative_int_value = ::core::option::Option::Some(
15194                    ::buffa::types::decode_int64(buf)?,
15195                );
15196            }
15197            6u32 => {
15198                ::buffa::encoding::check_wire_type(
15199                    tag,
15200                    ::buffa::encoding::WireType::Fixed64,
15201                )?;
15202                self.double_value = ::core::option::Option::Some(
15203                    ::buffa::types::decode_double(buf)?,
15204                );
15205            }
15206            7u32 => {
15207                ::buffa::encoding::check_wire_type(
15208                    tag,
15209                    ::buffa::encoding::WireType::LengthDelimited,
15210                )?;
15211                ::buffa::types::merge_bytes(
15212                    self.string_value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
15213                    buf,
15214                )?;
15215            }
15216            8u32 => {
15217                ::buffa::encoding::check_wire_type(
15218                    tag,
15219                    ::buffa::encoding::WireType::LengthDelimited,
15220                )?;
15221                ::buffa::types::merge_string(
15222                    self
15223                        .aggregate_value
15224                        .get_or_insert_with(::buffa::alloc::string::String::new),
15225                    buf,
15226                )?;
15227            }
15228            _ => {
15229                self.__buffa_unknown_fields
15230                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15231            }
15232        }
15233        ::core::result::Result::Ok(())
15234    }
15235    fn clear(&mut self) {
15236        self.name.clear();
15237        self.identifier_value = ::core::option::Option::None;
15238        self.positive_int_value = ::core::option::Option::None;
15239        self.negative_int_value = ::core::option::Option::None;
15240        self.double_value = ::core::option::Option::None;
15241        self.string_value = ::core::option::Option::None;
15242        self.aggregate_value = ::core::option::Option::None;
15243        self.__buffa_unknown_fields.clear();
15244    }
15245}
15246impl ::buffa::ExtensionSet for UninterpretedOption {
15247    const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption";
15248    fn unknown_fields(&self) -> &::buffa::UnknownFields {
15249        &self.__buffa_unknown_fields
15250    }
15251    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15252        &mut self.__buffa_unknown_fields
15253    }
15254}
15255#[cfg(feature = "text")]
15256impl ::buffa::text::TextFormat for UninterpretedOption {
15257    fn encode_text(
15258        &self,
15259        enc: &mut ::buffa::text::TextEncoder<'_>,
15260    ) -> ::core::fmt::Result {
15261        #[allow(unused_imports)]
15262        use ::buffa::Enumeration as _;
15263        if let ::core::option::Option::Some(ref __v) = self.identifier_value {
15264            enc.write_field_name("identifier_value")?;
15265            enc.write_string(__v)?;
15266        }
15267        if let ::core::option::Option::Some(ref __v) = self.positive_int_value {
15268            enc.write_field_name("positive_int_value")?;
15269            enc.write_u64(*__v)?;
15270        }
15271        if let ::core::option::Option::Some(ref __v) = self.negative_int_value {
15272            enc.write_field_name("negative_int_value")?;
15273            enc.write_i64(*__v)?;
15274        }
15275        if let ::core::option::Option::Some(ref __v) = self.double_value {
15276            enc.write_field_name("double_value")?;
15277            enc.write_f64(*__v)?;
15278        }
15279        if let ::core::option::Option::Some(ref __v) = self.string_value {
15280            enc.write_field_name("string_value")?;
15281            enc.write_bytes(__v)?;
15282        }
15283        if let ::core::option::Option::Some(ref __v) = self.aggregate_value {
15284            enc.write_field_name("aggregate_value")?;
15285            enc.write_string(__v)?;
15286        }
15287        for __v in &self.name {
15288            enc.write_field_name("name")?;
15289            enc.write_message(__v)?;
15290        }
15291        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15292        ::core::result::Result::Ok(())
15293    }
15294    fn merge_text(
15295        &mut self,
15296        dec: &mut ::buffa::text::TextDecoder<'_>,
15297    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15298        #[allow(unused_imports)]
15299        use ::buffa::Enumeration as _;
15300        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15301            match __name {
15302                "identifier_value" => {
15303                    self.identifier_value = ::core::option::Option::Some(
15304                        dec.read_string()?.into_owned(),
15305                    );
15306                }
15307                "positive_int_value" => {
15308                    self.positive_int_value = ::core::option::Option::Some(
15309                        dec.read_u64()?,
15310                    );
15311                }
15312                "negative_int_value" => {
15313                    self.negative_int_value = ::core::option::Option::Some(
15314                        dec.read_i64()?,
15315                    );
15316                }
15317                "double_value" => {
15318                    self.double_value = ::core::option::Option::Some(dec.read_f64()?);
15319                }
15320                "string_value" => {
15321                    self.string_value = ::core::option::Option::Some(dec.read_bytes()?);
15322                }
15323                "aggregate_value" => {
15324                    self.aggregate_value = ::core::option::Option::Some(
15325                        dec.read_string()?.into_owned(),
15326                    );
15327                }
15328                "name" => {
15329                    dec.read_repeated_into(
15330                        &mut self.name,
15331                        |__d| {
15332                            let mut __m = ::core::default::Default::default();
15333                            __d.merge_message(&mut __m)?;
15334                            ::core::result::Result::Ok(__m)
15335                        },
15336                    )?
15337                }
15338                _ => dec.skip_value()?,
15339            }
15340        }
15341        ::core::result::Result::Ok(())
15342    }
15343}
15344#[cfg(feature = "json")]
15345impl ::buffa::json_helpers::ProtoElemJson for UninterpretedOption {
15346    fn serialize_proto_json<S: ::serde::Serializer>(
15347        v: &Self,
15348        s: S,
15349    ) -> ::core::result::Result<S::Ok, S::Error> {
15350        ::serde::Serialize::serialize(v, s)
15351    }
15352    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15353        d: D,
15354    ) -> ::core::result::Result<Self, D::Error> {
15355        <Self as ::serde::Deserialize>::deserialize(d)
15356    }
15357}
15358#[cfg(feature = "json")]
15359#[doc(hidden)]
15360pub const __UNINTERPRETED_OPTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15361    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15362    to_json: ::buffa::type_registry::any_to_json::<UninterpretedOption>,
15363    from_json: ::buffa::type_registry::any_from_json::<UninterpretedOption>,
15364    is_wkt: false,
15365};
15366#[cfg(feature = "text")]
15367#[doc(hidden)]
15368pub const __UNINTERPRETED_OPTION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15369    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15370    text_encode: ::buffa::type_registry::any_encode_text::<UninterpretedOption>,
15371    text_merge: ::buffa::type_registry::any_merge_text::<UninterpretedOption>,
15372};
15373pub mod uninterpreted_option {
15374    #[allow(unused_imports)]
15375    use super::*;
15376    /// The name of the uninterpreted option.  Each string represents a segment in
15377    /// a dot-separated name.  is_extension is true iff a segment represents an
15378    /// extension (denoted with parentheses in options specs in .proto files).
15379    /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["moo", false\] } represents
15380    /// "foo.(bar.baz).moo".
15381    #[derive(Clone, PartialEq, Default)]
15382    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
15383    #[cfg_attr(feature = "json", serde(default))]
15384    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15385    pub struct NamePart {
15386        /// Field 1: `name_part`
15387        #[cfg_attr(
15388            feature = "json",
15389            serde(
15390                rename = "namePart",
15391                alias = "name_part",
15392                with = "::buffa::json_helpers::proto_string"
15393            )
15394        )]
15395        pub name_part: ::buffa::alloc::string::String,
15396        /// Field 2: `is_extension`
15397        #[cfg_attr(
15398            feature = "json",
15399            serde(
15400                rename = "isExtension",
15401                alias = "is_extension",
15402                with = "::buffa::json_helpers::proto_bool"
15403            )
15404        )]
15405        pub is_extension: bool,
15406        #[cfg_attr(feature = "json", serde(skip))]
15407        #[doc(hidden)]
15408        pub __buffa_unknown_fields: ::buffa::UnknownFields,
15409    }
15410    impl ::core::fmt::Debug for NamePart {
15411        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15412            f.debug_struct("NamePart")
15413                .field("name_part", &self.name_part)
15414                .field("is_extension", &self.is_extension)
15415                .finish()
15416        }
15417    }
15418    impl NamePart {
15419        /// Protobuf type URL for this message, for use with `Any::pack` and
15420        /// `Any::unpack_if`.
15421        ///
15422        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15423        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
15424    }
15425    ::buffa::impl_default_instance!(NamePart);
15426    impl ::buffa::MessageName for NamePart {
15427        const PACKAGE: &'static str = "google.protobuf";
15428        const NAME: &'static str = "UninterpretedOption.NamePart";
15429        const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption.NamePart";
15430        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
15431    }
15432    impl ::buffa::Message for NamePart {
15433        /// Returns the total encoded size in bytes.
15434        ///
15435        /// Accumulates in `u64` (which cannot overflow for in-memory
15436        /// data) and saturates to `u32` at return, so a message whose
15437        /// encoded size exceeds the 2 GiB protobuf limit yields a value
15438        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15439        /// points reject, never a silently wrapped size.
15440        #[allow(clippy::let_and_return)]
15441        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15442            #[allow(unused_imports)]
15443            use ::buffa::Enumeration as _;
15444            let mut size = 0u64;
15445            size += 1u64 + ::buffa::types::string_encoded_len(&self.name_part) as u64;
15446            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
15447            size += self.__buffa_unknown_fields.encoded_len() as u64;
15448            ::buffa::saturate_size(size)
15449        }
15450        fn write_to(
15451            &self,
15452            _cache: &mut ::buffa::SizeCache,
15453            buf: &mut impl ::buffa::EncodeSink,
15454        ) {
15455            #[allow(unused_imports)]
15456            use ::buffa::Enumeration as _;
15457            ::buffa::types::put_string_field(1u32, &self.name_part, buf);
15458            ::buffa::types::put_bool_field(2u32, self.is_extension, buf);
15459            self.__buffa_unknown_fields.write_to(buf);
15460        }
15461        fn merge_field(
15462            &mut self,
15463            tag: ::buffa::encoding::Tag,
15464            buf: &mut impl ::buffa::bytes::Buf,
15465            ctx: ::buffa::DecodeContext<'_>,
15466        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15467            #[allow(unused_imports)]
15468            use ::buffa::bytes::Buf as _;
15469            #[allow(unused_imports)]
15470            use ::buffa::Enumeration as _;
15471            match tag.field_number() {
15472                1u32 => {
15473                    ::buffa::encoding::check_wire_type(
15474                        tag,
15475                        ::buffa::encoding::WireType::LengthDelimited,
15476                    )?;
15477                    ::buffa::types::merge_string(&mut self.name_part, buf)?;
15478                }
15479                2u32 => {
15480                    ::buffa::encoding::check_wire_type(
15481                        tag,
15482                        ::buffa::encoding::WireType::Varint,
15483                    )?;
15484                    self.is_extension = ::buffa::types::decode_bool(buf)?;
15485                }
15486                _ => {
15487                    self.__buffa_unknown_fields
15488                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15489                }
15490            }
15491            ::core::result::Result::Ok(())
15492        }
15493        fn clear(&mut self) {
15494            self.name_part.clear();
15495            self.is_extension = false;
15496            self.__buffa_unknown_fields.clear();
15497        }
15498    }
15499    impl ::buffa::ExtensionSet for NamePart {
15500        const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption.NamePart";
15501        fn unknown_fields(&self) -> &::buffa::UnknownFields {
15502            &self.__buffa_unknown_fields
15503        }
15504        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15505            &mut self.__buffa_unknown_fields
15506        }
15507    }
15508    #[cfg(feature = "text")]
15509    impl ::buffa::text::TextFormat for NamePart {
15510        fn encode_text(
15511            &self,
15512            enc: &mut ::buffa::text::TextEncoder<'_>,
15513        ) -> ::core::fmt::Result {
15514            #[allow(unused_imports)]
15515            use ::buffa::Enumeration as _;
15516            enc.write_field_name("name_part")?;
15517            enc.write_string(&self.name_part)?;
15518            enc.write_field_name("is_extension")?;
15519            enc.write_bool(self.is_extension)?;
15520            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15521            ::core::result::Result::Ok(())
15522        }
15523        fn merge_text(
15524            &mut self,
15525            dec: &mut ::buffa::text::TextDecoder<'_>,
15526        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15527            #[allow(unused_imports)]
15528            use ::buffa::Enumeration as _;
15529            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15530                match __name {
15531                    "name_part" => self.name_part = dec.read_string()?.into_owned(),
15532                    "is_extension" => self.is_extension = dec.read_bool()?,
15533                    _ => dec.skip_value()?,
15534                }
15535            }
15536            ::core::result::Result::Ok(())
15537        }
15538    }
15539    #[cfg(feature = "json")]
15540    impl ::buffa::json_helpers::ProtoElemJson for NamePart {
15541        fn serialize_proto_json<S: ::serde::Serializer>(
15542            v: &Self,
15543            s: S,
15544        ) -> ::core::result::Result<S::Ok, S::Error> {
15545            ::serde::Serialize::serialize(v, s)
15546        }
15547        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15548            d: D,
15549        ) -> ::core::result::Result<Self, D::Error> {
15550            <Self as ::serde::Deserialize>::deserialize(d)
15551        }
15552    }
15553    #[cfg(feature = "json")]
15554    #[doc(hidden)]
15555    pub const __NAME_PART_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15556        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15557        to_json: ::buffa::type_registry::any_to_json::<NamePart>,
15558        from_json: ::buffa::type_registry::any_from_json::<NamePart>,
15559        is_wkt: false,
15560    };
15561    #[cfg(feature = "text")]
15562    #[doc(hidden)]
15563    pub const __NAME_PART_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15564        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15565        text_encode: ::buffa::type_registry::any_encode_text::<NamePart>,
15566        text_merge: ::buffa::type_registry::any_merge_text::<NamePart>,
15567    };
15568    #[cfg(feature = "views")]
15569    #[doc(inline)]
15570    pub use super::__buffa::view::uninterpreted_option::NamePartView;
15571    #[cfg(feature = "views")]
15572    #[doc(inline)]
15573    pub use super::__buffa::view::uninterpreted_option::NamePartOwnedView;
15574}
15575/// ===================================================================
15576/// Features
15577///
15578/// TODO Enums in C++ gencode (and potentially other languages) are
15579/// not well scoped.  This means that each of the feature enums below can clash
15580/// with each other.  The short names we've chosen maximize call-site
15581/// readability, but leave us very open to this scenario.  A future feature will
15582/// be designed and implemented to handle this, hopefully before we ever hit a
15583/// conflict here.
15584#[derive(Clone, PartialEq, Default)]
15585#[cfg_attr(feature = "json", derive(::serde::Serialize))]
15586#[cfg_attr(feature = "json", serde(default))]
15587#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15588pub struct FeatureSet {
15589    /// Field 1: `field_presence`
15590    #[cfg_attr(
15591        feature = "json",
15592        serde(
15593            rename = "fieldPresence",
15594            alias = "field_presence",
15595            with = "::buffa::json_helpers::opt_closed_enum",
15596            skip_serializing_if = "::core::option::Option::is_none"
15597        )
15598    )]
15599    pub field_presence: ::core::option::Option<feature_set::FieldPresence>,
15600    /// Field 2: `enum_type`
15601    #[cfg_attr(
15602        feature = "json",
15603        serde(
15604            rename = "enumType",
15605            alias = "enum_type",
15606            with = "::buffa::json_helpers::opt_closed_enum",
15607            skip_serializing_if = "::core::option::Option::is_none"
15608        )
15609    )]
15610    pub enum_type: ::core::option::Option<feature_set::EnumType>,
15611    /// Field 3: `repeated_field_encoding`
15612    #[cfg_attr(
15613        feature = "json",
15614        serde(
15615            rename = "repeatedFieldEncoding",
15616            alias = "repeated_field_encoding",
15617            with = "::buffa::json_helpers::opt_closed_enum",
15618            skip_serializing_if = "::core::option::Option::is_none"
15619        )
15620    )]
15621    pub repeated_field_encoding: ::core::option::Option<
15622        feature_set::RepeatedFieldEncoding,
15623    >,
15624    /// Field 4: `utf8_validation`
15625    #[cfg_attr(
15626        feature = "json",
15627        serde(
15628            rename = "utf8Validation",
15629            alias = "utf8_validation",
15630            with = "::buffa::json_helpers::opt_closed_enum",
15631            skip_serializing_if = "::core::option::Option::is_none"
15632        )
15633    )]
15634    pub utf8_validation: ::core::option::Option<feature_set::Utf8Validation>,
15635    /// Field 5: `message_encoding`
15636    #[cfg_attr(
15637        feature = "json",
15638        serde(
15639            rename = "messageEncoding",
15640            alias = "message_encoding",
15641            with = "::buffa::json_helpers::opt_closed_enum",
15642            skip_serializing_if = "::core::option::Option::is_none"
15643        )
15644    )]
15645    pub message_encoding: ::core::option::Option<feature_set::MessageEncoding>,
15646    /// Field 6: `json_format`
15647    #[cfg_attr(
15648        feature = "json",
15649        serde(
15650            rename = "jsonFormat",
15651            alias = "json_format",
15652            with = "::buffa::json_helpers::opt_closed_enum",
15653            skip_serializing_if = "::core::option::Option::is_none"
15654        )
15655    )]
15656    pub json_format: ::core::option::Option<feature_set::JsonFormat>,
15657    /// Field 7: `enforce_naming_style`
15658    #[cfg_attr(
15659        feature = "json",
15660        serde(
15661            rename = "enforceNamingStyle",
15662            alias = "enforce_naming_style",
15663            with = "::buffa::json_helpers::opt_closed_enum",
15664            skip_serializing_if = "::core::option::Option::is_none"
15665        )
15666    )]
15667    pub enforce_naming_style: ::core::option::Option<feature_set::EnforceNamingStyle>,
15668    /// Field 8: `default_symbol_visibility`
15669    #[cfg_attr(
15670        feature = "json",
15671        serde(
15672            rename = "defaultSymbolVisibility",
15673            alias = "default_symbol_visibility",
15674            with = "::buffa::json_helpers::opt_closed_enum",
15675            skip_serializing_if = "::core::option::Option::is_none"
15676        )
15677    )]
15678    pub default_symbol_visibility: ::core::option::Option<
15679        feature_set::visibility_feature::DefaultSymbolVisibility,
15680    >,
15681    #[cfg_attr(feature = "json", serde(flatten))]
15682    #[doc(hidden)]
15683    pub __buffa_unknown_fields: __FeatureSetExtJson,
15684}
15685impl ::core::fmt::Debug for FeatureSet {
15686    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15687        f.debug_struct("FeatureSet")
15688            .field("field_presence", &self.field_presence)
15689            .field("enum_type", &self.enum_type)
15690            .field("repeated_field_encoding", &self.repeated_field_encoding)
15691            .field("utf8_validation", &self.utf8_validation)
15692            .field("message_encoding", &self.message_encoding)
15693            .field("json_format", &self.json_format)
15694            .field("enforce_naming_style", &self.enforce_naming_style)
15695            .field("default_symbol_visibility", &self.default_symbol_visibility)
15696            .finish()
15697    }
15698}
15699impl FeatureSet {
15700    /// Protobuf type URL for this message, for use with `Any::pack` and
15701    /// `Any::unpack_if`.
15702    ///
15703    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15704    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15705}
15706impl FeatureSet {
15707    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15708    #[inline]
15709    ///Sets [`Self::field_presence`] to `Some(value)`, consuming and returning `self`.
15710    pub fn with_field_presence(
15711        mut self,
15712        value: impl Into<feature_set::FieldPresence>,
15713    ) -> Self {
15714        self.field_presence = Some(value.into());
15715        self
15716    }
15717    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15718    #[inline]
15719    ///Sets [`Self::enum_type`] to `Some(value)`, consuming and returning `self`.
15720    pub fn with_enum_type(mut self, value: impl Into<feature_set::EnumType>) -> Self {
15721        self.enum_type = Some(value.into());
15722        self
15723    }
15724    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15725    #[inline]
15726    ///Sets [`Self::repeated_field_encoding`] to `Some(value)`, consuming and returning `self`.
15727    pub fn with_repeated_field_encoding(
15728        mut self,
15729        value: impl Into<feature_set::RepeatedFieldEncoding>,
15730    ) -> Self {
15731        self.repeated_field_encoding = Some(value.into());
15732        self
15733    }
15734    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15735    #[inline]
15736    ///Sets [`Self::utf8_validation`] to `Some(value)`, consuming and returning `self`.
15737    pub fn with_utf8_validation(
15738        mut self,
15739        value: impl Into<feature_set::Utf8Validation>,
15740    ) -> Self {
15741        self.utf8_validation = Some(value.into());
15742        self
15743    }
15744    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15745    #[inline]
15746    ///Sets [`Self::message_encoding`] to `Some(value)`, consuming and returning `self`.
15747    pub fn with_message_encoding(
15748        mut self,
15749        value: impl Into<feature_set::MessageEncoding>,
15750    ) -> Self {
15751        self.message_encoding = Some(value.into());
15752        self
15753    }
15754    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15755    #[inline]
15756    ///Sets [`Self::json_format`] to `Some(value)`, consuming and returning `self`.
15757    pub fn with_json_format(
15758        mut self,
15759        value: impl Into<feature_set::JsonFormat>,
15760    ) -> Self {
15761        self.json_format = Some(value.into());
15762        self
15763    }
15764    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15765    #[inline]
15766    ///Sets [`Self::enforce_naming_style`] to `Some(value)`, consuming and returning `self`.
15767    pub fn with_enforce_naming_style(
15768        mut self,
15769        value: impl Into<feature_set::EnforceNamingStyle>,
15770    ) -> Self {
15771        self.enforce_naming_style = Some(value.into());
15772        self
15773    }
15774    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15775    #[inline]
15776    ///Sets [`Self::default_symbol_visibility`] to `Some(value)`, consuming and returning `self`.
15777    pub fn with_default_symbol_visibility(
15778        mut self,
15779        value: impl Into<feature_set::visibility_feature::DefaultSymbolVisibility>,
15780    ) -> Self {
15781        self.default_symbol_visibility = Some(value.into());
15782        self
15783    }
15784}
15785::buffa::impl_default_instance!(FeatureSet);
15786impl ::buffa::MessageName for FeatureSet {
15787    const PACKAGE: &'static str = "google.protobuf";
15788    const NAME: &'static str = "FeatureSet";
15789    const FULL_NAME: &'static str = "google.protobuf.FeatureSet";
15790    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15791}
15792impl ::buffa::Message for FeatureSet {
15793    /// Returns the total encoded size in bytes.
15794    ///
15795    /// Accumulates in `u64` (which cannot overflow for in-memory
15796    /// data) and saturates to `u32` at return, so a message whose
15797    /// encoded size exceeds the 2 GiB protobuf limit yields a value
15798    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15799    /// points reject, never a silently wrapped size.
15800    #[allow(clippy::let_and_return)]
15801    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15802        #[allow(unused_imports)]
15803        use ::buffa::Enumeration as _;
15804        let mut size = 0u64;
15805        if let Some(ref v) = self.field_presence {
15806            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15807        }
15808        if let Some(ref v) = self.enum_type {
15809            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15810        }
15811        if let Some(ref v) = self.repeated_field_encoding {
15812            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15813        }
15814        if let Some(ref v) = self.utf8_validation {
15815            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15816        }
15817        if let Some(ref v) = self.message_encoding {
15818            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15819        }
15820        if let Some(ref v) = self.json_format {
15821            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15822        }
15823        if let Some(ref v) = self.enforce_naming_style {
15824            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15825        }
15826        if let Some(ref v) = self.default_symbol_visibility {
15827            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15828        }
15829        size += self.__buffa_unknown_fields.encoded_len() as u64;
15830        ::buffa::saturate_size(size)
15831    }
15832    fn write_to(
15833        &self,
15834        _cache: &mut ::buffa::SizeCache,
15835        buf: &mut impl ::buffa::EncodeSink,
15836    ) {
15837        #[allow(unused_imports)]
15838        use ::buffa::Enumeration as _;
15839        if let Some(ref v) = self.field_presence {
15840            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
15841        }
15842        if let Some(ref v) = self.enum_type {
15843            ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
15844        }
15845        if let Some(ref v) = self.repeated_field_encoding {
15846            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
15847        }
15848        if let Some(ref v) = self.utf8_validation {
15849            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
15850        }
15851        if let Some(ref v) = self.message_encoding {
15852            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
15853        }
15854        if let Some(ref v) = self.json_format {
15855            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
15856        }
15857        if let Some(ref v) = self.enforce_naming_style {
15858            ::buffa::types::put_int32_field(7u32, v.to_i32(), buf);
15859        }
15860        if let Some(ref v) = self.default_symbol_visibility {
15861            ::buffa::types::put_int32_field(8u32, v.to_i32(), buf);
15862        }
15863        self.__buffa_unknown_fields.write_to(buf);
15864    }
15865    fn merge_field(
15866        &mut self,
15867        tag: ::buffa::encoding::Tag,
15868        buf: &mut impl ::buffa::bytes::Buf,
15869        ctx: ::buffa::DecodeContext<'_>,
15870    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15871        #[allow(unused_imports)]
15872        use ::buffa::bytes::Buf as _;
15873        #[allow(unused_imports)]
15874        use ::buffa::Enumeration as _;
15875        match tag.field_number() {
15876            1u32 => {
15877                ::buffa::encoding::check_wire_type(
15878                    tag,
15879                    ::buffa::encoding::WireType::Varint,
15880                )?;
15881                let __raw = ::buffa::types::decode_int32(buf)?;
15882                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15883                    __raw,
15884                ) {
15885                    self.field_presence = ::core::option::Option::Some(__v);
15886                } else {
15887                    ctx.register_unknown_field()?;
15888                    self.__buffa_unknown_fields
15889                        .push(::buffa::UnknownField {
15890                            number: 1u32,
15891                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15892                        });
15893                }
15894            }
15895            2u32 => {
15896                ::buffa::encoding::check_wire_type(
15897                    tag,
15898                    ::buffa::encoding::WireType::Varint,
15899                )?;
15900                let __raw = ::buffa::types::decode_int32(buf)?;
15901                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15902                    __raw,
15903                ) {
15904                    self.enum_type = ::core::option::Option::Some(__v);
15905                } else {
15906                    ctx.register_unknown_field()?;
15907                    self.__buffa_unknown_fields
15908                        .push(::buffa::UnknownField {
15909                            number: 2u32,
15910                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15911                        });
15912                }
15913            }
15914            3u32 => {
15915                ::buffa::encoding::check_wire_type(
15916                    tag,
15917                    ::buffa::encoding::WireType::Varint,
15918                )?;
15919                let __raw = ::buffa::types::decode_int32(buf)?;
15920                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15921                    __raw,
15922                ) {
15923                    self.repeated_field_encoding = ::core::option::Option::Some(__v);
15924                } else {
15925                    ctx.register_unknown_field()?;
15926                    self.__buffa_unknown_fields
15927                        .push(::buffa::UnknownField {
15928                            number: 3u32,
15929                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15930                        });
15931                }
15932            }
15933            4u32 => {
15934                ::buffa::encoding::check_wire_type(
15935                    tag,
15936                    ::buffa::encoding::WireType::Varint,
15937                )?;
15938                let __raw = ::buffa::types::decode_int32(buf)?;
15939                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15940                    __raw,
15941                ) {
15942                    self.utf8_validation = ::core::option::Option::Some(__v);
15943                } else {
15944                    ctx.register_unknown_field()?;
15945                    self.__buffa_unknown_fields
15946                        .push(::buffa::UnknownField {
15947                            number: 4u32,
15948                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15949                        });
15950                }
15951            }
15952            5u32 => {
15953                ::buffa::encoding::check_wire_type(
15954                    tag,
15955                    ::buffa::encoding::WireType::Varint,
15956                )?;
15957                let __raw = ::buffa::types::decode_int32(buf)?;
15958                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15959                    __raw,
15960                ) {
15961                    self.message_encoding = ::core::option::Option::Some(__v);
15962                } else {
15963                    ctx.register_unknown_field()?;
15964                    self.__buffa_unknown_fields
15965                        .push(::buffa::UnknownField {
15966                            number: 5u32,
15967                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15968                        });
15969                }
15970            }
15971            6u32 => {
15972                ::buffa::encoding::check_wire_type(
15973                    tag,
15974                    ::buffa::encoding::WireType::Varint,
15975                )?;
15976                let __raw = ::buffa::types::decode_int32(buf)?;
15977                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15978                    __raw,
15979                ) {
15980                    self.json_format = ::core::option::Option::Some(__v);
15981                } else {
15982                    ctx.register_unknown_field()?;
15983                    self.__buffa_unknown_fields
15984                        .push(::buffa::UnknownField {
15985                            number: 6u32,
15986                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15987                        });
15988                }
15989            }
15990            7u32 => {
15991                ::buffa::encoding::check_wire_type(
15992                    tag,
15993                    ::buffa::encoding::WireType::Varint,
15994                )?;
15995                let __raw = ::buffa::types::decode_int32(buf)?;
15996                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15997                    __raw,
15998                ) {
15999                    self.enforce_naming_style = ::core::option::Option::Some(__v);
16000                } else {
16001                    ctx.register_unknown_field()?;
16002                    self.__buffa_unknown_fields
16003                        .push(::buffa::UnknownField {
16004                            number: 7u32,
16005                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16006                        });
16007                }
16008            }
16009            8u32 => {
16010                ::buffa::encoding::check_wire_type(
16011                    tag,
16012                    ::buffa::encoding::WireType::Varint,
16013                )?;
16014                let __raw = ::buffa::types::decode_int32(buf)?;
16015                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16016                    __raw,
16017                ) {
16018                    self.default_symbol_visibility = ::core::option::Option::Some(__v);
16019                } else {
16020                    ctx.register_unknown_field()?;
16021                    self.__buffa_unknown_fields
16022                        .push(::buffa::UnknownField {
16023                            number: 8u32,
16024                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16025                        });
16026                }
16027            }
16028            _ => {
16029                self.__buffa_unknown_fields
16030                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
16031            }
16032        }
16033        ::core::result::Result::Ok(())
16034    }
16035    fn clear(&mut self) {
16036        self.field_presence = ::core::option::Option::None;
16037        self.enum_type = ::core::option::Option::None;
16038        self.repeated_field_encoding = ::core::option::Option::None;
16039        self.utf8_validation = ::core::option::Option::None;
16040        self.message_encoding = ::core::option::Option::None;
16041        self.json_format = ::core::option::Option::None;
16042        self.enforce_naming_style = ::core::option::Option::None;
16043        self.default_symbol_visibility = ::core::option::Option::None;
16044        self.__buffa_unknown_fields.clear();
16045    }
16046}
16047impl ::buffa::ExtensionSet for FeatureSet {
16048    const PROTO_FQN: &'static str = "google.protobuf.FeatureSet";
16049    fn unknown_fields(&self) -> &::buffa::UnknownFields {
16050        &self.__buffa_unknown_fields
16051    }
16052    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
16053        &mut self.__buffa_unknown_fields
16054    }
16055}
16056#[cfg(feature = "text")]
16057impl ::buffa::text::TextFormat for FeatureSet {
16058    fn encode_text(
16059        &self,
16060        enc: &mut ::buffa::text::TextEncoder<'_>,
16061    ) -> ::core::fmt::Result {
16062        #[allow(unused_imports)]
16063        use ::buffa::Enumeration as _;
16064        if let ::core::option::Option::Some(ref __v) = self.field_presence {
16065            enc.write_field_name("field_presence")?;
16066            enc.write_enum_name(__v.proto_name())?;
16067        }
16068        if let ::core::option::Option::Some(ref __v) = self.enum_type {
16069            enc.write_field_name("enum_type")?;
16070            enc.write_enum_name(__v.proto_name())?;
16071        }
16072        if let ::core::option::Option::Some(ref __v) = self.repeated_field_encoding {
16073            enc.write_field_name("repeated_field_encoding")?;
16074            enc.write_enum_name(__v.proto_name())?;
16075        }
16076        if let ::core::option::Option::Some(ref __v) = self.utf8_validation {
16077            enc.write_field_name("utf8_validation")?;
16078            enc.write_enum_name(__v.proto_name())?;
16079        }
16080        if let ::core::option::Option::Some(ref __v) = self.message_encoding {
16081            enc.write_field_name("message_encoding")?;
16082            enc.write_enum_name(__v.proto_name())?;
16083        }
16084        if let ::core::option::Option::Some(ref __v) = self.json_format {
16085            enc.write_field_name("json_format")?;
16086            enc.write_enum_name(__v.proto_name())?;
16087        }
16088        if let ::core::option::Option::Some(ref __v) = self.enforce_naming_style {
16089            enc.write_field_name("enforce_naming_style")?;
16090            enc.write_enum_name(__v.proto_name())?;
16091        }
16092        if let ::core::option::Option::Some(ref __v) = self.default_symbol_visibility {
16093            enc.write_field_name("default_symbol_visibility")?;
16094            enc.write_enum_name(__v.proto_name())?;
16095        }
16096        enc.write_extension_fields(
16097            "google.protobuf.FeatureSet",
16098            &self.__buffa_unknown_fields,
16099        )?;
16100        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
16101        ::core::result::Result::Ok(())
16102    }
16103    fn merge_text(
16104        &mut self,
16105        dec: &mut ::buffa::text::TextDecoder<'_>,
16106    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
16107        #[allow(unused_imports)]
16108        use ::buffa::Enumeration as _;
16109        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
16110            match __name {
16111                "field_presence" => {
16112                    self.field_presence = ::core::option::Option::Some(
16113                        dec.read_closed_enum_by_name::<feature_set::FieldPresence>()?,
16114                    );
16115                }
16116                "enum_type" => {
16117                    self.enum_type = ::core::option::Option::Some(
16118                        dec.read_closed_enum_by_name::<feature_set::EnumType>()?,
16119                    );
16120                }
16121                "repeated_field_encoding" => {
16122                    self.repeated_field_encoding = ::core::option::Option::Some(
16123                        dec
16124                            .read_closed_enum_by_name::<
16125                                feature_set::RepeatedFieldEncoding,
16126                            >()?,
16127                    );
16128                }
16129                "utf8_validation" => {
16130                    self.utf8_validation = ::core::option::Option::Some(
16131                        dec.read_closed_enum_by_name::<feature_set::Utf8Validation>()?,
16132                    );
16133                }
16134                "message_encoding" => {
16135                    self.message_encoding = ::core::option::Option::Some(
16136                        dec.read_closed_enum_by_name::<feature_set::MessageEncoding>()?,
16137                    );
16138                }
16139                "json_format" => {
16140                    self.json_format = ::core::option::Option::Some(
16141                        dec.read_closed_enum_by_name::<feature_set::JsonFormat>()?,
16142                    );
16143                }
16144                "enforce_naming_style" => {
16145                    self.enforce_naming_style = ::core::option::Option::Some(
16146                        dec
16147                            .read_closed_enum_by_name::<
16148                                feature_set::EnforceNamingStyle,
16149                            >()?,
16150                    );
16151                }
16152                "default_symbol_visibility" => {
16153                    self.default_symbol_visibility = ::core::option::Option::Some(
16154                        dec
16155                            .read_closed_enum_by_name::<
16156                                feature_set::visibility_feature::DefaultSymbolVisibility,
16157                            >()?,
16158                    );
16159                }
16160                __name if __name.starts_with('[') => {
16161                    for __r in dec.read_extension(__name, "google.protobuf.FeatureSet")?
16162                    {
16163                        self.__buffa_unknown_fields.push(__r);
16164                    }
16165                }
16166                _ => dec.skip_value()?,
16167            }
16168        }
16169        ::core::result::Result::Ok(())
16170    }
16171}
16172#[cfg(feature = "json")]
16173impl<'de> ::serde::Deserialize<'de> for FeatureSet {
16174    fn deserialize<D: ::serde::Deserializer<'de>>(
16175        d: D,
16176    ) -> ::core::result::Result<Self, D::Error> {
16177        struct _V;
16178        impl<'de> ::serde::de::Visitor<'de> for _V {
16179            type Value = FeatureSet;
16180            fn expecting(
16181                &self,
16182                f: &mut ::core::fmt::Formatter<'_>,
16183            ) -> ::core::fmt::Result {
16184                f.write_str("struct FeatureSet")
16185            }
16186            #[allow(clippy::field_reassign_with_default)]
16187            fn visit_map<A: ::serde::de::MapAccess<'de>>(
16188                self,
16189                mut map: A,
16190            ) -> ::core::result::Result<FeatureSet, A::Error> {
16191                let mut __f_field_presence: ::core::option::Option<
16192                    ::core::option::Option<feature_set::FieldPresence>,
16193                > = None;
16194                let mut __f_enum_type: ::core::option::Option<
16195                    ::core::option::Option<feature_set::EnumType>,
16196                > = None;
16197                let mut __f_repeated_field_encoding: ::core::option::Option<
16198                    ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16199                > = None;
16200                let mut __f_utf8_validation: ::core::option::Option<
16201                    ::core::option::Option<feature_set::Utf8Validation>,
16202                > = None;
16203                let mut __f_message_encoding: ::core::option::Option<
16204                    ::core::option::Option<feature_set::MessageEncoding>,
16205                > = None;
16206                let mut __f_json_format: ::core::option::Option<
16207                    ::core::option::Option<feature_set::JsonFormat>,
16208                > = None;
16209                let mut __f_enforce_naming_style: ::core::option::Option<
16210                    ::core::option::Option<feature_set::EnforceNamingStyle>,
16211                > = None;
16212                let mut __f_default_symbol_visibility: ::core::option::Option<
16213                    ::core::option::Option<
16214                        feature_set::visibility_feature::DefaultSymbolVisibility,
16215                    >,
16216                > = None;
16217                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
16218                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
16219                    match key.as_str() {
16220                        "fieldPresence" | "field_presence" => {
16221                            __f_field_presence = Some({
16222                                struct _S;
16223                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16224                                    type Value = ::core::option::Option<
16225                                        feature_set::FieldPresence,
16226                                    >;
16227                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16228                                        self,
16229                                        d: D,
16230                                    ) -> ::core::result::Result<
16231                                        ::core::option::Option<feature_set::FieldPresence>,
16232                                        D::Error,
16233                                    > {
16234                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16235                                    }
16236                                }
16237                                map.next_value_seed(_S)?
16238                            });
16239                        }
16240                        "enumType" | "enum_type" => {
16241                            __f_enum_type = Some({
16242                                struct _S;
16243                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16244                                    type Value = ::core::option::Option<feature_set::EnumType>;
16245                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16246                                        self,
16247                                        d: D,
16248                                    ) -> ::core::result::Result<
16249                                        ::core::option::Option<feature_set::EnumType>,
16250                                        D::Error,
16251                                    > {
16252                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16253                                    }
16254                                }
16255                                map.next_value_seed(_S)?
16256                            });
16257                        }
16258                        "repeatedFieldEncoding" | "repeated_field_encoding" => {
16259                            __f_repeated_field_encoding = Some({
16260                                struct _S;
16261                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16262                                    type Value = ::core::option::Option<
16263                                        feature_set::RepeatedFieldEncoding,
16264                                    >;
16265                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16266                                        self,
16267                                        d: D,
16268                                    ) -> ::core::result::Result<
16269                                        ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16270                                        D::Error,
16271                                    > {
16272                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16273                                    }
16274                                }
16275                                map.next_value_seed(_S)?
16276                            });
16277                        }
16278                        "utf8Validation" | "utf8_validation" => {
16279                            __f_utf8_validation = Some({
16280                                struct _S;
16281                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16282                                    type Value = ::core::option::Option<
16283                                        feature_set::Utf8Validation,
16284                                    >;
16285                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16286                                        self,
16287                                        d: D,
16288                                    ) -> ::core::result::Result<
16289                                        ::core::option::Option<feature_set::Utf8Validation>,
16290                                        D::Error,
16291                                    > {
16292                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16293                                    }
16294                                }
16295                                map.next_value_seed(_S)?
16296                            });
16297                        }
16298                        "messageEncoding" | "message_encoding" => {
16299                            __f_message_encoding = Some({
16300                                struct _S;
16301                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16302                                    type Value = ::core::option::Option<
16303                                        feature_set::MessageEncoding,
16304                                    >;
16305                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16306                                        self,
16307                                        d: D,
16308                                    ) -> ::core::result::Result<
16309                                        ::core::option::Option<feature_set::MessageEncoding>,
16310                                        D::Error,
16311                                    > {
16312                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16313                                    }
16314                                }
16315                                map.next_value_seed(_S)?
16316                            });
16317                        }
16318                        "jsonFormat" | "json_format" => {
16319                            __f_json_format = Some({
16320                                struct _S;
16321                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16322                                    type Value = ::core::option::Option<
16323                                        feature_set::JsonFormat,
16324                                    >;
16325                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16326                                        self,
16327                                        d: D,
16328                                    ) -> ::core::result::Result<
16329                                        ::core::option::Option<feature_set::JsonFormat>,
16330                                        D::Error,
16331                                    > {
16332                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16333                                    }
16334                                }
16335                                map.next_value_seed(_S)?
16336                            });
16337                        }
16338                        "enforceNamingStyle" | "enforce_naming_style" => {
16339                            __f_enforce_naming_style = Some({
16340                                struct _S;
16341                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16342                                    type Value = ::core::option::Option<
16343                                        feature_set::EnforceNamingStyle,
16344                                    >;
16345                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16346                                        self,
16347                                        d: D,
16348                                    ) -> ::core::result::Result<
16349                                        ::core::option::Option<feature_set::EnforceNamingStyle>,
16350                                        D::Error,
16351                                    > {
16352                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16353                                    }
16354                                }
16355                                map.next_value_seed(_S)?
16356                            });
16357                        }
16358                        "defaultSymbolVisibility" | "default_symbol_visibility" => {
16359                            __f_default_symbol_visibility = Some({
16360                                struct _S;
16361                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
16362                                    type Value = ::core::option::Option<
16363                                        feature_set::visibility_feature::DefaultSymbolVisibility,
16364                                    >;
16365                                    fn deserialize<D: ::serde::Deserializer<'de>>(
16366                                        self,
16367                                        d: D,
16368                                    ) -> ::core::result::Result<
16369                                        ::core::option::Option<
16370                                            feature_set::visibility_feature::DefaultSymbolVisibility,
16371                                        >,
16372                                        D::Error,
16373                                    > {
16374                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16375                                    }
16376                                }
16377                                map.next_value_seed(_S)?
16378                            });
16379                        }
16380                        __k if __k.starts_with('[') => {
16381                            let __v: ::buffa::serde_json::Value = map.next_value()?;
16382                            match ::buffa::extension_registry::deserialize_extension_key(
16383                                "google.protobuf.FeatureSet",
16384                                __k,
16385                                __v,
16386                            ) {
16387                                ::core::option::Option::Some(
16388                                    ::core::result::Result::Ok(__recs),
16389                                ) => {
16390                                    for __rec in __recs {
16391                                        __ext_records.push(__rec);
16392                                    }
16393                                }
16394                                ::core::option::Option::Some(
16395                                    ::core::result::Result::Err(__e),
16396                                ) => {
16397                                    return ::core::result::Result::Err(
16398                                        <A::Error as ::serde::de::Error>::custom(__e),
16399                                    );
16400                                }
16401                                ::core::option::Option::None => {}
16402                            }
16403                        }
16404                        _ => {
16405                            map.next_value::<::serde::de::IgnoredAny>()?;
16406                        }
16407                    }
16408                }
16409                let mut __r = <FeatureSet as ::core::default::Default>::default();
16410                if let ::core::option::Option::Some(v) = __f_field_presence {
16411                    __r.field_presence = v;
16412                }
16413                if let ::core::option::Option::Some(v) = __f_enum_type {
16414                    __r.enum_type = v;
16415                }
16416                if let ::core::option::Option::Some(v) = __f_repeated_field_encoding {
16417                    __r.repeated_field_encoding = v;
16418                }
16419                if let ::core::option::Option::Some(v) = __f_utf8_validation {
16420                    __r.utf8_validation = v;
16421                }
16422                if let ::core::option::Option::Some(v) = __f_message_encoding {
16423                    __r.message_encoding = v;
16424                }
16425                if let ::core::option::Option::Some(v) = __f_json_format {
16426                    __r.json_format = v;
16427                }
16428                if let ::core::option::Option::Some(v) = __f_enforce_naming_style {
16429                    __r.enforce_naming_style = v;
16430                }
16431                if let ::core::option::Option::Some(v) = __f_default_symbol_visibility {
16432                    __r.default_symbol_visibility = v;
16433                }
16434                for __rec in __ext_records {
16435                    __r.__buffa_unknown_fields.push(__rec);
16436                }
16437                Ok(__r)
16438            }
16439        }
16440        d.deserialize_map(_V)
16441    }
16442}
16443#[cfg(feature = "json")]
16444impl ::buffa::json_helpers::ProtoElemJson for FeatureSet {
16445    fn serialize_proto_json<S: ::serde::Serializer>(
16446        v: &Self,
16447        s: S,
16448    ) -> ::core::result::Result<S::Ok, S::Error> {
16449        ::serde::Serialize::serialize(v, s)
16450    }
16451    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16452        d: D,
16453    ) -> ::core::result::Result<Self, D::Error> {
16454        <Self as ::serde::Deserialize>::deserialize(d)
16455    }
16456}
16457#[doc(hidden)]
16458#[derive(Clone, Debug, Default, PartialEq)]
16459#[repr(transparent)]
16460#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16461pub struct __FeatureSetExtJson(pub ::buffa::UnknownFields);
16462impl ::core::ops::Deref for __FeatureSetExtJson {
16463    type Target = ::buffa::UnknownFields;
16464    fn deref(&self) -> &::buffa::UnknownFields {
16465        &self.0
16466    }
16467}
16468impl ::core::ops::DerefMut for __FeatureSetExtJson {
16469    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
16470        &mut self.0
16471    }
16472}
16473impl ::core::convert::From<::buffa::UnknownFields> for __FeatureSetExtJson {
16474    fn from(u: ::buffa::UnknownFields) -> Self {
16475        Self(u)
16476    }
16477}
16478#[cfg(feature = "json")]
16479impl ::serde::Serialize for __FeatureSetExtJson {
16480    fn serialize<S: ::serde::Serializer>(
16481        &self,
16482        s: S,
16483    ) -> ::core::result::Result<S::Ok, S::Error> {
16484        ::buffa::extension_registry::serialize_extensions(
16485            "google.protobuf.FeatureSet",
16486            &self.0,
16487            s,
16488        )
16489    }
16490}
16491#[cfg(feature = "json")]
16492impl<'de> ::serde::Deserialize<'de> for __FeatureSetExtJson {
16493    fn deserialize<D: ::serde::Deserializer<'de>>(
16494        d: D,
16495    ) -> ::core::result::Result<Self, D::Error> {
16496        ::buffa::extension_registry::deserialize_extensions(
16497                "google.protobuf.FeatureSet",
16498                d,
16499            )
16500            .map(Self)
16501    }
16502}
16503#[cfg(feature = "json")]
16504#[doc(hidden)]
16505pub const __FEATURE_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
16506    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16507    to_json: ::buffa::type_registry::any_to_json::<FeatureSet>,
16508    from_json: ::buffa::type_registry::any_from_json::<FeatureSet>,
16509    is_wkt: false,
16510};
16511#[cfg(feature = "text")]
16512#[doc(hidden)]
16513pub const __FEATURE_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
16514    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16515    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSet>,
16516    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSet>,
16517};
16518pub mod feature_set {
16519    #[allow(unused_imports)]
16520    use super::*;
16521    #[allow(non_camel_case_types)]
16522    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16523    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16524    #[repr(i32)]
16525    pub enum FieldPresence {
16526        FIELD_PRESENCE_UNKNOWN = 0i32,
16527        EXPLICIT = 1i32,
16528        IMPLICIT = 2i32,
16529        LEGACY_REQUIRED = 3i32,
16530    }
16531    impl FieldPresence {
16532        ///Idiomatic alias for [`Self::FIELD_PRESENCE_UNKNOWN`]; `Debug` prints the variant name.
16533        #[allow(non_upper_case_globals)]
16534        pub const FieldPresenceUnknown: Self = Self::FIELD_PRESENCE_UNKNOWN;
16535        ///Idiomatic alias for [`Self::EXPLICIT`]; `Debug` prints the variant name.
16536        #[allow(non_upper_case_globals)]
16537        pub const Explicit: Self = Self::EXPLICIT;
16538        ///Idiomatic alias for [`Self::IMPLICIT`]; `Debug` prints the variant name.
16539        #[allow(non_upper_case_globals)]
16540        pub const Implicit: Self = Self::IMPLICIT;
16541        ///Idiomatic alias for [`Self::LEGACY_REQUIRED`]; `Debug` prints the variant name.
16542        #[allow(non_upper_case_globals)]
16543        pub const LegacyRequired: Self = Self::LEGACY_REQUIRED;
16544    }
16545    impl ::core::default::Default for FieldPresence {
16546        fn default() -> Self {
16547            Self::FIELD_PRESENCE_UNKNOWN
16548        }
16549    }
16550    #[cfg(feature = "json")]
16551    const _: () = {
16552        impl ::serde::Serialize for FieldPresence {
16553            fn serialize<S: ::serde::Serializer>(
16554                &self,
16555                s: S,
16556            ) -> ::core::result::Result<S::Ok, S::Error> {
16557                s.serialize_str(::buffa::Enumeration::proto_name(self))
16558            }
16559        }
16560        impl<'de> ::serde::Deserialize<'de> for FieldPresence {
16561            fn deserialize<D: ::serde::Deserializer<'de>>(
16562                d: D,
16563            ) -> ::core::result::Result<Self, D::Error> {
16564                struct _V;
16565                impl ::serde::de::Visitor<'_> for _V {
16566                    type Value = FieldPresence;
16567                    fn expecting(
16568                        &self,
16569                        f: &mut ::core::fmt::Formatter<'_>,
16570                    ) -> ::core::fmt::Result {
16571                        f.write_str(
16572                            concat!(
16573                                "a string, integer, or null for ", stringify!(FieldPresence)
16574                            ),
16575                        )
16576                    }
16577                    fn visit_str<E: ::serde::de::Error>(
16578                        self,
16579                        v: &str,
16580                    ) -> ::core::result::Result<FieldPresence, E> {
16581                        <FieldPresence as ::buffa::Enumeration>::from_proto_name(v)
16582                            .ok_or_else(|| {
16583                                ::serde::de::Error::unknown_variant(v, &[])
16584                            })
16585                    }
16586                    fn visit_i64<E: ::serde::de::Error>(
16587                        self,
16588                        v: i64,
16589                    ) -> ::core::result::Result<FieldPresence, E> {
16590                        let v32 = i32::try_from(v)
16591                            .map_err(|_| {
16592                                ::serde::de::Error::custom(
16593                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16594                                )
16595                            })?;
16596                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16597                            .ok_or_else(|| {
16598                                ::serde::de::Error::custom(
16599                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16600                                )
16601                            })
16602                    }
16603                    fn visit_u64<E: ::serde::de::Error>(
16604                        self,
16605                        v: u64,
16606                    ) -> ::core::result::Result<FieldPresence, E> {
16607                        let v32 = i32::try_from(v)
16608                            .map_err(|_| {
16609                                ::serde::de::Error::custom(
16610                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16611                                )
16612                            })?;
16613                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16614                            .ok_or_else(|| {
16615                                ::serde::de::Error::custom(
16616                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16617                                )
16618                            })
16619                    }
16620                    fn visit_unit<E: ::serde::de::Error>(
16621                        self,
16622                    ) -> ::core::result::Result<FieldPresence, E> {
16623                        ::core::result::Result::Ok(::core::default::Default::default())
16624                    }
16625                }
16626                d.deserialize_any(_V)
16627            }
16628        }
16629        impl ::buffa::json_helpers::ProtoElemJson for FieldPresence {
16630            fn serialize_proto_json<S: ::serde::Serializer>(
16631                v: &Self,
16632                s: S,
16633            ) -> ::core::result::Result<S::Ok, S::Error> {
16634                ::serde::Serialize::serialize(v, s)
16635            }
16636            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16637                d: D,
16638            ) -> ::core::result::Result<Self, D::Error> {
16639                <Self as ::serde::Deserialize>::deserialize(d)
16640            }
16641        }
16642    };
16643    impl ::buffa::Enumeration for FieldPresence {
16644        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16645            match value {
16646                0i32 => ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
16647                1i32 => ::core::option::Option::Some(Self::EXPLICIT),
16648                2i32 => ::core::option::Option::Some(Self::IMPLICIT),
16649                3i32 => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16650                _ => ::core::option::Option::None,
16651            }
16652        }
16653        fn to_i32(&self) -> i32 {
16654            *self as i32
16655        }
16656        fn proto_name(&self) -> &'static str {
16657            match self {
16658                Self::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN",
16659                Self::EXPLICIT => "EXPLICIT",
16660                Self::IMPLICIT => "IMPLICIT",
16661                Self::LEGACY_REQUIRED => "LEGACY_REQUIRED",
16662            }
16663        }
16664        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16665            match name {
16666                "FIELD_PRESENCE_UNKNOWN" => {
16667                    ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN)
16668                }
16669                "EXPLICIT" => ::core::option::Option::Some(Self::EXPLICIT),
16670                "IMPLICIT" => ::core::option::Option::Some(Self::IMPLICIT),
16671                "LEGACY_REQUIRED" => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16672                _ => ::core::option::Option::None,
16673            }
16674        }
16675        fn values() -> &'static [Self] {
16676            &[
16677                Self::FIELD_PRESENCE_UNKNOWN,
16678                Self::EXPLICIT,
16679                Self::IMPLICIT,
16680                Self::LEGACY_REQUIRED,
16681            ]
16682        }
16683    }
16684    #[allow(non_camel_case_types)]
16685    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16686    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16687    #[repr(i32)]
16688    pub enum EnumType {
16689        ENUM_TYPE_UNKNOWN = 0i32,
16690        OPEN = 1i32,
16691        CLOSED = 2i32,
16692    }
16693    impl EnumType {
16694        ///Idiomatic alias for [`Self::ENUM_TYPE_UNKNOWN`]; `Debug` prints the variant name.
16695        #[allow(non_upper_case_globals)]
16696        pub const EnumTypeUnknown: Self = Self::ENUM_TYPE_UNKNOWN;
16697        ///Idiomatic alias for [`Self::OPEN`]; `Debug` prints the variant name.
16698        #[allow(non_upper_case_globals)]
16699        pub const Open: Self = Self::OPEN;
16700        ///Idiomatic alias for [`Self::CLOSED`]; `Debug` prints the variant name.
16701        #[allow(non_upper_case_globals)]
16702        pub const Closed: Self = Self::CLOSED;
16703    }
16704    impl ::core::default::Default for EnumType {
16705        fn default() -> Self {
16706            Self::ENUM_TYPE_UNKNOWN
16707        }
16708    }
16709    #[cfg(feature = "json")]
16710    const _: () = {
16711        impl ::serde::Serialize for EnumType {
16712            fn serialize<S: ::serde::Serializer>(
16713                &self,
16714                s: S,
16715            ) -> ::core::result::Result<S::Ok, S::Error> {
16716                s.serialize_str(::buffa::Enumeration::proto_name(self))
16717            }
16718        }
16719        impl<'de> ::serde::Deserialize<'de> for EnumType {
16720            fn deserialize<D: ::serde::Deserializer<'de>>(
16721                d: D,
16722            ) -> ::core::result::Result<Self, D::Error> {
16723                struct _V;
16724                impl ::serde::de::Visitor<'_> for _V {
16725                    type Value = EnumType;
16726                    fn expecting(
16727                        &self,
16728                        f: &mut ::core::fmt::Formatter<'_>,
16729                    ) -> ::core::fmt::Result {
16730                        f.write_str(
16731                            concat!(
16732                                "a string, integer, or null for ", stringify!(EnumType)
16733                            ),
16734                        )
16735                    }
16736                    fn visit_str<E: ::serde::de::Error>(
16737                        self,
16738                        v: &str,
16739                    ) -> ::core::result::Result<EnumType, E> {
16740                        <EnumType as ::buffa::Enumeration>::from_proto_name(v)
16741                            .ok_or_else(|| {
16742                                ::serde::de::Error::unknown_variant(v, &[])
16743                            })
16744                    }
16745                    fn visit_i64<E: ::serde::de::Error>(
16746                        self,
16747                        v: i64,
16748                    ) -> ::core::result::Result<EnumType, E> {
16749                        let v32 = i32::try_from(v)
16750                            .map_err(|_| {
16751                                ::serde::de::Error::custom(
16752                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16753                                )
16754                            })?;
16755                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16756                            .ok_or_else(|| {
16757                                ::serde::de::Error::custom(
16758                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16759                                )
16760                            })
16761                    }
16762                    fn visit_u64<E: ::serde::de::Error>(
16763                        self,
16764                        v: u64,
16765                    ) -> ::core::result::Result<EnumType, E> {
16766                        let v32 = i32::try_from(v)
16767                            .map_err(|_| {
16768                                ::serde::de::Error::custom(
16769                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16770                                )
16771                            })?;
16772                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16773                            .ok_or_else(|| {
16774                                ::serde::de::Error::custom(
16775                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16776                                )
16777                            })
16778                    }
16779                    fn visit_unit<E: ::serde::de::Error>(
16780                        self,
16781                    ) -> ::core::result::Result<EnumType, E> {
16782                        ::core::result::Result::Ok(::core::default::Default::default())
16783                    }
16784                }
16785                d.deserialize_any(_V)
16786            }
16787        }
16788        impl ::buffa::json_helpers::ProtoElemJson for EnumType {
16789            fn serialize_proto_json<S: ::serde::Serializer>(
16790                v: &Self,
16791                s: S,
16792            ) -> ::core::result::Result<S::Ok, S::Error> {
16793                ::serde::Serialize::serialize(v, s)
16794            }
16795            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16796                d: D,
16797            ) -> ::core::result::Result<Self, D::Error> {
16798                <Self as ::serde::Deserialize>::deserialize(d)
16799            }
16800        }
16801    };
16802    impl ::buffa::Enumeration for EnumType {
16803        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16804            match value {
16805                0i32 => ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
16806                1i32 => ::core::option::Option::Some(Self::OPEN),
16807                2i32 => ::core::option::Option::Some(Self::CLOSED),
16808                _ => ::core::option::Option::None,
16809            }
16810        }
16811        fn to_i32(&self) -> i32 {
16812            *self as i32
16813        }
16814        fn proto_name(&self) -> &'static str {
16815            match self {
16816                Self::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN",
16817                Self::OPEN => "OPEN",
16818                Self::CLOSED => "CLOSED",
16819            }
16820        }
16821        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16822            match name {
16823                "ENUM_TYPE_UNKNOWN" => {
16824                    ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN)
16825                }
16826                "OPEN" => ::core::option::Option::Some(Self::OPEN),
16827                "CLOSED" => ::core::option::Option::Some(Self::CLOSED),
16828                _ => ::core::option::Option::None,
16829            }
16830        }
16831        fn values() -> &'static [Self] {
16832            &[Self::ENUM_TYPE_UNKNOWN, Self::OPEN, Self::CLOSED]
16833        }
16834    }
16835    #[allow(non_camel_case_types)]
16836    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16837    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16838    #[repr(i32)]
16839    pub enum RepeatedFieldEncoding {
16840        REPEATED_FIELD_ENCODING_UNKNOWN = 0i32,
16841        PACKED = 1i32,
16842        EXPANDED = 2i32,
16843    }
16844    impl RepeatedFieldEncoding {
16845        ///Idiomatic alias for [`Self::REPEATED_FIELD_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
16846        #[allow(non_upper_case_globals)]
16847        pub const RepeatedFieldEncodingUnknown: Self = Self::REPEATED_FIELD_ENCODING_UNKNOWN;
16848        ///Idiomatic alias for [`Self::PACKED`]; `Debug` prints the variant name.
16849        #[allow(non_upper_case_globals)]
16850        pub const Packed: Self = Self::PACKED;
16851        ///Idiomatic alias for [`Self::EXPANDED`]; `Debug` prints the variant name.
16852        #[allow(non_upper_case_globals)]
16853        pub const Expanded: Self = Self::EXPANDED;
16854    }
16855    impl ::core::default::Default for RepeatedFieldEncoding {
16856        fn default() -> Self {
16857            Self::REPEATED_FIELD_ENCODING_UNKNOWN
16858        }
16859    }
16860    #[cfg(feature = "json")]
16861    const _: () = {
16862        impl ::serde::Serialize for RepeatedFieldEncoding {
16863            fn serialize<S: ::serde::Serializer>(
16864                &self,
16865                s: S,
16866            ) -> ::core::result::Result<S::Ok, S::Error> {
16867                s.serialize_str(::buffa::Enumeration::proto_name(self))
16868            }
16869        }
16870        impl<'de> ::serde::Deserialize<'de> for RepeatedFieldEncoding {
16871            fn deserialize<D: ::serde::Deserializer<'de>>(
16872                d: D,
16873            ) -> ::core::result::Result<Self, D::Error> {
16874                struct _V;
16875                impl ::serde::de::Visitor<'_> for _V {
16876                    type Value = RepeatedFieldEncoding;
16877                    fn expecting(
16878                        &self,
16879                        f: &mut ::core::fmt::Formatter<'_>,
16880                    ) -> ::core::fmt::Result {
16881                        f.write_str(
16882                            concat!(
16883                                "a string, integer, or null for ",
16884                                stringify!(RepeatedFieldEncoding)
16885                            ),
16886                        )
16887                    }
16888                    fn visit_str<E: ::serde::de::Error>(
16889                        self,
16890                        v: &str,
16891                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16892                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_proto_name(
16893                                v,
16894                            )
16895                            .ok_or_else(|| {
16896                                ::serde::de::Error::unknown_variant(v, &[])
16897                            })
16898                    }
16899                    fn visit_i64<E: ::serde::de::Error>(
16900                        self,
16901                        v: i64,
16902                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16903                        let v32 = i32::try_from(v)
16904                            .map_err(|_| {
16905                                ::serde::de::Error::custom(
16906                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16907                                )
16908                            })?;
16909                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16910                            .ok_or_else(|| {
16911                                ::serde::de::Error::custom(
16912                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16913                                )
16914                            })
16915                    }
16916                    fn visit_u64<E: ::serde::de::Error>(
16917                        self,
16918                        v: u64,
16919                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16920                        let v32 = i32::try_from(v)
16921                            .map_err(|_| {
16922                                ::serde::de::Error::custom(
16923                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16924                                )
16925                            })?;
16926                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16927                            .ok_or_else(|| {
16928                                ::serde::de::Error::custom(
16929                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16930                                )
16931                            })
16932                    }
16933                    fn visit_unit<E: ::serde::de::Error>(
16934                        self,
16935                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16936                        ::core::result::Result::Ok(::core::default::Default::default())
16937                    }
16938                }
16939                d.deserialize_any(_V)
16940            }
16941        }
16942        impl ::buffa::json_helpers::ProtoElemJson for RepeatedFieldEncoding {
16943            fn serialize_proto_json<S: ::serde::Serializer>(
16944                v: &Self,
16945                s: S,
16946            ) -> ::core::result::Result<S::Ok, S::Error> {
16947                ::serde::Serialize::serialize(v, s)
16948            }
16949            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16950                d: D,
16951            ) -> ::core::result::Result<Self, D::Error> {
16952                <Self as ::serde::Deserialize>::deserialize(d)
16953            }
16954        }
16955    };
16956    impl ::buffa::Enumeration for RepeatedFieldEncoding {
16957        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16958            match value {
16959                0i32 => {
16960                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16961                }
16962                1i32 => ::core::option::Option::Some(Self::PACKED),
16963                2i32 => ::core::option::Option::Some(Self::EXPANDED),
16964                _ => ::core::option::Option::None,
16965            }
16966        }
16967        fn to_i32(&self) -> i32 {
16968            *self as i32
16969        }
16970        fn proto_name(&self) -> &'static str {
16971            match self {
16972                Self::REPEATED_FIELD_ENCODING_UNKNOWN => {
16973                    "REPEATED_FIELD_ENCODING_UNKNOWN"
16974                }
16975                Self::PACKED => "PACKED",
16976                Self::EXPANDED => "EXPANDED",
16977            }
16978        }
16979        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16980            match name {
16981                "REPEATED_FIELD_ENCODING_UNKNOWN" => {
16982                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16983                }
16984                "PACKED" => ::core::option::Option::Some(Self::PACKED),
16985                "EXPANDED" => ::core::option::Option::Some(Self::EXPANDED),
16986                _ => ::core::option::Option::None,
16987            }
16988        }
16989        fn values() -> &'static [Self] {
16990            &[Self::REPEATED_FIELD_ENCODING_UNKNOWN, Self::PACKED, Self::EXPANDED]
16991        }
16992    }
16993    #[allow(non_camel_case_types)]
16994    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16995    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16996    #[repr(i32)]
16997    pub enum Utf8Validation {
16998        UTF8_VALIDATION_UNKNOWN = 0i32,
16999        VERIFY = 2i32,
17000        NONE = 3i32,
17001    }
17002    impl Utf8Validation {
17003        ///Idiomatic alias for [`Self::UTF8_VALIDATION_UNKNOWN`]; `Debug` prints the variant name.
17004        #[allow(non_upper_case_globals)]
17005        pub const Utf8ValidationUnknown: Self = Self::UTF8_VALIDATION_UNKNOWN;
17006        ///Idiomatic alias for [`Self::VERIFY`]; `Debug` prints the variant name.
17007        #[allow(non_upper_case_globals)]
17008        pub const Verify: Self = Self::VERIFY;
17009        ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
17010        #[allow(non_upper_case_globals)]
17011        pub const None: Self = Self::NONE;
17012    }
17013    impl ::core::default::Default for Utf8Validation {
17014        fn default() -> Self {
17015            Self::UTF8_VALIDATION_UNKNOWN
17016        }
17017    }
17018    #[cfg(feature = "json")]
17019    const _: () = {
17020        impl ::serde::Serialize for Utf8Validation {
17021            fn serialize<S: ::serde::Serializer>(
17022                &self,
17023                s: S,
17024            ) -> ::core::result::Result<S::Ok, S::Error> {
17025                s.serialize_str(::buffa::Enumeration::proto_name(self))
17026            }
17027        }
17028        impl<'de> ::serde::Deserialize<'de> for Utf8Validation {
17029            fn deserialize<D: ::serde::Deserializer<'de>>(
17030                d: D,
17031            ) -> ::core::result::Result<Self, D::Error> {
17032                struct _V;
17033                impl ::serde::de::Visitor<'_> for _V {
17034                    type Value = Utf8Validation;
17035                    fn expecting(
17036                        &self,
17037                        f: &mut ::core::fmt::Formatter<'_>,
17038                    ) -> ::core::fmt::Result {
17039                        f.write_str(
17040                            concat!(
17041                                "a string, integer, or null for ",
17042                                stringify!(Utf8Validation)
17043                            ),
17044                        )
17045                    }
17046                    fn visit_str<E: ::serde::de::Error>(
17047                        self,
17048                        v: &str,
17049                    ) -> ::core::result::Result<Utf8Validation, E> {
17050                        <Utf8Validation as ::buffa::Enumeration>::from_proto_name(v)
17051                            .ok_or_else(|| {
17052                                ::serde::de::Error::unknown_variant(v, &[])
17053                            })
17054                    }
17055                    fn visit_i64<E: ::serde::de::Error>(
17056                        self,
17057                        v: i64,
17058                    ) -> ::core::result::Result<Utf8Validation, E> {
17059                        let v32 = i32::try_from(v)
17060                            .map_err(|_| {
17061                                ::serde::de::Error::custom(
17062                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17063                                )
17064                            })?;
17065                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17066                            .ok_or_else(|| {
17067                                ::serde::de::Error::custom(
17068                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17069                                )
17070                            })
17071                    }
17072                    fn visit_u64<E: ::serde::de::Error>(
17073                        self,
17074                        v: u64,
17075                    ) -> ::core::result::Result<Utf8Validation, E> {
17076                        let v32 = i32::try_from(v)
17077                            .map_err(|_| {
17078                                ::serde::de::Error::custom(
17079                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17080                                )
17081                            })?;
17082                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17083                            .ok_or_else(|| {
17084                                ::serde::de::Error::custom(
17085                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17086                                )
17087                            })
17088                    }
17089                    fn visit_unit<E: ::serde::de::Error>(
17090                        self,
17091                    ) -> ::core::result::Result<Utf8Validation, E> {
17092                        ::core::result::Result::Ok(::core::default::Default::default())
17093                    }
17094                }
17095                d.deserialize_any(_V)
17096            }
17097        }
17098        impl ::buffa::json_helpers::ProtoElemJson for Utf8Validation {
17099            fn serialize_proto_json<S: ::serde::Serializer>(
17100                v: &Self,
17101                s: S,
17102            ) -> ::core::result::Result<S::Ok, S::Error> {
17103                ::serde::Serialize::serialize(v, s)
17104            }
17105            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17106                d: D,
17107            ) -> ::core::result::Result<Self, D::Error> {
17108                <Self as ::serde::Deserialize>::deserialize(d)
17109            }
17110        }
17111    };
17112    impl ::buffa::Enumeration for Utf8Validation {
17113        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17114            match value {
17115                0i32 => ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN),
17116                2i32 => ::core::option::Option::Some(Self::VERIFY),
17117                3i32 => ::core::option::Option::Some(Self::NONE),
17118                _ => ::core::option::Option::None,
17119            }
17120        }
17121        fn to_i32(&self) -> i32 {
17122            *self as i32
17123        }
17124        fn proto_name(&self) -> &'static str {
17125            match self {
17126                Self::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN",
17127                Self::VERIFY => "VERIFY",
17128                Self::NONE => "NONE",
17129            }
17130        }
17131        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17132            match name {
17133                "UTF8_VALIDATION_UNKNOWN" => {
17134                    ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
17135                }
17136                "VERIFY" => ::core::option::Option::Some(Self::VERIFY),
17137                "NONE" => ::core::option::Option::Some(Self::NONE),
17138                _ => ::core::option::Option::None,
17139            }
17140        }
17141        fn values() -> &'static [Self] {
17142            &[Self::UTF8_VALIDATION_UNKNOWN, Self::VERIFY, Self::NONE]
17143        }
17144    }
17145    #[allow(non_camel_case_types)]
17146    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17147    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17148    #[repr(i32)]
17149    pub enum MessageEncoding {
17150        MESSAGE_ENCODING_UNKNOWN = 0i32,
17151        LENGTH_PREFIXED = 1i32,
17152        DELIMITED = 2i32,
17153    }
17154    impl MessageEncoding {
17155        ///Idiomatic alias for [`Self::MESSAGE_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
17156        #[allow(non_upper_case_globals)]
17157        pub const MessageEncodingUnknown: Self = Self::MESSAGE_ENCODING_UNKNOWN;
17158        ///Idiomatic alias for [`Self::LENGTH_PREFIXED`]; `Debug` prints the variant name.
17159        #[allow(non_upper_case_globals)]
17160        pub const LengthPrefixed: Self = Self::LENGTH_PREFIXED;
17161        ///Idiomatic alias for [`Self::DELIMITED`]; `Debug` prints the variant name.
17162        #[allow(non_upper_case_globals)]
17163        pub const Delimited: Self = Self::DELIMITED;
17164    }
17165    impl ::core::default::Default for MessageEncoding {
17166        fn default() -> Self {
17167            Self::MESSAGE_ENCODING_UNKNOWN
17168        }
17169    }
17170    #[cfg(feature = "json")]
17171    const _: () = {
17172        impl ::serde::Serialize for MessageEncoding {
17173            fn serialize<S: ::serde::Serializer>(
17174                &self,
17175                s: S,
17176            ) -> ::core::result::Result<S::Ok, S::Error> {
17177                s.serialize_str(::buffa::Enumeration::proto_name(self))
17178            }
17179        }
17180        impl<'de> ::serde::Deserialize<'de> for MessageEncoding {
17181            fn deserialize<D: ::serde::Deserializer<'de>>(
17182                d: D,
17183            ) -> ::core::result::Result<Self, D::Error> {
17184                struct _V;
17185                impl ::serde::de::Visitor<'_> for _V {
17186                    type Value = MessageEncoding;
17187                    fn expecting(
17188                        &self,
17189                        f: &mut ::core::fmt::Formatter<'_>,
17190                    ) -> ::core::fmt::Result {
17191                        f.write_str(
17192                            concat!(
17193                                "a string, integer, or null for ",
17194                                stringify!(MessageEncoding)
17195                            ),
17196                        )
17197                    }
17198                    fn visit_str<E: ::serde::de::Error>(
17199                        self,
17200                        v: &str,
17201                    ) -> ::core::result::Result<MessageEncoding, E> {
17202                        <MessageEncoding as ::buffa::Enumeration>::from_proto_name(v)
17203                            .ok_or_else(|| {
17204                                ::serde::de::Error::unknown_variant(v, &[])
17205                            })
17206                    }
17207                    fn visit_i64<E: ::serde::de::Error>(
17208                        self,
17209                        v: i64,
17210                    ) -> ::core::result::Result<MessageEncoding, E> {
17211                        let v32 = i32::try_from(v)
17212                            .map_err(|_| {
17213                                ::serde::de::Error::custom(
17214                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17215                                )
17216                            })?;
17217                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17218                            .ok_or_else(|| {
17219                                ::serde::de::Error::custom(
17220                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17221                                )
17222                            })
17223                    }
17224                    fn visit_u64<E: ::serde::de::Error>(
17225                        self,
17226                        v: u64,
17227                    ) -> ::core::result::Result<MessageEncoding, E> {
17228                        let v32 = i32::try_from(v)
17229                            .map_err(|_| {
17230                                ::serde::de::Error::custom(
17231                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17232                                )
17233                            })?;
17234                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17235                            .ok_or_else(|| {
17236                                ::serde::de::Error::custom(
17237                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17238                                )
17239                            })
17240                    }
17241                    fn visit_unit<E: ::serde::de::Error>(
17242                        self,
17243                    ) -> ::core::result::Result<MessageEncoding, E> {
17244                        ::core::result::Result::Ok(::core::default::Default::default())
17245                    }
17246                }
17247                d.deserialize_any(_V)
17248            }
17249        }
17250        impl ::buffa::json_helpers::ProtoElemJson for MessageEncoding {
17251            fn serialize_proto_json<S: ::serde::Serializer>(
17252                v: &Self,
17253                s: S,
17254            ) -> ::core::result::Result<S::Ok, S::Error> {
17255                ::serde::Serialize::serialize(v, s)
17256            }
17257            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17258                d: D,
17259            ) -> ::core::result::Result<Self, D::Error> {
17260                <Self as ::serde::Deserialize>::deserialize(d)
17261            }
17262        }
17263    };
17264    impl ::buffa::Enumeration for MessageEncoding {
17265        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17266            match value {
17267                0i32 => ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN),
17268                1i32 => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17269                2i32 => ::core::option::Option::Some(Self::DELIMITED),
17270                _ => ::core::option::Option::None,
17271            }
17272        }
17273        fn to_i32(&self) -> i32 {
17274            *self as i32
17275        }
17276        fn proto_name(&self) -> &'static str {
17277            match self {
17278                Self::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN",
17279                Self::LENGTH_PREFIXED => "LENGTH_PREFIXED",
17280                Self::DELIMITED => "DELIMITED",
17281            }
17282        }
17283        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17284            match name {
17285                "MESSAGE_ENCODING_UNKNOWN" => {
17286                    ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
17287                }
17288                "LENGTH_PREFIXED" => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17289                "DELIMITED" => ::core::option::Option::Some(Self::DELIMITED),
17290                _ => ::core::option::Option::None,
17291            }
17292        }
17293        fn values() -> &'static [Self] {
17294            &[Self::MESSAGE_ENCODING_UNKNOWN, Self::LENGTH_PREFIXED, Self::DELIMITED]
17295        }
17296    }
17297    #[allow(non_camel_case_types)]
17298    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17299    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17300    #[repr(i32)]
17301    pub enum JsonFormat {
17302        JSON_FORMAT_UNKNOWN = 0i32,
17303        ALLOW = 1i32,
17304        LEGACY_BEST_EFFORT = 2i32,
17305    }
17306    impl JsonFormat {
17307        ///Idiomatic alias for [`Self::JSON_FORMAT_UNKNOWN`]; `Debug` prints the variant name.
17308        #[allow(non_upper_case_globals)]
17309        pub const JsonFormatUnknown: Self = Self::JSON_FORMAT_UNKNOWN;
17310        ///Idiomatic alias for [`Self::ALLOW`]; `Debug` prints the variant name.
17311        #[allow(non_upper_case_globals)]
17312        pub const Allow: Self = Self::ALLOW;
17313        ///Idiomatic alias for [`Self::LEGACY_BEST_EFFORT`]; `Debug` prints the variant name.
17314        #[allow(non_upper_case_globals)]
17315        pub const LegacyBestEffort: Self = Self::LEGACY_BEST_EFFORT;
17316    }
17317    impl ::core::default::Default for JsonFormat {
17318        fn default() -> Self {
17319            Self::JSON_FORMAT_UNKNOWN
17320        }
17321    }
17322    #[cfg(feature = "json")]
17323    const _: () = {
17324        impl ::serde::Serialize for JsonFormat {
17325            fn serialize<S: ::serde::Serializer>(
17326                &self,
17327                s: S,
17328            ) -> ::core::result::Result<S::Ok, S::Error> {
17329                s.serialize_str(::buffa::Enumeration::proto_name(self))
17330            }
17331        }
17332        impl<'de> ::serde::Deserialize<'de> for JsonFormat {
17333            fn deserialize<D: ::serde::Deserializer<'de>>(
17334                d: D,
17335            ) -> ::core::result::Result<Self, D::Error> {
17336                struct _V;
17337                impl ::serde::de::Visitor<'_> for _V {
17338                    type Value = JsonFormat;
17339                    fn expecting(
17340                        &self,
17341                        f: &mut ::core::fmt::Formatter<'_>,
17342                    ) -> ::core::fmt::Result {
17343                        f.write_str(
17344                            concat!(
17345                                "a string, integer, or null for ", stringify!(JsonFormat)
17346                            ),
17347                        )
17348                    }
17349                    fn visit_str<E: ::serde::de::Error>(
17350                        self,
17351                        v: &str,
17352                    ) -> ::core::result::Result<JsonFormat, E> {
17353                        <JsonFormat as ::buffa::Enumeration>::from_proto_name(v)
17354                            .ok_or_else(|| {
17355                                ::serde::de::Error::unknown_variant(v, &[])
17356                            })
17357                    }
17358                    fn visit_i64<E: ::serde::de::Error>(
17359                        self,
17360                        v: i64,
17361                    ) -> ::core::result::Result<JsonFormat, E> {
17362                        let v32 = i32::try_from(v)
17363                            .map_err(|_| {
17364                                ::serde::de::Error::custom(
17365                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17366                                )
17367                            })?;
17368                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
17369                            .ok_or_else(|| {
17370                                ::serde::de::Error::custom(
17371                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17372                                )
17373                            })
17374                    }
17375                    fn visit_u64<E: ::serde::de::Error>(
17376                        self,
17377                        v: u64,
17378                    ) -> ::core::result::Result<JsonFormat, E> {
17379                        let v32 = i32::try_from(v)
17380                            .map_err(|_| {
17381                                ::serde::de::Error::custom(
17382                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17383                                )
17384                            })?;
17385                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
17386                            .ok_or_else(|| {
17387                                ::serde::de::Error::custom(
17388                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17389                                )
17390                            })
17391                    }
17392                    fn visit_unit<E: ::serde::de::Error>(
17393                        self,
17394                    ) -> ::core::result::Result<JsonFormat, E> {
17395                        ::core::result::Result::Ok(::core::default::Default::default())
17396                    }
17397                }
17398                d.deserialize_any(_V)
17399            }
17400        }
17401        impl ::buffa::json_helpers::ProtoElemJson for JsonFormat {
17402            fn serialize_proto_json<S: ::serde::Serializer>(
17403                v: &Self,
17404                s: S,
17405            ) -> ::core::result::Result<S::Ok, S::Error> {
17406                ::serde::Serialize::serialize(v, s)
17407            }
17408            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17409                d: D,
17410            ) -> ::core::result::Result<Self, D::Error> {
17411                <Self as ::serde::Deserialize>::deserialize(d)
17412            }
17413        }
17414    };
17415    impl ::buffa::Enumeration for JsonFormat {
17416        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17417            match value {
17418                0i32 => ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
17419                1i32 => ::core::option::Option::Some(Self::ALLOW),
17420                2i32 => ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT),
17421                _ => ::core::option::Option::None,
17422            }
17423        }
17424        fn to_i32(&self) -> i32 {
17425            *self as i32
17426        }
17427        fn proto_name(&self) -> &'static str {
17428            match self {
17429                Self::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN",
17430                Self::ALLOW => "ALLOW",
17431                Self::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT",
17432            }
17433        }
17434        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17435            match name {
17436                "JSON_FORMAT_UNKNOWN" => {
17437                    ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN)
17438                }
17439                "ALLOW" => ::core::option::Option::Some(Self::ALLOW),
17440                "LEGACY_BEST_EFFORT" => {
17441                    ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT)
17442                }
17443                _ => ::core::option::Option::None,
17444            }
17445        }
17446        fn values() -> &'static [Self] {
17447            &[Self::JSON_FORMAT_UNKNOWN, Self::ALLOW, Self::LEGACY_BEST_EFFORT]
17448        }
17449    }
17450    #[allow(non_camel_case_types)]
17451    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17452    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17453    #[repr(i32)]
17454    pub enum EnforceNamingStyle {
17455        ENFORCE_NAMING_STYLE_UNKNOWN = 0i32,
17456        STYLE2024 = 1i32,
17457        STYLE_LEGACY = 2i32,
17458    }
17459    impl EnforceNamingStyle {
17460        ///Idiomatic alias for [`Self::ENFORCE_NAMING_STYLE_UNKNOWN`]; `Debug` prints the variant name.
17461        #[allow(non_upper_case_globals)]
17462        pub const EnforceNamingStyleUnknown: Self = Self::ENFORCE_NAMING_STYLE_UNKNOWN;
17463        ///Idiomatic alias for [`Self::STYLE2024`]; `Debug` prints the variant name.
17464        #[allow(non_upper_case_globals)]
17465        pub const Style2024: Self = Self::STYLE2024;
17466        ///Idiomatic alias for [`Self::STYLE_LEGACY`]; `Debug` prints the variant name.
17467        #[allow(non_upper_case_globals)]
17468        pub const StyleLegacy: Self = Self::STYLE_LEGACY;
17469    }
17470    impl ::core::default::Default for EnforceNamingStyle {
17471        fn default() -> Self {
17472            Self::ENFORCE_NAMING_STYLE_UNKNOWN
17473        }
17474    }
17475    #[cfg(feature = "json")]
17476    const _: () = {
17477        impl ::serde::Serialize for EnforceNamingStyle {
17478            fn serialize<S: ::serde::Serializer>(
17479                &self,
17480                s: S,
17481            ) -> ::core::result::Result<S::Ok, S::Error> {
17482                s.serialize_str(::buffa::Enumeration::proto_name(self))
17483            }
17484        }
17485        impl<'de> ::serde::Deserialize<'de> for EnforceNamingStyle {
17486            fn deserialize<D: ::serde::Deserializer<'de>>(
17487                d: D,
17488            ) -> ::core::result::Result<Self, D::Error> {
17489                struct _V;
17490                impl ::serde::de::Visitor<'_> for _V {
17491                    type Value = EnforceNamingStyle;
17492                    fn expecting(
17493                        &self,
17494                        f: &mut ::core::fmt::Formatter<'_>,
17495                    ) -> ::core::fmt::Result {
17496                        f.write_str(
17497                            concat!(
17498                                "a string, integer, or null for ",
17499                                stringify!(EnforceNamingStyle)
17500                            ),
17501                        )
17502                    }
17503                    fn visit_str<E: ::serde::de::Error>(
17504                        self,
17505                        v: &str,
17506                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17507                        <EnforceNamingStyle as ::buffa::Enumeration>::from_proto_name(v)
17508                            .ok_or_else(|| {
17509                                ::serde::de::Error::unknown_variant(v, &[])
17510                            })
17511                    }
17512                    fn visit_i64<E: ::serde::de::Error>(
17513                        self,
17514                        v: i64,
17515                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17516                        let v32 = i32::try_from(v)
17517                            .map_err(|_| {
17518                                ::serde::de::Error::custom(
17519                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17520                                )
17521                            })?;
17522                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17523                            .ok_or_else(|| {
17524                                ::serde::de::Error::custom(
17525                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17526                                )
17527                            })
17528                    }
17529                    fn visit_u64<E: ::serde::de::Error>(
17530                        self,
17531                        v: u64,
17532                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17533                        let v32 = i32::try_from(v)
17534                            .map_err(|_| {
17535                                ::serde::de::Error::custom(
17536                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17537                                )
17538                            })?;
17539                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17540                            .ok_or_else(|| {
17541                                ::serde::de::Error::custom(
17542                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17543                                )
17544                            })
17545                    }
17546                    fn visit_unit<E: ::serde::de::Error>(
17547                        self,
17548                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17549                        ::core::result::Result::Ok(::core::default::Default::default())
17550                    }
17551                }
17552                d.deserialize_any(_V)
17553            }
17554        }
17555        impl ::buffa::json_helpers::ProtoElemJson for EnforceNamingStyle {
17556            fn serialize_proto_json<S: ::serde::Serializer>(
17557                v: &Self,
17558                s: S,
17559            ) -> ::core::result::Result<S::Ok, S::Error> {
17560                ::serde::Serialize::serialize(v, s)
17561            }
17562            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17563                d: D,
17564            ) -> ::core::result::Result<Self, D::Error> {
17565                <Self as ::serde::Deserialize>::deserialize(d)
17566            }
17567        }
17568    };
17569    impl ::buffa::Enumeration for EnforceNamingStyle {
17570        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17571            match value {
17572                0i32 => ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN),
17573                1i32 => ::core::option::Option::Some(Self::STYLE2024),
17574                2i32 => ::core::option::Option::Some(Self::STYLE_LEGACY),
17575                _ => ::core::option::Option::None,
17576            }
17577        }
17578        fn to_i32(&self) -> i32 {
17579            *self as i32
17580        }
17581        fn proto_name(&self) -> &'static str {
17582            match self {
17583                Self::ENFORCE_NAMING_STYLE_UNKNOWN => "ENFORCE_NAMING_STYLE_UNKNOWN",
17584                Self::STYLE2024 => "STYLE2024",
17585                Self::STYLE_LEGACY => "STYLE_LEGACY",
17586            }
17587        }
17588        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17589            match name {
17590                "ENFORCE_NAMING_STYLE_UNKNOWN" => {
17591                    ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN)
17592                }
17593                "STYLE2024" => ::core::option::Option::Some(Self::STYLE2024),
17594                "STYLE_LEGACY" => ::core::option::Option::Some(Self::STYLE_LEGACY),
17595                _ => ::core::option::Option::None,
17596            }
17597        }
17598        fn values() -> &'static [Self] {
17599            &[Self::ENFORCE_NAMING_STYLE_UNKNOWN, Self::STYLE2024, Self::STYLE_LEGACY]
17600        }
17601    }
17602    #[derive(Clone, PartialEq, Default)]
17603    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17604    #[cfg_attr(feature = "json", serde(default))]
17605    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17606    pub struct VisibilityFeature {
17607        #[cfg_attr(feature = "json", serde(skip))]
17608        #[doc(hidden)]
17609        pub __buffa_unknown_fields: ::buffa::UnknownFields,
17610    }
17611    impl ::core::fmt::Debug for VisibilityFeature {
17612        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17613            f.debug_struct("VisibilityFeature").finish()
17614        }
17615    }
17616    impl VisibilityFeature {
17617        /// Protobuf type URL for this message, for use with `Any::pack` and
17618        /// `Any::unpack_if`.
17619        ///
17620        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17621        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17622    }
17623    ::buffa::impl_default_instance!(VisibilityFeature);
17624    impl ::buffa::MessageName for VisibilityFeature {
17625        const PACKAGE: &'static str = "google.protobuf";
17626        const NAME: &'static str = "FeatureSet.VisibilityFeature";
17627        const FULL_NAME: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17628        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17629    }
17630    impl ::buffa::Message for VisibilityFeature {
17631        /// Returns the total encoded size in bytes.
17632        ///
17633        /// Accumulates in `u64` (which cannot overflow for in-memory
17634        /// data) and saturates to `u32` at return, so a message whose
17635        /// encoded size exceeds the 2 GiB protobuf limit yields a value
17636        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
17637        /// points reject, never a silently wrapped size.
17638        #[allow(clippy::let_and_return)]
17639        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17640            #[allow(unused_imports)]
17641            use ::buffa::Enumeration as _;
17642            let mut size = 0u64;
17643            size += self.__buffa_unknown_fields.encoded_len() as u64;
17644            ::buffa::saturate_size(size)
17645        }
17646        fn write_to(
17647            &self,
17648            _cache: &mut ::buffa::SizeCache,
17649            buf: &mut impl ::buffa::EncodeSink,
17650        ) {
17651            #[allow(unused_imports)]
17652            use ::buffa::Enumeration as _;
17653            self.__buffa_unknown_fields.write_to(buf);
17654        }
17655        fn merge_field(
17656            &mut self,
17657            tag: ::buffa::encoding::Tag,
17658            buf: &mut impl ::buffa::bytes::Buf,
17659            ctx: ::buffa::DecodeContext<'_>,
17660        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
17661            #[allow(unused_imports)]
17662            use ::buffa::bytes::Buf as _;
17663            #[allow(unused_imports)]
17664            use ::buffa::Enumeration as _;
17665            match tag.field_number() {
17666                _ => {
17667                    self.__buffa_unknown_fields
17668                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
17669                }
17670            }
17671            ::core::result::Result::Ok(())
17672        }
17673        fn clear(&mut self) {
17674            self.__buffa_unknown_fields.clear();
17675        }
17676    }
17677    impl ::buffa::ExtensionSet for VisibilityFeature {
17678        const PROTO_FQN: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17679        fn unknown_fields(&self) -> &::buffa::UnknownFields {
17680            &self.__buffa_unknown_fields
17681        }
17682        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
17683            &mut self.__buffa_unknown_fields
17684        }
17685    }
17686    #[cfg(feature = "text")]
17687    impl ::buffa::text::TextFormat for VisibilityFeature {
17688        fn encode_text(
17689            &self,
17690            enc: &mut ::buffa::text::TextEncoder<'_>,
17691        ) -> ::core::fmt::Result {
17692            #[allow(unused_imports)]
17693            use ::buffa::Enumeration as _;
17694            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
17695            ::core::result::Result::Ok(())
17696        }
17697        fn merge_text(
17698            &mut self,
17699            dec: &mut ::buffa::text::TextDecoder<'_>,
17700        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
17701            #[allow(unused_imports)]
17702            use ::buffa::Enumeration as _;
17703            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
17704                match __name {
17705                    _ => dec.skip_value()?,
17706                }
17707            }
17708            ::core::result::Result::Ok(())
17709        }
17710    }
17711    #[cfg(feature = "json")]
17712    impl ::buffa::json_helpers::ProtoElemJson for VisibilityFeature {
17713        fn serialize_proto_json<S: ::serde::Serializer>(
17714            v: &Self,
17715            s: S,
17716        ) -> ::core::result::Result<S::Ok, S::Error> {
17717            ::serde::Serialize::serialize(v, s)
17718        }
17719        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17720            d: D,
17721        ) -> ::core::result::Result<Self, D::Error> {
17722            <Self as ::serde::Deserialize>::deserialize(d)
17723        }
17724    }
17725    #[cfg(feature = "json")]
17726    #[doc(hidden)]
17727    pub const __VISIBILITY_FEATURE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
17728        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17729        to_json: ::buffa::type_registry::any_to_json::<VisibilityFeature>,
17730        from_json: ::buffa::type_registry::any_from_json::<VisibilityFeature>,
17731        is_wkt: false,
17732    };
17733    #[cfg(feature = "text")]
17734    #[doc(hidden)]
17735    pub const __VISIBILITY_FEATURE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
17736        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17737        text_encode: ::buffa::type_registry::any_encode_text::<VisibilityFeature>,
17738        text_merge: ::buffa::type_registry::any_merge_text::<VisibilityFeature>,
17739    };
17740    pub mod visibility_feature {
17741        #[allow(unused_imports)]
17742        use super::*;
17743        #[allow(non_camel_case_types)]
17744        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17745        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17746        #[repr(i32)]
17747        pub enum DefaultSymbolVisibility {
17748            DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0i32,
17749            /// Default pre-EDITION_2024, all UNSET visibility are export.
17750            EXPORT_ALL = 1i32,
17751            /// All top-level symbols default to export, nested default to local.
17752            EXPORT_TOP_LEVEL = 2i32,
17753            /// All symbols default to local.
17754            LOCAL_ALL = 3i32,
17755            /// All symbols local by default. Nested types cannot be exported.
17756            /// With special case caveat for message { enum {} reserved 1 to max; }
17757            /// This is the recommended setting for new protos.
17758            STRICT = 4i32,
17759        }
17760        impl DefaultSymbolVisibility {
17761            ///Idiomatic alias for [`Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`]; `Debug` prints the variant name.
17762            #[allow(non_upper_case_globals)]
17763            pub const DefaultSymbolVisibilityUnknown: Self = Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
17764            ///Idiomatic alias for [`Self::EXPORT_ALL`]; `Debug` prints the variant name.
17765            #[allow(non_upper_case_globals)]
17766            pub const ExportAll: Self = Self::EXPORT_ALL;
17767            ///Idiomatic alias for [`Self::EXPORT_TOP_LEVEL`]; `Debug` prints the variant name.
17768            #[allow(non_upper_case_globals)]
17769            pub const ExportTopLevel: Self = Self::EXPORT_TOP_LEVEL;
17770            ///Idiomatic alias for [`Self::LOCAL_ALL`]; `Debug` prints the variant name.
17771            #[allow(non_upper_case_globals)]
17772            pub const LocalAll: Self = Self::LOCAL_ALL;
17773            ///Idiomatic alias for [`Self::STRICT`]; `Debug` prints the variant name.
17774            #[allow(non_upper_case_globals)]
17775            pub const Strict: Self = Self::STRICT;
17776        }
17777        impl ::core::default::Default for DefaultSymbolVisibility {
17778            fn default() -> Self {
17779                Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
17780            }
17781        }
17782        #[cfg(feature = "json")]
17783        const _: () = {
17784            impl ::serde::Serialize for DefaultSymbolVisibility {
17785                fn serialize<S: ::serde::Serializer>(
17786                    &self,
17787                    s: S,
17788                ) -> ::core::result::Result<S::Ok, S::Error> {
17789                    s.serialize_str(::buffa::Enumeration::proto_name(self))
17790                }
17791            }
17792            impl<'de> ::serde::Deserialize<'de> for DefaultSymbolVisibility {
17793                fn deserialize<D: ::serde::Deserializer<'de>>(
17794                    d: D,
17795                ) -> ::core::result::Result<Self, D::Error> {
17796                    struct _V;
17797                    impl ::serde::de::Visitor<'_> for _V {
17798                        type Value = DefaultSymbolVisibility;
17799                        fn expecting(
17800                            &self,
17801                            f: &mut ::core::fmt::Formatter<'_>,
17802                        ) -> ::core::fmt::Result {
17803                            f.write_str(
17804                                concat!(
17805                                    "a string, integer, or null for ",
17806                                    stringify!(DefaultSymbolVisibility)
17807                                ),
17808                            )
17809                        }
17810                        fn visit_str<E: ::serde::de::Error>(
17811                            self,
17812                            v: &str,
17813                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17814                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_proto_name(
17815                                    v,
17816                                )
17817                                .ok_or_else(|| {
17818                                    ::serde::de::Error::unknown_variant(v, &[])
17819                                })
17820                        }
17821                        fn visit_i64<E: ::serde::de::Error>(
17822                            self,
17823                            v: i64,
17824                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17825                            let v32 = i32::try_from(v)
17826                                .map_err(|_| {
17827                                    ::serde::de::Error::custom(
17828                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17829                                    )
17830                                })?;
17831                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17832                                    v32,
17833                                )
17834                                .ok_or_else(|| {
17835                                    ::serde::de::Error::custom(
17836                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17837                                    )
17838                                })
17839                        }
17840                        fn visit_u64<E: ::serde::de::Error>(
17841                            self,
17842                            v: u64,
17843                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17844                            let v32 = i32::try_from(v)
17845                                .map_err(|_| {
17846                                    ::serde::de::Error::custom(
17847                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17848                                    )
17849                                })?;
17850                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17851                                    v32,
17852                                )
17853                                .ok_or_else(|| {
17854                                    ::serde::de::Error::custom(
17855                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17856                                    )
17857                                })
17858                        }
17859                        fn visit_unit<E: ::serde::de::Error>(
17860                            self,
17861                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17862                            ::core::result::Result::Ok(
17863                                ::core::default::Default::default(),
17864                            )
17865                        }
17866                    }
17867                    d.deserialize_any(_V)
17868                }
17869            }
17870            impl ::buffa::json_helpers::ProtoElemJson for DefaultSymbolVisibility {
17871                fn serialize_proto_json<S: ::serde::Serializer>(
17872                    v: &Self,
17873                    s: S,
17874                ) -> ::core::result::Result<S::Ok, S::Error> {
17875                    ::serde::Serialize::serialize(v, s)
17876                }
17877                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17878                    d: D,
17879                ) -> ::core::result::Result<Self, D::Error> {
17880                    <Self as ::serde::Deserialize>::deserialize(d)
17881                }
17882            }
17883        };
17884        impl ::buffa::Enumeration for DefaultSymbolVisibility {
17885            fn from_i32(value: i32) -> ::core::option::Option<Self> {
17886                match value {
17887                    0i32 => {
17888                        ::core::option::Option::Some(
17889                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17890                        )
17891                    }
17892                    1i32 => ::core::option::Option::Some(Self::EXPORT_ALL),
17893                    2i32 => ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL),
17894                    3i32 => ::core::option::Option::Some(Self::LOCAL_ALL),
17895                    4i32 => ::core::option::Option::Some(Self::STRICT),
17896                    _ => ::core::option::Option::None,
17897                }
17898            }
17899            fn to_i32(&self) -> i32 {
17900                *self as i32
17901            }
17902            fn proto_name(&self) -> &'static str {
17903                match self {
17904                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => {
17905                        "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"
17906                    }
17907                    Self::EXPORT_ALL => "EXPORT_ALL",
17908                    Self::EXPORT_TOP_LEVEL => "EXPORT_TOP_LEVEL",
17909                    Self::LOCAL_ALL => "LOCAL_ALL",
17910                    Self::STRICT => "STRICT",
17911                }
17912            }
17913            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17914                match name {
17915                    "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => {
17916                        ::core::option::Option::Some(
17917                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17918                        )
17919                    }
17920                    "EXPORT_ALL" => ::core::option::Option::Some(Self::EXPORT_ALL),
17921                    "EXPORT_TOP_LEVEL" => {
17922                        ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL)
17923                    }
17924                    "LOCAL_ALL" => ::core::option::Option::Some(Self::LOCAL_ALL),
17925                    "STRICT" => ::core::option::Option::Some(Self::STRICT),
17926                    _ => ::core::option::Option::None,
17927                }
17928            }
17929            fn values() -> &'static [Self] {
17930                &[
17931                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17932                    Self::EXPORT_ALL,
17933                    Self::EXPORT_TOP_LEVEL,
17934                    Self::LOCAL_ALL,
17935                    Self::STRICT,
17936                ]
17937            }
17938        }
17939    }
17940    #[cfg(feature = "views")]
17941    #[doc(inline)]
17942    pub use super::__buffa::view::feature_set::VisibilityFeatureView;
17943    #[cfg(feature = "views")]
17944    #[doc(inline)]
17945    pub use super::__buffa::view::feature_set::VisibilityFeatureOwnedView;
17946}
17947/// A compiled specification for the defaults of a set of features.  These
17948/// messages are generated from FeatureSet extensions and can be used to seed
17949/// feature resolution. The resolution with this object becomes a simple search
17950/// for the closest matching edition, followed by proto merges.
17951#[derive(Clone, PartialEq, Default)]
17952#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17953#[cfg_attr(feature = "json", serde(default))]
17954#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17955pub struct FeatureSetDefaults {
17956    /// Field 1: `defaults`
17957    #[cfg_attr(
17958        feature = "json",
17959        serde(
17960            rename = "defaults",
17961            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
17962            deserialize_with = "::buffa::json_helpers::null_as_default"
17963        )
17964    )]
17965    pub defaults: ::buffa::alloc::vec::Vec<
17966        feature_set_defaults::FeatureSetEditionDefault,
17967    >,
17968    /// The minimum supported edition (inclusive) when this was constructed.
17969    /// Editions before this will not have defaults.
17970    ///
17971    /// Field 4: `minimum_edition`
17972    #[cfg_attr(
17973        feature = "json",
17974        serde(
17975            rename = "minimumEdition",
17976            alias = "minimum_edition",
17977            with = "::buffa::json_helpers::opt_closed_enum",
17978            skip_serializing_if = "::core::option::Option::is_none"
17979        )
17980    )]
17981    pub minimum_edition: ::core::option::Option<Edition>,
17982    /// The maximum known edition (inclusive) when this was constructed. Editions
17983    /// after this will not have reliable defaults.
17984    ///
17985    /// Field 5: `maximum_edition`
17986    #[cfg_attr(
17987        feature = "json",
17988        serde(
17989            rename = "maximumEdition",
17990            alias = "maximum_edition",
17991            with = "::buffa::json_helpers::opt_closed_enum",
17992            skip_serializing_if = "::core::option::Option::is_none"
17993        )
17994    )]
17995    pub maximum_edition: ::core::option::Option<Edition>,
17996    #[cfg_attr(feature = "json", serde(skip))]
17997    #[doc(hidden)]
17998    pub __buffa_unknown_fields: ::buffa::UnknownFields,
17999}
18000impl ::core::fmt::Debug for FeatureSetDefaults {
18001    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18002        f.debug_struct("FeatureSetDefaults")
18003            .field("defaults", &self.defaults)
18004            .field("minimum_edition", &self.minimum_edition)
18005            .field("maximum_edition", &self.maximum_edition)
18006            .finish()
18007    }
18008}
18009impl FeatureSetDefaults {
18010    /// Protobuf type URL for this message, for use with `Any::pack` and
18011    /// `Any::unpack_if`.
18012    ///
18013    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18014    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
18015}
18016impl FeatureSetDefaults {
18017    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18018    #[inline]
18019    ///Sets [`Self::minimum_edition`] to `Some(value)`, consuming and returning `self`.
18020    pub fn with_minimum_edition(mut self, value: impl Into<Edition>) -> Self {
18021        self.minimum_edition = Some(value.into());
18022        self
18023    }
18024    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18025    #[inline]
18026    ///Sets [`Self::maximum_edition`] to `Some(value)`, consuming and returning `self`.
18027    pub fn with_maximum_edition(mut self, value: impl Into<Edition>) -> Self {
18028        self.maximum_edition = Some(value.into());
18029        self
18030    }
18031}
18032::buffa::impl_default_instance!(FeatureSetDefaults);
18033impl ::buffa::MessageName for FeatureSetDefaults {
18034    const PACKAGE: &'static str = "google.protobuf";
18035    const NAME: &'static str = "FeatureSetDefaults";
18036    const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults";
18037    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
18038}
18039impl ::buffa::Message for FeatureSetDefaults {
18040    /// Returns the total encoded size in bytes.
18041    ///
18042    /// Accumulates in `u64` (which cannot overflow for in-memory
18043    /// data) and saturates to `u32` at return, so a message whose
18044    /// encoded size exceeds the 2 GiB protobuf limit yields a value
18045    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
18046    /// points reject, never a silently wrapped size.
18047    #[allow(clippy::let_and_return)]
18048    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18049        #[allow(unused_imports)]
18050        use ::buffa::Enumeration as _;
18051        let mut size = 0u64;
18052        for v in &self.defaults {
18053            let __slot = __cache.reserve();
18054            let inner_size = v.compute_size(__cache);
18055            __cache.set(__slot, inner_size);
18056            size
18057                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18058                    + inner_size as u64;
18059        }
18060        if let Some(ref v) = self.minimum_edition {
18061            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18062        }
18063        if let Some(ref v) = self.maximum_edition {
18064            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18065        }
18066        size += self.__buffa_unknown_fields.encoded_len() as u64;
18067        ::buffa::saturate_size(size)
18068    }
18069    fn write_to(
18070        &self,
18071        __cache: &mut ::buffa::SizeCache,
18072        buf: &mut impl ::buffa::EncodeSink,
18073    ) {
18074        #[allow(unused_imports)]
18075        use ::buffa::Enumeration as _;
18076        for v in &self.defaults {
18077            ::buffa::types::put_len_delimited_header(
18078                1u32,
18079                u64::from(__cache.consume_next()),
18080                buf,
18081            );
18082            v.write_to(__cache, buf);
18083        }
18084        if let Some(ref v) = self.minimum_edition {
18085            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
18086        }
18087        if let Some(ref v) = self.maximum_edition {
18088            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
18089        }
18090        self.__buffa_unknown_fields.write_to(buf);
18091    }
18092    fn merge_field(
18093        &mut self,
18094        tag: ::buffa::encoding::Tag,
18095        buf: &mut impl ::buffa::bytes::Buf,
18096        ctx: ::buffa::DecodeContext<'_>,
18097    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18098        #[allow(unused_imports)]
18099        use ::buffa::bytes::Buf as _;
18100        #[allow(unused_imports)]
18101        use ::buffa::Enumeration as _;
18102        match tag.field_number() {
18103            1u32 => {
18104                ::buffa::encoding::check_wire_type(
18105                    tag,
18106                    ::buffa::encoding::WireType::LengthDelimited,
18107                )?;
18108                let mut elem = ::core::default::Default::default();
18109                ctx.register_element_memory(
18110                    ::buffa::__private::element_footprint(&elem),
18111                )?;
18112                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
18113                self.defaults.push(elem);
18114            }
18115            4u32 => {
18116                ::buffa::encoding::check_wire_type(
18117                    tag,
18118                    ::buffa::encoding::WireType::Varint,
18119                )?;
18120                let __raw = ::buffa::types::decode_int32(buf)?;
18121                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18122                    __raw,
18123                ) {
18124                    self.minimum_edition = ::core::option::Option::Some(__v);
18125                } else {
18126                    ctx.register_unknown_field()?;
18127                    self.__buffa_unknown_fields
18128                        .push(::buffa::UnknownField {
18129                            number: 4u32,
18130                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18131                        });
18132                }
18133            }
18134            5u32 => {
18135                ::buffa::encoding::check_wire_type(
18136                    tag,
18137                    ::buffa::encoding::WireType::Varint,
18138                )?;
18139                let __raw = ::buffa::types::decode_int32(buf)?;
18140                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18141                    __raw,
18142                ) {
18143                    self.maximum_edition = ::core::option::Option::Some(__v);
18144                } else {
18145                    ctx.register_unknown_field()?;
18146                    self.__buffa_unknown_fields
18147                        .push(::buffa::UnknownField {
18148                            number: 5u32,
18149                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18150                        });
18151                }
18152            }
18153            _ => {
18154                self.__buffa_unknown_fields
18155                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18156            }
18157        }
18158        ::core::result::Result::Ok(())
18159    }
18160    fn clear(&mut self) {
18161        self.defaults.clear();
18162        self.minimum_edition = ::core::option::Option::None;
18163        self.maximum_edition = ::core::option::Option::None;
18164        self.__buffa_unknown_fields.clear();
18165    }
18166}
18167impl ::buffa::ExtensionSet for FeatureSetDefaults {
18168    const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults";
18169    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18170        &self.__buffa_unknown_fields
18171    }
18172    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18173        &mut self.__buffa_unknown_fields
18174    }
18175}
18176#[cfg(feature = "text")]
18177impl ::buffa::text::TextFormat for FeatureSetDefaults {
18178    fn encode_text(
18179        &self,
18180        enc: &mut ::buffa::text::TextEncoder<'_>,
18181    ) -> ::core::fmt::Result {
18182        #[allow(unused_imports)]
18183        use ::buffa::Enumeration as _;
18184        if let ::core::option::Option::Some(ref __v) = self.minimum_edition {
18185            enc.write_field_name("minimum_edition")?;
18186            enc.write_enum_name(__v.proto_name())?;
18187        }
18188        if let ::core::option::Option::Some(ref __v) = self.maximum_edition {
18189            enc.write_field_name("maximum_edition")?;
18190            enc.write_enum_name(__v.proto_name())?;
18191        }
18192        for __v in &self.defaults {
18193            enc.write_field_name("defaults")?;
18194            enc.write_message(__v)?;
18195        }
18196        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18197        ::core::result::Result::Ok(())
18198    }
18199    fn merge_text(
18200        &mut self,
18201        dec: &mut ::buffa::text::TextDecoder<'_>,
18202    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18203        #[allow(unused_imports)]
18204        use ::buffa::Enumeration as _;
18205        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18206            match __name {
18207                "minimum_edition" => {
18208                    self.minimum_edition = ::core::option::Option::Some(
18209                        dec.read_closed_enum_by_name::<Edition>()?,
18210                    );
18211                }
18212                "maximum_edition" => {
18213                    self.maximum_edition = ::core::option::Option::Some(
18214                        dec.read_closed_enum_by_name::<Edition>()?,
18215                    );
18216                }
18217                "defaults" => {
18218                    dec.read_repeated_into(
18219                        &mut self.defaults,
18220                        |__d| {
18221                            let mut __m = ::core::default::Default::default();
18222                            __d.merge_message(&mut __m)?;
18223                            ::core::result::Result::Ok(__m)
18224                        },
18225                    )?
18226                }
18227                _ => dec.skip_value()?,
18228            }
18229        }
18230        ::core::result::Result::Ok(())
18231    }
18232}
18233#[cfg(feature = "json")]
18234impl ::buffa::json_helpers::ProtoElemJson for FeatureSetDefaults {
18235    fn serialize_proto_json<S: ::serde::Serializer>(
18236        v: &Self,
18237        s: S,
18238    ) -> ::core::result::Result<S::Ok, S::Error> {
18239        ::serde::Serialize::serialize(v, s)
18240    }
18241    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18242        d: D,
18243    ) -> ::core::result::Result<Self, D::Error> {
18244        <Self as ::serde::Deserialize>::deserialize(d)
18245    }
18246}
18247#[cfg(feature = "json")]
18248#[doc(hidden)]
18249pub const __FEATURE_SET_DEFAULTS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18250    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18251    to_json: ::buffa::type_registry::any_to_json::<FeatureSetDefaults>,
18252    from_json: ::buffa::type_registry::any_from_json::<FeatureSetDefaults>,
18253    is_wkt: false,
18254};
18255#[cfg(feature = "text")]
18256#[doc(hidden)]
18257pub const __FEATURE_SET_DEFAULTS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18258    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18259    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetDefaults>,
18260    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetDefaults>,
18261};
18262pub mod feature_set_defaults {
18263    #[allow(unused_imports)]
18264    use super::*;
18265    /// A map from every known edition with a unique set of defaults to its
18266    /// defaults. Not all editions may be contained here.  For a given edition,
18267    /// the defaults at the closest matching edition ordered at or before it should
18268    /// be used.  This field must be in strict ascending order by edition.
18269    #[derive(Clone, PartialEq, Default)]
18270    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18271    #[cfg_attr(feature = "json", serde(default))]
18272    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18273    pub struct FeatureSetEditionDefault {
18274        /// Field 3: `edition`
18275        #[cfg_attr(
18276            feature = "json",
18277            serde(
18278                rename = "edition",
18279                with = "::buffa::json_helpers::opt_closed_enum",
18280                skip_serializing_if = "::core::option::Option::is_none"
18281            )
18282        )]
18283        pub edition: ::core::option::Option<super::Edition>,
18284        /// Defaults of features that can be overridden in this edition.
18285        ///
18286        /// Field 4: `overridable_features`
18287        #[cfg_attr(
18288            feature = "json",
18289            serde(
18290                rename = "overridableFeatures",
18291                alias = "overridable_features",
18292                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18293            )
18294        )]
18295        pub overridable_features: ::buffa::MessageField<
18296            super::FeatureSet,
18297            ::buffa::Inline<super::FeatureSet>,
18298        >,
18299        /// Defaults of features that can't be overridden in this edition.
18300        ///
18301        /// Field 5: `fixed_features`
18302        #[cfg_attr(
18303            feature = "json",
18304            serde(
18305                rename = "fixedFeatures",
18306                alias = "fixed_features",
18307                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18308            )
18309        )]
18310        pub fixed_features: ::buffa::MessageField<
18311            super::FeatureSet,
18312            ::buffa::Inline<super::FeatureSet>,
18313        >,
18314        #[cfg_attr(feature = "json", serde(skip))]
18315        #[doc(hidden)]
18316        pub __buffa_unknown_fields: ::buffa::UnknownFields,
18317    }
18318    impl ::core::fmt::Debug for FeatureSetEditionDefault {
18319        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18320            f.debug_struct("FeatureSetEditionDefault")
18321                .field("edition", &self.edition)
18322                .field("overridable_features", &self.overridable_features)
18323                .field("fixed_features", &self.fixed_features)
18324                .finish()
18325        }
18326    }
18327    impl FeatureSetEditionDefault {
18328        /// Protobuf type URL for this message, for use with `Any::pack` and
18329        /// `Any::unpack_if`.
18330        ///
18331        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18332        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18333    }
18334    impl FeatureSetEditionDefault {
18335        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18336        #[inline]
18337        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
18338        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
18339            self.edition = Some(value.into());
18340            self
18341        }
18342    }
18343    ::buffa::impl_default_instance!(FeatureSetEditionDefault);
18344    impl ::buffa::MessageName for FeatureSetEditionDefault {
18345        const PACKAGE: &'static str = "google.protobuf";
18346        const NAME: &'static str = "FeatureSetDefaults.FeatureSetEditionDefault";
18347        const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18348        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18349    }
18350    impl ::buffa::Message for FeatureSetEditionDefault {
18351        /// Returns the total encoded size in bytes.
18352        ///
18353        /// Accumulates in `u64` (which cannot overflow for in-memory
18354        /// data) and saturates to `u32` at return, so a message whose
18355        /// encoded size exceeds the 2 GiB protobuf limit yields a value
18356        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
18357        /// points reject, never a silently wrapped size.
18358        #[allow(clippy::let_and_return)]
18359        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18360            #[allow(unused_imports)]
18361            use ::buffa::Enumeration as _;
18362            let mut size = 0u64;
18363            if let Some(ref v) = self.edition {
18364                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18365            }
18366            if self.overridable_features.is_set() {
18367                let __slot = __cache.reserve();
18368                let inner_size = self.overridable_features.compute_size(__cache);
18369                __cache.set(__slot, inner_size);
18370                size
18371                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18372                        + inner_size as u64;
18373            }
18374            if self.fixed_features.is_set() {
18375                let __slot = __cache.reserve();
18376                let inner_size = self.fixed_features.compute_size(__cache);
18377                __cache.set(__slot, inner_size);
18378                size
18379                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18380                        + inner_size as u64;
18381            }
18382            size += self.__buffa_unknown_fields.encoded_len() as u64;
18383            ::buffa::saturate_size(size)
18384        }
18385        fn write_to(
18386            &self,
18387            __cache: &mut ::buffa::SizeCache,
18388            buf: &mut impl ::buffa::EncodeSink,
18389        ) {
18390            #[allow(unused_imports)]
18391            use ::buffa::Enumeration as _;
18392            if let Some(ref v) = self.edition {
18393                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
18394            }
18395            if self.overridable_features.is_set() {
18396                ::buffa::types::put_len_delimited_header(
18397                    4u32,
18398                    u64::from(__cache.consume_next()),
18399                    buf,
18400                );
18401                self.overridable_features.write_to(__cache, buf);
18402            }
18403            if self.fixed_features.is_set() {
18404                ::buffa::types::put_len_delimited_header(
18405                    5u32,
18406                    u64::from(__cache.consume_next()),
18407                    buf,
18408                );
18409                self.fixed_features.write_to(__cache, buf);
18410            }
18411            self.__buffa_unknown_fields.write_to(buf);
18412        }
18413        fn merge_field(
18414            &mut self,
18415            tag: ::buffa::encoding::Tag,
18416            buf: &mut impl ::buffa::bytes::Buf,
18417            ctx: ::buffa::DecodeContext<'_>,
18418        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18419            #[allow(unused_imports)]
18420            use ::buffa::bytes::Buf as _;
18421            #[allow(unused_imports)]
18422            use ::buffa::Enumeration as _;
18423            match tag.field_number() {
18424                3u32 => {
18425                    ::buffa::encoding::check_wire_type(
18426                        tag,
18427                        ::buffa::encoding::WireType::Varint,
18428                    )?;
18429                    let __raw = ::buffa::types::decode_int32(buf)?;
18430                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18431                        __raw,
18432                    ) {
18433                        self.edition = ::core::option::Option::Some(__v);
18434                    } else {
18435                        ctx.register_unknown_field()?;
18436                        self.__buffa_unknown_fields
18437                            .push(::buffa::UnknownField {
18438                                number: 3u32,
18439                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18440                            });
18441                    }
18442                }
18443                4u32 => {
18444                    ::buffa::encoding::check_wire_type(
18445                        tag,
18446                        ::buffa::encoding::WireType::LengthDelimited,
18447                    )?;
18448                    ::buffa::Message::merge_length_delimited(
18449                        self.overridable_features.get_or_insert_default(),
18450                        buf,
18451                        ctx,
18452                    )?;
18453                }
18454                5u32 => {
18455                    ::buffa::encoding::check_wire_type(
18456                        tag,
18457                        ::buffa::encoding::WireType::LengthDelimited,
18458                    )?;
18459                    ::buffa::Message::merge_length_delimited(
18460                        self.fixed_features.get_or_insert_default(),
18461                        buf,
18462                        ctx,
18463                    )?;
18464                }
18465                _ => {
18466                    self.__buffa_unknown_fields
18467                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18468                }
18469            }
18470            ::core::result::Result::Ok(())
18471        }
18472        fn clear(&mut self) {
18473            self.edition = ::core::option::Option::None;
18474            self.overridable_features = ::buffa::MessageField::none();
18475            self.fixed_features = ::buffa::MessageField::none();
18476            self.__buffa_unknown_fields.clear();
18477        }
18478    }
18479    impl ::buffa::ExtensionSet for FeatureSetEditionDefault {
18480        const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18481        fn unknown_fields(&self) -> &::buffa::UnknownFields {
18482            &self.__buffa_unknown_fields
18483        }
18484        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18485            &mut self.__buffa_unknown_fields
18486        }
18487    }
18488    #[cfg(feature = "text")]
18489    impl ::buffa::text::TextFormat for FeatureSetEditionDefault {
18490        fn encode_text(
18491            &self,
18492            enc: &mut ::buffa::text::TextEncoder<'_>,
18493        ) -> ::core::fmt::Result {
18494            #[allow(unused_imports)]
18495            use ::buffa::Enumeration as _;
18496            if let ::core::option::Option::Some(ref __v) = self.edition {
18497                enc.write_field_name("edition")?;
18498                enc.write_enum_name(__v.proto_name())?;
18499            }
18500            if self.overridable_features.is_set() {
18501                enc.write_field_name("overridable_features")?;
18502                enc.write_message(&*self.overridable_features)?;
18503            }
18504            if self.fixed_features.is_set() {
18505                enc.write_field_name("fixed_features")?;
18506                enc.write_message(&*self.fixed_features)?;
18507            }
18508            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18509            ::core::result::Result::Ok(())
18510        }
18511        fn merge_text(
18512            &mut self,
18513            dec: &mut ::buffa::text::TextDecoder<'_>,
18514        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18515            #[allow(unused_imports)]
18516            use ::buffa::Enumeration as _;
18517            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18518                match __name {
18519                    "edition" => {
18520                        self.edition = ::core::option::Option::Some(
18521                            dec.read_closed_enum_by_name::<super::Edition>()?,
18522                        );
18523                    }
18524                    "overridable_features" => {
18525                        dec.merge_message(
18526                            self.overridable_features.get_or_insert_default(),
18527                        )?
18528                    }
18529                    "fixed_features" => {
18530                        dec.merge_message(self.fixed_features.get_or_insert_default())?
18531                    }
18532                    _ => dec.skip_value()?,
18533                }
18534            }
18535            ::core::result::Result::Ok(())
18536        }
18537    }
18538    #[cfg(feature = "json")]
18539    impl ::buffa::json_helpers::ProtoElemJson for FeatureSetEditionDefault {
18540        fn serialize_proto_json<S: ::serde::Serializer>(
18541            v: &Self,
18542            s: S,
18543        ) -> ::core::result::Result<S::Ok, S::Error> {
18544            ::serde::Serialize::serialize(v, s)
18545        }
18546        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18547            d: D,
18548        ) -> ::core::result::Result<Self, D::Error> {
18549            <Self as ::serde::Deserialize>::deserialize(d)
18550        }
18551    }
18552    #[cfg(feature = "json")]
18553    #[doc(hidden)]
18554    pub const __FEATURE_SET_EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18555        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18556        to_json: ::buffa::type_registry::any_to_json::<FeatureSetEditionDefault>,
18557        from_json: ::buffa::type_registry::any_from_json::<FeatureSetEditionDefault>,
18558        is_wkt: false,
18559    };
18560    #[cfg(feature = "text")]
18561    #[doc(hidden)]
18562    pub const __FEATURE_SET_EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18563        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18564        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetEditionDefault>,
18565        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetEditionDefault>,
18566    };
18567    #[cfg(feature = "views")]
18568    #[doc(inline)]
18569    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultView;
18570    #[cfg(feature = "views")]
18571    #[doc(inline)]
18572    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultOwnedView;
18573}
18574/// ===================================================================
18575/// Optional source code info
18576///
18577/// Encapsulates information about the original source file from which a
18578/// FileDescriptorProto was generated.
18579#[derive(Clone, PartialEq, Default)]
18580#[cfg_attr(feature = "json", derive(::serde::Serialize))]
18581#[cfg_attr(feature = "json", serde(default))]
18582#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18583pub struct SourceCodeInfo {
18584    /// A Location identifies a piece of source code in a .proto file which
18585    /// corresponds to a particular definition.  This information is intended
18586    /// to be useful to IDEs, code indexers, documentation generators, and similar
18587    /// tools.
18588    ///
18589    /// For example, say we have a file like:
18590    ///   message Foo {
18591    /// ```text
18592    /// optional string foo = 1;
18593    /// ```
18594    ///   }
18595    /// Let's look at just the field definition:
18596    ///   optional string foo = 1;
18597    ///   ^       ^^     ^^  ^  ^^^
18598    ///   a       bc     de  f  ghi
18599    /// We have the following locations:
18600    ///   span   path               represents
18601    ///   \[a,i)  \[ 4, 0, 2, 0 \]     The whole field definition.
18602    ///   \[a,b)  \[ 4, 0, 2, 0, 4 \]  The label (optional).
18603    ///   \[c,d)  \[ 4, 0, 2, 0, 5 \]  The type (string).
18604    ///   \[e,f)  \[ 4, 0, 2, 0, 1 \]  The name (foo).
18605    ///   \[g,h)  \[ 4, 0, 2, 0, 3 \]  The number (1).
18606    ///
18607    /// Notes:
18608    /// - A location may refer to a repeated field itself (i.e. not to any
18609    ///   particular index within it).  This is used whenever a set of elements are
18610    ///   logically enclosed in a single code segment.  For example, an entire
18611    ///   extend block (possibly containing multiple extension definitions) will
18612    ///   have an outer location whose path refers to the "extensions" repeated
18613    ///   field without an index.
18614    /// - Multiple locations may have the same path.  This happens when a single
18615    ///   logical declaration is spread out across multiple places.  The most
18616    ///   obvious example is the "extend" block again -- there may be multiple
18617    ///   extend blocks in the same scope, each of which will have the same path.
18618    /// - A location's span is not always a subset of its parent's span.  For
18619    ///   example, the "extendee" of an extension declaration appears at the
18620    ///   beginning of the "extend" block and is shared by all extensions within
18621    ///   the block.
18622    /// - Just because a location's span is a subset of some other location's span
18623    ///   does not mean that it is a descendant.  For example, a "group" defines
18624    ///   both a type and a field in a single declaration.  Thus, the locations
18625    ///   corresponding to the type and field and their components will overlap.
18626    /// - Code which tries to interpret locations should probably be designed to
18627    ///   ignore those that it doesn't understand, as more types of locations could
18628    ///   be recorded in the future.
18629    ///
18630    /// Field 1: `location`
18631    #[cfg_attr(
18632        feature = "json",
18633        serde(
18634            rename = "location",
18635            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18636            deserialize_with = "::buffa::json_helpers::null_as_default"
18637        )
18638    )]
18639    pub location: ::buffa::alloc::vec::Vec<source_code_info::Location>,
18640    #[cfg_attr(feature = "json", serde(flatten))]
18641    #[doc(hidden)]
18642    pub __buffa_unknown_fields: __SourceCodeInfoExtJson,
18643}
18644impl ::core::fmt::Debug for SourceCodeInfo {
18645    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18646        f.debug_struct("SourceCodeInfo").field("location", &self.location).finish()
18647    }
18648}
18649impl SourceCodeInfo {
18650    /// Protobuf type URL for this message, for use with `Any::pack` and
18651    /// `Any::unpack_if`.
18652    ///
18653    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18654    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18655}
18656::buffa::impl_default_instance!(SourceCodeInfo);
18657impl ::buffa::MessageName for SourceCodeInfo {
18658    const PACKAGE: &'static str = "google.protobuf";
18659    const NAME: &'static str = "SourceCodeInfo";
18660    const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo";
18661    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18662}
18663impl ::buffa::Message for SourceCodeInfo {
18664    /// Returns the total encoded size in bytes.
18665    ///
18666    /// Accumulates in `u64` (which cannot overflow for in-memory
18667    /// data) and saturates to `u32` at return, so a message whose
18668    /// encoded size exceeds the 2 GiB protobuf limit yields a value
18669    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
18670    /// points reject, never a silently wrapped size.
18671    #[allow(clippy::let_and_return)]
18672    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18673        #[allow(unused_imports)]
18674        use ::buffa::Enumeration as _;
18675        let mut size = 0u64;
18676        for v in &self.location {
18677            let __slot = __cache.reserve();
18678            let inner_size = v.compute_size(__cache);
18679            __cache.set(__slot, inner_size);
18680            size
18681                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18682                    + inner_size as u64;
18683        }
18684        size += self.__buffa_unknown_fields.encoded_len() as u64;
18685        ::buffa::saturate_size(size)
18686    }
18687    fn write_to(
18688        &self,
18689        __cache: &mut ::buffa::SizeCache,
18690        buf: &mut impl ::buffa::EncodeSink,
18691    ) {
18692        #[allow(unused_imports)]
18693        use ::buffa::Enumeration as _;
18694        for v in &self.location {
18695            ::buffa::types::put_len_delimited_header(
18696                1u32,
18697                u64::from(__cache.consume_next()),
18698                buf,
18699            );
18700            v.write_to(__cache, buf);
18701        }
18702        self.__buffa_unknown_fields.write_to(buf);
18703    }
18704    fn merge_field(
18705        &mut self,
18706        tag: ::buffa::encoding::Tag,
18707        buf: &mut impl ::buffa::bytes::Buf,
18708        ctx: ::buffa::DecodeContext<'_>,
18709    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18710        #[allow(unused_imports)]
18711        use ::buffa::bytes::Buf as _;
18712        #[allow(unused_imports)]
18713        use ::buffa::Enumeration as _;
18714        match tag.field_number() {
18715            1u32 => {
18716                ::buffa::encoding::check_wire_type(
18717                    tag,
18718                    ::buffa::encoding::WireType::LengthDelimited,
18719                )?;
18720                let mut elem = ::core::default::Default::default();
18721                ctx.register_element_memory(
18722                    ::buffa::__private::element_footprint(&elem),
18723                )?;
18724                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
18725                self.location.push(elem);
18726            }
18727            _ => {
18728                self.__buffa_unknown_fields
18729                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18730            }
18731        }
18732        ::core::result::Result::Ok(())
18733    }
18734    fn clear(&mut self) {
18735        self.location.clear();
18736        self.__buffa_unknown_fields.clear();
18737    }
18738}
18739impl ::buffa::ExtensionSet for SourceCodeInfo {
18740    const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo";
18741    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18742        &self.__buffa_unknown_fields
18743    }
18744    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18745        &mut self.__buffa_unknown_fields
18746    }
18747}
18748#[cfg(feature = "text")]
18749impl ::buffa::text::TextFormat for SourceCodeInfo {
18750    fn encode_text(
18751        &self,
18752        enc: &mut ::buffa::text::TextEncoder<'_>,
18753    ) -> ::core::fmt::Result {
18754        #[allow(unused_imports)]
18755        use ::buffa::Enumeration as _;
18756        for __v in &self.location {
18757            enc.write_field_name("location")?;
18758            enc.write_message(__v)?;
18759        }
18760        enc.write_extension_fields(
18761            "google.protobuf.SourceCodeInfo",
18762            &self.__buffa_unknown_fields,
18763        )?;
18764        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18765        ::core::result::Result::Ok(())
18766    }
18767    fn merge_text(
18768        &mut self,
18769        dec: &mut ::buffa::text::TextDecoder<'_>,
18770    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18771        #[allow(unused_imports)]
18772        use ::buffa::Enumeration as _;
18773        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18774            match __name {
18775                "location" => {
18776                    dec.read_repeated_into(
18777                        &mut self.location,
18778                        |__d| {
18779                            let mut __m = ::core::default::Default::default();
18780                            __d.merge_message(&mut __m)?;
18781                            ::core::result::Result::Ok(__m)
18782                        },
18783                    )?
18784                }
18785                __name if __name.starts_with('[') => {
18786                    for __r in dec
18787                        .read_extension(__name, "google.protobuf.SourceCodeInfo")?
18788                    {
18789                        self.__buffa_unknown_fields.push(__r);
18790                    }
18791                }
18792                _ => dec.skip_value()?,
18793            }
18794        }
18795        ::core::result::Result::Ok(())
18796    }
18797}
18798#[cfg(feature = "json")]
18799impl<'de> ::serde::Deserialize<'de> for SourceCodeInfo {
18800    fn deserialize<D: ::serde::Deserializer<'de>>(
18801        d: D,
18802    ) -> ::core::result::Result<Self, D::Error> {
18803        struct _V;
18804        impl<'de> ::serde::de::Visitor<'de> for _V {
18805            type Value = SourceCodeInfo;
18806            fn expecting(
18807                &self,
18808                f: &mut ::core::fmt::Formatter<'_>,
18809            ) -> ::core::fmt::Result {
18810                f.write_str("struct SourceCodeInfo")
18811            }
18812            #[allow(clippy::field_reassign_with_default)]
18813            fn visit_map<A: ::serde::de::MapAccess<'de>>(
18814                self,
18815                mut map: A,
18816            ) -> ::core::result::Result<SourceCodeInfo, A::Error> {
18817                let mut __f_location: ::core::option::Option<
18818                    ::buffa::alloc::vec::Vec<source_code_info::Location>,
18819                > = None;
18820                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
18821                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
18822                    match key.as_str() {
18823                        "location" => {
18824                            __f_location = Some({
18825                                struct _S;
18826                                impl<'de> ::serde::de::DeserializeSeed<'de> for _S {
18827                                    type Value = ::buffa::alloc::vec::Vec<
18828                                        source_code_info::Location,
18829                                    >;
18830                                    fn deserialize<D: ::serde::Deserializer<'de>>(
18831                                        self,
18832                                        d: D,
18833                                    ) -> ::core::result::Result<
18834                                        ::buffa::alloc::vec::Vec<source_code_info::Location>,
18835                                        D::Error,
18836                                    > {
18837                                        ::buffa::json_helpers::null_as_default(d)
18838                                    }
18839                                }
18840                                map.next_value_seed(_S)?
18841                            });
18842                        }
18843                        __k if __k.starts_with('[') => {
18844                            let __v: ::buffa::serde_json::Value = map.next_value()?;
18845                            match ::buffa::extension_registry::deserialize_extension_key(
18846                                "google.protobuf.SourceCodeInfo",
18847                                __k,
18848                                __v,
18849                            ) {
18850                                ::core::option::Option::Some(
18851                                    ::core::result::Result::Ok(__recs),
18852                                ) => {
18853                                    for __rec in __recs {
18854                                        __ext_records.push(__rec);
18855                                    }
18856                                }
18857                                ::core::option::Option::Some(
18858                                    ::core::result::Result::Err(__e),
18859                                ) => {
18860                                    return ::core::result::Result::Err(
18861                                        <A::Error as ::serde::de::Error>::custom(__e),
18862                                    );
18863                                }
18864                                ::core::option::Option::None => {}
18865                            }
18866                        }
18867                        _ => {
18868                            map.next_value::<::serde::de::IgnoredAny>()?;
18869                        }
18870                    }
18871                }
18872                let mut __r = <SourceCodeInfo as ::core::default::Default>::default();
18873                if let ::core::option::Option::Some(v) = __f_location {
18874                    __r.location = v;
18875                }
18876                for __rec in __ext_records {
18877                    __r.__buffa_unknown_fields.push(__rec);
18878                }
18879                Ok(__r)
18880            }
18881        }
18882        d.deserialize_map(_V)
18883    }
18884}
18885#[cfg(feature = "json")]
18886impl ::buffa::json_helpers::ProtoElemJson for SourceCodeInfo {
18887    fn serialize_proto_json<S: ::serde::Serializer>(
18888        v: &Self,
18889        s: S,
18890    ) -> ::core::result::Result<S::Ok, S::Error> {
18891        ::serde::Serialize::serialize(v, s)
18892    }
18893    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18894        d: D,
18895    ) -> ::core::result::Result<Self, D::Error> {
18896        <Self as ::serde::Deserialize>::deserialize(d)
18897    }
18898}
18899#[doc(hidden)]
18900#[derive(Clone, Debug, Default, PartialEq)]
18901#[repr(transparent)]
18902#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18903pub struct __SourceCodeInfoExtJson(pub ::buffa::UnknownFields);
18904impl ::core::ops::Deref for __SourceCodeInfoExtJson {
18905    type Target = ::buffa::UnknownFields;
18906    fn deref(&self) -> &::buffa::UnknownFields {
18907        &self.0
18908    }
18909}
18910impl ::core::ops::DerefMut for __SourceCodeInfoExtJson {
18911    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
18912        &mut self.0
18913    }
18914}
18915impl ::core::convert::From<::buffa::UnknownFields> for __SourceCodeInfoExtJson {
18916    fn from(u: ::buffa::UnknownFields) -> Self {
18917        Self(u)
18918    }
18919}
18920#[cfg(feature = "json")]
18921impl ::serde::Serialize for __SourceCodeInfoExtJson {
18922    fn serialize<S: ::serde::Serializer>(
18923        &self,
18924        s: S,
18925    ) -> ::core::result::Result<S::Ok, S::Error> {
18926        ::buffa::extension_registry::serialize_extensions(
18927            "google.protobuf.SourceCodeInfo",
18928            &self.0,
18929            s,
18930        )
18931    }
18932}
18933#[cfg(feature = "json")]
18934impl<'de> ::serde::Deserialize<'de> for __SourceCodeInfoExtJson {
18935    fn deserialize<D: ::serde::Deserializer<'de>>(
18936        d: D,
18937    ) -> ::core::result::Result<Self, D::Error> {
18938        ::buffa::extension_registry::deserialize_extensions(
18939                "google.protobuf.SourceCodeInfo",
18940                d,
18941            )
18942            .map(Self)
18943    }
18944}
18945#[cfg(feature = "json")]
18946#[doc(hidden)]
18947pub const __SOURCE_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18948    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18949    to_json: ::buffa::type_registry::any_to_json::<SourceCodeInfo>,
18950    from_json: ::buffa::type_registry::any_from_json::<SourceCodeInfo>,
18951    is_wkt: false,
18952};
18953#[cfg(feature = "text")]
18954#[doc(hidden)]
18955pub const __SOURCE_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18956    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18957    text_encode: ::buffa::type_registry::any_encode_text::<SourceCodeInfo>,
18958    text_merge: ::buffa::type_registry::any_merge_text::<SourceCodeInfo>,
18959};
18960pub mod source_code_info {
18961    #[allow(unused_imports)]
18962    use super::*;
18963    #[derive(Clone, PartialEq, Default)]
18964    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18965    #[cfg_attr(feature = "json", serde(default))]
18966    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18967    pub struct Location {
18968        /// Identifies which part of the FileDescriptorProto was defined at this
18969        /// location.
18970        ///
18971        /// Each element is a field number or an index.  They form a path from
18972        /// the root FileDescriptorProto to the place where the definition appears.
18973        /// For example, this path:
18974        ///   \[ 4, 3, 2, 7, 1 \]
18975        /// refers to:
18976        ///   file.message_type(3)  // 4, 3
18977        /// ```text
18978        ///   .field(7)         // 2, 7
18979        ///   .name()           // 1
18980        /// ```
18981        /// This is because FileDescriptorProto.message_type has field number 4:
18982        ///   repeated DescriptorProto message_type = 4;
18983        /// and DescriptorProto.field has field number 2:
18984        ///   repeated FieldDescriptorProto field = 2;
18985        /// and FieldDescriptorProto.name has field number 1:
18986        ///   optional string name = 1;
18987        ///
18988        /// Thus, the above path gives the location of a field name.  If we removed
18989        /// the last element:
18990        ///   \[ 4, 3, 2, 7 \]
18991        /// this path refers to the whole field declaration (from the beginning
18992        /// of the label to the terminating semicolon).
18993        ///
18994        /// Field 1: `path`
18995        #[cfg_attr(
18996            feature = "json",
18997            serde(
18998                rename = "path",
18999                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19000                deserialize_with = "::buffa::json_helpers::null_as_default"
19001            )
19002        )]
19003        pub path: ::buffa::alloc::vec::Vec<i32>,
19004        /// Always has exactly three or four elements: start line, start column,
19005        /// end line (optional, otherwise assumed same as start line), end column.
19006        /// These are packed into a single field for efficiency.  Note that line
19007        /// and column numbers are zero-based -- typically you will want to add
19008        /// 1 to each before displaying to a user.
19009        ///
19010        /// Field 2: `span`
19011        #[cfg_attr(
19012            feature = "json",
19013            serde(
19014                rename = "span",
19015                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19016                deserialize_with = "::buffa::json_helpers::null_as_default"
19017            )
19018        )]
19019        pub span: ::buffa::alloc::vec::Vec<i32>,
19020        /// If this SourceCodeInfo represents a complete declaration, these are any
19021        /// comments appearing before and after the declaration which appear to be
19022        /// attached to the declaration.
19023        ///
19024        /// A series of line comments appearing on consecutive lines, with no other
19025        /// tokens appearing on those lines, will be treated as a single comment.
19026        ///
19027        /// leading_detached_comments will keep paragraphs of comments that appear
19028        /// before (but not connected to) the current element. Each paragraph,
19029        /// separated by empty lines, will be one comment element in the repeated
19030        /// field.
19031        ///
19032        /// Only the comment content is provided; comment markers (e.g. //) are
19033        /// stripped out.  For block comments, leading whitespace and an asterisk
19034        /// will be stripped from the beginning of each line other than the first.
19035        /// Newlines are included in the output.
19036        ///
19037        /// Examples:
19038        ///
19039        ///   optional int32 foo = 1;  // Comment attached to foo.
19040        ///   // Comment attached to bar.
19041        ///   optional int32 bar = 2;
19042        ///
19043        ///   optional string baz = 3;
19044        ///   // Comment attached to baz.
19045        ///   // Another line attached to baz.
19046        ///
19047        ///   // Comment attached to moo.
19048        ///   //
19049        ///   // Another line attached to moo.
19050        ///   optional double moo = 4;
19051        ///
19052        ///   // Detached comment for corge. This is not leading or trailing comments
19053        ///   // to moo or corge because there are blank lines separating it from
19054        ///   // both.
19055        ///
19056        ///   // Detached comment for corge paragraph 2.
19057        ///
19058        ///   optional string corge = 5;
19059        ///   /* Block comment attached
19060        /// ```text
19061        /// * to corge.  Leading asterisks
19062        /// * will be removed. */
19063        /// ```
19064        ///   /* Block comment attached to
19065        /// ```text
19066        /// * grault. */
19067        /// ```
19068        ///   optional int32 grault = 6;
19069        ///
19070        ///   // ignored detached comments.
19071        ///
19072        /// Field 3: `leading_comments`
19073        #[cfg_attr(
19074            feature = "json",
19075            serde(
19076                rename = "leadingComments",
19077                alias = "leading_comments",
19078                skip_serializing_if = "::core::option::Option::is_none"
19079            )
19080        )]
19081        pub leading_comments: ::core::option::Option<::buffa::alloc::string::String>,
19082        /// Field 4: `trailing_comments`
19083        #[cfg_attr(
19084            feature = "json",
19085            serde(
19086                rename = "trailingComments",
19087                alias = "trailing_comments",
19088                skip_serializing_if = "::core::option::Option::is_none"
19089            )
19090        )]
19091        pub trailing_comments: ::core::option::Option<::buffa::alloc::string::String>,
19092        /// Field 6: `leading_detached_comments`
19093        #[cfg_attr(
19094            feature = "json",
19095            serde(
19096                rename = "leadingDetachedComments",
19097                alias = "leading_detached_comments",
19098                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19099                deserialize_with = "::buffa::json_helpers::null_as_default"
19100            )
19101        )]
19102        pub leading_detached_comments: ::buffa::alloc::vec::Vec<
19103            ::buffa::alloc::string::String,
19104        >,
19105        #[cfg_attr(feature = "json", serde(skip))]
19106        #[doc(hidden)]
19107        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19108    }
19109    impl ::core::fmt::Debug for Location {
19110        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19111            f.debug_struct("Location")
19112                .field("path", &self.path)
19113                .field("span", &self.span)
19114                .field("leading_comments", &self.leading_comments)
19115                .field("trailing_comments", &self.trailing_comments)
19116                .field("leading_detached_comments", &self.leading_detached_comments)
19117                .finish()
19118        }
19119    }
19120    impl Location {
19121        /// Protobuf type URL for this message, for use with `Any::pack` and
19122        /// `Any::unpack_if`.
19123        ///
19124        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19125        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19126    }
19127    impl Location {
19128        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19129        #[inline]
19130        ///Sets [`Self::leading_comments`] to `Some(value)`, consuming and returning `self`.
19131        pub fn with_leading_comments(
19132            mut self,
19133            value: impl Into<::buffa::alloc::string::String>,
19134        ) -> Self {
19135            self.leading_comments = Some(value.into());
19136            self
19137        }
19138        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19139        #[inline]
19140        ///Sets [`Self::trailing_comments`] to `Some(value)`, consuming and returning `self`.
19141        pub fn with_trailing_comments(
19142            mut self,
19143            value: impl Into<::buffa::alloc::string::String>,
19144        ) -> Self {
19145            self.trailing_comments = Some(value.into());
19146            self
19147        }
19148    }
19149    ::buffa::impl_default_instance!(Location);
19150    impl ::buffa::MessageName for Location {
19151        const PACKAGE: &'static str = "google.protobuf";
19152        const NAME: &'static str = "SourceCodeInfo.Location";
19153        const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo.Location";
19154        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19155    }
19156    impl ::buffa::Message for Location {
19157        /// Returns the total encoded size in bytes.
19158        ///
19159        /// Accumulates in `u64` (which cannot overflow for in-memory
19160        /// data) and saturates to `u32` at return, so a message whose
19161        /// encoded size exceeds the 2 GiB protobuf limit yields a value
19162        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19163        /// points reject, never a silently wrapped size.
19164        #[allow(clippy::let_and_return)]
19165        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19166            #[allow(unused_imports)]
19167            use ::buffa::Enumeration as _;
19168            let mut size = 0u64;
19169            if !self.path.is_empty() {
19170                let payload: u64 = self
19171                    .path
19172                    .iter()
19173                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19174                    .sum::<u64>();
19175                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19176            }
19177            if !self.span.is_empty() {
19178                let payload: u64 = self
19179                    .span
19180                    .iter()
19181                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19182                    .sum::<u64>();
19183                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19184            }
19185            if let Some(ref v) = self.leading_comments {
19186                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19187            }
19188            if let Some(ref v) = self.trailing_comments {
19189                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19190            }
19191            for v in &self.leading_detached_comments {
19192                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19193            }
19194            size += self.__buffa_unknown_fields.encoded_len() as u64;
19195            ::buffa::saturate_size(size)
19196        }
19197        fn write_to(
19198            &self,
19199            _cache: &mut ::buffa::SizeCache,
19200            buf: &mut impl ::buffa::EncodeSink,
19201        ) {
19202            #[allow(unused_imports)]
19203            use ::buffa::Enumeration as _;
19204            if !self.path.is_empty() {
19205                let payload: u64 = self
19206                    .path
19207                    .iter()
19208                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19209                    .sum::<u64>();
19210                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
19211                for &v in &self.path {
19212                    ::buffa::types::encode_int32(v, buf);
19213                }
19214            }
19215            if !self.span.is_empty() {
19216                let payload: u64 = self
19217                    .span
19218                    .iter()
19219                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19220                    .sum::<u64>();
19221                ::buffa::types::put_len_delimited_header(2u32, payload, buf);
19222                for &v in &self.span {
19223                    ::buffa::types::encode_int32(v, buf);
19224                }
19225            }
19226            if let Some(ref v) = self.leading_comments {
19227                ::buffa::types::put_string_field(3u32, v, buf);
19228            }
19229            if let Some(ref v) = self.trailing_comments {
19230                ::buffa::types::put_string_field(4u32, v, buf);
19231            }
19232            for v in &self.leading_detached_comments {
19233                ::buffa::types::put_string_field(6u32, v, buf);
19234            }
19235            self.__buffa_unknown_fields.write_to(buf);
19236        }
19237        fn merge_field(
19238            &mut self,
19239            tag: ::buffa::encoding::Tag,
19240            buf: &mut impl ::buffa::bytes::Buf,
19241            ctx: ::buffa::DecodeContext<'_>,
19242        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19243            #[allow(unused_imports)]
19244            use ::buffa::bytes::Buf as _;
19245            #[allow(unused_imports)]
19246            use ::buffa::Enumeration as _;
19247            match tag.field_number() {
19248                1u32 => {
19249                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19250                        let len = ::buffa::encoding::decode_varint(buf)?;
19251                        let len = usize::try_from(len)
19252                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19253                        if buf.remaining() < len {
19254                            return ::core::result::Result::Err(
19255                                ::buffa::DecodeError::UnexpectedEof,
19256                            );
19257                        }
19258                        if buf.chunk().len() >= len {
19259                            ::buffa::types::extend_packed_int32(
19260                                &buf.chunk()[..len],
19261                                &mut self.path,
19262                                len,
19263                            )?;
19264                            buf.advance(len);
19265                        } else {
19266                            self.path.reserve(len);
19267                            let mut limited = buf.take(len);
19268                            while limited.has_remaining() {
19269                                self.path
19270                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19271                            }
19272                            let leftover = limited.remaining();
19273                            if leftover > 0 {
19274                                limited.advance(leftover);
19275                            }
19276                        }
19277                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19278                        self.path.push(::buffa::types::decode_int32(buf)?);
19279                    } else {
19280                        return ::core::result::Result::Err(
19281                            ::buffa::encoding::wire_type_mismatch(
19282                                tag,
19283                                ::buffa::encoding::WireType::LengthDelimited,
19284                            ),
19285                        );
19286                    }
19287                }
19288                2u32 => {
19289                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19290                        let len = ::buffa::encoding::decode_varint(buf)?;
19291                        let len = usize::try_from(len)
19292                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19293                        if buf.remaining() < len {
19294                            return ::core::result::Result::Err(
19295                                ::buffa::DecodeError::UnexpectedEof,
19296                            );
19297                        }
19298                        if buf.chunk().len() >= len {
19299                            ::buffa::types::extend_packed_int32(
19300                                &buf.chunk()[..len],
19301                                &mut self.span,
19302                                len,
19303                            )?;
19304                            buf.advance(len);
19305                        } else {
19306                            self.span.reserve(len);
19307                            let mut limited = buf.take(len);
19308                            while limited.has_remaining() {
19309                                self.span
19310                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19311                            }
19312                            let leftover = limited.remaining();
19313                            if leftover > 0 {
19314                                limited.advance(leftover);
19315                            }
19316                        }
19317                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19318                        self.span.push(::buffa::types::decode_int32(buf)?);
19319                    } else {
19320                        return ::core::result::Result::Err(
19321                            ::buffa::encoding::wire_type_mismatch(
19322                                tag,
19323                                ::buffa::encoding::WireType::LengthDelimited,
19324                            ),
19325                        );
19326                    }
19327                }
19328                3u32 => {
19329                    ::buffa::encoding::check_wire_type(
19330                        tag,
19331                        ::buffa::encoding::WireType::LengthDelimited,
19332                    )?;
19333                    ::buffa::types::merge_string(
19334                        self
19335                            .leading_comments
19336                            .get_or_insert_with(::buffa::alloc::string::String::new),
19337                        buf,
19338                    )?;
19339                }
19340                4u32 => {
19341                    ::buffa::encoding::check_wire_type(
19342                        tag,
19343                        ::buffa::encoding::WireType::LengthDelimited,
19344                    )?;
19345                    ::buffa::types::merge_string(
19346                        self
19347                            .trailing_comments
19348                            .get_or_insert_with(::buffa::alloc::string::String::new),
19349                        buf,
19350                    )?;
19351                }
19352                6u32 => {
19353                    ::buffa::encoding::check_wire_type(
19354                        tag,
19355                        ::buffa::encoding::WireType::LengthDelimited,
19356                    )?;
19357                    let __elem = ::buffa::types::decode_string(buf)?;
19358                    ctx.register_element_memory(
19359                        ::buffa::__private::element_footprint(&__elem),
19360                    )?;
19361                    self.leading_detached_comments.push(__elem);
19362                }
19363                _ => {
19364                    self.__buffa_unknown_fields
19365                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19366                }
19367            }
19368            ::core::result::Result::Ok(())
19369        }
19370        fn clear(&mut self) {
19371            self.path.clear();
19372            self.span.clear();
19373            self.leading_comments = ::core::option::Option::None;
19374            self.trailing_comments = ::core::option::Option::None;
19375            self.leading_detached_comments.clear();
19376            self.__buffa_unknown_fields.clear();
19377        }
19378    }
19379    impl ::buffa::ExtensionSet for Location {
19380        const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo.Location";
19381        fn unknown_fields(&self) -> &::buffa::UnknownFields {
19382            &self.__buffa_unknown_fields
19383        }
19384        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19385            &mut self.__buffa_unknown_fields
19386        }
19387    }
19388    #[cfg(feature = "text")]
19389    impl ::buffa::text::TextFormat for Location {
19390        fn encode_text(
19391            &self,
19392            enc: &mut ::buffa::text::TextEncoder<'_>,
19393        ) -> ::core::fmt::Result {
19394            #[allow(unused_imports)]
19395            use ::buffa::Enumeration as _;
19396            if let ::core::option::Option::Some(ref __v) = self.leading_comments {
19397                enc.write_field_name("leading_comments")?;
19398                enc.write_string(__v)?;
19399            }
19400            if let ::core::option::Option::Some(ref __v) = self.trailing_comments {
19401                enc.write_field_name("trailing_comments")?;
19402                enc.write_string(__v)?;
19403            }
19404            for __v in &self.path {
19405                enc.write_field_name("path")?;
19406                enc.write_i32(*__v)?;
19407            }
19408            for __v in &self.span {
19409                enc.write_field_name("span")?;
19410                enc.write_i32(*__v)?;
19411            }
19412            for __v in &self.leading_detached_comments {
19413                enc.write_field_name("leading_detached_comments")?;
19414                enc.write_string(__v)?;
19415            }
19416            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19417            ::core::result::Result::Ok(())
19418        }
19419        fn merge_text(
19420            &mut self,
19421            dec: &mut ::buffa::text::TextDecoder<'_>,
19422        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19423            #[allow(unused_imports)]
19424            use ::buffa::Enumeration as _;
19425            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19426                match __name {
19427                    "leading_comments" => {
19428                        self.leading_comments = ::core::option::Option::Some(
19429                            dec.read_string()?.into_owned(),
19430                        );
19431                    }
19432                    "trailing_comments" => {
19433                        self.trailing_comments = ::core::option::Option::Some(
19434                            dec.read_string()?.into_owned(),
19435                        );
19436                    }
19437                    "path" => {
19438                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
19439                    }
19440                    "span" => {
19441                        dec.read_repeated_into(&mut self.span, |__d| __d.read_i32())?
19442                    }
19443                    "leading_detached_comments" => {
19444                        dec.read_repeated_into(
19445                            &mut self.leading_detached_comments,
19446                            |__d| ::core::result::Result::Ok(
19447                                __d.read_string()?.into_owned(),
19448                            ),
19449                        )?
19450                    }
19451                    _ => dec.skip_value()?,
19452                }
19453            }
19454            ::core::result::Result::Ok(())
19455        }
19456    }
19457    #[cfg(feature = "json")]
19458    impl ::buffa::json_helpers::ProtoElemJson for Location {
19459        fn serialize_proto_json<S: ::serde::Serializer>(
19460            v: &Self,
19461            s: S,
19462        ) -> ::core::result::Result<S::Ok, S::Error> {
19463            ::serde::Serialize::serialize(v, s)
19464        }
19465        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19466            d: D,
19467        ) -> ::core::result::Result<Self, D::Error> {
19468            <Self as ::serde::Deserialize>::deserialize(d)
19469        }
19470    }
19471    #[cfg(feature = "json")]
19472    #[doc(hidden)]
19473    pub const __LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19474        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
19475        to_json: ::buffa::type_registry::any_to_json::<Location>,
19476        from_json: ::buffa::type_registry::any_from_json::<Location>,
19477        is_wkt: false,
19478    };
19479    #[cfg(feature = "text")]
19480    #[doc(hidden)]
19481    pub const __LOCATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19482        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
19483        text_encode: ::buffa::type_registry::any_encode_text::<Location>,
19484        text_merge: ::buffa::type_registry::any_merge_text::<Location>,
19485    };
19486    #[cfg(feature = "views")]
19487    #[doc(inline)]
19488    pub use super::__buffa::view::source_code_info::LocationView;
19489    #[cfg(feature = "views")]
19490    #[doc(inline)]
19491    pub use super::__buffa::view::source_code_info::LocationOwnedView;
19492}
19493/// Describes the relationship between generated code and its original source
19494/// file. A GeneratedCodeInfo message is associated with only one generated
19495/// source file, but may contain references to different source .proto files.
19496#[derive(Clone, PartialEq, Default)]
19497#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19498#[cfg_attr(feature = "json", serde(default))]
19499#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19500pub struct GeneratedCodeInfo {
19501    /// An Annotation connects some span of text in generated code to an element
19502    /// of its generating .proto file.
19503    ///
19504    /// Field 1: `annotation`
19505    #[cfg_attr(
19506        feature = "json",
19507        serde(
19508            rename = "annotation",
19509            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19510            deserialize_with = "::buffa::json_helpers::null_as_default"
19511        )
19512    )]
19513    pub annotation: ::buffa::alloc::vec::Vec<generated_code_info::Annotation>,
19514    #[cfg_attr(feature = "json", serde(skip))]
19515    #[doc(hidden)]
19516    pub __buffa_unknown_fields: ::buffa::UnknownFields,
19517}
19518impl ::core::fmt::Debug for GeneratedCodeInfo {
19519    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19520        f.debug_struct("GeneratedCodeInfo")
19521            .field("annotation", &self.annotation)
19522            .finish()
19523    }
19524}
19525impl GeneratedCodeInfo {
19526    /// Protobuf type URL for this message, for use with `Any::pack` and
19527    /// `Any::unpack_if`.
19528    ///
19529    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19530    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
19531}
19532::buffa::impl_default_instance!(GeneratedCodeInfo);
19533impl ::buffa::MessageName for GeneratedCodeInfo {
19534    const PACKAGE: &'static str = "google.protobuf";
19535    const NAME: &'static str = "GeneratedCodeInfo";
19536    const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo";
19537    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
19538}
19539impl ::buffa::Message for GeneratedCodeInfo {
19540    /// Returns the total encoded size in bytes.
19541    ///
19542    /// Accumulates in `u64` (which cannot overflow for in-memory
19543    /// data) and saturates to `u32` at return, so a message whose
19544    /// encoded size exceeds the 2 GiB protobuf limit yields a value
19545    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19546    /// points reject, never a silently wrapped size.
19547    #[allow(clippy::let_and_return)]
19548    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19549        #[allow(unused_imports)]
19550        use ::buffa::Enumeration as _;
19551        let mut size = 0u64;
19552        for v in &self.annotation {
19553            let __slot = __cache.reserve();
19554            let inner_size = v.compute_size(__cache);
19555            __cache.set(__slot, inner_size);
19556            size
19557                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
19558                    + inner_size as u64;
19559        }
19560        size += self.__buffa_unknown_fields.encoded_len() as u64;
19561        ::buffa::saturate_size(size)
19562    }
19563    fn write_to(
19564        &self,
19565        __cache: &mut ::buffa::SizeCache,
19566        buf: &mut impl ::buffa::EncodeSink,
19567    ) {
19568        #[allow(unused_imports)]
19569        use ::buffa::Enumeration as _;
19570        for v in &self.annotation {
19571            ::buffa::types::put_len_delimited_header(
19572                1u32,
19573                u64::from(__cache.consume_next()),
19574                buf,
19575            );
19576            v.write_to(__cache, buf);
19577        }
19578        self.__buffa_unknown_fields.write_to(buf);
19579    }
19580    fn merge_field(
19581        &mut self,
19582        tag: ::buffa::encoding::Tag,
19583        buf: &mut impl ::buffa::bytes::Buf,
19584        ctx: ::buffa::DecodeContext<'_>,
19585    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19586        #[allow(unused_imports)]
19587        use ::buffa::bytes::Buf as _;
19588        #[allow(unused_imports)]
19589        use ::buffa::Enumeration as _;
19590        match tag.field_number() {
19591            1u32 => {
19592                ::buffa::encoding::check_wire_type(
19593                    tag,
19594                    ::buffa::encoding::WireType::LengthDelimited,
19595                )?;
19596                let mut elem = ::core::default::Default::default();
19597                ctx.register_element_memory(
19598                    ::buffa::__private::element_footprint(&elem),
19599                )?;
19600                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
19601                self.annotation.push(elem);
19602            }
19603            _ => {
19604                self.__buffa_unknown_fields
19605                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19606            }
19607        }
19608        ::core::result::Result::Ok(())
19609    }
19610    fn clear(&mut self) {
19611        self.annotation.clear();
19612        self.__buffa_unknown_fields.clear();
19613    }
19614}
19615impl ::buffa::ExtensionSet for GeneratedCodeInfo {
19616    const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo";
19617    fn unknown_fields(&self) -> &::buffa::UnknownFields {
19618        &self.__buffa_unknown_fields
19619    }
19620    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19621        &mut self.__buffa_unknown_fields
19622    }
19623}
19624#[cfg(feature = "text")]
19625impl ::buffa::text::TextFormat for GeneratedCodeInfo {
19626    fn encode_text(
19627        &self,
19628        enc: &mut ::buffa::text::TextEncoder<'_>,
19629    ) -> ::core::fmt::Result {
19630        #[allow(unused_imports)]
19631        use ::buffa::Enumeration as _;
19632        for __v in &self.annotation {
19633            enc.write_field_name("annotation")?;
19634            enc.write_message(__v)?;
19635        }
19636        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19637        ::core::result::Result::Ok(())
19638    }
19639    fn merge_text(
19640        &mut self,
19641        dec: &mut ::buffa::text::TextDecoder<'_>,
19642    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19643        #[allow(unused_imports)]
19644        use ::buffa::Enumeration as _;
19645        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19646            match __name {
19647                "annotation" => {
19648                    dec.read_repeated_into(
19649                        &mut self.annotation,
19650                        |__d| {
19651                            let mut __m = ::core::default::Default::default();
19652                            __d.merge_message(&mut __m)?;
19653                            ::core::result::Result::Ok(__m)
19654                        },
19655                    )?
19656                }
19657                _ => dec.skip_value()?,
19658            }
19659        }
19660        ::core::result::Result::Ok(())
19661    }
19662}
19663#[cfg(feature = "json")]
19664impl ::buffa::json_helpers::ProtoElemJson for GeneratedCodeInfo {
19665    fn serialize_proto_json<S: ::serde::Serializer>(
19666        v: &Self,
19667        s: S,
19668    ) -> ::core::result::Result<S::Ok, S::Error> {
19669        ::serde::Serialize::serialize(v, s)
19670    }
19671    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19672        d: D,
19673    ) -> ::core::result::Result<Self, D::Error> {
19674        <Self as ::serde::Deserialize>::deserialize(d)
19675    }
19676}
19677#[cfg(feature = "json")]
19678#[doc(hidden)]
19679pub const __GENERATED_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19680    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19681    to_json: ::buffa::type_registry::any_to_json::<GeneratedCodeInfo>,
19682    from_json: ::buffa::type_registry::any_from_json::<GeneratedCodeInfo>,
19683    is_wkt: false,
19684};
19685#[cfg(feature = "text")]
19686#[doc(hidden)]
19687pub const __GENERATED_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19688    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19689    text_encode: ::buffa::type_registry::any_encode_text::<GeneratedCodeInfo>,
19690    text_merge: ::buffa::type_registry::any_merge_text::<GeneratedCodeInfo>,
19691};
19692pub mod generated_code_info {
19693    #[allow(unused_imports)]
19694    use super::*;
19695    #[derive(Clone, PartialEq, Default)]
19696    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19697    #[cfg_attr(feature = "json", serde(default))]
19698    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19699    pub struct Annotation {
19700        /// Identifies the element in the original source .proto file. This field
19701        /// is formatted the same as SourceCodeInfo.Location.path.
19702        ///
19703        /// Field 1: `path`
19704        #[cfg_attr(
19705            feature = "json",
19706            serde(
19707                rename = "path",
19708                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19709                deserialize_with = "::buffa::json_helpers::null_as_default"
19710            )
19711        )]
19712        pub path: ::buffa::alloc::vec::Vec<i32>,
19713        /// Identifies the filesystem path to the original source .proto.
19714        ///
19715        /// Field 2: `source_file`
19716        #[cfg_attr(
19717            feature = "json",
19718            serde(
19719                rename = "sourceFile",
19720                alias = "source_file",
19721                skip_serializing_if = "::core::option::Option::is_none"
19722            )
19723        )]
19724        pub source_file: ::core::option::Option<::buffa::alloc::string::String>,
19725        /// Identifies the starting offset in bytes in the generated code
19726        /// that relates to the identified object.
19727        ///
19728        /// Field 3: `begin`
19729        #[cfg_attr(
19730            feature = "json",
19731            serde(
19732                rename = "begin",
19733                with = "::buffa::json_helpers::opt_int32",
19734                skip_serializing_if = "::core::option::Option::is_none"
19735            )
19736        )]
19737        pub begin: ::core::option::Option<i32>,
19738        /// Identifies the ending offset in bytes in the generated code that
19739        /// relates to the identified object. The end offset should be one past
19740        /// the last relevant byte (so the length of the text = end - begin).
19741        ///
19742        /// Field 4: `end`
19743        #[cfg_attr(
19744            feature = "json",
19745            serde(
19746                rename = "end",
19747                with = "::buffa::json_helpers::opt_int32",
19748                skip_serializing_if = "::core::option::Option::is_none"
19749            )
19750        )]
19751        pub end: ::core::option::Option<i32>,
19752        /// Field 5: `semantic`
19753        #[cfg_attr(
19754            feature = "json",
19755            serde(
19756                rename = "semantic",
19757                with = "::buffa::json_helpers::opt_closed_enum",
19758                skip_serializing_if = "::core::option::Option::is_none"
19759            )
19760        )]
19761        pub semantic: ::core::option::Option<
19762            super::generated_code_info::annotation::Semantic,
19763        >,
19764        #[cfg_attr(feature = "json", serde(skip))]
19765        #[doc(hidden)]
19766        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19767    }
19768    impl ::core::fmt::Debug for Annotation {
19769        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19770            f.debug_struct("Annotation")
19771                .field("path", &self.path)
19772                .field("source_file", &self.source_file)
19773                .field("begin", &self.begin)
19774                .field("end", &self.end)
19775                .field("semantic", &self.semantic)
19776                .finish()
19777        }
19778    }
19779    impl Annotation {
19780        /// Protobuf type URL for this message, for use with `Any::pack` and
19781        /// `Any::unpack_if`.
19782        ///
19783        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19784        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19785    }
19786    impl Annotation {
19787        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19788        #[inline]
19789        ///Sets [`Self::source_file`] to `Some(value)`, consuming and returning `self`.
19790        pub fn with_source_file(
19791            mut self,
19792            value: impl Into<::buffa::alloc::string::String>,
19793        ) -> Self {
19794            self.source_file = Some(value.into());
19795            self
19796        }
19797        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19798        #[inline]
19799        ///Sets [`Self::begin`] to `Some(value)`, consuming and returning `self`.
19800        pub fn with_begin(mut self, value: i32) -> Self {
19801            self.begin = Some(value);
19802            self
19803        }
19804        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19805        #[inline]
19806        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
19807        pub fn with_end(mut self, value: i32) -> Self {
19808            self.end = Some(value);
19809            self
19810        }
19811        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19812        #[inline]
19813        ///Sets [`Self::semantic`] to `Some(value)`, consuming and returning `self`.
19814        pub fn with_semantic(
19815            mut self,
19816            value: impl Into<super::generated_code_info::annotation::Semantic>,
19817        ) -> Self {
19818            self.semantic = Some(value.into());
19819            self
19820        }
19821    }
19822    ::buffa::impl_default_instance!(Annotation);
19823    impl ::buffa::MessageName for Annotation {
19824        const PACKAGE: &'static str = "google.protobuf";
19825        const NAME: &'static str = "GeneratedCodeInfo.Annotation";
19826        const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
19827        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19828    }
19829    impl ::buffa::Message for Annotation {
19830        /// Returns the total encoded size in bytes.
19831        ///
19832        /// Accumulates in `u64` (which cannot overflow for in-memory
19833        /// data) and saturates to `u32` at return, so a message whose
19834        /// encoded size exceeds the 2 GiB protobuf limit yields a value
19835        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19836        /// points reject, never a silently wrapped size.
19837        #[allow(clippy::let_and_return)]
19838        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19839            #[allow(unused_imports)]
19840            use ::buffa::Enumeration as _;
19841            let mut size = 0u64;
19842            if !self.path.is_empty() {
19843                let payload: u64 = self
19844                    .path
19845                    .iter()
19846                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19847                    .sum::<u64>();
19848                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19849            }
19850            if let Some(ref v) = self.source_file {
19851                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19852            }
19853            if let Some(v) = self.begin {
19854                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
19855            }
19856            if let Some(v) = self.end {
19857                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
19858            }
19859            if let Some(ref v) = self.semantic {
19860                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
19861            }
19862            size += self.__buffa_unknown_fields.encoded_len() as u64;
19863            ::buffa::saturate_size(size)
19864        }
19865        fn write_to(
19866            &self,
19867            _cache: &mut ::buffa::SizeCache,
19868            buf: &mut impl ::buffa::EncodeSink,
19869        ) {
19870            #[allow(unused_imports)]
19871            use ::buffa::Enumeration as _;
19872            if !self.path.is_empty() {
19873                let payload: u64 = self
19874                    .path
19875                    .iter()
19876                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19877                    .sum::<u64>();
19878                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
19879                for &v in &self.path {
19880                    ::buffa::types::encode_int32(v, buf);
19881                }
19882            }
19883            if let Some(ref v) = self.source_file {
19884                ::buffa::types::put_string_field(2u32, v, buf);
19885            }
19886            if let Some(v) = self.begin {
19887                ::buffa::types::put_int32_field(3u32, v, buf);
19888            }
19889            if let Some(v) = self.end {
19890                ::buffa::types::put_int32_field(4u32, v, buf);
19891            }
19892            if let Some(ref v) = self.semantic {
19893                ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
19894            }
19895            self.__buffa_unknown_fields.write_to(buf);
19896        }
19897        fn merge_field(
19898            &mut self,
19899            tag: ::buffa::encoding::Tag,
19900            buf: &mut impl ::buffa::bytes::Buf,
19901            ctx: ::buffa::DecodeContext<'_>,
19902        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19903            #[allow(unused_imports)]
19904            use ::buffa::bytes::Buf as _;
19905            #[allow(unused_imports)]
19906            use ::buffa::Enumeration as _;
19907            match tag.field_number() {
19908                1u32 => {
19909                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19910                        let len = ::buffa::encoding::decode_varint(buf)?;
19911                        let len = usize::try_from(len)
19912                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19913                        if buf.remaining() < len {
19914                            return ::core::result::Result::Err(
19915                                ::buffa::DecodeError::UnexpectedEof,
19916                            );
19917                        }
19918                        if buf.chunk().len() >= len {
19919                            ::buffa::types::extend_packed_int32(
19920                                &buf.chunk()[..len],
19921                                &mut self.path,
19922                                len,
19923                            )?;
19924                            buf.advance(len);
19925                        } else {
19926                            self.path.reserve(len);
19927                            let mut limited = buf.take(len);
19928                            while limited.has_remaining() {
19929                                self.path
19930                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19931                            }
19932                            let leftover = limited.remaining();
19933                            if leftover > 0 {
19934                                limited.advance(leftover);
19935                            }
19936                        }
19937                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19938                        self.path.push(::buffa::types::decode_int32(buf)?);
19939                    } else {
19940                        return ::core::result::Result::Err(
19941                            ::buffa::encoding::wire_type_mismatch(
19942                                tag,
19943                                ::buffa::encoding::WireType::LengthDelimited,
19944                            ),
19945                        );
19946                    }
19947                }
19948                2u32 => {
19949                    ::buffa::encoding::check_wire_type(
19950                        tag,
19951                        ::buffa::encoding::WireType::LengthDelimited,
19952                    )?;
19953                    ::buffa::types::merge_string(
19954                        self
19955                            .source_file
19956                            .get_or_insert_with(::buffa::alloc::string::String::new),
19957                        buf,
19958                    )?;
19959                }
19960                3u32 => {
19961                    ::buffa::encoding::check_wire_type(
19962                        tag,
19963                        ::buffa::encoding::WireType::Varint,
19964                    )?;
19965                    self.begin = ::core::option::Option::Some(
19966                        ::buffa::types::decode_int32(buf)?,
19967                    );
19968                }
19969                4u32 => {
19970                    ::buffa::encoding::check_wire_type(
19971                        tag,
19972                        ::buffa::encoding::WireType::Varint,
19973                    )?;
19974                    self.end = ::core::option::Option::Some(
19975                        ::buffa::types::decode_int32(buf)?,
19976                    );
19977                }
19978                5u32 => {
19979                    ::buffa::encoding::check_wire_type(
19980                        tag,
19981                        ::buffa::encoding::WireType::Varint,
19982                    )?;
19983                    let __raw = ::buffa::types::decode_int32(buf)?;
19984                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
19985                        __raw,
19986                    ) {
19987                        self.semantic = ::core::option::Option::Some(__v);
19988                    } else {
19989                        ctx.register_unknown_field()?;
19990                        self.__buffa_unknown_fields
19991                            .push(::buffa::UnknownField {
19992                                number: 5u32,
19993                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
19994                            });
19995                    }
19996                }
19997                _ => {
19998                    self.__buffa_unknown_fields
19999                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
20000                }
20001            }
20002            ::core::result::Result::Ok(())
20003        }
20004        fn clear(&mut self) {
20005            self.path.clear();
20006            self.source_file = ::core::option::Option::None;
20007            self.begin = ::core::option::Option::None;
20008            self.end = ::core::option::Option::None;
20009            self.semantic = ::core::option::Option::None;
20010            self.__buffa_unknown_fields.clear();
20011        }
20012    }
20013    impl ::buffa::ExtensionSet for Annotation {
20014        const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
20015        fn unknown_fields(&self) -> &::buffa::UnknownFields {
20016            &self.__buffa_unknown_fields
20017        }
20018        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
20019            &mut self.__buffa_unknown_fields
20020        }
20021    }
20022    #[cfg(feature = "text")]
20023    impl ::buffa::text::TextFormat for Annotation {
20024        fn encode_text(
20025            &self,
20026            enc: &mut ::buffa::text::TextEncoder<'_>,
20027        ) -> ::core::fmt::Result {
20028            #[allow(unused_imports)]
20029            use ::buffa::Enumeration as _;
20030            if let ::core::option::Option::Some(ref __v) = self.source_file {
20031                enc.write_field_name("source_file")?;
20032                enc.write_string(__v)?;
20033            }
20034            if let ::core::option::Option::Some(ref __v) = self.begin {
20035                enc.write_field_name("begin")?;
20036                enc.write_i32(*__v)?;
20037            }
20038            if let ::core::option::Option::Some(ref __v) = self.end {
20039                enc.write_field_name("end")?;
20040                enc.write_i32(*__v)?;
20041            }
20042            if let ::core::option::Option::Some(ref __v) = self.semantic {
20043                enc.write_field_name("semantic")?;
20044                enc.write_enum_name(__v.proto_name())?;
20045            }
20046            for __v in &self.path {
20047                enc.write_field_name("path")?;
20048                enc.write_i32(*__v)?;
20049            }
20050            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
20051            ::core::result::Result::Ok(())
20052        }
20053        fn merge_text(
20054            &mut self,
20055            dec: &mut ::buffa::text::TextDecoder<'_>,
20056        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
20057            #[allow(unused_imports)]
20058            use ::buffa::Enumeration as _;
20059            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
20060                match __name {
20061                    "source_file" => {
20062                        self.source_file = ::core::option::Option::Some(
20063                            dec.read_string()?.into_owned(),
20064                        );
20065                    }
20066                    "begin" => self.begin = ::core::option::Option::Some(dec.read_i32()?),
20067                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
20068                    "semantic" => {
20069                        self.semantic = ::core::option::Option::Some(
20070                            dec
20071                                .read_closed_enum_by_name::<
20072                                    super::generated_code_info::annotation::Semantic,
20073                                >()?,
20074                        );
20075                    }
20076                    "path" => {
20077                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
20078                    }
20079                    _ => dec.skip_value()?,
20080                }
20081            }
20082            ::core::result::Result::Ok(())
20083        }
20084    }
20085    #[cfg(feature = "json")]
20086    impl ::buffa::json_helpers::ProtoElemJson for Annotation {
20087        fn serialize_proto_json<S: ::serde::Serializer>(
20088            v: &Self,
20089            s: S,
20090        ) -> ::core::result::Result<S::Ok, S::Error> {
20091            ::serde::Serialize::serialize(v, s)
20092        }
20093        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20094            d: D,
20095        ) -> ::core::result::Result<Self, D::Error> {
20096            <Self as ::serde::Deserialize>::deserialize(d)
20097        }
20098    }
20099    #[cfg(feature = "json")]
20100    #[doc(hidden)]
20101    pub const __ANNOTATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
20102        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20103        to_json: ::buffa::type_registry::any_to_json::<Annotation>,
20104        from_json: ::buffa::type_registry::any_from_json::<Annotation>,
20105        is_wkt: false,
20106    };
20107    #[cfg(feature = "text")]
20108    #[doc(hidden)]
20109    pub const __ANNOTATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
20110        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20111        text_encode: ::buffa::type_registry::any_encode_text::<Annotation>,
20112        text_merge: ::buffa::type_registry::any_merge_text::<Annotation>,
20113    };
20114    pub mod annotation {
20115        #[allow(unused_imports)]
20116        use super::*;
20117        /// Represents the identified object's effect on the element in the original
20118        /// .proto file.
20119        #[allow(non_camel_case_types)]
20120        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
20121        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
20122        #[repr(i32)]
20123        pub enum Semantic {
20124            /// There is no effect or the effect is indescribable.
20125            NONE = 0i32,
20126            /// The element is set or otherwise mutated.
20127            SET = 1i32,
20128            /// An alias to the element is returned.
20129            ALIAS = 2i32,
20130        }
20131        impl Semantic {
20132            ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
20133            #[allow(non_upper_case_globals)]
20134            pub const None: Self = Self::NONE;
20135            ///Idiomatic alias for [`Self::SET`]; `Debug` prints the variant name.
20136            #[allow(non_upper_case_globals)]
20137            pub const Set: Self = Self::SET;
20138            ///Idiomatic alias for [`Self::ALIAS`]; `Debug` prints the variant name.
20139            #[allow(non_upper_case_globals)]
20140            pub const Alias: Self = Self::ALIAS;
20141        }
20142        impl ::core::default::Default for Semantic {
20143            fn default() -> Self {
20144                Self::NONE
20145            }
20146        }
20147        #[cfg(feature = "json")]
20148        const _: () = {
20149            impl ::serde::Serialize for Semantic {
20150                fn serialize<S: ::serde::Serializer>(
20151                    &self,
20152                    s: S,
20153                ) -> ::core::result::Result<S::Ok, S::Error> {
20154                    s.serialize_str(::buffa::Enumeration::proto_name(self))
20155                }
20156            }
20157            impl<'de> ::serde::Deserialize<'de> for Semantic {
20158                fn deserialize<D: ::serde::Deserializer<'de>>(
20159                    d: D,
20160                ) -> ::core::result::Result<Self, D::Error> {
20161                    struct _V;
20162                    impl ::serde::de::Visitor<'_> for _V {
20163                        type Value = Semantic;
20164                        fn expecting(
20165                            &self,
20166                            f: &mut ::core::fmt::Formatter<'_>,
20167                        ) -> ::core::fmt::Result {
20168                            f.write_str(
20169                                concat!(
20170                                    "a string, integer, or null for ", stringify!(Semantic)
20171                                ),
20172                            )
20173                        }
20174                        fn visit_str<E: ::serde::de::Error>(
20175                            self,
20176                            v: &str,
20177                        ) -> ::core::result::Result<Semantic, E> {
20178                            <Semantic as ::buffa::Enumeration>::from_proto_name(v)
20179                                .ok_or_else(|| {
20180                                    ::serde::de::Error::unknown_variant(v, &[])
20181                                })
20182                        }
20183                        fn visit_i64<E: ::serde::de::Error>(
20184                            self,
20185                            v: i64,
20186                        ) -> ::core::result::Result<Semantic, E> {
20187                            let v32 = i32::try_from(v)
20188                                .map_err(|_| {
20189                                    ::serde::de::Error::custom(
20190                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20191                                    )
20192                                })?;
20193                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20194                                .ok_or_else(|| {
20195                                    ::serde::de::Error::custom(
20196                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20197                                    )
20198                                })
20199                        }
20200                        fn visit_u64<E: ::serde::de::Error>(
20201                            self,
20202                            v: u64,
20203                        ) -> ::core::result::Result<Semantic, E> {
20204                            let v32 = i32::try_from(v)
20205                                .map_err(|_| {
20206                                    ::serde::de::Error::custom(
20207                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20208                                    )
20209                                })?;
20210                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20211                                .ok_or_else(|| {
20212                                    ::serde::de::Error::custom(
20213                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20214                                    )
20215                                })
20216                        }
20217                        fn visit_unit<E: ::serde::de::Error>(
20218                            self,
20219                        ) -> ::core::result::Result<Semantic, E> {
20220                            ::core::result::Result::Ok(
20221                                ::core::default::Default::default(),
20222                            )
20223                        }
20224                    }
20225                    d.deserialize_any(_V)
20226                }
20227            }
20228            impl ::buffa::json_helpers::ProtoElemJson for Semantic {
20229                fn serialize_proto_json<S: ::serde::Serializer>(
20230                    v: &Self,
20231                    s: S,
20232                ) -> ::core::result::Result<S::Ok, S::Error> {
20233                    ::serde::Serialize::serialize(v, s)
20234                }
20235                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20236                    d: D,
20237                ) -> ::core::result::Result<Self, D::Error> {
20238                    <Self as ::serde::Deserialize>::deserialize(d)
20239                }
20240            }
20241        };
20242        impl ::buffa::Enumeration for Semantic {
20243            fn from_i32(value: i32) -> ::core::option::Option<Self> {
20244                match value {
20245                    0i32 => ::core::option::Option::Some(Self::NONE),
20246                    1i32 => ::core::option::Option::Some(Self::SET),
20247                    2i32 => ::core::option::Option::Some(Self::ALIAS),
20248                    _ => ::core::option::Option::None,
20249                }
20250            }
20251            fn to_i32(&self) -> i32 {
20252                *self as i32
20253            }
20254            fn proto_name(&self) -> &'static str {
20255                match self {
20256                    Self::NONE => "NONE",
20257                    Self::SET => "SET",
20258                    Self::ALIAS => "ALIAS",
20259                }
20260            }
20261            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
20262                match name {
20263                    "NONE" => ::core::option::Option::Some(Self::NONE),
20264                    "SET" => ::core::option::Option::Some(Self::SET),
20265                    "ALIAS" => ::core::option::Option::Some(Self::ALIAS),
20266                    _ => ::core::option::Option::None,
20267                }
20268            }
20269            fn values() -> &'static [Self] {
20270                &[Self::NONE, Self::SET, Self::ALIAS]
20271            }
20272        }
20273    }
20274    #[cfg(feature = "views")]
20275    #[doc(inline)]
20276    pub use super::__buffa::view::generated_code_info::AnnotationView;
20277    #[cfg(feature = "views")]
20278    #[doc(inline)]
20279    pub use super::__buffa::view::generated_code_info::AnnotationOwnedView;
20280}