Skip to main content

buffa_descriptor/generated/
google.protobuf.descriptor.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2// source: google/protobuf/descriptor.proto
3
4/// The full set of known editions.
5#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
6#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
7#[repr(i32)]
8pub enum Edition {
9    /// A placeholder for an unknown edition value.
10    EDITION_UNKNOWN = 0i32,
11    /// A placeholder edition for specifying default behaviors *before* a feature
12    /// was first introduced.  This is effectively an "infinite past".
13    EDITION_LEGACY = 900i32,
14    /// Legacy syntax "editions".  These pre-date editions, but behave much like
15    /// distinct editions.  These can't be used to specify the edition of proto
16    /// files, but feature definitions must supply proto2/proto3 defaults for
17    /// backwards compatibility.
18    EDITION_PROTO2 = 998i32,
19    EDITION_PROTO3 = 999i32,
20    /// Editions that have been released.  The specific values are arbitrary and
21    /// should not be depended on, but they will always be time-ordered for easy
22    /// comparison.
23    EDITION_2023 = 1000i32,
24    EDITION_2024 = 1001i32,
25    /// A placeholder edition for developing and testing unscheduled features.
26    EDITION_UNSTABLE = 9999i32,
27    /// Placeholder editions for testing feature resolution.  These should not be
28    /// used or relied on outside of tests.
29    EDITION_1_TEST_ONLY = 1i32,
30    EDITION_2_TEST_ONLY = 2i32,
31    EDITION_99997_TEST_ONLY = 99997i32,
32    EDITION_99998_TEST_ONLY = 99998i32,
33    EDITION_99999_TEST_ONLY = 99999i32,
34    /// Placeholder for specifying unbounded edition support.  This should only
35    /// ever be used by plugins that can expect to never require any changes to
36    /// support a new edition.
37    EDITION_MAX = 2147483647i32,
38}
39impl Edition {
40    ///Idiomatic alias for [`Self::EDITION_UNKNOWN`]; `Debug` prints the variant name.
41    #[allow(non_upper_case_globals)]
42    pub const EditionUnknown: Self = Self::EDITION_UNKNOWN;
43    ///Idiomatic alias for [`Self::EDITION_LEGACY`]; `Debug` prints the variant name.
44    #[allow(non_upper_case_globals)]
45    pub const EditionLegacy: Self = Self::EDITION_LEGACY;
46    ///Idiomatic alias for [`Self::EDITION_PROTO2`]; `Debug` prints the variant name.
47    #[allow(non_upper_case_globals)]
48    pub const EditionProto2: Self = Self::EDITION_PROTO2;
49    ///Idiomatic alias for [`Self::EDITION_PROTO3`]; `Debug` prints the variant name.
50    #[allow(non_upper_case_globals)]
51    pub const EditionProto3: Self = Self::EDITION_PROTO3;
52    ///Idiomatic alias for [`Self::EDITION_2023`]; `Debug` prints the variant name.
53    #[allow(non_upper_case_globals)]
54    pub const Edition2023: Self = Self::EDITION_2023;
55    ///Idiomatic alias for [`Self::EDITION_2024`]; `Debug` prints the variant name.
56    #[allow(non_upper_case_globals)]
57    pub const Edition2024: Self = Self::EDITION_2024;
58    ///Idiomatic alias for [`Self::EDITION_UNSTABLE`]; `Debug` prints the variant name.
59    #[allow(non_upper_case_globals)]
60    pub const EditionUnstable: Self = Self::EDITION_UNSTABLE;
61    ///Idiomatic alias for [`Self::EDITION_1_TEST_ONLY`]; `Debug` prints the variant name.
62    #[allow(non_upper_case_globals)]
63    pub const Edition1TestOnly: Self = Self::EDITION_1_TEST_ONLY;
64    ///Idiomatic alias for [`Self::EDITION_2_TEST_ONLY`]; `Debug` prints the variant name.
65    #[allow(non_upper_case_globals)]
66    pub const Edition2TestOnly: Self = Self::EDITION_2_TEST_ONLY;
67    ///Idiomatic alias for [`Self::EDITION_99997_TEST_ONLY`]; `Debug` prints the variant name.
68    #[allow(non_upper_case_globals)]
69    pub const Edition99997TestOnly: Self = Self::EDITION_99997_TEST_ONLY;
70    ///Idiomatic alias for [`Self::EDITION_99998_TEST_ONLY`]; `Debug` prints the variant name.
71    #[allow(non_upper_case_globals)]
72    pub const Edition99998TestOnly: Self = Self::EDITION_99998_TEST_ONLY;
73    ///Idiomatic alias for [`Self::EDITION_99999_TEST_ONLY`]; `Debug` prints the variant name.
74    #[allow(non_upper_case_globals)]
75    pub const Edition99999TestOnly: Self = Self::EDITION_99999_TEST_ONLY;
76    ///Idiomatic alias for [`Self::EDITION_MAX`]; `Debug` prints the variant name.
77    #[allow(non_upper_case_globals)]
78    pub const EditionMax: Self = Self::EDITION_MAX;
79}
80impl ::core::default::Default for Edition {
81    fn default() -> Self {
82        Self::EDITION_UNKNOWN
83    }
84}
85#[cfg(feature = "json")]
86const _: () = {
87    impl ::serde::Serialize for Edition {
88        fn serialize<S: ::serde::Serializer>(
89            &self,
90            s: S,
91        ) -> ::core::result::Result<S::Ok, S::Error> {
92            s.serialize_str(::buffa::Enumeration::proto_name(self))
93        }
94    }
95    impl<'de> ::serde::Deserialize<'de> for Edition {
96        fn deserialize<D: ::serde::Deserializer<'de>>(
97            d: D,
98        ) -> ::core::result::Result<Self, D::Error> {
99            struct _V;
100            impl ::serde::de::Visitor<'_> for _V {
101                type Value = Edition;
102                fn expecting(
103                    &self,
104                    f: &mut ::core::fmt::Formatter<'_>,
105                ) -> ::core::fmt::Result {
106                    f.write_str(
107                        concat!("a string, integer, or null for ", stringify!(Edition)),
108                    )
109                }
110                fn visit_str<E: ::serde::de::Error>(
111                    self,
112                    v: &str,
113                ) -> ::core::result::Result<Edition, E> {
114                    <Edition as ::buffa::Enumeration>::from_proto_name(v)
115                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
116                }
117                fn visit_i64<E: ::serde::de::Error>(
118                    self,
119                    v: i64,
120                ) -> ::core::result::Result<Edition, E> {
121                    let v32 = i32::try_from(v)
122                        .map_err(|_| {
123                            ::serde::de::Error::custom(
124                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
125                            )
126                        })?;
127                    <Edition as ::buffa::Enumeration>::from_i32(v32)
128                        .ok_or_else(|| {
129                            ::serde::de::Error::custom(
130                                ::buffa::alloc::format!("unknown enum value {v32}"),
131                            )
132                        })
133                }
134                fn visit_u64<E: ::serde::de::Error>(
135                    self,
136                    v: u64,
137                ) -> ::core::result::Result<Edition, E> {
138                    let v32 = i32::try_from(v)
139                        .map_err(|_| {
140                            ::serde::de::Error::custom(
141                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
142                            )
143                        })?;
144                    <Edition as ::buffa::Enumeration>::from_i32(v32)
145                        .ok_or_else(|| {
146                            ::serde::de::Error::custom(
147                                ::buffa::alloc::format!("unknown enum value {v32}"),
148                            )
149                        })
150                }
151                fn visit_unit<E: ::serde::de::Error>(
152                    self,
153                ) -> ::core::result::Result<Edition, E> {
154                    ::core::result::Result::Ok(::core::default::Default::default())
155                }
156            }
157            d.deserialize_any(_V)
158        }
159    }
160    impl ::buffa::json_helpers::ProtoElemJson for Edition {
161        fn serialize_proto_json<S: ::serde::Serializer>(
162            v: &Self,
163            s: S,
164        ) -> ::core::result::Result<S::Ok, S::Error> {
165            ::serde::Serialize::serialize(v, s)
166        }
167        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
168            d: D,
169        ) -> ::core::result::Result<Self, D::Error> {
170            <Self as ::serde::Deserialize>::deserialize(d)
171        }
172    }
173};
174impl ::buffa::Enumeration for Edition {
175    fn from_i32(value: i32) -> ::core::option::Option<Self> {
176        match value {
177            0i32 => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
178            900i32 => ::core::option::Option::Some(Self::EDITION_LEGACY),
179            998i32 => ::core::option::Option::Some(Self::EDITION_PROTO2),
180            999i32 => ::core::option::Option::Some(Self::EDITION_PROTO3),
181            1000i32 => ::core::option::Option::Some(Self::EDITION_2023),
182            1001i32 => ::core::option::Option::Some(Self::EDITION_2024),
183            9999i32 => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
184            1i32 => ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY),
185            2i32 => ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY),
186            99997i32 => ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY),
187            99998i32 => ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY),
188            99999i32 => ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY),
189            2147483647i32 => ::core::option::Option::Some(Self::EDITION_MAX),
190            _ => ::core::option::Option::None,
191        }
192    }
193    fn to_i32(&self) -> i32 {
194        *self as i32
195    }
196    fn proto_name(&self) -> &'static str {
197        match self {
198            Self::EDITION_UNKNOWN => "EDITION_UNKNOWN",
199            Self::EDITION_LEGACY => "EDITION_LEGACY",
200            Self::EDITION_PROTO2 => "EDITION_PROTO2",
201            Self::EDITION_PROTO3 => "EDITION_PROTO3",
202            Self::EDITION_2023 => "EDITION_2023",
203            Self::EDITION_2024 => "EDITION_2024",
204            Self::EDITION_UNSTABLE => "EDITION_UNSTABLE",
205            Self::EDITION_1_TEST_ONLY => "EDITION_1_TEST_ONLY",
206            Self::EDITION_2_TEST_ONLY => "EDITION_2_TEST_ONLY",
207            Self::EDITION_99997_TEST_ONLY => "EDITION_99997_TEST_ONLY",
208            Self::EDITION_99998_TEST_ONLY => "EDITION_99998_TEST_ONLY",
209            Self::EDITION_99999_TEST_ONLY => "EDITION_99999_TEST_ONLY",
210            Self::EDITION_MAX => "EDITION_MAX",
211        }
212    }
213    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
214        match name {
215            "EDITION_UNKNOWN" => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
216            "EDITION_LEGACY" => ::core::option::Option::Some(Self::EDITION_LEGACY),
217            "EDITION_PROTO2" => ::core::option::Option::Some(Self::EDITION_PROTO2),
218            "EDITION_PROTO3" => ::core::option::Option::Some(Self::EDITION_PROTO3),
219            "EDITION_2023" => ::core::option::Option::Some(Self::EDITION_2023),
220            "EDITION_2024" => ::core::option::Option::Some(Self::EDITION_2024),
221            "EDITION_UNSTABLE" => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
222            "EDITION_1_TEST_ONLY" => {
223                ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY)
224            }
225            "EDITION_2_TEST_ONLY" => {
226                ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY)
227            }
228            "EDITION_99997_TEST_ONLY" => {
229                ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY)
230            }
231            "EDITION_99998_TEST_ONLY" => {
232                ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY)
233            }
234            "EDITION_99999_TEST_ONLY" => {
235                ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY)
236            }
237            "EDITION_MAX" => ::core::option::Option::Some(Self::EDITION_MAX),
238            _ => ::core::option::Option::None,
239        }
240    }
241    fn values() -> &'static [Self] {
242        &[
243            Self::EDITION_UNKNOWN,
244            Self::EDITION_LEGACY,
245            Self::EDITION_PROTO2,
246            Self::EDITION_PROTO3,
247            Self::EDITION_2023,
248            Self::EDITION_2024,
249            Self::EDITION_UNSTABLE,
250            Self::EDITION_1_TEST_ONLY,
251            Self::EDITION_2_TEST_ONLY,
252            Self::EDITION_99997_TEST_ONLY,
253            Self::EDITION_99998_TEST_ONLY,
254            Self::EDITION_99999_TEST_ONLY,
255            Self::EDITION_MAX,
256        ]
257    }
258}
259/// Describes the 'visibility' of a symbol with respect to the proto import
260/// system. Symbols can only be imported when the visibility rules do not prevent
261/// it (ex: local symbols cannot be imported).  Visibility modifiers can only set
262/// on `message` and `enum` as they are the only types available to be referenced
263/// from other files.
264#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
265#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
266#[repr(i32)]
267pub enum SymbolVisibility {
268    VISIBILITY_UNSET = 0i32,
269    VISIBILITY_LOCAL = 1i32,
270    VISIBILITY_EXPORT = 2i32,
271}
272impl SymbolVisibility {
273    ///Idiomatic alias for [`Self::VISIBILITY_UNSET`]; `Debug` prints the variant name.
274    #[allow(non_upper_case_globals)]
275    pub const VisibilityUnset: Self = Self::VISIBILITY_UNSET;
276    ///Idiomatic alias for [`Self::VISIBILITY_LOCAL`]; `Debug` prints the variant name.
277    #[allow(non_upper_case_globals)]
278    pub const VisibilityLocal: Self = Self::VISIBILITY_LOCAL;
279    ///Idiomatic alias for [`Self::VISIBILITY_EXPORT`]; `Debug` prints the variant name.
280    #[allow(non_upper_case_globals)]
281    pub const VisibilityExport: Self = Self::VISIBILITY_EXPORT;
282}
283impl ::core::default::Default for SymbolVisibility {
284    fn default() -> Self {
285        Self::VISIBILITY_UNSET
286    }
287}
288#[cfg(feature = "json")]
289const _: () = {
290    impl ::serde::Serialize for SymbolVisibility {
291        fn serialize<S: ::serde::Serializer>(
292            &self,
293            s: S,
294        ) -> ::core::result::Result<S::Ok, S::Error> {
295            s.serialize_str(::buffa::Enumeration::proto_name(self))
296        }
297    }
298    impl<'de> ::serde::Deserialize<'de> for SymbolVisibility {
299        fn deserialize<D: ::serde::Deserializer<'de>>(
300            d: D,
301        ) -> ::core::result::Result<Self, D::Error> {
302            struct _V;
303            impl ::serde::de::Visitor<'_> for _V {
304                type Value = SymbolVisibility;
305                fn expecting(
306                    &self,
307                    f: &mut ::core::fmt::Formatter<'_>,
308                ) -> ::core::fmt::Result {
309                    f.write_str(
310                        concat!(
311                            "a string, integer, or null for ",
312                            stringify!(SymbolVisibility)
313                        ),
314                    )
315                }
316                fn visit_str<E: ::serde::de::Error>(
317                    self,
318                    v: &str,
319                ) -> ::core::result::Result<SymbolVisibility, E> {
320                    <SymbolVisibility as ::buffa::Enumeration>::from_proto_name(v)
321                        .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
322                }
323                fn visit_i64<E: ::serde::de::Error>(
324                    self,
325                    v: i64,
326                ) -> ::core::result::Result<SymbolVisibility, E> {
327                    let v32 = i32::try_from(v)
328                        .map_err(|_| {
329                            ::serde::de::Error::custom(
330                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
331                            )
332                        })?;
333                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
334                        .ok_or_else(|| {
335                            ::serde::de::Error::custom(
336                                ::buffa::alloc::format!("unknown enum value {v32}"),
337                            )
338                        })
339                }
340                fn visit_u64<E: ::serde::de::Error>(
341                    self,
342                    v: u64,
343                ) -> ::core::result::Result<SymbolVisibility, E> {
344                    let v32 = i32::try_from(v)
345                        .map_err(|_| {
346                            ::serde::de::Error::custom(
347                                ::buffa::alloc::format!("enum value {v} out of i32 range"),
348                            )
349                        })?;
350                    <SymbolVisibility as ::buffa::Enumeration>::from_i32(v32)
351                        .ok_or_else(|| {
352                            ::serde::de::Error::custom(
353                                ::buffa::alloc::format!("unknown enum value {v32}"),
354                            )
355                        })
356                }
357                fn visit_unit<E: ::serde::de::Error>(
358                    self,
359                ) -> ::core::result::Result<SymbolVisibility, E> {
360                    ::core::result::Result::Ok(::core::default::Default::default())
361                }
362            }
363            d.deserialize_any(_V)
364        }
365    }
366    impl ::buffa::json_helpers::ProtoElemJson for SymbolVisibility {
367        fn serialize_proto_json<S: ::serde::Serializer>(
368            v: &Self,
369            s: S,
370        ) -> ::core::result::Result<S::Ok, S::Error> {
371            ::serde::Serialize::serialize(v, s)
372        }
373        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
374            d: D,
375        ) -> ::core::result::Result<Self, D::Error> {
376            <Self as ::serde::Deserialize>::deserialize(d)
377        }
378    }
379};
380impl ::buffa::Enumeration for SymbolVisibility {
381    fn from_i32(value: i32) -> ::core::option::Option<Self> {
382        match value {
383            0i32 => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
384            1i32 => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
385            2i32 => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
386            _ => ::core::option::Option::None,
387        }
388    }
389    fn to_i32(&self) -> i32 {
390        *self as i32
391    }
392    fn proto_name(&self) -> &'static str {
393        match self {
394            Self::VISIBILITY_UNSET => "VISIBILITY_UNSET",
395            Self::VISIBILITY_LOCAL => "VISIBILITY_LOCAL",
396            Self::VISIBILITY_EXPORT => "VISIBILITY_EXPORT",
397        }
398    }
399    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
400        match name {
401            "VISIBILITY_UNSET" => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
402            "VISIBILITY_LOCAL" => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
403            "VISIBILITY_EXPORT" => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
404            _ => ::core::option::Option::None,
405        }
406    }
407    fn values() -> &'static [Self] {
408        &[Self::VISIBILITY_UNSET, Self::VISIBILITY_LOCAL, Self::VISIBILITY_EXPORT]
409    }
410}
411/// The protocol compiler can output a FileDescriptorSet containing the .proto
412/// files it parses.
413#[derive(Clone, PartialEq, Default)]
414#[cfg_attr(feature = "json", derive(::serde::Serialize))]
415#[cfg_attr(feature = "json", serde(default))]
416#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
417pub struct FileDescriptorSet {
418    /// Field 1: `file`
419    #[cfg_attr(
420        feature = "json",
421        serde(
422            rename = "file",
423            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
424            deserialize_with = "::buffa::json_helpers::null_as_default"
425        )
426    )]
427    pub file: ::buffa::alloc::vec::Vec<FileDescriptorProto>,
428    #[cfg_attr(feature = "json", serde(flatten))]
429    #[doc(hidden)]
430    pub __buffa_unknown_fields: __FileDescriptorSetExtJson,
431}
432impl ::core::fmt::Debug for FileDescriptorSet {
433    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
434        f.debug_struct("FileDescriptorSet").field("file", &self.file).finish()
435    }
436}
437impl FileDescriptorSet {
438    /// Protobuf type URL for this message, for use with `Any::pack` and
439    /// `Any::unpack_if`.
440    ///
441    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
442    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
443}
444::buffa::impl_default_instance!(FileDescriptorSet);
445impl ::buffa::MessageName for FileDescriptorSet {
446    const PACKAGE: &'static str = "google.protobuf";
447    const NAME: &'static str = "FileDescriptorSet";
448    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorSet";
449    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
450}
451impl ::buffa::Message for FileDescriptorSet {
452    /// Returns the total encoded size in bytes.
453    ///
454    /// Accumulates in `u64` (which cannot overflow for in-memory
455    /// data) and saturates to `u32` at return, so a message whose
456    /// encoded size exceeds the 2 GiB protobuf limit yields a value
457    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
458    /// points reject, never a silently wrapped size.
459    #[allow(clippy::let_and_return)]
460    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
461        #[allow(unused_imports)]
462        use ::buffa::Enumeration as _;
463        let mut size = 0u64;
464        for v in &self.file {
465            let __slot = __cache.reserve();
466            let inner_size = v.compute_size(__cache);
467            __cache.set(__slot, inner_size);
468            size
469                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
470                    + inner_size as u64;
471        }
472        size += self.__buffa_unknown_fields.encoded_len() as u64;
473        ::buffa::saturate_size(size)
474    }
475    fn write_to(
476        &self,
477        __cache: &mut ::buffa::SizeCache,
478        buf: &mut impl ::buffa::EncodeSink,
479    ) {
480        #[allow(unused_imports)]
481        use ::buffa::Enumeration as _;
482        for v in &self.file {
483            ::buffa::types::put_len_delimited_header(
484                1u32,
485                u64::from(__cache.consume_next()),
486                buf,
487            );
488            v.write_to(__cache, buf);
489        }
490        self.__buffa_unknown_fields.write_to(buf);
491    }
492    fn merge_field(
493        &mut self,
494        tag: ::buffa::encoding::Tag,
495        buf: &mut impl ::buffa::bytes::Buf,
496        ctx: ::buffa::DecodeContext<'_>,
497    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
498        #[allow(unused_imports)]
499        use ::buffa::bytes::Buf as _;
500        #[allow(unused_imports)]
501        use ::buffa::Enumeration as _;
502        match tag.field_number() {
503            1u32 => {
504                ::buffa::encoding::check_wire_type(
505                    tag,
506                    ::buffa::encoding::WireType::LengthDelimited,
507                )?;
508                let mut elem = ::core::default::Default::default();
509                ctx.register_element_memory(
510                    ::buffa::__private::element_footprint(&elem),
511                )?;
512                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
513                self.file.push(elem);
514            }
515            _ => {
516                self.__buffa_unknown_fields
517                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
518            }
519        }
520        ::core::result::Result::Ok(())
521    }
522    fn clear(&mut self) {
523        self.file.clear();
524        self.__buffa_unknown_fields.clear();
525    }
526}
527impl ::buffa::ExtensionSet for FileDescriptorSet {
528    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorSet";
529    fn unknown_fields(&self) -> &::buffa::UnknownFields {
530        &self.__buffa_unknown_fields
531    }
532    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
533        &mut self.__buffa_unknown_fields
534    }
535}
536#[cfg(feature = "text")]
537impl ::buffa::text::TextFormat for FileDescriptorSet {
538    fn encode_text(
539        &self,
540        enc: &mut ::buffa::text::TextEncoder<'_>,
541    ) -> ::core::fmt::Result {
542        #[allow(unused_imports)]
543        use ::buffa::Enumeration as _;
544        for __v in &self.file {
545            enc.write_field_name("file")?;
546            enc.write_message(__v)?;
547        }
548        enc.write_extension_fields(
549            "google.protobuf.FileDescriptorSet",
550            &self.__buffa_unknown_fields,
551        )?;
552        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
553        ::core::result::Result::Ok(())
554    }
555    fn merge_text(
556        &mut self,
557        dec: &mut ::buffa::text::TextDecoder<'_>,
558    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
559        #[allow(unused_imports)]
560        use ::buffa::Enumeration as _;
561        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
562            match __name {
563                "file" => {
564                    dec.read_repeated_into(
565                        &mut self.file,
566                        |__d| {
567                            let mut __m = ::core::default::Default::default();
568                            __d.merge_message(&mut __m)?;
569                            ::core::result::Result::Ok(__m)
570                        },
571                    )?
572                }
573                __name if __name.starts_with('[') => {
574                    for __r in dec
575                        .read_extension(__name, "google.protobuf.FileDescriptorSet")?
576                    {
577                        self.__buffa_unknown_fields.push(__r);
578                    }
579                }
580                _ => dec.skip_value()?,
581            }
582        }
583        ::core::result::Result::Ok(())
584    }
585}
586#[cfg(feature = "json")]
587impl<'de> serde::Deserialize<'de> for FileDescriptorSet {
588    fn deserialize<D: serde::Deserializer<'de>>(
589        d: D,
590    ) -> ::core::result::Result<Self, D::Error> {
591        struct _V;
592        impl<'de> serde::de::Visitor<'de> for _V {
593            type Value = FileDescriptorSet;
594            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
595                f.write_str("struct FileDescriptorSet")
596            }
597            #[allow(clippy::field_reassign_with_default)]
598            fn visit_map<A: serde::de::MapAccess<'de>>(
599                self,
600                mut map: A,
601            ) -> ::core::result::Result<FileDescriptorSet, A::Error> {
602                let mut __f_file: ::core::option::Option<
603                    ::buffa::alloc::vec::Vec<FileDescriptorProto>,
604                > = None;
605                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
606                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
607                    match key.as_str() {
608                        "file" => {
609                            __f_file = Some({
610                                struct _S;
611                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
612                                    type Value = ::buffa::alloc::vec::Vec<FileDescriptorProto>;
613                                    fn deserialize<D: serde::Deserializer<'de>>(
614                                        self,
615                                        d: D,
616                                    ) -> ::core::result::Result<
617                                        ::buffa::alloc::vec::Vec<FileDescriptorProto>,
618                                        D::Error,
619                                    > {
620                                        ::buffa::json_helpers::null_as_default(d)
621                                    }
622                                }
623                                map.next_value_seed(_S)?
624                            });
625                        }
626                        __k if __k.starts_with('[') => {
627                            let __v: ::buffa::serde_json::Value = map.next_value()?;
628                            match ::buffa::extension_registry::deserialize_extension_key(
629                                "google.protobuf.FileDescriptorSet",
630                                __k,
631                                __v,
632                            ) {
633                                ::core::option::Option::Some(
634                                    ::core::result::Result::Ok(__recs),
635                                ) => {
636                                    for __rec in __recs {
637                                        __ext_records.push(__rec);
638                                    }
639                                }
640                                ::core::option::Option::Some(
641                                    ::core::result::Result::Err(__e),
642                                ) => {
643                                    return ::core::result::Result::Err(
644                                        <A::Error as ::serde::de::Error>::custom(__e),
645                                    );
646                                }
647                                ::core::option::Option::None => {}
648                            }
649                        }
650                        _ => {
651                            map.next_value::<serde::de::IgnoredAny>()?;
652                        }
653                    }
654                }
655                let mut __r = <FileDescriptorSet as ::core::default::Default>::default();
656                if let ::core::option::Option::Some(v) = __f_file {
657                    __r.file = v;
658                }
659                for __rec in __ext_records {
660                    __r.__buffa_unknown_fields.push(__rec);
661                }
662                Ok(__r)
663            }
664        }
665        d.deserialize_map(_V)
666    }
667}
668#[cfg(feature = "json")]
669impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorSet {
670    fn serialize_proto_json<S: ::serde::Serializer>(
671        v: &Self,
672        s: S,
673    ) -> ::core::result::Result<S::Ok, S::Error> {
674        ::serde::Serialize::serialize(v, s)
675    }
676    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
677        d: D,
678    ) -> ::core::result::Result<Self, D::Error> {
679        <Self as ::serde::Deserialize>::deserialize(d)
680    }
681}
682#[doc(hidden)]
683#[derive(Clone, Debug, Default, PartialEq)]
684#[repr(transparent)]
685#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
686pub struct __FileDescriptorSetExtJson(pub ::buffa::UnknownFields);
687impl ::core::ops::Deref for __FileDescriptorSetExtJson {
688    type Target = ::buffa::UnknownFields;
689    fn deref(&self) -> &::buffa::UnknownFields {
690        &self.0
691    }
692}
693impl ::core::ops::DerefMut for __FileDescriptorSetExtJson {
694    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
695        &mut self.0
696    }
697}
698impl ::core::convert::From<::buffa::UnknownFields> for __FileDescriptorSetExtJson {
699    fn from(u: ::buffa::UnknownFields) -> Self {
700        Self(u)
701    }
702}
703#[cfg(feature = "json")]
704impl ::serde::Serialize for __FileDescriptorSetExtJson {
705    fn serialize<S: ::serde::Serializer>(
706        &self,
707        s: S,
708    ) -> ::core::result::Result<S::Ok, S::Error> {
709        ::buffa::extension_registry::serialize_extensions(
710            "google.protobuf.FileDescriptorSet",
711            &self.0,
712            s,
713        )
714    }
715}
716#[cfg(feature = "json")]
717impl<'de> ::serde::Deserialize<'de> for __FileDescriptorSetExtJson {
718    fn deserialize<D: ::serde::Deserializer<'de>>(
719        d: D,
720    ) -> ::core::result::Result<Self, D::Error> {
721        ::buffa::extension_registry::deserialize_extensions(
722                "google.protobuf.FileDescriptorSet",
723                d,
724            )
725            .map(Self)
726    }
727}
728#[cfg(feature = "json")]
729#[doc(hidden)]
730pub const __FILE_DESCRIPTOR_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
731    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
732    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorSet>,
733    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorSet>,
734    is_wkt: false,
735};
736#[cfg(feature = "text")]
737#[doc(hidden)]
738pub const __FILE_DESCRIPTOR_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
739    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
740    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorSet>,
741    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorSet>,
742};
743/// Describes a complete .proto file.
744#[derive(Clone, PartialEq, Default)]
745#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
746#[cfg_attr(feature = "json", serde(default))]
747#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
748pub struct FileDescriptorProto {
749    /// file name, relative to root of source tree
750    ///
751    /// Field 1: `name`
752    #[cfg_attr(
753        feature = "json",
754        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
755    )]
756    pub name: ::core::option::Option<::buffa::alloc::string::String>,
757    /// e.g. "foo", "foo.bar", etc.
758    ///
759    /// Field 2: `package`
760    #[cfg_attr(
761        feature = "json",
762        serde(
763            rename = "package",
764            skip_serializing_if = "::core::option::Option::is_none"
765        )
766    )]
767    pub package: ::core::option::Option<::buffa::alloc::string::String>,
768    /// Names of files imported by this file.
769    ///
770    /// Field 3: `dependency`
771    #[cfg_attr(
772        feature = "json",
773        serde(
774            rename = "dependency",
775            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
776            deserialize_with = "::buffa::json_helpers::null_as_default"
777        )
778    )]
779    pub dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
780    /// Indexes of the public imported files in the dependency list above.
781    ///
782    /// Field 10: `public_dependency`
783    #[cfg_attr(
784        feature = "json",
785        serde(
786            rename = "publicDependency",
787            alias = "public_dependency",
788            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
789            deserialize_with = "::buffa::json_helpers::null_as_default"
790        )
791    )]
792    pub public_dependency: ::buffa::alloc::vec::Vec<i32>,
793    /// Indexes of the weak imported files in the dependency list.
794    /// For Google-internal migration only. Do not use.
795    ///
796    /// Field 11: `weak_dependency`
797    #[cfg_attr(
798        feature = "json",
799        serde(
800            rename = "weakDependency",
801            alias = "weak_dependency",
802            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
803            deserialize_with = "::buffa::json_helpers::null_as_default"
804        )
805    )]
806    pub weak_dependency: ::buffa::alloc::vec::Vec<i32>,
807    /// Names of files imported by this file purely for the purpose of providing
808    /// option extensions. These are excluded from the dependency list above.
809    ///
810    /// Field 15: `option_dependency`
811    #[cfg_attr(
812        feature = "json",
813        serde(
814            rename = "optionDependency",
815            alias = "option_dependency",
816            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
817            deserialize_with = "::buffa::json_helpers::null_as_default"
818        )
819    )]
820    pub option_dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
821    /// All top-level definitions in this file.
822    ///
823    /// Field 4: `message_type`
824    #[cfg_attr(
825        feature = "json",
826        serde(
827            rename = "messageType",
828            alias = "message_type",
829            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
830            deserialize_with = "::buffa::json_helpers::null_as_default"
831        )
832    )]
833    pub message_type: ::buffa::alloc::vec::Vec<DescriptorProto>,
834    /// Field 5: `enum_type`
835    #[cfg_attr(
836        feature = "json",
837        serde(
838            rename = "enumType",
839            alias = "enum_type",
840            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
841            deserialize_with = "::buffa::json_helpers::null_as_default"
842        )
843    )]
844    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
845    /// Field 6: `service`
846    #[cfg_attr(
847        feature = "json",
848        serde(
849            rename = "service",
850            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
851            deserialize_with = "::buffa::json_helpers::null_as_default"
852        )
853    )]
854    pub service: ::buffa::alloc::vec::Vec<ServiceDescriptorProto>,
855    /// Field 7: `extension`
856    #[cfg_attr(
857        feature = "json",
858        serde(
859            rename = "extension",
860            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
861            deserialize_with = "::buffa::json_helpers::null_as_default"
862        )
863    )]
864    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
865    /// Field 8: `options`
866    #[cfg_attr(
867        feature = "json",
868        serde(
869            rename = "options",
870            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
871        )
872    )]
873    pub options: ::buffa::MessageField<FileOptions, ::buffa::Inline<FileOptions>>,
874    /// This field contains optional information about the original source code.
875    /// You may safely remove this entire field without harming runtime
876    /// functionality of the descriptors -- the information is needed only by
877    /// development tools.
878    ///
879    /// Field 9: `source_code_info`
880    #[cfg_attr(
881        feature = "json",
882        serde(
883            rename = "sourceCodeInfo",
884            alias = "source_code_info",
885            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
886        )
887    )]
888    pub source_code_info: ::buffa::MessageField<
889        SourceCodeInfo,
890        ::buffa::Inline<SourceCodeInfo>,
891    >,
892    /// The syntax of the proto file.
893    /// The supported values are "proto2", "proto3", and "editions".
894    ///
895    /// If `edition` is present, this value must be "editions".
896    /// WARNING: This field should only be used by protobuf plugins or special
897    /// cases like the proto compiler. Other uses are discouraged and
898    /// developers should rely on the protoreflect APIs for their client language.
899    ///
900    /// Field 12: `syntax`
901    #[cfg_attr(
902        feature = "json",
903        serde(rename = "syntax", skip_serializing_if = "::core::option::Option::is_none")
904    )]
905    pub syntax: ::core::option::Option<::buffa::alloc::string::String>,
906    /// The edition of the proto file.
907    /// WARNING: This field should only be used by protobuf plugins or special
908    /// cases like the proto compiler. Other uses are discouraged and
909    /// developers should rely on the protoreflect APIs for their client language.
910    ///
911    /// Field 14: `edition`
912    #[cfg_attr(
913        feature = "json",
914        serde(
915            rename = "edition",
916            with = "::buffa::json_helpers::opt_closed_enum",
917            skip_serializing_if = "::core::option::Option::is_none"
918        )
919    )]
920    pub edition: ::core::option::Option<Edition>,
921    #[cfg_attr(feature = "json", serde(skip))]
922    #[doc(hidden)]
923    pub __buffa_unknown_fields: ::buffa::UnknownFields,
924}
925impl ::core::fmt::Debug for FileDescriptorProto {
926    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
927        f.debug_struct("FileDescriptorProto")
928            .field("name", &self.name)
929            .field("package", &self.package)
930            .field("dependency", &self.dependency)
931            .field("public_dependency", &self.public_dependency)
932            .field("weak_dependency", &self.weak_dependency)
933            .field("option_dependency", &self.option_dependency)
934            .field("message_type", &self.message_type)
935            .field("enum_type", &self.enum_type)
936            .field("service", &self.service)
937            .field("extension", &self.extension)
938            .field("options", &self.options)
939            .field("source_code_info", &self.source_code_info)
940            .field("syntax", &self.syntax)
941            .field("edition", &self.edition)
942            .finish()
943    }
944}
945impl FileDescriptorProto {
946    /// Protobuf type URL for this message, for use with `Any::pack` and
947    /// `Any::unpack_if`.
948    ///
949    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
950    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
951}
952impl FileDescriptorProto {
953    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
954    #[inline]
955    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
956    pub fn with_name(
957        mut self,
958        value: impl Into<::buffa::alloc::string::String>,
959    ) -> Self {
960        self.name = Some(value.into());
961        self
962    }
963    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
964    #[inline]
965    ///Sets [`Self::package`] to `Some(value)`, consuming and returning `self`.
966    pub fn with_package(
967        mut self,
968        value: impl Into<::buffa::alloc::string::String>,
969    ) -> Self {
970        self.package = Some(value.into());
971        self
972    }
973    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
974    #[inline]
975    ///Sets [`Self::syntax`] to `Some(value)`, consuming and returning `self`.
976    pub fn with_syntax(
977        mut self,
978        value: impl Into<::buffa::alloc::string::String>,
979    ) -> Self {
980        self.syntax = Some(value.into());
981        self
982    }
983    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
984    #[inline]
985    ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
986    pub fn with_edition(mut self, value: impl Into<Edition>) -> Self {
987        self.edition = Some(value.into());
988        self
989    }
990}
991::buffa::impl_default_instance!(FileDescriptorProto);
992impl ::buffa::MessageName for FileDescriptorProto {
993    const PACKAGE: &'static str = "google.protobuf";
994    const NAME: &'static str = "FileDescriptorProto";
995    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorProto";
996    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
997}
998impl ::buffa::Message for FileDescriptorProto {
999    /// Returns the total encoded size in bytes.
1000    ///
1001    /// Accumulates in `u64` (which cannot overflow for in-memory
1002    /// data) and saturates to `u32` at return, so a message whose
1003    /// encoded size exceeds the 2 GiB protobuf limit yields a value
1004    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
1005    /// points reject, never a silently wrapped size.
1006    #[allow(clippy::let_and_return)]
1007    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1008        #[allow(unused_imports)]
1009        use ::buffa::Enumeration as _;
1010        let mut size = 0u64;
1011        if let Some(ref v) = self.name {
1012            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1013        }
1014        if let Some(ref v) = self.package {
1015            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1016        }
1017        for v in &self.dependency {
1018            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1019        }
1020        for v in &self.message_type {
1021            let __slot = __cache.reserve();
1022            let inner_size = v.compute_size(__cache);
1023            __cache.set(__slot, inner_size);
1024            size
1025                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1026                    + inner_size as u64;
1027        }
1028        for v in &self.enum_type {
1029            let __slot = __cache.reserve();
1030            let inner_size = v.compute_size(__cache);
1031            __cache.set(__slot, inner_size);
1032            size
1033                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1034                    + inner_size as u64;
1035        }
1036        for v in &self.service {
1037            let __slot = __cache.reserve();
1038            let inner_size = v.compute_size(__cache);
1039            __cache.set(__slot, inner_size);
1040            size
1041                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1042                    + inner_size as u64;
1043        }
1044        for v in &self.extension {
1045            let __slot = __cache.reserve();
1046            let inner_size = v.compute_size(__cache);
1047            __cache.set(__slot, inner_size);
1048            size
1049                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1050                    + inner_size as u64;
1051        }
1052        if self.options.is_set() {
1053            let __slot = __cache.reserve();
1054            let inner_size = self.options.compute_size(__cache);
1055            __cache.set(__slot, inner_size);
1056            size
1057                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1058                    + inner_size as u64;
1059        }
1060        if self.source_code_info.is_set() {
1061            let __slot = __cache.reserve();
1062            let inner_size = self.source_code_info.compute_size(__cache);
1063            __cache.set(__slot, inner_size);
1064            size
1065                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1066                    + inner_size as u64;
1067        }
1068        for v in &self.public_dependency {
1069            size += 1u64 + ::buffa::types::int32_encoded_len(*v) as u64;
1070        }
1071        for v in &self.weak_dependency {
1072            size += 1u64 + ::buffa::types::int32_encoded_len(*v) as u64;
1073        }
1074        if let Some(ref v) = self.syntax {
1075            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1076        }
1077        if let Some(ref v) = self.edition {
1078            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
1079        }
1080        for v in &self.option_dependency {
1081            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1082        }
1083        size += self.__buffa_unknown_fields.encoded_len() as u64;
1084        ::buffa::saturate_size(size)
1085    }
1086    fn write_to(
1087        &self,
1088        __cache: &mut ::buffa::SizeCache,
1089        buf: &mut impl ::buffa::EncodeSink,
1090    ) {
1091        #[allow(unused_imports)]
1092        use ::buffa::Enumeration as _;
1093        if let Some(ref v) = self.name {
1094            ::buffa::types::put_string_field(1u32, v, buf);
1095        }
1096        if let Some(ref v) = self.package {
1097            ::buffa::types::put_string_field(2u32, v, buf);
1098        }
1099        for v in &self.dependency {
1100            ::buffa::types::put_string_field(3u32, v, buf);
1101        }
1102        for v in &self.message_type {
1103            ::buffa::types::put_len_delimited_header(
1104                4u32,
1105                u64::from(__cache.consume_next()),
1106                buf,
1107            );
1108            v.write_to(__cache, buf);
1109        }
1110        for v in &self.enum_type {
1111            ::buffa::types::put_len_delimited_header(
1112                5u32,
1113                u64::from(__cache.consume_next()),
1114                buf,
1115            );
1116            v.write_to(__cache, buf);
1117        }
1118        for v in &self.service {
1119            ::buffa::types::put_len_delimited_header(
1120                6u32,
1121                u64::from(__cache.consume_next()),
1122                buf,
1123            );
1124            v.write_to(__cache, buf);
1125        }
1126        for v in &self.extension {
1127            ::buffa::types::put_len_delimited_header(
1128                7u32,
1129                u64::from(__cache.consume_next()),
1130                buf,
1131            );
1132            v.write_to(__cache, buf);
1133        }
1134        if self.options.is_set() {
1135            ::buffa::types::put_len_delimited_header(
1136                8u32,
1137                u64::from(__cache.consume_next()),
1138                buf,
1139            );
1140            self.options.write_to(__cache, buf);
1141        }
1142        if self.source_code_info.is_set() {
1143            ::buffa::types::put_len_delimited_header(
1144                9u32,
1145                u64::from(__cache.consume_next()),
1146                buf,
1147            );
1148            self.source_code_info.write_to(__cache, buf);
1149        }
1150        for v in &self.public_dependency {
1151            ::buffa::types::put_int32_field(10u32, *v, buf);
1152        }
1153        for v in &self.weak_dependency {
1154            ::buffa::types::put_int32_field(11u32, *v, buf);
1155        }
1156        if let Some(ref v) = self.syntax {
1157            ::buffa::types::put_string_field(12u32, v, buf);
1158        }
1159        if let Some(ref v) = self.edition {
1160            ::buffa::types::put_int32_field(14u32, v.to_i32(), buf);
1161        }
1162        for v in &self.option_dependency {
1163            ::buffa::types::put_string_field(15u32, v, buf);
1164        }
1165        self.__buffa_unknown_fields.write_to(buf);
1166    }
1167    fn merge_field(
1168        &mut self,
1169        tag: ::buffa::encoding::Tag,
1170        buf: &mut impl ::buffa::bytes::Buf,
1171        ctx: ::buffa::DecodeContext<'_>,
1172    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1173        #[allow(unused_imports)]
1174        use ::buffa::bytes::Buf as _;
1175        #[allow(unused_imports)]
1176        use ::buffa::Enumeration as _;
1177        match tag.field_number() {
1178            1u32 => {
1179                ::buffa::encoding::check_wire_type(
1180                    tag,
1181                    ::buffa::encoding::WireType::LengthDelimited,
1182                )?;
1183                ::buffa::types::merge_string(
1184                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1185                    buf,
1186                )?;
1187            }
1188            2u32 => {
1189                ::buffa::encoding::check_wire_type(
1190                    tag,
1191                    ::buffa::encoding::WireType::LengthDelimited,
1192                )?;
1193                ::buffa::types::merge_string(
1194                    self.package.get_or_insert_with(::buffa::alloc::string::String::new),
1195                    buf,
1196                )?;
1197            }
1198            3u32 => {
1199                ::buffa::encoding::check_wire_type(
1200                    tag,
1201                    ::buffa::encoding::WireType::LengthDelimited,
1202                )?;
1203                let __elem = ::buffa::types::decode_string(buf)?;
1204                ctx.register_element_memory(
1205                    ::buffa::__private::element_footprint(&__elem),
1206                )?;
1207                self.dependency.push(__elem);
1208            }
1209            4u32 => {
1210                ::buffa::encoding::check_wire_type(
1211                    tag,
1212                    ::buffa::encoding::WireType::LengthDelimited,
1213                )?;
1214                let mut elem = ::core::default::Default::default();
1215                ctx.register_element_memory(
1216                    ::buffa::__private::element_footprint(&elem),
1217                )?;
1218                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1219                self.message_type.push(elem);
1220            }
1221            5u32 => {
1222                ::buffa::encoding::check_wire_type(
1223                    tag,
1224                    ::buffa::encoding::WireType::LengthDelimited,
1225                )?;
1226                let mut elem = ::core::default::Default::default();
1227                ctx.register_element_memory(
1228                    ::buffa::__private::element_footprint(&elem),
1229                )?;
1230                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1231                self.enum_type.push(elem);
1232            }
1233            6u32 => {
1234                ::buffa::encoding::check_wire_type(
1235                    tag,
1236                    ::buffa::encoding::WireType::LengthDelimited,
1237                )?;
1238                let mut elem = ::core::default::Default::default();
1239                ctx.register_element_memory(
1240                    ::buffa::__private::element_footprint(&elem),
1241                )?;
1242                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1243                self.service.push(elem);
1244            }
1245            7u32 => {
1246                ::buffa::encoding::check_wire_type(
1247                    tag,
1248                    ::buffa::encoding::WireType::LengthDelimited,
1249                )?;
1250                let mut elem = ::core::default::Default::default();
1251                ctx.register_element_memory(
1252                    ::buffa::__private::element_footprint(&elem),
1253                )?;
1254                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1255                self.extension.push(elem);
1256            }
1257            8u32 => {
1258                ::buffa::encoding::check_wire_type(
1259                    tag,
1260                    ::buffa::encoding::WireType::LengthDelimited,
1261                )?;
1262                ::buffa::Message::merge_length_delimited(
1263                    self.options.get_or_insert_default(),
1264                    buf,
1265                    ctx,
1266                )?;
1267            }
1268            9u32 => {
1269                ::buffa::encoding::check_wire_type(
1270                    tag,
1271                    ::buffa::encoding::WireType::LengthDelimited,
1272                )?;
1273                ::buffa::Message::merge_length_delimited(
1274                    self.source_code_info.get_or_insert_default(),
1275                    buf,
1276                    ctx,
1277                )?;
1278            }
1279            10u32 => {
1280                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1281                    let len = ::buffa::encoding::decode_varint(buf)?;
1282                    let len = usize::try_from(len)
1283                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1284                    if buf.remaining() < len {
1285                        return ::core::result::Result::Err(
1286                            ::buffa::DecodeError::UnexpectedEof,
1287                        );
1288                    }
1289                    if buf.chunk().len() >= len {
1290                        ::buffa::types::extend_packed_int32(
1291                            &buf.chunk()[..len],
1292                            &mut self.public_dependency,
1293                            len,
1294                        )?;
1295                        buf.advance(len);
1296                    } else {
1297                        self.public_dependency.reserve(len);
1298                        let mut limited = buf.take(len);
1299                        while limited.has_remaining() {
1300                            self.public_dependency
1301                                .push(::buffa::types::decode_int32_packed(&mut limited)?);
1302                        }
1303                        let leftover = limited.remaining();
1304                        if leftover > 0 {
1305                            limited.advance(leftover);
1306                        }
1307                    }
1308                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1309                    self.public_dependency.push(::buffa::types::decode_int32(buf)?);
1310                } else {
1311                    return ::core::result::Result::Err(
1312                        ::buffa::encoding::wire_type_mismatch(
1313                            tag,
1314                            ::buffa::encoding::WireType::LengthDelimited,
1315                        ),
1316                    );
1317                }
1318            }
1319            11u32 => {
1320                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1321                    let len = ::buffa::encoding::decode_varint(buf)?;
1322                    let len = usize::try_from(len)
1323                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1324                    if buf.remaining() < len {
1325                        return ::core::result::Result::Err(
1326                            ::buffa::DecodeError::UnexpectedEof,
1327                        );
1328                    }
1329                    if buf.chunk().len() >= len {
1330                        ::buffa::types::extend_packed_int32(
1331                            &buf.chunk()[..len],
1332                            &mut self.weak_dependency,
1333                            len,
1334                        )?;
1335                        buf.advance(len);
1336                    } else {
1337                        self.weak_dependency.reserve(len);
1338                        let mut limited = buf.take(len);
1339                        while limited.has_remaining() {
1340                            self.weak_dependency
1341                                .push(::buffa::types::decode_int32_packed(&mut limited)?);
1342                        }
1343                        let leftover = limited.remaining();
1344                        if leftover > 0 {
1345                            limited.advance(leftover);
1346                        }
1347                    }
1348                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1349                    self.weak_dependency.push(::buffa::types::decode_int32(buf)?);
1350                } else {
1351                    return ::core::result::Result::Err(
1352                        ::buffa::encoding::wire_type_mismatch(
1353                            tag,
1354                            ::buffa::encoding::WireType::LengthDelimited,
1355                        ),
1356                    );
1357                }
1358            }
1359            12u32 => {
1360                ::buffa::encoding::check_wire_type(
1361                    tag,
1362                    ::buffa::encoding::WireType::LengthDelimited,
1363                )?;
1364                ::buffa::types::merge_string(
1365                    self.syntax.get_or_insert_with(::buffa::alloc::string::String::new),
1366                    buf,
1367                )?;
1368            }
1369            14u32 => {
1370                ::buffa::encoding::check_wire_type(
1371                    tag,
1372                    ::buffa::encoding::WireType::Varint,
1373                )?;
1374                let __raw = ::buffa::types::decode_int32(buf)?;
1375                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
1376                    __raw,
1377                ) {
1378                    self.edition = ::core::option::Option::Some(__v);
1379                } else {
1380                    ctx.register_unknown_field()?;
1381                    self.__buffa_unknown_fields
1382                        .push(::buffa::UnknownField {
1383                            number: 14u32,
1384                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
1385                        });
1386                }
1387            }
1388            15u32 => {
1389                ::buffa::encoding::check_wire_type(
1390                    tag,
1391                    ::buffa::encoding::WireType::LengthDelimited,
1392                )?;
1393                let __elem = ::buffa::types::decode_string(buf)?;
1394                ctx.register_element_memory(
1395                    ::buffa::__private::element_footprint(&__elem),
1396                )?;
1397                self.option_dependency.push(__elem);
1398            }
1399            _ => {
1400                self.__buffa_unknown_fields
1401                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1402            }
1403        }
1404        ::core::result::Result::Ok(())
1405    }
1406    fn clear(&mut self) {
1407        self.name = ::core::option::Option::None;
1408        self.package = ::core::option::Option::None;
1409        self.dependency.clear();
1410        self.message_type.clear();
1411        self.enum_type.clear();
1412        self.service.clear();
1413        self.extension.clear();
1414        self.options = ::buffa::MessageField::none();
1415        self.source_code_info = ::buffa::MessageField::none();
1416        self.public_dependency.clear();
1417        self.weak_dependency.clear();
1418        self.syntax = ::core::option::Option::None;
1419        self.edition = ::core::option::Option::None;
1420        self.option_dependency.clear();
1421        self.__buffa_unknown_fields.clear();
1422    }
1423}
1424impl ::buffa::ExtensionSet for FileDescriptorProto {
1425    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto";
1426    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1427        &self.__buffa_unknown_fields
1428    }
1429    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1430        &mut self.__buffa_unknown_fields
1431    }
1432}
1433#[cfg(feature = "text")]
1434impl ::buffa::text::TextFormat for FileDescriptorProto {
1435    fn encode_text(
1436        &self,
1437        enc: &mut ::buffa::text::TextEncoder<'_>,
1438    ) -> ::core::fmt::Result {
1439        #[allow(unused_imports)]
1440        use ::buffa::Enumeration as _;
1441        if let ::core::option::Option::Some(ref __v) = self.name {
1442            enc.write_field_name("name")?;
1443            enc.write_string(__v)?;
1444        }
1445        if let ::core::option::Option::Some(ref __v) = self.package {
1446            enc.write_field_name("package")?;
1447            enc.write_string(__v)?;
1448        }
1449        if self.options.is_set() {
1450            enc.write_field_name("options")?;
1451            enc.write_message(&*self.options)?;
1452        }
1453        if self.source_code_info.is_set() {
1454            enc.write_field_name("source_code_info")?;
1455            enc.write_message(&*self.source_code_info)?;
1456        }
1457        if let ::core::option::Option::Some(ref __v) = self.syntax {
1458            enc.write_field_name("syntax")?;
1459            enc.write_string(__v)?;
1460        }
1461        if let ::core::option::Option::Some(ref __v) = self.edition {
1462            enc.write_field_name("edition")?;
1463            enc.write_enum_name(__v.proto_name())?;
1464        }
1465        for __v in &self.dependency {
1466            enc.write_field_name("dependency")?;
1467            enc.write_string(__v)?;
1468        }
1469        for __v in &self.public_dependency {
1470            enc.write_field_name("public_dependency")?;
1471            enc.write_i32(*__v)?;
1472        }
1473        for __v in &self.weak_dependency {
1474            enc.write_field_name("weak_dependency")?;
1475            enc.write_i32(*__v)?;
1476        }
1477        for __v in &self.option_dependency {
1478            enc.write_field_name("option_dependency")?;
1479            enc.write_string(__v)?;
1480        }
1481        for __v in &self.message_type {
1482            enc.write_field_name("message_type")?;
1483            enc.write_message(__v)?;
1484        }
1485        for __v in &self.enum_type {
1486            enc.write_field_name("enum_type")?;
1487            enc.write_message(__v)?;
1488        }
1489        for __v in &self.service {
1490            enc.write_field_name("service")?;
1491            enc.write_message(__v)?;
1492        }
1493        for __v in &self.extension {
1494            enc.write_field_name("extension")?;
1495            enc.write_message(__v)?;
1496        }
1497        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1498        ::core::result::Result::Ok(())
1499    }
1500    fn merge_text(
1501        &mut self,
1502        dec: &mut ::buffa::text::TextDecoder<'_>,
1503    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1504        #[allow(unused_imports)]
1505        use ::buffa::Enumeration as _;
1506        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1507            match __name {
1508                "name" => {
1509                    self.name = ::core::option::Option::Some(
1510                        dec.read_string()?.into_owned(),
1511                    );
1512                }
1513                "package" => {
1514                    self.package = ::core::option::Option::Some(
1515                        dec.read_string()?.into_owned(),
1516                    );
1517                }
1518                "options" => dec.merge_message(self.options.get_or_insert_default())?,
1519                "source_code_info" => {
1520                    dec.merge_message(self.source_code_info.get_or_insert_default())?
1521                }
1522                "syntax" => {
1523                    self.syntax = ::core::option::Option::Some(
1524                        dec.read_string()?.into_owned(),
1525                    );
1526                }
1527                "edition" => {
1528                    self.edition = ::core::option::Option::Some(
1529                        dec.read_closed_enum_by_name::<Edition>()?,
1530                    );
1531                }
1532                "dependency" => {
1533                    dec.read_repeated_into(
1534                        &mut self.dependency,
1535                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1536                    )?
1537                }
1538                "public_dependency" => {
1539                    dec.read_repeated_into(
1540                        &mut self.public_dependency,
1541                        |__d| __d.read_i32(),
1542                    )?
1543                }
1544                "weak_dependency" => {
1545                    dec.read_repeated_into(
1546                        &mut self.weak_dependency,
1547                        |__d| __d.read_i32(),
1548                    )?
1549                }
1550                "option_dependency" => {
1551                    dec.read_repeated_into(
1552                        &mut self.option_dependency,
1553                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1554                    )?
1555                }
1556                "message_type" => {
1557                    dec.read_repeated_into(
1558                        &mut self.message_type,
1559                        |__d| {
1560                            let mut __m = ::core::default::Default::default();
1561                            __d.merge_message(&mut __m)?;
1562                            ::core::result::Result::Ok(__m)
1563                        },
1564                    )?
1565                }
1566                "enum_type" => {
1567                    dec.read_repeated_into(
1568                        &mut self.enum_type,
1569                        |__d| {
1570                            let mut __m = ::core::default::Default::default();
1571                            __d.merge_message(&mut __m)?;
1572                            ::core::result::Result::Ok(__m)
1573                        },
1574                    )?
1575                }
1576                "service" => {
1577                    dec.read_repeated_into(
1578                        &mut self.service,
1579                        |__d| {
1580                            let mut __m = ::core::default::Default::default();
1581                            __d.merge_message(&mut __m)?;
1582                            ::core::result::Result::Ok(__m)
1583                        },
1584                    )?
1585                }
1586                "extension" => {
1587                    dec.read_repeated_into(
1588                        &mut self.extension,
1589                        |__d| {
1590                            let mut __m = ::core::default::Default::default();
1591                            __d.merge_message(&mut __m)?;
1592                            ::core::result::Result::Ok(__m)
1593                        },
1594                    )?
1595                }
1596                _ => dec.skip_value()?,
1597            }
1598        }
1599        ::core::result::Result::Ok(())
1600    }
1601}
1602#[cfg(feature = "json")]
1603impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorProto {
1604    fn serialize_proto_json<S: ::serde::Serializer>(
1605        v: &Self,
1606        s: S,
1607    ) -> ::core::result::Result<S::Ok, S::Error> {
1608        ::serde::Serialize::serialize(v, s)
1609    }
1610    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1611        d: D,
1612    ) -> ::core::result::Result<Self, D::Error> {
1613        <Self as ::serde::Deserialize>::deserialize(d)
1614    }
1615}
1616#[cfg(feature = "json")]
1617#[doc(hidden)]
1618pub const __FILE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1619    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1620    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorProto>,
1621    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorProto>,
1622    is_wkt: false,
1623};
1624#[cfg(feature = "text")]
1625#[doc(hidden)]
1626pub const __FILE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1627    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1628    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorProto>,
1629    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorProto>,
1630};
1631/// Describes a message type.
1632#[derive(Clone, PartialEq, Default)]
1633#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
1634#[cfg_attr(feature = "json", serde(default))]
1635#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1636pub struct DescriptorProto {
1637    /// Field 1: `name`
1638    #[cfg_attr(
1639        feature = "json",
1640        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
1641    )]
1642    pub name: ::core::option::Option<::buffa::alloc::string::String>,
1643    /// Field 2: `field`
1644    #[cfg_attr(
1645        feature = "json",
1646        serde(
1647            rename = "field",
1648            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1649            deserialize_with = "::buffa::json_helpers::null_as_default"
1650        )
1651    )]
1652    pub field: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1653    /// Field 6: `extension`
1654    #[cfg_attr(
1655        feature = "json",
1656        serde(
1657            rename = "extension",
1658            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1659            deserialize_with = "::buffa::json_helpers::null_as_default"
1660        )
1661    )]
1662    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1663    /// Field 3: `nested_type`
1664    #[cfg_attr(
1665        feature = "json",
1666        serde(
1667            rename = "nestedType",
1668            alias = "nested_type",
1669            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1670            deserialize_with = "::buffa::json_helpers::null_as_default"
1671        )
1672    )]
1673    pub nested_type: ::buffa::alloc::vec::Vec<Self>,
1674    /// Field 4: `enum_type`
1675    #[cfg_attr(
1676        feature = "json",
1677        serde(
1678            rename = "enumType",
1679            alias = "enum_type",
1680            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1681            deserialize_with = "::buffa::json_helpers::null_as_default"
1682        )
1683    )]
1684    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
1685    /// Field 5: `extension_range`
1686    #[cfg_attr(
1687        feature = "json",
1688        serde(
1689            rename = "extensionRange",
1690            alias = "extension_range",
1691            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1692            deserialize_with = "::buffa::json_helpers::null_as_default"
1693        )
1694    )]
1695    pub extension_range: ::buffa::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
1696    /// Field 8: `oneof_decl`
1697    #[cfg_attr(
1698        feature = "json",
1699        serde(
1700            rename = "oneofDecl",
1701            alias = "oneof_decl",
1702            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1703            deserialize_with = "::buffa::json_helpers::null_as_default"
1704        )
1705    )]
1706    pub oneof_decl: ::buffa::alloc::vec::Vec<OneofDescriptorProto>,
1707    /// Field 7: `options`
1708    #[cfg_attr(
1709        feature = "json",
1710        serde(
1711            rename = "options",
1712            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1713        )
1714    )]
1715    pub options: ::buffa::MessageField<MessageOptions, ::buffa::Inline<MessageOptions>>,
1716    /// Field 9: `reserved_range`
1717    #[cfg_attr(
1718        feature = "json",
1719        serde(
1720            rename = "reservedRange",
1721            alias = "reserved_range",
1722            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1723            deserialize_with = "::buffa::json_helpers::null_as_default"
1724        )
1725    )]
1726    pub reserved_range: ::buffa::alloc::vec::Vec<descriptor_proto::ReservedRange>,
1727    /// Reserved field names, which may not be used by fields in the same message.
1728    /// A given name may only be reserved once.
1729    ///
1730    /// Field 10: `reserved_name`
1731    #[cfg_attr(
1732        feature = "json",
1733        serde(
1734            rename = "reservedName",
1735            alias = "reserved_name",
1736            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1737            deserialize_with = "::buffa::json_helpers::null_as_default"
1738        )
1739    )]
1740    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1741    /// Support for `export` and `local` keywords on enums.
1742    ///
1743    /// Field 11: `visibility`
1744    #[cfg_attr(
1745        feature = "json",
1746        serde(
1747            rename = "visibility",
1748            with = "::buffa::json_helpers::opt_closed_enum",
1749            skip_serializing_if = "::core::option::Option::is_none"
1750        )
1751    )]
1752    pub visibility: ::core::option::Option<SymbolVisibility>,
1753    #[cfg_attr(feature = "json", serde(skip))]
1754    #[doc(hidden)]
1755    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1756}
1757impl ::core::fmt::Debug for DescriptorProto {
1758    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1759        f.debug_struct("DescriptorProto")
1760            .field("name", &self.name)
1761            .field("field", &self.field)
1762            .field("extension", &self.extension)
1763            .field("nested_type", &self.nested_type)
1764            .field("enum_type", &self.enum_type)
1765            .field("extension_range", &self.extension_range)
1766            .field("oneof_decl", &self.oneof_decl)
1767            .field("options", &self.options)
1768            .field("reserved_range", &self.reserved_range)
1769            .field("reserved_name", &self.reserved_name)
1770            .field("visibility", &self.visibility)
1771            .finish()
1772    }
1773}
1774impl DescriptorProto {
1775    /// Protobuf type URL for this message, for use with `Any::pack` and
1776    /// `Any::unpack_if`.
1777    ///
1778    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1779    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1780}
1781impl DescriptorProto {
1782    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1783    #[inline]
1784    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
1785    pub fn with_name(
1786        mut self,
1787        value: impl Into<::buffa::alloc::string::String>,
1788    ) -> Self {
1789        self.name = Some(value.into());
1790        self
1791    }
1792    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1793    #[inline]
1794    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
1795    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
1796        self.visibility = Some(value.into());
1797        self
1798    }
1799}
1800::buffa::impl_default_instance!(DescriptorProto);
1801impl ::buffa::MessageName for DescriptorProto {
1802    const PACKAGE: &'static str = "google.protobuf";
1803    const NAME: &'static str = "DescriptorProto";
1804    const FULL_NAME: &'static str = "google.protobuf.DescriptorProto";
1805    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1806}
1807impl ::buffa::Message for DescriptorProto {
1808    /// Returns the total encoded size in bytes.
1809    ///
1810    /// Accumulates in `u64` (which cannot overflow for in-memory
1811    /// data) and saturates to `u32` at return, so a message whose
1812    /// encoded size exceeds the 2 GiB protobuf limit yields a value
1813    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
1814    /// points reject, never a silently wrapped size.
1815    #[allow(clippy::let_and_return)]
1816    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1817        #[allow(unused_imports)]
1818        use ::buffa::Enumeration as _;
1819        let mut size = 0u64;
1820        if let Some(ref v) = self.name {
1821            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1822        }
1823        for v in &self.field {
1824            let __slot = __cache.reserve();
1825            let inner_size = v.compute_size(__cache);
1826            __cache.set(__slot, inner_size);
1827            size
1828                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1829                    + inner_size as u64;
1830        }
1831        for v in &self.nested_type {
1832            let __slot = __cache.reserve();
1833            let inner_size = v.compute_size(__cache);
1834            __cache.set(__slot, inner_size);
1835            size
1836                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1837                    + inner_size as u64;
1838        }
1839        for v in &self.enum_type {
1840            let __slot = __cache.reserve();
1841            let inner_size = v.compute_size(__cache);
1842            __cache.set(__slot, inner_size);
1843            size
1844                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1845                    + inner_size as u64;
1846        }
1847        for v in &self.extension_range {
1848            let __slot = __cache.reserve();
1849            let inner_size = v.compute_size(__cache);
1850            __cache.set(__slot, inner_size);
1851            size
1852                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1853                    + inner_size as u64;
1854        }
1855        for v in &self.extension {
1856            let __slot = __cache.reserve();
1857            let inner_size = v.compute_size(__cache);
1858            __cache.set(__slot, inner_size);
1859            size
1860                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1861                    + inner_size as u64;
1862        }
1863        if self.options.is_set() {
1864            let __slot = __cache.reserve();
1865            let inner_size = self.options.compute_size(__cache);
1866            __cache.set(__slot, inner_size);
1867            size
1868                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1869                    + inner_size as u64;
1870        }
1871        for v in &self.oneof_decl {
1872            let __slot = __cache.reserve();
1873            let inner_size = v.compute_size(__cache);
1874            __cache.set(__slot, inner_size);
1875            size
1876                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1877                    + inner_size as u64;
1878        }
1879        for v in &self.reserved_range {
1880            let __slot = __cache.reserve();
1881            let inner_size = v.compute_size(__cache);
1882            __cache.set(__slot, inner_size);
1883            size
1884                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
1885                    + inner_size as u64;
1886        }
1887        for v in &self.reserved_name {
1888            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
1889        }
1890        if let Some(ref v) = self.visibility {
1891            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
1892        }
1893        size += self.__buffa_unknown_fields.encoded_len() as u64;
1894        ::buffa::saturate_size(size)
1895    }
1896    fn write_to(
1897        &self,
1898        __cache: &mut ::buffa::SizeCache,
1899        buf: &mut impl ::buffa::EncodeSink,
1900    ) {
1901        #[allow(unused_imports)]
1902        use ::buffa::Enumeration as _;
1903        if let Some(ref v) = self.name {
1904            ::buffa::types::put_string_field(1u32, v, buf);
1905        }
1906        for v in &self.field {
1907            ::buffa::types::put_len_delimited_header(
1908                2u32,
1909                u64::from(__cache.consume_next()),
1910                buf,
1911            );
1912            v.write_to(__cache, buf);
1913        }
1914        for v in &self.nested_type {
1915            ::buffa::types::put_len_delimited_header(
1916                3u32,
1917                u64::from(__cache.consume_next()),
1918                buf,
1919            );
1920            v.write_to(__cache, buf);
1921        }
1922        for v in &self.enum_type {
1923            ::buffa::types::put_len_delimited_header(
1924                4u32,
1925                u64::from(__cache.consume_next()),
1926                buf,
1927            );
1928            v.write_to(__cache, buf);
1929        }
1930        for v in &self.extension_range {
1931            ::buffa::types::put_len_delimited_header(
1932                5u32,
1933                u64::from(__cache.consume_next()),
1934                buf,
1935            );
1936            v.write_to(__cache, buf);
1937        }
1938        for v in &self.extension {
1939            ::buffa::types::put_len_delimited_header(
1940                6u32,
1941                u64::from(__cache.consume_next()),
1942                buf,
1943            );
1944            v.write_to(__cache, buf);
1945        }
1946        if self.options.is_set() {
1947            ::buffa::types::put_len_delimited_header(
1948                7u32,
1949                u64::from(__cache.consume_next()),
1950                buf,
1951            );
1952            self.options.write_to(__cache, buf);
1953        }
1954        for v in &self.oneof_decl {
1955            ::buffa::types::put_len_delimited_header(
1956                8u32,
1957                u64::from(__cache.consume_next()),
1958                buf,
1959            );
1960            v.write_to(__cache, buf);
1961        }
1962        for v in &self.reserved_range {
1963            ::buffa::types::put_len_delimited_header(
1964                9u32,
1965                u64::from(__cache.consume_next()),
1966                buf,
1967            );
1968            v.write_to(__cache, buf);
1969        }
1970        for v in &self.reserved_name {
1971            ::buffa::types::put_string_field(10u32, v, buf);
1972        }
1973        if let Some(ref v) = self.visibility {
1974            ::buffa::types::put_int32_field(11u32, v.to_i32(), buf);
1975        }
1976        self.__buffa_unknown_fields.write_to(buf);
1977    }
1978    fn merge_field(
1979        &mut self,
1980        tag: ::buffa::encoding::Tag,
1981        buf: &mut impl ::buffa::bytes::Buf,
1982        ctx: ::buffa::DecodeContext<'_>,
1983    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1984        #[allow(unused_imports)]
1985        use ::buffa::bytes::Buf as _;
1986        #[allow(unused_imports)]
1987        use ::buffa::Enumeration as _;
1988        match tag.field_number() {
1989            1u32 => {
1990                ::buffa::encoding::check_wire_type(
1991                    tag,
1992                    ::buffa::encoding::WireType::LengthDelimited,
1993                )?;
1994                ::buffa::types::merge_string(
1995                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1996                    buf,
1997                )?;
1998            }
1999            2u32 => {
2000                ::buffa::encoding::check_wire_type(
2001                    tag,
2002                    ::buffa::encoding::WireType::LengthDelimited,
2003                )?;
2004                let mut elem = ::core::default::Default::default();
2005                ctx.register_element_memory(
2006                    ::buffa::__private::element_footprint(&elem),
2007                )?;
2008                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2009                self.field.push(elem);
2010            }
2011            3u32 => {
2012                ::buffa::encoding::check_wire_type(
2013                    tag,
2014                    ::buffa::encoding::WireType::LengthDelimited,
2015                )?;
2016                let mut elem = ::core::default::Default::default();
2017                ctx.register_element_memory(
2018                    ::buffa::__private::element_footprint(&elem),
2019                )?;
2020                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2021                self.nested_type.push(elem);
2022            }
2023            4u32 => {
2024                ::buffa::encoding::check_wire_type(
2025                    tag,
2026                    ::buffa::encoding::WireType::LengthDelimited,
2027                )?;
2028                let mut elem = ::core::default::Default::default();
2029                ctx.register_element_memory(
2030                    ::buffa::__private::element_footprint(&elem),
2031                )?;
2032                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2033                self.enum_type.push(elem);
2034            }
2035            5u32 => {
2036                ::buffa::encoding::check_wire_type(
2037                    tag,
2038                    ::buffa::encoding::WireType::LengthDelimited,
2039                )?;
2040                let mut elem = ::core::default::Default::default();
2041                ctx.register_element_memory(
2042                    ::buffa::__private::element_footprint(&elem),
2043                )?;
2044                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2045                self.extension_range.push(elem);
2046            }
2047            6u32 => {
2048                ::buffa::encoding::check_wire_type(
2049                    tag,
2050                    ::buffa::encoding::WireType::LengthDelimited,
2051                )?;
2052                let mut elem = ::core::default::Default::default();
2053                ctx.register_element_memory(
2054                    ::buffa::__private::element_footprint(&elem),
2055                )?;
2056                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2057                self.extension.push(elem);
2058            }
2059            7u32 => {
2060                ::buffa::encoding::check_wire_type(
2061                    tag,
2062                    ::buffa::encoding::WireType::LengthDelimited,
2063                )?;
2064                ::buffa::Message::merge_length_delimited(
2065                    self.options.get_or_insert_default(),
2066                    buf,
2067                    ctx,
2068                )?;
2069            }
2070            8u32 => {
2071                ::buffa::encoding::check_wire_type(
2072                    tag,
2073                    ::buffa::encoding::WireType::LengthDelimited,
2074                )?;
2075                let mut elem = ::core::default::Default::default();
2076                ctx.register_element_memory(
2077                    ::buffa::__private::element_footprint(&elem),
2078                )?;
2079                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2080                self.oneof_decl.push(elem);
2081            }
2082            9u32 => {
2083                ::buffa::encoding::check_wire_type(
2084                    tag,
2085                    ::buffa::encoding::WireType::LengthDelimited,
2086                )?;
2087                let mut elem = ::core::default::Default::default();
2088                ctx.register_element_memory(
2089                    ::buffa::__private::element_footprint(&elem),
2090                )?;
2091                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2092                self.reserved_range.push(elem);
2093            }
2094            10u32 => {
2095                ::buffa::encoding::check_wire_type(
2096                    tag,
2097                    ::buffa::encoding::WireType::LengthDelimited,
2098                )?;
2099                let __elem = ::buffa::types::decode_string(buf)?;
2100                ctx.register_element_memory(
2101                    ::buffa::__private::element_footprint(&__elem),
2102                )?;
2103                self.reserved_name.push(__elem);
2104            }
2105            11u32 => {
2106                ::buffa::encoding::check_wire_type(
2107                    tag,
2108                    ::buffa::encoding::WireType::Varint,
2109                )?;
2110                let __raw = ::buffa::types::decode_int32(buf)?;
2111                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
2112                    __raw,
2113                ) {
2114                    self.visibility = ::core::option::Option::Some(__v);
2115                } else {
2116                    ctx.register_unknown_field()?;
2117                    self.__buffa_unknown_fields
2118                        .push(::buffa::UnknownField {
2119                            number: 11u32,
2120                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
2121                        });
2122                }
2123            }
2124            _ => {
2125                self.__buffa_unknown_fields
2126                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2127            }
2128        }
2129        ::core::result::Result::Ok(())
2130    }
2131    fn clear(&mut self) {
2132        self.name = ::core::option::Option::None;
2133        self.field.clear();
2134        self.nested_type.clear();
2135        self.enum_type.clear();
2136        self.extension_range.clear();
2137        self.extension.clear();
2138        self.options = ::buffa::MessageField::none();
2139        self.oneof_decl.clear();
2140        self.reserved_range.clear();
2141        self.reserved_name.clear();
2142        self.visibility = ::core::option::Option::None;
2143        self.__buffa_unknown_fields.clear();
2144    }
2145}
2146impl ::buffa::ExtensionSet for DescriptorProto {
2147    const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto";
2148    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2149        &self.__buffa_unknown_fields
2150    }
2151    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2152        &mut self.__buffa_unknown_fields
2153    }
2154}
2155#[cfg(feature = "text")]
2156impl ::buffa::text::TextFormat for DescriptorProto {
2157    fn encode_text(
2158        &self,
2159        enc: &mut ::buffa::text::TextEncoder<'_>,
2160    ) -> ::core::fmt::Result {
2161        #[allow(unused_imports)]
2162        use ::buffa::Enumeration as _;
2163        if let ::core::option::Option::Some(ref __v) = self.name {
2164            enc.write_field_name("name")?;
2165            enc.write_string(__v)?;
2166        }
2167        if self.options.is_set() {
2168            enc.write_field_name("options")?;
2169            enc.write_message(&*self.options)?;
2170        }
2171        if let ::core::option::Option::Some(ref __v) = self.visibility {
2172            enc.write_field_name("visibility")?;
2173            enc.write_enum_name(__v.proto_name())?;
2174        }
2175        for __v in &self.field {
2176            enc.write_field_name("field")?;
2177            enc.write_message(__v)?;
2178        }
2179        for __v in &self.extension {
2180            enc.write_field_name("extension")?;
2181            enc.write_message(__v)?;
2182        }
2183        for __v in &self.nested_type {
2184            enc.write_field_name("nested_type")?;
2185            enc.write_message(__v)?;
2186        }
2187        for __v in &self.enum_type {
2188            enc.write_field_name("enum_type")?;
2189            enc.write_message(__v)?;
2190        }
2191        for __v in &self.extension_range {
2192            enc.write_field_name("extension_range")?;
2193            enc.write_message(__v)?;
2194        }
2195        for __v in &self.oneof_decl {
2196            enc.write_field_name("oneof_decl")?;
2197            enc.write_message(__v)?;
2198        }
2199        for __v in &self.reserved_range {
2200            enc.write_field_name("reserved_range")?;
2201            enc.write_message(__v)?;
2202        }
2203        for __v in &self.reserved_name {
2204            enc.write_field_name("reserved_name")?;
2205            enc.write_string(__v)?;
2206        }
2207        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2208        ::core::result::Result::Ok(())
2209    }
2210    fn merge_text(
2211        &mut self,
2212        dec: &mut ::buffa::text::TextDecoder<'_>,
2213    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2214        #[allow(unused_imports)]
2215        use ::buffa::Enumeration as _;
2216        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2217            match __name {
2218                "name" => {
2219                    self.name = ::core::option::Option::Some(
2220                        dec.read_string()?.into_owned(),
2221                    );
2222                }
2223                "options" => dec.merge_message(self.options.get_or_insert_default())?,
2224                "visibility" => {
2225                    self.visibility = ::core::option::Option::Some(
2226                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
2227                    );
2228                }
2229                "field" => {
2230                    dec.read_repeated_into(
2231                        &mut self.field,
2232                        |__d| {
2233                            let mut __m = ::core::default::Default::default();
2234                            __d.merge_message(&mut __m)?;
2235                            ::core::result::Result::Ok(__m)
2236                        },
2237                    )?
2238                }
2239                "extension" => {
2240                    dec.read_repeated_into(
2241                        &mut self.extension,
2242                        |__d| {
2243                            let mut __m = ::core::default::Default::default();
2244                            __d.merge_message(&mut __m)?;
2245                            ::core::result::Result::Ok(__m)
2246                        },
2247                    )?
2248                }
2249                "nested_type" => {
2250                    dec.read_repeated_into(
2251                        &mut self.nested_type,
2252                        |__d| {
2253                            let mut __m = ::core::default::Default::default();
2254                            __d.merge_message(&mut __m)?;
2255                            ::core::result::Result::Ok(__m)
2256                        },
2257                    )?
2258                }
2259                "enum_type" => {
2260                    dec.read_repeated_into(
2261                        &mut self.enum_type,
2262                        |__d| {
2263                            let mut __m = ::core::default::Default::default();
2264                            __d.merge_message(&mut __m)?;
2265                            ::core::result::Result::Ok(__m)
2266                        },
2267                    )?
2268                }
2269                "extension_range" => {
2270                    dec.read_repeated_into(
2271                        &mut self.extension_range,
2272                        |__d| {
2273                            let mut __m = ::core::default::Default::default();
2274                            __d.merge_message(&mut __m)?;
2275                            ::core::result::Result::Ok(__m)
2276                        },
2277                    )?
2278                }
2279                "oneof_decl" => {
2280                    dec.read_repeated_into(
2281                        &mut self.oneof_decl,
2282                        |__d| {
2283                            let mut __m = ::core::default::Default::default();
2284                            __d.merge_message(&mut __m)?;
2285                            ::core::result::Result::Ok(__m)
2286                        },
2287                    )?
2288                }
2289                "reserved_range" => {
2290                    dec.read_repeated_into(
2291                        &mut self.reserved_range,
2292                        |__d| {
2293                            let mut __m = ::core::default::Default::default();
2294                            __d.merge_message(&mut __m)?;
2295                            ::core::result::Result::Ok(__m)
2296                        },
2297                    )?
2298                }
2299                "reserved_name" => {
2300                    dec.read_repeated_into(
2301                        &mut self.reserved_name,
2302                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
2303                    )?
2304                }
2305                _ => dec.skip_value()?,
2306            }
2307        }
2308        ::core::result::Result::Ok(())
2309    }
2310}
2311#[cfg(feature = "json")]
2312impl ::buffa::json_helpers::ProtoElemJson for DescriptorProto {
2313    fn serialize_proto_json<S: ::serde::Serializer>(
2314        v: &Self,
2315        s: S,
2316    ) -> ::core::result::Result<S::Ok, S::Error> {
2317        ::serde::Serialize::serialize(v, s)
2318    }
2319    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2320        d: D,
2321    ) -> ::core::result::Result<Self, D::Error> {
2322        <Self as ::serde::Deserialize>::deserialize(d)
2323    }
2324}
2325#[cfg(feature = "json")]
2326#[doc(hidden)]
2327pub const __DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2328    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2329    to_json: ::buffa::type_registry::any_to_json::<DescriptorProto>,
2330    from_json: ::buffa::type_registry::any_from_json::<DescriptorProto>,
2331    is_wkt: false,
2332};
2333#[cfg(feature = "text")]
2334#[doc(hidden)]
2335pub const __DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2336    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2337    text_encode: ::buffa::type_registry::any_encode_text::<DescriptorProto>,
2338    text_merge: ::buffa::type_registry::any_merge_text::<DescriptorProto>,
2339};
2340pub mod descriptor_proto {
2341    #[allow(unused_imports)]
2342    use super::*;
2343    #[derive(Clone, PartialEq, Default)]
2344    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2345    #[cfg_attr(feature = "json", serde(default))]
2346    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2347    pub struct ExtensionRange {
2348        /// Inclusive.
2349        ///
2350        /// Field 1: `start`
2351        #[cfg_attr(
2352            feature = "json",
2353            serde(
2354                rename = "start",
2355                with = "::buffa::json_helpers::opt_int32",
2356                skip_serializing_if = "::core::option::Option::is_none"
2357            )
2358        )]
2359        pub start: ::core::option::Option<i32>,
2360        /// Exclusive.
2361        ///
2362        /// Field 2: `end`
2363        #[cfg_attr(
2364            feature = "json",
2365            serde(
2366                rename = "end",
2367                with = "::buffa::json_helpers::opt_int32",
2368                skip_serializing_if = "::core::option::Option::is_none"
2369            )
2370        )]
2371        pub end: ::core::option::Option<i32>,
2372        /// Field 3: `options`
2373        #[cfg_attr(
2374            feature = "json",
2375            serde(
2376                rename = "options",
2377                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2378            )
2379        )]
2380        pub options: ::buffa::MessageField<
2381            super::ExtensionRangeOptions,
2382            ::buffa::Inline<super::ExtensionRangeOptions>,
2383        >,
2384        #[cfg_attr(feature = "json", serde(skip))]
2385        #[doc(hidden)]
2386        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2387    }
2388    impl ::core::fmt::Debug for ExtensionRange {
2389        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2390            f.debug_struct("ExtensionRange")
2391                .field("start", &self.start)
2392                .field("end", &self.end)
2393                .field("options", &self.options)
2394                .finish()
2395        }
2396    }
2397    impl ExtensionRange {
2398        /// Protobuf type URL for this message, for use with `Any::pack` and
2399        /// `Any::unpack_if`.
2400        ///
2401        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2402        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2403    }
2404    impl ExtensionRange {
2405        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2406        #[inline]
2407        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2408        pub fn with_start(mut self, value: i32) -> Self {
2409            self.start = Some(value);
2410            self
2411        }
2412        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2413        #[inline]
2414        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2415        pub fn with_end(mut self, value: i32) -> Self {
2416            self.end = Some(value);
2417            self
2418        }
2419    }
2420    ::buffa::impl_default_instance!(ExtensionRange);
2421    impl ::buffa::MessageName for ExtensionRange {
2422        const PACKAGE: &'static str = "google.protobuf";
2423        const NAME: &'static str = "DescriptorProto.ExtensionRange";
2424        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2425        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2426    }
2427    impl ::buffa::Message for ExtensionRange {
2428        /// Returns the total encoded size in bytes.
2429        ///
2430        /// Accumulates in `u64` (which cannot overflow for in-memory
2431        /// data) and saturates to `u32` at return, so a message whose
2432        /// encoded size exceeds the 2 GiB protobuf limit yields a value
2433        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2434        /// points reject, never a silently wrapped size.
2435        #[allow(clippy::let_and_return)]
2436        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2437            #[allow(unused_imports)]
2438            use ::buffa::Enumeration as _;
2439            let mut size = 0u64;
2440            if let Some(v) = self.start {
2441                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2442            }
2443            if let Some(v) = self.end {
2444                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2445            }
2446            if self.options.is_set() {
2447                let __slot = __cache.reserve();
2448                let inner_size = self.options.compute_size(__cache);
2449                __cache.set(__slot, inner_size);
2450                size
2451                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2452                        + inner_size as u64;
2453            }
2454            size += self.__buffa_unknown_fields.encoded_len() as u64;
2455            ::buffa::saturate_size(size)
2456        }
2457        fn write_to(
2458            &self,
2459            __cache: &mut ::buffa::SizeCache,
2460            buf: &mut impl ::buffa::EncodeSink,
2461        ) {
2462            #[allow(unused_imports)]
2463            use ::buffa::Enumeration as _;
2464            if let Some(v) = self.start {
2465                ::buffa::types::put_int32_field(1u32, v, buf);
2466            }
2467            if let Some(v) = self.end {
2468                ::buffa::types::put_int32_field(2u32, v, buf);
2469            }
2470            if self.options.is_set() {
2471                ::buffa::types::put_len_delimited_header(
2472                    3u32,
2473                    u64::from(__cache.consume_next()),
2474                    buf,
2475                );
2476                self.options.write_to(__cache, buf);
2477            }
2478            self.__buffa_unknown_fields.write_to(buf);
2479        }
2480        fn merge_field(
2481            &mut self,
2482            tag: ::buffa::encoding::Tag,
2483            buf: &mut impl ::buffa::bytes::Buf,
2484            ctx: ::buffa::DecodeContext<'_>,
2485        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2486            #[allow(unused_imports)]
2487            use ::buffa::bytes::Buf as _;
2488            #[allow(unused_imports)]
2489            use ::buffa::Enumeration as _;
2490            match tag.field_number() {
2491                1u32 => {
2492                    ::buffa::encoding::check_wire_type(
2493                        tag,
2494                        ::buffa::encoding::WireType::Varint,
2495                    )?;
2496                    self.start = ::core::option::Option::Some(
2497                        ::buffa::types::decode_int32(buf)?,
2498                    );
2499                }
2500                2u32 => {
2501                    ::buffa::encoding::check_wire_type(
2502                        tag,
2503                        ::buffa::encoding::WireType::Varint,
2504                    )?;
2505                    self.end = ::core::option::Option::Some(
2506                        ::buffa::types::decode_int32(buf)?,
2507                    );
2508                }
2509                3u32 => {
2510                    ::buffa::encoding::check_wire_type(
2511                        tag,
2512                        ::buffa::encoding::WireType::LengthDelimited,
2513                    )?;
2514                    ::buffa::Message::merge_length_delimited(
2515                        self.options.get_or_insert_default(),
2516                        buf,
2517                        ctx,
2518                    )?;
2519                }
2520                _ => {
2521                    self.__buffa_unknown_fields
2522                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2523                }
2524            }
2525            ::core::result::Result::Ok(())
2526        }
2527        fn clear(&mut self) {
2528            self.start = ::core::option::Option::None;
2529            self.end = ::core::option::Option::None;
2530            self.options = ::buffa::MessageField::none();
2531            self.__buffa_unknown_fields.clear();
2532        }
2533    }
2534    impl ::buffa::ExtensionSet for ExtensionRange {
2535        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2536        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2537            &self.__buffa_unknown_fields
2538        }
2539        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2540            &mut self.__buffa_unknown_fields
2541        }
2542    }
2543    #[cfg(feature = "text")]
2544    impl ::buffa::text::TextFormat for ExtensionRange {
2545        fn encode_text(
2546            &self,
2547            enc: &mut ::buffa::text::TextEncoder<'_>,
2548        ) -> ::core::fmt::Result {
2549            #[allow(unused_imports)]
2550            use ::buffa::Enumeration as _;
2551            if let ::core::option::Option::Some(ref __v) = self.start {
2552                enc.write_field_name("start")?;
2553                enc.write_i32(*__v)?;
2554            }
2555            if let ::core::option::Option::Some(ref __v) = self.end {
2556                enc.write_field_name("end")?;
2557                enc.write_i32(*__v)?;
2558            }
2559            if self.options.is_set() {
2560                enc.write_field_name("options")?;
2561                enc.write_message(&*self.options)?;
2562            }
2563            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2564            ::core::result::Result::Ok(())
2565        }
2566        fn merge_text(
2567            &mut self,
2568            dec: &mut ::buffa::text::TextDecoder<'_>,
2569        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2570            #[allow(unused_imports)]
2571            use ::buffa::Enumeration as _;
2572            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2573                match __name {
2574                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2575                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2576                    "options" => dec.merge_message(self.options.get_or_insert_default())?,
2577                    _ => dec.skip_value()?,
2578                }
2579            }
2580            ::core::result::Result::Ok(())
2581        }
2582    }
2583    #[cfg(feature = "json")]
2584    impl ::buffa::json_helpers::ProtoElemJson for ExtensionRange {
2585        fn serialize_proto_json<S: ::serde::Serializer>(
2586            v: &Self,
2587            s: S,
2588        ) -> ::core::result::Result<S::Ok, S::Error> {
2589            ::serde::Serialize::serialize(v, s)
2590        }
2591        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2592            d: D,
2593        ) -> ::core::result::Result<Self, D::Error> {
2594            <Self as ::serde::Deserialize>::deserialize(d)
2595        }
2596    }
2597    #[cfg(feature = "json")]
2598    #[doc(hidden)]
2599    pub const __EXTENSION_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2600        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2601        to_json: ::buffa::type_registry::any_to_json::<ExtensionRange>,
2602        from_json: ::buffa::type_registry::any_from_json::<ExtensionRange>,
2603        is_wkt: false,
2604    };
2605    #[cfg(feature = "text")]
2606    #[doc(hidden)]
2607    pub const __EXTENSION_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2608        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2609        text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRange>,
2610        text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRange>,
2611    };
2612    /// Range of reserved tag numbers. Reserved tag numbers may not be used by
2613    /// fields or extension ranges in the same message. Reserved ranges may
2614    /// not overlap.
2615    #[derive(Clone, PartialEq, Default)]
2616    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2617    #[cfg_attr(feature = "json", serde(default))]
2618    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2619    pub struct ReservedRange {
2620        /// Inclusive.
2621        ///
2622        /// Field 1: `start`
2623        #[cfg_attr(
2624            feature = "json",
2625            serde(
2626                rename = "start",
2627                with = "::buffa::json_helpers::opt_int32",
2628                skip_serializing_if = "::core::option::Option::is_none"
2629            )
2630        )]
2631        pub start: ::core::option::Option<i32>,
2632        /// Exclusive.
2633        ///
2634        /// Field 2: `end`
2635        #[cfg_attr(
2636            feature = "json",
2637            serde(
2638                rename = "end",
2639                with = "::buffa::json_helpers::opt_int32",
2640                skip_serializing_if = "::core::option::Option::is_none"
2641            )
2642        )]
2643        pub end: ::core::option::Option<i32>,
2644        #[cfg_attr(feature = "json", serde(skip))]
2645        #[doc(hidden)]
2646        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2647    }
2648    impl ::core::fmt::Debug for ReservedRange {
2649        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2650            f.debug_struct("ReservedRange")
2651                .field("start", &self.start)
2652                .field("end", &self.end)
2653                .finish()
2654        }
2655    }
2656    impl ReservedRange {
2657        /// Protobuf type URL for this message, for use with `Any::pack` and
2658        /// `Any::unpack_if`.
2659        ///
2660        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2661        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2662    }
2663    impl ReservedRange {
2664        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2665        #[inline]
2666        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2667        pub fn with_start(mut self, value: i32) -> Self {
2668            self.start = Some(value);
2669            self
2670        }
2671        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2672        #[inline]
2673        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2674        pub fn with_end(mut self, value: i32) -> Self {
2675            self.end = Some(value);
2676            self
2677        }
2678    }
2679    ::buffa::impl_default_instance!(ReservedRange);
2680    impl ::buffa::MessageName for ReservedRange {
2681        const PACKAGE: &'static str = "google.protobuf";
2682        const NAME: &'static str = "DescriptorProto.ReservedRange";
2683        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2684        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2685    }
2686    impl ::buffa::Message for ReservedRange {
2687        /// Returns the total encoded size in bytes.
2688        ///
2689        /// Accumulates in `u64` (which cannot overflow for in-memory
2690        /// data) and saturates to `u32` at return, so a message whose
2691        /// encoded size exceeds the 2 GiB protobuf limit yields a value
2692        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2693        /// points reject, never a silently wrapped size.
2694        #[allow(clippy::let_and_return)]
2695        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2696            #[allow(unused_imports)]
2697            use ::buffa::Enumeration as _;
2698            let mut size = 0u64;
2699            if let Some(v) = self.start {
2700                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2701            }
2702            if let Some(v) = self.end {
2703                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
2704            }
2705            size += self.__buffa_unknown_fields.encoded_len() as u64;
2706            ::buffa::saturate_size(size)
2707        }
2708        fn write_to(
2709            &self,
2710            _cache: &mut ::buffa::SizeCache,
2711            buf: &mut impl ::buffa::EncodeSink,
2712        ) {
2713            #[allow(unused_imports)]
2714            use ::buffa::Enumeration as _;
2715            if let Some(v) = self.start {
2716                ::buffa::types::put_int32_field(1u32, v, buf);
2717            }
2718            if let Some(v) = self.end {
2719                ::buffa::types::put_int32_field(2u32, v, buf);
2720            }
2721            self.__buffa_unknown_fields.write_to(buf);
2722        }
2723        fn merge_field(
2724            &mut self,
2725            tag: ::buffa::encoding::Tag,
2726            buf: &mut impl ::buffa::bytes::Buf,
2727            ctx: ::buffa::DecodeContext<'_>,
2728        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2729            #[allow(unused_imports)]
2730            use ::buffa::bytes::Buf as _;
2731            #[allow(unused_imports)]
2732            use ::buffa::Enumeration as _;
2733            match tag.field_number() {
2734                1u32 => {
2735                    ::buffa::encoding::check_wire_type(
2736                        tag,
2737                        ::buffa::encoding::WireType::Varint,
2738                    )?;
2739                    self.start = ::core::option::Option::Some(
2740                        ::buffa::types::decode_int32(buf)?,
2741                    );
2742                }
2743                2u32 => {
2744                    ::buffa::encoding::check_wire_type(
2745                        tag,
2746                        ::buffa::encoding::WireType::Varint,
2747                    )?;
2748                    self.end = ::core::option::Option::Some(
2749                        ::buffa::types::decode_int32(buf)?,
2750                    );
2751                }
2752                _ => {
2753                    self.__buffa_unknown_fields
2754                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2755                }
2756            }
2757            ::core::result::Result::Ok(())
2758        }
2759        fn clear(&mut self) {
2760            self.start = ::core::option::Option::None;
2761            self.end = ::core::option::Option::None;
2762            self.__buffa_unknown_fields.clear();
2763        }
2764    }
2765    impl ::buffa::ExtensionSet for ReservedRange {
2766        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2767        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2768            &self.__buffa_unknown_fields
2769        }
2770        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2771            &mut self.__buffa_unknown_fields
2772        }
2773    }
2774    #[cfg(feature = "text")]
2775    impl ::buffa::text::TextFormat for ReservedRange {
2776        fn encode_text(
2777            &self,
2778            enc: &mut ::buffa::text::TextEncoder<'_>,
2779        ) -> ::core::fmt::Result {
2780            #[allow(unused_imports)]
2781            use ::buffa::Enumeration as _;
2782            if let ::core::option::Option::Some(ref __v) = self.start {
2783                enc.write_field_name("start")?;
2784                enc.write_i32(*__v)?;
2785            }
2786            if let ::core::option::Option::Some(ref __v) = self.end {
2787                enc.write_field_name("end")?;
2788                enc.write_i32(*__v)?;
2789            }
2790            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2791            ::core::result::Result::Ok(())
2792        }
2793        fn merge_text(
2794            &mut self,
2795            dec: &mut ::buffa::text::TextDecoder<'_>,
2796        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2797            #[allow(unused_imports)]
2798            use ::buffa::Enumeration as _;
2799            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2800                match __name {
2801                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2802                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2803                    _ => dec.skip_value()?,
2804                }
2805            }
2806            ::core::result::Result::Ok(())
2807        }
2808    }
2809    #[cfg(feature = "json")]
2810    impl ::buffa::json_helpers::ProtoElemJson for ReservedRange {
2811        fn serialize_proto_json<S: ::serde::Serializer>(
2812            v: &Self,
2813            s: S,
2814        ) -> ::core::result::Result<S::Ok, S::Error> {
2815            ::serde::Serialize::serialize(v, s)
2816        }
2817        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2818            d: D,
2819        ) -> ::core::result::Result<Self, D::Error> {
2820            <Self as ::serde::Deserialize>::deserialize(d)
2821        }
2822    }
2823    #[cfg(feature = "json")]
2824    #[doc(hidden)]
2825    pub const __RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2826        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2827        to_json: ::buffa::type_registry::any_to_json::<ReservedRange>,
2828        from_json: ::buffa::type_registry::any_from_json::<ReservedRange>,
2829        is_wkt: false,
2830    };
2831    #[cfg(feature = "text")]
2832    #[doc(hidden)]
2833    pub const __RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2834        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2835        text_encode: ::buffa::type_registry::any_encode_text::<ReservedRange>,
2836        text_merge: ::buffa::type_registry::any_merge_text::<ReservedRange>,
2837    };
2838    #[cfg(feature = "views")]
2839    #[doc(inline)]
2840    pub use super::__buffa::view::descriptor_proto::ExtensionRangeView;
2841    #[cfg(feature = "views")]
2842    #[doc(inline)]
2843    pub use super::__buffa::view::descriptor_proto::ExtensionRangeOwnedView;
2844    #[cfg(feature = "views")]
2845    #[doc(inline)]
2846    pub use super::__buffa::view::descriptor_proto::ReservedRangeView;
2847    #[cfg(feature = "views")]
2848    #[doc(inline)]
2849    pub use super::__buffa::view::descriptor_proto::ReservedRangeOwnedView;
2850}
2851#[derive(Clone, PartialEq, Default)]
2852#[cfg_attr(feature = "json", derive(::serde::Serialize))]
2853#[cfg_attr(feature = "json", serde(default))]
2854#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2855pub struct ExtensionRangeOptions {
2856    /// The parser stores options it doesn't recognize here. See above.
2857    ///
2858    /// Field 999: `uninterpreted_option`
2859    #[cfg_attr(
2860        feature = "json",
2861        serde(
2862            rename = "uninterpretedOption",
2863            alias = "uninterpreted_option",
2864            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2865            deserialize_with = "::buffa::json_helpers::null_as_default"
2866        )
2867    )]
2868    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
2869    /// For external users: DO NOT USE. We are in the process of open sourcing
2870    /// extension declaration and executing internal cleanups before it can be
2871    /// used externally.
2872    ///
2873    /// Field 2: `declaration`
2874    #[cfg_attr(
2875        feature = "json",
2876        serde(
2877            rename = "declaration",
2878            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2879            deserialize_with = "::buffa::json_helpers::null_as_default"
2880        )
2881    )]
2882    pub declaration: ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
2883    /// Any features defined in the specific edition.
2884    ///
2885    /// Field 50: `features`
2886    #[cfg_attr(
2887        feature = "json",
2888        serde(
2889            rename = "features",
2890            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2891        )
2892    )]
2893    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
2894    /// The verification state of the range.
2895    /// TODO: flip the default to DECLARATION once all empty ranges
2896    /// are marked as UNVERIFIED.
2897    ///
2898    /// Field 3: `verification`
2899    #[cfg_attr(
2900        feature = "json",
2901        serde(
2902            rename = "verification",
2903            with = "::buffa::json_helpers::opt_closed_enum",
2904            skip_serializing_if = "::core::option::Option::is_none"
2905        )
2906    )]
2907    pub verification: ::core::option::Option<extension_range_options::VerificationState>,
2908    #[cfg_attr(feature = "json", serde(flatten))]
2909    #[doc(hidden)]
2910    pub __buffa_unknown_fields: __ExtensionRangeOptionsExtJson,
2911}
2912impl ::core::fmt::Debug for ExtensionRangeOptions {
2913    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2914        f.debug_struct("ExtensionRangeOptions")
2915            .field("uninterpreted_option", &self.uninterpreted_option)
2916            .field("declaration", &self.declaration)
2917            .field("features", &self.features)
2918            .field("verification", &self.verification)
2919            .finish()
2920    }
2921}
2922impl ExtensionRangeOptions {
2923    /// Protobuf type URL for this message, for use with `Any::pack` and
2924    /// `Any::unpack_if`.
2925    ///
2926    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2927    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2928}
2929impl ExtensionRangeOptions {
2930    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2931    #[inline]
2932    ///Sets [`Self::verification`] to `Some(value)`, consuming and returning `self`.
2933    pub fn with_verification(
2934        mut self,
2935        value: impl Into<extension_range_options::VerificationState>,
2936    ) -> Self {
2937        self.verification = Some(value.into());
2938        self
2939    }
2940}
2941::buffa::impl_default_instance!(ExtensionRangeOptions);
2942impl ::buffa::MessageName for ExtensionRangeOptions {
2943    const PACKAGE: &'static str = "google.protobuf";
2944    const NAME: &'static str = "ExtensionRangeOptions";
2945    const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions";
2946    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
2947}
2948impl ::buffa::Message for ExtensionRangeOptions {
2949    /// Returns the total encoded size in bytes.
2950    ///
2951    /// Accumulates in `u64` (which cannot overflow for in-memory
2952    /// data) and saturates to `u32` at return, so a message whose
2953    /// encoded size exceeds the 2 GiB protobuf limit yields a value
2954    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
2955    /// points reject, never a silently wrapped size.
2956    #[allow(clippy::let_and_return)]
2957    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2958        #[allow(unused_imports)]
2959        use ::buffa::Enumeration as _;
2960        let mut size = 0u64;
2961        for v in &self.declaration {
2962            let __slot = __cache.reserve();
2963            let inner_size = v.compute_size(__cache);
2964            __cache.set(__slot, inner_size);
2965            size
2966                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2967                    + inner_size as u64;
2968        }
2969        if let Some(ref v) = self.verification {
2970            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
2971        }
2972        if self.features.is_set() {
2973            let __slot = __cache.reserve();
2974            let inner_size = self.features.compute_size(__cache);
2975            __cache.set(__slot, inner_size);
2976            size
2977                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2978                    + inner_size as u64;
2979        }
2980        for v in &self.uninterpreted_option {
2981            let __slot = __cache.reserve();
2982            let inner_size = v.compute_size(__cache);
2983            __cache.set(__slot, inner_size);
2984            size
2985                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
2986                    + inner_size as u64;
2987        }
2988        size += self.__buffa_unknown_fields.encoded_len() as u64;
2989        ::buffa::saturate_size(size)
2990    }
2991    fn write_to(
2992        &self,
2993        __cache: &mut ::buffa::SizeCache,
2994        buf: &mut impl ::buffa::EncodeSink,
2995    ) {
2996        #[allow(unused_imports)]
2997        use ::buffa::Enumeration as _;
2998        for v in &self.declaration {
2999            ::buffa::types::put_len_delimited_header(
3000                2u32,
3001                u64::from(__cache.consume_next()),
3002                buf,
3003            );
3004            v.write_to(__cache, buf);
3005        }
3006        if let Some(ref v) = self.verification {
3007            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
3008        }
3009        if self.features.is_set() {
3010            ::buffa::types::put_len_delimited_header(
3011                50u32,
3012                u64::from(__cache.consume_next()),
3013                buf,
3014            );
3015            self.features.write_to(__cache, buf);
3016        }
3017        for v in &self.uninterpreted_option {
3018            ::buffa::types::put_len_delimited_header(
3019                999u32,
3020                u64::from(__cache.consume_next()),
3021                buf,
3022            );
3023            v.write_to(__cache, buf);
3024        }
3025        self.__buffa_unknown_fields.write_to(buf);
3026    }
3027    fn merge_field(
3028        &mut self,
3029        tag: ::buffa::encoding::Tag,
3030        buf: &mut impl ::buffa::bytes::Buf,
3031        ctx: ::buffa::DecodeContext<'_>,
3032    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3033        #[allow(unused_imports)]
3034        use ::buffa::bytes::Buf as _;
3035        #[allow(unused_imports)]
3036        use ::buffa::Enumeration as _;
3037        match tag.field_number() {
3038            2u32 => {
3039                ::buffa::encoding::check_wire_type(
3040                    tag,
3041                    ::buffa::encoding::WireType::LengthDelimited,
3042                )?;
3043                let mut elem = ::core::default::Default::default();
3044                ctx.register_element_memory(
3045                    ::buffa::__private::element_footprint(&elem),
3046                )?;
3047                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
3048                self.declaration.push(elem);
3049            }
3050            3u32 => {
3051                ::buffa::encoding::check_wire_type(
3052                    tag,
3053                    ::buffa::encoding::WireType::Varint,
3054                )?;
3055                let __raw = ::buffa::types::decode_int32(buf)?;
3056                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
3057                    __raw,
3058                ) {
3059                    self.verification = ::core::option::Option::Some(__v);
3060                } else {
3061                    ctx.register_unknown_field()?;
3062                    self.__buffa_unknown_fields
3063                        .push(::buffa::UnknownField {
3064                            number: 3u32,
3065                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
3066                        });
3067                }
3068            }
3069            50u32 => {
3070                ::buffa::encoding::check_wire_type(
3071                    tag,
3072                    ::buffa::encoding::WireType::LengthDelimited,
3073                )?;
3074                ::buffa::Message::merge_length_delimited(
3075                    self.features.get_or_insert_default(),
3076                    buf,
3077                    ctx,
3078                )?;
3079            }
3080            999u32 => {
3081                ::buffa::encoding::check_wire_type(
3082                    tag,
3083                    ::buffa::encoding::WireType::LengthDelimited,
3084                )?;
3085                let mut elem = ::core::default::Default::default();
3086                ctx.register_element_memory(
3087                    ::buffa::__private::element_footprint(&elem),
3088                )?;
3089                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
3090                self.uninterpreted_option.push(elem);
3091            }
3092            _ => {
3093                self.__buffa_unknown_fields
3094                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3095            }
3096        }
3097        ::core::result::Result::Ok(())
3098    }
3099    fn clear(&mut self) {
3100        self.declaration.clear();
3101        self.verification = ::core::option::Option::None;
3102        self.features = ::buffa::MessageField::none();
3103        self.uninterpreted_option.clear();
3104        self.__buffa_unknown_fields.clear();
3105    }
3106}
3107impl ::buffa::ExtensionSet for ExtensionRangeOptions {
3108    const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions";
3109    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3110        &self.__buffa_unknown_fields
3111    }
3112    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3113        &mut self.__buffa_unknown_fields
3114    }
3115}
3116#[cfg(feature = "text")]
3117impl ::buffa::text::TextFormat for ExtensionRangeOptions {
3118    fn encode_text(
3119        &self,
3120        enc: &mut ::buffa::text::TextEncoder<'_>,
3121    ) -> ::core::fmt::Result {
3122        #[allow(unused_imports)]
3123        use ::buffa::Enumeration as _;
3124        if self.features.is_set() {
3125            enc.write_field_name("features")?;
3126            enc.write_message(&*self.features)?;
3127        }
3128        if let ::core::option::Option::Some(ref __v) = self.verification {
3129            enc.write_field_name("verification")?;
3130            enc.write_enum_name(__v.proto_name())?;
3131        }
3132        for __v in &self.uninterpreted_option {
3133            enc.write_field_name("uninterpreted_option")?;
3134            enc.write_message(__v)?;
3135        }
3136        for __v in &self.declaration {
3137            enc.write_field_name("declaration")?;
3138            enc.write_message(__v)?;
3139        }
3140        enc.write_extension_fields(
3141            "google.protobuf.ExtensionRangeOptions",
3142            &self.__buffa_unknown_fields,
3143        )?;
3144        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3145        ::core::result::Result::Ok(())
3146    }
3147    fn merge_text(
3148        &mut self,
3149        dec: &mut ::buffa::text::TextDecoder<'_>,
3150    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3151        #[allow(unused_imports)]
3152        use ::buffa::Enumeration as _;
3153        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3154            match __name {
3155                "features" => dec.merge_message(self.features.get_or_insert_default())?,
3156                "verification" => {
3157                    self.verification = ::core::option::Option::Some(
3158                        dec
3159                            .read_closed_enum_by_name::<
3160                                extension_range_options::VerificationState,
3161                            >()?,
3162                    );
3163                }
3164                "uninterpreted_option" => {
3165                    dec.read_repeated_into(
3166                        &mut self.uninterpreted_option,
3167                        |__d| {
3168                            let mut __m = ::core::default::Default::default();
3169                            __d.merge_message(&mut __m)?;
3170                            ::core::result::Result::Ok(__m)
3171                        },
3172                    )?
3173                }
3174                "declaration" => {
3175                    dec.read_repeated_into(
3176                        &mut self.declaration,
3177                        |__d| {
3178                            let mut __m = ::core::default::Default::default();
3179                            __d.merge_message(&mut __m)?;
3180                            ::core::result::Result::Ok(__m)
3181                        },
3182                    )?
3183                }
3184                __name if __name.starts_with('[') => {
3185                    for __r in dec
3186                        .read_extension(__name, "google.protobuf.ExtensionRangeOptions")?
3187                    {
3188                        self.__buffa_unknown_fields.push(__r);
3189                    }
3190                }
3191                _ => dec.skip_value()?,
3192            }
3193        }
3194        ::core::result::Result::Ok(())
3195    }
3196}
3197#[cfg(feature = "json")]
3198impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions {
3199    fn deserialize<D: serde::Deserializer<'de>>(
3200        d: D,
3201    ) -> ::core::result::Result<Self, D::Error> {
3202        struct _V;
3203        impl<'de> serde::de::Visitor<'de> for _V {
3204            type Value = ExtensionRangeOptions;
3205            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3206                f.write_str("struct ExtensionRangeOptions")
3207            }
3208            #[allow(clippy::field_reassign_with_default)]
3209            fn visit_map<A: serde::de::MapAccess<'de>>(
3210                self,
3211                mut map: A,
3212            ) -> ::core::result::Result<ExtensionRangeOptions, A::Error> {
3213                let mut __f_uninterpreted_option: ::core::option::Option<
3214                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
3215                > = None;
3216                let mut __f_declaration: ::core::option::Option<
3217                    ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
3218                > = None;
3219                let mut __f_features: ::core::option::Option<
3220                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
3221                > = None;
3222                let mut __f_verification: ::core::option::Option<
3223                    ::core::option::Option<extension_range_options::VerificationState>,
3224                > = None;
3225                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
3226                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
3227                    match key.as_str() {
3228                        "uninterpretedOption" | "uninterpreted_option" => {
3229                            __f_uninterpreted_option = Some({
3230                                struct _S;
3231                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3232                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
3233                                    fn deserialize<D: serde::Deserializer<'de>>(
3234                                        self,
3235                                        d: D,
3236                                    ) -> ::core::result::Result<
3237                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
3238                                        D::Error,
3239                                    > {
3240                                        ::buffa::json_helpers::null_as_default(d)
3241                                    }
3242                                }
3243                                map.next_value_seed(_S)?
3244                            });
3245                        }
3246                        "declaration" => {
3247                            __f_declaration = Some({
3248                                struct _S;
3249                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3250                                    type Value = ::buffa::alloc::vec::Vec<
3251                                        extension_range_options::Declaration,
3252                                    >;
3253                                    fn deserialize<D: serde::Deserializer<'de>>(
3254                                        self,
3255                                        d: D,
3256                                    ) -> ::core::result::Result<
3257                                        ::buffa::alloc::vec::Vec<
3258                                            extension_range_options::Declaration,
3259                                        >,
3260                                        D::Error,
3261                                    > {
3262                                        ::buffa::json_helpers::null_as_default(d)
3263                                    }
3264                                }
3265                                map.next_value_seed(_S)?
3266                            });
3267                        }
3268                        "features" => {
3269                            __f_features = Some(
3270                                map
3271                                    .next_value::<
3272                                        ::buffa::MessageField<
3273                                            FeatureSet,
3274                                            ::buffa::Inline<FeatureSet>,
3275                                        >,
3276                                    >()?,
3277                            );
3278                        }
3279                        "verification" => {
3280                            __f_verification = Some({
3281                                struct _S;
3282                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3283                                    type Value = ::core::option::Option<
3284                                        extension_range_options::VerificationState,
3285                                    >;
3286                                    fn deserialize<D: serde::Deserializer<'de>>(
3287                                        self,
3288                                        d: D,
3289                                    ) -> ::core::result::Result<
3290                                        ::core::option::Option<
3291                                            extension_range_options::VerificationState,
3292                                        >,
3293                                        D::Error,
3294                                    > {
3295                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
3296                                    }
3297                                }
3298                                map.next_value_seed(_S)?
3299                            });
3300                        }
3301                        __k if __k.starts_with('[') => {
3302                            let __v: ::buffa::serde_json::Value = map.next_value()?;
3303                            match ::buffa::extension_registry::deserialize_extension_key(
3304                                "google.protobuf.ExtensionRangeOptions",
3305                                __k,
3306                                __v,
3307                            ) {
3308                                ::core::option::Option::Some(
3309                                    ::core::result::Result::Ok(__recs),
3310                                ) => {
3311                                    for __rec in __recs {
3312                                        __ext_records.push(__rec);
3313                                    }
3314                                }
3315                                ::core::option::Option::Some(
3316                                    ::core::result::Result::Err(__e),
3317                                ) => {
3318                                    return ::core::result::Result::Err(
3319                                        <A::Error as ::serde::de::Error>::custom(__e),
3320                                    );
3321                                }
3322                                ::core::option::Option::None => {}
3323                            }
3324                        }
3325                        _ => {
3326                            map.next_value::<serde::de::IgnoredAny>()?;
3327                        }
3328                    }
3329                }
3330                let mut __r = <ExtensionRangeOptions as ::core::default::Default>::default();
3331                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
3332                    __r.uninterpreted_option = v;
3333                }
3334                if let ::core::option::Option::Some(v) = __f_declaration {
3335                    __r.declaration = v;
3336                }
3337                if let ::core::option::Option::Some(v) = __f_features {
3338                    __r.features = v;
3339                }
3340                if let ::core::option::Option::Some(v) = __f_verification {
3341                    __r.verification = v;
3342                }
3343                for __rec in __ext_records {
3344                    __r.__buffa_unknown_fields.push(__rec);
3345                }
3346                Ok(__r)
3347            }
3348        }
3349        d.deserialize_map(_V)
3350    }
3351}
3352#[cfg(feature = "json")]
3353impl ::buffa::json_helpers::ProtoElemJson for ExtensionRangeOptions {
3354    fn serialize_proto_json<S: ::serde::Serializer>(
3355        v: &Self,
3356        s: S,
3357    ) -> ::core::result::Result<S::Ok, S::Error> {
3358        ::serde::Serialize::serialize(v, s)
3359    }
3360    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3361        d: D,
3362    ) -> ::core::result::Result<Self, D::Error> {
3363        <Self as ::serde::Deserialize>::deserialize(d)
3364    }
3365}
3366#[doc(hidden)]
3367#[derive(Clone, Debug, Default, PartialEq)]
3368#[repr(transparent)]
3369#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3370pub struct __ExtensionRangeOptionsExtJson(pub ::buffa::UnknownFields);
3371impl ::core::ops::Deref for __ExtensionRangeOptionsExtJson {
3372    type Target = ::buffa::UnknownFields;
3373    fn deref(&self) -> &::buffa::UnknownFields {
3374        &self.0
3375    }
3376}
3377impl ::core::ops::DerefMut for __ExtensionRangeOptionsExtJson {
3378    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
3379        &mut self.0
3380    }
3381}
3382impl ::core::convert::From<::buffa::UnknownFields> for __ExtensionRangeOptionsExtJson {
3383    fn from(u: ::buffa::UnknownFields) -> Self {
3384        Self(u)
3385    }
3386}
3387#[cfg(feature = "json")]
3388impl ::serde::Serialize for __ExtensionRangeOptionsExtJson {
3389    fn serialize<S: ::serde::Serializer>(
3390        &self,
3391        s: S,
3392    ) -> ::core::result::Result<S::Ok, S::Error> {
3393        ::buffa::extension_registry::serialize_extensions(
3394            "google.protobuf.ExtensionRangeOptions",
3395            &self.0,
3396            s,
3397        )
3398    }
3399}
3400#[cfg(feature = "json")]
3401impl<'de> ::serde::Deserialize<'de> for __ExtensionRangeOptionsExtJson {
3402    fn deserialize<D: ::serde::Deserializer<'de>>(
3403        d: D,
3404    ) -> ::core::result::Result<Self, D::Error> {
3405        ::buffa::extension_registry::deserialize_extensions(
3406                "google.protobuf.ExtensionRangeOptions",
3407                d,
3408            )
3409            .map(Self)
3410    }
3411}
3412#[cfg(feature = "json")]
3413#[doc(hidden)]
3414pub const __EXTENSION_RANGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3415    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3416    to_json: ::buffa::type_registry::any_to_json::<ExtensionRangeOptions>,
3417    from_json: ::buffa::type_registry::any_from_json::<ExtensionRangeOptions>,
3418    is_wkt: false,
3419};
3420#[cfg(feature = "text")]
3421#[doc(hidden)]
3422pub const __EXTENSION_RANGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3423    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3424    text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRangeOptions>,
3425    text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRangeOptions>,
3426};
3427pub mod extension_range_options {
3428    #[allow(unused_imports)]
3429    use super::*;
3430    /// The verification state of the extension range.
3431    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
3432    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3433    #[repr(i32)]
3434    pub enum VerificationState {
3435        /// All the extensions of the range must be declared.
3436        DECLARATION = 0i32,
3437        UNVERIFIED = 1i32,
3438    }
3439    impl VerificationState {
3440        ///Idiomatic alias for [`Self::DECLARATION`]; `Debug` prints the variant name.
3441        #[allow(non_upper_case_globals)]
3442        pub const Declaration: Self = Self::DECLARATION;
3443        ///Idiomatic alias for [`Self::UNVERIFIED`]; `Debug` prints the variant name.
3444        #[allow(non_upper_case_globals)]
3445        pub const Unverified: Self = Self::UNVERIFIED;
3446    }
3447    impl ::core::default::Default for VerificationState {
3448        fn default() -> Self {
3449            Self::DECLARATION
3450        }
3451    }
3452    #[cfg(feature = "json")]
3453    const _: () = {
3454        impl ::serde::Serialize for VerificationState {
3455            fn serialize<S: ::serde::Serializer>(
3456                &self,
3457                s: S,
3458            ) -> ::core::result::Result<S::Ok, S::Error> {
3459                s.serialize_str(::buffa::Enumeration::proto_name(self))
3460            }
3461        }
3462        impl<'de> ::serde::Deserialize<'de> for VerificationState {
3463            fn deserialize<D: ::serde::Deserializer<'de>>(
3464                d: D,
3465            ) -> ::core::result::Result<Self, D::Error> {
3466                struct _V;
3467                impl ::serde::de::Visitor<'_> for _V {
3468                    type Value = VerificationState;
3469                    fn expecting(
3470                        &self,
3471                        f: &mut ::core::fmt::Formatter<'_>,
3472                    ) -> ::core::fmt::Result {
3473                        f.write_str(
3474                            concat!(
3475                                "a string, integer, or null for ",
3476                                stringify!(VerificationState)
3477                            ),
3478                        )
3479                    }
3480                    fn visit_str<E: ::serde::de::Error>(
3481                        self,
3482                        v: &str,
3483                    ) -> ::core::result::Result<VerificationState, E> {
3484                        <VerificationState as ::buffa::Enumeration>::from_proto_name(v)
3485                            .ok_or_else(|| {
3486                                ::serde::de::Error::unknown_variant(v, &[])
3487                            })
3488                    }
3489                    fn visit_i64<E: ::serde::de::Error>(
3490                        self,
3491                        v: i64,
3492                    ) -> ::core::result::Result<VerificationState, E> {
3493                        let v32 = i32::try_from(v)
3494                            .map_err(|_| {
3495                                ::serde::de::Error::custom(
3496                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3497                                )
3498                            })?;
3499                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3500                            .ok_or_else(|| {
3501                                ::serde::de::Error::custom(
3502                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3503                                )
3504                            })
3505                    }
3506                    fn visit_u64<E: ::serde::de::Error>(
3507                        self,
3508                        v: u64,
3509                    ) -> ::core::result::Result<VerificationState, E> {
3510                        let v32 = i32::try_from(v)
3511                            .map_err(|_| {
3512                                ::serde::de::Error::custom(
3513                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3514                                )
3515                            })?;
3516                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3517                            .ok_or_else(|| {
3518                                ::serde::de::Error::custom(
3519                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3520                                )
3521                            })
3522                    }
3523                    fn visit_unit<E: ::serde::de::Error>(
3524                        self,
3525                    ) -> ::core::result::Result<VerificationState, E> {
3526                        ::core::result::Result::Ok(::core::default::Default::default())
3527                    }
3528                }
3529                d.deserialize_any(_V)
3530            }
3531        }
3532        impl ::buffa::json_helpers::ProtoElemJson for VerificationState {
3533            fn serialize_proto_json<S: ::serde::Serializer>(
3534                v: &Self,
3535                s: S,
3536            ) -> ::core::result::Result<S::Ok, S::Error> {
3537                ::serde::Serialize::serialize(v, s)
3538            }
3539            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3540                d: D,
3541            ) -> ::core::result::Result<Self, D::Error> {
3542                <Self as ::serde::Deserialize>::deserialize(d)
3543            }
3544        }
3545    };
3546    impl ::buffa::Enumeration for VerificationState {
3547        fn from_i32(value: i32) -> ::core::option::Option<Self> {
3548            match value {
3549                0i32 => ::core::option::Option::Some(Self::DECLARATION),
3550                1i32 => ::core::option::Option::Some(Self::UNVERIFIED),
3551                _ => ::core::option::Option::None,
3552            }
3553        }
3554        fn to_i32(&self) -> i32 {
3555            *self as i32
3556        }
3557        fn proto_name(&self) -> &'static str {
3558            match self {
3559                Self::DECLARATION => "DECLARATION",
3560                Self::UNVERIFIED => "UNVERIFIED",
3561            }
3562        }
3563        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
3564            match name {
3565                "DECLARATION" => ::core::option::Option::Some(Self::DECLARATION),
3566                "UNVERIFIED" => ::core::option::Option::Some(Self::UNVERIFIED),
3567                _ => ::core::option::Option::None,
3568            }
3569        }
3570        fn values() -> &'static [Self] {
3571            &[Self::DECLARATION, Self::UNVERIFIED]
3572        }
3573    }
3574    #[derive(Clone, PartialEq, Default)]
3575    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3576    #[cfg_attr(feature = "json", serde(default))]
3577    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3578    pub struct Declaration {
3579        /// The extension number declared within the extension range.
3580        ///
3581        /// Field 1: `number`
3582        #[cfg_attr(
3583            feature = "json",
3584            serde(
3585                rename = "number",
3586                with = "::buffa::json_helpers::opt_int32",
3587                skip_serializing_if = "::core::option::Option::is_none"
3588            )
3589        )]
3590        pub number: ::core::option::Option<i32>,
3591        /// The fully-qualified name of the extension field. There must be a leading
3592        /// dot in front of the full name.
3593        ///
3594        /// Field 2: `full_name`
3595        #[cfg_attr(
3596            feature = "json",
3597            serde(
3598                rename = "fullName",
3599                alias = "full_name",
3600                skip_serializing_if = "::core::option::Option::is_none"
3601            )
3602        )]
3603        pub full_name: ::core::option::Option<::buffa::alloc::string::String>,
3604        /// The fully-qualified type name of the extension field. Unlike
3605        /// Metadata.type, Declaration.type must have a leading dot for messages
3606        /// and enums.
3607        ///
3608        /// Field 3: `type`
3609        #[cfg_attr(
3610            feature = "json",
3611            serde(
3612                rename = "type",
3613                skip_serializing_if = "::core::option::Option::is_none"
3614            )
3615        )]
3616        pub r#type: ::core::option::Option<::buffa::alloc::string::String>,
3617        /// If true, indicates that the number is reserved in the extension range,
3618        /// and any extension field with the number will fail to compile. Set this
3619        /// when a declared extension field is deleted.
3620        ///
3621        /// Field 5: `reserved`
3622        #[cfg_attr(
3623            feature = "json",
3624            serde(
3625                rename = "reserved",
3626                skip_serializing_if = "::core::option::Option::is_none"
3627            )
3628        )]
3629        pub reserved: ::core::option::Option<bool>,
3630        /// If true, indicates that the extension must be defined as repeated.
3631        /// Otherwise the extension must be defined as optional.
3632        ///
3633        /// Field 6: `repeated`
3634        #[cfg_attr(
3635            feature = "json",
3636            serde(
3637                rename = "repeated",
3638                skip_serializing_if = "::core::option::Option::is_none"
3639            )
3640        )]
3641        pub repeated: ::core::option::Option<bool>,
3642        #[cfg_attr(feature = "json", serde(skip))]
3643        #[doc(hidden)]
3644        pub __buffa_unknown_fields: ::buffa::UnknownFields,
3645    }
3646    impl ::core::fmt::Debug for Declaration {
3647        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3648            f.debug_struct("Declaration")
3649                .field("number", &self.number)
3650                .field("full_name", &self.full_name)
3651                .field("type", &self.r#type)
3652                .field("reserved", &self.reserved)
3653                .field("repeated", &self.repeated)
3654                .finish()
3655        }
3656    }
3657    impl Declaration {
3658        /// Protobuf type URL for this message, for use with `Any::pack` and
3659        /// `Any::unpack_if`.
3660        ///
3661        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3662        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3663    }
3664    impl Declaration {
3665        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3666        #[inline]
3667        ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
3668        pub fn with_number(mut self, value: i32) -> Self {
3669            self.number = Some(value);
3670            self
3671        }
3672        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3673        #[inline]
3674        ///Sets [`Self::full_name`] to `Some(value)`, consuming and returning `self`.
3675        pub fn with_full_name(
3676            mut self,
3677            value: impl Into<::buffa::alloc::string::String>,
3678        ) -> Self {
3679            self.full_name = Some(value.into());
3680            self
3681        }
3682        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3683        #[inline]
3684        ///Sets `type` to `Some(value)`, consuming and returning `self`.
3685        pub fn with_type(
3686            mut self,
3687            value: impl Into<::buffa::alloc::string::String>,
3688        ) -> Self {
3689            self.r#type = Some(value.into());
3690            self
3691        }
3692        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3693        #[inline]
3694        ///Sets [`Self::reserved`] to `Some(value)`, consuming and returning `self`.
3695        pub fn with_reserved(mut self, value: bool) -> Self {
3696            self.reserved = Some(value);
3697            self
3698        }
3699        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3700        #[inline]
3701        ///Sets [`Self::repeated`] to `Some(value)`, consuming and returning `self`.
3702        pub fn with_repeated(mut self, value: bool) -> Self {
3703            self.repeated = Some(value);
3704            self
3705        }
3706    }
3707    ::buffa::impl_default_instance!(Declaration);
3708    impl ::buffa::MessageName for Declaration {
3709        const PACKAGE: &'static str = "google.protobuf";
3710        const NAME: &'static str = "ExtensionRangeOptions.Declaration";
3711        const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3712        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3713    }
3714    impl ::buffa::Message for Declaration {
3715        /// Returns the total encoded size in bytes.
3716        ///
3717        /// Accumulates in `u64` (which cannot overflow for in-memory
3718        /// data) and saturates to `u32` at return, so a message whose
3719        /// encoded size exceeds the 2 GiB protobuf limit yields a value
3720        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
3721        /// points reject, never a silently wrapped size.
3722        #[allow(clippy::let_and_return)]
3723        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3724            #[allow(unused_imports)]
3725            use ::buffa::Enumeration as _;
3726            let mut size = 0u64;
3727            if let Some(v) = self.number {
3728                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
3729            }
3730            if let Some(ref v) = self.full_name {
3731                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
3732            }
3733            if let Some(ref v) = self.r#type {
3734                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
3735            }
3736            if self.reserved.is_some() {
3737                size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
3738            }
3739            if self.repeated.is_some() {
3740                size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
3741            }
3742            size += self.__buffa_unknown_fields.encoded_len() as u64;
3743            ::buffa::saturate_size(size)
3744        }
3745        fn write_to(
3746            &self,
3747            _cache: &mut ::buffa::SizeCache,
3748            buf: &mut impl ::buffa::EncodeSink,
3749        ) {
3750            #[allow(unused_imports)]
3751            use ::buffa::Enumeration as _;
3752            if let Some(v) = self.number {
3753                ::buffa::types::put_int32_field(1u32, v, buf);
3754            }
3755            if let Some(ref v) = self.full_name {
3756                ::buffa::types::put_string_field(2u32, v, buf);
3757            }
3758            if let Some(ref v) = self.r#type {
3759                ::buffa::types::put_string_field(3u32, v, buf);
3760            }
3761            if let Some(v) = self.reserved {
3762                ::buffa::types::put_bool_field(5u32, v, buf);
3763            }
3764            if let Some(v) = self.repeated {
3765                ::buffa::types::put_bool_field(6u32, v, buf);
3766            }
3767            self.__buffa_unknown_fields.write_to(buf);
3768        }
3769        fn merge_field(
3770            &mut self,
3771            tag: ::buffa::encoding::Tag,
3772            buf: &mut impl ::buffa::bytes::Buf,
3773            ctx: ::buffa::DecodeContext<'_>,
3774        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3775            #[allow(unused_imports)]
3776            use ::buffa::bytes::Buf as _;
3777            #[allow(unused_imports)]
3778            use ::buffa::Enumeration as _;
3779            match tag.field_number() {
3780                1u32 => {
3781                    ::buffa::encoding::check_wire_type(
3782                        tag,
3783                        ::buffa::encoding::WireType::Varint,
3784                    )?;
3785                    self.number = ::core::option::Option::Some(
3786                        ::buffa::types::decode_int32(buf)?,
3787                    );
3788                }
3789                2u32 => {
3790                    ::buffa::encoding::check_wire_type(
3791                        tag,
3792                        ::buffa::encoding::WireType::LengthDelimited,
3793                    )?;
3794                    ::buffa::types::merge_string(
3795                        self
3796                            .full_name
3797                            .get_or_insert_with(::buffa::alloc::string::String::new),
3798                        buf,
3799                    )?;
3800                }
3801                3u32 => {
3802                    ::buffa::encoding::check_wire_type(
3803                        tag,
3804                        ::buffa::encoding::WireType::LengthDelimited,
3805                    )?;
3806                    ::buffa::types::merge_string(
3807                        self
3808                            .r#type
3809                            .get_or_insert_with(::buffa::alloc::string::String::new),
3810                        buf,
3811                    )?;
3812                }
3813                5u32 => {
3814                    ::buffa::encoding::check_wire_type(
3815                        tag,
3816                        ::buffa::encoding::WireType::Varint,
3817                    )?;
3818                    self.reserved = ::core::option::Option::Some(
3819                        ::buffa::types::decode_bool(buf)?,
3820                    );
3821                }
3822                6u32 => {
3823                    ::buffa::encoding::check_wire_type(
3824                        tag,
3825                        ::buffa::encoding::WireType::Varint,
3826                    )?;
3827                    self.repeated = ::core::option::Option::Some(
3828                        ::buffa::types::decode_bool(buf)?,
3829                    );
3830                }
3831                _ => {
3832                    self.__buffa_unknown_fields
3833                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3834                }
3835            }
3836            ::core::result::Result::Ok(())
3837        }
3838        fn clear(&mut self) {
3839            self.number = ::core::option::Option::None;
3840            self.full_name = ::core::option::Option::None;
3841            self.r#type = ::core::option::Option::None;
3842            self.reserved = ::core::option::Option::None;
3843            self.repeated = ::core::option::Option::None;
3844            self.__buffa_unknown_fields.clear();
3845        }
3846    }
3847    impl ::buffa::ExtensionSet for Declaration {
3848        const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3849        fn unknown_fields(&self) -> &::buffa::UnknownFields {
3850            &self.__buffa_unknown_fields
3851        }
3852        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3853            &mut self.__buffa_unknown_fields
3854        }
3855    }
3856    #[cfg(feature = "text")]
3857    impl ::buffa::text::TextFormat for Declaration {
3858        fn encode_text(
3859            &self,
3860            enc: &mut ::buffa::text::TextEncoder<'_>,
3861        ) -> ::core::fmt::Result {
3862            #[allow(unused_imports)]
3863            use ::buffa::Enumeration as _;
3864            if let ::core::option::Option::Some(ref __v) = self.number {
3865                enc.write_field_name("number")?;
3866                enc.write_i32(*__v)?;
3867            }
3868            if let ::core::option::Option::Some(ref __v) = self.full_name {
3869                enc.write_field_name("full_name")?;
3870                enc.write_string(__v)?;
3871            }
3872            if let ::core::option::Option::Some(ref __v) = self.r#type {
3873                enc.write_field_name("type")?;
3874                enc.write_string(__v)?;
3875            }
3876            if let ::core::option::Option::Some(ref __v) = self.reserved {
3877                enc.write_field_name("reserved")?;
3878                enc.write_bool(*__v)?;
3879            }
3880            if let ::core::option::Option::Some(ref __v) = self.repeated {
3881                enc.write_field_name("repeated")?;
3882                enc.write_bool(*__v)?;
3883            }
3884            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3885            ::core::result::Result::Ok(())
3886        }
3887        fn merge_text(
3888            &mut self,
3889            dec: &mut ::buffa::text::TextDecoder<'_>,
3890        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3891            #[allow(unused_imports)]
3892            use ::buffa::Enumeration as _;
3893            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3894                match __name {
3895                    "number" => {
3896                        self.number = ::core::option::Option::Some(dec.read_i32()?);
3897                    }
3898                    "full_name" => {
3899                        self.full_name = ::core::option::Option::Some(
3900                            dec.read_string()?.into_owned(),
3901                        );
3902                    }
3903                    "type" => {
3904                        self.r#type = ::core::option::Option::Some(
3905                            dec.read_string()?.into_owned(),
3906                        );
3907                    }
3908                    "reserved" => {
3909                        self.reserved = ::core::option::Option::Some(dec.read_bool()?);
3910                    }
3911                    "repeated" => {
3912                        self.repeated = ::core::option::Option::Some(dec.read_bool()?);
3913                    }
3914                    _ => dec.skip_value()?,
3915                }
3916            }
3917            ::core::result::Result::Ok(())
3918        }
3919    }
3920    #[cfg(feature = "json")]
3921    impl ::buffa::json_helpers::ProtoElemJson for Declaration {
3922        fn serialize_proto_json<S: ::serde::Serializer>(
3923            v: &Self,
3924            s: S,
3925        ) -> ::core::result::Result<S::Ok, S::Error> {
3926            ::serde::Serialize::serialize(v, s)
3927        }
3928        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3929            d: D,
3930        ) -> ::core::result::Result<Self, D::Error> {
3931            <Self as ::serde::Deserialize>::deserialize(d)
3932        }
3933    }
3934    #[cfg(feature = "json")]
3935    #[doc(hidden)]
3936    pub const __DECLARATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3937        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3938        to_json: ::buffa::type_registry::any_to_json::<Declaration>,
3939        from_json: ::buffa::type_registry::any_from_json::<Declaration>,
3940        is_wkt: false,
3941    };
3942    #[cfg(feature = "text")]
3943    #[doc(hidden)]
3944    pub const __DECLARATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3945        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
3946        text_encode: ::buffa::type_registry::any_encode_text::<Declaration>,
3947        text_merge: ::buffa::type_registry::any_merge_text::<Declaration>,
3948    };
3949    #[cfg(feature = "views")]
3950    #[doc(inline)]
3951    pub use super::__buffa::view::extension_range_options::DeclarationView;
3952    #[cfg(feature = "views")]
3953    #[doc(inline)]
3954    pub use super::__buffa::view::extension_range_options::DeclarationOwnedView;
3955}
3956/// Describes a field within a message.
3957#[derive(Clone, PartialEq, Default)]
3958#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3959#[cfg_attr(feature = "json", serde(default))]
3960#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3961pub struct FieldDescriptorProto {
3962    /// Field 1: `name`
3963    #[cfg_attr(
3964        feature = "json",
3965        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
3966    )]
3967    pub name: ::core::option::Option<::buffa::alloc::string::String>,
3968    /// Field 3: `number`
3969    #[cfg_attr(
3970        feature = "json",
3971        serde(
3972            rename = "number",
3973            with = "::buffa::json_helpers::opt_int32",
3974            skip_serializing_if = "::core::option::Option::is_none"
3975        )
3976    )]
3977    pub number: ::core::option::Option<i32>,
3978    /// Field 4: `label`
3979    #[cfg_attr(
3980        feature = "json",
3981        serde(
3982            rename = "label",
3983            with = "::buffa::json_helpers::opt_closed_enum",
3984            skip_serializing_if = "::core::option::Option::is_none"
3985        )
3986    )]
3987    pub label: ::core::option::Option<field_descriptor_proto::Label>,
3988    /// If type_name is set, this need not be set.  If both this and type_name
3989    /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
3990    ///
3991    /// Field 5: `type`
3992    #[cfg_attr(
3993        feature = "json",
3994        serde(
3995            rename = "type",
3996            with = "::buffa::json_helpers::opt_closed_enum",
3997            skip_serializing_if = "::core::option::Option::is_none"
3998        )
3999    )]
4000    pub r#type: ::core::option::Option<field_descriptor_proto::Type>,
4001    /// For message and enum types, this is the name of the type.  If the name
4002    /// starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
4003    /// rules are used to find the type (i.e. first the nested types within this
4004    /// message are searched, then within the parent, on up to the root
4005    /// namespace).
4006    ///
4007    /// Field 6: `type_name`
4008    #[cfg_attr(
4009        feature = "json",
4010        serde(
4011            rename = "typeName",
4012            alias = "type_name",
4013            skip_serializing_if = "::core::option::Option::is_none"
4014        )
4015    )]
4016    pub type_name: ::core::option::Option<::buffa::alloc::string::String>,
4017    /// For extensions, this is the name of the type being extended.  It is
4018    /// resolved in the same manner as type_name.
4019    ///
4020    /// Field 2: `extendee`
4021    #[cfg_attr(
4022        feature = "json",
4023        serde(
4024            rename = "extendee",
4025            skip_serializing_if = "::core::option::Option::is_none"
4026        )
4027    )]
4028    pub extendee: ::core::option::Option<::buffa::alloc::string::String>,
4029    /// For numeric types, contains the original text representation of the value.
4030    /// For booleans, "true" or "false".
4031    /// For strings, contains the default text contents (not escaped in any way).
4032    /// For bytes, contains the C escaped value.  All bytes \>= 128 are escaped.
4033    ///
4034    /// Field 7: `default_value`
4035    #[cfg_attr(
4036        feature = "json",
4037        serde(
4038            rename = "defaultValue",
4039            alias = "default_value",
4040            skip_serializing_if = "::core::option::Option::is_none"
4041        )
4042    )]
4043    pub default_value: ::core::option::Option<::buffa::alloc::string::String>,
4044    /// If set, gives the index of a oneof in the containing type's oneof_decl
4045    /// list.  This field is a member of that oneof.
4046    ///
4047    /// Field 9: `oneof_index`
4048    #[cfg_attr(
4049        feature = "json",
4050        serde(
4051            rename = "oneofIndex",
4052            alias = "oneof_index",
4053            with = "::buffa::json_helpers::opt_int32",
4054            skip_serializing_if = "::core::option::Option::is_none"
4055        )
4056    )]
4057    pub oneof_index: ::core::option::Option<i32>,
4058    /// JSON name of this field. The value is set by protocol compiler. If the
4059    /// user has set a "json_name" option on this field, that option's value
4060    /// will be used. Otherwise, it's deduced from the field's name by converting
4061    /// it to camelCase.
4062    ///
4063    /// Field 10: `json_name`
4064    #[cfg_attr(
4065        feature = "json",
4066        serde(
4067            rename = "jsonName",
4068            alias = "json_name",
4069            skip_serializing_if = "::core::option::Option::is_none"
4070        )
4071    )]
4072    pub json_name: ::core::option::Option<::buffa::alloc::string::String>,
4073    /// Field 8: `options`
4074    #[cfg_attr(
4075        feature = "json",
4076        serde(
4077            rename = "options",
4078            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4079        )
4080    )]
4081    pub options: ::buffa::MessageField<FieldOptions, ::buffa::Inline<FieldOptions>>,
4082    /// If true, this is a proto3 "optional". When a proto3 field is optional, it
4083    /// tracks presence regardless of field type.
4084    ///
4085    /// When proto3_optional is true, this field must belong to a oneof to signal
4086    /// to old proto3 clients that presence is tracked for this field. This oneof
4087    /// is known as a "synthetic" oneof, and this field must be its sole member
4088    /// (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
4089    /// exist in the descriptor only, and do not generate any API. Synthetic oneofs
4090    /// must be ordered after all "real" oneofs.
4091    ///
4092    /// For message fields, proto3_optional doesn't create any semantic change,
4093    /// since non-repeated message fields always track presence. However it still
4094    /// indicates the semantic detail of whether the user wrote "optional" or not.
4095    /// This can be useful for round-tripping the .proto file. For consistency we
4096    /// give message fields a synthetic oneof also, even though it is not required
4097    /// to track presence. This is especially important because the parser can't
4098    /// tell if a field is a message or an enum, so it must always create a
4099    /// synthetic oneof.
4100    ///
4101    /// Proto2 optional fields do not set this flag, because they already indicate
4102    /// optional with `LABEL_OPTIONAL`.
4103    ///
4104    /// Field 17: `proto3_optional`
4105    #[cfg_attr(
4106        feature = "json",
4107        serde(
4108            rename = "proto3Optional",
4109            alias = "proto3_optional",
4110            skip_serializing_if = "::core::option::Option::is_none"
4111        )
4112    )]
4113    pub proto3_optional: ::core::option::Option<bool>,
4114    #[cfg_attr(feature = "json", serde(skip))]
4115    #[doc(hidden)]
4116    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4117}
4118impl ::core::fmt::Debug for FieldDescriptorProto {
4119    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4120        f.debug_struct("FieldDescriptorProto")
4121            .field("name", &self.name)
4122            .field("number", &self.number)
4123            .field("label", &self.label)
4124            .field("type", &self.r#type)
4125            .field("type_name", &self.type_name)
4126            .field("extendee", &self.extendee)
4127            .field("default_value", &self.default_value)
4128            .field("oneof_index", &self.oneof_index)
4129            .field("json_name", &self.json_name)
4130            .field("options", &self.options)
4131            .field("proto3_optional", &self.proto3_optional)
4132            .finish()
4133    }
4134}
4135impl FieldDescriptorProto {
4136    /// Protobuf type URL for this message, for use with `Any::pack` and
4137    /// `Any::unpack_if`.
4138    ///
4139    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4140    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4141}
4142impl FieldDescriptorProto {
4143    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4144    #[inline]
4145    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
4146    pub fn with_name(
4147        mut self,
4148        value: impl Into<::buffa::alloc::string::String>,
4149    ) -> Self {
4150        self.name = Some(value.into());
4151        self
4152    }
4153    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4154    #[inline]
4155    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
4156    pub fn with_number(mut self, value: i32) -> Self {
4157        self.number = Some(value);
4158        self
4159    }
4160    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4161    #[inline]
4162    ///Sets [`Self::label`] to `Some(value)`, consuming and returning `self`.
4163    pub fn with_label(
4164        mut self,
4165        value: impl Into<field_descriptor_proto::Label>,
4166    ) -> Self {
4167        self.label = Some(value.into());
4168        self
4169    }
4170    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4171    #[inline]
4172    ///Sets `type` to `Some(value)`, consuming and returning `self`.
4173    pub fn with_type(mut self, value: impl Into<field_descriptor_proto::Type>) -> Self {
4174        self.r#type = Some(value.into());
4175        self
4176    }
4177    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4178    #[inline]
4179    ///Sets [`Self::type_name`] to `Some(value)`, consuming and returning `self`.
4180    pub fn with_type_name(
4181        mut self,
4182        value: impl Into<::buffa::alloc::string::String>,
4183    ) -> Self {
4184        self.type_name = Some(value.into());
4185        self
4186    }
4187    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4188    #[inline]
4189    ///Sets [`Self::extendee`] to `Some(value)`, consuming and returning `self`.
4190    pub fn with_extendee(
4191        mut self,
4192        value: impl Into<::buffa::alloc::string::String>,
4193    ) -> Self {
4194        self.extendee = Some(value.into());
4195        self
4196    }
4197    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4198    #[inline]
4199    ///Sets [`Self::default_value`] to `Some(value)`, consuming and returning `self`.
4200    pub fn with_default_value(
4201        mut self,
4202        value: impl Into<::buffa::alloc::string::String>,
4203    ) -> Self {
4204        self.default_value = Some(value.into());
4205        self
4206    }
4207    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4208    #[inline]
4209    ///Sets [`Self::oneof_index`] to `Some(value)`, consuming and returning `self`.
4210    pub fn with_oneof_index(mut self, value: i32) -> Self {
4211        self.oneof_index = Some(value);
4212        self
4213    }
4214    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4215    #[inline]
4216    ///Sets [`Self::json_name`] to `Some(value)`, consuming and returning `self`.
4217    pub fn with_json_name(
4218        mut self,
4219        value: impl Into<::buffa::alloc::string::String>,
4220    ) -> Self {
4221        self.json_name = Some(value.into());
4222        self
4223    }
4224    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4225    #[inline]
4226    ///Sets [`Self::proto3_optional`] to `Some(value)`, consuming and returning `self`.
4227    pub fn with_proto3_optional(mut self, value: bool) -> Self {
4228        self.proto3_optional = Some(value);
4229        self
4230    }
4231}
4232::buffa::impl_default_instance!(FieldDescriptorProto);
4233impl ::buffa::MessageName for FieldDescriptorProto {
4234    const PACKAGE: &'static str = "google.protobuf";
4235    const NAME: &'static str = "FieldDescriptorProto";
4236    const FULL_NAME: &'static str = "google.protobuf.FieldDescriptorProto";
4237    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4238}
4239impl ::buffa::Message for FieldDescriptorProto {
4240    /// Returns the total encoded size in bytes.
4241    ///
4242    /// Accumulates in `u64` (which cannot overflow for in-memory
4243    /// data) and saturates to `u32` at return, so a message whose
4244    /// encoded size exceeds the 2 GiB protobuf limit yields a value
4245    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
4246    /// points reject, never a silently wrapped size.
4247    #[allow(clippy::let_and_return)]
4248    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4249        #[allow(unused_imports)]
4250        use ::buffa::Enumeration as _;
4251        let mut size = 0u64;
4252        if let Some(ref v) = self.name {
4253            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4254        }
4255        if let Some(ref v) = self.extendee {
4256            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4257        }
4258        if let Some(v) = self.number {
4259            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
4260        }
4261        if let Some(ref v) = self.label {
4262            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
4263        }
4264        if let Some(ref v) = self.r#type {
4265            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
4266        }
4267        if let Some(ref v) = self.type_name {
4268            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4269        }
4270        if let Some(ref v) = self.default_value {
4271            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4272        }
4273        if self.options.is_set() {
4274            let __slot = __cache.reserve();
4275            let inner_size = self.options.compute_size(__cache);
4276            __cache.set(__slot, inner_size);
4277            size
4278                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
4279                    + inner_size as u64;
4280        }
4281        if let Some(v) = self.oneof_index {
4282            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
4283        }
4284        if let Some(ref v) = self.json_name {
4285            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
4286        }
4287        if self.proto3_optional.is_some() {
4288            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
4289        }
4290        size += self.__buffa_unknown_fields.encoded_len() as u64;
4291        ::buffa::saturate_size(size)
4292    }
4293    fn write_to(
4294        &self,
4295        __cache: &mut ::buffa::SizeCache,
4296        buf: &mut impl ::buffa::EncodeSink,
4297    ) {
4298        #[allow(unused_imports)]
4299        use ::buffa::Enumeration as _;
4300        if let Some(ref v) = self.name {
4301            ::buffa::types::put_string_field(1u32, v, buf);
4302        }
4303        if let Some(ref v) = self.extendee {
4304            ::buffa::types::put_string_field(2u32, v, buf);
4305        }
4306        if let Some(v) = self.number {
4307            ::buffa::types::put_int32_field(3u32, v, buf);
4308        }
4309        if let Some(ref v) = self.label {
4310            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
4311        }
4312        if let Some(ref v) = self.r#type {
4313            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
4314        }
4315        if let Some(ref v) = self.type_name {
4316            ::buffa::types::put_string_field(6u32, v, buf);
4317        }
4318        if let Some(ref v) = self.default_value {
4319            ::buffa::types::put_string_field(7u32, v, buf);
4320        }
4321        if self.options.is_set() {
4322            ::buffa::types::put_len_delimited_header(
4323                8u32,
4324                u64::from(__cache.consume_next()),
4325                buf,
4326            );
4327            self.options.write_to(__cache, buf);
4328        }
4329        if let Some(v) = self.oneof_index {
4330            ::buffa::types::put_int32_field(9u32, v, buf);
4331        }
4332        if let Some(ref v) = self.json_name {
4333            ::buffa::types::put_string_field(10u32, v, buf);
4334        }
4335        if let Some(v) = self.proto3_optional {
4336            ::buffa::types::put_bool_field(17u32, v, buf);
4337        }
4338        self.__buffa_unknown_fields.write_to(buf);
4339    }
4340    fn merge_field(
4341        &mut self,
4342        tag: ::buffa::encoding::Tag,
4343        buf: &mut impl ::buffa::bytes::Buf,
4344        ctx: ::buffa::DecodeContext<'_>,
4345    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4346        #[allow(unused_imports)]
4347        use ::buffa::bytes::Buf as _;
4348        #[allow(unused_imports)]
4349        use ::buffa::Enumeration as _;
4350        match tag.field_number() {
4351            1u32 => {
4352                ::buffa::encoding::check_wire_type(
4353                    tag,
4354                    ::buffa::encoding::WireType::LengthDelimited,
4355                )?;
4356                ::buffa::types::merge_string(
4357                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
4358                    buf,
4359                )?;
4360            }
4361            2u32 => {
4362                ::buffa::encoding::check_wire_type(
4363                    tag,
4364                    ::buffa::encoding::WireType::LengthDelimited,
4365                )?;
4366                ::buffa::types::merge_string(
4367                    self
4368                        .extendee
4369                        .get_or_insert_with(::buffa::alloc::string::String::new),
4370                    buf,
4371                )?;
4372            }
4373            3u32 => {
4374                ::buffa::encoding::check_wire_type(
4375                    tag,
4376                    ::buffa::encoding::WireType::Varint,
4377                )?;
4378                self.number = ::core::option::Option::Some(
4379                    ::buffa::types::decode_int32(buf)?,
4380                );
4381            }
4382            4u32 => {
4383                ::buffa::encoding::check_wire_type(
4384                    tag,
4385                    ::buffa::encoding::WireType::Varint,
4386                )?;
4387                let __raw = ::buffa::types::decode_int32(buf)?;
4388                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4389                    __raw,
4390                ) {
4391                    self.label = ::core::option::Option::Some(__v);
4392                } else {
4393                    ctx.register_unknown_field()?;
4394                    self.__buffa_unknown_fields
4395                        .push(::buffa::UnknownField {
4396                            number: 4u32,
4397                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4398                        });
4399                }
4400            }
4401            5u32 => {
4402                ::buffa::encoding::check_wire_type(
4403                    tag,
4404                    ::buffa::encoding::WireType::Varint,
4405                )?;
4406                let __raw = ::buffa::types::decode_int32(buf)?;
4407                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4408                    __raw,
4409                ) {
4410                    self.r#type = ::core::option::Option::Some(__v);
4411                } else {
4412                    ctx.register_unknown_field()?;
4413                    self.__buffa_unknown_fields
4414                        .push(::buffa::UnknownField {
4415                            number: 5u32,
4416                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4417                        });
4418                }
4419            }
4420            6u32 => {
4421                ::buffa::encoding::check_wire_type(
4422                    tag,
4423                    ::buffa::encoding::WireType::LengthDelimited,
4424                )?;
4425                ::buffa::types::merge_string(
4426                    self
4427                        .type_name
4428                        .get_or_insert_with(::buffa::alloc::string::String::new),
4429                    buf,
4430                )?;
4431            }
4432            7u32 => {
4433                ::buffa::encoding::check_wire_type(
4434                    tag,
4435                    ::buffa::encoding::WireType::LengthDelimited,
4436                )?;
4437                ::buffa::types::merge_string(
4438                    self
4439                        .default_value
4440                        .get_or_insert_with(::buffa::alloc::string::String::new),
4441                    buf,
4442                )?;
4443            }
4444            8u32 => {
4445                ::buffa::encoding::check_wire_type(
4446                    tag,
4447                    ::buffa::encoding::WireType::LengthDelimited,
4448                )?;
4449                ::buffa::Message::merge_length_delimited(
4450                    self.options.get_or_insert_default(),
4451                    buf,
4452                    ctx,
4453                )?;
4454            }
4455            9u32 => {
4456                ::buffa::encoding::check_wire_type(
4457                    tag,
4458                    ::buffa::encoding::WireType::Varint,
4459                )?;
4460                self.oneof_index = ::core::option::Option::Some(
4461                    ::buffa::types::decode_int32(buf)?,
4462                );
4463            }
4464            10u32 => {
4465                ::buffa::encoding::check_wire_type(
4466                    tag,
4467                    ::buffa::encoding::WireType::LengthDelimited,
4468                )?;
4469                ::buffa::types::merge_string(
4470                    self
4471                        .json_name
4472                        .get_or_insert_with(::buffa::alloc::string::String::new),
4473                    buf,
4474                )?;
4475            }
4476            17u32 => {
4477                ::buffa::encoding::check_wire_type(
4478                    tag,
4479                    ::buffa::encoding::WireType::Varint,
4480                )?;
4481                self.proto3_optional = ::core::option::Option::Some(
4482                    ::buffa::types::decode_bool(buf)?,
4483                );
4484            }
4485            _ => {
4486                self.__buffa_unknown_fields
4487                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4488            }
4489        }
4490        ::core::result::Result::Ok(())
4491    }
4492    fn clear(&mut self) {
4493        self.name = ::core::option::Option::None;
4494        self.extendee = ::core::option::Option::None;
4495        self.number = ::core::option::Option::None;
4496        self.label = ::core::option::Option::None;
4497        self.r#type = ::core::option::Option::None;
4498        self.type_name = ::core::option::Option::None;
4499        self.default_value = ::core::option::Option::None;
4500        self.options = ::buffa::MessageField::none();
4501        self.oneof_index = ::core::option::Option::None;
4502        self.json_name = ::core::option::Option::None;
4503        self.proto3_optional = ::core::option::Option::None;
4504        self.__buffa_unknown_fields.clear();
4505    }
4506}
4507impl ::buffa::ExtensionSet for FieldDescriptorProto {
4508    const PROTO_FQN: &'static str = "google.protobuf.FieldDescriptorProto";
4509    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4510        &self.__buffa_unknown_fields
4511    }
4512    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4513        &mut self.__buffa_unknown_fields
4514    }
4515}
4516#[cfg(feature = "text")]
4517impl ::buffa::text::TextFormat for FieldDescriptorProto {
4518    fn encode_text(
4519        &self,
4520        enc: &mut ::buffa::text::TextEncoder<'_>,
4521    ) -> ::core::fmt::Result {
4522        #[allow(unused_imports)]
4523        use ::buffa::Enumeration as _;
4524        if let ::core::option::Option::Some(ref __v) = self.name {
4525            enc.write_field_name("name")?;
4526            enc.write_string(__v)?;
4527        }
4528        if let ::core::option::Option::Some(ref __v) = self.number {
4529            enc.write_field_name("number")?;
4530            enc.write_i32(*__v)?;
4531        }
4532        if let ::core::option::Option::Some(ref __v) = self.label {
4533            enc.write_field_name("label")?;
4534            enc.write_enum_name(__v.proto_name())?;
4535        }
4536        if let ::core::option::Option::Some(ref __v) = self.r#type {
4537            enc.write_field_name("type")?;
4538            enc.write_enum_name(__v.proto_name())?;
4539        }
4540        if let ::core::option::Option::Some(ref __v) = self.type_name {
4541            enc.write_field_name("type_name")?;
4542            enc.write_string(__v)?;
4543        }
4544        if let ::core::option::Option::Some(ref __v) = self.extendee {
4545            enc.write_field_name("extendee")?;
4546            enc.write_string(__v)?;
4547        }
4548        if let ::core::option::Option::Some(ref __v) = self.default_value {
4549            enc.write_field_name("default_value")?;
4550            enc.write_string(__v)?;
4551        }
4552        if let ::core::option::Option::Some(ref __v) = self.oneof_index {
4553            enc.write_field_name("oneof_index")?;
4554            enc.write_i32(*__v)?;
4555        }
4556        if let ::core::option::Option::Some(ref __v) = self.json_name {
4557            enc.write_field_name("json_name")?;
4558            enc.write_string(__v)?;
4559        }
4560        if self.options.is_set() {
4561            enc.write_field_name("options")?;
4562            enc.write_message(&*self.options)?;
4563        }
4564        if let ::core::option::Option::Some(ref __v) = self.proto3_optional {
4565            enc.write_field_name("proto3_optional")?;
4566            enc.write_bool(*__v)?;
4567        }
4568        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
4569        ::core::result::Result::Ok(())
4570    }
4571    fn merge_text(
4572        &mut self,
4573        dec: &mut ::buffa::text::TextDecoder<'_>,
4574    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
4575        #[allow(unused_imports)]
4576        use ::buffa::Enumeration as _;
4577        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
4578            match __name {
4579                "name" => {
4580                    self.name = ::core::option::Option::Some(
4581                        dec.read_string()?.into_owned(),
4582                    );
4583                }
4584                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
4585                "label" => {
4586                    self.label = ::core::option::Option::Some(
4587                        dec.read_closed_enum_by_name::<field_descriptor_proto::Label>()?,
4588                    );
4589                }
4590                "type" => {
4591                    self.r#type = ::core::option::Option::Some(
4592                        dec.read_closed_enum_by_name::<field_descriptor_proto::Type>()?,
4593                    );
4594                }
4595                "type_name" => {
4596                    self.type_name = ::core::option::Option::Some(
4597                        dec.read_string()?.into_owned(),
4598                    );
4599                }
4600                "extendee" => {
4601                    self.extendee = ::core::option::Option::Some(
4602                        dec.read_string()?.into_owned(),
4603                    );
4604                }
4605                "default_value" => {
4606                    self.default_value = ::core::option::Option::Some(
4607                        dec.read_string()?.into_owned(),
4608                    );
4609                }
4610                "oneof_index" => {
4611                    self.oneof_index = ::core::option::Option::Some(dec.read_i32()?);
4612                }
4613                "json_name" => {
4614                    self.json_name = ::core::option::Option::Some(
4615                        dec.read_string()?.into_owned(),
4616                    );
4617                }
4618                "options" => dec.merge_message(self.options.get_or_insert_default())?,
4619                "proto3_optional" => {
4620                    self.proto3_optional = ::core::option::Option::Some(dec.read_bool()?);
4621                }
4622                _ => dec.skip_value()?,
4623            }
4624        }
4625        ::core::result::Result::Ok(())
4626    }
4627}
4628#[cfg(feature = "json")]
4629impl ::buffa::json_helpers::ProtoElemJson for FieldDescriptorProto {
4630    fn serialize_proto_json<S: ::serde::Serializer>(
4631        v: &Self,
4632        s: S,
4633    ) -> ::core::result::Result<S::Ok, S::Error> {
4634        ::serde::Serialize::serialize(v, s)
4635    }
4636    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4637        d: D,
4638    ) -> ::core::result::Result<Self, D::Error> {
4639        <Self as ::serde::Deserialize>::deserialize(d)
4640    }
4641}
4642#[cfg(feature = "json")]
4643#[doc(hidden)]
4644pub const __FIELD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4645    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4646    to_json: ::buffa::type_registry::any_to_json::<FieldDescriptorProto>,
4647    from_json: ::buffa::type_registry::any_from_json::<FieldDescriptorProto>,
4648    is_wkt: false,
4649};
4650#[cfg(feature = "text")]
4651#[doc(hidden)]
4652pub const __FIELD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
4653    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4654    text_encode: ::buffa::type_registry::any_encode_text::<FieldDescriptorProto>,
4655    text_merge: ::buffa::type_registry::any_merge_text::<FieldDescriptorProto>,
4656};
4657pub mod field_descriptor_proto {
4658    #[allow(unused_imports)]
4659    use super::*;
4660    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4661    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4662    #[repr(i32)]
4663    pub enum Type {
4664        /// 0 is reserved for errors.
4665        /// Order is weird for historical reasons.
4666        TYPE_DOUBLE = 1i32,
4667        TYPE_FLOAT = 2i32,
4668        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
4669        /// negative values are likely.
4670        TYPE_INT64 = 3i32,
4671        TYPE_UINT64 = 4i32,
4672        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
4673        /// negative values are likely.
4674        TYPE_INT32 = 5i32,
4675        TYPE_FIXED64 = 6i32,
4676        TYPE_FIXED32 = 7i32,
4677        TYPE_BOOL = 8i32,
4678        TYPE_STRING = 9i32,
4679        /// Tag-delimited aggregate.
4680        /// Group type is deprecated and not supported after google.protobuf. However, Proto3
4681        /// implementations should still be able to parse the group wire format and
4682        /// treat group fields as unknown fields.  In Editions, the group wire format
4683        /// can be enabled via the `message_encoding` feature.
4684        TYPE_GROUP = 10i32,
4685        /// Length-delimited aggregate.
4686        TYPE_MESSAGE = 11i32,
4687        /// New in version 2.
4688        TYPE_BYTES = 12i32,
4689        TYPE_UINT32 = 13i32,
4690        TYPE_ENUM = 14i32,
4691        TYPE_SFIXED32 = 15i32,
4692        TYPE_SFIXED64 = 16i32,
4693        /// Uses ZigZag encoding.
4694        TYPE_SINT32 = 17i32,
4695        /// Uses ZigZag encoding.
4696        TYPE_SINT64 = 18i32,
4697    }
4698    impl Type {
4699        ///Idiomatic alias for [`Self::TYPE_DOUBLE`]; `Debug` prints the variant name.
4700        #[allow(non_upper_case_globals)]
4701        pub const Double: Self = Self::TYPE_DOUBLE;
4702        ///Idiomatic alias for [`Self::TYPE_FLOAT`]; `Debug` prints the variant name.
4703        #[allow(non_upper_case_globals)]
4704        pub const Float: Self = Self::TYPE_FLOAT;
4705        ///Idiomatic alias for [`Self::TYPE_INT64`]; `Debug` prints the variant name.
4706        #[allow(non_upper_case_globals)]
4707        pub const Int64: Self = Self::TYPE_INT64;
4708        ///Idiomatic alias for [`Self::TYPE_UINT64`]; `Debug` prints the variant name.
4709        #[allow(non_upper_case_globals)]
4710        pub const Uint64: Self = Self::TYPE_UINT64;
4711        ///Idiomatic alias for [`Self::TYPE_INT32`]; `Debug` prints the variant name.
4712        #[allow(non_upper_case_globals)]
4713        pub const Int32: Self = Self::TYPE_INT32;
4714        ///Idiomatic alias for [`Self::TYPE_FIXED64`]; `Debug` prints the variant name.
4715        #[allow(non_upper_case_globals)]
4716        pub const Fixed64: Self = Self::TYPE_FIXED64;
4717        ///Idiomatic alias for [`Self::TYPE_FIXED32`]; `Debug` prints the variant name.
4718        #[allow(non_upper_case_globals)]
4719        pub const Fixed32: Self = Self::TYPE_FIXED32;
4720        ///Idiomatic alias for [`Self::TYPE_BOOL`]; `Debug` prints the variant name.
4721        #[allow(non_upper_case_globals)]
4722        pub const Bool: Self = Self::TYPE_BOOL;
4723        ///Idiomatic alias for [`Self::TYPE_STRING`]; `Debug` prints the variant name.
4724        #[allow(non_upper_case_globals)]
4725        pub const String: Self = Self::TYPE_STRING;
4726        ///Idiomatic alias for [`Self::TYPE_GROUP`]; `Debug` prints the variant name.
4727        #[allow(non_upper_case_globals)]
4728        pub const Group: Self = Self::TYPE_GROUP;
4729        ///Idiomatic alias for [`Self::TYPE_MESSAGE`]; `Debug` prints the variant name.
4730        #[allow(non_upper_case_globals)]
4731        pub const Message: Self = Self::TYPE_MESSAGE;
4732        ///Idiomatic alias for [`Self::TYPE_BYTES`]; `Debug` prints the variant name.
4733        #[allow(non_upper_case_globals)]
4734        pub const Bytes: Self = Self::TYPE_BYTES;
4735        ///Idiomatic alias for [`Self::TYPE_UINT32`]; `Debug` prints the variant name.
4736        #[allow(non_upper_case_globals)]
4737        pub const Uint32: Self = Self::TYPE_UINT32;
4738        ///Idiomatic alias for [`Self::TYPE_ENUM`]; `Debug` prints the variant name.
4739        #[allow(non_upper_case_globals)]
4740        pub const Enum: Self = Self::TYPE_ENUM;
4741        ///Idiomatic alias for [`Self::TYPE_SFIXED32`]; `Debug` prints the variant name.
4742        #[allow(non_upper_case_globals)]
4743        pub const Sfixed32: Self = Self::TYPE_SFIXED32;
4744        ///Idiomatic alias for [`Self::TYPE_SFIXED64`]; `Debug` prints the variant name.
4745        #[allow(non_upper_case_globals)]
4746        pub const Sfixed64: Self = Self::TYPE_SFIXED64;
4747        ///Idiomatic alias for [`Self::TYPE_SINT32`]; `Debug` prints the variant name.
4748        #[allow(non_upper_case_globals)]
4749        pub const Sint32: Self = Self::TYPE_SINT32;
4750        ///Idiomatic alias for [`Self::TYPE_SINT64`]; `Debug` prints the variant name.
4751        #[allow(non_upper_case_globals)]
4752        pub const Sint64: Self = Self::TYPE_SINT64;
4753    }
4754    impl ::core::default::Default for Type {
4755        fn default() -> Self {
4756            Self::TYPE_DOUBLE
4757        }
4758    }
4759    #[cfg(feature = "json")]
4760    const _: () = {
4761        impl ::serde::Serialize for Type {
4762            fn serialize<S: ::serde::Serializer>(
4763                &self,
4764                s: S,
4765            ) -> ::core::result::Result<S::Ok, S::Error> {
4766                s.serialize_str(::buffa::Enumeration::proto_name(self))
4767            }
4768        }
4769        impl<'de> ::serde::Deserialize<'de> for Type {
4770            fn deserialize<D: ::serde::Deserializer<'de>>(
4771                d: D,
4772            ) -> ::core::result::Result<Self, D::Error> {
4773                struct _V;
4774                impl ::serde::de::Visitor<'_> for _V {
4775                    type Value = Type;
4776                    fn expecting(
4777                        &self,
4778                        f: &mut ::core::fmt::Formatter<'_>,
4779                    ) -> ::core::fmt::Result {
4780                        f.write_str(
4781                            concat!("a string, integer, or null for ", stringify!(Type)),
4782                        )
4783                    }
4784                    fn visit_str<E: ::serde::de::Error>(
4785                        self,
4786                        v: &str,
4787                    ) -> ::core::result::Result<Type, E> {
4788                        <Type as ::buffa::Enumeration>::from_proto_name(v)
4789                            .ok_or_else(|| {
4790                                ::serde::de::Error::unknown_variant(v, &[])
4791                            })
4792                    }
4793                    fn visit_i64<E: ::serde::de::Error>(
4794                        self,
4795                        v: i64,
4796                    ) -> ::core::result::Result<Type, E> {
4797                        let v32 = i32::try_from(v)
4798                            .map_err(|_| {
4799                                ::serde::de::Error::custom(
4800                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4801                                )
4802                            })?;
4803                        <Type as ::buffa::Enumeration>::from_i32(v32)
4804                            .ok_or_else(|| {
4805                                ::serde::de::Error::custom(
4806                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4807                                )
4808                            })
4809                    }
4810                    fn visit_u64<E: ::serde::de::Error>(
4811                        self,
4812                        v: u64,
4813                    ) -> ::core::result::Result<Type, E> {
4814                        let v32 = i32::try_from(v)
4815                            .map_err(|_| {
4816                                ::serde::de::Error::custom(
4817                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
4818                                )
4819                            })?;
4820                        <Type as ::buffa::Enumeration>::from_i32(v32)
4821                            .ok_or_else(|| {
4822                                ::serde::de::Error::custom(
4823                                    ::buffa::alloc::format!("unknown enum value {v32}"),
4824                                )
4825                            })
4826                    }
4827                    fn visit_unit<E: ::serde::de::Error>(
4828                        self,
4829                    ) -> ::core::result::Result<Type, E> {
4830                        ::core::result::Result::Ok(::core::default::Default::default())
4831                    }
4832                }
4833                d.deserialize_any(_V)
4834            }
4835        }
4836        impl ::buffa::json_helpers::ProtoElemJson for Type {
4837            fn serialize_proto_json<S: ::serde::Serializer>(
4838                v: &Self,
4839                s: S,
4840            ) -> ::core::result::Result<S::Ok, S::Error> {
4841                ::serde::Serialize::serialize(v, s)
4842            }
4843            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4844                d: D,
4845            ) -> ::core::result::Result<Self, D::Error> {
4846                <Self as ::serde::Deserialize>::deserialize(d)
4847            }
4848        }
4849    };
4850    impl ::buffa::Enumeration for Type {
4851        fn from_i32(value: i32) -> ::core::option::Option<Self> {
4852            match value {
4853                1i32 => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4854                2i32 => ::core::option::Option::Some(Self::TYPE_FLOAT),
4855                3i32 => ::core::option::Option::Some(Self::TYPE_INT64),
4856                4i32 => ::core::option::Option::Some(Self::TYPE_UINT64),
4857                5i32 => ::core::option::Option::Some(Self::TYPE_INT32),
4858                6i32 => ::core::option::Option::Some(Self::TYPE_FIXED64),
4859                7i32 => ::core::option::Option::Some(Self::TYPE_FIXED32),
4860                8i32 => ::core::option::Option::Some(Self::TYPE_BOOL),
4861                9i32 => ::core::option::Option::Some(Self::TYPE_STRING),
4862                10i32 => ::core::option::Option::Some(Self::TYPE_GROUP),
4863                11i32 => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4864                12i32 => ::core::option::Option::Some(Self::TYPE_BYTES),
4865                13i32 => ::core::option::Option::Some(Self::TYPE_UINT32),
4866                14i32 => ::core::option::Option::Some(Self::TYPE_ENUM),
4867                15i32 => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4868                16i32 => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4869                17i32 => ::core::option::Option::Some(Self::TYPE_SINT32),
4870                18i32 => ::core::option::Option::Some(Self::TYPE_SINT64),
4871                _ => ::core::option::Option::None,
4872            }
4873        }
4874        fn to_i32(&self) -> i32 {
4875            *self as i32
4876        }
4877        fn proto_name(&self) -> &'static str {
4878            match self {
4879                Self::TYPE_DOUBLE => "TYPE_DOUBLE",
4880                Self::TYPE_FLOAT => "TYPE_FLOAT",
4881                Self::TYPE_INT64 => "TYPE_INT64",
4882                Self::TYPE_UINT64 => "TYPE_UINT64",
4883                Self::TYPE_INT32 => "TYPE_INT32",
4884                Self::TYPE_FIXED64 => "TYPE_FIXED64",
4885                Self::TYPE_FIXED32 => "TYPE_FIXED32",
4886                Self::TYPE_BOOL => "TYPE_BOOL",
4887                Self::TYPE_STRING => "TYPE_STRING",
4888                Self::TYPE_GROUP => "TYPE_GROUP",
4889                Self::TYPE_MESSAGE => "TYPE_MESSAGE",
4890                Self::TYPE_BYTES => "TYPE_BYTES",
4891                Self::TYPE_UINT32 => "TYPE_UINT32",
4892                Self::TYPE_ENUM => "TYPE_ENUM",
4893                Self::TYPE_SFIXED32 => "TYPE_SFIXED32",
4894                Self::TYPE_SFIXED64 => "TYPE_SFIXED64",
4895                Self::TYPE_SINT32 => "TYPE_SINT32",
4896                Self::TYPE_SINT64 => "TYPE_SINT64",
4897            }
4898        }
4899        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
4900            match name {
4901                "TYPE_DOUBLE" => ::core::option::Option::Some(Self::TYPE_DOUBLE),
4902                "TYPE_FLOAT" => ::core::option::Option::Some(Self::TYPE_FLOAT),
4903                "TYPE_INT64" => ::core::option::Option::Some(Self::TYPE_INT64),
4904                "TYPE_UINT64" => ::core::option::Option::Some(Self::TYPE_UINT64),
4905                "TYPE_INT32" => ::core::option::Option::Some(Self::TYPE_INT32),
4906                "TYPE_FIXED64" => ::core::option::Option::Some(Self::TYPE_FIXED64),
4907                "TYPE_FIXED32" => ::core::option::Option::Some(Self::TYPE_FIXED32),
4908                "TYPE_BOOL" => ::core::option::Option::Some(Self::TYPE_BOOL),
4909                "TYPE_STRING" => ::core::option::Option::Some(Self::TYPE_STRING),
4910                "TYPE_GROUP" => ::core::option::Option::Some(Self::TYPE_GROUP),
4911                "TYPE_MESSAGE" => ::core::option::Option::Some(Self::TYPE_MESSAGE),
4912                "TYPE_BYTES" => ::core::option::Option::Some(Self::TYPE_BYTES),
4913                "TYPE_UINT32" => ::core::option::Option::Some(Self::TYPE_UINT32),
4914                "TYPE_ENUM" => ::core::option::Option::Some(Self::TYPE_ENUM),
4915                "TYPE_SFIXED32" => ::core::option::Option::Some(Self::TYPE_SFIXED32),
4916                "TYPE_SFIXED64" => ::core::option::Option::Some(Self::TYPE_SFIXED64),
4917                "TYPE_SINT32" => ::core::option::Option::Some(Self::TYPE_SINT32),
4918                "TYPE_SINT64" => ::core::option::Option::Some(Self::TYPE_SINT64),
4919                _ => ::core::option::Option::None,
4920            }
4921        }
4922        fn values() -> &'static [Self] {
4923            &[
4924                Self::TYPE_DOUBLE,
4925                Self::TYPE_FLOAT,
4926                Self::TYPE_INT64,
4927                Self::TYPE_UINT64,
4928                Self::TYPE_INT32,
4929                Self::TYPE_FIXED64,
4930                Self::TYPE_FIXED32,
4931                Self::TYPE_BOOL,
4932                Self::TYPE_STRING,
4933                Self::TYPE_GROUP,
4934                Self::TYPE_MESSAGE,
4935                Self::TYPE_BYTES,
4936                Self::TYPE_UINT32,
4937                Self::TYPE_ENUM,
4938                Self::TYPE_SFIXED32,
4939                Self::TYPE_SFIXED64,
4940                Self::TYPE_SINT32,
4941                Self::TYPE_SINT64,
4942            ]
4943        }
4944    }
4945    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4946    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4947    #[repr(i32)]
4948    pub enum Label {
4949        /// 0 is reserved for errors
4950        LABEL_OPTIONAL = 1i32,
4951        LABEL_REPEATED = 3i32,
4952        /// The required label is only allowed in google.protobuf.  In proto3 and Editions
4953        /// it's explicitly prohibited.  In Editions, the `field_presence` feature
4954        /// can be used to get this behavior.
4955        LABEL_REQUIRED = 2i32,
4956    }
4957    impl Label {
4958        ///Idiomatic alias for [`Self::LABEL_OPTIONAL`]; `Debug` prints the variant name.
4959        #[allow(non_upper_case_globals)]
4960        pub const Optional: Self = Self::LABEL_OPTIONAL;
4961        ///Idiomatic alias for [`Self::LABEL_REPEATED`]; `Debug` prints the variant name.
4962        #[allow(non_upper_case_globals)]
4963        pub const Repeated: Self = Self::LABEL_REPEATED;
4964        ///Idiomatic alias for [`Self::LABEL_REQUIRED`]; `Debug` prints the variant name.
4965        #[allow(non_upper_case_globals)]
4966        pub const Required: Self = Self::LABEL_REQUIRED;
4967    }
4968    impl ::core::default::Default for Label {
4969        fn default() -> Self {
4970            Self::LABEL_OPTIONAL
4971        }
4972    }
4973    #[cfg(feature = "json")]
4974    const _: () = {
4975        impl ::serde::Serialize for Label {
4976            fn serialize<S: ::serde::Serializer>(
4977                &self,
4978                s: S,
4979            ) -> ::core::result::Result<S::Ok, S::Error> {
4980                s.serialize_str(::buffa::Enumeration::proto_name(self))
4981            }
4982        }
4983        impl<'de> ::serde::Deserialize<'de> for Label {
4984            fn deserialize<D: ::serde::Deserializer<'de>>(
4985                d: D,
4986            ) -> ::core::result::Result<Self, D::Error> {
4987                struct _V;
4988                impl ::serde::de::Visitor<'_> for _V {
4989                    type Value = Label;
4990                    fn expecting(
4991                        &self,
4992                        f: &mut ::core::fmt::Formatter<'_>,
4993                    ) -> ::core::fmt::Result {
4994                        f.write_str(
4995                            concat!("a string, integer, or null for ", stringify!(Label)),
4996                        )
4997                    }
4998                    fn visit_str<E: ::serde::de::Error>(
4999                        self,
5000                        v: &str,
5001                    ) -> ::core::result::Result<Label, E> {
5002                        <Label as ::buffa::Enumeration>::from_proto_name(v)
5003                            .ok_or_else(|| {
5004                                ::serde::de::Error::unknown_variant(v, &[])
5005                            })
5006                    }
5007                    fn visit_i64<E: ::serde::de::Error>(
5008                        self,
5009                        v: i64,
5010                    ) -> ::core::result::Result<Label, E> {
5011                        let v32 = i32::try_from(v)
5012                            .map_err(|_| {
5013                                ::serde::de::Error::custom(
5014                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5015                                )
5016                            })?;
5017                        <Label as ::buffa::Enumeration>::from_i32(v32)
5018                            .ok_or_else(|| {
5019                                ::serde::de::Error::custom(
5020                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5021                                )
5022                            })
5023                    }
5024                    fn visit_u64<E: ::serde::de::Error>(
5025                        self,
5026                        v: u64,
5027                    ) -> ::core::result::Result<Label, E> {
5028                        let v32 = i32::try_from(v)
5029                            .map_err(|_| {
5030                                ::serde::de::Error::custom(
5031                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5032                                )
5033                            })?;
5034                        <Label as ::buffa::Enumeration>::from_i32(v32)
5035                            .ok_or_else(|| {
5036                                ::serde::de::Error::custom(
5037                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5038                                )
5039                            })
5040                    }
5041                    fn visit_unit<E: ::serde::de::Error>(
5042                        self,
5043                    ) -> ::core::result::Result<Label, E> {
5044                        ::core::result::Result::Ok(::core::default::Default::default())
5045                    }
5046                }
5047                d.deserialize_any(_V)
5048            }
5049        }
5050        impl ::buffa::json_helpers::ProtoElemJson for Label {
5051            fn serialize_proto_json<S: ::serde::Serializer>(
5052                v: &Self,
5053                s: S,
5054            ) -> ::core::result::Result<S::Ok, S::Error> {
5055                ::serde::Serialize::serialize(v, s)
5056            }
5057            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5058                d: D,
5059            ) -> ::core::result::Result<Self, D::Error> {
5060                <Self as ::serde::Deserialize>::deserialize(d)
5061            }
5062        }
5063    };
5064    impl ::buffa::Enumeration for Label {
5065        fn from_i32(value: i32) -> ::core::option::Option<Self> {
5066            match value {
5067                1i32 => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5068                3i32 => ::core::option::Option::Some(Self::LABEL_REPEATED),
5069                2i32 => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5070                _ => ::core::option::Option::None,
5071            }
5072        }
5073        fn to_i32(&self) -> i32 {
5074            *self as i32
5075        }
5076        fn proto_name(&self) -> &'static str {
5077            match self {
5078                Self::LABEL_OPTIONAL => "LABEL_OPTIONAL",
5079                Self::LABEL_REPEATED => "LABEL_REPEATED",
5080                Self::LABEL_REQUIRED => "LABEL_REQUIRED",
5081            }
5082        }
5083        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
5084            match name {
5085                "LABEL_OPTIONAL" => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5086                "LABEL_REPEATED" => ::core::option::Option::Some(Self::LABEL_REPEATED),
5087                "LABEL_REQUIRED" => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5088                _ => ::core::option::Option::None,
5089            }
5090        }
5091        fn values() -> &'static [Self] {
5092            &[Self::LABEL_OPTIONAL, Self::LABEL_REPEATED, Self::LABEL_REQUIRED]
5093        }
5094    }
5095}
5096/// Describes a oneof.
5097#[derive(Clone, PartialEq, Default)]
5098#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5099#[cfg_attr(feature = "json", serde(default))]
5100#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5101pub struct OneofDescriptorProto {
5102    /// Field 1: `name`
5103    #[cfg_attr(
5104        feature = "json",
5105        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5106    )]
5107    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5108    /// Field 2: `options`
5109    #[cfg_attr(
5110        feature = "json",
5111        serde(
5112            rename = "options",
5113            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5114        )
5115    )]
5116    pub options: ::buffa::MessageField<OneofOptions, ::buffa::Inline<OneofOptions>>,
5117    #[cfg_attr(feature = "json", serde(skip))]
5118    #[doc(hidden)]
5119    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5120}
5121impl ::core::fmt::Debug for OneofDescriptorProto {
5122    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5123        f.debug_struct("OneofDescriptorProto")
5124            .field("name", &self.name)
5125            .field("options", &self.options)
5126            .finish()
5127    }
5128}
5129impl OneofDescriptorProto {
5130    /// Protobuf type URL for this message, for use with `Any::pack` and
5131    /// `Any::unpack_if`.
5132    ///
5133    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5134    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5135}
5136impl OneofDescriptorProto {
5137    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5138    #[inline]
5139    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5140    pub fn with_name(
5141        mut self,
5142        value: impl Into<::buffa::alloc::string::String>,
5143    ) -> Self {
5144        self.name = Some(value.into());
5145        self
5146    }
5147}
5148::buffa::impl_default_instance!(OneofDescriptorProto);
5149impl ::buffa::MessageName for OneofDescriptorProto {
5150    const PACKAGE: &'static str = "google.protobuf";
5151    const NAME: &'static str = "OneofDescriptorProto";
5152    const FULL_NAME: &'static str = "google.protobuf.OneofDescriptorProto";
5153    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5154}
5155impl ::buffa::Message for OneofDescriptorProto {
5156    /// Returns the total encoded size in bytes.
5157    ///
5158    /// Accumulates in `u64` (which cannot overflow for in-memory
5159    /// data) and saturates to `u32` at return, so a message whose
5160    /// encoded size exceeds the 2 GiB protobuf limit yields a value
5161    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5162    /// points reject, never a silently wrapped size.
5163    #[allow(clippy::let_and_return)]
5164    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5165        #[allow(unused_imports)]
5166        use ::buffa::Enumeration as _;
5167        let mut size = 0u64;
5168        if let Some(ref v) = self.name {
5169            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5170        }
5171        if self.options.is_set() {
5172            let __slot = __cache.reserve();
5173            let inner_size = self.options.compute_size(__cache);
5174            __cache.set(__slot, inner_size);
5175            size
5176                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5177                    + inner_size as u64;
5178        }
5179        size += self.__buffa_unknown_fields.encoded_len() as u64;
5180        ::buffa::saturate_size(size)
5181    }
5182    fn write_to(
5183        &self,
5184        __cache: &mut ::buffa::SizeCache,
5185        buf: &mut impl ::buffa::EncodeSink,
5186    ) {
5187        #[allow(unused_imports)]
5188        use ::buffa::Enumeration as _;
5189        if let Some(ref v) = self.name {
5190            ::buffa::types::put_string_field(1u32, v, buf);
5191        }
5192        if self.options.is_set() {
5193            ::buffa::types::put_len_delimited_header(
5194                2u32,
5195                u64::from(__cache.consume_next()),
5196                buf,
5197            );
5198            self.options.write_to(__cache, buf);
5199        }
5200        self.__buffa_unknown_fields.write_to(buf);
5201    }
5202    fn merge_field(
5203        &mut self,
5204        tag: ::buffa::encoding::Tag,
5205        buf: &mut impl ::buffa::bytes::Buf,
5206        ctx: ::buffa::DecodeContext<'_>,
5207    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5208        #[allow(unused_imports)]
5209        use ::buffa::bytes::Buf as _;
5210        #[allow(unused_imports)]
5211        use ::buffa::Enumeration as _;
5212        match tag.field_number() {
5213            1u32 => {
5214                ::buffa::encoding::check_wire_type(
5215                    tag,
5216                    ::buffa::encoding::WireType::LengthDelimited,
5217                )?;
5218                ::buffa::types::merge_string(
5219                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5220                    buf,
5221                )?;
5222            }
5223            2u32 => {
5224                ::buffa::encoding::check_wire_type(
5225                    tag,
5226                    ::buffa::encoding::WireType::LengthDelimited,
5227                )?;
5228                ::buffa::Message::merge_length_delimited(
5229                    self.options.get_or_insert_default(),
5230                    buf,
5231                    ctx,
5232                )?;
5233            }
5234            _ => {
5235                self.__buffa_unknown_fields
5236                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5237            }
5238        }
5239        ::core::result::Result::Ok(())
5240    }
5241    fn clear(&mut self) {
5242        self.name = ::core::option::Option::None;
5243        self.options = ::buffa::MessageField::none();
5244        self.__buffa_unknown_fields.clear();
5245    }
5246}
5247impl ::buffa::ExtensionSet for OneofDescriptorProto {
5248    const PROTO_FQN: &'static str = "google.protobuf.OneofDescriptorProto";
5249    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5250        &self.__buffa_unknown_fields
5251    }
5252    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5253        &mut self.__buffa_unknown_fields
5254    }
5255}
5256#[cfg(feature = "text")]
5257impl ::buffa::text::TextFormat for OneofDescriptorProto {
5258    fn encode_text(
5259        &self,
5260        enc: &mut ::buffa::text::TextEncoder<'_>,
5261    ) -> ::core::fmt::Result {
5262        #[allow(unused_imports)]
5263        use ::buffa::Enumeration as _;
5264        if let ::core::option::Option::Some(ref __v) = self.name {
5265            enc.write_field_name("name")?;
5266            enc.write_string(__v)?;
5267        }
5268        if self.options.is_set() {
5269            enc.write_field_name("options")?;
5270            enc.write_message(&*self.options)?;
5271        }
5272        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5273        ::core::result::Result::Ok(())
5274    }
5275    fn merge_text(
5276        &mut self,
5277        dec: &mut ::buffa::text::TextDecoder<'_>,
5278    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5279        #[allow(unused_imports)]
5280        use ::buffa::Enumeration as _;
5281        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5282            match __name {
5283                "name" => {
5284                    self.name = ::core::option::Option::Some(
5285                        dec.read_string()?.into_owned(),
5286                    );
5287                }
5288                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5289                _ => dec.skip_value()?,
5290            }
5291        }
5292        ::core::result::Result::Ok(())
5293    }
5294}
5295#[cfg(feature = "json")]
5296impl ::buffa::json_helpers::ProtoElemJson for OneofDescriptorProto {
5297    fn serialize_proto_json<S: ::serde::Serializer>(
5298        v: &Self,
5299        s: S,
5300    ) -> ::core::result::Result<S::Ok, S::Error> {
5301        ::serde::Serialize::serialize(v, s)
5302    }
5303    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5304        d: D,
5305    ) -> ::core::result::Result<Self, D::Error> {
5306        <Self as ::serde::Deserialize>::deserialize(d)
5307    }
5308}
5309#[cfg(feature = "json")]
5310#[doc(hidden)]
5311pub const __ONEOF_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5312    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5313    to_json: ::buffa::type_registry::any_to_json::<OneofDescriptorProto>,
5314    from_json: ::buffa::type_registry::any_from_json::<OneofDescriptorProto>,
5315    is_wkt: false,
5316};
5317#[cfg(feature = "text")]
5318#[doc(hidden)]
5319pub const __ONEOF_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5320    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5321    text_encode: ::buffa::type_registry::any_encode_text::<OneofDescriptorProto>,
5322    text_merge: ::buffa::type_registry::any_merge_text::<OneofDescriptorProto>,
5323};
5324/// Describes an enum type.
5325#[derive(Clone, PartialEq, Default)]
5326#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5327#[cfg_attr(feature = "json", serde(default))]
5328#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5329pub struct EnumDescriptorProto {
5330    /// Field 1: `name`
5331    #[cfg_attr(
5332        feature = "json",
5333        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5334    )]
5335    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5336    /// Field 2: `value`
5337    #[cfg_attr(
5338        feature = "json",
5339        serde(
5340            rename = "value",
5341            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5342            deserialize_with = "::buffa::json_helpers::null_as_default"
5343        )
5344    )]
5345    pub value: ::buffa::alloc::vec::Vec<EnumValueDescriptorProto>,
5346    /// Field 3: `options`
5347    #[cfg_attr(
5348        feature = "json",
5349        serde(
5350            rename = "options",
5351            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5352        )
5353    )]
5354    pub options: ::buffa::MessageField<EnumOptions, ::buffa::Inline<EnumOptions>>,
5355    /// Range of reserved numeric values. Reserved numeric values may not be used
5356    /// by enum values in the same enum declaration. Reserved ranges may not
5357    /// overlap.
5358    ///
5359    /// Field 4: `reserved_range`
5360    #[cfg_attr(
5361        feature = "json",
5362        serde(
5363            rename = "reservedRange",
5364            alias = "reserved_range",
5365            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5366            deserialize_with = "::buffa::json_helpers::null_as_default"
5367        )
5368    )]
5369    pub reserved_range: ::buffa::alloc::vec::Vec<
5370        enum_descriptor_proto::EnumReservedRange,
5371    >,
5372    /// Reserved enum value names, which may not be reused. A given name may only
5373    /// be reserved once.
5374    ///
5375    /// Field 5: `reserved_name`
5376    #[cfg_attr(
5377        feature = "json",
5378        serde(
5379            rename = "reservedName",
5380            alias = "reserved_name",
5381            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5382            deserialize_with = "::buffa::json_helpers::null_as_default"
5383        )
5384    )]
5385    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
5386    /// Support for `export` and `local` keywords on enums.
5387    ///
5388    /// Field 6: `visibility`
5389    #[cfg_attr(
5390        feature = "json",
5391        serde(
5392            rename = "visibility",
5393            with = "::buffa::json_helpers::opt_closed_enum",
5394            skip_serializing_if = "::core::option::Option::is_none"
5395        )
5396    )]
5397    pub visibility: ::core::option::Option<SymbolVisibility>,
5398    #[cfg_attr(feature = "json", serde(skip))]
5399    #[doc(hidden)]
5400    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5401}
5402impl ::core::fmt::Debug for EnumDescriptorProto {
5403    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5404        f.debug_struct("EnumDescriptorProto")
5405            .field("name", &self.name)
5406            .field("value", &self.value)
5407            .field("options", &self.options)
5408            .field("reserved_range", &self.reserved_range)
5409            .field("reserved_name", &self.reserved_name)
5410            .field("visibility", &self.visibility)
5411            .finish()
5412    }
5413}
5414impl EnumDescriptorProto {
5415    /// Protobuf type URL for this message, for use with `Any::pack` and
5416    /// `Any::unpack_if`.
5417    ///
5418    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5419    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5420}
5421impl EnumDescriptorProto {
5422    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5423    #[inline]
5424    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5425    pub fn with_name(
5426        mut self,
5427        value: impl Into<::buffa::alloc::string::String>,
5428    ) -> Self {
5429        self.name = Some(value.into());
5430        self
5431    }
5432    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5433    #[inline]
5434    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
5435    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
5436        self.visibility = Some(value.into());
5437        self
5438    }
5439}
5440::buffa::impl_default_instance!(EnumDescriptorProto);
5441impl ::buffa::MessageName for EnumDescriptorProto {
5442    const PACKAGE: &'static str = "google.protobuf";
5443    const NAME: &'static str = "EnumDescriptorProto";
5444    const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto";
5445    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5446}
5447impl ::buffa::Message for EnumDescriptorProto {
5448    /// Returns the total encoded size in bytes.
5449    ///
5450    /// Accumulates in `u64` (which cannot overflow for in-memory
5451    /// data) and saturates to `u32` at return, so a message whose
5452    /// encoded size exceeds the 2 GiB protobuf limit yields a value
5453    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5454    /// points reject, never a silently wrapped size.
5455    #[allow(clippy::let_and_return)]
5456    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5457        #[allow(unused_imports)]
5458        use ::buffa::Enumeration as _;
5459        let mut size = 0u64;
5460        if let Some(ref v) = self.name {
5461            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5462        }
5463        for v in &self.value {
5464            let __slot = __cache.reserve();
5465            let inner_size = v.compute_size(__cache);
5466            __cache.set(__slot, inner_size);
5467            size
5468                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5469                    + inner_size as u64;
5470        }
5471        if self.options.is_set() {
5472            let __slot = __cache.reserve();
5473            let inner_size = self.options.compute_size(__cache);
5474            __cache.set(__slot, inner_size);
5475            size
5476                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5477                    + inner_size as u64;
5478        }
5479        for v in &self.reserved_range {
5480            let __slot = __cache.reserve();
5481            let inner_size = v.compute_size(__cache);
5482            __cache.set(__slot, inner_size);
5483            size
5484                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
5485                    + inner_size as u64;
5486        }
5487        for v in &self.reserved_name {
5488            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
5489        }
5490        if let Some(ref v) = self.visibility {
5491            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
5492        }
5493        size += self.__buffa_unknown_fields.encoded_len() as u64;
5494        ::buffa::saturate_size(size)
5495    }
5496    fn write_to(
5497        &self,
5498        __cache: &mut ::buffa::SizeCache,
5499        buf: &mut impl ::buffa::EncodeSink,
5500    ) {
5501        #[allow(unused_imports)]
5502        use ::buffa::Enumeration as _;
5503        if let Some(ref v) = self.name {
5504            ::buffa::types::put_string_field(1u32, v, buf);
5505        }
5506        for v in &self.value {
5507            ::buffa::types::put_len_delimited_header(
5508                2u32,
5509                u64::from(__cache.consume_next()),
5510                buf,
5511            );
5512            v.write_to(__cache, buf);
5513        }
5514        if self.options.is_set() {
5515            ::buffa::types::put_len_delimited_header(
5516                3u32,
5517                u64::from(__cache.consume_next()),
5518                buf,
5519            );
5520            self.options.write_to(__cache, buf);
5521        }
5522        for v in &self.reserved_range {
5523            ::buffa::types::put_len_delimited_header(
5524                4u32,
5525                u64::from(__cache.consume_next()),
5526                buf,
5527            );
5528            v.write_to(__cache, buf);
5529        }
5530        for v in &self.reserved_name {
5531            ::buffa::types::put_string_field(5u32, v, buf);
5532        }
5533        if let Some(ref v) = self.visibility {
5534            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
5535        }
5536        self.__buffa_unknown_fields.write_to(buf);
5537    }
5538    fn merge_field(
5539        &mut self,
5540        tag: ::buffa::encoding::Tag,
5541        buf: &mut impl ::buffa::bytes::Buf,
5542        ctx: ::buffa::DecodeContext<'_>,
5543    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5544        #[allow(unused_imports)]
5545        use ::buffa::bytes::Buf as _;
5546        #[allow(unused_imports)]
5547        use ::buffa::Enumeration as _;
5548        match tag.field_number() {
5549            1u32 => {
5550                ::buffa::encoding::check_wire_type(
5551                    tag,
5552                    ::buffa::encoding::WireType::LengthDelimited,
5553                )?;
5554                ::buffa::types::merge_string(
5555                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5556                    buf,
5557                )?;
5558            }
5559            2u32 => {
5560                ::buffa::encoding::check_wire_type(
5561                    tag,
5562                    ::buffa::encoding::WireType::LengthDelimited,
5563                )?;
5564                let mut elem = ::core::default::Default::default();
5565                ctx.register_element_memory(
5566                    ::buffa::__private::element_footprint(&elem),
5567                )?;
5568                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5569                self.value.push(elem);
5570            }
5571            3u32 => {
5572                ::buffa::encoding::check_wire_type(
5573                    tag,
5574                    ::buffa::encoding::WireType::LengthDelimited,
5575                )?;
5576                ::buffa::Message::merge_length_delimited(
5577                    self.options.get_or_insert_default(),
5578                    buf,
5579                    ctx,
5580                )?;
5581            }
5582            4u32 => {
5583                ::buffa::encoding::check_wire_type(
5584                    tag,
5585                    ::buffa::encoding::WireType::LengthDelimited,
5586                )?;
5587                let mut elem = ::core::default::Default::default();
5588                ctx.register_element_memory(
5589                    ::buffa::__private::element_footprint(&elem),
5590                )?;
5591                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
5592                self.reserved_range.push(elem);
5593            }
5594            5u32 => {
5595                ::buffa::encoding::check_wire_type(
5596                    tag,
5597                    ::buffa::encoding::WireType::LengthDelimited,
5598                )?;
5599                let __elem = ::buffa::types::decode_string(buf)?;
5600                ctx.register_element_memory(
5601                    ::buffa::__private::element_footprint(&__elem),
5602                )?;
5603                self.reserved_name.push(__elem);
5604            }
5605            6u32 => {
5606                ::buffa::encoding::check_wire_type(
5607                    tag,
5608                    ::buffa::encoding::WireType::Varint,
5609                )?;
5610                let __raw = ::buffa::types::decode_int32(buf)?;
5611                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
5612                    __raw,
5613                ) {
5614                    self.visibility = ::core::option::Option::Some(__v);
5615                } else {
5616                    ctx.register_unknown_field()?;
5617                    self.__buffa_unknown_fields
5618                        .push(::buffa::UnknownField {
5619                            number: 6u32,
5620                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
5621                        });
5622                }
5623            }
5624            _ => {
5625                self.__buffa_unknown_fields
5626                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5627            }
5628        }
5629        ::core::result::Result::Ok(())
5630    }
5631    fn clear(&mut self) {
5632        self.name = ::core::option::Option::None;
5633        self.value.clear();
5634        self.options = ::buffa::MessageField::none();
5635        self.reserved_range.clear();
5636        self.reserved_name.clear();
5637        self.visibility = ::core::option::Option::None;
5638        self.__buffa_unknown_fields.clear();
5639    }
5640}
5641impl ::buffa::ExtensionSet for EnumDescriptorProto {
5642    const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto";
5643    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5644        &self.__buffa_unknown_fields
5645    }
5646    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5647        &mut self.__buffa_unknown_fields
5648    }
5649}
5650#[cfg(feature = "text")]
5651impl ::buffa::text::TextFormat for EnumDescriptorProto {
5652    fn encode_text(
5653        &self,
5654        enc: &mut ::buffa::text::TextEncoder<'_>,
5655    ) -> ::core::fmt::Result {
5656        #[allow(unused_imports)]
5657        use ::buffa::Enumeration as _;
5658        if let ::core::option::Option::Some(ref __v) = self.name {
5659            enc.write_field_name("name")?;
5660            enc.write_string(__v)?;
5661        }
5662        if self.options.is_set() {
5663            enc.write_field_name("options")?;
5664            enc.write_message(&*self.options)?;
5665        }
5666        if let ::core::option::Option::Some(ref __v) = self.visibility {
5667            enc.write_field_name("visibility")?;
5668            enc.write_enum_name(__v.proto_name())?;
5669        }
5670        for __v in &self.value {
5671            enc.write_field_name("value")?;
5672            enc.write_message(__v)?;
5673        }
5674        for __v in &self.reserved_range {
5675            enc.write_field_name("reserved_range")?;
5676            enc.write_message(__v)?;
5677        }
5678        for __v in &self.reserved_name {
5679            enc.write_field_name("reserved_name")?;
5680            enc.write_string(__v)?;
5681        }
5682        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5683        ::core::result::Result::Ok(())
5684    }
5685    fn merge_text(
5686        &mut self,
5687        dec: &mut ::buffa::text::TextDecoder<'_>,
5688    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5689        #[allow(unused_imports)]
5690        use ::buffa::Enumeration as _;
5691        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5692            match __name {
5693                "name" => {
5694                    self.name = ::core::option::Option::Some(
5695                        dec.read_string()?.into_owned(),
5696                    );
5697                }
5698                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5699                "visibility" => {
5700                    self.visibility = ::core::option::Option::Some(
5701                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
5702                    );
5703                }
5704                "value" => {
5705                    dec.read_repeated_into(
5706                        &mut self.value,
5707                        |__d| {
5708                            let mut __m = ::core::default::Default::default();
5709                            __d.merge_message(&mut __m)?;
5710                            ::core::result::Result::Ok(__m)
5711                        },
5712                    )?
5713                }
5714                "reserved_range" => {
5715                    dec.read_repeated_into(
5716                        &mut self.reserved_range,
5717                        |__d| {
5718                            let mut __m = ::core::default::Default::default();
5719                            __d.merge_message(&mut __m)?;
5720                            ::core::result::Result::Ok(__m)
5721                        },
5722                    )?
5723                }
5724                "reserved_name" => {
5725                    dec.read_repeated_into(
5726                        &mut self.reserved_name,
5727                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
5728                    )?
5729                }
5730                _ => dec.skip_value()?,
5731            }
5732        }
5733        ::core::result::Result::Ok(())
5734    }
5735}
5736#[cfg(feature = "json")]
5737impl ::buffa::json_helpers::ProtoElemJson for EnumDescriptorProto {
5738    fn serialize_proto_json<S: ::serde::Serializer>(
5739        v: &Self,
5740        s: S,
5741    ) -> ::core::result::Result<S::Ok, S::Error> {
5742        ::serde::Serialize::serialize(v, s)
5743    }
5744    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5745        d: D,
5746    ) -> ::core::result::Result<Self, D::Error> {
5747        <Self as ::serde::Deserialize>::deserialize(d)
5748    }
5749}
5750#[cfg(feature = "json")]
5751#[doc(hidden)]
5752pub const __ENUM_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5753    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5754    to_json: ::buffa::type_registry::any_to_json::<EnumDescriptorProto>,
5755    from_json: ::buffa::type_registry::any_from_json::<EnumDescriptorProto>,
5756    is_wkt: false,
5757};
5758#[cfg(feature = "text")]
5759#[doc(hidden)]
5760pub const __ENUM_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5761    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5762    text_encode: ::buffa::type_registry::any_encode_text::<EnumDescriptorProto>,
5763    text_merge: ::buffa::type_registry::any_merge_text::<EnumDescriptorProto>,
5764};
5765pub mod enum_descriptor_proto {
5766    #[allow(unused_imports)]
5767    use super::*;
5768    /// Range of reserved numeric values. Reserved values may not be used by
5769    /// entries in the same enum. Reserved ranges may not overlap.
5770    ///
5771    /// Note that this is distinct from DescriptorProto.ReservedRange in that it
5772    /// is inclusive such that it can appropriately represent the entire int32
5773    /// domain.
5774    #[derive(Clone, PartialEq, Default)]
5775    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5776    #[cfg_attr(feature = "json", serde(default))]
5777    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5778    pub struct EnumReservedRange {
5779        /// Inclusive.
5780        ///
5781        /// Field 1: `start`
5782        #[cfg_attr(
5783            feature = "json",
5784            serde(
5785                rename = "start",
5786                with = "::buffa::json_helpers::opt_int32",
5787                skip_serializing_if = "::core::option::Option::is_none"
5788            )
5789        )]
5790        pub start: ::core::option::Option<i32>,
5791        /// Inclusive.
5792        ///
5793        /// Field 2: `end`
5794        #[cfg_attr(
5795            feature = "json",
5796            serde(
5797                rename = "end",
5798                with = "::buffa::json_helpers::opt_int32",
5799                skip_serializing_if = "::core::option::Option::is_none"
5800            )
5801        )]
5802        pub end: ::core::option::Option<i32>,
5803        #[cfg_attr(feature = "json", serde(skip))]
5804        #[doc(hidden)]
5805        pub __buffa_unknown_fields: ::buffa::UnknownFields,
5806    }
5807    impl ::core::fmt::Debug for EnumReservedRange {
5808        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5809            f.debug_struct("EnumReservedRange")
5810                .field("start", &self.start)
5811                .field("end", &self.end)
5812                .finish()
5813        }
5814    }
5815    impl EnumReservedRange {
5816        /// Protobuf type URL for this message, for use with `Any::pack` and
5817        /// `Any::unpack_if`.
5818        ///
5819        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5820        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5821    }
5822    impl EnumReservedRange {
5823        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5824        #[inline]
5825        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
5826        pub fn with_start(mut self, value: i32) -> Self {
5827            self.start = Some(value);
5828            self
5829        }
5830        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5831        #[inline]
5832        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
5833        pub fn with_end(mut self, value: i32) -> Self {
5834            self.end = Some(value);
5835            self
5836        }
5837    }
5838    ::buffa::impl_default_instance!(EnumReservedRange);
5839    impl ::buffa::MessageName for EnumReservedRange {
5840        const PACKAGE: &'static str = "google.protobuf";
5841        const NAME: &'static str = "EnumDescriptorProto.EnumReservedRange";
5842        const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5843        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
5844    }
5845    impl ::buffa::Message for EnumReservedRange {
5846        /// Returns the total encoded size in bytes.
5847        ///
5848        /// Accumulates in `u64` (which cannot overflow for in-memory
5849        /// data) and saturates to `u32` at return, so a message whose
5850        /// encoded size exceeds the 2 GiB protobuf limit yields a value
5851        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
5852        /// points reject, never a silently wrapped size.
5853        #[allow(clippy::let_and_return)]
5854        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5855            #[allow(unused_imports)]
5856            use ::buffa::Enumeration as _;
5857            let mut size = 0u64;
5858            if let Some(v) = self.start {
5859                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
5860            }
5861            if let Some(v) = self.end {
5862                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
5863            }
5864            size += self.__buffa_unknown_fields.encoded_len() as u64;
5865            ::buffa::saturate_size(size)
5866        }
5867        fn write_to(
5868            &self,
5869            _cache: &mut ::buffa::SizeCache,
5870            buf: &mut impl ::buffa::EncodeSink,
5871        ) {
5872            #[allow(unused_imports)]
5873            use ::buffa::Enumeration as _;
5874            if let Some(v) = self.start {
5875                ::buffa::types::put_int32_field(1u32, v, buf);
5876            }
5877            if let Some(v) = self.end {
5878                ::buffa::types::put_int32_field(2u32, v, buf);
5879            }
5880            self.__buffa_unknown_fields.write_to(buf);
5881        }
5882        fn merge_field(
5883            &mut self,
5884            tag: ::buffa::encoding::Tag,
5885            buf: &mut impl ::buffa::bytes::Buf,
5886            ctx: ::buffa::DecodeContext<'_>,
5887        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5888            #[allow(unused_imports)]
5889            use ::buffa::bytes::Buf as _;
5890            #[allow(unused_imports)]
5891            use ::buffa::Enumeration as _;
5892            match tag.field_number() {
5893                1u32 => {
5894                    ::buffa::encoding::check_wire_type(
5895                        tag,
5896                        ::buffa::encoding::WireType::Varint,
5897                    )?;
5898                    self.start = ::core::option::Option::Some(
5899                        ::buffa::types::decode_int32(buf)?,
5900                    );
5901                }
5902                2u32 => {
5903                    ::buffa::encoding::check_wire_type(
5904                        tag,
5905                        ::buffa::encoding::WireType::Varint,
5906                    )?;
5907                    self.end = ::core::option::Option::Some(
5908                        ::buffa::types::decode_int32(buf)?,
5909                    );
5910                }
5911                _ => {
5912                    self.__buffa_unknown_fields
5913                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5914                }
5915            }
5916            ::core::result::Result::Ok(())
5917        }
5918        fn clear(&mut self) {
5919            self.start = ::core::option::Option::None;
5920            self.end = ::core::option::Option::None;
5921            self.__buffa_unknown_fields.clear();
5922        }
5923    }
5924    impl ::buffa::ExtensionSet for EnumReservedRange {
5925        const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
5926        fn unknown_fields(&self) -> &::buffa::UnknownFields {
5927            &self.__buffa_unknown_fields
5928        }
5929        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5930            &mut self.__buffa_unknown_fields
5931        }
5932    }
5933    #[cfg(feature = "text")]
5934    impl ::buffa::text::TextFormat for EnumReservedRange {
5935        fn encode_text(
5936            &self,
5937            enc: &mut ::buffa::text::TextEncoder<'_>,
5938        ) -> ::core::fmt::Result {
5939            #[allow(unused_imports)]
5940            use ::buffa::Enumeration as _;
5941            if let ::core::option::Option::Some(ref __v) = self.start {
5942                enc.write_field_name("start")?;
5943                enc.write_i32(*__v)?;
5944            }
5945            if let ::core::option::Option::Some(ref __v) = self.end {
5946                enc.write_field_name("end")?;
5947                enc.write_i32(*__v)?;
5948            }
5949            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5950            ::core::result::Result::Ok(())
5951        }
5952        fn merge_text(
5953            &mut self,
5954            dec: &mut ::buffa::text::TextDecoder<'_>,
5955        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5956            #[allow(unused_imports)]
5957            use ::buffa::Enumeration as _;
5958            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5959                match __name {
5960                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
5961                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
5962                    _ => dec.skip_value()?,
5963                }
5964            }
5965            ::core::result::Result::Ok(())
5966        }
5967    }
5968    #[cfg(feature = "json")]
5969    impl ::buffa::json_helpers::ProtoElemJson for EnumReservedRange {
5970        fn serialize_proto_json<S: ::serde::Serializer>(
5971            v: &Self,
5972            s: S,
5973        ) -> ::core::result::Result<S::Ok, S::Error> {
5974            ::serde::Serialize::serialize(v, s)
5975        }
5976        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5977            d: D,
5978        ) -> ::core::result::Result<Self, D::Error> {
5979            <Self as ::serde::Deserialize>::deserialize(d)
5980        }
5981    }
5982    #[cfg(feature = "json")]
5983    #[doc(hidden)]
5984    pub const __ENUM_RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5985        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
5986        to_json: ::buffa::type_registry::any_to_json::<EnumReservedRange>,
5987        from_json: ::buffa::type_registry::any_from_json::<EnumReservedRange>,
5988        is_wkt: false,
5989    };
5990    #[cfg(feature = "text")]
5991    #[doc(hidden)]
5992    pub const __ENUM_RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5993        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
5994        text_encode: ::buffa::type_registry::any_encode_text::<EnumReservedRange>,
5995        text_merge: ::buffa::type_registry::any_merge_text::<EnumReservedRange>,
5996    };
5997    #[cfg(feature = "views")]
5998    #[doc(inline)]
5999    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeView;
6000    #[cfg(feature = "views")]
6001    #[doc(inline)]
6002    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeOwnedView;
6003}
6004/// Describes a value within an enum.
6005#[derive(Clone, PartialEq, Default)]
6006#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6007#[cfg_attr(feature = "json", serde(default))]
6008#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6009pub struct EnumValueDescriptorProto {
6010    /// Field 1: `name`
6011    #[cfg_attr(
6012        feature = "json",
6013        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6014    )]
6015    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6016    /// Field 2: `number`
6017    #[cfg_attr(
6018        feature = "json",
6019        serde(
6020            rename = "number",
6021            with = "::buffa::json_helpers::opt_int32",
6022            skip_serializing_if = "::core::option::Option::is_none"
6023        )
6024    )]
6025    pub number: ::core::option::Option<i32>,
6026    /// Field 3: `options`
6027    #[cfg_attr(
6028        feature = "json",
6029        serde(
6030            rename = "options",
6031            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6032        )
6033    )]
6034    pub options: ::buffa::MessageField<
6035        EnumValueOptions,
6036        ::buffa::Inline<EnumValueOptions>,
6037    >,
6038    #[cfg_attr(feature = "json", serde(skip))]
6039    #[doc(hidden)]
6040    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6041}
6042impl ::core::fmt::Debug for EnumValueDescriptorProto {
6043    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6044        f.debug_struct("EnumValueDescriptorProto")
6045            .field("name", &self.name)
6046            .field("number", &self.number)
6047            .field("options", &self.options)
6048            .finish()
6049    }
6050}
6051impl EnumValueDescriptorProto {
6052    /// Protobuf type URL for this message, for use with `Any::pack` and
6053    /// `Any::unpack_if`.
6054    ///
6055    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6056    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6057}
6058impl EnumValueDescriptorProto {
6059    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6060    #[inline]
6061    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6062    pub fn with_name(
6063        mut self,
6064        value: impl Into<::buffa::alloc::string::String>,
6065    ) -> Self {
6066        self.name = Some(value.into());
6067        self
6068    }
6069    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6070    #[inline]
6071    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
6072    pub fn with_number(mut self, value: i32) -> Self {
6073        self.number = Some(value);
6074        self
6075    }
6076}
6077::buffa::impl_default_instance!(EnumValueDescriptorProto);
6078impl ::buffa::MessageName for EnumValueDescriptorProto {
6079    const PACKAGE: &'static str = "google.protobuf";
6080    const NAME: &'static str = "EnumValueDescriptorProto";
6081    const FULL_NAME: &'static str = "google.protobuf.EnumValueDescriptorProto";
6082    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6083}
6084impl ::buffa::Message for EnumValueDescriptorProto {
6085    /// Returns the total encoded size in bytes.
6086    ///
6087    /// Accumulates in `u64` (which cannot overflow for in-memory
6088    /// data) and saturates to `u32` at return, so a message whose
6089    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6090    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6091    /// points reject, never a silently wrapped size.
6092    #[allow(clippy::let_and_return)]
6093    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6094        #[allow(unused_imports)]
6095        use ::buffa::Enumeration as _;
6096        let mut size = 0u64;
6097        if let Some(ref v) = self.name {
6098            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6099        }
6100        if let Some(v) = self.number {
6101            size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
6102        }
6103        if self.options.is_set() {
6104            let __slot = __cache.reserve();
6105            let inner_size = self.options.compute_size(__cache);
6106            __cache.set(__slot, inner_size);
6107            size
6108                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6109                    + inner_size as u64;
6110        }
6111        size += self.__buffa_unknown_fields.encoded_len() as u64;
6112        ::buffa::saturate_size(size)
6113    }
6114    fn write_to(
6115        &self,
6116        __cache: &mut ::buffa::SizeCache,
6117        buf: &mut impl ::buffa::EncodeSink,
6118    ) {
6119        #[allow(unused_imports)]
6120        use ::buffa::Enumeration as _;
6121        if let Some(ref v) = self.name {
6122            ::buffa::types::put_string_field(1u32, v, buf);
6123        }
6124        if let Some(v) = self.number {
6125            ::buffa::types::put_int32_field(2u32, v, buf);
6126        }
6127        if self.options.is_set() {
6128            ::buffa::types::put_len_delimited_header(
6129                3u32,
6130                u64::from(__cache.consume_next()),
6131                buf,
6132            );
6133            self.options.write_to(__cache, buf);
6134        }
6135        self.__buffa_unknown_fields.write_to(buf);
6136    }
6137    fn merge_field(
6138        &mut self,
6139        tag: ::buffa::encoding::Tag,
6140        buf: &mut impl ::buffa::bytes::Buf,
6141        ctx: ::buffa::DecodeContext<'_>,
6142    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6143        #[allow(unused_imports)]
6144        use ::buffa::bytes::Buf as _;
6145        #[allow(unused_imports)]
6146        use ::buffa::Enumeration as _;
6147        match tag.field_number() {
6148            1u32 => {
6149                ::buffa::encoding::check_wire_type(
6150                    tag,
6151                    ::buffa::encoding::WireType::LengthDelimited,
6152                )?;
6153                ::buffa::types::merge_string(
6154                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6155                    buf,
6156                )?;
6157            }
6158            2u32 => {
6159                ::buffa::encoding::check_wire_type(
6160                    tag,
6161                    ::buffa::encoding::WireType::Varint,
6162                )?;
6163                self.number = ::core::option::Option::Some(
6164                    ::buffa::types::decode_int32(buf)?,
6165                );
6166            }
6167            3u32 => {
6168                ::buffa::encoding::check_wire_type(
6169                    tag,
6170                    ::buffa::encoding::WireType::LengthDelimited,
6171                )?;
6172                ::buffa::Message::merge_length_delimited(
6173                    self.options.get_or_insert_default(),
6174                    buf,
6175                    ctx,
6176                )?;
6177            }
6178            _ => {
6179                self.__buffa_unknown_fields
6180                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6181            }
6182        }
6183        ::core::result::Result::Ok(())
6184    }
6185    fn clear(&mut self) {
6186        self.name = ::core::option::Option::None;
6187        self.number = ::core::option::Option::None;
6188        self.options = ::buffa::MessageField::none();
6189        self.__buffa_unknown_fields.clear();
6190    }
6191}
6192impl ::buffa::ExtensionSet for EnumValueDescriptorProto {
6193    const PROTO_FQN: &'static str = "google.protobuf.EnumValueDescriptorProto";
6194    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6195        &self.__buffa_unknown_fields
6196    }
6197    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6198        &mut self.__buffa_unknown_fields
6199    }
6200}
6201#[cfg(feature = "text")]
6202impl ::buffa::text::TextFormat for EnumValueDescriptorProto {
6203    fn encode_text(
6204        &self,
6205        enc: &mut ::buffa::text::TextEncoder<'_>,
6206    ) -> ::core::fmt::Result {
6207        #[allow(unused_imports)]
6208        use ::buffa::Enumeration as _;
6209        if let ::core::option::Option::Some(ref __v) = self.name {
6210            enc.write_field_name("name")?;
6211            enc.write_string(__v)?;
6212        }
6213        if let ::core::option::Option::Some(ref __v) = self.number {
6214            enc.write_field_name("number")?;
6215            enc.write_i32(*__v)?;
6216        }
6217        if self.options.is_set() {
6218            enc.write_field_name("options")?;
6219            enc.write_message(&*self.options)?;
6220        }
6221        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6222        ::core::result::Result::Ok(())
6223    }
6224    fn merge_text(
6225        &mut self,
6226        dec: &mut ::buffa::text::TextDecoder<'_>,
6227    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6228        #[allow(unused_imports)]
6229        use ::buffa::Enumeration as _;
6230        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6231            match __name {
6232                "name" => {
6233                    self.name = ::core::option::Option::Some(
6234                        dec.read_string()?.into_owned(),
6235                    );
6236                }
6237                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
6238                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6239                _ => dec.skip_value()?,
6240            }
6241        }
6242        ::core::result::Result::Ok(())
6243    }
6244}
6245#[cfg(feature = "json")]
6246impl ::buffa::json_helpers::ProtoElemJson for EnumValueDescriptorProto {
6247    fn serialize_proto_json<S: ::serde::Serializer>(
6248        v: &Self,
6249        s: S,
6250    ) -> ::core::result::Result<S::Ok, S::Error> {
6251        ::serde::Serialize::serialize(v, s)
6252    }
6253    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6254        d: D,
6255    ) -> ::core::result::Result<Self, D::Error> {
6256        <Self as ::serde::Deserialize>::deserialize(d)
6257    }
6258}
6259#[cfg(feature = "json")]
6260#[doc(hidden)]
6261pub const __ENUM_VALUE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6262    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6263    to_json: ::buffa::type_registry::any_to_json::<EnumValueDescriptorProto>,
6264    from_json: ::buffa::type_registry::any_from_json::<EnumValueDescriptorProto>,
6265    is_wkt: false,
6266};
6267#[cfg(feature = "text")]
6268#[doc(hidden)]
6269pub const __ENUM_VALUE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6270    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6271    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueDescriptorProto>,
6272    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueDescriptorProto>,
6273};
6274/// Describes a service.
6275#[derive(Clone, PartialEq, Default)]
6276#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6277#[cfg_attr(feature = "json", serde(default))]
6278#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6279pub struct ServiceDescriptorProto {
6280    /// Field 1: `name`
6281    #[cfg_attr(
6282        feature = "json",
6283        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6284    )]
6285    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6286    /// Field 2: `method`
6287    #[cfg_attr(
6288        feature = "json",
6289        serde(
6290            rename = "method",
6291            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
6292            deserialize_with = "::buffa::json_helpers::null_as_default"
6293        )
6294    )]
6295    pub method: ::buffa::alloc::vec::Vec<MethodDescriptorProto>,
6296    /// Field 3: `options`
6297    #[cfg_attr(
6298        feature = "json",
6299        serde(
6300            rename = "options",
6301            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6302        )
6303    )]
6304    pub options: ::buffa::MessageField<ServiceOptions, ::buffa::Inline<ServiceOptions>>,
6305    #[cfg_attr(feature = "json", serde(skip))]
6306    #[doc(hidden)]
6307    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6308}
6309impl ::core::fmt::Debug for ServiceDescriptorProto {
6310    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6311        f.debug_struct("ServiceDescriptorProto")
6312            .field("name", &self.name)
6313            .field("method", &self.method)
6314            .field("options", &self.options)
6315            .finish()
6316    }
6317}
6318impl ServiceDescriptorProto {
6319    /// Protobuf type URL for this message, for use with `Any::pack` and
6320    /// `Any::unpack_if`.
6321    ///
6322    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6323    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6324}
6325impl ServiceDescriptorProto {
6326    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6327    #[inline]
6328    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6329    pub fn with_name(
6330        mut self,
6331        value: impl Into<::buffa::alloc::string::String>,
6332    ) -> Self {
6333        self.name = Some(value.into());
6334        self
6335    }
6336}
6337::buffa::impl_default_instance!(ServiceDescriptorProto);
6338impl ::buffa::MessageName for ServiceDescriptorProto {
6339    const PACKAGE: &'static str = "google.protobuf";
6340    const NAME: &'static str = "ServiceDescriptorProto";
6341    const FULL_NAME: &'static str = "google.protobuf.ServiceDescriptorProto";
6342    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6343}
6344impl ::buffa::Message for ServiceDescriptorProto {
6345    /// Returns the total encoded size in bytes.
6346    ///
6347    /// Accumulates in `u64` (which cannot overflow for in-memory
6348    /// data) and saturates to `u32` at return, so a message whose
6349    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6350    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6351    /// points reject, never a silently wrapped size.
6352    #[allow(clippy::let_and_return)]
6353    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6354        #[allow(unused_imports)]
6355        use ::buffa::Enumeration as _;
6356        let mut size = 0u64;
6357        if let Some(ref v) = self.name {
6358            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6359        }
6360        for v in &self.method {
6361            let __slot = __cache.reserve();
6362            let inner_size = v.compute_size(__cache);
6363            __cache.set(__slot, inner_size);
6364            size
6365                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6366                    + inner_size as u64;
6367        }
6368        if self.options.is_set() {
6369            let __slot = __cache.reserve();
6370            let inner_size = self.options.compute_size(__cache);
6371            __cache.set(__slot, inner_size);
6372            size
6373                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6374                    + inner_size as u64;
6375        }
6376        size += self.__buffa_unknown_fields.encoded_len() as u64;
6377        ::buffa::saturate_size(size)
6378    }
6379    fn write_to(
6380        &self,
6381        __cache: &mut ::buffa::SizeCache,
6382        buf: &mut impl ::buffa::EncodeSink,
6383    ) {
6384        #[allow(unused_imports)]
6385        use ::buffa::Enumeration as _;
6386        if let Some(ref v) = self.name {
6387            ::buffa::types::put_string_field(1u32, v, buf);
6388        }
6389        for v in &self.method {
6390            ::buffa::types::put_len_delimited_header(
6391                2u32,
6392                u64::from(__cache.consume_next()),
6393                buf,
6394            );
6395            v.write_to(__cache, buf);
6396        }
6397        if self.options.is_set() {
6398            ::buffa::types::put_len_delimited_header(
6399                3u32,
6400                u64::from(__cache.consume_next()),
6401                buf,
6402            );
6403            self.options.write_to(__cache, buf);
6404        }
6405        self.__buffa_unknown_fields.write_to(buf);
6406    }
6407    fn merge_field(
6408        &mut self,
6409        tag: ::buffa::encoding::Tag,
6410        buf: &mut impl ::buffa::bytes::Buf,
6411        ctx: ::buffa::DecodeContext<'_>,
6412    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6413        #[allow(unused_imports)]
6414        use ::buffa::bytes::Buf as _;
6415        #[allow(unused_imports)]
6416        use ::buffa::Enumeration as _;
6417        match tag.field_number() {
6418            1u32 => {
6419                ::buffa::encoding::check_wire_type(
6420                    tag,
6421                    ::buffa::encoding::WireType::LengthDelimited,
6422                )?;
6423                ::buffa::types::merge_string(
6424                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6425                    buf,
6426                )?;
6427            }
6428            2u32 => {
6429                ::buffa::encoding::check_wire_type(
6430                    tag,
6431                    ::buffa::encoding::WireType::LengthDelimited,
6432                )?;
6433                let mut elem = ::core::default::Default::default();
6434                ctx.register_element_memory(
6435                    ::buffa::__private::element_footprint(&elem),
6436                )?;
6437                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
6438                self.method.push(elem);
6439            }
6440            3u32 => {
6441                ::buffa::encoding::check_wire_type(
6442                    tag,
6443                    ::buffa::encoding::WireType::LengthDelimited,
6444                )?;
6445                ::buffa::Message::merge_length_delimited(
6446                    self.options.get_or_insert_default(),
6447                    buf,
6448                    ctx,
6449                )?;
6450            }
6451            _ => {
6452                self.__buffa_unknown_fields
6453                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6454            }
6455        }
6456        ::core::result::Result::Ok(())
6457    }
6458    fn clear(&mut self) {
6459        self.name = ::core::option::Option::None;
6460        self.method.clear();
6461        self.options = ::buffa::MessageField::none();
6462        self.__buffa_unknown_fields.clear();
6463    }
6464}
6465impl ::buffa::ExtensionSet for ServiceDescriptorProto {
6466    const PROTO_FQN: &'static str = "google.protobuf.ServiceDescriptorProto";
6467    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6468        &self.__buffa_unknown_fields
6469    }
6470    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6471        &mut self.__buffa_unknown_fields
6472    }
6473}
6474#[cfg(feature = "text")]
6475impl ::buffa::text::TextFormat for ServiceDescriptorProto {
6476    fn encode_text(
6477        &self,
6478        enc: &mut ::buffa::text::TextEncoder<'_>,
6479    ) -> ::core::fmt::Result {
6480        #[allow(unused_imports)]
6481        use ::buffa::Enumeration as _;
6482        if let ::core::option::Option::Some(ref __v) = self.name {
6483            enc.write_field_name("name")?;
6484            enc.write_string(__v)?;
6485        }
6486        if self.options.is_set() {
6487            enc.write_field_name("options")?;
6488            enc.write_message(&*self.options)?;
6489        }
6490        for __v in &self.method {
6491            enc.write_field_name("method")?;
6492            enc.write_message(__v)?;
6493        }
6494        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6495        ::core::result::Result::Ok(())
6496    }
6497    fn merge_text(
6498        &mut self,
6499        dec: &mut ::buffa::text::TextDecoder<'_>,
6500    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6501        #[allow(unused_imports)]
6502        use ::buffa::Enumeration as _;
6503        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6504            match __name {
6505                "name" => {
6506                    self.name = ::core::option::Option::Some(
6507                        dec.read_string()?.into_owned(),
6508                    );
6509                }
6510                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6511                "method" => {
6512                    dec.read_repeated_into(
6513                        &mut self.method,
6514                        |__d| {
6515                            let mut __m = ::core::default::Default::default();
6516                            __d.merge_message(&mut __m)?;
6517                            ::core::result::Result::Ok(__m)
6518                        },
6519                    )?
6520                }
6521                _ => dec.skip_value()?,
6522            }
6523        }
6524        ::core::result::Result::Ok(())
6525    }
6526}
6527#[cfg(feature = "json")]
6528impl ::buffa::json_helpers::ProtoElemJson for ServiceDescriptorProto {
6529    fn serialize_proto_json<S: ::serde::Serializer>(
6530        v: &Self,
6531        s: S,
6532    ) -> ::core::result::Result<S::Ok, S::Error> {
6533        ::serde::Serialize::serialize(v, s)
6534    }
6535    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6536        d: D,
6537    ) -> ::core::result::Result<Self, D::Error> {
6538        <Self as ::serde::Deserialize>::deserialize(d)
6539    }
6540}
6541#[cfg(feature = "json")]
6542#[doc(hidden)]
6543pub const __SERVICE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6544    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6545    to_json: ::buffa::type_registry::any_to_json::<ServiceDescriptorProto>,
6546    from_json: ::buffa::type_registry::any_from_json::<ServiceDescriptorProto>,
6547    is_wkt: false,
6548};
6549#[cfg(feature = "text")]
6550#[doc(hidden)]
6551pub const __SERVICE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6552    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6553    text_encode: ::buffa::type_registry::any_encode_text::<ServiceDescriptorProto>,
6554    text_merge: ::buffa::type_registry::any_merge_text::<ServiceDescriptorProto>,
6555};
6556/// Describes a method of a service.
6557#[derive(Clone, PartialEq, Default)]
6558#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6559#[cfg_attr(feature = "json", serde(default))]
6560#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6561pub struct MethodDescriptorProto {
6562    /// Field 1: `name`
6563    #[cfg_attr(
6564        feature = "json",
6565        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6566    )]
6567    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6568    /// Input and output type names.  These are resolved in the same way as
6569    /// FieldDescriptorProto.type_name, but must refer to a message type.
6570    ///
6571    /// Field 2: `input_type`
6572    #[cfg_attr(
6573        feature = "json",
6574        serde(
6575            rename = "inputType",
6576            alias = "input_type",
6577            skip_serializing_if = "::core::option::Option::is_none"
6578        )
6579    )]
6580    pub input_type: ::core::option::Option<::buffa::alloc::string::String>,
6581    /// Field 3: `output_type`
6582    #[cfg_attr(
6583        feature = "json",
6584        serde(
6585            rename = "outputType",
6586            alias = "output_type",
6587            skip_serializing_if = "::core::option::Option::is_none"
6588        )
6589    )]
6590    pub output_type: ::core::option::Option<::buffa::alloc::string::String>,
6591    /// Field 4: `options`
6592    #[cfg_attr(
6593        feature = "json",
6594        serde(
6595            rename = "options",
6596            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6597        )
6598    )]
6599    pub options: ::buffa::MessageField<MethodOptions, ::buffa::Inline<MethodOptions>>,
6600    /// Identifies if client streams multiple client messages
6601    ///
6602    /// Field 5: `client_streaming`
6603    #[cfg_attr(
6604        feature = "json",
6605        serde(
6606            rename = "clientStreaming",
6607            alias = "client_streaming",
6608            skip_serializing_if = "::core::option::Option::is_none"
6609        )
6610    )]
6611    pub client_streaming: ::core::option::Option<bool>,
6612    /// Identifies if server streams multiple server messages
6613    ///
6614    /// Field 6: `server_streaming`
6615    #[cfg_attr(
6616        feature = "json",
6617        serde(
6618            rename = "serverStreaming",
6619            alias = "server_streaming",
6620            skip_serializing_if = "::core::option::Option::is_none"
6621        )
6622    )]
6623    pub server_streaming: ::core::option::Option<bool>,
6624    #[cfg_attr(feature = "json", serde(skip))]
6625    #[doc(hidden)]
6626    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6627}
6628impl ::core::fmt::Debug for MethodDescriptorProto {
6629    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6630        f.debug_struct("MethodDescriptorProto")
6631            .field("name", &self.name)
6632            .field("input_type", &self.input_type)
6633            .field("output_type", &self.output_type)
6634            .field("options", &self.options)
6635            .field("client_streaming", &self.client_streaming)
6636            .field("server_streaming", &self.server_streaming)
6637            .finish()
6638    }
6639}
6640impl MethodDescriptorProto {
6641    /// Protobuf type URL for this message, for use with `Any::pack` and
6642    /// `Any::unpack_if`.
6643    ///
6644    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6645    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6646}
6647impl MethodDescriptorProto {
6648    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6649    #[inline]
6650    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6651    pub fn with_name(
6652        mut self,
6653        value: impl Into<::buffa::alloc::string::String>,
6654    ) -> Self {
6655        self.name = Some(value.into());
6656        self
6657    }
6658    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6659    #[inline]
6660    ///Sets [`Self::input_type`] to `Some(value)`, consuming and returning `self`.
6661    pub fn with_input_type(
6662        mut self,
6663        value: impl Into<::buffa::alloc::string::String>,
6664    ) -> Self {
6665        self.input_type = Some(value.into());
6666        self
6667    }
6668    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6669    #[inline]
6670    ///Sets [`Self::output_type`] to `Some(value)`, consuming and returning `self`.
6671    pub fn with_output_type(
6672        mut self,
6673        value: impl Into<::buffa::alloc::string::String>,
6674    ) -> Self {
6675        self.output_type = Some(value.into());
6676        self
6677    }
6678    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6679    #[inline]
6680    ///Sets [`Self::client_streaming`] to `Some(value)`, consuming and returning `self`.
6681    pub fn with_client_streaming(mut self, value: bool) -> Self {
6682        self.client_streaming = Some(value);
6683        self
6684    }
6685    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6686    #[inline]
6687    ///Sets [`Self::server_streaming`] to `Some(value)`, consuming and returning `self`.
6688    pub fn with_server_streaming(mut self, value: bool) -> Self {
6689        self.server_streaming = Some(value);
6690        self
6691    }
6692}
6693::buffa::impl_default_instance!(MethodDescriptorProto);
6694impl ::buffa::MessageName for MethodDescriptorProto {
6695    const PACKAGE: &'static str = "google.protobuf";
6696    const NAME: &'static str = "MethodDescriptorProto";
6697    const FULL_NAME: &'static str = "google.protobuf.MethodDescriptorProto";
6698    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6699}
6700impl ::buffa::Message for MethodDescriptorProto {
6701    /// Returns the total encoded size in bytes.
6702    ///
6703    /// Accumulates in `u64` (which cannot overflow for in-memory
6704    /// data) and saturates to `u32` at return, so a message whose
6705    /// encoded size exceeds the 2 GiB protobuf limit yields a value
6706    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
6707    /// points reject, never a silently wrapped size.
6708    #[allow(clippy::let_and_return)]
6709    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6710        #[allow(unused_imports)]
6711        use ::buffa::Enumeration as _;
6712        let mut size = 0u64;
6713        if let Some(ref v) = self.name {
6714            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6715        }
6716        if let Some(ref v) = self.input_type {
6717            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6718        }
6719        if let Some(ref v) = self.output_type {
6720            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
6721        }
6722        if self.options.is_set() {
6723            let __slot = __cache.reserve();
6724            let inner_size = self.options.compute_size(__cache);
6725            __cache.set(__slot, inner_size);
6726            size
6727                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
6728                    + inner_size as u64;
6729        }
6730        if self.client_streaming.is_some() {
6731            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
6732        }
6733        if self.server_streaming.is_some() {
6734            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
6735        }
6736        size += self.__buffa_unknown_fields.encoded_len() as u64;
6737        ::buffa::saturate_size(size)
6738    }
6739    fn write_to(
6740        &self,
6741        __cache: &mut ::buffa::SizeCache,
6742        buf: &mut impl ::buffa::EncodeSink,
6743    ) {
6744        #[allow(unused_imports)]
6745        use ::buffa::Enumeration as _;
6746        if let Some(ref v) = self.name {
6747            ::buffa::types::put_string_field(1u32, v, buf);
6748        }
6749        if let Some(ref v) = self.input_type {
6750            ::buffa::types::put_string_field(2u32, v, buf);
6751        }
6752        if let Some(ref v) = self.output_type {
6753            ::buffa::types::put_string_field(3u32, v, buf);
6754        }
6755        if self.options.is_set() {
6756            ::buffa::types::put_len_delimited_header(
6757                4u32,
6758                u64::from(__cache.consume_next()),
6759                buf,
6760            );
6761            self.options.write_to(__cache, buf);
6762        }
6763        if let Some(v) = self.client_streaming {
6764            ::buffa::types::put_bool_field(5u32, v, buf);
6765        }
6766        if let Some(v) = self.server_streaming {
6767            ::buffa::types::put_bool_field(6u32, v, buf);
6768        }
6769        self.__buffa_unknown_fields.write_to(buf);
6770    }
6771    fn merge_field(
6772        &mut self,
6773        tag: ::buffa::encoding::Tag,
6774        buf: &mut impl ::buffa::bytes::Buf,
6775        ctx: ::buffa::DecodeContext<'_>,
6776    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6777        #[allow(unused_imports)]
6778        use ::buffa::bytes::Buf as _;
6779        #[allow(unused_imports)]
6780        use ::buffa::Enumeration as _;
6781        match tag.field_number() {
6782            1u32 => {
6783                ::buffa::encoding::check_wire_type(
6784                    tag,
6785                    ::buffa::encoding::WireType::LengthDelimited,
6786                )?;
6787                ::buffa::types::merge_string(
6788                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6789                    buf,
6790                )?;
6791            }
6792            2u32 => {
6793                ::buffa::encoding::check_wire_type(
6794                    tag,
6795                    ::buffa::encoding::WireType::LengthDelimited,
6796                )?;
6797                ::buffa::types::merge_string(
6798                    self
6799                        .input_type
6800                        .get_or_insert_with(::buffa::alloc::string::String::new),
6801                    buf,
6802                )?;
6803            }
6804            3u32 => {
6805                ::buffa::encoding::check_wire_type(
6806                    tag,
6807                    ::buffa::encoding::WireType::LengthDelimited,
6808                )?;
6809                ::buffa::types::merge_string(
6810                    self
6811                        .output_type
6812                        .get_or_insert_with(::buffa::alloc::string::String::new),
6813                    buf,
6814                )?;
6815            }
6816            4u32 => {
6817                ::buffa::encoding::check_wire_type(
6818                    tag,
6819                    ::buffa::encoding::WireType::LengthDelimited,
6820                )?;
6821                ::buffa::Message::merge_length_delimited(
6822                    self.options.get_or_insert_default(),
6823                    buf,
6824                    ctx,
6825                )?;
6826            }
6827            5u32 => {
6828                ::buffa::encoding::check_wire_type(
6829                    tag,
6830                    ::buffa::encoding::WireType::Varint,
6831                )?;
6832                self.client_streaming = ::core::option::Option::Some(
6833                    ::buffa::types::decode_bool(buf)?,
6834                );
6835            }
6836            6u32 => {
6837                ::buffa::encoding::check_wire_type(
6838                    tag,
6839                    ::buffa::encoding::WireType::Varint,
6840                )?;
6841                self.server_streaming = ::core::option::Option::Some(
6842                    ::buffa::types::decode_bool(buf)?,
6843                );
6844            }
6845            _ => {
6846                self.__buffa_unknown_fields
6847                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6848            }
6849        }
6850        ::core::result::Result::Ok(())
6851    }
6852    fn clear(&mut self) {
6853        self.name = ::core::option::Option::None;
6854        self.input_type = ::core::option::Option::None;
6855        self.output_type = ::core::option::Option::None;
6856        self.options = ::buffa::MessageField::none();
6857        self.client_streaming = ::core::option::Option::None;
6858        self.server_streaming = ::core::option::Option::None;
6859        self.__buffa_unknown_fields.clear();
6860    }
6861}
6862impl ::buffa::ExtensionSet for MethodDescriptorProto {
6863    const PROTO_FQN: &'static str = "google.protobuf.MethodDescriptorProto";
6864    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6865        &self.__buffa_unknown_fields
6866    }
6867    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6868        &mut self.__buffa_unknown_fields
6869    }
6870}
6871#[cfg(feature = "text")]
6872impl ::buffa::text::TextFormat for MethodDescriptorProto {
6873    fn encode_text(
6874        &self,
6875        enc: &mut ::buffa::text::TextEncoder<'_>,
6876    ) -> ::core::fmt::Result {
6877        #[allow(unused_imports)]
6878        use ::buffa::Enumeration as _;
6879        if let ::core::option::Option::Some(ref __v) = self.name {
6880            enc.write_field_name("name")?;
6881            enc.write_string(__v)?;
6882        }
6883        if let ::core::option::Option::Some(ref __v) = self.input_type {
6884            enc.write_field_name("input_type")?;
6885            enc.write_string(__v)?;
6886        }
6887        if let ::core::option::Option::Some(ref __v) = self.output_type {
6888            enc.write_field_name("output_type")?;
6889            enc.write_string(__v)?;
6890        }
6891        if self.options.is_set() {
6892            enc.write_field_name("options")?;
6893            enc.write_message(&*self.options)?;
6894        }
6895        if let ::core::option::Option::Some(ref __v) = self.client_streaming {
6896            enc.write_field_name("client_streaming")?;
6897            enc.write_bool(*__v)?;
6898        }
6899        if let ::core::option::Option::Some(ref __v) = self.server_streaming {
6900            enc.write_field_name("server_streaming")?;
6901            enc.write_bool(*__v)?;
6902        }
6903        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6904        ::core::result::Result::Ok(())
6905    }
6906    fn merge_text(
6907        &mut self,
6908        dec: &mut ::buffa::text::TextDecoder<'_>,
6909    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6910        #[allow(unused_imports)]
6911        use ::buffa::Enumeration as _;
6912        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6913            match __name {
6914                "name" => {
6915                    self.name = ::core::option::Option::Some(
6916                        dec.read_string()?.into_owned(),
6917                    );
6918                }
6919                "input_type" => {
6920                    self.input_type = ::core::option::Option::Some(
6921                        dec.read_string()?.into_owned(),
6922                    );
6923                }
6924                "output_type" => {
6925                    self.output_type = ::core::option::Option::Some(
6926                        dec.read_string()?.into_owned(),
6927                    );
6928                }
6929                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6930                "client_streaming" => {
6931                    self.client_streaming = ::core::option::Option::Some(
6932                        dec.read_bool()?,
6933                    );
6934                }
6935                "server_streaming" => {
6936                    self.server_streaming = ::core::option::Option::Some(
6937                        dec.read_bool()?,
6938                    );
6939                }
6940                _ => dec.skip_value()?,
6941            }
6942        }
6943        ::core::result::Result::Ok(())
6944    }
6945}
6946#[cfg(feature = "json")]
6947impl ::buffa::json_helpers::ProtoElemJson for MethodDescriptorProto {
6948    fn serialize_proto_json<S: ::serde::Serializer>(
6949        v: &Self,
6950        s: S,
6951    ) -> ::core::result::Result<S::Ok, S::Error> {
6952        ::serde::Serialize::serialize(v, s)
6953    }
6954    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6955        d: D,
6956    ) -> ::core::result::Result<Self, D::Error> {
6957        <Self as ::serde::Deserialize>::deserialize(d)
6958    }
6959}
6960#[cfg(feature = "json")]
6961#[doc(hidden)]
6962pub const __METHOD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6963    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6964    to_json: ::buffa::type_registry::any_to_json::<MethodDescriptorProto>,
6965    from_json: ::buffa::type_registry::any_from_json::<MethodDescriptorProto>,
6966    is_wkt: false,
6967};
6968#[cfg(feature = "text")]
6969#[doc(hidden)]
6970pub const __METHOD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6971    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
6972    text_encode: ::buffa::type_registry::any_encode_text::<MethodDescriptorProto>,
6973    text_merge: ::buffa::type_registry::any_merge_text::<MethodDescriptorProto>,
6974};
6975/// ===================================================================
6976/// Options
6977///
6978/// Each of the definitions above may have "options" attached.  These are
6979/// just annotations which may cause code to be generated slightly differently
6980/// or may contain hints for code that manipulates protocol messages.
6981///
6982/// Clients may define custom options as extensions of the *Options messages.
6983/// These extensions may not yet be known at parsing time, so the parser cannot
6984/// store the values in them.  Instead it stores them in a field in the *Options
6985/// message called uninterpreted_option. This field must have the same name
6986/// across all *Options messages. We then use this field to populate the
6987/// extensions when we build a descriptor, at which point all protos have been
6988/// parsed and so all extensions are known.
6989///
6990/// Extension numbers for custom options may be chosen as follows:
6991/// * For options which will only be used within a single application or
6992///   organization, or for experimental options, use field numbers 50000
6993///   through 99999.  It is up to you to ensure that you do not use the
6994///   same number for multiple options.
6995/// * For options which will be published and used publicly by multiple
6996///   independent entities, e-mail protobuf-global-extension-registry@google.com
6997///   to reserve extension numbers. Simply provide your project name (e.g.
6998///   Objective-C plugin) and your project website (if available) -- there's no
6999///   need to explain how you intend to use them. Usually you only need one
7000///   extension number. You can declare multiple options with only one extension
7001///   number by putting them in a sub-message. See the Custom Options section of
7002///   the docs for examples:
7003///   <https://developers.google.com/protocol-buffers/docs/proto#options>
7004///   If this turns out to be popular, a web service will be set up
7005///   to automatically assign option numbers.
7006#[derive(Clone, PartialEq, Default)]
7007#[cfg_attr(feature = "json", derive(::serde::Serialize))]
7008#[cfg_attr(feature = "json", serde(default))]
7009#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
7010pub struct FileOptions {
7011    /// Sets the Java package where classes generated from this .proto will be
7012    /// placed.  By default, the proto package is used, but this is often
7013    /// inappropriate because proto packages do not normally start with backwards
7014    /// domain names.
7015    ///
7016    /// Field 1: `java_package`
7017    #[cfg_attr(
7018        feature = "json",
7019        serde(
7020            rename = "javaPackage",
7021            alias = "java_package",
7022            skip_serializing_if = "::core::option::Option::is_none"
7023        )
7024    )]
7025    pub java_package: ::core::option::Option<::buffa::alloc::string::String>,
7026    /// Controls the name of the wrapper Java class generated for the .proto file.
7027    /// That class will always contain the .proto file's getDescriptor() method as
7028    /// well as any top-level extensions defined in the .proto file.
7029    /// If java_multiple_files is disabled, then all the other classes from the
7030    /// .proto file will be nested inside the single wrapper outer class.
7031    ///
7032    /// Field 8: `java_outer_classname`
7033    #[cfg_attr(
7034        feature = "json",
7035        serde(
7036            rename = "javaOuterClassname",
7037            alias = "java_outer_classname",
7038            skip_serializing_if = "::core::option::Option::is_none"
7039        )
7040    )]
7041    pub java_outer_classname: ::core::option::Option<::buffa::alloc::string::String>,
7042    /// If enabled, then the Java code generator will generate a separate .java
7043    /// file for each top-level message, enum, and service defined in the .proto
7044    /// file.  Thus, these types will *not* be nested inside the wrapper class
7045    /// named by java_outer_classname.  However, the wrapper class will still be
7046    /// generated to contain the file's getDescriptor() method as well as any
7047    /// top-level extensions defined in the file.
7048    ///
7049    /// Field 10: `java_multiple_files`
7050    #[cfg_attr(
7051        feature = "json",
7052        serde(
7053            rename = "javaMultipleFiles",
7054            alias = "java_multiple_files",
7055            skip_serializing_if = "::core::option::Option::is_none"
7056        )
7057    )]
7058    pub java_multiple_files: ::core::option::Option<bool>,
7059    /// This option does nothing.
7060    ///
7061    /// Field 20: `java_generate_equals_and_hash`
7062    #[cfg_attr(
7063        feature = "json",
7064        serde(
7065            rename = "javaGenerateEqualsAndHash",
7066            alias = "java_generate_equals_and_hash",
7067            skip_serializing_if = "::core::option::Option::is_none"
7068        )
7069    )]
7070    pub java_generate_equals_and_hash: ::core::option::Option<bool>,
7071    /// A proto2 file can set this to true to opt in to UTF-8 checking for Java,
7072    /// which will throw an exception if invalid UTF-8 is parsed from the wire or
7073    /// assigned to a string field.
7074    ///
7075    /// TODO: clarify exactly what kinds of field types this option
7076    /// applies to, and update these docs accordingly.
7077    ///
7078    /// Proto3 files already perform these checks. Setting the option explicitly to
7079    /// false has no effect: it cannot be used to opt proto3 files out of UTF-8
7080    /// checks.
7081    ///
7082    /// Field 27: `java_string_check_utf8`
7083    #[cfg_attr(
7084        feature = "json",
7085        serde(
7086            rename = "javaStringCheckUtf8",
7087            alias = "java_string_check_utf8",
7088            skip_serializing_if = "::core::option::Option::is_none"
7089        )
7090    )]
7091    pub java_string_check_utf8: ::core::option::Option<bool>,
7092    /// Field 9: `optimize_for`
7093    #[cfg_attr(
7094        feature = "json",
7095        serde(
7096            rename = "optimizeFor",
7097            alias = "optimize_for",
7098            with = "::buffa::json_helpers::opt_closed_enum",
7099            skip_serializing_if = "::core::option::Option::is_none"
7100        )
7101    )]
7102    pub optimize_for: ::core::option::Option<file_options::OptimizeMode>,
7103    /// Sets the Go package where structs generated from this .proto will be
7104    /// placed. If omitted, the Go package will be derived from the following:
7105    ///   - The basename of the package import path, if provided.
7106    ///   - Otherwise, the package statement in the .proto file, if present.
7107    ///   - Otherwise, the basename of the .proto file, without extension.
7108    ///
7109    /// Field 11: `go_package`
7110    #[cfg_attr(
7111        feature = "json",
7112        serde(
7113            rename = "goPackage",
7114            alias = "go_package",
7115            skip_serializing_if = "::core::option::Option::is_none"
7116        )
7117    )]
7118    pub go_package: ::core::option::Option<::buffa::alloc::string::String>,
7119    /// Should generic services be generated in each language?  "Generic" services
7120    /// are not specific to any particular RPC system.  They are generated by the
7121    /// main code generators in each language (without additional plugins).
7122    /// Generic services were the only kind of service generation supported by
7123    /// early versions of google.protobuf.
7124    ///
7125    /// Generic services are now considered deprecated in favor of using plugins
7126    /// that generate code specific to your particular RPC system.  Therefore,
7127    /// these default to false.  Old code which depends on generic services should
7128    /// explicitly set them to true.
7129    ///
7130    /// Field 16: `cc_generic_services`
7131    #[cfg_attr(
7132        feature = "json",
7133        serde(
7134            rename = "ccGenericServices",
7135            alias = "cc_generic_services",
7136            skip_serializing_if = "::core::option::Option::is_none"
7137        )
7138    )]
7139    pub cc_generic_services: ::core::option::Option<bool>,
7140    /// Field 17: `java_generic_services`
7141    #[cfg_attr(
7142        feature = "json",
7143        serde(
7144            rename = "javaGenericServices",
7145            alias = "java_generic_services",
7146            skip_serializing_if = "::core::option::Option::is_none"
7147        )
7148    )]
7149    pub java_generic_services: ::core::option::Option<bool>,
7150    /// Field 18: `py_generic_services`
7151    #[cfg_attr(
7152        feature = "json",
7153        serde(
7154            rename = "pyGenericServices",
7155            alias = "py_generic_services",
7156            skip_serializing_if = "::core::option::Option::is_none"
7157        )
7158    )]
7159    pub py_generic_services: ::core::option::Option<bool>,
7160    /// Is this file deprecated?
7161    /// Depending on the target platform, this can emit Deprecated annotations
7162    /// for everything in the file, or it will be completely ignored; in the very
7163    /// least, this is a formalization for deprecating files.
7164    ///
7165    /// Field 23: `deprecated`
7166    #[cfg_attr(
7167        feature = "json",
7168        serde(
7169            rename = "deprecated",
7170            skip_serializing_if = "::core::option::Option::is_none"
7171        )
7172    )]
7173    pub deprecated: ::core::option::Option<bool>,
7174    /// Enables the use of arenas for the proto messages in this file. This applies
7175    /// only to generated classes for C++.
7176    ///
7177    /// Field 31: `cc_enable_arenas`
7178    #[cfg_attr(
7179        feature = "json",
7180        serde(
7181            rename = "ccEnableArenas",
7182            alias = "cc_enable_arenas",
7183            skip_serializing_if = "::core::option::Option::is_none"
7184        )
7185    )]
7186    pub cc_enable_arenas: ::core::option::Option<bool>,
7187    /// Sets the objective c class prefix which is prepended to all objective c
7188    /// generated classes from this .proto. There is no default.
7189    ///
7190    /// Field 36: `objc_class_prefix`
7191    #[cfg_attr(
7192        feature = "json",
7193        serde(
7194            rename = "objcClassPrefix",
7195            alias = "objc_class_prefix",
7196            skip_serializing_if = "::core::option::Option::is_none"
7197        )
7198    )]
7199    pub objc_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7200    /// Namespace for generated classes; defaults to the package.
7201    ///
7202    /// Field 37: `csharp_namespace`
7203    #[cfg_attr(
7204        feature = "json",
7205        serde(
7206            rename = "csharpNamespace",
7207            alias = "csharp_namespace",
7208            skip_serializing_if = "::core::option::Option::is_none"
7209        )
7210    )]
7211    pub csharp_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7212    /// By default Swift generators will take the proto package and CamelCase it
7213    /// replacing '.' with underscore and use that to prefix the types/symbols
7214    /// defined. When this options is provided, they will use this value instead
7215    /// to prefix the types/symbols defined.
7216    ///
7217    /// Field 39: `swift_prefix`
7218    #[cfg_attr(
7219        feature = "json",
7220        serde(
7221            rename = "swiftPrefix",
7222            alias = "swift_prefix",
7223            skip_serializing_if = "::core::option::Option::is_none"
7224        )
7225    )]
7226    pub swift_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7227    /// Sets the php class prefix which is prepended to all php generated classes
7228    /// from this .proto. Default is empty.
7229    ///
7230    /// Field 40: `php_class_prefix`
7231    #[cfg_attr(
7232        feature = "json",
7233        serde(
7234            rename = "phpClassPrefix",
7235            alias = "php_class_prefix",
7236            skip_serializing_if = "::core::option::Option::is_none"
7237        )
7238    )]
7239    pub php_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7240    /// Use this option to change the namespace of php generated classes. Default
7241    /// is empty. When this option is empty, the package name will be used for
7242    /// determining the namespace.
7243    ///
7244    /// Field 41: `php_namespace`
7245    #[cfg_attr(
7246        feature = "json",
7247        serde(
7248            rename = "phpNamespace",
7249            alias = "php_namespace",
7250            skip_serializing_if = "::core::option::Option::is_none"
7251        )
7252    )]
7253    pub php_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7254    /// Use this option to change the namespace of php generated metadata classes.
7255    /// Default is empty. When this option is empty, the proto file name will be
7256    /// used for determining the namespace.
7257    ///
7258    /// Field 44: `php_metadata_namespace`
7259    #[cfg_attr(
7260        feature = "json",
7261        serde(
7262            rename = "phpMetadataNamespace",
7263            alias = "php_metadata_namespace",
7264            skip_serializing_if = "::core::option::Option::is_none"
7265        )
7266    )]
7267    pub php_metadata_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7268    /// Use this option to change the package of ruby generated classes. Default
7269    /// is empty. When this option is not set, the package name will be used for
7270    /// determining the ruby package.
7271    ///
7272    /// Field 45: `ruby_package`
7273    #[cfg_attr(
7274        feature = "json",
7275        serde(
7276            rename = "rubyPackage",
7277            alias = "ruby_package",
7278            skip_serializing_if = "::core::option::Option::is_none"
7279        )
7280    )]
7281    pub ruby_package: ::core::option::Option<::buffa::alloc::string::String>,
7282    /// Any features defined in the specific edition.
7283    /// WARNING: This field should only be used by protobuf plugins or special
7284    /// cases like the proto compiler. Other uses are discouraged and
7285    /// developers should rely on the protoreflect APIs for their client language.
7286    ///
7287    /// Field 50: `features`
7288    #[cfg_attr(
7289        feature = "json",
7290        serde(
7291            rename = "features",
7292            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7293        )
7294    )]
7295    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
7296    /// The parser stores options it doesn't recognize here.
7297    /// See the documentation for the "Options" section above.
7298    ///
7299    /// Field 999: `uninterpreted_option`
7300    #[cfg_attr(
7301        feature = "json",
7302        serde(
7303            rename = "uninterpretedOption",
7304            alias = "uninterpreted_option",
7305            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
7306            deserialize_with = "::buffa::json_helpers::null_as_default"
7307        )
7308    )]
7309    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
7310    #[cfg_attr(feature = "json", serde(flatten))]
7311    #[doc(hidden)]
7312    pub __buffa_unknown_fields: __FileOptionsExtJson,
7313}
7314impl ::core::fmt::Debug for FileOptions {
7315    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7316        f.debug_struct("FileOptions")
7317            .field("java_package", &self.java_package)
7318            .field("java_outer_classname", &self.java_outer_classname)
7319            .field("java_multiple_files", &self.java_multiple_files)
7320            .field("java_generate_equals_and_hash", &self.java_generate_equals_and_hash)
7321            .field("java_string_check_utf8", &self.java_string_check_utf8)
7322            .field("optimize_for", &self.optimize_for)
7323            .field("go_package", &self.go_package)
7324            .field("cc_generic_services", &self.cc_generic_services)
7325            .field("java_generic_services", &self.java_generic_services)
7326            .field("py_generic_services", &self.py_generic_services)
7327            .field("deprecated", &self.deprecated)
7328            .field("cc_enable_arenas", &self.cc_enable_arenas)
7329            .field("objc_class_prefix", &self.objc_class_prefix)
7330            .field("csharp_namespace", &self.csharp_namespace)
7331            .field("swift_prefix", &self.swift_prefix)
7332            .field("php_class_prefix", &self.php_class_prefix)
7333            .field("php_namespace", &self.php_namespace)
7334            .field("php_metadata_namespace", &self.php_metadata_namespace)
7335            .field("ruby_package", &self.ruby_package)
7336            .field("features", &self.features)
7337            .field("uninterpreted_option", &self.uninterpreted_option)
7338            .finish()
7339    }
7340}
7341impl FileOptions {
7342    /// Protobuf type URL for this message, for use with `Any::pack` and
7343    /// `Any::unpack_if`.
7344    ///
7345    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7346    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7347}
7348impl FileOptions {
7349    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7350    #[inline]
7351    ///Sets [`Self::java_package`] to `Some(value)`, consuming and returning `self`.
7352    pub fn with_java_package(
7353        mut self,
7354        value: impl Into<::buffa::alloc::string::String>,
7355    ) -> Self {
7356        self.java_package = Some(value.into());
7357        self
7358    }
7359    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7360    #[inline]
7361    ///Sets [`Self::java_outer_classname`] to `Some(value)`, consuming and returning `self`.
7362    pub fn with_java_outer_classname(
7363        mut self,
7364        value: impl Into<::buffa::alloc::string::String>,
7365    ) -> Self {
7366        self.java_outer_classname = Some(value.into());
7367        self
7368    }
7369    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7370    #[inline]
7371    ///Sets [`Self::java_multiple_files`] to `Some(value)`, consuming and returning `self`.
7372    pub fn with_java_multiple_files(mut self, value: bool) -> Self {
7373        self.java_multiple_files = Some(value);
7374        self
7375    }
7376    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7377    #[inline]
7378    ///Sets [`Self::java_generate_equals_and_hash`] to `Some(value)`, consuming and returning `self`.
7379    pub fn with_java_generate_equals_and_hash(mut self, value: bool) -> Self {
7380        self.java_generate_equals_and_hash = Some(value);
7381        self
7382    }
7383    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7384    #[inline]
7385    ///Sets [`Self::java_string_check_utf8`] to `Some(value)`, consuming and returning `self`.
7386    pub fn with_java_string_check_utf8(mut self, value: bool) -> Self {
7387        self.java_string_check_utf8 = Some(value);
7388        self
7389    }
7390    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7391    #[inline]
7392    ///Sets [`Self::optimize_for`] to `Some(value)`, consuming and returning `self`.
7393    pub fn with_optimize_for(
7394        mut self,
7395        value: impl Into<file_options::OptimizeMode>,
7396    ) -> Self {
7397        self.optimize_for = Some(value.into());
7398        self
7399    }
7400    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7401    #[inline]
7402    ///Sets [`Self::go_package`] to `Some(value)`, consuming and returning `self`.
7403    pub fn with_go_package(
7404        mut self,
7405        value: impl Into<::buffa::alloc::string::String>,
7406    ) -> Self {
7407        self.go_package = Some(value.into());
7408        self
7409    }
7410    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7411    #[inline]
7412    ///Sets [`Self::cc_generic_services`] to `Some(value)`, consuming and returning `self`.
7413    pub fn with_cc_generic_services(mut self, value: bool) -> Self {
7414        self.cc_generic_services = Some(value);
7415        self
7416    }
7417    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7418    #[inline]
7419    ///Sets [`Self::java_generic_services`] to `Some(value)`, consuming and returning `self`.
7420    pub fn with_java_generic_services(mut self, value: bool) -> Self {
7421        self.java_generic_services = Some(value);
7422        self
7423    }
7424    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7425    #[inline]
7426    ///Sets [`Self::py_generic_services`] to `Some(value)`, consuming and returning `self`.
7427    pub fn with_py_generic_services(mut self, value: bool) -> Self {
7428        self.py_generic_services = Some(value);
7429        self
7430    }
7431    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7432    #[inline]
7433    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
7434    pub fn with_deprecated(mut self, value: bool) -> Self {
7435        self.deprecated = Some(value);
7436        self
7437    }
7438    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7439    #[inline]
7440    ///Sets [`Self::cc_enable_arenas`] to `Some(value)`, consuming and returning `self`.
7441    pub fn with_cc_enable_arenas(mut self, value: bool) -> Self {
7442        self.cc_enable_arenas = Some(value);
7443        self
7444    }
7445    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7446    #[inline]
7447    ///Sets [`Self::objc_class_prefix`] to `Some(value)`, consuming and returning `self`.
7448    pub fn with_objc_class_prefix(
7449        mut self,
7450        value: impl Into<::buffa::alloc::string::String>,
7451    ) -> Self {
7452        self.objc_class_prefix = Some(value.into());
7453        self
7454    }
7455    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7456    #[inline]
7457    ///Sets [`Self::csharp_namespace`] to `Some(value)`, consuming and returning `self`.
7458    pub fn with_csharp_namespace(
7459        mut self,
7460        value: impl Into<::buffa::alloc::string::String>,
7461    ) -> Self {
7462        self.csharp_namespace = Some(value.into());
7463        self
7464    }
7465    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7466    #[inline]
7467    ///Sets [`Self::swift_prefix`] to `Some(value)`, consuming and returning `self`.
7468    pub fn with_swift_prefix(
7469        mut self,
7470        value: impl Into<::buffa::alloc::string::String>,
7471    ) -> Self {
7472        self.swift_prefix = Some(value.into());
7473        self
7474    }
7475    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7476    #[inline]
7477    ///Sets [`Self::php_class_prefix`] to `Some(value)`, consuming and returning `self`.
7478    pub fn with_php_class_prefix(
7479        mut self,
7480        value: impl Into<::buffa::alloc::string::String>,
7481    ) -> Self {
7482        self.php_class_prefix = Some(value.into());
7483        self
7484    }
7485    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7486    #[inline]
7487    ///Sets [`Self::php_namespace`] to `Some(value)`, consuming and returning `self`.
7488    pub fn with_php_namespace(
7489        mut self,
7490        value: impl Into<::buffa::alloc::string::String>,
7491    ) -> Self {
7492        self.php_namespace = Some(value.into());
7493        self
7494    }
7495    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7496    #[inline]
7497    ///Sets [`Self::php_metadata_namespace`] to `Some(value)`, consuming and returning `self`.
7498    pub fn with_php_metadata_namespace(
7499        mut self,
7500        value: impl Into<::buffa::alloc::string::String>,
7501    ) -> Self {
7502        self.php_metadata_namespace = Some(value.into());
7503        self
7504    }
7505    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7506    #[inline]
7507    ///Sets [`Self::ruby_package`] to `Some(value)`, consuming and returning `self`.
7508    pub fn with_ruby_package(
7509        mut self,
7510        value: impl Into<::buffa::alloc::string::String>,
7511    ) -> Self {
7512        self.ruby_package = Some(value.into());
7513        self
7514    }
7515}
7516::buffa::impl_default_instance!(FileOptions);
7517impl ::buffa::MessageName for FileOptions {
7518    const PACKAGE: &'static str = "google.protobuf";
7519    const NAME: &'static str = "FileOptions";
7520    const FULL_NAME: &'static str = "google.protobuf.FileOptions";
7521    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7522}
7523impl ::buffa::Message for FileOptions {
7524    /// Returns the total encoded size in bytes.
7525    ///
7526    /// Accumulates in `u64` (which cannot overflow for in-memory
7527    /// data) and saturates to `u32` at return, so a message whose
7528    /// encoded size exceeds the 2 GiB protobuf limit yields a value
7529    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
7530    /// points reject, never a silently wrapped size.
7531    #[allow(clippy::let_and_return)]
7532    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7533        #[allow(unused_imports)]
7534        use ::buffa::Enumeration as _;
7535        let mut size = 0u64;
7536        if let Some(ref v) = self.java_package {
7537            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7538        }
7539        if let Some(ref v) = self.java_outer_classname {
7540            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7541        }
7542        if let Some(ref v) = self.optimize_for {
7543            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
7544        }
7545        if self.java_multiple_files.is_some() {
7546            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7547        }
7548        if let Some(ref v) = self.go_package {
7549            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
7550        }
7551        if self.cc_generic_services.is_some() {
7552            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7553        }
7554        if self.java_generic_services.is_some() {
7555            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7556        }
7557        if self.py_generic_services.is_some() {
7558            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7559        }
7560        if self.java_generate_equals_and_hash.is_some() {
7561            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7562        }
7563        if self.deprecated.is_some() {
7564            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7565        }
7566        if self.java_string_check_utf8.is_some() {
7567            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7568        }
7569        if self.cc_enable_arenas.is_some() {
7570            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
7571        }
7572        if let Some(ref v) = self.objc_class_prefix {
7573            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7574        }
7575        if let Some(ref v) = self.csharp_namespace {
7576            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7577        }
7578        if let Some(ref v) = self.swift_prefix {
7579            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7580        }
7581        if let Some(ref v) = self.php_class_prefix {
7582            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7583        }
7584        if let Some(ref v) = self.php_namespace {
7585            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7586        }
7587        if let Some(ref v) = self.php_metadata_namespace {
7588            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7589        }
7590        if let Some(ref v) = self.ruby_package {
7591            size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
7592        }
7593        if self.features.is_set() {
7594            let __slot = __cache.reserve();
7595            let inner_size = self.features.compute_size(__cache);
7596            __cache.set(__slot, inner_size);
7597            size
7598                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
7599                    + inner_size as u64;
7600        }
7601        for v in &self.uninterpreted_option {
7602            let __slot = __cache.reserve();
7603            let inner_size = v.compute_size(__cache);
7604            __cache.set(__slot, inner_size);
7605            size
7606                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
7607                    + inner_size as u64;
7608        }
7609        size += self.__buffa_unknown_fields.encoded_len() as u64;
7610        ::buffa::saturate_size(size)
7611    }
7612    fn write_to(
7613        &self,
7614        __cache: &mut ::buffa::SizeCache,
7615        buf: &mut impl ::buffa::EncodeSink,
7616    ) {
7617        #[allow(unused_imports)]
7618        use ::buffa::Enumeration as _;
7619        if let Some(ref v) = self.java_package {
7620            ::buffa::types::put_string_field(1u32, v, buf);
7621        }
7622        if let Some(ref v) = self.java_outer_classname {
7623            ::buffa::types::put_string_field(8u32, v, buf);
7624        }
7625        if let Some(ref v) = self.optimize_for {
7626            ::buffa::types::put_int32_field(9u32, v.to_i32(), buf);
7627        }
7628        if let Some(v) = self.java_multiple_files {
7629            ::buffa::types::put_bool_field(10u32, v, buf);
7630        }
7631        if let Some(ref v) = self.go_package {
7632            ::buffa::types::put_string_field(11u32, v, buf);
7633        }
7634        if let Some(v) = self.cc_generic_services {
7635            ::buffa::types::put_bool_field(16u32, v, buf);
7636        }
7637        if let Some(v) = self.java_generic_services {
7638            ::buffa::types::put_bool_field(17u32, v, buf);
7639        }
7640        if let Some(v) = self.py_generic_services {
7641            ::buffa::types::put_bool_field(18u32, v, buf);
7642        }
7643        if let Some(v) = self.java_generate_equals_and_hash {
7644            ::buffa::types::put_bool_field(20u32, v, buf);
7645        }
7646        if let Some(v) = self.deprecated {
7647            ::buffa::types::put_bool_field(23u32, v, buf);
7648        }
7649        if let Some(v) = self.java_string_check_utf8 {
7650            ::buffa::types::put_bool_field(27u32, v, buf);
7651        }
7652        if let Some(v) = self.cc_enable_arenas {
7653            ::buffa::types::put_bool_field(31u32, v, buf);
7654        }
7655        if let Some(ref v) = self.objc_class_prefix {
7656            ::buffa::types::put_string_field(36u32, v, buf);
7657        }
7658        if let Some(ref v) = self.csharp_namespace {
7659            ::buffa::types::put_string_field(37u32, v, buf);
7660        }
7661        if let Some(ref v) = self.swift_prefix {
7662            ::buffa::types::put_string_field(39u32, v, buf);
7663        }
7664        if let Some(ref v) = self.php_class_prefix {
7665            ::buffa::types::put_string_field(40u32, v, buf);
7666        }
7667        if let Some(ref v) = self.php_namespace {
7668            ::buffa::types::put_string_field(41u32, v, buf);
7669        }
7670        if let Some(ref v) = self.php_metadata_namespace {
7671            ::buffa::types::put_string_field(44u32, v, buf);
7672        }
7673        if let Some(ref v) = self.ruby_package {
7674            ::buffa::types::put_string_field(45u32, v, buf);
7675        }
7676        if self.features.is_set() {
7677            ::buffa::types::put_len_delimited_header(
7678                50u32,
7679                u64::from(__cache.consume_next()),
7680                buf,
7681            );
7682            self.features.write_to(__cache, buf);
7683        }
7684        for v in &self.uninterpreted_option {
7685            ::buffa::types::put_len_delimited_header(
7686                999u32,
7687                u64::from(__cache.consume_next()),
7688                buf,
7689            );
7690            v.write_to(__cache, buf);
7691        }
7692        self.__buffa_unknown_fields.write_to(buf);
7693    }
7694    fn merge_field(
7695        &mut self,
7696        tag: ::buffa::encoding::Tag,
7697        buf: &mut impl ::buffa::bytes::Buf,
7698        ctx: ::buffa::DecodeContext<'_>,
7699    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7700        #[allow(unused_imports)]
7701        use ::buffa::bytes::Buf as _;
7702        #[allow(unused_imports)]
7703        use ::buffa::Enumeration as _;
7704        match tag.field_number() {
7705            1u32 => {
7706                ::buffa::encoding::check_wire_type(
7707                    tag,
7708                    ::buffa::encoding::WireType::LengthDelimited,
7709                )?;
7710                ::buffa::types::merge_string(
7711                    self
7712                        .java_package
7713                        .get_or_insert_with(::buffa::alloc::string::String::new),
7714                    buf,
7715                )?;
7716            }
7717            8u32 => {
7718                ::buffa::encoding::check_wire_type(
7719                    tag,
7720                    ::buffa::encoding::WireType::LengthDelimited,
7721                )?;
7722                ::buffa::types::merge_string(
7723                    self
7724                        .java_outer_classname
7725                        .get_or_insert_with(::buffa::alloc::string::String::new),
7726                    buf,
7727                )?;
7728            }
7729            9u32 => {
7730                ::buffa::encoding::check_wire_type(
7731                    tag,
7732                    ::buffa::encoding::WireType::Varint,
7733                )?;
7734                let __raw = ::buffa::types::decode_int32(buf)?;
7735                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
7736                    __raw,
7737                ) {
7738                    self.optimize_for = ::core::option::Option::Some(__v);
7739                } else {
7740                    ctx.register_unknown_field()?;
7741                    self.__buffa_unknown_fields
7742                        .push(::buffa::UnknownField {
7743                            number: 9u32,
7744                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
7745                        });
7746                }
7747            }
7748            10u32 => {
7749                ::buffa::encoding::check_wire_type(
7750                    tag,
7751                    ::buffa::encoding::WireType::Varint,
7752                )?;
7753                self.java_multiple_files = ::core::option::Option::Some(
7754                    ::buffa::types::decode_bool(buf)?,
7755                );
7756            }
7757            11u32 => {
7758                ::buffa::encoding::check_wire_type(
7759                    tag,
7760                    ::buffa::encoding::WireType::LengthDelimited,
7761                )?;
7762                ::buffa::types::merge_string(
7763                    self
7764                        .go_package
7765                        .get_or_insert_with(::buffa::alloc::string::String::new),
7766                    buf,
7767                )?;
7768            }
7769            16u32 => {
7770                ::buffa::encoding::check_wire_type(
7771                    tag,
7772                    ::buffa::encoding::WireType::Varint,
7773                )?;
7774                self.cc_generic_services = ::core::option::Option::Some(
7775                    ::buffa::types::decode_bool(buf)?,
7776                );
7777            }
7778            17u32 => {
7779                ::buffa::encoding::check_wire_type(
7780                    tag,
7781                    ::buffa::encoding::WireType::Varint,
7782                )?;
7783                self.java_generic_services = ::core::option::Option::Some(
7784                    ::buffa::types::decode_bool(buf)?,
7785                );
7786            }
7787            18u32 => {
7788                ::buffa::encoding::check_wire_type(
7789                    tag,
7790                    ::buffa::encoding::WireType::Varint,
7791                )?;
7792                self.py_generic_services = ::core::option::Option::Some(
7793                    ::buffa::types::decode_bool(buf)?,
7794                );
7795            }
7796            20u32 => {
7797                ::buffa::encoding::check_wire_type(
7798                    tag,
7799                    ::buffa::encoding::WireType::Varint,
7800                )?;
7801                self.java_generate_equals_and_hash = ::core::option::Option::Some(
7802                    ::buffa::types::decode_bool(buf)?,
7803                );
7804            }
7805            23u32 => {
7806                ::buffa::encoding::check_wire_type(
7807                    tag,
7808                    ::buffa::encoding::WireType::Varint,
7809                )?;
7810                self.deprecated = ::core::option::Option::Some(
7811                    ::buffa::types::decode_bool(buf)?,
7812                );
7813            }
7814            27u32 => {
7815                ::buffa::encoding::check_wire_type(
7816                    tag,
7817                    ::buffa::encoding::WireType::Varint,
7818                )?;
7819                self.java_string_check_utf8 = ::core::option::Option::Some(
7820                    ::buffa::types::decode_bool(buf)?,
7821                );
7822            }
7823            31u32 => {
7824                ::buffa::encoding::check_wire_type(
7825                    tag,
7826                    ::buffa::encoding::WireType::Varint,
7827                )?;
7828                self.cc_enable_arenas = ::core::option::Option::Some(
7829                    ::buffa::types::decode_bool(buf)?,
7830                );
7831            }
7832            36u32 => {
7833                ::buffa::encoding::check_wire_type(
7834                    tag,
7835                    ::buffa::encoding::WireType::LengthDelimited,
7836                )?;
7837                ::buffa::types::merge_string(
7838                    self
7839                        .objc_class_prefix
7840                        .get_or_insert_with(::buffa::alloc::string::String::new),
7841                    buf,
7842                )?;
7843            }
7844            37u32 => {
7845                ::buffa::encoding::check_wire_type(
7846                    tag,
7847                    ::buffa::encoding::WireType::LengthDelimited,
7848                )?;
7849                ::buffa::types::merge_string(
7850                    self
7851                        .csharp_namespace
7852                        .get_or_insert_with(::buffa::alloc::string::String::new),
7853                    buf,
7854                )?;
7855            }
7856            39u32 => {
7857                ::buffa::encoding::check_wire_type(
7858                    tag,
7859                    ::buffa::encoding::WireType::LengthDelimited,
7860                )?;
7861                ::buffa::types::merge_string(
7862                    self
7863                        .swift_prefix
7864                        .get_or_insert_with(::buffa::alloc::string::String::new),
7865                    buf,
7866                )?;
7867            }
7868            40u32 => {
7869                ::buffa::encoding::check_wire_type(
7870                    tag,
7871                    ::buffa::encoding::WireType::LengthDelimited,
7872                )?;
7873                ::buffa::types::merge_string(
7874                    self
7875                        .php_class_prefix
7876                        .get_or_insert_with(::buffa::alloc::string::String::new),
7877                    buf,
7878                )?;
7879            }
7880            41u32 => {
7881                ::buffa::encoding::check_wire_type(
7882                    tag,
7883                    ::buffa::encoding::WireType::LengthDelimited,
7884                )?;
7885                ::buffa::types::merge_string(
7886                    self
7887                        .php_namespace
7888                        .get_or_insert_with(::buffa::alloc::string::String::new),
7889                    buf,
7890                )?;
7891            }
7892            44u32 => {
7893                ::buffa::encoding::check_wire_type(
7894                    tag,
7895                    ::buffa::encoding::WireType::LengthDelimited,
7896                )?;
7897                ::buffa::types::merge_string(
7898                    self
7899                        .php_metadata_namespace
7900                        .get_or_insert_with(::buffa::alloc::string::String::new),
7901                    buf,
7902                )?;
7903            }
7904            45u32 => {
7905                ::buffa::encoding::check_wire_type(
7906                    tag,
7907                    ::buffa::encoding::WireType::LengthDelimited,
7908                )?;
7909                ::buffa::types::merge_string(
7910                    self
7911                        .ruby_package
7912                        .get_or_insert_with(::buffa::alloc::string::String::new),
7913                    buf,
7914                )?;
7915            }
7916            50u32 => {
7917                ::buffa::encoding::check_wire_type(
7918                    tag,
7919                    ::buffa::encoding::WireType::LengthDelimited,
7920                )?;
7921                ::buffa::Message::merge_length_delimited(
7922                    self.features.get_or_insert_default(),
7923                    buf,
7924                    ctx,
7925                )?;
7926            }
7927            999u32 => {
7928                ::buffa::encoding::check_wire_type(
7929                    tag,
7930                    ::buffa::encoding::WireType::LengthDelimited,
7931                )?;
7932                let mut elem = ::core::default::Default::default();
7933                ctx.register_element_memory(
7934                    ::buffa::__private::element_footprint(&elem),
7935                )?;
7936                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
7937                self.uninterpreted_option.push(elem);
7938            }
7939            _ => {
7940                self.__buffa_unknown_fields
7941                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
7942            }
7943        }
7944        ::core::result::Result::Ok(())
7945    }
7946    fn clear(&mut self) {
7947        self.java_package = ::core::option::Option::None;
7948        self.java_outer_classname = ::core::option::Option::None;
7949        self.optimize_for = ::core::option::Option::None;
7950        self.java_multiple_files = ::core::option::Option::None;
7951        self.go_package = ::core::option::Option::None;
7952        self.cc_generic_services = ::core::option::Option::None;
7953        self.java_generic_services = ::core::option::Option::None;
7954        self.py_generic_services = ::core::option::Option::None;
7955        self.java_generate_equals_and_hash = ::core::option::Option::None;
7956        self.deprecated = ::core::option::Option::None;
7957        self.java_string_check_utf8 = ::core::option::Option::None;
7958        self.cc_enable_arenas = ::core::option::Option::None;
7959        self.objc_class_prefix = ::core::option::Option::None;
7960        self.csharp_namespace = ::core::option::Option::None;
7961        self.swift_prefix = ::core::option::Option::None;
7962        self.php_class_prefix = ::core::option::Option::None;
7963        self.php_namespace = ::core::option::Option::None;
7964        self.php_metadata_namespace = ::core::option::Option::None;
7965        self.ruby_package = ::core::option::Option::None;
7966        self.features = ::buffa::MessageField::none();
7967        self.uninterpreted_option.clear();
7968        self.__buffa_unknown_fields.clear();
7969    }
7970}
7971impl ::buffa::ExtensionSet for FileOptions {
7972    const PROTO_FQN: &'static str = "google.protobuf.FileOptions";
7973    fn unknown_fields(&self) -> &::buffa::UnknownFields {
7974        &self.__buffa_unknown_fields
7975    }
7976    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7977        &mut self.__buffa_unknown_fields
7978    }
7979}
7980#[cfg(feature = "text")]
7981impl ::buffa::text::TextFormat for FileOptions {
7982    fn encode_text(
7983        &self,
7984        enc: &mut ::buffa::text::TextEncoder<'_>,
7985    ) -> ::core::fmt::Result {
7986        #[allow(unused_imports)]
7987        use ::buffa::Enumeration as _;
7988        if let ::core::option::Option::Some(ref __v) = self.java_package {
7989            enc.write_field_name("java_package")?;
7990            enc.write_string(__v)?;
7991        }
7992        if let ::core::option::Option::Some(ref __v) = self.java_outer_classname {
7993            enc.write_field_name("java_outer_classname")?;
7994            enc.write_string(__v)?;
7995        }
7996        if let ::core::option::Option::Some(ref __v) = self.java_multiple_files {
7997            enc.write_field_name("java_multiple_files")?;
7998            enc.write_bool(*__v)?;
7999        }
8000        if let ::core::option::Option::Some(ref __v) = self.java_generate_equals_and_hash
8001        {
8002            enc.write_field_name("java_generate_equals_and_hash")?;
8003            enc.write_bool(*__v)?;
8004        }
8005        if let ::core::option::Option::Some(ref __v) = self.java_string_check_utf8 {
8006            enc.write_field_name("java_string_check_utf8")?;
8007            enc.write_bool(*__v)?;
8008        }
8009        if let ::core::option::Option::Some(ref __v) = self.optimize_for {
8010            enc.write_field_name("optimize_for")?;
8011            enc.write_enum_name(__v.proto_name())?;
8012        }
8013        if let ::core::option::Option::Some(ref __v) = self.go_package {
8014            enc.write_field_name("go_package")?;
8015            enc.write_string(__v)?;
8016        }
8017        if let ::core::option::Option::Some(ref __v) = self.cc_generic_services {
8018            enc.write_field_name("cc_generic_services")?;
8019            enc.write_bool(*__v)?;
8020        }
8021        if let ::core::option::Option::Some(ref __v) = self.java_generic_services {
8022            enc.write_field_name("java_generic_services")?;
8023            enc.write_bool(*__v)?;
8024        }
8025        if let ::core::option::Option::Some(ref __v) = self.py_generic_services {
8026            enc.write_field_name("py_generic_services")?;
8027            enc.write_bool(*__v)?;
8028        }
8029        if let ::core::option::Option::Some(ref __v) = self.deprecated {
8030            enc.write_field_name("deprecated")?;
8031            enc.write_bool(*__v)?;
8032        }
8033        if let ::core::option::Option::Some(ref __v) = self.cc_enable_arenas {
8034            enc.write_field_name("cc_enable_arenas")?;
8035            enc.write_bool(*__v)?;
8036        }
8037        if let ::core::option::Option::Some(ref __v) = self.objc_class_prefix {
8038            enc.write_field_name("objc_class_prefix")?;
8039            enc.write_string(__v)?;
8040        }
8041        if let ::core::option::Option::Some(ref __v) = self.csharp_namespace {
8042            enc.write_field_name("csharp_namespace")?;
8043            enc.write_string(__v)?;
8044        }
8045        if let ::core::option::Option::Some(ref __v) = self.swift_prefix {
8046            enc.write_field_name("swift_prefix")?;
8047            enc.write_string(__v)?;
8048        }
8049        if let ::core::option::Option::Some(ref __v) = self.php_class_prefix {
8050            enc.write_field_name("php_class_prefix")?;
8051            enc.write_string(__v)?;
8052        }
8053        if let ::core::option::Option::Some(ref __v) = self.php_namespace {
8054            enc.write_field_name("php_namespace")?;
8055            enc.write_string(__v)?;
8056        }
8057        if let ::core::option::Option::Some(ref __v) = self.php_metadata_namespace {
8058            enc.write_field_name("php_metadata_namespace")?;
8059            enc.write_string(__v)?;
8060        }
8061        if let ::core::option::Option::Some(ref __v) = self.ruby_package {
8062            enc.write_field_name("ruby_package")?;
8063            enc.write_string(__v)?;
8064        }
8065        if self.features.is_set() {
8066            enc.write_field_name("features")?;
8067            enc.write_message(&*self.features)?;
8068        }
8069        for __v in &self.uninterpreted_option {
8070            enc.write_field_name("uninterpreted_option")?;
8071            enc.write_message(__v)?;
8072        }
8073        enc.write_extension_fields(
8074            "google.protobuf.FileOptions",
8075            &self.__buffa_unknown_fields,
8076        )?;
8077        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
8078        ::core::result::Result::Ok(())
8079    }
8080    fn merge_text(
8081        &mut self,
8082        dec: &mut ::buffa::text::TextDecoder<'_>,
8083    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
8084        #[allow(unused_imports)]
8085        use ::buffa::Enumeration as _;
8086        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
8087            match __name {
8088                "java_package" => {
8089                    self.java_package = ::core::option::Option::Some(
8090                        dec.read_string()?.into_owned(),
8091                    );
8092                }
8093                "java_outer_classname" => {
8094                    self.java_outer_classname = ::core::option::Option::Some(
8095                        dec.read_string()?.into_owned(),
8096                    );
8097                }
8098                "java_multiple_files" => {
8099                    self.java_multiple_files = ::core::option::Option::Some(
8100                        dec.read_bool()?,
8101                    );
8102                }
8103                "java_generate_equals_and_hash" => {
8104                    self.java_generate_equals_and_hash = ::core::option::Option::Some(
8105                        dec.read_bool()?,
8106                    );
8107                }
8108                "java_string_check_utf8" => {
8109                    self.java_string_check_utf8 = ::core::option::Option::Some(
8110                        dec.read_bool()?,
8111                    );
8112                }
8113                "optimize_for" => {
8114                    self.optimize_for = ::core::option::Option::Some(
8115                        dec.read_closed_enum_by_name::<file_options::OptimizeMode>()?,
8116                    );
8117                }
8118                "go_package" => {
8119                    self.go_package = ::core::option::Option::Some(
8120                        dec.read_string()?.into_owned(),
8121                    );
8122                }
8123                "cc_generic_services" => {
8124                    self.cc_generic_services = ::core::option::Option::Some(
8125                        dec.read_bool()?,
8126                    );
8127                }
8128                "java_generic_services" => {
8129                    self.java_generic_services = ::core::option::Option::Some(
8130                        dec.read_bool()?,
8131                    );
8132                }
8133                "py_generic_services" => {
8134                    self.py_generic_services = ::core::option::Option::Some(
8135                        dec.read_bool()?,
8136                    );
8137                }
8138                "deprecated" => {
8139                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
8140                }
8141                "cc_enable_arenas" => {
8142                    self.cc_enable_arenas = ::core::option::Option::Some(
8143                        dec.read_bool()?,
8144                    );
8145                }
8146                "objc_class_prefix" => {
8147                    self.objc_class_prefix = ::core::option::Option::Some(
8148                        dec.read_string()?.into_owned(),
8149                    );
8150                }
8151                "csharp_namespace" => {
8152                    self.csharp_namespace = ::core::option::Option::Some(
8153                        dec.read_string()?.into_owned(),
8154                    );
8155                }
8156                "swift_prefix" => {
8157                    self.swift_prefix = ::core::option::Option::Some(
8158                        dec.read_string()?.into_owned(),
8159                    );
8160                }
8161                "php_class_prefix" => {
8162                    self.php_class_prefix = ::core::option::Option::Some(
8163                        dec.read_string()?.into_owned(),
8164                    );
8165                }
8166                "php_namespace" => {
8167                    self.php_namespace = ::core::option::Option::Some(
8168                        dec.read_string()?.into_owned(),
8169                    );
8170                }
8171                "php_metadata_namespace" => {
8172                    self.php_metadata_namespace = ::core::option::Option::Some(
8173                        dec.read_string()?.into_owned(),
8174                    );
8175                }
8176                "ruby_package" => {
8177                    self.ruby_package = ::core::option::Option::Some(
8178                        dec.read_string()?.into_owned(),
8179                    );
8180                }
8181                "features" => dec.merge_message(self.features.get_or_insert_default())?,
8182                "uninterpreted_option" => {
8183                    dec.read_repeated_into(
8184                        &mut self.uninterpreted_option,
8185                        |__d| {
8186                            let mut __m = ::core::default::Default::default();
8187                            __d.merge_message(&mut __m)?;
8188                            ::core::result::Result::Ok(__m)
8189                        },
8190                    )?
8191                }
8192                __name if __name.starts_with('[') => {
8193                    for __r in dec.read_extension(__name, "google.protobuf.FileOptions")?
8194                    {
8195                        self.__buffa_unknown_fields.push(__r);
8196                    }
8197                }
8198                _ => dec.skip_value()?,
8199            }
8200        }
8201        ::core::result::Result::Ok(())
8202    }
8203}
8204#[cfg(feature = "json")]
8205impl<'de> serde::Deserialize<'de> for FileOptions {
8206    fn deserialize<D: serde::Deserializer<'de>>(
8207        d: D,
8208    ) -> ::core::result::Result<Self, D::Error> {
8209        struct _V;
8210        impl<'de> serde::de::Visitor<'de> for _V {
8211            type Value = FileOptions;
8212            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8213                f.write_str("struct FileOptions")
8214            }
8215            #[allow(clippy::field_reassign_with_default)]
8216            fn visit_map<A: serde::de::MapAccess<'de>>(
8217                self,
8218                mut map: A,
8219            ) -> ::core::result::Result<FileOptions, A::Error> {
8220                let mut __f_java_package: ::core::option::Option<
8221                    ::core::option::Option<::buffa::alloc::string::String>,
8222                > = None;
8223                let mut __f_java_outer_classname: ::core::option::Option<
8224                    ::core::option::Option<::buffa::alloc::string::String>,
8225                > = None;
8226                let mut __f_java_multiple_files: ::core::option::Option<
8227                    ::core::option::Option<bool>,
8228                > = None;
8229                let mut __f_java_generate_equals_and_hash: ::core::option::Option<
8230                    ::core::option::Option<bool>,
8231                > = None;
8232                let mut __f_java_string_check_utf8: ::core::option::Option<
8233                    ::core::option::Option<bool>,
8234                > = None;
8235                let mut __f_optimize_for: ::core::option::Option<
8236                    ::core::option::Option<file_options::OptimizeMode>,
8237                > = None;
8238                let mut __f_go_package: ::core::option::Option<
8239                    ::core::option::Option<::buffa::alloc::string::String>,
8240                > = None;
8241                let mut __f_cc_generic_services: ::core::option::Option<
8242                    ::core::option::Option<bool>,
8243                > = None;
8244                let mut __f_java_generic_services: ::core::option::Option<
8245                    ::core::option::Option<bool>,
8246                > = None;
8247                let mut __f_py_generic_services: ::core::option::Option<
8248                    ::core::option::Option<bool>,
8249                > = None;
8250                let mut __f_deprecated: ::core::option::Option<
8251                    ::core::option::Option<bool>,
8252                > = None;
8253                let mut __f_cc_enable_arenas: ::core::option::Option<
8254                    ::core::option::Option<bool>,
8255                > = None;
8256                let mut __f_objc_class_prefix: ::core::option::Option<
8257                    ::core::option::Option<::buffa::alloc::string::String>,
8258                > = None;
8259                let mut __f_csharp_namespace: ::core::option::Option<
8260                    ::core::option::Option<::buffa::alloc::string::String>,
8261                > = None;
8262                let mut __f_swift_prefix: ::core::option::Option<
8263                    ::core::option::Option<::buffa::alloc::string::String>,
8264                > = None;
8265                let mut __f_php_class_prefix: ::core::option::Option<
8266                    ::core::option::Option<::buffa::alloc::string::String>,
8267                > = None;
8268                let mut __f_php_namespace: ::core::option::Option<
8269                    ::core::option::Option<::buffa::alloc::string::String>,
8270                > = None;
8271                let mut __f_php_metadata_namespace: ::core::option::Option<
8272                    ::core::option::Option<::buffa::alloc::string::String>,
8273                > = None;
8274                let mut __f_ruby_package: ::core::option::Option<
8275                    ::core::option::Option<::buffa::alloc::string::String>,
8276                > = None;
8277                let mut __f_features: ::core::option::Option<
8278                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
8279                > = None;
8280                let mut __f_uninterpreted_option: ::core::option::Option<
8281                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
8282                > = None;
8283                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
8284                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
8285                    match key.as_str() {
8286                        "javaPackage" | "java_package" => {
8287                            __f_java_package = Some(
8288                                map
8289                                    .next_value::<
8290                                        ::core::option::Option<::buffa::alloc::string::String>,
8291                                    >()?,
8292                            );
8293                        }
8294                        "javaOuterClassname" | "java_outer_classname" => {
8295                            __f_java_outer_classname = Some(
8296                                map
8297                                    .next_value::<
8298                                        ::core::option::Option<::buffa::alloc::string::String>,
8299                                    >()?,
8300                            );
8301                        }
8302                        "javaMultipleFiles" | "java_multiple_files" => {
8303                            __f_java_multiple_files = Some(
8304                                map.next_value::<::core::option::Option<bool>>()?,
8305                            );
8306                        }
8307                        "javaGenerateEqualsAndHash"
8308                        | "java_generate_equals_and_hash" => {
8309                            __f_java_generate_equals_and_hash = Some(
8310                                map.next_value::<::core::option::Option<bool>>()?,
8311                            );
8312                        }
8313                        "javaStringCheckUtf8" | "java_string_check_utf8" => {
8314                            __f_java_string_check_utf8 = Some(
8315                                map.next_value::<::core::option::Option<bool>>()?,
8316                            );
8317                        }
8318                        "optimizeFor" | "optimize_for" => {
8319                            __f_optimize_for = Some({
8320                                struct _S;
8321                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8322                                    type Value = ::core::option::Option<
8323                                        file_options::OptimizeMode,
8324                                    >;
8325                                    fn deserialize<D: serde::Deserializer<'de>>(
8326                                        self,
8327                                        d: D,
8328                                    ) -> ::core::result::Result<
8329                                        ::core::option::Option<file_options::OptimizeMode>,
8330                                        D::Error,
8331                                    > {
8332                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
8333                                    }
8334                                }
8335                                map.next_value_seed(_S)?
8336                            });
8337                        }
8338                        "goPackage" | "go_package" => {
8339                            __f_go_package = Some(
8340                                map
8341                                    .next_value::<
8342                                        ::core::option::Option<::buffa::alloc::string::String>,
8343                                    >()?,
8344                            );
8345                        }
8346                        "ccGenericServices" | "cc_generic_services" => {
8347                            __f_cc_generic_services = Some(
8348                                map.next_value::<::core::option::Option<bool>>()?,
8349                            );
8350                        }
8351                        "javaGenericServices" | "java_generic_services" => {
8352                            __f_java_generic_services = Some(
8353                                map.next_value::<::core::option::Option<bool>>()?,
8354                            );
8355                        }
8356                        "pyGenericServices" | "py_generic_services" => {
8357                            __f_py_generic_services = Some(
8358                                map.next_value::<::core::option::Option<bool>>()?,
8359                            );
8360                        }
8361                        "deprecated" => {
8362                            __f_deprecated = Some(
8363                                map.next_value::<::core::option::Option<bool>>()?,
8364                            );
8365                        }
8366                        "ccEnableArenas" | "cc_enable_arenas" => {
8367                            __f_cc_enable_arenas = Some(
8368                                map.next_value::<::core::option::Option<bool>>()?,
8369                            );
8370                        }
8371                        "objcClassPrefix" | "objc_class_prefix" => {
8372                            __f_objc_class_prefix = Some(
8373                                map
8374                                    .next_value::<
8375                                        ::core::option::Option<::buffa::alloc::string::String>,
8376                                    >()?,
8377                            );
8378                        }
8379                        "csharpNamespace" | "csharp_namespace" => {
8380                            __f_csharp_namespace = Some(
8381                                map
8382                                    .next_value::<
8383                                        ::core::option::Option<::buffa::alloc::string::String>,
8384                                    >()?,
8385                            );
8386                        }
8387                        "swiftPrefix" | "swift_prefix" => {
8388                            __f_swift_prefix = Some(
8389                                map
8390                                    .next_value::<
8391                                        ::core::option::Option<::buffa::alloc::string::String>,
8392                                    >()?,
8393                            );
8394                        }
8395                        "phpClassPrefix" | "php_class_prefix" => {
8396                            __f_php_class_prefix = Some(
8397                                map
8398                                    .next_value::<
8399                                        ::core::option::Option<::buffa::alloc::string::String>,
8400                                    >()?,
8401                            );
8402                        }
8403                        "phpNamespace" | "php_namespace" => {
8404                            __f_php_namespace = Some(
8405                                map
8406                                    .next_value::<
8407                                        ::core::option::Option<::buffa::alloc::string::String>,
8408                                    >()?,
8409                            );
8410                        }
8411                        "phpMetadataNamespace" | "php_metadata_namespace" => {
8412                            __f_php_metadata_namespace = Some(
8413                                map
8414                                    .next_value::<
8415                                        ::core::option::Option<::buffa::alloc::string::String>,
8416                                    >()?,
8417                            );
8418                        }
8419                        "rubyPackage" | "ruby_package" => {
8420                            __f_ruby_package = Some(
8421                                map
8422                                    .next_value::<
8423                                        ::core::option::Option<::buffa::alloc::string::String>,
8424                                    >()?,
8425                            );
8426                        }
8427                        "features" => {
8428                            __f_features = Some(
8429                                map
8430                                    .next_value::<
8431                                        ::buffa::MessageField<
8432                                            FeatureSet,
8433                                            ::buffa::Inline<FeatureSet>,
8434                                        >,
8435                                    >()?,
8436                            );
8437                        }
8438                        "uninterpretedOption" | "uninterpreted_option" => {
8439                            __f_uninterpreted_option = Some({
8440                                struct _S;
8441                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8442                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
8443                                    fn deserialize<D: serde::Deserializer<'de>>(
8444                                        self,
8445                                        d: D,
8446                                    ) -> ::core::result::Result<
8447                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
8448                                        D::Error,
8449                                    > {
8450                                        ::buffa::json_helpers::null_as_default(d)
8451                                    }
8452                                }
8453                                map.next_value_seed(_S)?
8454                            });
8455                        }
8456                        __k if __k.starts_with('[') => {
8457                            let __v: ::buffa::serde_json::Value = map.next_value()?;
8458                            match ::buffa::extension_registry::deserialize_extension_key(
8459                                "google.protobuf.FileOptions",
8460                                __k,
8461                                __v,
8462                            ) {
8463                                ::core::option::Option::Some(
8464                                    ::core::result::Result::Ok(__recs),
8465                                ) => {
8466                                    for __rec in __recs {
8467                                        __ext_records.push(__rec);
8468                                    }
8469                                }
8470                                ::core::option::Option::Some(
8471                                    ::core::result::Result::Err(__e),
8472                                ) => {
8473                                    return ::core::result::Result::Err(
8474                                        <A::Error as ::serde::de::Error>::custom(__e),
8475                                    );
8476                                }
8477                                ::core::option::Option::None => {}
8478                            }
8479                        }
8480                        _ => {
8481                            map.next_value::<serde::de::IgnoredAny>()?;
8482                        }
8483                    }
8484                }
8485                let mut __r = <FileOptions as ::core::default::Default>::default();
8486                if let ::core::option::Option::Some(v) = __f_java_package {
8487                    __r.java_package = v;
8488                }
8489                if let ::core::option::Option::Some(v) = __f_java_outer_classname {
8490                    __r.java_outer_classname = v;
8491                }
8492                if let ::core::option::Option::Some(v) = __f_java_multiple_files {
8493                    __r.java_multiple_files = v;
8494                }
8495                if let ::core::option::Option::Some(v) = __f_java_generate_equals_and_hash {
8496                    __r.java_generate_equals_and_hash = v;
8497                }
8498                if let ::core::option::Option::Some(v) = __f_java_string_check_utf8 {
8499                    __r.java_string_check_utf8 = v;
8500                }
8501                if let ::core::option::Option::Some(v) = __f_optimize_for {
8502                    __r.optimize_for = v;
8503                }
8504                if let ::core::option::Option::Some(v) = __f_go_package {
8505                    __r.go_package = v;
8506                }
8507                if let ::core::option::Option::Some(v) = __f_cc_generic_services {
8508                    __r.cc_generic_services = v;
8509                }
8510                if let ::core::option::Option::Some(v) = __f_java_generic_services {
8511                    __r.java_generic_services = v;
8512                }
8513                if let ::core::option::Option::Some(v) = __f_py_generic_services {
8514                    __r.py_generic_services = v;
8515                }
8516                if let ::core::option::Option::Some(v) = __f_deprecated {
8517                    __r.deprecated = v;
8518                }
8519                if let ::core::option::Option::Some(v) = __f_cc_enable_arenas {
8520                    __r.cc_enable_arenas = v;
8521                }
8522                if let ::core::option::Option::Some(v) = __f_objc_class_prefix {
8523                    __r.objc_class_prefix = v;
8524                }
8525                if let ::core::option::Option::Some(v) = __f_csharp_namespace {
8526                    __r.csharp_namespace = v;
8527                }
8528                if let ::core::option::Option::Some(v) = __f_swift_prefix {
8529                    __r.swift_prefix = v;
8530                }
8531                if let ::core::option::Option::Some(v) = __f_php_class_prefix {
8532                    __r.php_class_prefix = v;
8533                }
8534                if let ::core::option::Option::Some(v) = __f_php_namespace {
8535                    __r.php_namespace = v;
8536                }
8537                if let ::core::option::Option::Some(v) = __f_php_metadata_namespace {
8538                    __r.php_metadata_namespace = v;
8539                }
8540                if let ::core::option::Option::Some(v) = __f_ruby_package {
8541                    __r.ruby_package = v;
8542                }
8543                if let ::core::option::Option::Some(v) = __f_features {
8544                    __r.features = v;
8545                }
8546                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
8547                    __r.uninterpreted_option = v;
8548                }
8549                for __rec in __ext_records {
8550                    __r.__buffa_unknown_fields.push(__rec);
8551                }
8552                Ok(__r)
8553            }
8554        }
8555        d.deserialize_map(_V)
8556    }
8557}
8558#[cfg(feature = "json")]
8559impl ::buffa::json_helpers::ProtoElemJson for FileOptions {
8560    fn serialize_proto_json<S: ::serde::Serializer>(
8561        v: &Self,
8562        s: S,
8563    ) -> ::core::result::Result<S::Ok, S::Error> {
8564        ::serde::Serialize::serialize(v, s)
8565    }
8566    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8567        d: D,
8568    ) -> ::core::result::Result<Self, D::Error> {
8569        <Self as ::serde::Deserialize>::deserialize(d)
8570    }
8571}
8572#[doc(hidden)]
8573#[derive(Clone, Debug, Default, PartialEq)]
8574#[repr(transparent)]
8575#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8576pub struct __FileOptionsExtJson(pub ::buffa::UnknownFields);
8577impl ::core::ops::Deref for __FileOptionsExtJson {
8578    type Target = ::buffa::UnknownFields;
8579    fn deref(&self) -> &::buffa::UnknownFields {
8580        &self.0
8581    }
8582}
8583impl ::core::ops::DerefMut for __FileOptionsExtJson {
8584    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
8585        &mut self.0
8586    }
8587}
8588impl ::core::convert::From<::buffa::UnknownFields> for __FileOptionsExtJson {
8589    fn from(u: ::buffa::UnknownFields) -> Self {
8590        Self(u)
8591    }
8592}
8593#[cfg(feature = "json")]
8594impl ::serde::Serialize for __FileOptionsExtJson {
8595    fn serialize<S: ::serde::Serializer>(
8596        &self,
8597        s: S,
8598    ) -> ::core::result::Result<S::Ok, S::Error> {
8599        ::buffa::extension_registry::serialize_extensions(
8600            "google.protobuf.FileOptions",
8601            &self.0,
8602            s,
8603        )
8604    }
8605}
8606#[cfg(feature = "json")]
8607impl<'de> ::serde::Deserialize<'de> for __FileOptionsExtJson {
8608    fn deserialize<D: ::serde::Deserializer<'de>>(
8609        d: D,
8610    ) -> ::core::result::Result<Self, D::Error> {
8611        ::buffa::extension_registry::deserialize_extensions(
8612                "google.protobuf.FileOptions",
8613                d,
8614            )
8615            .map(Self)
8616    }
8617}
8618#[cfg(feature = "json")]
8619#[doc(hidden)]
8620pub const __FILE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8621    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8622    to_json: ::buffa::type_registry::any_to_json::<FileOptions>,
8623    from_json: ::buffa::type_registry::any_from_json::<FileOptions>,
8624    is_wkt: false,
8625};
8626#[cfg(feature = "text")]
8627#[doc(hidden)]
8628pub const __FILE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
8629    type_url: "type.googleapis.com/google.protobuf.FileOptions",
8630    text_encode: ::buffa::type_registry::any_encode_text::<FileOptions>,
8631    text_merge: ::buffa::type_registry::any_merge_text::<FileOptions>,
8632};
8633pub mod file_options {
8634    #[allow(unused_imports)]
8635    use super::*;
8636    /// Generated classes can be optimized for speed or code size.
8637    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
8638    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8639    #[repr(i32)]
8640    pub enum OptimizeMode {
8641        /// Generate complete code for parsing, serialization,
8642        SPEED = 1i32,
8643        /// etc.
8644        ///
8645        /// Use ReflectionOps to implement these methods.
8646        CODE_SIZE = 2i32,
8647        /// Generate code using MessageLite and the lite runtime.
8648        LITE_RUNTIME = 3i32,
8649    }
8650    impl OptimizeMode {
8651        ///Idiomatic alias for [`Self::SPEED`]; `Debug` prints the variant name.
8652        #[allow(non_upper_case_globals)]
8653        pub const Speed: Self = Self::SPEED;
8654        ///Idiomatic alias for [`Self::CODE_SIZE`]; `Debug` prints the variant name.
8655        #[allow(non_upper_case_globals)]
8656        pub const CodeSize: Self = Self::CODE_SIZE;
8657        ///Idiomatic alias for [`Self::LITE_RUNTIME`]; `Debug` prints the variant name.
8658        #[allow(non_upper_case_globals)]
8659        pub const LiteRuntime: Self = Self::LITE_RUNTIME;
8660    }
8661    impl ::core::default::Default for OptimizeMode {
8662        fn default() -> Self {
8663            Self::SPEED
8664        }
8665    }
8666    #[cfg(feature = "json")]
8667    const _: () = {
8668        impl ::serde::Serialize for OptimizeMode {
8669            fn serialize<S: ::serde::Serializer>(
8670                &self,
8671                s: S,
8672            ) -> ::core::result::Result<S::Ok, S::Error> {
8673                s.serialize_str(::buffa::Enumeration::proto_name(self))
8674            }
8675        }
8676        impl<'de> ::serde::Deserialize<'de> for OptimizeMode {
8677            fn deserialize<D: ::serde::Deserializer<'de>>(
8678                d: D,
8679            ) -> ::core::result::Result<Self, D::Error> {
8680                struct _V;
8681                impl ::serde::de::Visitor<'_> for _V {
8682                    type Value = OptimizeMode;
8683                    fn expecting(
8684                        &self,
8685                        f: &mut ::core::fmt::Formatter<'_>,
8686                    ) -> ::core::fmt::Result {
8687                        f.write_str(
8688                            concat!(
8689                                "a string, integer, or null for ", stringify!(OptimizeMode)
8690                            ),
8691                        )
8692                    }
8693                    fn visit_str<E: ::serde::de::Error>(
8694                        self,
8695                        v: &str,
8696                    ) -> ::core::result::Result<OptimizeMode, E> {
8697                        <OptimizeMode as ::buffa::Enumeration>::from_proto_name(v)
8698                            .ok_or_else(|| {
8699                                ::serde::de::Error::unknown_variant(v, &[])
8700                            })
8701                    }
8702                    fn visit_i64<E: ::serde::de::Error>(
8703                        self,
8704                        v: i64,
8705                    ) -> ::core::result::Result<OptimizeMode, E> {
8706                        let v32 = i32::try_from(v)
8707                            .map_err(|_| {
8708                                ::serde::de::Error::custom(
8709                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8710                                )
8711                            })?;
8712                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8713                            .ok_or_else(|| {
8714                                ::serde::de::Error::custom(
8715                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8716                                )
8717                            })
8718                    }
8719                    fn visit_u64<E: ::serde::de::Error>(
8720                        self,
8721                        v: u64,
8722                    ) -> ::core::result::Result<OptimizeMode, E> {
8723                        let v32 = i32::try_from(v)
8724                            .map_err(|_| {
8725                                ::serde::de::Error::custom(
8726                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
8727                                )
8728                            })?;
8729                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
8730                            .ok_or_else(|| {
8731                                ::serde::de::Error::custom(
8732                                    ::buffa::alloc::format!("unknown enum value {v32}"),
8733                                )
8734                            })
8735                    }
8736                    fn visit_unit<E: ::serde::de::Error>(
8737                        self,
8738                    ) -> ::core::result::Result<OptimizeMode, E> {
8739                        ::core::result::Result::Ok(::core::default::Default::default())
8740                    }
8741                }
8742                d.deserialize_any(_V)
8743            }
8744        }
8745        impl ::buffa::json_helpers::ProtoElemJson for OptimizeMode {
8746            fn serialize_proto_json<S: ::serde::Serializer>(
8747                v: &Self,
8748                s: S,
8749            ) -> ::core::result::Result<S::Ok, S::Error> {
8750                ::serde::Serialize::serialize(v, s)
8751            }
8752            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8753                d: D,
8754            ) -> ::core::result::Result<Self, D::Error> {
8755                <Self as ::serde::Deserialize>::deserialize(d)
8756            }
8757        }
8758    };
8759    impl ::buffa::Enumeration for OptimizeMode {
8760        fn from_i32(value: i32) -> ::core::option::Option<Self> {
8761            match value {
8762                1i32 => ::core::option::Option::Some(Self::SPEED),
8763                2i32 => ::core::option::Option::Some(Self::CODE_SIZE),
8764                3i32 => ::core::option::Option::Some(Self::LITE_RUNTIME),
8765                _ => ::core::option::Option::None,
8766            }
8767        }
8768        fn to_i32(&self) -> i32 {
8769            *self as i32
8770        }
8771        fn proto_name(&self) -> &'static str {
8772            match self {
8773                Self::SPEED => "SPEED",
8774                Self::CODE_SIZE => "CODE_SIZE",
8775                Self::LITE_RUNTIME => "LITE_RUNTIME",
8776            }
8777        }
8778        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
8779            match name {
8780                "SPEED" => ::core::option::Option::Some(Self::SPEED),
8781                "CODE_SIZE" => ::core::option::Option::Some(Self::CODE_SIZE),
8782                "LITE_RUNTIME" => ::core::option::Option::Some(Self::LITE_RUNTIME),
8783                _ => ::core::option::Option::None,
8784            }
8785        }
8786        fn values() -> &'static [Self] {
8787            &[Self::SPEED, Self::CODE_SIZE, Self::LITE_RUNTIME]
8788        }
8789    }
8790}
8791#[derive(Clone, PartialEq, Default)]
8792#[cfg_attr(feature = "json", derive(::serde::Serialize))]
8793#[cfg_attr(feature = "json", serde(default))]
8794#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
8795pub struct MessageOptions {
8796    /// Set true to use the old proto1 MessageSet wire format for extensions.
8797    /// This is provided for backwards-compatibility with the MessageSet wire
8798    /// format.  You should not use this for any other reason:  It's less
8799    /// efficient, has fewer features, and is more complicated.
8800    ///
8801    /// The message must be defined exactly as follows:
8802    ///   message Foo {
8803    /// ```text
8804    /// option message_set_wire_format = true;
8805    /// extensions 4 to max;
8806    /// ```
8807    ///   }
8808    /// Note that the message cannot have any defined fields; MessageSets only
8809    /// have extensions.
8810    ///
8811    /// All extensions of your type must be singular messages; e.g. they cannot
8812    /// be int32s, enums, or repeated messages.
8813    ///
8814    /// Because this is an option, the above two restrictions are not enforced by
8815    /// the protocol compiler.
8816    ///
8817    /// Field 1: `message_set_wire_format`
8818    #[cfg_attr(
8819        feature = "json",
8820        serde(
8821            rename = "messageSetWireFormat",
8822            alias = "message_set_wire_format",
8823            skip_serializing_if = "::core::option::Option::is_none"
8824        )
8825    )]
8826    pub message_set_wire_format: ::core::option::Option<bool>,
8827    /// Disables the generation of the standard "descriptor()" accessor, which can
8828    /// conflict with a field of the same name.  This is meant to make migration
8829    /// from proto1 easier; new code should avoid fields named "descriptor".
8830    ///
8831    /// Field 2: `no_standard_descriptor_accessor`
8832    #[cfg_attr(
8833        feature = "json",
8834        serde(
8835            rename = "noStandardDescriptorAccessor",
8836            alias = "no_standard_descriptor_accessor",
8837            skip_serializing_if = "::core::option::Option::is_none"
8838        )
8839    )]
8840    pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
8841    /// Is this message deprecated?
8842    /// Depending on the target platform, this can emit Deprecated annotations
8843    /// for the message, or it will be completely ignored; in the very least,
8844    /// this is a formalization for deprecating messages.
8845    ///
8846    /// Field 3: `deprecated`
8847    #[cfg_attr(
8848        feature = "json",
8849        serde(
8850            rename = "deprecated",
8851            skip_serializing_if = "::core::option::Option::is_none"
8852        )
8853    )]
8854    pub deprecated: ::core::option::Option<bool>,
8855    /// Whether the message is an automatically generated map entry type for the
8856    /// maps field.
8857    ///
8858    /// For maps fields:
8859    /// ```text
8860    /// map<KeyType, ValueType> map_field = 1;
8861    /// ```
8862    /// The parsed descriptor looks like:
8863    /// ```text
8864    /// message MapFieldEntry {
8865    ///     option map_entry = true;
8866    ///     optional KeyType key = 1;
8867    ///     optional ValueType value = 2;
8868    /// }
8869    /// repeated MapFieldEntry map_field = 1;
8870    /// ```
8871    ///
8872    /// Implementations may choose not to generate the map_entry=true message, but
8873    /// use a native map in the target language to hold the keys and values.
8874    /// The reflection APIs in such implementations still need to work as
8875    /// if the field is a repeated message field.
8876    ///
8877    /// NOTE: Do not set the option in .proto files. Always use the maps syntax
8878    /// instead. The option should only be implicitly set by the proto compiler
8879    /// parser.
8880    ///
8881    /// Field 7: `map_entry`
8882    #[cfg_attr(
8883        feature = "json",
8884        serde(
8885            rename = "mapEntry",
8886            alias = "map_entry",
8887            skip_serializing_if = "::core::option::Option::is_none"
8888        )
8889    )]
8890    pub map_entry: ::core::option::Option<bool>,
8891    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
8892    /// and strips underscored from the fields before comparison in proto3 only.
8893    /// The new behavior takes `json_name` into account and applies to proto2 as
8894    /// well.
8895    ///
8896    /// This should only be used as a temporary measure against broken builds due
8897    /// to the change in behavior for JSON field name conflicts.
8898    ///
8899    /// TODO This is legacy behavior we plan to remove once downstream
8900    /// teams have had time to migrate.
8901    ///
8902    /// Field 11: `deprecated_legacy_json_field_conflicts`
8903    #[cfg_attr(
8904        feature = "json",
8905        serde(
8906            rename = "deprecatedLegacyJsonFieldConflicts",
8907            alias = "deprecated_legacy_json_field_conflicts",
8908            skip_serializing_if = "::core::option::Option::is_none"
8909        )
8910    )]
8911    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
8912    /// Any features defined in the specific edition.
8913    /// WARNING: This field should only be used by protobuf plugins or special
8914    /// cases like the proto compiler. Other uses are discouraged and
8915    /// developers should rely on the protoreflect APIs for their client language.
8916    ///
8917    /// Field 12: `features`
8918    #[cfg_attr(
8919        feature = "json",
8920        serde(
8921            rename = "features",
8922            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
8923        )
8924    )]
8925    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
8926    /// The parser stores options it doesn't recognize here. See above.
8927    ///
8928    /// Field 999: `uninterpreted_option`
8929    #[cfg_attr(
8930        feature = "json",
8931        serde(
8932            rename = "uninterpretedOption",
8933            alias = "uninterpreted_option",
8934            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
8935            deserialize_with = "::buffa::json_helpers::null_as_default"
8936        )
8937    )]
8938    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
8939    #[cfg_attr(feature = "json", serde(flatten))]
8940    #[doc(hidden)]
8941    pub __buffa_unknown_fields: __MessageOptionsExtJson,
8942}
8943impl ::core::fmt::Debug for MessageOptions {
8944    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8945        f.debug_struct("MessageOptions")
8946            .field("message_set_wire_format", &self.message_set_wire_format)
8947            .field(
8948                "no_standard_descriptor_accessor",
8949                &self.no_standard_descriptor_accessor,
8950            )
8951            .field("deprecated", &self.deprecated)
8952            .field("map_entry", &self.map_entry)
8953            .field(
8954                "deprecated_legacy_json_field_conflicts",
8955                &self.deprecated_legacy_json_field_conflicts,
8956            )
8957            .field("features", &self.features)
8958            .field("uninterpreted_option", &self.uninterpreted_option)
8959            .finish()
8960    }
8961}
8962impl MessageOptions {
8963    /// Protobuf type URL for this message, for use with `Any::pack` and
8964    /// `Any::unpack_if`.
8965    ///
8966    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8967    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
8968}
8969impl MessageOptions {
8970    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8971    #[inline]
8972    ///Sets [`Self::message_set_wire_format`] to `Some(value)`, consuming and returning `self`.
8973    pub fn with_message_set_wire_format(mut self, value: bool) -> Self {
8974        self.message_set_wire_format = Some(value);
8975        self
8976    }
8977    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8978    #[inline]
8979    ///Sets [`Self::no_standard_descriptor_accessor`] to `Some(value)`, consuming and returning `self`.
8980    pub fn with_no_standard_descriptor_accessor(mut self, value: bool) -> Self {
8981        self.no_standard_descriptor_accessor = Some(value);
8982        self
8983    }
8984    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8985    #[inline]
8986    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
8987    pub fn with_deprecated(mut self, value: bool) -> Self {
8988        self.deprecated = Some(value);
8989        self
8990    }
8991    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8992    #[inline]
8993    ///Sets [`Self::map_entry`] to `Some(value)`, consuming and returning `self`.
8994    pub fn with_map_entry(mut self, value: bool) -> Self {
8995        self.map_entry = Some(value);
8996        self
8997    }
8998    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
8999    #[inline]
9000    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
9001    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
9002        self.deprecated_legacy_json_field_conflicts = Some(value);
9003        self
9004    }
9005}
9006::buffa::impl_default_instance!(MessageOptions);
9007impl ::buffa::MessageName for MessageOptions {
9008    const PACKAGE: &'static str = "google.protobuf";
9009    const NAME: &'static str = "MessageOptions";
9010    const FULL_NAME: &'static str = "google.protobuf.MessageOptions";
9011    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
9012}
9013impl ::buffa::Message for MessageOptions {
9014    /// Returns the total encoded size in bytes.
9015    ///
9016    /// Accumulates in `u64` (which cannot overflow for in-memory
9017    /// data) and saturates to `u32` at return, so a message whose
9018    /// encoded size exceeds the 2 GiB protobuf limit yields a value
9019    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
9020    /// points reject, never a silently wrapped size.
9021    #[allow(clippy::let_and_return)]
9022    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9023        #[allow(unused_imports)]
9024        use ::buffa::Enumeration as _;
9025        let mut size = 0u64;
9026        if self.message_set_wire_format.is_some() {
9027            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9028        }
9029        if self.no_standard_descriptor_accessor.is_some() {
9030            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9031        }
9032        if self.deprecated.is_some() {
9033            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9034        }
9035        if self.map_entry.is_some() {
9036            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9037        }
9038        if self.deprecated_legacy_json_field_conflicts.is_some() {
9039            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9040        }
9041        if self.features.is_set() {
9042            let __slot = __cache.reserve();
9043            let inner_size = self.features.compute_size(__cache);
9044            __cache.set(__slot, inner_size);
9045            size
9046                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9047                    + inner_size as u64;
9048        }
9049        for v in &self.uninterpreted_option {
9050            let __slot = __cache.reserve();
9051            let inner_size = v.compute_size(__cache);
9052            __cache.set(__slot, inner_size);
9053            size
9054                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9055                    + inner_size as u64;
9056        }
9057        size += self.__buffa_unknown_fields.encoded_len() as u64;
9058        ::buffa::saturate_size(size)
9059    }
9060    fn write_to(
9061        &self,
9062        __cache: &mut ::buffa::SizeCache,
9063        buf: &mut impl ::buffa::EncodeSink,
9064    ) {
9065        #[allow(unused_imports)]
9066        use ::buffa::Enumeration as _;
9067        if let Some(v) = self.message_set_wire_format {
9068            ::buffa::types::put_bool_field(1u32, v, buf);
9069        }
9070        if let Some(v) = self.no_standard_descriptor_accessor {
9071            ::buffa::types::put_bool_field(2u32, v, buf);
9072        }
9073        if let Some(v) = self.deprecated {
9074            ::buffa::types::put_bool_field(3u32, v, buf);
9075        }
9076        if let Some(v) = self.map_entry {
9077            ::buffa::types::put_bool_field(7u32, v, buf);
9078        }
9079        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
9080            ::buffa::types::put_bool_field(11u32, v, buf);
9081        }
9082        if self.features.is_set() {
9083            ::buffa::types::put_len_delimited_header(
9084                12u32,
9085                u64::from(__cache.consume_next()),
9086                buf,
9087            );
9088            self.features.write_to(__cache, buf);
9089        }
9090        for v in &self.uninterpreted_option {
9091            ::buffa::types::put_len_delimited_header(
9092                999u32,
9093                u64::from(__cache.consume_next()),
9094                buf,
9095            );
9096            v.write_to(__cache, buf);
9097        }
9098        self.__buffa_unknown_fields.write_to(buf);
9099    }
9100    fn merge_field(
9101        &mut self,
9102        tag: ::buffa::encoding::Tag,
9103        buf: &mut impl ::buffa::bytes::Buf,
9104        ctx: ::buffa::DecodeContext<'_>,
9105    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9106        #[allow(unused_imports)]
9107        use ::buffa::bytes::Buf as _;
9108        #[allow(unused_imports)]
9109        use ::buffa::Enumeration as _;
9110        match tag.field_number() {
9111            1u32 => {
9112                ::buffa::encoding::check_wire_type(
9113                    tag,
9114                    ::buffa::encoding::WireType::Varint,
9115                )?;
9116                self.message_set_wire_format = ::core::option::Option::Some(
9117                    ::buffa::types::decode_bool(buf)?,
9118                );
9119            }
9120            2u32 => {
9121                ::buffa::encoding::check_wire_type(
9122                    tag,
9123                    ::buffa::encoding::WireType::Varint,
9124                )?;
9125                self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9126                    ::buffa::types::decode_bool(buf)?,
9127                );
9128            }
9129            3u32 => {
9130                ::buffa::encoding::check_wire_type(
9131                    tag,
9132                    ::buffa::encoding::WireType::Varint,
9133                )?;
9134                self.deprecated = ::core::option::Option::Some(
9135                    ::buffa::types::decode_bool(buf)?,
9136                );
9137            }
9138            7u32 => {
9139                ::buffa::encoding::check_wire_type(
9140                    tag,
9141                    ::buffa::encoding::WireType::Varint,
9142                )?;
9143                self.map_entry = ::core::option::Option::Some(
9144                    ::buffa::types::decode_bool(buf)?,
9145                );
9146            }
9147            11u32 => {
9148                ::buffa::encoding::check_wire_type(
9149                    tag,
9150                    ::buffa::encoding::WireType::Varint,
9151                )?;
9152                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9153                    ::buffa::types::decode_bool(buf)?,
9154                );
9155            }
9156            12u32 => {
9157                ::buffa::encoding::check_wire_type(
9158                    tag,
9159                    ::buffa::encoding::WireType::LengthDelimited,
9160                )?;
9161                ::buffa::Message::merge_length_delimited(
9162                    self.features.get_or_insert_default(),
9163                    buf,
9164                    ctx,
9165                )?;
9166            }
9167            999u32 => {
9168                ::buffa::encoding::check_wire_type(
9169                    tag,
9170                    ::buffa::encoding::WireType::LengthDelimited,
9171                )?;
9172                let mut elem = ::core::default::Default::default();
9173                ctx.register_element_memory(
9174                    ::buffa::__private::element_footprint(&elem),
9175                )?;
9176                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
9177                self.uninterpreted_option.push(elem);
9178            }
9179            _ => {
9180                self.__buffa_unknown_fields
9181                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
9182            }
9183        }
9184        ::core::result::Result::Ok(())
9185    }
9186    fn clear(&mut self) {
9187        self.message_set_wire_format = ::core::option::Option::None;
9188        self.no_standard_descriptor_accessor = ::core::option::Option::None;
9189        self.deprecated = ::core::option::Option::None;
9190        self.map_entry = ::core::option::Option::None;
9191        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
9192        self.features = ::buffa::MessageField::none();
9193        self.uninterpreted_option.clear();
9194        self.__buffa_unknown_fields.clear();
9195    }
9196}
9197impl ::buffa::ExtensionSet for MessageOptions {
9198    const PROTO_FQN: &'static str = "google.protobuf.MessageOptions";
9199    fn unknown_fields(&self) -> &::buffa::UnknownFields {
9200        &self.__buffa_unknown_fields
9201    }
9202    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9203        &mut self.__buffa_unknown_fields
9204    }
9205}
9206#[cfg(feature = "text")]
9207impl ::buffa::text::TextFormat for MessageOptions {
9208    fn encode_text(
9209        &self,
9210        enc: &mut ::buffa::text::TextEncoder<'_>,
9211    ) -> ::core::fmt::Result {
9212        #[allow(unused_imports)]
9213        use ::buffa::Enumeration as _;
9214        if let ::core::option::Option::Some(ref __v) = self.message_set_wire_format {
9215            enc.write_field_name("message_set_wire_format")?;
9216            enc.write_bool(*__v)?;
9217        }
9218        if let ::core::option::Option::Some(ref __v) = self
9219            .no_standard_descriptor_accessor
9220        {
9221            enc.write_field_name("no_standard_descriptor_accessor")?;
9222            enc.write_bool(*__v)?;
9223        }
9224        if let ::core::option::Option::Some(ref __v) = self.deprecated {
9225            enc.write_field_name("deprecated")?;
9226            enc.write_bool(*__v)?;
9227        }
9228        if let ::core::option::Option::Some(ref __v) = self.map_entry {
9229            enc.write_field_name("map_entry")?;
9230            enc.write_bool(*__v)?;
9231        }
9232        if let ::core::option::Option::Some(ref __v) = self
9233            .deprecated_legacy_json_field_conflicts
9234        {
9235            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
9236            enc.write_bool(*__v)?;
9237        }
9238        if self.features.is_set() {
9239            enc.write_field_name("features")?;
9240            enc.write_message(&*self.features)?;
9241        }
9242        for __v in &self.uninterpreted_option {
9243            enc.write_field_name("uninterpreted_option")?;
9244            enc.write_message(__v)?;
9245        }
9246        enc.write_extension_fields(
9247            "google.protobuf.MessageOptions",
9248            &self.__buffa_unknown_fields,
9249        )?;
9250        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
9251        ::core::result::Result::Ok(())
9252    }
9253    fn merge_text(
9254        &mut self,
9255        dec: &mut ::buffa::text::TextDecoder<'_>,
9256    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
9257        #[allow(unused_imports)]
9258        use ::buffa::Enumeration as _;
9259        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
9260            match __name {
9261                "message_set_wire_format" => {
9262                    self.message_set_wire_format = ::core::option::Option::Some(
9263                        dec.read_bool()?,
9264                    );
9265                }
9266                "no_standard_descriptor_accessor" => {
9267                    self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9268                        dec.read_bool()?,
9269                    );
9270                }
9271                "deprecated" => {
9272                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
9273                }
9274                "map_entry" => {
9275                    self.map_entry = ::core::option::Option::Some(dec.read_bool()?);
9276                }
9277                "deprecated_legacy_json_field_conflicts" => {
9278                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9279                        dec.read_bool()?,
9280                    );
9281                }
9282                "features" => dec.merge_message(self.features.get_or_insert_default())?,
9283                "uninterpreted_option" => {
9284                    dec.read_repeated_into(
9285                        &mut self.uninterpreted_option,
9286                        |__d| {
9287                            let mut __m = ::core::default::Default::default();
9288                            __d.merge_message(&mut __m)?;
9289                            ::core::result::Result::Ok(__m)
9290                        },
9291                    )?
9292                }
9293                __name if __name.starts_with('[') => {
9294                    for __r in dec
9295                        .read_extension(__name, "google.protobuf.MessageOptions")?
9296                    {
9297                        self.__buffa_unknown_fields.push(__r);
9298                    }
9299                }
9300                _ => dec.skip_value()?,
9301            }
9302        }
9303        ::core::result::Result::Ok(())
9304    }
9305}
9306#[cfg(feature = "json")]
9307impl<'de> serde::Deserialize<'de> for MessageOptions {
9308    fn deserialize<D: serde::Deserializer<'de>>(
9309        d: D,
9310    ) -> ::core::result::Result<Self, D::Error> {
9311        struct _V;
9312        impl<'de> serde::de::Visitor<'de> for _V {
9313            type Value = MessageOptions;
9314            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9315                f.write_str("struct MessageOptions")
9316            }
9317            #[allow(clippy::field_reassign_with_default)]
9318            fn visit_map<A: serde::de::MapAccess<'de>>(
9319                self,
9320                mut map: A,
9321            ) -> ::core::result::Result<MessageOptions, A::Error> {
9322                let mut __f_message_set_wire_format: ::core::option::Option<
9323                    ::core::option::Option<bool>,
9324                > = None;
9325                let mut __f_no_standard_descriptor_accessor: ::core::option::Option<
9326                    ::core::option::Option<bool>,
9327                > = None;
9328                let mut __f_deprecated: ::core::option::Option<
9329                    ::core::option::Option<bool>,
9330                > = None;
9331                let mut __f_map_entry: ::core::option::Option<
9332                    ::core::option::Option<bool>,
9333                > = None;
9334                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
9335                    ::core::option::Option<bool>,
9336                > = None;
9337                let mut __f_features: ::core::option::Option<
9338                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
9339                > = None;
9340                let mut __f_uninterpreted_option: ::core::option::Option<
9341                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
9342                > = None;
9343                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
9344                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
9345                    match key.as_str() {
9346                        "messageSetWireFormat" | "message_set_wire_format" => {
9347                            __f_message_set_wire_format = Some(
9348                                map.next_value::<::core::option::Option<bool>>()?,
9349                            );
9350                        }
9351                        "noStandardDescriptorAccessor"
9352                        | "no_standard_descriptor_accessor" => {
9353                            __f_no_standard_descriptor_accessor = Some(
9354                                map.next_value::<::core::option::Option<bool>>()?,
9355                            );
9356                        }
9357                        "deprecated" => {
9358                            __f_deprecated = Some(
9359                                map.next_value::<::core::option::Option<bool>>()?,
9360                            );
9361                        }
9362                        "mapEntry" | "map_entry" => {
9363                            __f_map_entry = Some(
9364                                map.next_value::<::core::option::Option<bool>>()?,
9365                            );
9366                        }
9367                        "deprecatedLegacyJsonFieldConflicts"
9368                        | "deprecated_legacy_json_field_conflicts" => {
9369                            __f_deprecated_legacy_json_field_conflicts = Some(
9370                                map.next_value::<::core::option::Option<bool>>()?,
9371                            );
9372                        }
9373                        "features" => {
9374                            __f_features = Some(
9375                                map
9376                                    .next_value::<
9377                                        ::buffa::MessageField<
9378                                            FeatureSet,
9379                                            ::buffa::Inline<FeatureSet>,
9380                                        >,
9381                                    >()?,
9382                            );
9383                        }
9384                        "uninterpretedOption" | "uninterpreted_option" => {
9385                            __f_uninterpreted_option = Some({
9386                                struct _S;
9387                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
9388                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
9389                                    fn deserialize<D: serde::Deserializer<'de>>(
9390                                        self,
9391                                        d: D,
9392                                    ) -> ::core::result::Result<
9393                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
9394                                        D::Error,
9395                                    > {
9396                                        ::buffa::json_helpers::null_as_default(d)
9397                                    }
9398                                }
9399                                map.next_value_seed(_S)?
9400                            });
9401                        }
9402                        __k if __k.starts_with('[') => {
9403                            let __v: ::buffa::serde_json::Value = map.next_value()?;
9404                            match ::buffa::extension_registry::deserialize_extension_key(
9405                                "google.protobuf.MessageOptions",
9406                                __k,
9407                                __v,
9408                            ) {
9409                                ::core::option::Option::Some(
9410                                    ::core::result::Result::Ok(__recs),
9411                                ) => {
9412                                    for __rec in __recs {
9413                                        __ext_records.push(__rec);
9414                                    }
9415                                }
9416                                ::core::option::Option::Some(
9417                                    ::core::result::Result::Err(__e),
9418                                ) => {
9419                                    return ::core::result::Result::Err(
9420                                        <A::Error as ::serde::de::Error>::custom(__e),
9421                                    );
9422                                }
9423                                ::core::option::Option::None => {}
9424                            }
9425                        }
9426                        _ => {
9427                            map.next_value::<serde::de::IgnoredAny>()?;
9428                        }
9429                    }
9430                }
9431                let mut __r = <MessageOptions as ::core::default::Default>::default();
9432                if let ::core::option::Option::Some(v) = __f_message_set_wire_format {
9433                    __r.message_set_wire_format = v;
9434                }
9435                if let ::core::option::Option::Some(v) = __f_no_standard_descriptor_accessor {
9436                    __r.no_standard_descriptor_accessor = v;
9437                }
9438                if let ::core::option::Option::Some(v) = __f_deprecated {
9439                    __r.deprecated = v;
9440                }
9441                if let ::core::option::Option::Some(v) = __f_map_entry {
9442                    __r.map_entry = v;
9443                }
9444                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
9445                    __r.deprecated_legacy_json_field_conflicts = v;
9446                }
9447                if let ::core::option::Option::Some(v) = __f_features {
9448                    __r.features = v;
9449                }
9450                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
9451                    __r.uninterpreted_option = v;
9452                }
9453                for __rec in __ext_records {
9454                    __r.__buffa_unknown_fields.push(__rec);
9455                }
9456                Ok(__r)
9457            }
9458        }
9459        d.deserialize_map(_V)
9460    }
9461}
9462#[cfg(feature = "json")]
9463impl ::buffa::json_helpers::ProtoElemJson for MessageOptions {
9464    fn serialize_proto_json<S: ::serde::Serializer>(
9465        v: &Self,
9466        s: S,
9467    ) -> ::core::result::Result<S::Ok, S::Error> {
9468        ::serde::Serialize::serialize(v, s)
9469    }
9470    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9471        d: D,
9472    ) -> ::core::result::Result<Self, D::Error> {
9473        <Self as ::serde::Deserialize>::deserialize(d)
9474    }
9475}
9476#[doc(hidden)]
9477#[derive(Clone, Debug, Default, PartialEq)]
9478#[repr(transparent)]
9479#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9480pub struct __MessageOptionsExtJson(pub ::buffa::UnknownFields);
9481impl ::core::ops::Deref for __MessageOptionsExtJson {
9482    type Target = ::buffa::UnknownFields;
9483    fn deref(&self) -> &::buffa::UnknownFields {
9484        &self.0
9485    }
9486}
9487impl ::core::ops::DerefMut for __MessageOptionsExtJson {
9488    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
9489        &mut self.0
9490    }
9491}
9492impl ::core::convert::From<::buffa::UnknownFields> for __MessageOptionsExtJson {
9493    fn from(u: ::buffa::UnknownFields) -> Self {
9494        Self(u)
9495    }
9496}
9497#[cfg(feature = "json")]
9498impl ::serde::Serialize for __MessageOptionsExtJson {
9499    fn serialize<S: ::serde::Serializer>(
9500        &self,
9501        s: S,
9502    ) -> ::core::result::Result<S::Ok, S::Error> {
9503        ::buffa::extension_registry::serialize_extensions(
9504            "google.protobuf.MessageOptions",
9505            &self.0,
9506            s,
9507        )
9508    }
9509}
9510#[cfg(feature = "json")]
9511impl<'de> ::serde::Deserialize<'de> for __MessageOptionsExtJson {
9512    fn deserialize<D: ::serde::Deserializer<'de>>(
9513        d: D,
9514    ) -> ::core::result::Result<Self, D::Error> {
9515        ::buffa::extension_registry::deserialize_extensions(
9516                "google.protobuf.MessageOptions",
9517                d,
9518            )
9519            .map(Self)
9520    }
9521}
9522#[cfg(feature = "json")]
9523#[doc(hidden)]
9524pub const __MESSAGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9525    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9526    to_json: ::buffa::type_registry::any_to_json::<MessageOptions>,
9527    from_json: ::buffa::type_registry::any_from_json::<MessageOptions>,
9528    is_wkt: false,
9529};
9530#[cfg(feature = "text")]
9531#[doc(hidden)]
9532pub const __MESSAGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
9533    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
9534    text_encode: ::buffa::type_registry::any_encode_text::<MessageOptions>,
9535    text_merge: ::buffa::type_registry::any_merge_text::<MessageOptions>,
9536};
9537#[derive(Clone, PartialEq, Default)]
9538#[cfg_attr(feature = "json", derive(::serde::Serialize))]
9539#[cfg_attr(feature = "json", serde(default))]
9540#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9541pub struct FieldOptions {
9542    /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
9543    /// The ctype option instructs the C++ code generator to use a different
9544    /// representation of the field than it normally would.  See the specific
9545    /// options below.  This option is only implemented to support use of
9546    /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
9547    /// type "bytes" in the open source release.
9548    /// TODO: make ctype actually deprecated.
9549    ///
9550    /// Field 1: `ctype`
9551    #[cfg_attr(
9552        feature = "json",
9553        serde(
9554            rename = "ctype",
9555            with = "::buffa::json_helpers::opt_closed_enum",
9556            skip_serializing_if = "::core::option::Option::is_none"
9557        )
9558    )]
9559    pub ctype: ::core::option::Option<field_options::CType>,
9560    /// The packed option can be enabled for repeated primitive fields to enable
9561    /// a more efficient representation on the wire. Rather than repeatedly
9562    /// writing the tag and type for each element, the entire array is encoded as
9563    /// a single length-delimited blob. In proto3, only explicit setting it to
9564    /// false will avoid using packed encoding.  This option is prohibited in
9565    /// Editions, but the `repeated_field_encoding` feature can be used to control
9566    /// the behavior.
9567    ///
9568    /// Field 2: `packed`
9569    #[cfg_attr(
9570        feature = "json",
9571        serde(rename = "packed", skip_serializing_if = "::core::option::Option::is_none")
9572    )]
9573    pub packed: ::core::option::Option<bool>,
9574    /// The jstype option determines the JavaScript type used for values of the
9575    /// field.  The option is permitted only for 64 bit integral and fixed types
9576    /// (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
9577    /// is represented as JavaScript string, which avoids loss of precision that
9578    /// can happen when a large value is converted to a floating point JavaScript.
9579    /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
9580    /// use the JavaScript "number" type.  The behavior of the default option
9581    /// JS_NORMAL is implementation dependent.
9582    ///
9583    /// This option is an enum to permit additional types to be added, e.g.
9584    /// goog.math.Integer.
9585    ///
9586    /// Field 6: `jstype`
9587    #[cfg_attr(
9588        feature = "json",
9589        serde(
9590            rename = "jstype",
9591            with = "::buffa::json_helpers::opt_closed_enum",
9592            skip_serializing_if = "::core::option::Option::is_none"
9593        )
9594    )]
9595    pub jstype: ::core::option::Option<field_options::JSType>,
9596    /// Should this field be parsed lazily?  Lazy applies only to message-type
9597    /// fields.  It means that when the outer message is initially parsed, the
9598    /// inner message's contents will not be parsed but instead stored in encoded
9599    /// form.  The inner message will actually be parsed when it is first accessed.
9600    ///
9601    /// This is only a hint.  Implementations are free to choose whether to use
9602    /// eager or lazy parsing regardless of the value of this option.  However,
9603    /// setting this option true suggests that the protocol author believes that
9604    /// using lazy parsing on this field is worth the additional bookkeeping
9605    /// overhead typically needed to implement it.
9606    ///
9607    /// This option does not affect the public interface of any generated code;
9608    /// all method signatures remain the same.  Furthermore, thread-safety of the
9609    /// interface is not affected by this option; const methods remain safe to
9610    /// call from multiple threads concurrently, while non-const methods continue
9611    /// to require exclusive access.
9612    ///
9613    /// Note that lazy message fields are still eagerly verified to check
9614    /// ill-formed wireformat or missing required fields. Calling IsInitialized()
9615    /// on the outer message would fail if the inner message has missing required
9616    /// fields. Failed verification would result in parsing failure (except when
9617    /// uninitialized messages are acceptable).
9618    ///
9619    /// Field 5: `lazy`
9620    #[cfg_attr(
9621        feature = "json",
9622        serde(rename = "lazy", skip_serializing_if = "::core::option::Option::is_none")
9623    )]
9624    pub lazy: ::core::option::Option<bool>,
9625    /// unverified_lazy does no correctness checks on the byte stream. This should
9626    /// only be used where lazy with verification is prohibitive for performance
9627    /// reasons.
9628    ///
9629    /// Field 15: `unverified_lazy`
9630    #[cfg_attr(
9631        feature = "json",
9632        serde(
9633            rename = "unverifiedLazy",
9634            alias = "unverified_lazy",
9635            skip_serializing_if = "::core::option::Option::is_none"
9636        )
9637    )]
9638    pub unverified_lazy: ::core::option::Option<bool>,
9639    /// Is this field deprecated?
9640    /// Depending on the target platform, this can emit Deprecated annotations
9641    /// for accessors, or it will be completely ignored; in the very least, this
9642    /// is a formalization for deprecating fields.
9643    ///
9644    /// Field 3: `deprecated`
9645    #[cfg_attr(
9646        feature = "json",
9647        serde(
9648            rename = "deprecated",
9649            skip_serializing_if = "::core::option::Option::is_none"
9650        )
9651    )]
9652    pub deprecated: ::core::option::Option<bool>,
9653    /// DEPRECATED. DO NOT USE!
9654    /// For Google-internal migration only. Do not use.
9655    ///
9656    /// Field 10: `weak`
9657    #[cfg_attr(
9658        feature = "json",
9659        serde(rename = "weak", skip_serializing_if = "::core::option::Option::is_none")
9660    )]
9661    pub weak: ::core::option::Option<bool>,
9662    /// Indicate that the field value should not be printed out when using debug
9663    /// formats, e.g. when the field contains sensitive credentials.
9664    ///
9665    /// Field 16: `debug_redact`
9666    #[cfg_attr(
9667        feature = "json",
9668        serde(
9669            rename = "debugRedact",
9670            alias = "debug_redact",
9671            skip_serializing_if = "::core::option::Option::is_none"
9672        )
9673    )]
9674    pub debug_redact: ::core::option::Option<bool>,
9675    /// Field 17: `retention`
9676    #[cfg_attr(
9677        feature = "json",
9678        serde(
9679            rename = "retention",
9680            with = "::buffa::json_helpers::opt_closed_enum",
9681            skip_serializing_if = "::core::option::Option::is_none"
9682        )
9683    )]
9684    pub retention: ::core::option::Option<field_options::OptionRetention>,
9685    /// Field 19: `targets`
9686    #[cfg_attr(
9687        feature = "json",
9688        serde(
9689            rename = "targets",
9690            with = "::buffa::json_helpers::repeated_closed_enum",
9691            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
9692        )
9693    )]
9694    pub targets: ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
9695    /// Field 20: `edition_defaults`
9696    #[cfg_attr(
9697        feature = "json",
9698        serde(
9699            rename = "editionDefaults",
9700            alias = "edition_defaults",
9701            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9702            deserialize_with = "::buffa::json_helpers::null_as_default"
9703        )
9704    )]
9705    pub edition_defaults: ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
9706    /// Any features defined in the specific edition.
9707    /// WARNING: This field should only be used by protobuf plugins or special
9708    /// cases like the proto compiler. Other uses are discouraged and
9709    /// developers should rely on the protoreflect APIs for their client language.
9710    ///
9711    /// Field 21: `features`
9712    #[cfg_attr(
9713        feature = "json",
9714        serde(
9715            rename = "features",
9716            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9717        )
9718    )]
9719    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
9720    /// Field 22: `feature_support`
9721    #[cfg_attr(
9722        feature = "json",
9723        serde(
9724            rename = "featureSupport",
9725            alias = "feature_support",
9726            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9727        )
9728    )]
9729    pub feature_support: ::buffa::MessageField<
9730        field_options::FeatureSupport,
9731        ::buffa::Inline<field_options::FeatureSupport>,
9732    >,
9733    /// The parser stores options it doesn't recognize here. See above.
9734    ///
9735    /// Field 999: `uninterpreted_option`
9736    #[cfg_attr(
9737        feature = "json",
9738        serde(
9739            rename = "uninterpretedOption",
9740            alias = "uninterpreted_option",
9741            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9742            deserialize_with = "::buffa::json_helpers::null_as_default"
9743        )
9744    )]
9745    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
9746    #[cfg_attr(feature = "json", serde(flatten))]
9747    #[doc(hidden)]
9748    pub __buffa_unknown_fields: __FieldOptionsExtJson,
9749}
9750impl ::core::fmt::Debug for FieldOptions {
9751    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9752        f.debug_struct("FieldOptions")
9753            .field("ctype", &self.ctype)
9754            .field("packed", &self.packed)
9755            .field("jstype", &self.jstype)
9756            .field("lazy", &self.lazy)
9757            .field("unverified_lazy", &self.unverified_lazy)
9758            .field("deprecated", &self.deprecated)
9759            .field("weak", &self.weak)
9760            .field("debug_redact", &self.debug_redact)
9761            .field("retention", &self.retention)
9762            .field("targets", &self.targets)
9763            .field("edition_defaults", &self.edition_defaults)
9764            .field("features", &self.features)
9765            .field("feature_support", &self.feature_support)
9766            .field("uninterpreted_option", &self.uninterpreted_option)
9767            .finish()
9768    }
9769}
9770impl FieldOptions {
9771    /// Protobuf type URL for this message, for use with `Any::pack` and
9772    /// `Any::unpack_if`.
9773    ///
9774    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9775    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9776}
9777impl FieldOptions {
9778    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9779    #[inline]
9780    ///Sets [`Self::ctype`] to `Some(value)`, consuming and returning `self`.
9781    pub fn with_ctype(mut self, value: impl Into<field_options::CType>) -> Self {
9782        self.ctype = Some(value.into());
9783        self
9784    }
9785    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9786    #[inline]
9787    ///Sets [`Self::packed`] to `Some(value)`, consuming and returning `self`.
9788    pub fn with_packed(mut self, value: bool) -> Self {
9789        self.packed = Some(value);
9790        self
9791    }
9792    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9793    #[inline]
9794    ///Sets [`Self::jstype`] to `Some(value)`, consuming and returning `self`.
9795    pub fn with_jstype(mut self, value: impl Into<field_options::JSType>) -> Self {
9796        self.jstype = Some(value.into());
9797        self
9798    }
9799    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9800    #[inline]
9801    ///Sets [`Self::lazy`] to `Some(value)`, consuming and returning `self`.
9802    pub fn with_lazy(mut self, value: bool) -> Self {
9803        self.lazy = Some(value);
9804        self
9805    }
9806    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9807    #[inline]
9808    ///Sets [`Self::unverified_lazy`] to `Some(value)`, consuming and returning `self`.
9809    pub fn with_unverified_lazy(mut self, value: bool) -> Self {
9810        self.unverified_lazy = Some(value);
9811        self
9812    }
9813    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9814    #[inline]
9815    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
9816    pub fn with_deprecated(mut self, value: bool) -> Self {
9817        self.deprecated = Some(value);
9818        self
9819    }
9820    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9821    #[inline]
9822    ///Sets [`Self::weak`] to `Some(value)`, consuming and returning `self`.
9823    pub fn with_weak(mut self, value: bool) -> Self {
9824        self.weak = Some(value);
9825        self
9826    }
9827    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9828    #[inline]
9829    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
9830    pub fn with_debug_redact(mut self, value: bool) -> Self {
9831        self.debug_redact = Some(value);
9832        self
9833    }
9834    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9835    #[inline]
9836    ///Sets [`Self::retention`] to `Some(value)`, consuming and returning `self`.
9837    pub fn with_retention(
9838        mut self,
9839        value: impl Into<field_options::OptionRetention>,
9840    ) -> Self {
9841        self.retention = Some(value.into());
9842        self
9843    }
9844}
9845::buffa::impl_default_instance!(FieldOptions);
9846impl ::buffa::MessageName for FieldOptions {
9847    const PACKAGE: &'static str = "google.protobuf";
9848    const NAME: &'static str = "FieldOptions";
9849    const FULL_NAME: &'static str = "google.protobuf.FieldOptions";
9850    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
9851}
9852impl ::buffa::Message for FieldOptions {
9853    /// Returns the total encoded size in bytes.
9854    ///
9855    /// Accumulates in `u64` (which cannot overflow for in-memory
9856    /// data) and saturates to `u32` at return, so a message whose
9857    /// encoded size exceeds the 2 GiB protobuf limit yields a value
9858    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
9859    /// points reject, never a silently wrapped size.
9860    #[allow(clippy::let_and_return)]
9861    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9862        #[allow(unused_imports)]
9863        use ::buffa::Enumeration as _;
9864        let mut size = 0u64;
9865        if let Some(ref v) = self.ctype {
9866            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9867        }
9868        if self.packed.is_some() {
9869            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9870        }
9871        if self.deprecated.is_some() {
9872            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9873        }
9874        if self.lazy.is_some() {
9875            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9876        }
9877        if let Some(ref v) = self.jstype {
9878            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9879        }
9880        if self.weak.is_some() {
9881            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9882        }
9883        if self.unverified_lazy.is_some() {
9884            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9885        }
9886        if self.debug_redact.is_some() {
9887            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
9888        }
9889        if let Some(ref v) = self.retention {
9890            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9891        }
9892        for v in &self.targets {
9893            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
9894        }
9895        for v in &self.edition_defaults {
9896            let __slot = __cache.reserve();
9897            let inner_size = v.compute_size(__cache);
9898            __cache.set(__slot, inner_size);
9899            size
9900                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9901                    + inner_size as u64;
9902        }
9903        if self.features.is_set() {
9904            let __slot = __cache.reserve();
9905            let inner_size = self.features.compute_size(__cache);
9906            __cache.set(__slot, inner_size);
9907            size
9908                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9909                    + inner_size as u64;
9910        }
9911        if self.feature_support.is_set() {
9912            let __slot = __cache.reserve();
9913            let inner_size = self.feature_support.compute_size(__cache);
9914            __cache.set(__slot, inner_size);
9915            size
9916                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9917                    + inner_size as u64;
9918        }
9919        for v in &self.uninterpreted_option {
9920            let __slot = __cache.reserve();
9921            let inner_size = v.compute_size(__cache);
9922            __cache.set(__slot, inner_size);
9923            size
9924                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
9925                    + inner_size as u64;
9926        }
9927        size += self.__buffa_unknown_fields.encoded_len() as u64;
9928        ::buffa::saturate_size(size)
9929    }
9930    fn write_to(
9931        &self,
9932        __cache: &mut ::buffa::SizeCache,
9933        buf: &mut impl ::buffa::EncodeSink,
9934    ) {
9935        #[allow(unused_imports)]
9936        use ::buffa::Enumeration as _;
9937        if let Some(ref v) = self.ctype {
9938            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
9939        }
9940        if let Some(v) = self.packed {
9941            ::buffa::types::put_bool_field(2u32, v, buf);
9942        }
9943        if let Some(v) = self.deprecated {
9944            ::buffa::types::put_bool_field(3u32, v, buf);
9945        }
9946        if let Some(v) = self.lazy {
9947            ::buffa::types::put_bool_field(5u32, v, buf);
9948        }
9949        if let Some(ref v) = self.jstype {
9950            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
9951        }
9952        if let Some(v) = self.weak {
9953            ::buffa::types::put_bool_field(10u32, v, buf);
9954        }
9955        if let Some(v) = self.unverified_lazy {
9956            ::buffa::types::put_bool_field(15u32, v, buf);
9957        }
9958        if let Some(v) = self.debug_redact {
9959            ::buffa::types::put_bool_field(16u32, v, buf);
9960        }
9961        if let Some(ref v) = self.retention {
9962            ::buffa::types::put_int32_field(17u32, v.to_i32(), buf);
9963        }
9964        for v in &self.targets {
9965            ::buffa::types::put_int32_field(19u32, v.to_i32(), buf);
9966        }
9967        for v in &self.edition_defaults {
9968            ::buffa::types::put_len_delimited_header(
9969                20u32,
9970                u64::from(__cache.consume_next()),
9971                buf,
9972            );
9973            v.write_to(__cache, buf);
9974        }
9975        if self.features.is_set() {
9976            ::buffa::types::put_len_delimited_header(
9977                21u32,
9978                u64::from(__cache.consume_next()),
9979                buf,
9980            );
9981            self.features.write_to(__cache, buf);
9982        }
9983        if self.feature_support.is_set() {
9984            ::buffa::types::put_len_delimited_header(
9985                22u32,
9986                u64::from(__cache.consume_next()),
9987                buf,
9988            );
9989            self.feature_support.write_to(__cache, buf);
9990        }
9991        for v in &self.uninterpreted_option {
9992            ::buffa::types::put_len_delimited_header(
9993                999u32,
9994                u64::from(__cache.consume_next()),
9995                buf,
9996            );
9997            v.write_to(__cache, buf);
9998        }
9999        self.__buffa_unknown_fields.write_to(buf);
10000    }
10001    fn merge_field(
10002        &mut self,
10003        tag: ::buffa::encoding::Tag,
10004        buf: &mut impl ::buffa::bytes::Buf,
10005        ctx: ::buffa::DecodeContext<'_>,
10006    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10007        #[allow(unused_imports)]
10008        use ::buffa::bytes::Buf as _;
10009        #[allow(unused_imports)]
10010        use ::buffa::Enumeration as _;
10011        match tag.field_number() {
10012            1u32 => {
10013                ::buffa::encoding::check_wire_type(
10014                    tag,
10015                    ::buffa::encoding::WireType::Varint,
10016                )?;
10017                let __raw = ::buffa::types::decode_int32(buf)?;
10018                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10019                    __raw,
10020                ) {
10021                    self.ctype = ::core::option::Option::Some(__v);
10022                } else {
10023                    ctx.register_unknown_field()?;
10024                    self.__buffa_unknown_fields
10025                        .push(::buffa::UnknownField {
10026                            number: 1u32,
10027                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10028                        });
10029                }
10030            }
10031            2u32 => {
10032                ::buffa::encoding::check_wire_type(
10033                    tag,
10034                    ::buffa::encoding::WireType::Varint,
10035                )?;
10036                self.packed = ::core::option::Option::Some(
10037                    ::buffa::types::decode_bool(buf)?,
10038                );
10039            }
10040            3u32 => {
10041                ::buffa::encoding::check_wire_type(
10042                    tag,
10043                    ::buffa::encoding::WireType::Varint,
10044                )?;
10045                self.deprecated = ::core::option::Option::Some(
10046                    ::buffa::types::decode_bool(buf)?,
10047                );
10048            }
10049            5u32 => {
10050                ::buffa::encoding::check_wire_type(
10051                    tag,
10052                    ::buffa::encoding::WireType::Varint,
10053                )?;
10054                self.lazy = ::core::option::Option::Some(
10055                    ::buffa::types::decode_bool(buf)?,
10056                );
10057            }
10058            6u32 => {
10059                ::buffa::encoding::check_wire_type(
10060                    tag,
10061                    ::buffa::encoding::WireType::Varint,
10062                )?;
10063                let __raw = ::buffa::types::decode_int32(buf)?;
10064                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10065                    __raw,
10066                ) {
10067                    self.jstype = ::core::option::Option::Some(__v);
10068                } else {
10069                    ctx.register_unknown_field()?;
10070                    self.__buffa_unknown_fields
10071                        .push(::buffa::UnknownField {
10072                            number: 6u32,
10073                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10074                        });
10075                }
10076            }
10077            10u32 => {
10078                ::buffa::encoding::check_wire_type(
10079                    tag,
10080                    ::buffa::encoding::WireType::Varint,
10081                )?;
10082                self.weak = ::core::option::Option::Some(
10083                    ::buffa::types::decode_bool(buf)?,
10084                );
10085            }
10086            15u32 => {
10087                ::buffa::encoding::check_wire_type(
10088                    tag,
10089                    ::buffa::encoding::WireType::Varint,
10090                )?;
10091                self.unverified_lazy = ::core::option::Option::Some(
10092                    ::buffa::types::decode_bool(buf)?,
10093                );
10094            }
10095            16u32 => {
10096                ::buffa::encoding::check_wire_type(
10097                    tag,
10098                    ::buffa::encoding::WireType::Varint,
10099                )?;
10100                self.debug_redact = ::core::option::Option::Some(
10101                    ::buffa::types::decode_bool(buf)?,
10102                );
10103            }
10104            17u32 => {
10105                ::buffa::encoding::check_wire_type(
10106                    tag,
10107                    ::buffa::encoding::WireType::Varint,
10108                )?;
10109                let __raw = ::buffa::types::decode_int32(buf)?;
10110                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10111                    __raw,
10112                ) {
10113                    self.retention = ::core::option::Option::Some(__v);
10114                } else {
10115                    ctx.register_unknown_field()?;
10116                    self.__buffa_unknown_fields
10117                        .push(::buffa::UnknownField {
10118                            number: 17u32,
10119                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10120                        });
10121                }
10122            }
10123            19u32 => {
10124                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
10125                    let len = ::buffa::encoding::decode_varint(buf)?;
10126                    let len = usize::try_from(len)
10127                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
10128                    if buf.remaining() < len {
10129                        return ::core::result::Result::Err(
10130                            ::buffa::DecodeError::UnexpectedEof,
10131                        );
10132                    }
10133                    self.targets.reserve(len);
10134                    let mut limited = buf.take(len);
10135                    while limited.has_remaining() {
10136                        let __raw = ::buffa::types::decode_int32(&mut limited)?;
10137                        if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10138                            __raw,
10139                        ) {
10140                            self.targets.push(__v);
10141                        } else {
10142                            ctx.register_unknown_field()?;
10143                            self.__buffa_unknown_fields
10144                                .push(::buffa::UnknownField {
10145                                    number: 19u32,
10146                                    data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10147                                });
10148                        }
10149                    }
10150                    let leftover = limited.remaining();
10151                    if leftover > 0 {
10152                        limited.advance(leftover);
10153                    }
10154                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
10155                    let __raw = ::buffa::types::decode_int32(buf)?;
10156                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10157                        __raw,
10158                    ) {
10159                        self.targets.push(__v);
10160                    } else {
10161                        ctx.register_unknown_field()?;
10162                        self.__buffa_unknown_fields
10163                            .push(::buffa::UnknownField {
10164                                number: 19u32,
10165                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10166                            });
10167                    }
10168                } else {
10169                    return ::core::result::Result::Err(
10170                        ::buffa::encoding::wire_type_mismatch(
10171                            tag,
10172                            ::buffa::encoding::WireType::LengthDelimited,
10173                        ),
10174                    );
10175                }
10176            }
10177            20u32 => {
10178                ::buffa::encoding::check_wire_type(
10179                    tag,
10180                    ::buffa::encoding::WireType::LengthDelimited,
10181                )?;
10182                let mut elem = ::core::default::Default::default();
10183                ctx.register_element_memory(
10184                    ::buffa::__private::element_footprint(&elem),
10185                )?;
10186                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
10187                self.edition_defaults.push(elem);
10188            }
10189            21u32 => {
10190                ::buffa::encoding::check_wire_type(
10191                    tag,
10192                    ::buffa::encoding::WireType::LengthDelimited,
10193                )?;
10194                ::buffa::Message::merge_length_delimited(
10195                    self.features.get_or_insert_default(),
10196                    buf,
10197                    ctx,
10198                )?;
10199            }
10200            22u32 => {
10201                ::buffa::encoding::check_wire_type(
10202                    tag,
10203                    ::buffa::encoding::WireType::LengthDelimited,
10204                )?;
10205                ::buffa::Message::merge_length_delimited(
10206                    self.feature_support.get_or_insert_default(),
10207                    buf,
10208                    ctx,
10209                )?;
10210            }
10211            999u32 => {
10212                ::buffa::encoding::check_wire_type(
10213                    tag,
10214                    ::buffa::encoding::WireType::LengthDelimited,
10215                )?;
10216                let mut elem = ::core::default::Default::default();
10217                ctx.register_element_memory(
10218                    ::buffa::__private::element_footprint(&elem),
10219                )?;
10220                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
10221                self.uninterpreted_option.push(elem);
10222            }
10223            _ => {
10224                self.__buffa_unknown_fields
10225                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
10226            }
10227        }
10228        ::core::result::Result::Ok(())
10229    }
10230    fn clear(&mut self) {
10231        self.ctype = ::core::option::Option::None;
10232        self.packed = ::core::option::Option::None;
10233        self.deprecated = ::core::option::Option::None;
10234        self.lazy = ::core::option::Option::None;
10235        self.jstype = ::core::option::Option::None;
10236        self.weak = ::core::option::Option::None;
10237        self.unverified_lazy = ::core::option::Option::None;
10238        self.debug_redact = ::core::option::Option::None;
10239        self.retention = ::core::option::Option::None;
10240        self.targets.clear();
10241        self.edition_defaults.clear();
10242        self.features = ::buffa::MessageField::none();
10243        self.feature_support = ::buffa::MessageField::none();
10244        self.uninterpreted_option.clear();
10245        self.__buffa_unknown_fields.clear();
10246    }
10247}
10248impl ::buffa::ExtensionSet for FieldOptions {
10249    const PROTO_FQN: &'static str = "google.protobuf.FieldOptions";
10250    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10251        &self.__buffa_unknown_fields
10252    }
10253    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10254        &mut self.__buffa_unknown_fields
10255    }
10256}
10257#[cfg(feature = "text")]
10258impl ::buffa::text::TextFormat for FieldOptions {
10259    fn encode_text(
10260        &self,
10261        enc: &mut ::buffa::text::TextEncoder<'_>,
10262    ) -> ::core::fmt::Result {
10263        #[allow(unused_imports)]
10264        use ::buffa::Enumeration as _;
10265        if let ::core::option::Option::Some(ref __v) = self.ctype {
10266            enc.write_field_name("ctype")?;
10267            enc.write_enum_name(__v.proto_name())?;
10268        }
10269        if let ::core::option::Option::Some(ref __v) = self.packed {
10270            enc.write_field_name("packed")?;
10271            enc.write_bool(*__v)?;
10272        }
10273        if let ::core::option::Option::Some(ref __v) = self.jstype {
10274            enc.write_field_name("jstype")?;
10275            enc.write_enum_name(__v.proto_name())?;
10276        }
10277        if let ::core::option::Option::Some(ref __v) = self.lazy {
10278            enc.write_field_name("lazy")?;
10279            enc.write_bool(*__v)?;
10280        }
10281        if let ::core::option::Option::Some(ref __v) = self.unverified_lazy {
10282            enc.write_field_name("unverified_lazy")?;
10283            enc.write_bool(*__v)?;
10284        }
10285        if let ::core::option::Option::Some(ref __v) = self.deprecated {
10286            enc.write_field_name("deprecated")?;
10287            enc.write_bool(*__v)?;
10288        }
10289        if let ::core::option::Option::Some(ref __v) = self.weak {
10290            enc.write_field_name("weak")?;
10291            enc.write_bool(*__v)?;
10292        }
10293        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
10294            enc.write_field_name("debug_redact")?;
10295            enc.write_bool(*__v)?;
10296        }
10297        if let ::core::option::Option::Some(ref __v) = self.retention {
10298            enc.write_field_name("retention")?;
10299            enc.write_enum_name(__v.proto_name())?;
10300        }
10301        if self.features.is_set() {
10302            enc.write_field_name("features")?;
10303            enc.write_message(&*self.features)?;
10304        }
10305        if self.feature_support.is_set() {
10306            enc.write_field_name("feature_support")?;
10307            enc.write_message(&*self.feature_support)?;
10308        }
10309        for __v in &self.targets {
10310            enc.write_field_name("targets")?;
10311            enc.write_enum_name(__v.proto_name())?;
10312        }
10313        for __v in &self.edition_defaults {
10314            enc.write_field_name("edition_defaults")?;
10315            enc.write_message(__v)?;
10316        }
10317        for __v in &self.uninterpreted_option {
10318            enc.write_field_name("uninterpreted_option")?;
10319            enc.write_message(__v)?;
10320        }
10321        enc.write_extension_fields(
10322            "google.protobuf.FieldOptions",
10323            &self.__buffa_unknown_fields,
10324        )?;
10325        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
10326        ::core::result::Result::Ok(())
10327    }
10328    fn merge_text(
10329        &mut self,
10330        dec: &mut ::buffa::text::TextDecoder<'_>,
10331    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
10332        #[allow(unused_imports)]
10333        use ::buffa::Enumeration as _;
10334        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
10335            match __name {
10336                "ctype" => {
10337                    self.ctype = ::core::option::Option::Some(
10338                        dec.read_closed_enum_by_name::<field_options::CType>()?,
10339                    );
10340                }
10341                "packed" => self.packed = ::core::option::Option::Some(dec.read_bool()?),
10342                "jstype" => {
10343                    self.jstype = ::core::option::Option::Some(
10344                        dec.read_closed_enum_by_name::<field_options::JSType>()?,
10345                    );
10346                }
10347                "lazy" => self.lazy = ::core::option::Option::Some(dec.read_bool()?),
10348                "unverified_lazy" => {
10349                    self.unverified_lazy = ::core::option::Option::Some(dec.read_bool()?);
10350                }
10351                "deprecated" => {
10352                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
10353                }
10354                "weak" => self.weak = ::core::option::Option::Some(dec.read_bool()?),
10355                "debug_redact" => {
10356                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
10357                }
10358                "retention" => {
10359                    self.retention = ::core::option::Option::Some(
10360                        dec.read_closed_enum_by_name::<field_options::OptionRetention>()?,
10361                    );
10362                }
10363                "features" => dec.merge_message(self.features.get_or_insert_default())?,
10364                "feature_support" => {
10365                    dec.merge_message(self.feature_support.get_or_insert_default())?
10366                }
10367                "targets" => {
10368                    dec.read_repeated_into(
10369                        &mut self.targets,
10370                        |__d| {
10371                            __d
10372                                .read_closed_enum_by_name::<
10373                                    field_options::OptionTargetType,
10374                                >()
10375                        },
10376                    )?
10377                }
10378                "edition_defaults" => {
10379                    dec.read_repeated_into(
10380                        &mut self.edition_defaults,
10381                        |__d| {
10382                            let mut __m = ::core::default::Default::default();
10383                            __d.merge_message(&mut __m)?;
10384                            ::core::result::Result::Ok(__m)
10385                        },
10386                    )?
10387                }
10388                "uninterpreted_option" => {
10389                    dec.read_repeated_into(
10390                        &mut self.uninterpreted_option,
10391                        |__d| {
10392                            let mut __m = ::core::default::Default::default();
10393                            __d.merge_message(&mut __m)?;
10394                            ::core::result::Result::Ok(__m)
10395                        },
10396                    )?
10397                }
10398                __name if __name.starts_with('[') => {
10399                    for __r in dec
10400                        .read_extension(__name, "google.protobuf.FieldOptions")?
10401                    {
10402                        self.__buffa_unknown_fields.push(__r);
10403                    }
10404                }
10405                _ => dec.skip_value()?,
10406            }
10407        }
10408        ::core::result::Result::Ok(())
10409    }
10410}
10411#[cfg(feature = "json")]
10412impl<'de> serde::Deserialize<'de> for FieldOptions {
10413    fn deserialize<D: serde::Deserializer<'de>>(
10414        d: D,
10415    ) -> ::core::result::Result<Self, D::Error> {
10416        struct _V;
10417        impl<'de> serde::de::Visitor<'de> for _V {
10418            type Value = FieldOptions;
10419            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10420                f.write_str("struct FieldOptions")
10421            }
10422            #[allow(clippy::field_reassign_with_default)]
10423            fn visit_map<A: serde::de::MapAccess<'de>>(
10424                self,
10425                mut map: A,
10426            ) -> ::core::result::Result<FieldOptions, A::Error> {
10427                let mut __f_ctype: ::core::option::Option<
10428                    ::core::option::Option<field_options::CType>,
10429                > = None;
10430                let mut __f_packed: ::core::option::Option<
10431                    ::core::option::Option<bool>,
10432                > = None;
10433                let mut __f_jstype: ::core::option::Option<
10434                    ::core::option::Option<field_options::JSType>,
10435                > = None;
10436                let mut __f_lazy: ::core::option::Option<::core::option::Option<bool>> = None;
10437                let mut __f_unverified_lazy: ::core::option::Option<
10438                    ::core::option::Option<bool>,
10439                > = None;
10440                let mut __f_deprecated: ::core::option::Option<
10441                    ::core::option::Option<bool>,
10442                > = None;
10443                let mut __f_weak: ::core::option::Option<::core::option::Option<bool>> = None;
10444                let mut __f_debug_redact: ::core::option::Option<
10445                    ::core::option::Option<bool>,
10446                > = None;
10447                let mut __f_retention: ::core::option::Option<
10448                    ::core::option::Option<field_options::OptionRetention>,
10449                > = None;
10450                let mut __f_targets: ::core::option::Option<
10451                    ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10452                > = None;
10453                let mut __f_edition_defaults: ::core::option::Option<
10454                    ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10455                > = None;
10456                let mut __f_features: ::core::option::Option<
10457                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
10458                > = None;
10459                let mut __f_feature_support: ::core::option::Option<
10460                    ::buffa::MessageField<
10461                        field_options::FeatureSupport,
10462                        ::buffa::Inline<field_options::FeatureSupport>,
10463                    >,
10464                > = None;
10465                let mut __f_uninterpreted_option: ::core::option::Option<
10466                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
10467                > = None;
10468                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
10469                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
10470                    match key.as_str() {
10471                        "ctype" => {
10472                            __f_ctype = Some({
10473                                struct _S;
10474                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10475                                    type Value = ::core::option::Option<field_options::CType>;
10476                                    fn deserialize<D: serde::Deserializer<'de>>(
10477                                        self,
10478                                        d: D,
10479                                    ) -> ::core::result::Result<
10480                                        ::core::option::Option<field_options::CType>,
10481                                        D::Error,
10482                                    > {
10483                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10484                                    }
10485                                }
10486                                map.next_value_seed(_S)?
10487                            });
10488                        }
10489                        "packed" => {
10490                            __f_packed = Some(
10491                                map.next_value::<::core::option::Option<bool>>()?,
10492                            );
10493                        }
10494                        "jstype" => {
10495                            __f_jstype = Some({
10496                                struct _S;
10497                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10498                                    type Value = ::core::option::Option<field_options::JSType>;
10499                                    fn deserialize<D: serde::Deserializer<'de>>(
10500                                        self,
10501                                        d: D,
10502                                    ) -> ::core::result::Result<
10503                                        ::core::option::Option<field_options::JSType>,
10504                                        D::Error,
10505                                    > {
10506                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10507                                    }
10508                                }
10509                                map.next_value_seed(_S)?
10510                            });
10511                        }
10512                        "lazy" => {
10513                            __f_lazy = Some(
10514                                map.next_value::<::core::option::Option<bool>>()?,
10515                            );
10516                        }
10517                        "unverifiedLazy" | "unverified_lazy" => {
10518                            __f_unverified_lazy = Some(
10519                                map.next_value::<::core::option::Option<bool>>()?,
10520                            );
10521                        }
10522                        "deprecated" => {
10523                            __f_deprecated = Some(
10524                                map.next_value::<::core::option::Option<bool>>()?,
10525                            );
10526                        }
10527                        "weak" => {
10528                            __f_weak = Some(
10529                                map.next_value::<::core::option::Option<bool>>()?,
10530                            );
10531                        }
10532                        "debugRedact" | "debug_redact" => {
10533                            __f_debug_redact = Some(
10534                                map.next_value::<::core::option::Option<bool>>()?,
10535                            );
10536                        }
10537                        "retention" => {
10538                            __f_retention = Some({
10539                                struct _S;
10540                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10541                                    type Value = ::core::option::Option<
10542                                        field_options::OptionRetention,
10543                                    >;
10544                                    fn deserialize<D: serde::Deserializer<'de>>(
10545                                        self,
10546                                        d: D,
10547                                    ) -> ::core::result::Result<
10548                                        ::core::option::Option<field_options::OptionRetention>,
10549                                        D::Error,
10550                                    > {
10551                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
10552                                    }
10553                                }
10554                                map.next_value_seed(_S)?
10555                            });
10556                        }
10557                        "targets" => {
10558                            __f_targets = Some({
10559                                struct _S;
10560                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10561                                    type Value = ::buffa::alloc::vec::Vec<
10562                                        field_options::OptionTargetType,
10563                                    >;
10564                                    fn deserialize<D: serde::Deserializer<'de>>(
10565                                        self,
10566                                        d: D,
10567                                    ) -> ::core::result::Result<
10568                                        ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10569                                        D::Error,
10570                                    > {
10571                                        ::buffa::json_helpers::repeated_closed_enum::deserialize(d)
10572                                    }
10573                                }
10574                                map.next_value_seed(_S)?
10575                            });
10576                        }
10577                        "editionDefaults" | "edition_defaults" => {
10578                            __f_edition_defaults = Some({
10579                                struct _S;
10580                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10581                                    type Value = ::buffa::alloc::vec::Vec<
10582                                        field_options::EditionDefault,
10583                                    >;
10584                                    fn deserialize<D: serde::Deserializer<'de>>(
10585                                        self,
10586                                        d: D,
10587                                    ) -> ::core::result::Result<
10588                                        ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10589                                        D::Error,
10590                                    > {
10591                                        ::buffa::json_helpers::null_as_default(d)
10592                                    }
10593                                }
10594                                map.next_value_seed(_S)?
10595                            });
10596                        }
10597                        "features" => {
10598                            __f_features = Some(
10599                                map
10600                                    .next_value::<
10601                                        ::buffa::MessageField<
10602                                            FeatureSet,
10603                                            ::buffa::Inline<FeatureSet>,
10604                                        >,
10605                                    >()?,
10606                            );
10607                        }
10608                        "featureSupport" | "feature_support" => {
10609                            __f_feature_support = Some(
10610                                map
10611                                    .next_value::<
10612                                        ::buffa::MessageField<
10613                                            field_options::FeatureSupport,
10614                                            ::buffa::Inline<field_options::FeatureSupport>,
10615                                        >,
10616                                    >()?,
10617                            );
10618                        }
10619                        "uninterpretedOption" | "uninterpreted_option" => {
10620                            __f_uninterpreted_option = Some({
10621                                struct _S;
10622                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
10623                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
10624                                    fn deserialize<D: serde::Deserializer<'de>>(
10625                                        self,
10626                                        d: D,
10627                                    ) -> ::core::result::Result<
10628                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
10629                                        D::Error,
10630                                    > {
10631                                        ::buffa::json_helpers::null_as_default(d)
10632                                    }
10633                                }
10634                                map.next_value_seed(_S)?
10635                            });
10636                        }
10637                        __k if __k.starts_with('[') => {
10638                            let __v: ::buffa::serde_json::Value = map.next_value()?;
10639                            match ::buffa::extension_registry::deserialize_extension_key(
10640                                "google.protobuf.FieldOptions",
10641                                __k,
10642                                __v,
10643                            ) {
10644                                ::core::option::Option::Some(
10645                                    ::core::result::Result::Ok(__recs),
10646                                ) => {
10647                                    for __rec in __recs {
10648                                        __ext_records.push(__rec);
10649                                    }
10650                                }
10651                                ::core::option::Option::Some(
10652                                    ::core::result::Result::Err(__e),
10653                                ) => {
10654                                    return ::core::result::Result::Err(
10655                                        <A::Error as ::serde::de::Error>::custom(__e),
10656                                    );
10657                                }
10658                                ::core::option::Option::None => {}
10659                            }
10660                        }
10661                        _ => {
10662                            map.next_value::<serde::de::IgnoredAny>()?;
10663                        }
10664                    }
10665                }
10666                let mut __r = <FieldOptions as ::core::default::Default>::default();
10667                if let ::core::option::Option::Some(v) = __f_ctype {
10668                    __r.ctype = v;
10669                }
10670                if let ::core::option::Option::Some(v) = __f_packed {
10671                    __r.packed = v;
10672                }
10673                if let ::core::option::Option::Some(v) = __f_jstype {
10674                    __r.jstype = v;
10675                }
10676                if let ::core::option::Option::Some(v) = __f_lazy {
10677                    __r.lazy = v;
10678                }
10679                if let ::core::option::Option::Some(v) = __f_unverified_lazy {
10680                    __r.unverified_lazy = v;
10681                }
10682                if let ::core::option::Option::Some(v) = __f_deprecated {
10683                    __r.deprecated = v;
10684                }
10685                if let ::core::option::Option::Some(v) = __f_weak {
10686                    __r.weak = v;
10687                }
10688                if let ::core::option::Option::Some(v) = __f_debug_redact {
10689                    __r.debug_redact = v;
10690                }
10691                if let ::core::option::Option::Some(v) = __f_retention {
10692                    __r.retention = v;
10693                }
10694                if let ::core::option::Option::Some(v) = __f_targets {
10695                    __r.targets = v;
10696                }
10697                if let ::core::option::Option::Some(v) = __f_edition_defaults {
10698                    __r.edition_defaults = v;
10699                }
10700                if let ::core::option::Option::Some(v) = __f_features {
10701                    __r.features = v;
10702                }
10703                if let ::core::option::Option::Some(v) = __f_feature_support {
10704                    __r.feature_support = v;
10705                }
10706                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
10707                    __r.uninterpreted_option = v;
10708                }
10709                for __rec in __ext_records {
10710                    __r.__buffa_unknown_fields.push(__rec);
10711                }
10712                Ok(__r)
10713            }
10714        }
10715        d.deserialize_map(_V)
10716    }
10717}
10718#[cfg(feature = "json")]
10719impl ::buffa::json_helpers::ProtoElemJson for FieldOptions {
10720    fn serialize_proto_json<S: ::serde::Serializer>(
10721        v: &Self,
10722        s: S,
10723    ) -> ::core::result::Result<S::Ok, S::Error> {
10724        ::serde::Serialize::serialize(v, s)
10725    }
10726    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10727        d: D,
10728    ) -> ::core::result::Result<Self, D::Error> {
10729        <Self as ::serde::Deserialize>::deserialize(d)
10730    }
10731}
10732#[doc(hidden)]
10733#[derive(Clone, Debug, Default, PartialEq)]
10734#[repr(transparent)]
10735#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10736pub struct __FieldOptionsExtJson(pub ::buffa::UnknownFields);
10737impl ::core::ops::Deref for __FieldOptionsExtJson {
10738    type Target = ::buffa::UnknownFields;
10739    fn deref(&self) -> &::buffa::UnknownFields {
10740        &self.0
10741    }
10742}
10743impl ::core::ops::DerefMut for __FieldOptionsExtJson {
10744    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
10745        &mut self.0
10746    }
10747}
10748impl ::core::convert::From<::buffa::UnknownFields> for __FieldOptionsExtJson {
10749    fn from(u: ::buffa::UnknownFields) -> Self {
10750        Self(u)
10751    }
10752}
10753#[cfg(feature = "json")]
10754impl ::serde::Serialize for __FieldOptionsExtJson {
10755    fn serialize<S: ::serde::Serializer>(
10756        &self,
10757        s: S,
10758    ) -> ::core::result::Result<S::Ok, S::Error> {
10759        ::buffa::extension_registry::serialize_extensions(
10760            "google.protobuf.FieldOptions",
10761            &self.0,
10762            s,
10763        )
10764    }
10765}
10766#[cfg(feature = "json")]
10767impl<'de> ::serde::Deserialize<'de> for __FieldOptionsExtJson {
10768    fn deserialize<D: ::serde::Deserializer<'de>>(
10769        d: D,
10770    ) -> ::core::result::Result<Self, D::Error> {
10771        ::buffa::extension_registry::deserialize_extensions(
10772                "google.protobuf.FieldOptions",
10773                d,
10774            )
10775            .map(Self)
10776    }
10777}
10778#[cfg(feature = "json")]
10779#[doc(hidden)]
10780pub const __FIELD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10781    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10782    to_json: ::buffa::type_registry::any_to_json::<FieldOptions>,
10783    from_json: ::buffa::type_registry::any_from_json::<FieldOptions>,
10784    is_wkt: false,
10785};
10786#[cfg(feature = "text")]
10787#[doc(hidden)]
10788pub const __FIELD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
10789    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
10790    text_encode: ::buffa::type_registry::any_encode_text::<FieldOptions>,
10791    text_merge: ::buffa::type_registry::any_merge_text::<FieldOptions>,
10792};
10793pub mod field_options {
10794    #[allow(unused_imports)]
10795    use super::*;
10796    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10797    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10798    #[repr(i32)]
10799    pub enum CType {
10800        /// Default mode.
10801        STRING = 0i32,
10802        /// The option \[ctype=CORD\] may be applied to a non-repeated field of type
10803        /// "bytes". It indicates that in C++, the data should be stored in a Cord
10804        /// instead of a string.  For very large strings, this may reduce memory
10805        /// fragmentation. It may also allow better performance when parsing from a
10806        /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then
10807        /// alias the original buffer.
10808        CORD = 1i32,
10809        STRING_PIECE = 2i32,
10810    }
10811    impl CType {
10812        ///Idiomatic alias for [`Self::STRING`]; `Debug` prints the variant name.
10813        #[allow(non_upper_case_globals)]
10814        pub const String: Self = Self::STRING;
10815        ///Idiomatic alias for [`Self::CORD`]; `Debug` prints the variant name.
10816        #[allow(non_upper_case_globals)]
10817        pub const Cord: Self = Self::CORD;
10818        ///Idiomatic alias for [`Self::STRING_PIECE`]; `Debug` prints the variant name.
10819        #[allow(non_upper_case_globals)]
10820        pub const StringPiece: Self = Self::STRING_PIECE;
10821    }
10822    impl ::core::default::Default for CType {
10823        fn default() -> Self {
10824            Self::STRING
10825        }
10826    }
10827    #[cfg(feature = "json")]
10828    const _: () = {
10829        impl ::serde::Serialize for CType {
10830            fn serialize<S: ::serde::Serializer>(
10831                &self,
10832                s: S,
10833            ) -> ::core::result::Result<S::Ok, S::Error> {
10834                s.serialize_str(::buffa::Enumeration::proto_name(self))
10835            }
10836        }
10837        impl<'de> ::serde::Deserialize<'de> for CType {
10838            fn deserialize<D: ::serde::Deserializer<'de>>(
10839                d: D,
10840            ) -> ::core::result::Result<Self, D::Error> {
10841                struct _V;
10842                impl ::serde::de::Visitor<'_> for _V {
10843                    type Value = CType;
10844                    fn expecting(
10845                        &self,
10846                        f: &mut ::core::fmt::Formatter<'_>,
10847                    ) -> ::core::fmt::Result {
10848                        f.write_str(
10849                            concat!("a string, integer, or null for ", stringify!(CType)),
10850                        )
10851                    }
10852                    fn visit_str<E: ::serde::de::Error>(
10853                        self,
10854                        v: &str,
10855                    ) -> ::core::result::Result<CType, E> {
10856                        <CType as ::buffa::Enumeration>::from_proto_name(v)
10857                            .ok_or_else(|| {
10858                                ::serde::de::Error::unknown_variant(v, &[])
10859                            })
10860                    }
10861                    fn visit_i64<E: ::serde::de::Error>(
10862                        self,
10863                        v: i64,
10864                    ) -> ::core::result::Result<CType, E> {
10865                        let v32 = i32::try_from(v)
10866                            .map_err(|_| {
10867                                ::serde::de::Error::custom(
10868                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10869                                )
10870                            })?;
10871                        <CType as ::buffa::Enumeration>::from_i32(v32)
10872                            .ok_or_else(|| {
10873                                ::serde::de::Error::custom(
10874                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10875                                )
10876                            })
10877                    }
10878                    fn visit_u64<E: ::serde::de::Error>(
10879                        self,
10880                        v: u64,
10881                    ) -> ::core::result::Result<CType, E> {
10882                        let v32 = i32::try_from(v)
10883                            .map_err(|_| {
10884                                ::serde::de::Error::custom(
10885                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
10886                                )
10887                            })?;
10888                        <CType as ::buffa::Enumeration>::from_i32(v32)
10889                            .ok_or_else(|| {
10890                                ::serde::de::Error::custom(
10891                                    ::buffa::alloc::format!("unknown enum value {v32}"),
10892                                )
10893                            })
10894                    }
10895                    fn visit_unit<E: ::serde::de::Error>(
10896                        self,
10897                    ) -> ::core::result::Result<CType, E> {
10898                        ::core::result::Result::Ok(::core::default::Default::default())
10899                    }
10900                }
10901                d.deserialize_any(_V)
10902            }
10903        }
10904        impl ::buffa::json_helpers::ProtoElemJson for CType {
10905            fn serialize_proto_json<S: ::serde::Serializer>(
10906                v: &Self,
10907                s: S,
10908            ) -> ::core::result::Result<S::Ok, S::Error> {
10909                ::serde::Serialize::serialize(v, s)
10910            }
10911            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10912                d: D,
10913            ) -> ::core::result::Result<Self, D::Error> {
10914                <Self as ::serde::Deserialize>::deserialize(d)
10915            }
10916        }
10917    };
10918    impl ::buffa::Enumeration for CType {
10919        fn from_i32(value: i32) -> ::core::option::Option<Self> {
10920            match value {
10921                0i32 => ::core::option::Option::Some(Self::STRING),
10922                1i32 => ::core::option::Option::Some(Self::CORD),
10923                2i32 => ::core::option::Option::Some(Self::STRING_PIECE),
10924                _ => ::core::option::Option::None,
10925            }
10926        }
10927        fn to_i32(&self) -> i32 {
10928            *self as i32
10929        }
10930        fn proto_name(&self) -> &'static str {
10931            match self {
10932                Self::STRING => "STRING",
10933                Self::CORD => "CORD",
10934                Self::STRING_PIECE => "STRING_PIECE",
10935            }
10936        }
10937        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
10938            match name {
10939                "STRING" => ::core::option::Option::Some(Self::STRING),
10940                "CORD" => ::core::option::Option::Some(Self::CORD),
10941                "STRING_PIECE" => ::core::option::Option::Some(Self::STRING_PIECE),
10942                _ => ::core::option::Option::None,
10943            }
10944        }
10945        fn values() -> &'static [Self] {
10946            &[Self::STRING, Self::CORD, Self::STRING_PIECE]
10947        }
10948    }
10949    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
10950    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10951    #[repr(i32)]
10952    pub enum JSType {
10953        /// Use the default type.
10954        JS_NORMAL = 0i32,
10955        /// Use JavaScript strings.
10956        JS_STRING = 1i32,
10957        /// Use JavaScript numbers.
10958        JS_NUMBER = 2i32,
10959    }
10960    impl JSType {
10961        ///Idiomatic alias for [`Self::JS_NORMAL`]; `Debug` prints the variant name.
10962        #[allow(non_upper_case_globals)]
10963        pub const JsNormal: Self = Self::JS_NORMAL;
10964        ///Idiomatic alias for [`Self::JS_STRING`]; `Debug` prints the variant name.
10965        #[allow(non_upper_case_globals)]
10966        pub const JsString: Self = Self::JS_STRING;
10967        ///Idiomatic alias for [`Self::JS_NUMBER`]; `Debug` prints the variant name.
10968        #[allow(non_upper_case_globals)]
10969        pub const JsNumber: Self = Self::JS_NUMBER;
10970    }
10971    impl ::core::default::Default for JSType {
10972        fn default() -> Self {
10973            Self::JS_NORMAL
10974        }
10975    }
10976    #[cfg(feature = "json")]
10977    const _: () = {
10978        impl ::serde::Serialize for JSType {
10979            fn serialize<S: ::serde::Serializer>(
10980                &self,
10981                s: S,
10982            ) -> ::core::result::Result<S::Ok, S::Error> {
10983                s.serialize_str(::buffa::Enumeration::proto_name(self))
10984            }
10985        }
10986        impl<'de> ::serde::Deserialize<'de> for JSType {
10987            fn deserialize<D: ::serde::Deserializer<'de>>(
10988                d: D,
10989            ) -> ::core::result::Result<Self, D::Error> {
10990                struct _V;
10991                impl ::serde::de::Visitor<'_> for _V {
10992                    type Value = JSType;
10993                    fn expecting(
10994                        &self,
10995                        f: &mut ::core::fmt::Formatter<'_>,
10996                    ) -> ::core::fmt::Result {
10997                        f.write_str(
10998                            concat!(
10999                                "a string, integer, or null for ", stringify!(JSType)
11000                            ),
11001                        )
11002                    }
11003                    fn visit_str<E: ::serde::de::Error>(
11004                        self,
11005                        v: &str,
11006                    ) -> ::core::result::Result<JSType, E> {
11007                        <JSType as ::buffa::Enumeration>::from_proto_name(v)
11008                            .ok_or_else(|| {
11009                                ::serde::de::Error::unknown_variant(v, &[])
11010                            })
11011                    }
11012                    fn visit_i64<E: ::serde::de::Error>(
11013                        self,
11014                        v: i64,
11015                    ) -> ::core::result::Result<JSType, E> {
11016                        let v32 = i32::try_from(v)
11017                            .map_err(|_| {
11018                                ::serde::de::Error::custom(
11019                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11020                                )
11021                            })?;
11022                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11023                            .ok_or_else(|| {
11024                                ::serde::de::Error::custom(
11025                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11026                                )
11027                            })
11028                    }
11029                    fn visit_u64<E: ::serde::de::Error>(
11030                        self,
11031                        v: u64,
11032                    ) -> ::core::result::Result<JSType, E> {
11033                        let v32 = i32::try_from(v)
11034                            .map_err(|_| {
11035                                ::serde::de::Error::custom(
11036                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11037                                )
11038                            })?;
11039                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11040                            .ok_or_else(|| {
11041                                ::serde::de::Error::custom(
11042                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11043                                )
11044                            })
11045                    }
11046                    fn visit_unit<E: ::serde::de::Error>(
11047                        self,
11048                    ) -> ::core::result::Result<JSType, E> {
11049                        ::core::result::Result::Ok(::core::default::Default::default())
11050                    }
11051                }
11052                d.deserialize_any(_V)
11053            }
11054        }
11055        impl ::buffa::json_helpers::ProtoElemJson for JSType {
11056            fn serialize_proto_json<S: ::serde::Serializer>(
11057                v: &Self,
11058                s: S,
11059            ) -> ::core::result::Result<S::Ok, S::Error> {
11060                ::serde::Serialize::serialize(v, s)
11061            }
11062            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11063                d: D,
11064            ) -> ::core::result::Result<Self, D::Error> {
11065                <Self as ::serde::Deserialize>::deserialize(d)
11066            }
11067        }
11068    };
11069    impl ::buffa::Enumeration for JSType {
11070        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11071            match value {
11072                0i32 => ::core::option::Option::Some(Self::JS_NORMAL),
11073                1i32 => ::core::option::Option::Some(Self::JS_STRING),
11074                2i32 => ::core::option::Option::Some(Self::JS_NUMBER),
11075                _ => ::core::option::Option::None,
11076            }
11077        }
11078        fn to_i32(&self) -> i32 {
11079            *self as i32
11080        }
11081        fn proto_name(&self) -> &'static str {
11082            match self {
11083                Self::JS_NORMAL => "JS_NORMAL",
11084                Self::JS_STRING => "JS_STRING",
11085                Self::JS_NUMBER => "JS_NUMBER",
11086            }
11087        }
11088        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11089            match name {
11090                "JS_NORMAL" => ::core::option::Option::Some(Self::JS_NORMAL),
11091                "JS_STRING" => ::core::option::Option::Some(Self::JS_STRING),
11092                "JS_NUMBER" => ::core::option::Option::Some(Self::JS_NUMBER),
11093                _ => ::core::option::Option::None,
11094            }
11095        }
11096        fn values() -> &'static [Self] {
11097            &[Self::JS_NORMAL, Self::JS_STRING, Self::JS_NUMBER]
11098        }
11099    }
11100    /// If set to RETENTION_SOURCE, the option will be omitted from the binary.
11101    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11102    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11103    #[repr(i32)]
11104    pub enum OptionRetention {
11105        RETENTION_UNKNOWN = 0i32,
11106        RETENTION_RUNTIME = 1i32,
11107        RETENTION_SOURCE = 2i32,
11108    }
11109    impl OptionRetention {
11110        ///Idiomatic alias for [`Self::RETENTION_UNKNOWN`]; `Debug` prints the variant name.
11111        #[allow(non_upper_case_globals)]
11112        pub const RetentionUnknown: Self = Self::RETENTION_UNKNOWN;
11113        ///Idiomatic alias for [`Self::RETENTION_RUNTIME`]; `Debug` prints the variant name.
11114        #[allow(non_upper_case_globals)]
11115        pub const RetentionRuntime: Self = Self::RETENTION_RUNTIME;
11116        ///Idiomatic alias for [`Self::RETENTION_SOURCE`]; `Debug` prints the variant name.
11117        #[allow(non_upper_case_globals)]
11118        pub const RetentionSource: Self = Self::RETENTION_SOURCE;
11119    }
11120    impl ::core::default::Default for OptionRetention {
11121        fn default() -> Self {
11122            Self::RETENTION_UNKNOWN
11123        }
11124    }
11125    #[cfg(feature = "json")]
11126    const _: () = {
11127        impl ::serde::Serialize for OptionRetention {
11128            fn serialize<S: ::serde::Serializer>(
11129                &self,
11130                s: S,
11131            ) -> ::core::result::Result<S::Ok, S::Error> {
11132                s.serialize_str(::buffa::Enumeration::proto_name(self))
11133            }
11134        }
11135        impl<'de> ::serde::Deserialize<'de> for OptionRetention {
11136            fn deserialize<D: ::serde::Deserializer<'de>>(
11137                d: D,
11138            ) -> ::core::result::Result<Self, D::Error> {
11139                struct _V;
11140                impl ::serde::de::Visitor<'_> for _V {
11141                    type Value = OptionRetention;
11142                    fn expecting(
11143                        &self,
11144                        f: &mut ::core::fmt::Formatter<'_>,
11145                    ) -> ::core::fmt::Result {
11146                        f.write_str(
11147                            concat!(
11148                                "a string, integer, or null for ",
11149                                stringify!(OptionRetention)
11150                            ),
11151                        )
11152                    }
11153                    fn visit_str<E: ::serde::de::Error>(
11154                        self,
11155                        v: &str,
11156                    ) -> ::core::result::Result<OptionRetention, E> {
11157                        <OptionRetention as ::buffa::Enumeration>::from_proto_name(v)
11158                            .ok_or_else(|| {
11159                                ::serde::de::Error::unknown_variant(v, &[])
11160                            })
11161                    }
11162                    fn visit_i64<E: ::serde::de::Error>(
11163                        self,
11164                        v: i64,
11165                    ) -> ::core::result::Result<OptionRetention, E> {
11166                        let v32 = i32::try_from(v)
11167                            .map_err(|_| {
11168                                ::serde::de::Error::custom(
11169                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11170                                )
11171                            })?;
11172                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11173                            .ok_or_else(|| {
11174                                ::serde::de::Error::custom(
11175                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11176                                )
11177                            })
11178                    }
11179                    fn visit_u64<E: ::serde::de::Error>(
11180                        self,
11181                        v: u64,
11182                    ) -> ::core::result::Result<OptionRetention, E> {
11183                        let v32 = i32::try_from(v)
11184                            .map_err(|_| {
11185                                ::serde::de::Error::custom(
11186                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11187                                )
11188                            })?;
11189                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11190                            .ok_or_else(|| {
11191                                ::serde::de::Error::custom(
11192                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11193                                )
11194                            })
11195                    }
11196                    fn visit_unit<E: ::serde::de::Error>(
11197                        self,
11198                    ) -> ::core::result::Result<OptionRetention, E> {
11199                        ::core::result::Result::Ok(::core::default::Default::default())
11200                    }
11201                }
11202                d.deserialize_any(_V)
11203            }
11204        }
11205        impl ::buffa::json_helpers::ProtoElemJson for OptionRetention {
11206            fn serialize_proto_json<S: ::serde::Serializer>(
11207                v: &Self,
11208                s: S,
11209            ) -> ::core::result::Result<S::Ok, S::Error> {
11210                ::serde::Serialize::serialize(v, s)
11211            }
11212            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11213                d: D,
11214            ) -> ::core::result::Result<Self, D::Error> {
11215                <Self as ::serde::Deserialize>::deserialize(d)
11216            }
11217        }
11218    };
11219    impl ::buffa::Enumeration for OptionRetention {
11220        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11221            match value {
11222                0i32 => ::core::option::Option::Some(Self::RETENTION_UNKNOWN),
11223                1i32 => ::core::option::Option::Some(Self::RETENTION_RUNTIME),
11224                2i32 => ::core::option::Option::Some(Self::RETENTION_SOURCE),
11225                _ => ::core::option::Option::None,
11226            }
11227        }
11228        fn to_i32(&self) -> i32 {
11229            *self as i32
11230        }
11231        fn proto_name(&self) -> &'static str {
11232            match self {
11233                Self::RETENTION_UNKNOWN => "RETENTION_UNKNOWN",
11234                Self::RETENTION_RUNTIME => "RETENTION_RUNTIME",
11235                Self::RETENTION_SOURCE => "RETENTION_SOURCE",
11236            }
11237        }
11238        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11239            match name {
11240                "RETENTION_UNKNOWN" => {
11241                    ::core::option::Option::Some(Self::RETENTION_UNKNOWN)
11242                }
11243                "RETENTION_RUNTIME" => {
11244                    ::core::option::Option::Some(Self::RETENTION_RUNTIME)
11245                }
11246                "RETENTION_SOURCE" => {
11247                    ::core::option::Option::Some(Self::RETENTION_SOURCE)
11248                }
11249                _ => ::core::option::Option::None,
11250            }
11251        }
11252        fn values() -> &'static [Self] {
11253            &[Self::RETENTION_UNKNOWN, Self::RETENTION_RUNTIME, Self::RETENTION_SOURCE]
11254        }
11255    }
11256    /// This indicates the types of entities that the field may apply to when used
11257    /// as an option. If it is unset, then the field may be freely used as an
11258    /// option on any kind of entity.
11259    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11260    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11261    #[repr(i32)]
11262    pub enum OptionTargetType {
11263        TARGET_TYPE_UNKNOWN = 0i32,
11264        TARGET_TYPE_FILE = 1i32,
11265        TARGET_TYPE_EXTENSION_RANGE = 2i32,
11266        TARGET_TYPE_MESSAGE = 3i32,
11267        TARGET_TYPE_FIELD = 4i32,
11268        TARGET_TYPE_ONEOF = 5i32,
11269        TARGET_TYPE_ENUM = 6i32,
11270        TARGET_TYPE_ENUM_ENTRY = 7i32,
11271        TARGET_TYPE_SERVICE = 8i32,
11272        TARGET_TYPE_METHOD = 9i32,
11273    }
11274    impl OptionTargetType {
11275        ///Idiomatic alias for [`Self::TARGET_TYPE_UNKNOWN`]; `Debug` prints the variant name.
11276        #[allow(non_upper_case_globals)]
11277        pub const TargetTypeUnknown: Self = Self::TARGET_TYPE_UNKNOWN;
11278        ///Idiomatic alias for [`Self::TARGET_TYPE_FILE`]; `Debug` prints the variant name.
11279        #[allow(non_upper_case_globals)]
11280        pub const TargetTypeFile: Self = Self::TARGET_TYPE_FILE;
11281        ///Idiomatic alias for [`Self::TARGET_TYPE_EXTENSION_RANGE`]; `Debug` prints the variant name.
11282        #[allow(non_upper_case_globals)]
11283        pub const TargetTypeExtensionRange: Self = Self::TARGET_TYPE_EXTENSION_RANGE;
11284        ///Idiomatic alias for [`Self::TARGET_TYPE_MESSAGE`]; `Debug` prints the variant name.
11285        #[allow(non_upper_case_globals)]
11286        pub const TargetTypeMessage: Self = Self::TARGET_TYPE_MESSAGE;
11287        ///Idiomatic alias for [`Self::TARGET_TYPE_FIELD`]; `Debug` prints the variant name.
11288        #[allow(non_upper_case_globals)]
11289        pub const TargetTypeField: Self = Self::TARGET_TYPE_FIELD;
11290        ///Idiomatic alias for [`Self::TARGET_TYPE_ONEOF`]; `Debug` prints the variant name.
11291        #[allow(non_upper_case_globals)]
11292        pub const TargetTypeOneof: Self = Self::TARGET_TYPE_ONEOF;
11293        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM`]; `Debug` prints the variant name.
11294        #[allow(non_upper_case_globals)]
11295        pub const TargetTypeEnum: Self = Self::TARGET_TYPE_ENUM;
11296        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM_ENTRY`]; `Debug` prints the variant name.
11297        #[allow(non_upper_case_globals)]
11298        pub const TargetTypeEnumEntry: Self = Self::TARGET_TYPE_ENUM_ENTRY;
11299        ///Idiomatic alias for [`Self::TARGET_TYPE_SERVICE`]; `Debug` prints the variant name.
11300        #[allow(non_upper_case_globals)]
11301        pub const TargetTypeService: Self = Self::TARGET_TYPE_SERVICE;
11302        ///Idiomatic alias for [`Self::TARGET_TYPE_METHOD`]; `Debug` prints the variant name.
11303        #[allow(non_upper_case_globals)]
11304        pub const TargetTypeMethod: Self = Self::TARGET_TYPE_METHOD;
11305    }
11306    impl ::core::default::Default for OptionTargetType {
11307        fn default() -> Self {
11308            Self::TARGET_TYPE_UNKNOWN
11309        }
11310    }
11311    #[cfg(feature = "json")]
11312    const _: () = {
11313        impl ::serde::Serialize for OptionTargetType {
11314            fn serialize<S: ::serde::Serializer>(
11315                &self,
11316                s: S,
11317            ) -> ::core::result::Result<S::Ok, S::Error> {
11318                s.serialize_str(::buffa::Enumeration::proto_name(self))
11319            }
11320        }
11321        impl<'de> ::serde::Deserialize<'de> for OptionTargetType {
11322            fn deserialize<D: ::serde::Deserializer<'de>>(
11323                d: D,
11324            ) -> ::core::result::Result<Self, D::Error> {
11325                struct _V;
11326                impl ::serde::de::Visitor<'_> for _V {
11327                    type Value = OptionTargetType;
11328                    fn expecting(
11329                        &self,
11330                        f: &mut ::core::fmt::Formatter<'_>,
11331                    ) -> ::core::fmt::Result {
11332                        f.write_str(
11333                            concat!(
11334                                "a string, integer, or null for ",
11335                                stringify!(OptionTargetType)
11336                            ),
11337                        )
11338                    }
11339                    fn visit_str<E: ::serde::de::Error>(
11340                        self,
11341                        v: &str,
11342                    ) -> ::core::result::Result<OptionTargetType, E> {
11343                        <OptionTargetType as ::buffa::Enumeration>::from_proto_name(v)
11344                            .ok_or_else(|| {
11345                                ::serde::de::Error::unknown_variant(v, &[])
11346                            })
11347                    }
11348                    fn visit_i64<E: ::serde::de::Error>(
11349                        self,
11350                        v: i64,
11351                    ) -> ::core::result::Result<OptionTargetType, E> {
11352                        let v32 = i32::try_from(v)
11353                            .map_err(|_| {
11354                                ::serde::de::Error::custom(
11355                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11356                                )
11357                            })?;
11358                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11359                            .ok_or_else(|| {
11360                                ::serde::de::Error::custom(
11361                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11362                                )
11363                            })
11364                    }
11365                    fn visit_u64<E: ::serde::de::Error>(
11366                        self,
11367                        v: u64,
11368                    ) -> ::core::result::Result<OptionTargetType, E> {
11369                        let v32 = i32::try_from(v)
11370                            .map_err(|_| {
11371                                ::serde::de::Error::custom(
11372                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11373                                )
11374                            })?;
11375                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11376                            .ok_or_else(|| {
11377                                ::serde::de::Error::custom(
11378                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11379                                )
11380                            })
11381                    }
11382                    fn visit_unit<E: ::serde::de::Error>(
11383                        self,
11384                    ) -> ::core::result::Result<OptionTargetType, E> {
11385                        ::core::result::Result::Ok(::core::default::Default::default())
11386                    }
11387                }
11388                d.deserialize_any(_V)
11389            }
11390        }
11391        impl ::buffa::json_helpers::ProtoElemJson for OptionTargetType {
11392            fn serialize_proto_json<S: ::serde::Serializer>(
11393                v: &Self,
11394                s: S,
11395            ) -> ::core::result::Result<S::Ok, S::Error> {
11396                ::serde::Serialize::serialize(v, s)
11397            }
11398            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11399                d: D,
11400            ) -> ::core::result::Result<Self, D::Error> {
11401                <Self as ::serde::Deserialize>::deserialize(d)
11402            }
11403        }
11404    };
11405    impl ::buffa::Enumeration for OptionTargetType {
11406        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11407            match value {
11408                0i32 => ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
11409                1i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FILE),
11410                2i32 => ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE),
11411                3i32 => ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
11412                4i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FIELD),
11413                5i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF),
11414                6i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM),
11415                7i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
11416                8i32 => ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE),
11417                9i32 => ::core::option::Option::Some(Self::TARGET_TYPE_METHOD),
11418                _ => ::core::option::Option::None,
11419            }
11420        }
11421        fn to_i32(&self) -> i32 {
11422            *self as i32
11423        }
11424        fn proto_name(&self) -> &'static str {
11425            match self {
11426                Self::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN",
11427                Self::TARGET_TYPE_FILE => "TARGET_TYPE_FILE",
11428                Self::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE",
11429                Self::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE",
11430                Self::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD",
11431                Self::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF",
11432                Self::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM",
11433                Self::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY",
11434                Self::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE",
11435                Self::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD",
11436            }
11437        }
11438        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11439            match name {
11440                "TARGET_TYPE_UNKNOWN" => {
11441                    ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN)
11442                }
11443                "TARGET_TYPE_FILE" => {
11444                    ::core::option::Option::Some(Self::TARGET_TYPE_FILE)
11445                }
11446                "TARGET_TYPE_EXTENSION_RANGE" => {
11447                    ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
11448                }
11449                "TARGET_TYPE_MESSAGE" => {
11450                    ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE)
11451                }
11452                "TARGET_TYPE_FIELD" => {
11453                    ::core::option::Option::Some(Self::TARGET_TYPE_FIELD)
11454                }
11455                "TARGET_TYPE_ONEOF" => {
11456                    ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF)
11457                }
11458                "TARGET_TYPE_ENUM" => {
11459                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM)
11460                }
11461                "TARGET_TYPE_ENUM_ENTRY" => {
11462                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY)
11463                }
11464                "TARGET_TYPE_SERVICE" => {
11465                    ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE)
11466                }
11467                "TARGET_TYPE_METHOD" => {
11468                    ::core::option::Option::Some(Self::TARGET_TYPE_METHOD)
11469                }
11470                _ => ::core::option::Option::None,
11471            }
11472        }
11473        fn values() -> &'static [Self] {
11474            &[
11475                Self::TARGET_TYPE_UNKNOWN,
11476                Self::TARGET_TYPE_FILE,
11477                Self::TARGET_TYPE_EXTENSION_RANGE,
11478                Self::TARGET_TYPE_MESSAGE,
11479                Self::TARGET_TYPE_FIELD,
11480                Self::TARGET_TYPE_ONEOF,
11481                Self::TARGET_TYPE_ENUM,
11482                Self::TARGET_TYPE_ENUM_ENTRY,
11483                Self::TARGET_TYPE_SERVICE,
11484                Self::TARGET_TYPE_METHOD,
11485            ]
11486        }
11487    }
11488    #[derive(Clone, PartialEq, Default)]
11489    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11490    #[cfg_attr(feature = "json", serde(default))]
11491    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11492    pub struct EditionDefault {
11493        /// Field 3: `edition`
11494        #[cfg_attr(
11495            feature = "json",
11496            serde(
11497                rename = "edition",
11498                with = "::buffa::json_helpers::opt_closed_enum",
11499                skip_serializing_if = "::core::option::Option::is_none"
11500            )
11501        )]
11502        pub edition: ::core::option::Option<super::Edition>,
11503        /// Textproto value.
11504        ///
11505        /// Field 2: `value`
11506        #[cfg_attr(
11507            feature = "json",
11508            serde(
11509                rename = "value",
11510                skip_serializing_if = "::core::option::Option::is_none"
11511            )
11512        )]
11513        pub value: ::core::option::Option<::buffa::alloc::string::String>,
11514        #[cfg_attr(feature = "json", serde(skip))]
11515        #[doc(hidden)]
11516        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11517    }
11518    impl ::core::fmt::Debug for EditionDefault {
11519        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11520            f.debug_struct("EditionDefault")
11521                .field("edition", &self.edition)
11522                .field("value", &self.value)
11523                .finish()
11524        }
11525    }
11526    impl EditionDefault {
11527        /// Protobuf type URL for this message, for use with `Any::pack` and
11528        /// `Any::unpack_if`.
11529        ///
11530        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11531        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11532    }
11533    impl EditionDefault {
11534        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11535        #[inline]
11536        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
11537        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
11538            self.edition = Some(value.into());
11539            self
11540        }
11541        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11542        #[inline]
11543        ///Sets [`Self::value`] to `Some(value)`, consuming and returning `self`.
11544        pub fn with_value(
11545            mut self,
11546            value: impl Into<::buffa::alloc::string::String>,
11547        ) -> Self {
11548            self.value = Some(value.into());
11549            self
11550        }
11551    }
11552    ::buffa::impl_default_instance!(EditionDefault);
11553    impl ::buffa::MessageName for EditionDefault {
11554        const PACKAGE: &'static str = "google.protobuf";
11555        const NAME: &'static str = "FieldOptions.EditionDefault";
11556        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11557        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
11558    }
11559    impl ::buffa::Message for EditionDefault {
11560        /// Returns the total encoded size in bytes.
11561        ///
11562        /// Accumulates in `u64` (which cannot overflow for in-memory
11563        /// data) and saturates to `u32` at return, so a message whose
11564        /// encoded size exceeds the 2 GiB protobuf limit yields a value
11565        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
11566        /// points reject, never a silently wrapped size.
11567        #[allow(clippy::let_and_return)]
11568        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11569            #[allow(unused_imports)]
11570            use ::buffa::Enumeration as _;
11571            let mut size = 0u64;
11572            if let Some(ref v) = self.value {
11573                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
11574            }
11575            if let Some(ref v) = self.edition {
11576                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11577            }
11578            size += self.__buffa_unknown_fields.encoded_len() as u64;
11579            ::buffa::saturate_size(size)
11580        }
11581        fn write_to(
11582            &self,
11583            _cache: &mut ::buffa::SizeCache,
11584            buf: &mut impl ::buffa::EncodeSink,
11585        ) {
11586            #[allow(unused_imports)]
11587            use ::buffa::Enumeration as _;
11588            if let Some(ref v) = self.value {
11589                ::buffa::types::put_string_field(2u32, v, buf);
11590            }
11591            if let Some(ref v) = self.edition {
11592                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
11593            }
11594            self.__buffa_unknown_fields.write_to(buf);
11595        }
11596        fn merge_field(
11597            &mut self,
11598            tag: ::buffa::encoding::Tag,
11599            buf: &mut impl ::buffa::bytes::Buf,
11600            ctx: ::buffa::DecodeContext<'_>,
11601        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11602            #[allow(unused_imports)]
11603            use ::buffa::bytes::Buf as _;
11604            #[allow(unused_imports)]
11605            use ::buffa::Enumeration as _;
11606            match tag.field_number() {
11607                2u32 => {
11608                    ::buffa::encoding::check_wire_type(
11609                        tag,
11610                        ::buffa::encoding::WireType::LengthDelimited,
11611                    )?;
11612                    ::buffa::types::merge_string(
11613                        self
11614                            .value
11615                            .get_or_insert_with(::buffa::alloc::string::String::new),
11616                        buf,
11617                    )?;
11618                }
11619                3u32 => {
11620                    ::buffa::encoding::check_wire_type(
11621                        tag,
11622                        ::buffa::encoding::WireType::Varint,
11623                    )?;
11624                    let __raw = ::buffa::types::decode_int32(buf)?;
11625                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11626                        __raw,
11627                    ) {
11628                        self.edition = ::core::option::Option::Some(__v);
11629                    } else {
11630                        ctx.register_unknown_field()?;
11631                        self.__buffa_unknown_fields
11632                            .push(::buffa::UnknownField {
11633                                number: 3u32,
11634                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11635                            });
11636                    }
11637                }
11638                _ => {
11639                    self.__buffa_unknown_fields
11640                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11641                }
11642            }
11643            ::core::result::Result::Ok(())
11644        }
11645        fn clear(&mut self) {
11646            self.value = ::core::option::Option::None;
11647            self.edition = ::core::option::Option::None;
11648            self.__buffa_unknown_fields.clear();
11649        }
11650    }
11651    impl ::buffa::ExtensionSet for EditionDefault {
11652        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.EditionDefault";
11653        fn unknown_fields(&self) -> &::buffa::UnknownFields {
11654            &self.__buffa_unknown_fields
11655        }
11656        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11657            &mut self.__buffa_unknown_fields
11658        }
11659    }
11660    #[cfg(feature = "text")]
11661    impl ::buffa::text::TextFormat for EditionDefault {
11662        fn encode_text(
11663            &self,
11664            enc: &mut ::buffa::text::TextEncoder<'_>,
11665        ) -> ::core::fmt::Result {
11666            #[allow(unused_imports)]
11667            use ::buffa::Enumeration as _;
11668            if let ::core::option::Option::Some(ref __v) = self.edition {
11669                enc.write_field_name("edition")?;
11670                enc.write_enum_name(__v.proto_name())?;
11671            }
11672            if let ::core::option::Option::Some(ref __v) = self.value {
11673                enc.write_field_name("value")?;
11674                enc.write_string(__v)?;
11675            }
11676            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
11677            ::core::result::Result::Ok(())
11678        }
11679        fn merge_text(
11680            &mut self,
11681            dec: &mut ::buffa::text::TextDecoder<'_>,
11682        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
11683            #[allow(unused_imports)]
11684            use ::buffa::Enumeration as _;
11685            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
11686                match __name {
11687                    "edition" => {
11688                        self.edition = ::core::option::Option::Some(
11689                            dec.read_closed_enum_by_name::<super::Edition>()?,
11690                        );
11691                    }
11692                    "value" => {
11693                        self.value = ::core::option::Option::Some(
11694                            dec.read_string()?.into_owned(),
11695                        );
11696                    }
11697                    _ => dec.skip_value()?,
11698                }
11699            }
11700            ::core::result::Result::Ok(())
11701        }
11702    }
11703    #[cfg(feature = "json")]
11704    impl ::buffa::json_helpers::ProtoElemJson for EditionDefault {
11705        fn serialize_proto_json<S: ::serde::Serializer>(
11706            v: &Self,
11707            s: S,
11708        ) -> ::core::result::Result<S::Ok, S::Error> {
11709            ::serde::Serialize::serialize(v, s)
11710        }
11711        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11712            d: D,
11713        ) -> ::core::result::Result<Self, D::Error> {
11714            <Self as ::serde::Deserialize>::deserialize(d)
11715        }
11716    }
11717    #[cfg(feature = "json")]
11718    #[doc(hidden)]
11719    pub const __EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11720        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11721        to_json: ::buffa::type_registry::any_to_json::<EditionDefault>,
11722        from_json: ::buffa::type_registry::any_from_json::<EditionDefault>,
11723        is_wkt: false,
11724    };
11725    #[cfg(feature = "text")]
11726    #[doc(hidden)]
11727    pub const __EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
11728        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
11729        text_encode: ::buffa::type_registry::any_encode_text::<EditionDefault>,
11730        text_merge: ::buffa::type_registry::any_merge_text::<EditionDefault>,
11731    };
11732    /// Information about the support window of a feature.
11733    #[derive(Clone, PartialEq, Default)]
11734    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
11735    #[cfg_attr(feature = "json", serde(default))]
11736    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11737    pub struct FeatureSupport {
11738        /// The edition that this feature was first available in.  In editions
11739        /// earlier than this one, the default assigned to EDITION_LEGACY will be
11740        /// used, and proto files will not be able to override it.
11741        ///
11742        /// Field 1: `edition_introduced`
11743        #[cfg_attr(
11744            feature = "json",
11745            serde(
11746                rename = "editionIntroduced",
11747                alias = "edition_introduced",
11748                with = "::buffa::json_helpers::opt_closed_enum",
11749                skip_serializing_if = "::core::option::Option::is_none"
11750            )
11751        )]
11752        pub edition_introduced: ::core::option::Option<super::Edition>,
11753        /// The edition this feature becomes deprecated in.  Using this after this
11754        /// edition may trigger warnings.
11755        ///
11756        /// Field 2: `edition_deprecated`
11757        #[cfg_attr(
11758            feature = "json",
11759            serde(
11760                rename = "editionDeprecated",
11761                alias = "edition_deprecated",
11762                with = "::buffa::json_helpers::opt_closed_enum",
11763                skip_serializing_if = "::core::option::Option::is_none"
11764            )
11765        )]
11766        pub edition_deprecated: ::core::option::Option<super::Edition>,
11767        /// The deprecation warning text if this feature is used after the edition it
11768        /// was marked deprecated in.
11769        ///
11770        /// Field 3: `deprecation_warning`
11771        #[cfg_attr(
11772            feature = "json",
11773            serde(
11774                rename = "deprecationWarning",
11775                alias = "deprecation_warning",
11776                skip_serializing_if = "::core::option::Option::is_none"
11777            )
11778        )]
11779        pub deprecation_warning: ::core::option::Option<::buffa::alloc::string::String>,
11780        /// The edition this feature is no longer available in.  In editions after
11781        /// this one, the last default assigned will be used, and proto files will
11782        /// not be able to override it.
11783        ///
11784        /// Field 4: `edition_removed`
11785        #[cfg_attr(
11786            feature = "json",
11787            serde(
11788                rename = "editionRemoved",
11789                alias = "edition_removed",
11790                with = "::buffa::json_helpers::opt_closed_enum",
11791                skip_serializing_if = "::core::option::Option::is_none"
11792            )
11793        )]
11794        pub edition_removed: ::core::option::Option<super::Edition>,
11795        #[cfg_attr(feature = "json", serde(skip))]
11796        #[doc(hidden)]
11797        pub __buffa_unknown_fields: ::buffa::UnknownFields,
11798    }
11799    impl ::core::fmt::Debug for FeatureSupport {
11800        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11801            f.debug_struct("FeatureSupport")
11802                .field("edition_introduced", &self.edition_introduced)
11803                .field("edition_deprecated", &self.edition_deprecated)
11804                .field("deprecation_warning", &self.deprecation_warning)
11805                .field("edition_removed", &self.edition_removed)
11806                .finish()
11807        }
11808    }
11809    impl FeatureSupport {
11810        /// Protobuf type URL for this message, for use with `Any::pack` and
11811        /// `Any::unpack_if`.
11812        ///
11813        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11814        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11815    }
11816    impl FeatureSupport {
11817        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11818        #[inline]
11819        ///Sets [`Self::edition_introduced`] to `Some(value)`, consuming and returning `self`.
11820        pub fn with_edition_introduced(
11821            mut self,
11822            value: impl Into<super::Edition>,
11823        ) -> Self {
11824            self.edition_introduced = Some(value.into());
11825            self
11826        }
11827        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11828        #[inline]
11829        ///Sets [`Self::edition_deprecated`] to `Some(value)`, consuming and returning `self`.
11830        pub fn with_edition_deprecated(
11831            mut self,
11832            value: impl Into<super::Edition>,
11833        ) -> Self {
11834            self.edition_deprecated = Some(value.into());
11835            self
11836        }
11837        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11838        #[inline]
11839        ///Sets [`Self::deprecation_warning`] to `Some(value)`, consuming and returning `self`.
11840        pub fn with_deprecation_warning(
11841            mut self,
11842            value: impl Into<::buffa::alloc::string::String>,
11843        ) -> Self {
11844            self.deprecation_warning = Some(value.into());
11845            self
11846        }
11847        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
11848        #[inline]
11849        ///Sets [`Self::edition_removed`] to `Some(value)`, consuming and returning `self`.
11850        pub fn with_edition_removed(mut self, value: impl Into<super::Edition>) -> Self {
11851            self.edition_removed = Some(value.into());
11852            self
11853        }
11854    }
11855    ::buffa::impl_default_instance!(FeatureSupport);
11856    impl ::buffa::MessageName for FeatureSupport {
11857        const PACKAGE: &'static str = "google.protobuf";
11858        const NAME: &'static str = "FieldOptions.FeatureSupport";
11859        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
11860        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
11861    }
11862    impl ::buffa::Message for FeatureSupport {
11863        /// Returns the total encoded size in bytes.
11864        ///
11865        /// Accumulates in `u64` (which cannot overflow for in-memory
11866        /// data) and saturates to `u32` at return, so a message whose
11867        /// encoded size exceeds the 2 GiB protobuf limit yields a value
11868        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
11869        /// points reject, never a silently wrapped size.
11870        #[allow(clippy::let_and_return)]
11871        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11872            #[allow(unused_imports)]
11873            use ::buffa::Enumeration as _;
11874            let mut size = 0u64;
11875            if let Some(ref v) = self.edition_introduced {
11876                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11877            }
11878            if let Some(ref v) = self.edition_deprecated {
11879                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11880            }
11881            if let Some(ref v) = self.deprecation_warning {
11882                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
11883            }
11884            if let Some(ref v) = self.edition_removed {
11885                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
11886            }
11887            size += self.__buffa_unknown_fields.encoded_len() as u64;
11888            ::buffa::saturate_size(size)
11889        }
11890        fn write_to(
11891            &self,
11892            _cache: &mut ::buffa::SizeCache,
11893            buf: &mut impl ::buffa::EncodeSink,
11894        ) {
11895            #[allow(unused_imports)]
11896            use ::buffa::Enumeration as _;
11897            if let Some(ref v) = self.edition_introduced {
11898                ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
11899            }
11900            if let Some(ref v) = self.edition_deprecated {
11901                ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
11902            }
11903            if let Some(ref v) = self.deprecation_warning {
11904                ::buffa::types::put_string_field(3u32, v, buf);
11905            }
11906            if let Some(ref v) = self.edition_removed {
11907                ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
11908            }
11909            self.__buffa_unknown_fields.write_to(buf);
11910        }
11911        fn merge_field(
11912            &mut self,
11913            tag: ::buffa::encoding::Tag,
11914            buf: &mut impl ::buffa::bytes::Buf,
11915            ctx: ::buffa::DecodeContext<'_>,
11916        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11917            #[allow(unused_imports)]
11918            use ::buffa::bytes::Buf as _;
11919            #[allow(unused_imports)]
11920            use ::buffa::Enumeration as _;
11921            match tag.field_number() {
11922                1u32 => {
11923                    ::buffa::encoding::check_wire_type(
11924                        tag,
11925                        ::buffa::encoding::WireType::Varint,
11926                    )?;
11927                    let __raw = ::buffa::types::decode_int32(buf)?;
11928                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11929                        __raw,
11930                    ) {
11931                        self.edition_introduced = ::core::option::Option::Some(__v);
11932                    } else {
11933                        ctx.register_unknown_field()?;
11934                        self.__buffa_unknown_fields
11935                            .push(::buffa::UnknownField {
11936                                number: 1u32,
11937                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11938                            });
11939                    }
11940                }
11941                2u32 => {
11942                    ::buffa::encoding::check_wire_type(
11943                        tag,
11944                        ::buffa::encoding::WireType::Varint,
11945                    )?;
11946                    let __raw = ::buffa::types::decode_int32(buf)?;
11947                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11948                        __raw,
11949                    ) {
11950                        self.edition_deprecated = ::core::option::Option::Some(__v);
11951                    } else {
11952                        ctx.register_unknown_field()?;
11953                        self.__buffa_unknown_fields
11954                            .push(::buffa::UnknownField {
11955                                number: 2u32,
11956                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11957                            });
11958                    }
11959                }
11960                3u32 => {
11961                    ::buffa::encoding::check_wire_type(
11962                        tag,
11963                        ::buffa::encoding::WireType::LengthDelimited,
11964                    )?;
11965                    ::buffa::types::merge_string(
11966                        self
11967                            .deprecation_warning
11968                            .get_or_insert_with(::buffa::alloc::string::String::new),
11969                        buf,
11970                    )?;
11971                }
11972                4u32 => {
11973                    ::buffa::encoding::check_wire_type(
11974                        tag,
11975                        ::buffa::encoding::WireType::Varint,
11976                    )?;
11977                    let __raw = ::buffa::types::decode_int32(buf)?;
11978                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
11979                        __raw,
11980                    ) {
11981                        self.edition_removed = ::core::option::Option::Some(__v);
11982                    } else {
11983                        ctx.register_unknown_field()?;
11984                        self.__buffa_unknown_fields
11985                            .push(::buffa::UnknownField {
11986                                number: 4u32,
11987                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
11988                            });
11989                    }
11990                }
11991                _ => {
11992                    self.__buffa_unknown_fields
11993                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
11994                }
11995            }
11996            ::core::result::Result::Ok(())
11997        }
11998        fn clear(&mut self) {
11999            self.edition_introduced = ::core::option::Option::None;
12000            self.edition_deprecated = ::core::option::Option::None;
12001            self.deprecation_warning = ::core::option::Option::None;
12002            self.edition_removed = ::core::option::Option::None;
12003            self.__buffa_unknown_fields.clear();
12004        }
12005    }
12006    impl ::buffa::ExtensionSet for FeatureSupport {
12007        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
12008        fn unknown_fields(&self) -> &::buffa::UnknownFields {
12009            &self.__buffa_unknown_fields
12010        }
12011        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12012            &mut self.__buffa_unknown_fields
12013        }
12014    }
12015    #[cfg(feature = "text")]
12016    impl ::buffa::text::TextFormat for FeatureSupport {
12017        fn encode_text(
12018            &self,
12019            enc: &mut ::buffa::text::TextEncoder<'_>,
12020        ) -> ::core::fmt::Result {
12021            #[allow(unused_imports)]
12022            use ::buffa::Enumeration as _;
12023            if let ::core::option::Option::Some(ref __v) = self.edition_introduced {
12024                enc.write_field_name("edition_introduced")?;
12025                enc.write_enum_name(__v.proto_name())?;
12026            }
12027            if let ::core::option::Option::Some(ref __v) = self.edition_deprecated {
12028                enc.write_field_name("edition_deprecated")?;
12029                enc.write_enum_name(__v.proto_name())?;
12030            }
12031            if let ::core::option::Option::Some(ref __v) = self.deprecation_warning {
12032                enc.write_field_name("deprecation_warning")?;
12033                enc.write_string(__v)?;
12034            }
12035            if let ::core::option::Option::Some(ref __v) = self.edition_removed {
12036                enc.write_field_name("edition_removed")?;
12037                enc.write_enum_name(__v.proto_name())?;
12038            }
12039            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12040            ::core::result::Result::Ok(())
12041        }
12042        fn merge_text(
12043            &mut self,
12044            dec: &mut ::buffa::text::TextDecoder<'_>,
12045        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12046            #[allow(unused_imports)]
12047            use ::buffa::Enumeration as _;
12048            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12049                match __name {
12050                    "edition_introduced" => {
12051                        self.edition_introduced = ::core::option::Option::Some(
12052                            dec.read_closed_enum_by_name::<super::Edition>()?,
12053                        );
12054                    }
12055                    "edition_deprecated" => {
12056                        self.edition_deprecated = ::core::option::Option::Some(
12057                            dec.read_closed_enum_by_name::<super::Edition>()?,
12058                        );
12059                    }
12060                    "deprecation_warning" => {
12061                        self.deprecation_warning = ::core::option::Option::Some(
12062                            dec.read_string()?.into_owned(),
12063                        );
12064                    }
12065                    "edition_removed" => {
12066                        self.edition_removed = ::core::option::Option::Some(
12067                            dec.read_closed_enum_by_name::<super::Edition>()?,
12068                        );
12069                    }
12070                    _ => dec.skip_value()?,
12071                }
12072            }
12073            ::core::result::Result::Ok(())
12074        }
12075    }
12076    #[cfg(feature = "json")]
12077    impl ::buffa::json_helpers::ProtoElemJson for FeatureSupport {
12078        fn serialize_proto_json<S: ::serde::Serializer>(
12079            v: &Self,
12080            s: S,
12081        ) -> ::core::result::Result<S::Ok, S::Error> {
12082            ::serde::Serialize::serialize(v, s)
12083        }
12084        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12085            d: D,
12086        ) -> ::core::result::Result<Self, D::Error> {
12087            <Self as ::serde::Deserialize>::deserialize(d)
12088        }
12089    }
12090    #[cfg(feature = "json")]
12091    #[doc(hidden)]
12092    pub const __FEATURE_SUPPORT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12093        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12094        to_json: ::buffa::type_registry::any_to_json::<FeatureSupport>,
12095        from_json: ::buffa::type_registry::any_from_json::<FeatureSupport>,
12096        is_wkt: false,
12097    };
12098    #[cfg(feature = "text")]
12099    #[doc(hidden)]
12100    pub const __FEATURE_SUPPORT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12101        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12102        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSupport>,
12103        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSupport>,
12104    };
12105    #[cfg(feature = "views")]
12106    #[doc(inline)]
12107    pub use super::__buffa::view::field_options::EditionDefaultView;
12108    #[cfg(feature = "views")]
12109    #[doc(inline)]
12110    pub use super::__buffa::view::field_options::EditionDefaultOwnedView;
12111    #[cfg(feature = "views")]
12112    #[doc(inline)]
12113    pub use super::__buffa::view::field_options::FeatureSupportView;
12114    #[cfg(feature = "views")]
12115    #[doc(inline)]
12116    pub use super::__buffa::view::field_options::FeatureSupportOwnedView;
12117}
12118#[derive(Clone, PartialEq, Default)]
12119#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12120#[cfg_attr(feature = "json", serde(default))]
12121#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12122pub struct OneofOptions {
12123    /// Any features defined in the specific edition.
12124    /// WARNING: This field should only be used by protobuf plugins or special
12125    /// cases like the proto compiler. Other uses are discouraged and
12126    /// developers should rely on the protoreflect APIs for their client language.
12127    ///
12128    /// Field 1: `features`
12129    #[cfg_attr(
12130        feature = "json",
12131        serde(
12132            rename = "features",
12133            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12134        )
12135    )]
12136    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12137    /// The parser stores options it doesn't recognize here. See above.
12138    ///
12139    /// Field 999: `uninterpreted_option`
12140    #[cfg_attr(
12141        feature = "json",
12142        serde(
12143            rename = "uninterpretedOption",
12144            alias = "uninterpreted_option",
12145            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12146            deserialize_with = "::buffa::json_helpers::null_as_default"
12147        )
12148    )]
12149    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12150    #[cfg_attr(feature = "json", serde(flatten))]
12151    #[doc(hidden)]
12152    pub __buffa_unknown_fields: __OneofOptionsExtJson,
12153}
12154impl ::core::fmt::Debug for OneofOptions {
12155    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12156        f.debug_struct("OneofOptions")
12157            .field("features", &self.features)
12158            .field("uninterpreted_option", &self.uninterpreted_option)
12159            .finish()
12160    }
12161}
12162impl OneofOptions {
12163    /// Protobuf type URL for this message, for use with `Any::pack` and
12164    /// `Any::unpack_if`.
12165    ///
12166    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12167    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12168}
12169::buffa::impl_default_instance!(OneofOptions);
12170impl ::buffa::MessageName for OneofOptions {
12171    const PACKAGE: &'static str = "google.protobuf";
12172    const NAME: &'static str = "OneofOptions";
12173    const FULL_NAME: &'static str = "google.protobuf.OneofOptions";
12174    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12175}
12176impl ::buffa::Message for OneofOptions {
12177    /// Returns the total encoded size in bytes.
12178    ///
12179    /// Accumulates in `u64` (which cannot overflow for in-memory
12180    /// data) and saturates to `u32` at return, so a message whose
12181    /// encoded size exceeds the 2 GiB protobuf limit yields a value
12182    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
12183    /// points reject, never a silently wrapped size.
12184    #[allow(clippy::let_and_return)]
12185    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12186        #[allow(unused_imports)]
12187        use ::buffa::Enumeration as _;
12188        let mut size = 0u64;
12189        if self.features.is_set() {
12190            let __slot = __cache.reserve();
12191            let inner_size = self.features.compute_size(__cache);
12192            __cache.set(__slot, inner_size);
12193            size
12194                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12195                    + inner_size as u64;
12196        }
12197        for v in &self.uninterpreted_option {
12198            let __slot = __cache.reserve();
12199            let inner_size = v.compute_size(__cache);
12200            __cache.set(__slot, inner_size);
12201            size
12202                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12203                    + inner_size as u64;
12204        }
12205        size += self.__buffa_unknown_fields.encoded_len() as u64;
12206        ::buffa::saturate_size(size)
12207    }
12208    fn write_to(
12209        &self,
12210        __cache: &mut ::buffa::SizeCache,
12211        buf: &mut impl ::buffa::EncodeSink,
12212    ) {
12213        #[allow(unused_imports)]
12214        use ::buffa::Enumeration as _;
12215        if self.features.is_set() {
12216            ::buffa::types::put_len_delimited_header(
12217                1u32,
12218                u64::from(__cache.consume_next()),
12219                buf,
12220            );
12221            self.features.write_to(__cache, buf);
12222        }
12223        for v in &self.uninterpreted_option {
12224            ::buffa::types::put_len_delimited_header(
12225                999u32,
12226                u64::from(__cache.consume_next()),
12227                buf,
12228            );
12229            v.write_to(__cache, buf);
12230        }
12231        self.__buffa_unknown_fields.write_to(buf);
12232    }
12233    fn merge_field(
12234        &mut self,
12235        tag: ::buffa::encoding::Tag,
12236        buf: &mut impl ::buffa::bytes::Buf,
12237        ctx: ::buffa::DecodeContext<'_>,
12238    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12239        #[allow(unused_imports)]
12240        use ::buffa::bytes::Buf as _;
12241        #[allow(unused_imports)]
12242        use ::buffa::Enumeration as _;
12243        match tag.field_number() {
12244            1u32 => {
12245                ::buffa::encoding::check_wire_type(
12246                    tag,
12247                    ::buffa::encoding::WireType::LengthDelimited,
12248                )?;
12249                ::buffa::Message::merge_length_delimited(
12250                    self.features.get_or_insert_default(),
12251                    buf,
12252                    ctx,
12253                )?;
12254            }
12255            999u32 => {
12256                ::buffa::encoding::check_wire_type(
12257                    tag,
12258                    ::buffa::encoding::WireType::LengthDelimited,
12259                )?;
12260                let mut elem = ::core::default::Default::default();
12261                ctx.register_element_memory(
12262                    ::buffa::__private::element_footprint(&elem),
12263                )?;
12264                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
12265                self.uninterpreted_option.push(elem);
12266            }
12267            _ => {
12268                self.__buffa_unknown_fields
12269                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12270            }
12271        }
12272        ::core::result::Result::Ok(())
12273    }
12274    fn clear(&mut self) {
12275        self.features = ::buffa::MessageField::none();
12276        self.uninterpreted_option.clear();
12277        self.__buffa_unknown_fields.clear();
12278    }
12279}
12280impl ::buffa::ExtensionSet for OneofOptions {
12281    const PROTO_FQN: &'static str = "google.protobuf.OneofOptions";
12282    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12283        &self.__buffa_unknown_fields
12284    }
12285    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12286        &mut self.__buffa_unknown_fields
12287    }
12288}
12289#[cfg(feature = "text")]
12290impl ::buffa::text::TextFormat for OneofOptions {
12291    fn encode_text(
12292        &self,
12293        enc: &mut ::buffa::text::TextEncoder<'_>,
12294    ) -> ::core::fmt::Result {
12295        #[allow(unused_imports)]
12296        use ::buffa::Enumeration as _;
12297        if self.features.is_set() {
12298            enc.write_field_name("features")?;
12299            enc.write_message(&*self.features)?;
12300        }
12301        for __v in &self.uninterpreted_option {
12302            enc.write_field_name("uninterpreted_option")?;
12303            enc.write_message(__v)?;
12304        }
12305        enc.write_extension_fields(
12306            "google.protobuf.OneofOptions",
12307            &self.__buffa_unknown_fields,
12308        )?;
12309        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12310        ::core::result::Result::Ok(())
12311    }
12312    fn merge_text(
12313        &mut self,
12314        dec: &mut ::buffa::text::TextDecoder<'_>,
12315    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12316        #[allow(unused_imports)]
12317        use ::buffa::Enumeration as _;
12318        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12319            match __name {
12320                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12321                "uninterpreted_option" => {
12322                    dec.read_repeated_into(
12323                        &mut self.uninterpreted_option,
12324                        |__d| {
12325                            let mut __m = ::core::default::Default::default();
12326                            __d.merge_message(&mut __m)?;
12327                            ::core::result::Result::Ok(__m)
12328                        },
12329                    )?
12330                }
12331                __name if __name.starts_with('[') => {
12332                    for __r in dec
12333                        .read_extension(__name, "google.protobuf.OneofOptions")?
12334                    {
12335                        self.__buffa_unknown_fields.push(__r);
12336                    }
12337                }
12338                _ => dec.skip_value()?,
12339            }
12340        }
12341        ::core::result::Result::Ok(())
12342    }
12343}
12344#[cfg(feature = "json")]
12345impl<'de> serde::Deserialize<'de> for OneofOptions {
12346    fn deserialize<D: serde::Deserializer<'de>>(
12347        d: D,
12348    ) -> ::core::result::Result<Self, D::Error> {
12349        struct _V;
12350        impl<'de> serde::de::Visitor<'de> for _V {
12351            type Value = OneofOptions;
12352            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12353                f.write_str("struct OneofOptions")
12354            }
12355            #[allow(clippy::field_reassign_with_default)]
12356            fn visit_map<A: serde::de::MapAccess<'de>>(
12357                self,
12358                mut map: A,
12359            ) -> ::core::result::Result<OneofOptions, A::Error> {
12360                let mut __f_features: ::core::option::Option<
12361                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12362                > = None;
12363                let mut __f_uninterpreted_option: ::core::option::Option<
12364                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12365                > = None;
12366                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12367                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12368                    match key.as_str() {
12369                        "features" => {
12370                            __f_features = Some(
12371                                map
12372                                    .next_value::<
12373                                        ::buffa::MessageField<
12374                                            FeatureSet,
12375                                            ::buffa::Inline<FeatureSet>,
12376                                        >,
12377                                    >()?,
12378                            );
12379                        }
12380                        "uninterpretedOption" | "uninterpreted_option" => {
12381                            __f_uninterpreted_option = Some({
12382                                struct _S;
12383                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
12384                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12385                                    fn deserialize<D: serde::Deserializer<'de>>(
12386                                        self,
12387                                        d: D,
12388                                    ) -> ::core::result::Result<
12389                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12390                                        D::Error,
12391                                    > {
12392                                        ::buffa::json_helpers::null_as_default(d)
12393                                    }
12394                                }
12395                                map.next_value_seed(_S)?
12396                            });
12397                        }
12398                        __k if __k.starts_with('[') => {
12399                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12400                            match ::buffa::extension_registry::deserialize_extension_key(
12401                                "google.protobuf.OneofOptions",
12402                                __k,
12403                                __v,
12404                            ) {
12405                                ::core::option::Option::Some(
12406                                    ::core::result::Result::Ok(__recs),
12407                                ) => {
12408                                    for __rec in __recs {
12409                                        __ext_records.push(__rec);
12410                                    }
12411                                }
12412                                ::core::option::Option::Some(
12413                                    ::core::result::Result::Err(__e),
12414                                ) => {
12415                                    return ::core::result::Result::Err(
12416                                        <A::Error as ::serde::de::Error>::custom(__e),
12417                                    );
12418                                }
12419                                ::core::option::Option::None => {}
12420                            }
12421                        }
12422                        _ => {
12423                            map.next_value::<serde::de::IgnoredAny>()?;
12424                        }
12425                    }
12426                }
12427                let mut __r = <OneofOptions as ::core::default::Default>::default();
12428                if let ::core::option::Option::Some(v) = __f_features {
12429                    __r.features = v;
12430                }
12431                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
12432                    __r.uninterpreted_option = v;
12433                }
12434                for __rec in __ext_records {
12435                    __r.__buffa_unknown_fields.push(__rec);
12436                }
12437                Ok(__r)
12438            }
12439        }
12440        d.deserialize_map(_V)
12441    }
12442}
12443#[cfg(feature = "json")]
12444impl ::buffa::json_helpers::ProtoElemJson for OneofOptions {
12445    fn serialize_proto_json<S: ::serde::Serializer>(
12446        v: &Self,
12447        s: S,
12448    ) -> ::core::result::Result<S::Ok, S::Error> {
12449        ::serde::Serialize::serialize(v, s)
12450    }
12451    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12452        d: D,
12453    ) -> ::core::result::Result<Self, D::Error> {
12454        <Self as ::serde::Deserialize>::deserialize(d)
12455    }
12456}
12457#[doc(hidden)]
12458#[derive(Clone, Debug, Default, PartialEq)]
12459#[repr(transparent)]
12460#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12461pub struct __OneofOptionsExtJson(pub ::buffa::UnknownFields);
12462impl ::core::ops::Deref for __OneofOptionsExtJson {
12463    type Target = ::buffa::UnknownFields;
12464    fn deref(&self) -> &::buffa::UnknownFields {
12465        &self.0
12466    }
12467}
12468impl ::core::ops::DerefMut for __OneofOptionsExtJson {
12469    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
12470        &mut self.0
12471    }
12472}
12473impl ::core::convert::From<::buffa::UnknownFields> for __OneofOptionsExtJson {
12474    fn from(u: ::buffa::UnknownFields) -> Self {
12475        Self(u)
12476    }
12477}
12478#[cfg(feature = "json")]
12479impl ::serde::Serialize for __OneofOptionsExtJson {
12480    fn serialize<S: ::serde::Serializer>(
12481        &self,
12482        s: S,
12483    ) -> ::core::result::Result<S::Ok, S::Error> {
12484        ::buffa::extension_registry::serialize_extensions(
12485            "google.protobuf.OneofOptions",
12486            &self.0,
12487            s,
12488        )
12489    }
12490}
12491#[cfg(feature = "json")]
12492impl<'de> ::serde::Deserialize<'de> for __OneofOptionsExtJson {
12493    fn deserialize<D: ::serde::Deserializer<'de>>(
12494        d: D,
12495    ) -> ::core::result::Result<Self, D::Error> {
12496        ::buffa::extension_registry::deserialize_extensions(
12497                "google.protobuf.OneofOptions",
12498                d,
12499            )
12500            .map(Self)
12501    }
12502}
12503#[cfg(feature = "json")]
12504#[doc(hidden)]
12505pub const __ONEOF_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12506    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12507    to_json: ::buffa::type_registry::any_to_json::<OneofOptions>,
12508    from_json: ::buffa::type_registry::any_from_json::<OneofOptions>,
12509    is_wkt: false,
12510};
12511#[cfg(feature = "text")]
12512#[doc(hidden)]
12513pub const __ONEOF_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12514    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
12515    text_encode: ::buffa::type_registry::any_encode_text::<OneofOptions>,
12516    text_merge: ::buffa::type_registry::any_merge_text::<OneofOptions>,
12517};
12518#[derive(Clone, PartialEq, Default)]
12519#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12520#[cfg_attr(feature = "json", serde(default))]
12521#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12522pub struct EnumOptions {
12523    /// Set this option to true to allow mapping different tag names to the same
12524    /// value.
12525    ///
12526    /// Field 2: `allow_alias`
12527    #[cfg_attr(
12528        feature = "json",
12529        serde(
12530            rename = "allowAlias",
12531            alias = "allow_alias",
12532            skip_serializing_if = "::core::option::Option::is_none"
12533        )
12534    )]
12535    pub allow_alias: ::core::option::Option<bool>,
12536    /// Is this enum deprecated?
12537    /// Depending on the target platform, this can emit Deprecated annotations
12538    /// for the enum, or it will be completely ignored; in the very least, this
12539    /// is a formalization for deprecating enums.
12540    ///
12541    /// Field 3: `deprecated`
12542    #[cfg_attr(
12543        feature = "json",
12544        serde(
12545            rename = "deprecated",
12546            skip_serializing_if = "::core::option::Option::is_none"
12547        )
12548    )]
12549    pub deprecated: ::core::option::Option<bool>,
12550    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
12551    /// and strips underscored from the fields before comparison in proto3 only.
12552    /// The new behavior takes `json_name` into account and applies to proto2 as
12553    /// well.
12554    /// TODO Remove this legacy behavior once downstream teams have
12555    /// had time to migrate.
12556    ///
12557    /// Field 6: `deprecated_legacy_json_field_conflicts`
12558    #[cfg_attr(
12559        feature = "json",
12560        serde(
12561            rename = "deprecatedLegacyJsonFieldConflicts",
12562            alias = "deprecated_legacy_json_field_conflicts",
12563            skip_serializing_if = "::core::option::Option::is_none"
12564        )
12565    )]
12566    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
12567    /// Any features defined in the specific edition.
12568    /// WARNING: This field should only be used by protobuf plugins or special
12569    /// cases like the proto compiler. Other uses are discouraged and
12570    /// developers should rely on the protoreflect APIs for their client language.
12571    ///
12572    /// Field 7: `features`
12573    #[cfg_attr(
12574        feature = "json",
12575        serde(
12576            rename = "features",
12577            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12578        )
12579    )]
12580    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12581    /// The parser stores options it doesn't recognize here. See above.
12582    ///
12583    /// Field 999: `uninterpreted_option`
12584    #[cfg_attr(
12585        feature = "json",
12586        serde(
12587            rename = "uninterpretedOption",
12588            alias = "uninterpreted_option",
12589            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12590            deserialize_with = "::buffa::json_helpers::null_as_default"
12591        )
12592    )]
12593    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12594    #[cfg_attr(feature = "json", serde(flatten))]
12595    #[doc(hidden)]
12596    pub __buffa_unknown_fields: __EnumOptionsExtJson,
12597}
12598impl ::core::fmt::Debug for EnumOptions {
12599    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12600        f.debug_struct("EnumOptions")
12601            .field("allow_alias", &self.allow_alias)
12602            .field("deprecated", &self.deprecated)
12603            .field(
12604                "deprecated_legacy_json_field_conflicts",
12605                &self.deprecated_legacy_json_field_conflicts,
12606            )
12607            .field("features", &self.features)
12608            .field("uninterpreted_option", &self.uninterpreted_option)
12609            .finish()
12610    }
12611}
12612impl EnumOptions {
12613    /// Protobuf type URL for this message, for use with `Any::pack` and
12614    /// `Any::unpack_if`.
12615    ///
12616    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12617    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12618}
12619impl EnumOptions {
12620    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12621    #[inline]
12622    ///Sets [`Self::allow_alias`] to `Some(value)`, consuming and returning `self`.
12623    pub fn with_allow_alias(mut self, value: bool) -> Self {
12624        self.allow_alias = Some(value);
12625        self
12626    }
12627    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12628    #[inline]
12629    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
12630    pub fn with_deprecated(mut self, value: bool) -> Self {
12631        self.deprecated = Some(value);
12632        self
12633    }
12634    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12635    #[inline]
12636    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
12637    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
12638        self.deprecated_legacy_json_field_conflicts = Some(value);
12639        self
12640    }
12641}
12642::buffa::impl_default_instance!(EnumOptions);
12643impl ::buffa::MessageName for EnumOptions {
12644    const PACKAGE: &'static str = "google.protobuf";
12645    const NAME: &'static str = "EnumOptions";
12646    const FULL_NAME: &'static str = "google.protobuf.EnumOptions";
12647    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
12648}
12649impl ::buffa::Message for EnumOptions {
12650    /// Returns the total encoded size in bytes.
12651    ///
12652    /// Accumulates in `u64` (which cannot overflow for in-memory
12653    /// data) and saturates to `u32` at return, so a message whose
12654    /// encoded size exceeds the 2 GiB protobuf limit yields a value
12655    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
12656    /// points reject, never a silently wrapped size.
12657    #[allow(clippy::let_and_return)]
12658    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12659        #[allow(unused_imports)]
12660        use ::buffa::Enumeration as _;
12661        let mut size = 0u64;
12662        if self.allow_alias.is_some() {
12663            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12664        }
12665        if self.deprecated.is_some() {
12666            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12667        }
12668        if self.deprecated_legacy_json_field_conflicts.is_some() {
12669            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
12670        }
12671        if self.features.is_set() {
12672            let __slot = __cache.reserve();
12673            let inner_size = self.features.compute_size(__cache);
12674            __cache.set(__slot, inner_size);
12675            size
12676                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12677                    + inner_size as u64;
12678        }
12679        for v in &self.uninterpreted_option {
12680            let __slot = __cache.reserve();
12681            let inner_size = v.compute_size(__cache);
12682            __cache.set(__slot, inner_size);
12683            size
12684                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
12685                    + inner_size as u64;
12686        }
12687        size += self.__buffa_unknown_fields.encoded_len() as u64;
12688        ::buffa::saturate_size(size)
12689    }
12690    fn write_to(
12691        &self,
12692        __cache: &mut ::buffa::SizeCache,
12693        buf: &mut impl ::buffa::EncodeSink,
12694    ) {
12695        #[allow(unused_imports)]
12696        use ::buffa::Enumeration as _;
12697        if let Some(v) = self.allow_alias {
12698            ::buffa::types::put_bool_field(2u32, v, buf);
12699        }
12700        if let Some(v) = self.deprecated {
12701            ::buffa::types::put_bool_field(3u32, v, buf);
12702        }
12703        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
12704            ::buffa::types::put_bool_field(6u32, v, buf);
12705        }
12706        if self.features.is_set() {
12707            ::buffa::types::put_len_delimited_header(
12708                7u32,
12709                u64::from(__cache.consume_next()),
12710                buf,
12711            );
12712            self.features.write_to(__cache, buf);
12713        }
12714        for v in &self.uninterpreted_option {
12715            ::buffa::types::put_len_delimited_header(
12716                999u32,
12717                u64::from(__cache.consume_next()),
12718                buf,
12719            );
12720            v.write_to(__cache, buf);
12721        }
12722        self.__buffa_unknown_fields.write_to(buf);
12723    }
12724    fn merge_field(
12725        &mut self,
12726        tag: ::buffa::encoding::Tag,
12727        buf: &mut impl ::buffa::bytes::Buf,
12728        ctx: ::buffa::DecodeContext<'_>,
12729    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12730        #[allow(unused_imports)]
12731        use ::buffa::bytes::Buf as _;
12732        #[allow(unused_imports)]
12733        use ::buffa::Enumeration as _;
12734        match tag.field_number() {
12735            2u32 => {
12736                ::buffa::encoding::check_wire_type(
12737                    tag,
12738                    ::buffa::encoding::WireType::Varint,
12739                )?;
12740                self.allow_alias = ::core::option::Option::Some(
12741                    ::buffa::types::decode_bool(buf)?,
12742                );
12743            }
12744            3u32 => {
12745                ::buffa::encoding::check_wire_type(
12746                    tag,
12747                    ::buffa::encoding::WireType::Varint,
12748                )?;
12749                self.deprecated = ::core::option::Option::Some(
12750                    ::buffa::types::decode_bool(buf)?,
12751                );
12752            }
12753            6u32 => {
12754                ::buffa::encoding::check_wire_type(
12755                    tag,
12756                    ::buffa::encoding::WireType::Varint,
12757                )?;
12758                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12759                    ::buffa::types::decode_bool(buf)?,
12760                );
12761            }
12762            7u32 => {
12763                ::buffa::encoding::check_wire_type(
12764                    tag,
12765                    ::buffa::encoding::WireType::LengthDelimited,
12766                )?;
12767                ::buffa::Message::merge_length_delimited(
12768                    self.features.get_or_insert_default(),
12769                    buf,
12770                    ctx,
12771                )?;
12772            }
12773            999u32 => {
12774                ::buffa::encoding::check_wire_type(
12775                    tag,
12776                    ::buffa::encoding::WireType::LengthDelimited,
12777                )?;
12778                let mut elem = ::core::default::Default::default();
12779                ctx.register_element_memory(
12780                    ::buffa::__private::element_footprint(&elem),
12781                )?;
12782                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
12783                self.uninterpreted_option.push(elem);
12784            }
12785            _ => {
12786                self.__buffa_unknown_fields
12787                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
12788            }
12789        }
12790        ::core::result::Result::Ok(())
12791    }
12792    fn clear(&mut self) {
12793        self.allow_alias = ::core::option::Option::None;
12794        self.deprecated = ::core::option::Option::None;
12795        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
12796        self.features = ::buffa::MessageField::none();
12797        self.uninterpreted_option.clear();
12798        self.__buffa_unknown_fields.clear();
12799    }
12800}
12801impl ::buffa::ExtensionSet for EnumOptions {
12802    const PROTO_FQN: &'static str = "google.protobuf.EnumOptions";
12803    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12804        &self.__buffa_unknown_fields
12805    }
12806    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12807        &mut self.__buffa_unknown_fields
12808    }
12809}
12810#[cfg(feature = "text")]
12811impl ::buffa::text::TextFormat for EnumOptions {
12812    fn encode_text(
12813        &self,
12814        enc: &mut ::buffa::text::TextEncoder<'_>,
12815    ) -> ::core::fmt::Result {
12816        #[allow(unused_imports)]
12817        use ::buffa::Enumeration as _;
12818        if let ::core::option::Option::Some(ref __v) = self.allow_alias {
12819            enc.write_field_name("allow_alias")?;
12820            enc.write_bool(*__v)?;
12821        }
12822        if let ::core::option::Option::Some(ref __v) = self.deprecated {
12823            enc.write_field_name("deprecated")?;
12824            enc.write_bool(*__v)?;
12825        }
12826        if let ::core::option::Option::Some(ref __v) = self
12827            .deprecated_legacy_json_field_conflicts
12828        {
12829            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
12830            enc.write_bool(*__v)?;
12831        }
12832        if self.features.is_set() {
12833            enc.write_field_name("features")?;
12834            enc.write_message(&*self.features)?;
12835        }
12836        for __v in &self.uninterpreted_option {
12837            enc.write_field_name("uninterpreted_option")?;
12838            enc.write_message(__v)?;
12839        }
12840        enc.write_extension_fields(
12841            "google.protobuf.EnumOptions",
12842            &self.__buffa_unknown_fields,
12843        )?;
12844        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12845        ::core::result::Result::Ok(())
12846    }
12847    fn merge_text(
12848        &mut self,
12849        dec: &mut ::buffa::text::TextDecoder<'_>,
12850    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12851        #[allow(unused_imports)]
12852        use ::buffa::Enumeration as _;
12853        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12854            match __name {
12855                "allow_alias" => {
12856                    self.allow_alias = ::core::option::Option::Some(dec.read_bool()?);
12857                }
12858                "deprecated" => {
12859                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
12860                }
12861                "deprecated_legacy_json_field_conflicts" => {
12862                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
12863                        dec.read_bool()?,
12864                    );
12865                }
12866                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12867                "uninterpreted_option" => {
12868                    dec.read_repeated_into(
12869                        &mut self.uninterpreted_option,
12870                        |__d| {
12871                            let mut __m = ::core::default::Default::default();
12872                            __d.merge_message(&mut __m)?;
12873                            ::core::result::Result::Ok(__m)
12874                        },
12875                    )?
12876                }
12877                __name if __name.starts_with('[') => {
12878                    for __r in dec.read_extension(__name, "google.protobuf.EnumOptions")?
12879                    {
12880                        self.__buffa_unknown_fields.push(__r);
12881                    }
12882                }
12883                _ => dec.skip_value()?,
12884            }
12885        }
12886        ::core::result::Result::Ok(())
12887    }
12888}
12889#[cfg(feature = "json")]
12890impl<'de> serde::Deserialize<'de> for EnumOptions {
12891    fn deserialize<D: serde::Deserializer<'de>>(
12892        d: D,
12893    ) -> ::core::result::Result<Self, D::Error> {
12894        struct _V;
12895        impl<'de> serde::de::Visitor<'de> for _V {
12896            type Value = EnumOptions;
12897            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12898                f.write_str("struct EnumOptions")
12899            }
12900            #[allow(clippy::field_reassign_with_default)]
12901            fn visit_map<A: serde::de::MapAccess<'de>>(
12902                self,
12903                mut map: A,
12904            ) -> ::core::result::Result<EnumOptions, A::Error> {
12905                let mut __f_allow_alias: ::core::option::Option<
12906                    ::core::option::Option<bool>,
12907                > = None;
12908                let mut __f_deprecated: ::core::option::Option<
12909                    ::core::option::Option<bool>,
12910                > = None;
12911                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
12912                    ::core::option::Option<bool>,
12913                > = None;
12914                let mut __f_features: ::core::option::Option<
12915                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
12916                > = None;
12917                let mut __f_uninterpreted_option: ::core::option::Option<
12918                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12919                > = None;
12920                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12921                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12922                    match key.as_str() {
12923                        "allowAlias" | "allow_alias" => {
12924                            __f_allow_alias = Some(
12925                                map.next_value::<::core::option::Option<bool>>()?,
12926                            );
12927                        }
12928                        "deprecated" => {
12929                            __f_deprecated = Some(
12930                                map.next_value::<::core::option::Option<bool>>()?,
12931                            );
12932                        }
12933                        "deprecatedLegacyJsonFieldConflicts"
12934                        | "deprecated_legacy_json_field_conflicts" => {
12935                            __f_deprecated_legacy_json_field_conflicts = Some(
12936                                map.next_value::<::core::option::Option<bool>>()?,
12937                            );
12938                        }
12939                        "features" => {
12940                            __f_features = Some(
12941                                map
12942                                    .next_value::<
12943                                        ::buffa::MessageField<
12944                                            FeatureSet,
12945                                            ::buffa::Inline<FeatureSet>,
12946                                        >,
12947                                    >()?,
12948                            );
12949                        }
12950                        "uninterpretedOption" | "uninterpreted_option" => {
12951                            __f_uninterpreted_option = Some({
12952                                struct _S;
12953                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
12954                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12955                                    fn deserialize<D: serde::Deserializer<'de>>(
12956                                        self,
12957                                        d: D,
12958                                    ) -> ::core::result::Result<
12959                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12960                                        D::Error,
12961                                    > {
12962                                        ::buffa::json_helpers::null_as_default(d)
12963                                    }
12964                                }
12965                                map.next_value_seed(_S)?
12966                            });
12967                        }
12968                        __k if __k.starts_with('[') => {
12969                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12970                            match ::buffa::extension_registry::deserialize_extension_key(
12971                                "google.protobuf.EnumOptions",
12972                                __k,
12973                                __v,
12974                            ) {
12975                                ::core::option::Option::Some(
12976                                    ::core::result::Result::Ok(__recs),
12977                                ) => {
12978                                    for __rec in __recs {
12979                                        __ext_records.push(__rec);
12980                                    }
12981                                }
12982                                ::core::option::Option::Some(
12983                                    ::core::result::Result::Err(__e),
12984                                ) => {
12985                                    return ::core::result::Result::Err(
12986                                        <A::Error as ::serde::de::Error>::custom(__e),
12987                                    );
12988                                }
12989                                ::core::option::Option::None => {}
12990                            }
12991                        }
12992                        _ => {
12993                            map.next_value::<serde::de::IgnoredAny>()?;
12994                        }
12995                    }
12996                }
12997                let mut __r = <EnumOptions as ::core::default::Default>::default();
12998                if let ::core::option::Option::Some(v) = __f_allow_alias {
12999                    __r.allow_alias = v;
13000                }
13001                if let ::core::option::Option::Some(v) = __f_deprecated {
13002                    __r.deprecated = v;
13003                }
13004                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
13005                    __r.deprecated_legacy_json_field_conflicts = v;
13006                }
13007                if let ::core::option::Option::Some(v) = __f_features {
13008                    __r.features = v;
13009                }
13010                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13011                    __r.uninterpreted_option = v;
13012                }
13013                for __rec in __ext_records {
13014                    __r.__buffa_unknown_fields.push(__rec);
13015                }
13016                Ok(__r)
13017            }
13018        }
13019        d.deserialize_map(_V)
13020    }
13021}
13022#[cfg(feature = "json")]
13023impl ::buffa::json_helpers::ProtoElemJson for EnumOptions {
13024    fn serialize_proto_json<S: ::serde::Serializer>(
13025        v: &Self,
13026        s: S,
13027    ) -> ::core::result::Result<S::Ok, S::Error> {
13028        ::serde::Serialize::serialize(v, s)
13029    }
13030    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13031        d: D,
13032    ) -> ::core::result::Result<Self, D::Error> {
13033        <Self as ::serde::Deserialize>::deserialize(d)
13034    }
13035}
13036#[doc(hidden)]
13037#[derive(Clone, Debug, Default, PartialEq)]
13038#[repr(transparent)]
13039#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13040pub struct __EnumOptionsExtJson(pub ::buffa::UnknownFields);
13041impl ::core::ops::Deref for __EnumOptionsExtJson {
13042    type Target = ::buffa::UnknownFields;
13043    fn deref(&self) -> &::buffa::UnknownFields {
13044        &self.0
13045    }
13046}
13047impl ::core::ops::DerefMut for __EnumOptionsExtJson {
13048    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13049        &mut self.0
13050    }
13051}
13052impl ::core::convert::From<::buffa::UnknownFields> for __EnumOptionsExtJson {
13053    fn from(u: ::buffa::UnknownFields) -> Self {
13054        Self(u)
13055    }
13056}
13057#[cfg(feature = "json")]
13058impl ::serde::Serialize for __EnumOptionsExtJson {
13059    fn serialize<S: ::serde::Serializer>(
13060        &self,
13061        s: S,
13062    ) -> ::core::result::Result<S::Ok, S::Error> {
13063        ::buffa::extension_registry::serialize_extensions(
13064            "google.protobuf.EnumOptions",
13065            &self.0,
13066            s,
13067        )
13068    }
13069}
13070#[cfg(feature = "json")]
13071impl<'de> ::serde::Deserialize<'de> for __EnumOptionsExtJson {
13072    fn deserialize<D: ::serde::Deserializer<'de>>(
13073        d: D,
13074    ) -> ::core::result::Result<Self, D::Error> {
13075        ::buffa::extension_registry::deserialize_extensions(
13076                "google.protobuf.EnumOptions",
13077                d,
13078            )
13079            .map(Self)
13080    }
13081}
13082#[cfg(feature = "json")]
13083#[doc(hidden)]
13084pub const __ENUM_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13085    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13086    to_json: ::buffa::type_registry::any_to_json::<EnumOptions>,
13087    from_json: ::buffa::type_registry::any_from_json::<EnumOptions>,
13088    is_wkt: false,
13089};
13090#[cfg(feature = "text")]
13091#[doc(hidden)]
13092pub const __ENUM_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13093    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13094    text_encode: ::buffa::type_registry::any_encode_text::<EnumOptions>,
13095    text_merge: ::buffa::type_registry::any_merge_text::<EnumOptions>,
13096};
13097#[derive(Clone, PartialEq, Default)]
13098#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13099#[cfg_attr(feature = "json", serde(default))]
13100#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13101pub struct EnumValueOptions {
13102    /// Is this enum value deprecated?
13103    /// Depending on the target platform, this can emit Deprecated annotations
13104    /// for the enum value, or it will be completely ignored; in the very least,
13105    /// this is a formalization for deprecating enum values.
13106    ///
13107    /// Field 1: `deprecated`
13108    #[cfg_attr(
13109        feature = "json",
13110        serde(
13111            rename = "deprecated",
13112            skip_serializing_if = "::core::option::Option::is_none"
13113        )
13114    )]
13115    pub deprecated: ::core::option::Option<bool>,
13116    /// Any features defined in the specific edition.
13117    /// WARNING: This field should only be used by protobuf plugins or special
13118    /// cases like the proto compiler. Other uses are discouraged and
13119    /// developers should rely on the protoreflect APIs for their client language.
13120    ///
13121    /// Field 2: `features`
13122    #[cfg_attr(
13123        feature = "json",
13124        serde(
13125            rename = "features",
13126            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13127        )
13128    )]
13129    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13130    /// Indicate that fields annotated with this enum value should not be printed
13131    /// out when using debug formats, e.g. when the field contains sensitive
13132    /// credentials.
13133    ///
13134    /// Field 3: `debug_redact`
13135    #[cfg_attr(
13136        feature = "json",
13137        serde(
13138            rename = "debugRedact",
13139            alias = "debug_redact",
13140            skip_serializing_if = "::core::option::Option::is_none"
13141        )
13142    )]
13143    pub debug_redact: ::core::option::Option<bool>,
13144    /// Information about the support window of a feature value.
13145    ///
13146    /// Field 4: `feature_support`
13147    #[cfg_attr(
13148        feature = "json",
13149        serde(
13150            rename = "featureSupport",
13151            alias = "feature_support",
13152            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13153        )
13154    )]
13155    pub feature_support: ::buffa::MessageField<
13156        field_options::FeatureSupport,
13157        ::buffa::Inline<field_options::FeatureSupport>,
13158    >,
13159    /// The parser stores options it doesn't recognize here. See above.
13160    ///
13161    /// Field 999: `uninterpreted_option`
13162    #[cfg_attr(
13163        feature = "json",
13164        serde(
13165            rename = "uninterpretedOption",
13166            alias = "uninterpreted_option",
13167            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13168            deserialize_with = "::buffa::json_helpers::null_as_default"
13169        )
13170    )]
13171    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13172    #[cfg_attr(feature = "json", serde(flatten))]
13173    #[doc(hidden)]
13174    pub __buffa_unknown_fields: __EnumValueOptionsExtJson,
13175}
13176impl ::core::fmt::Debug for EnumValueOptions {
13177    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13178        f.debug_struct("EnumValueOptions")
13179            .field("deprecated", &self.deprecated)
13180            .field("features", &self.features)
13181            .field("debug_redact", &self.debug_redact)
13182            .field("feature_support", &self.feature_support)
13183            .field("uninterpreted_option", &self.uninterpreted_option)
13184            .finish()
13185    }
13186}
13187impl EnumValueOptions {
13188    /// Protobuf type URL for this message, for use with `Any::pack` and
13189    /// `Any::unpack_if`.
13190    ///
13191    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13192    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13193}
13194impl EnumValueOptions {
13195    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13196    #[inline]
13197    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13198    pub fn with_deprecated(mut self, value: bool) -> Self {
13199        self.deprecated = Some(value);
13200        self
13201    }
13202    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13203    #[inline]
13204    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
13205    pub fn with_debug_redact(mut self, value: bool) -> Self {
13206        self.debug_redact = Some(value);
13207        self
13208    }
13209}
13210::buffa::impl_default_instance!(EnumValueOptions);
13211impl ::buffa::MessageName for EnumValueOptions {
13212    const PACKAGE: &'static str = "google.protobuf";
13213    const NAME: &'static str = "EnumValueOptions";
13214    const FULL_NAME: &'static str = "google.protobuf.EnumValueOptions";
13215    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13216}
13217impl ::buffa::Message for EnumValueOptions {
13218    /// Returns the total encoded size in bytes.
13219    ///
13220    /// Accumulates in `u64` (which cannot overflow for in-memory
13221    /// data) and saturates to `u32` at return, so a message whose
13222    /// encoded size exceeds the 2 GiB protobuf limit yields a value
13223    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
13224    /// points reject, never a silently wrapped size.
13225    #[allow(clippy::let_and_return)]
13226    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13227        #[allow(unused_imports)]
13228        use ::buffa::Enumeration as _;
13229        let mut size = 0u64;
13230        if self.deprecated.is_some() {
13231            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13232        }
13233        if self.features.is_set() {
13234            let __slot = __cache.reserve();
13235            let inner_size = self.features.compute_size(__cache);
13236            __cache.set(__slot, inner_size);
13237            size
13238                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13239                    + inner_size as u64;
13240        }
13241        if self.debug_redact.is_some() {
13242            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13243        }
13244        if self.feature_support.is_set() {
13245            let __slot = __cache.reserve();
13246            let inner_size = self.feature_support.compute_size(__cache);
13247            __cache.set(__slot, inner_size);
13248            size
13249                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13250                    + inner_size as u64;
13251        }
13252        for v in &self.uninterpreted_option {
13253            let __slot = __cache.reserve();
13254            let inner_size = v.compute_size(__cache);
13255            __cache.set(__slot, inner_size);
13256            size
13257                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13258                    + inner_size as u64;
13259        }
13260        size += self.__buffa_unknown_fields.encoded_len() as u64;
13261        ::buffa::saturate_size(size)
13262    }
13263    fn write_to(
13264        &self,
13265        __cache: &mut ::buffa::SizeCache,
13266        buf: &mut impl ::buffa::EncodeSink,
13267    ) {
13268        #[allow(unused_imports)]
13269        use ::buffa::Enumeration as _;
13270        if let Some(v) = self.deprecated {
13271            ::buffa::types::put_bool_field(1u32, v, buf);
13272        }
13273        if self.features.is_set() {
13274            ::buffa::types::put_len_delimited_header(
13275                2u32,
13276                u64::from(__cache.consume_next()),
13277                buf,
13278            );
13279            self.features.write_to(__cache, buf);
13280        }
13281        if let Some(v) = self.debug_redact {
13282            ::buffa::types::put_bool_field(3u32, v, buf);
13283        }
13284        if self.feature_support.is_set() {
13285            ::buffa::types::put_len_delimited_header(
13286                4u32,
13287                u64::from(__cache.consume_next()),
13288                buf,
13289            );
13290            self.feature_support.write_to(__cache, buf);
13291        }
13292        for v in &self.uninterpreted_option {
13293            ::buffa::types::put_len_delimited_header(
13294                999u32,
13295                u64::from(__cache.consume_next()),
13296                buf,
13297            );
13298            v.write_to(__cache, buf);
13299        }
13300        self.__buffa_unknown_fields.write_to(buf);
13301    }
13302    fn merge_field(
13303        &mut self,
13304        tag: ::buffa::encoding::Tag,
13305        buf: &mut impl ::buffa::bytes::Buf,
13306        ctx: ::buffa::DecodeContext<'_>,
13307    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13308        #[allow(unused_imports)]
13309        use ::buffa::bytes::Buf as _;
13310        #[allow(unused_imports)]
13311        use ::buffa::Enumeration as _;
13312        match tag.field_number() {
13313            1u32 => {
13314                ::buffa::encoding::check_wire_type(
13315                    tag,
13316                    ::buffa::encoding::WireType::Varint,
13317                )?;
13318                self.deprecated = ::core::option::Option::Some(
13319                    ::buffa::types::decode_bool(buf)?,
13320                );
13321            }
13322            2u32 => {
13323                ::buffa::encoding::check_wire_type(
13324                    tag,
13325                    ::buffa::encoding::WireType::LengthDelimited,
13326                )?;
13327                ::buffa::Message::merge_length_delimited(
13328                    self.features.get_or_insert_default(),
13329                    buf,
13330                    ctx,
13331                )?;
13332            }
13333            3u32 => {
13334                ::buffa::encoding::check_wire_type(
13335                    tag,
13336                    ::buffa::encoding::WireType::Varint,
13337                )?;
13338                self.debug_redact = ::core::option::Option::Some(
13339                    ::buffa::types::decode_bool(buf)?,
13340                );
13341            }
13342            4u32 => {
13343                ::buffa::encoding::check_wire_type(
13344                    tag,
13345                    ::buffa::encoding::WireType::LengthDelimited,
13346                )?;
13347                ::buffa::Message::merge_length_delimited(
13348                    self.feature_support.get_or_insert_default(),
13349                    buf,
13350                    ctx,
13351                )?;
13352            }
13353            999u32 => {
13354                ::buffa::encoding::check_wire_type(
13355                    tag,
13356                    ::buffa::encoding::WireType::LengthDelimited,
13357                )?;
13358                let mut elem = ::core::default::Default::default();
13359                ctx.register_element_memory(
13360                    ::buffa::__private::element_footprint(&elem),
13361                )?;
13362                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13363                self.uninterpreted_option.push(elem);
13364            }
13365            _ => {
13366                self.__buffa_unknown_fields
13367                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13368            }
13369        }
13370        ::core::result::Result::Ok(())
13371    }
13372    fn clear(&mut self) {
13373        self.deprecated = ::core::option::Option::None;
13374        self.features = ::buffa::MessageField::none();
13375        self.debug_redact = ::core::option::Option::None;
13376        self.feature_support = ::buffa::MessageField::none();
13377        self.uninterpreted_option.clear();
13378        self.__buffa_unknown_fields.clear();
13379    }
13380}
13381impl ::buffa::ExtensionSet for EnumValueOptions {
13382    const PROTO_FQN: &'static str = "google.protobuf.EnumValueOptions";
13383    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13384        &self.__buffa_unknown_fields
13385    }
13386    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13387        &mut self.__buffa_unknown_fields
13388    }
13389}
13390#[cfg(feature = "text")]
13391impl ::buffa::text::TextFormat for EnumValueOptions {
13392    fn encode_text(
13393        &self,
13394        enc: &mut ::buffa::text::TextEncoder<'_>,
13395    ) -> ::core::fmt::Result {
13396        #[allow(unused_imports)]
13397        use ::buffa::Enumeration as _;
13398        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13399            enc.write_field_name("deprecated")?;
13400            enc.write_bool(*__v)?;
13401        }
13402        if self.features.is_set() {
13403            enc.write_field_name("features")?;
13404            enc.write_message(&*self.features)?;
13405        }
13406        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
13407            enc.write_field_name("debug_redact")?;
13408            enc.write_bool(*__v)?;
13409        }
13410        if self.feature_support.is_set() {
13411            enc.write_field_name("feature_support")?;
13412            enc.write_message(&*self.feature_support)?;
13413        }
13414        for __v in &self.uninterpreted_option {
13415            enc.write_field_name("uninterpreted_option")?;
13416            enc.write_message(__v)?;
13417        }
13418        enc.write_extension_fields(
13419            "google.protobuf.EnumValueOptions",
13420            &self.__buffa_unknown_fields,
13421        )?;
13422        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13423        ::core::result::Result::Ok(())
13424    }
13425    fn merge_text(
13426        &mut self,
13427        dec: &mut ::buffa::text::TextDecoder<'_>,
13428    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13429        #[allow(unused_imports)]
13430        use ::buffa::Enumeration as _;
13431        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13432            match __name {
13433                "deprecated" => {
13434                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13435                }
13436                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13437                "debug_redact" => {
13438                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
13439                }
13440                "feature_support" => {
13441                    dec.merge_message(self.feature_support.get_or_insert_default())?
13442                }
13443                "uninterpreted_option" => {
13444                    dec.read_repeated_into(
13445                        &mut self.uninterpreted_option,
13446                        |__d| {
13447                            let mut __m = ::core::default::Default::default();
13448                            __d.merge_message(&mut __m)?;
13449                            ::core::result::Result::Ok(__m)
13450                        },
13451                    )?
13452                }
13453                __name if __name.starts_with('[') => {
13454                    for __r in dec
13455                        .read_extension(__name, "google.protobuf.EnumValueOptions")?
13456                    {
13457                        self.__buffa_unknown_fields.push(__r);
13458                    }
13459                }
13460                _ => dec.skip_value()?,
13461            }
13462        }
13463        ::core::result::Result::Ok(())
13464    }
13465}
13466#[cfg(feature = "json")]
13467impl<'de> serde::Deserialize<'de> for EnumValueOptions {
13468    fn deserialize<D: serde::Deserializer<'de>>(
13469        d: D,
13470    ) -> ::core::result::Result<Self, D::Error> {
13471        struct _V;
13472        impl<'de> serde::de::Visitor<'de> for _V {
13473            type Value = EnumValueOptions;
13474            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13475                f.write_str("struct EnumValueOptions")
13476            }
13477            #[allow(clippy::field_reassign_with_default)]
13478            fn visit_map<A: serde::de::MapAccess<'de>>(
13479                self,
13480                mut map: A,
13481            ) -> ::core::result::Result<EnumValueOptions, A::Error> {
13482                let mut __f_deprecated: ::core::option::Option<
13483                    ::core::option::Option<bool>,
13484                > = None;
13485                let mut __f_features: ::core::option::Option<
13486                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13487                > = None;
13488                let mut __f_debug_redact: ::core::option::Option<
13489                    ::core::option::Option<bool>,
13490                > = None;
13491                let mut __f_feature_support: ::core::option::Option<
13492                    ::buffa::MessageField<
13493                        field_options::FeatureSupport,
13494                        ::buffa::Inline<field_options::FeatureSupport>,
13495                    >,
13496                > = None;
13497                let mut __f_uninterpreted_option: ::core::option::Option<
13498                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13499                > = None;
13500                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13501                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13502                    match key.as_str() {
13503                        "deprecated" => {
13504                            __f_deprecated = Some(
13505                                map.next_value::<::core::option::Option<bool>>()?,
13506                            );
13507                        }
13508                        "features" => {
13509                            __f_features = Some(
13510                                map
13511                                    .next_value::<
13512                                        ::buffa::MessageField<
13513                                            FeatureSet,
13514                                            ::buffa::Inline<FeatureSet>,
13515                                        >,
13516                                    >()?,
13517                            );
13518                        }
13519                        "debugRedact" | "debug_redact" => {
13520                            __f_debug_redact = Some(
13521                                map.next_value::<::core::option::Option<bool>>()?,
13522                            );
13523                        }
13524                        "featureSupport" | "feature_support" => {
13525                            __f_feature_support = Some(
13526                                map
13527                                    .next_value::<
13528                                        ::buffa::MessageField<
13529                                            field_options::FeatureSupport,
13530                                            ::buffa::Inline<field_options::FeatureSupport>,
13531                                        >,
13532                                    >()?,
13533                            );
13534                        }
13535                        "uninterpretedOption" | "uninterpreted_option" => {
13536                            __f_uninterpreted_option = Some({
13537                                struct _S;
13538                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
13539                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
13540                                    fn deserialize<D: serde::Deserializer<'de>>(
13541                                        self,
13542                                        d: D,
13543                                    ) -> ::core::result::Result<
13544                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
13545                                        D::Error,
13546                                    > {
13547                                        ::buffa::json_helpers::null_as_default(d)
13548                                    }
13549                                }
13550                                map.next_value_seed(_S)?
13551                            });
13552                        }
13553                        __k if __k.starts_with('[') => {
13554                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13555                            match ::buffa::extension_registry::deserialize_extension_key(
13556                                "google.protobuf.EnumValueOptions",
13557                                __k,
13558                                __v,
13559                            ) {
13560                                ::core::option::Option::Some(
13561                                    ::core::result::Result::Ok(__recs),
13562                                ) => {
13563                                    for __rec in __recs {
13564                                        __ext_records.push(__rec);
13565                                    }
13566                                }
13567                                ::core::option::Option::Some(
13568                                    ::core::result::Result::Err(__e),
13569                                ) => {
13570                                    return ::core::result::Result::Err(
13571                                        <A::Error as ::serde::de::Error>::custom(__e),
13572                                    );
13573                                }
13574                                ::core::option::Option::None => {}
13575                            }
13576                        }
13577                        _ => {
13578                            map.next_value::<serde::de::IgnoredAny>()?;
13579                        }
13580                    }
13581                }
13582                let mut __r = <EnumValueOptions as ::core::default::Default>::default();
13583                if let ::core::option::Option::Some(v) = __f_deprecated {
13584                    __r.deprecated = v;
13585                }
13586                if let ::core::option::Option::Some(v) = __f_features {
13587                    __r.features = v;
13588                }
13589                if let ::core::option::Option::Some(v) = __f_debug_redact {
13590                    __r.debug_redact = v;
13591                }
13592                if let ::core::option::Option::Some(v) = __f_feature_support {
13593                    __r.feature_support = v;
13594                }
13595                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13596                    __r.uninterpreted_option = v;
13597                }
13598                for __rec in __ext_records {
13599                    __r.__buffa_unknown_fields.push(__rec);
13600                }
13601                Ok(__r)
13602            }
13603        }
13604        d.deserialize_map(_V)
13605    }
13606}
13607#[cfg(feature = "json")]
13608impl ::buffa::json_helpers::ProtoElemJson for EnumValueOptions {
13609    fn serialize_proto_json<S: ::serde::Serializer>(
13610        v: &Self,
13611        s: S,
13612    ) -> ::core::result::Result<S::Ok, S::Error> {
13613        ::serde::Serialize::serialize(v, s)
13614    }
13615    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13616        d: D,
13617    ) -> ::core::result::Result<Self, D::Error> {
13618        <Self as ::serde::Deserialize>::deserialize(d)
13619    }
13620}
13621#[doc(hidden)]
13622#[derive(Clone, Debug, Default, PartialEq)]
13623#[repr(transparent)]
13624#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13625pub struct __EnumValueOptionsExtJson(pub ::buffa::UnknownFields);
13626impl ::core::ops::Deref for __EnumValueOptionsExtJson {
13627    type Target = ::buffa::UnknownFields;
13628    fn deref(&self) -> &::buffa::UnknownFields {
13629        &self.0
13630    }
13631}
13632impl ::core::ops::DerefMut for __EnumValueOptionsExtJson {
13633    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13634        &mut self.0
13635    }
13636}
13637impl ::core::convert::From<::buffa::UnknownFields> for __EnumValueOptionsExtJson {
13638    fn from(u: ::buffa::UnknownFields) -> Self {
13639        Self(u)
13640    }
13641}
13642#[cfg(feature = "json")]
13643impl ::serde::Serialize for __EnumValueOptionsExtJson {
13644    fn serialize<S: ::serde::Serializer>(
13645        &self,
13646        s: S,
13647    ) -> ::core::result::Result<S::Ok, S::Error> {
13648        ::buffa::extension_registry::serialize_extensions(
13649            "google.protobuf.EnumValueOptions",
13650            &self.0,
13651            s,
13652        )
13653    }
13654}
13655#[cfg(feature = "json")]
13656impl<'de> ::serde::Deserialize<'de> for __EnumValueOptionsExtJson {
13657    fn deserialize<D: ::serde::Deserializer<'de>>(
13658        d: D,
13659    ) -> ::core::result::Result<Self, D::Error> {
13660        ::buffa::extension_registry::deserialize_extensions(
13661                "google.protobuf.EnumValueOptions",
13662                d,
13663            )
13664            .map(Self)
13665    }
13666}
13667#[cfg(feature = "json")]
13668#[doc(hidden)]
13669pub const __ENUM_VALUE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13670    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13671    to_json: ::buffa::type_registry::any_to_json::<EnumValueOptions>,
13672    from_json: ::buffa::type_registry::any_from_json::<EnumValueOptions>,
13673    is_wkt: false,
13674};
13675#[cfg(feature = "text")]
13676#[doc(hidden)]
13677pub const __ENUM_VALUE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13678    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
13679    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueOptions>,
13680    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueOptions>,
13681};
13682#[derive(Clone, PartialEq, Default)]
13683#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13684#[cfg_attr(feature = "json", serde(default))]
13685#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13686pub struct ServiceOptions {
13687    /// Any features defined in the specific edition.
13688    /// WARNING: This field should only be used by protobuf plugins or special
13689    /// cases like the proto compiler. Other uses are discouraged and
13690    /// developers should rely on the protoreflect APIs for their client language.
13691    ///
13692    /// Field 34: `features`
13693    #[cfg_attr(
13694        feature = "json",
13695        serde(
13696            rename = "features",
13697            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13698        )
13699    )]
13700    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13701    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
13702    ///   framework.  We apologize for hoarding these numbers to ourselves, but
13703    ///   we were already using them long before we decided to release Protocol
13704    ///   Buffers.
13705    ///
13706    /// Is this service deprecated?
13707    /// Depending on the target platform, this can emit Deprecated annotations
13708    /// for the service, or it will be completely ignored; in the very least,
13709    /// this is a formalization for deprecating services.
13710    ///
13711    /// Field 33: `deprecated`
13712    #[cfg_attr(
13713        feature = "json",
13714        serde(
13715            rename = "deprecated",
13716            skip_serializing_if = "::core::option::Option::is_none"
13717        )
13718    )]
13719    pub deprecated: ::core::option::Option<bool>,
13720    /// The parser stores options it doesn't recognize here. See above.
13721    ///
13722    /// Field 999: `uninterpreted_option`
13723    #[cfg_attr(
13724        feature = "json",
13725        serde(
13726            rename = "uninterpretedOption",
13727            alias = "uninterpreted_option",
13728            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13729            deserialize_with = "::buffa::json_helpers::null_as_default"
13730        )
13731    )]
13732    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13733    #[cfg_attr(feature = "json", serde(flatten))]
13734    #[doc(hidden)]
13735    pub __buffa_unknown_fields: __ServiceOptionsExtJson,
13736}
13737impl ::core::fmt::Debug for ServiceOptions {
13738    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13739        f.debug_struct("ServiceOptions")
13740            .field("features", &self.features)
13741            .field("deprecated", &self.deprecated)
13742            .field("uninterpreted_option", &self.uninterpreted_option)
13743            .finish()
13744    }
13745}
13746impl ServiceOptions {
13747    /// Protobuf type URL for this message, for use with `Any::pack` and
13748    /// `Any::unpack_if`.
13749    ///
13750    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13751    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13752}
13753impl ServiceOptions {
13754    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13755    #[inline]
13756    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13757    pub fn with_deprecated(mut self, value: bool) -> Self {
13758        self.deprecated = Some(value);
13759        self
13760    }
13761}
13762::buffa::impl_default_instance!(ServiceOptions);
13763impl ::buffa::MessageName for ServiceOptions {
13764    const PACKAGE: &'static str = "google.protobuf";
13765    const NAME: &'static str = "ServiceOptions";
13766    const FULL_NAME: &'static str = "google.protobuf.ServiceOptions";
13767    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
13768}
13769impl ::buffa::Message for ServiceOptions {
13770    /// Returns the total encoded size in bytes.
13771    ///
13772    /// Accumulates in `u64` (which cannot overflow for in-memory
13773    /// data) and saturates to `u32` at return, so a message whose
13774    /// encoded size exceeds the 2 GiB protobuf limit yields a value
13775    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
13776    /// points reject, never a silently wrapped size.
13777    #[allow(clippy::let_and_return)]
13778    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13779        #[allow(unused_imports)]
13780        use ::buffa::Enumeration as _;
13781        let mut size = 0u64;
13782        if self.deprecated.is_some() {
13783            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
13784        }
13785        if self.features.is_set() {
13786            let __slot = __cache.reserve();
13787            let inner_size = self.features.compute_size(__cache);
13788            __cache.set(__slot, inner_size);
13789            size
13790                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13791                    + inner_size as u64;
13792        }
13793        for v in &self.uninterpreted_option {
13794            let __slot = __cache.reserve();
13795            let inner_size = v.compute_size(__cache);
13796            __cache.set(__slot, inner_size);
13797            size
13798                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
13799                    + inner_size as u64;
13800        }
13801        size += self.__buffa_unknown_fields.encoded_len() as u64;
13802        ::buffa::saturate_size(size)
13803    }
13804    fn write_to(
13805        &self,
13806        __cache: &mut ::buffa::SizeCache,
13807        buf: &mut impl ::buffa::EncodeSink,
13808    ) {
13809        #[allow(unused_imports)]
13810        use ::buffa::Enumeration as _;
13811        if let Some(v) = self.deprecated {
13812            ::buffa::types::put_bool_field(33u32, v, buf);
13813        }
13814        if self.features.is_set() {
13815            ::buffa::types::put_len_delimited_header(
13816                34u32,
13817                u64::from(__cache.consume_next()),
13818                buf,
13819            );
13820            self.features.write_to(__cache, buf);
13821        }
13822        for v in &self.uninterpreted_option {
13823            ::buffa::types::put_len_delimited_header(
13824                999u32,
13825                u64::from(__cache.consume_next()),
13826                buf,
13827            );
13828            v.write_to(__cache, buf);
13829        }
13830        self.__buffa_unknown_fields.write_to(buf);
13831    }
13832    fn merge_field(
13833        &mut self,
13834        tag: ::buffa::encoding::Tag,
13835        buf: &mut impl ::buffa::bytes::Buf,
13836        ctx: ::buffa::DecodeContext<'_>,
13837    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13838        #[allow(unused_imports)]
13839        use ::buffa::bytes::Buf as _;
13840        #[allow(unused_imports)]
13841        use ::buffa::Enumeration as _;
13842        match tag.field_number() {
13843            33u32 => {
13844                ::buffa::encoding::check_wire_type(
13845                    tag,
13846                    ::buffa::encoding::WireType::Varint,
13847                )?;
13848                self.deprecated = ::core::option::Option::Some(
13849                    ::buffa::types::decode_bool(buf)?,
13850                );
13851            }
13852            34u32 => {
13853                ::buffa::encoding::check_wire_type(
13854                    tag,
13855                    ::buffa::encoding::WireType::LengthDelimited,
13856                )?;
13857                ::buffa::Message::merge_length_delimited(
13858                    self.features.get_or_insert_default(),
13859                    buf,
13860                    ctx,
13861                )?;
13862            }
13863            999u32 => {
13864                ::buffa::encoding::check_wire_type(
13865                    tag,
13866                    ::buffa::encoding::WireType::LengthDelimited,
13867                )?;
13868                let mut elem = ::core::default::Default::default();
13869                ctx.register_element_memory(
13870                    ::buffa::__private::element_footprint(&elem),
13871                )?;
13872                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
13873                self.uninterpreted_option.push(elem);
13874            }
13875            _ => {
13876                self.__buffa_unknown_fields
13877                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
13878            }
13879        }
13880        ::core::result::Result::Ok(())
13881    }
13882    fn clear(&mut self) {
13883        self.deprecated = ::core::option::Option::None;
13884        self.features = ::buffa::MessageField::none();
13885        self.uninterpreted_option.clear();
13886        self.__buffa_unknown_fields.clear();
13887    }
13888}
13889impl ::buffa::ExtensionSet for ServiceOptions {
13890    const PROTO_FQN: &'static str = "google.protobuf.ServiceOptions";
13891    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13892        &self.__buffa_unknown_fields
13893    }
13894    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13895        &mut self.__buffa_unknown_fields
13896    }
13897}
13898#[cfg(feature = "text")]
13899impl ::buffa::text::TextFormat for ServiceOptions {
13900    fn encode_text(
13901        &self,
13902        enc: &mut ::buffa::text::TextEncoder<'_>,
13903    ) -> ::core::fmt::Result {
13904        #[allow(unused_imports)]
13905        use ::buffa::Enumeration as _;
13906        if self.features.is_set() {
13907            enc.write_field_name("features")?;
13908            enc.write_message(&*self.features)?;
13909        }
13910        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13911            enc.write_field_name("deprecated")?;
13912            enc.write_bool(*__v)?;
13913        }
13914        for __v in &self.uninterpreted_option {
13915            enc.write_field_name("uninterpreted_option")?;
13916            enc.write_message(__v)?;
13917        }
13918        enc.write_extension_fields(
13919            "google.protobuf.ServiceOptions",
13920            &self.__buffa_unknown_fields,
13921        )?;
13922        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13923        ::core::result::Result::Ok(())
13924    }
13925    fn merge_text(
13926        &mut self,
13927        dec: &mut ::buffa::text::TextDecoder<'_>,
13928    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13929        #[allow(unused_imports)]
13930        use ::buffa::Enumeration as _;
13931        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13932            match __name {
13933                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13934                "deprecated" => {
13935                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13936                }
13937                "uninterpreted_option" => {
13938                    dec.read_repeated_into(
13939                        &mut self.uninterpreted_option,
13940                        |__d| {
13941                            let mut __m = ::core::default::Default::default();
13942                            __d.merge_message(&mut __m)?;
13943                            ::core::result::Result::Ok(__m)
13944                        },
13945                    )?
13946                }
13947                __name if __name.starts_with('[') => {
13948                    for __r in dec
13949                        .read_extension(__name, "google.protobuf.ServiceOptions")?
13950                    {
13951                        self.__buffa_unknown_fields.push(__r);
13952                    }
13953                }
13954                _ => dec.skip_value()?,
13955            }
13956        }
13957        ::core::result::Result::Ok(())
13958    }
13959}
13960#[cfg(feature = "json")]
13961impl<'de> serde::Deserialize<'de> for ServiceOptions {
13962    fn deserialize<D: serde::Deserializer<'de>>(
13963        d: D,
13964    ) -> ::core::result::Result<Self, D::Error> {
13965        struct _V;
13966        impl<'de> serde::de::Visitor<'de> for _V {
13967            type Value = ServiceOptions;
13968            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13969                f.write_str("struct ServiceOptions")
13970            }
13971            #[allow(clippy::field_reassign_with_default)]
13972            fn visit_map<A: serde::de::MapAccess<'de>>(
13973                self,
13974                mut map: A,
13975            ) -> ::core::result::Result<ServiceOptions, A::Error> {
13976                let mut __f_features: ::core::option::Option<
13977                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
13978                > = None;
13979                let mut __f_deprecated: ::core::option::Option<
13980                    ::core::option::Option<bool>,
13981                > = None;
13982                let mut __f_uninterpreted_option: ::core::option::Option<
13983                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13984                > = None;
13985                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13986                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13987                    match key.as_str() {
13988                        "features" => {
13989                            __f_features = Some(
13990                                map
13991                                    .next_value::<
13992                                        ::buffa::MessageField<
13993                                            FeatureSet,
13994                                            ::buffa::Inline<FeatureSet>,
13995                                        >,
13996                                    >()?,
13997                            );
13998                        }
13999                        "deprecated" => {
14000                            __f_deprecated = Some(
14001                                map.next_value::<::core::option::Option<bool>>()?,
14002                            );
14003                        }
14004                        "uninterpretedOption" | "uninterpreted_option" => {
14005                            __f_uninterpreted_option = Some({
14006                                struct _S;
14007                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14008                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14009                                    fn deserialize<D: serde::Deserializer<'de>>(
14010                                        self,
14011                                        d: D,
14012                                    ) -> ::core::result::Result<
14013                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14014                                        D::Error,
14015                                    > {
14016                                        ::buffa::json_helpers::null_as_default(d)
14017                                    }
14018                                }
14019                                map.next_value_seed(_S)?
14020                            });
14021                        }
14022                        __k if __k.starts_with('[') => {
14023                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14024                            match ::buffa::extension_registry::deserialize_extension_key(
14025                                "google.protobuf.ServiceOptions",
14026                                __k,
14027                                __v,
14028                            ) {
14029                                ::core::option::Option::Some(
14030                                    ::core::result::Result::Ok(__recs),
14031                                ) => {
14032                                    for __rec in __recs {
14033                                        __ext_records.push(__rec);
14034                                    }
14035                                }
14036                                ::core::option::Option::Some(
14037                                    ::core::result::Result::Err(__e),
14038                                ) => {
14039                                    return ::core::result::Result::Err(
14040                                        <A::Error as ::serde::de::Error>::custom(__e),
14041                                    );
14042                                }
14043                                ::core::option::Option::None => {}
14044                            }
14045                        }
14046                        _ => {
14047                            map.next_value::<serde::de::IgnoredAny>()?;
14048                        }
14049                    }
14050                }
14051                let mut __r = <ServiceOptions as ::core::default::Default>::default();
14052                if let ::core::option::Option::Some(v) = __f_features {
14053                    __r.features = v;
14054                }
14055                if let ::core::option::Option::Some(v) = __f_deprecated {
14056                    __r.deprecated = v;
14057                }
14058                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14059                    __r.uninterpreted_option = v;
14060                }
14061                for __rec in __ext_records {
14062                    __r.__buffa_unknown_fields.push(__rec);
14063                }
14064                Ok(__r)
14065            }
14066        }
14067        d.deserialize_map(_V)
14068    }
14069}
14070#[cfg(feature = "json")]
14071impl ::buffa::json_helpers::ProtoElemJson for ServiceOptions {
14072    fn serialize_proto_json<S: ::serde::Serializer>(
14073        v: &Self,
14074        s: S,
14075    ) -> ::core::result::Result<S::Ok, S::Error> {
14076        ::serde::Serialize::serialize(v, s)
14077    }
14078    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14079        d: D,
14080    ) -> ::core::result::Result<Self, D::Error> {
14081        <Self as ::serde::Deserialize>::deserialize(d)
14082    }
14083}
14084#[doc(hidden)]
14085#[derive(Clone, Debug, Default, PartialEq)]
14086#[repr(transparent)]
14087#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14088pub struct __ServiceOptionsExtJson(pub ::buffa::UnknownFields);
14089impl ::core::ops::Deref for __ServiceOptionsExtJson {
14090    type Target = ::buffa::UnknownFields;
14091    fn deref(&self) -> &::buffa::UnknownFields {
14092        &self.0
14093    }
14094}
14095impl ::core::ops::DerefMut for __ServiceOptionsExtJson {
14096    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14097        &mut self.0
14098    }
14099}
14100impl ::core::convert::From<::buffa::UnknownFields> for __ServiceOptionsExtJson {
14101    fn from(u: ::buffa::UnknownFields) -> Self {
14102        Self(u)
14103    }
14104}
14105#[cfg(feature = "json")]
14106impl ::serde::Serialize for __ServiceOptionsExtJson {
14107    fn serialize<S: ::serde::Serializer>(
14108        &self,
14109        s: S,
14110    ) -> ::core::result::Result<S::Ok, S::Error> {
14111        ::buffa::extension_registry::serialize_extensions(
14112            "google.protobuf.ServiceOptions",
14113            &self.0,
14114            s,
14115        )
14116    }
14117}
14118#[cfg(feature = "json")]
14119impl<'de> ::serde::Deserialize<'de> for __ServiceOptionsExtJson {
14120    fn deserialize<D: ::serde::Deserializer<'de>>(
14121        d: D,
14122    ) -> ::core::result::Result<Self, D::Error> {
14123        ::buffa::extension_registry::deserialize_extensions(
14124                "google.protobuf.ServiceOptions",
14125                d,
14126            )
14127            .map(Self)
14128    }
14129}
14130#[cfg(feature = "json")]
14131#[doc(hidden)]
14132pub const __SERVICE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14133    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14134    to_json: ::buffa::type_registry::any_to_json::<ServiceOptions>,
14135    from_json: ::buffa::type_registry::any_from_json::<ServiceOptions>,
14136    is_wkt: false,
14137};
14138#[cfg(feature = "text")]
14139#[doc(hidden)]
14140pub const __SERVICE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14141    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14142    text_encode: ::buffa::type_registry::any_encode_text::<ServiceOptions>,
14143    text_merge: ::buffa::type_registry::any_merge_text::<ServiceOptions>,
14144};
14145#[derive(Clone, PartialEq, Default)]
14146#[cfg_attr(feature = "json", derive(::serde::Serialize))]
14147#[cfg_attr(feature = "json", serde(default))]
14148#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14149pub struct MethodOptions {
14150    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
14151    ///   framework.  We apologize for hoarding these numbers to ourselves, but
14152    ///   we were already using them long before we decided to release Protocol
14153    ///   Buffers.
14154    ///
14155    /// Is this method deprecated?
14156    /// Depending on the target platform, this can emit Deprecated annotations
14157    /// for the method, or it will be completely ignored; in the very least,
14158    /// this is a formalization for deprecating methods.
14159    ///
14160    /// Field 33: `deprecated`
14161    #[cfg_attr(
14162        feature = "json",
14163        serde(
14164            rename = "deprecated",
14165            skip_serializing_if = "::core::option::Option::is_none"
14166        )
14167    )]
14168    pub deprecated: ::core::option::Option<bool>,
14169    /// Field 34: `idempotency_level`
14170    #[cfg_attr(
14171        feature = "json",
14172        serde(
14173            rename = "idempotencyLevel",
14174            alias = "idempotency_level",
14175            with = "::buffa::json_helpers::opt_closed_enum",
14176            skip_serializing_if = "::core::option::Option::is_none"
14177        )
14178    )]
14179    pub idempotency_level: ::core::option::Option<method_options::IdempotencyLevel>,
14180    /// Any features defined in the specific edition.
14181    /// WARNING: This field should only be used by protobuf plugins or special
14182    /// cases like the proto compiler. Other uses are discouraged and
14183    /// developers should rely on the protoreflect APIs for their client language.
14184    ///
14185    /// Field 35: `features`
14186    #[cfg_attr(
14187        feature = "json",
14188        serde(
14189            rename = "features",
14190            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
14191        )
14192    )]
14193    pub features: ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
14194    /// The parser stores options it doesn't recognize here. See above.
14195    ///
14196    /// Field 999: `uninterpreted_option`
14197    #[cfg_attr(
14198        feature = "json",
14199        serde(
14200            rename = "uninterpretedOption",
14201            alias = "uninterpreted_option",
14202            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14203            deserialize_with = "::buffa::json_helpers::null_as_default"
14204        )
14205    )]
14206    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
14207    #[cfg_attr(feature = "json", serde(flatten))]
14208    #[doc(hidden)]
14209    pub __buffa_unknown_fields: __MethodOptionsExtJson,
14210}
14211impl ::core::fmt::Debug for MethodOptions {
14212    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14213        f.debug_struct("MethodOptions")
14214            .field("deprecated", &self.deprecated)
14215            .field("idempotency_level", &self.idempotency_level)
14216            .field("features", &self.features)
14217            .field("uninterpreted_option", &self.uninterpreted_option)
14218            .finish()
14219    }
14220}
14221impl MethodOptions {
14222    /// Protobuf type URL for this message, for use with `Any::pack` and
14223    /// `Any::unpack_if`.
14224    ///
14225    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14226    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14227}
14228impl MethodOptions {
14229    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14230    #[inline]
14231    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
14232    pub fn with_deprecated(mut self, value: bool) -> Self {
14233        self.deprecated = Some(value);
14234        self
14235    }
14236    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14237    #[inline]
14238    ///Sets [`Self::idempotency_level`] to `Some(value)`, consuming and returning `self`.
14239    pub fn with_idempotency_level(
14240        mut self,
14241        value: impl Into<method_options::IdempotencyLevel>,
14242    ) -> Self {
14243        self.idempotency_level = Some(value.into());
14244        self
14245    }
14246}
14247::buffa::impl_default_instance!(MethodOptions);
14248impl ::buffa::MessageName for MethodOptions {
14249    const PACKAGE: &'static str = "google.protobuf";
14250    const NAME: &'static str = "MethodOptions";
14251    const FULL_NAME: &'static str = "google.protobuf.MethodOptions";
14252    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14253}
14254impl ::buffa::Message for MethodOptions {
14255    /// Returns the total encoded size in bytes.
14256    ///
14257    /// Accumulates in `u64` (which cannot overflow for in-memory
14258    /// data) and saturates to `u32` at return, so a message whose
14259    /// encoded size exceeds the 2 GiB protobuf limit yields a value
14260    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
14261    /// points reject, never a silently wrapped size.
14262    #[allow(clippy::let_and_return)]
14263    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14264        #[allow(unused_imports)]
14265        use ::buffa::Enumeration as _;
14266        let mut size = 0u64;
14267        if self.deprecated.is_some() {
14268            size += 2u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
14269        }
14270        if let Some(ref v) = self.idempotency_level {
14271            size += 2u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
14272        }
14273        if self.features.is_set() {
14274            let __slot = __cache.reserve();
14275            let inner_size = self.features.compute_size(__cache);
14276            __cache.set(__slot, inner_size);
14277            size
14278                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
14279                    + inner_size as u64;
14280        }
14281        for v in &self.uninterpreted_option {
14282            let __slot = __cache.reserve();
14283            let inner_size = v.compute_size(__cache);
14284            __cache.set(__slot, inner_size);
14285            size
14286                += 2u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
14287                    + inner_size as u64;
14288        }
14289        size += self.__buffa_unknown_fields.encoded_len() as u64;
14290        ::buffa::saturate_size(size)
14291    }
14292    fn write_to(
14293        &self,
14294        __cache: &mut ::buffa::SizeCache,
14295        buf: &mut impl ::buffa::EncodeSink,
14296    ) {
14297        #[allow(unused_imports)]
14298        use ::buffa::Enumeration as _;
14299        if let Some(v) = self.deprecated {
14300            ::buffa::types::put_bool_field(33u32, v, buf);
14301        }
14302        if let Some(ref v) = self.idempotency_level {
14303            ::buffa::types::put_int32_field(34u32, v.to_i32(), buf);
14304        }
14305        if self.features.is_set() {
14306            ::buffa::types::put_len_delimited_header(
14307                35u32,
14308                u64::from(__cache.consume_next()),
14309                buf,
14310            );
14311            self.features.write_to(__cache, buf);
14312        }
14313        for v in &self.uninterpreted_option {
14314            ::buffa::types::put_len_delimited_header(
14315                999u32,
14316                u64::from(__cache.consume_next()),
14317                buf,
14318            );
14319            v.write_to(__cache, buf);
14320        }
14321        self.__buffa_unknown_fields.write_to(buf);
14322    }
14323    fn merge_field(
14324        &mut self,
14325        tag: ::buffa::encoding::Tag,
14326        buf: &mut impl ::buffa::bytes::Buf,
14327        ctx: ::buffa::DecodeContext<'_>,
14328    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14329        #[allow(unused_imports)]
14330        use ::buffa::bytes::Buf as _;
14331        #[allow(unused_imports)]
14332        use ::buffa::Enumeration as _;
14333        match tag.field_number() {
14334            33u32 => {
14335                ::buffa::encoding::check_wire_type(
14336                    tag,
14337                    ::buffa::encoding::WireType::Varint,
14338                )?;
14339                self.deprecated = ::core::option::Option::Some(
14340                    ::buffa::types::decode_bool(buf)?,
14341                );
14342            }
14343            34u32 => {
14344                ::buffa::encoding::check_wire_type(
14345                    tag,
14346                    ::buffa::encoding::WireType::Varint,
14347                )?;
14348                let __raw = ::buffa::types::decode_int32(buf)?;
14349                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
14350                    __raw,
14351                ) {
14352                    self.idempotency_level = ::core::option::Option::Some(__v);
14353                } else {
14354                    ctx.register_unknown_field()?;
14355                    self.__buffa_unknown_fields
14356                        .push(::buffa::UnknownField {
14357                            number: 34u32,
14358                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
14359                        });
14360                }
14361            }
14362            35u32 => {
14363                ::buffa::encoding::check_wire_type(
14364                    tag,
14365                    ::buffa::encoding::WireType::LengthDelimited,
14366                )?;
14367                ::buffa::Message::merge_length_delimited(
14368                    self.features.get_or_insert_default(),
14369                    buf,
14370                    ctx,
14371                )?;
14372            }
14373            999u32 => {
14374                ::buffa::encoding::check_wire_type(
14375                    tag,
14376                    ::buffa::encoding::WireType::LengthDelimited,
14377                )?;
14378                let mut elem = ::core::default::Default::default();
14379                ctx.register_element_memory(
14380                    ::buffa::__private::element_footprint(&elem),
14381                )?;
14382                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
14383                self.uninterpreted_option.push(elem);
14384            }
14385            _ => {
14386                self.__buffa_unknown_fields
14387                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
14388            }
14389        }
14390        ::core::result::Result::Ok(())
14391    }
14392    fn clear(&mut self) {
14393        self.deprecated = ::core::option::Option::None;
14394        self.idempotency_level = ::core::option::Option::None;
14395        self.features = ::buffa::MessageField::none();
14396        self.uninterpreted_option.clear();
14397        self.__buffa_unknown_fields.clear();
14398    }
14399}
14400impl ::buffa::ExtensionSet for MethodOptions {
14401    const PROTO_FQN: &'static str = "google.protobuf.MethodOptions";
14402    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14403        &self.__buffa_unknown_fields
14404    }
14405    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14406        &mut self.__buffa_unknown_fields
14407    }
14408}
14409#[cfg(feature = "text")]
14410impl ::buffa::text::TextFormat for MethodOptions {
14411    fn encode_text(
14412        &self,
14413        enc: &mut ::buffa::text::TextEncoder<'_>,
14414    ) -> ::core::fmt::Result {
14415        #[allow(unused_imports)]
14416        use ::buffa::Enumeration as _;
14417        if let ::core::option::Option::Some(ref __v) = self.deprecated {
14418            enc.write_field_name("deprecated")?;
14419            enc.write_bool(*__v)?;
14420        }
14421        if let ::core::option::Option::Some(ref __v) = self.idempotency_level {
14422            enc.write_field_name("idempotency_level")?;
14423            enc.write_enum_name(__v.proto_name())?;
14424        }
14425        if self.features.is_set() {
14426            enc.write_field_name("features")?;
14427            enc.write_message(&*self.features)?;
14428        }
14429        for __v in &self.uninterpreted_option {
14430            enc.write_field_name("uninterpreted_option")?;
14431            enc.write_message(__v)?;
14432        }
14433        enc.write_extension_fields(
14434            "google.protobuf.MethodOptions",
14435            &self.__buffa_unknown_fields,
14436        )?;
14437        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14438        ::core::result::Result::Ok(())
14439    }
14440    fn merge_text(
14441        &mut self,
14442        dec: &mut ::buffa::text::TextDecoder<'_>,
14443    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14444        #[allow(unused_imports)]
14445        use ::buffa::Enumeration as _;
14446        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14447            match __name {
14448                "deprecated" => {
14449                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
14450                }
14451                "idempotency_level" => {
14452                    self.idempotency_level = ::core::option::Option::Some(
14453                        dec
14454                            .read_closed_enum_by_name::<
14455                                method_options::IdempotencyLevel,
14456                            >()?,
14457                    );
14458                }
14459                "features" => dec.merge_message(self.features.get_or_insert_default())?,
14460                "uninterpreted_option" => {
14461                    dec.read_repeated_into(
14462                        &mut self.uninterpreted_option,
14463                        |__d| {
14464                            let mut __m = ::core::default::Default::default();
14465                            __d.merge_message(&mut __m)?;
14466                            ::core::result::Result::Ok(__m)
14467                        },
14468                    )?
14469                }
14470                __name if __name.starts_with('[') => {
14471                    for __r in dec
14472                        .read_extension(__name, "google.protobuf.MethodOptions")?
14473                    {
14474                        self.__buffa_unknown_fields.push(__r);
14475                    }
14476                }
14477                _ => dec.skip_value()?,
14478            }
14479        }
14480        ::core::result::Result::Ok(())
14481    }
14482}
14483#[cfg(feature = "json")]
14484impl<'de> serde::Deserialize<'de> for MethodOptions {
14485    fn deserialize<D: serde::Deserializer<'de>>(
14486        d: D,
14487    ) -> ::core::result::Result<Self, D::Error> {
14488        struct _V;
14489        impl<'de> serde::de::Visitor<'de> for _V {
14490            type Value = MethodOptions;
14491            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14492                f.write_str("struct MethodOptions")
14493            }
14494            #[allow(clippy::field_reassign_with_default)]
14495            fn visit_map<A: serde::de::MapAccess<'de>>(
14496                self,
14497                mut map: A,
14498            ) -> ::core::result::Result<MethodOptions, A::Error> {
14499                let mut __f_deprecated: ::core::option::Option<
14500                    ::core::option::Option<bool>,
14501                > = None;
14502                let mut __f_idempotency_level: ::core::option::Option<
14503                    ::core::option::Option<method_options::IdempotencyLevel>,
14504                > = None;
14505                let mut __f_features: ::core::option::Option<
14506                    ::buffa::MessageField<FeatureSet, ::buffa::Inline<FeatureSet>>,
14507                > = None;
14508                let mut __f_uninterpreted_option: ::core::option::Option<
14509                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14510                > = None;
14511                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14512                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14513                    match key.as_str() {
14514                        "deprecated" => {
14515                            __f_deprecated = Some(
14516                                map.next_value::<::core::option::Option<bool>>()?,
14517                            );
14518                        }
14519                        "idempotencyLevel" | "idempotency_level" => {
14520                            __f_idempotency_level = Some({
14521                                struct _S;
14522                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14523                                    type Value = ::core::option::Option<
14524                                        method_options::IdempotencyLevel,
14525                                    >;
14526                                    fn deserialize<D: serde::Deserializer<'de>>(
14527                                        self,
14528                                        d: D,
14529                                    ) -> ::core::result::Result<
14530                                        ::core::option::Option<method_options::IdempotencyLevel>,
14531                                        D::Error,
14532                                    > {
14533                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
14534                                    }
14535                                }
14536                                map.next_value_seed(_S)?
14537                            });
14538                        }
14539                        "features" => {
14540                            __f_features = Some(
14541                                map
14542                                    .next_value::<
14543                                        ::buffa::MessageField<
14544                                            FeatureSet,
14545                                            ::buffa::Inline<FeatureSet>,
14546                                        >,
14547                                    >()?,
14548                            );
14549                        }
14550                        "uninterpretedOption" | "uninterpreted_option" => {
14551                            __f_uninterpreted_option = Some({
14552                                struct _S;
14553                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14554                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14555                                    fn deserialize<D: serde::Deserializer<'de>>(
14556                                        self,
14557                                        d: D,
14558                                    ) -> ::core::result::Result<
14559                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14560                                        D::Error,
14561                                    > {
14562                                        ::buffa::json_helpers::null_as_default(d)
14563                                    }
14564                                }
14565                                map.next_value_seed(_S)?
14566                            });
14567                        }
14568                        __k if __k.starts_with('[') => {
14569                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14570                            match ::buffa::extension_registry::deserialize_extension_key(
14571                                "google.protobuf.MethodOptions",
14572                                __k,
14573                                __v,
14574                            ) {
14575                                ::core::option::Option::Some(
14576                                    ::core::result::Result::Ok(__recs),
14577                                ) => {
14578                                    for __rec in __recs {
14579                                        __ext_records.push(__rec);
14580                                    }
14581                                }
14582                                ::core::option::Option::Some(
14583                                    ::core::result::Result::Err(__e),
14584                                ) => {
14585                                    return ::core::result::Result::Err(
14586                                        <A::Error as ::serde::de::Error>::custom(__e),
14587                                    );
14588                                }
14589                                ::core::option::Option::None => {}
14590                            }
14591                        }
14592                        _ => {
14593                            map.next_value::<serde::de::IgnoredAny>()?;
14594                        }
14595                    }
14596                }
14597                let mut __r = <MethodOptions as ::core::default::Default>::default();
14598                if let ::core::option::Option::Some(v) = __f_deprecated {
14599                    __r.deprecated = v;
14600                }
14601                if let ::core::option::Option::Some(v) = __f_idempotency_level {
14602                    __r.idempotency_level = v;
14603                }
14604                if let ::core::option::Option::Some(v) = __f_features {
14605                    __r.features = v;
14606                }
14607                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14608                    __r.uninterpreted_option = v;
14609                }
14610                for __rec in __ext_records {
14611                    __r.__buffa_unknown_fields.push(__rec);
14612                }
14613                Ok(__r)
14614            }
14615        }
14616        d.deserialize_map(_V)
14617    }
14618}
14619#[cfg(feature = "json")]
14620impl ::buffa::json_helpers::ProtoElemJson for MethodOptions {
14621    fn serialize_proto_json<S: ::serde::Serializer>(
14622        v: &Self,
14623        s: S,
14624    ) -> ::core::result::Result<S::Ok, S::Error> {
14625        ::serde::Serialize::serialize(v, s)
14626    }
14627    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14628        d: D,
14629    ) -> ::core::result::Result<Self, D::Error> {
14630        <Self as ::serde::Deserialize>::deserialize(d)
14631    }
14632}
14633#[doc(hidden)]
14634#[derive(Clone, Debug, Default, PartialEq)]
14635#[repr(transparent)]
14636#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14637pub struct __MethodOptionsExtJson(pub ::buffa::UnknownFields);
14638impl ::core::ops::Deref for __MethodOptionsExtJson {
14639    type Target = ::buffa::UnknownFields;
14640    fn deref(&self) -> &::buffa::UnknownFields {
14641        &self.0
14642    }
14643}
14644impl ::core::ops::DerefMut for __MethodOptionsExtJson {
14645    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14646        &mut self.0
14647    }
14648}
14649impl ::core::convert::From<::buffa::UnknownFields> for __MethodOptionsExtJson {
14650    fn from(u: ::buffa::UnknownFields) -> Self {
14651        Self(u)
14652    }
14653}
14654#[cfg(feature = "json")]
14655impl ::serde::Serialize for __MethodOptionsExtJson {
14656    fn serialize<S: ::serde::Serializer>(
14657        &self,
14658        s: S,
14659    ) -> ::core::result::Result<S::Ok, S::Error> {
14660        ::buffa::extension_registry::serialize_extensions(
14661            "google.protobuf.MethodOptions",
14662            &self.0,
14663            s,
14664        )
14665    }
14666}
14667#[cfg(feature = "json")]
14668impl<'de> ::serde::Deserialize<'de> for __MethodOptionsExtJson {
14669    fn deserialize<D: ::serde::Deserializer<'de>>(
14670        d: D,
14671    ) -> ::core::result::Result<Self, D::Error> {
14672        ::buffa::extension_registry::deserialize_extensions(
14673                "google.protobuf.MethodOptions",
14674                d,
14675            )
14676            .map(Self)
14677    }
14678}
14679#[cfg(feature = "json")]
14680#[doc(hidden)]
14681pub const __METHOD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14682    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14683    to_json: ::buffa::type_registry::any_to_json::<MethodOptions>,
14684    from_json: ::buffa::type_registry::any_from_json::<MethodOptions>,
14685    is_wkt: false,
14686};
14687#[cfg(feature = "text")]
14688#[doc(hidden)]
14689pub const __METHOD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14690    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
14691    text_encode: ::buffa::type_registry::any_encode_text::<MethodOptions>,
14692    text_merge: ::buffa::type_registry::any_merge_text::<MethodOptions>,
14693};
14694pub mod method_options {
14695    #[allow(unused_imports)]
14696    use super::*;
14697    /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
14698    /// or neither? HTTP based RPC implementation may choose GET verb for safe
14699    /// methods, and PUT verb for idempotent methods instead of the default POST.
14700    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
14701    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14702    #[repr(i32)]
14703    pub enum IdempotencyLevel {
14704        IDEMPOTENCY_UNKNOWN = 0i32,
14705        /// implies idempotent
14706        NO_SIDE_EFFECTS = 1i32,
14707        /// idempotent, but may have side effects
14708        IDEMPOTENT = 2i32,
14709    }
14710    impl IdempotencyLevel {
14711        ///Idiomatic alias for [`Self::IDEMPOTENCY_UNKNOWN`]; `Debug` prints the variant name.
14712        #[allow(non_upper_case_globals)]
14713        pub const IdempotencyUnknown: Self = Self::IDEMPOTENCY_UNKNOWN;
14714        ///Idiomatic alias for [`Self::NO_SIDE_EFFECTS`]; `Debug` prints the variant name.
14715        #[allow(non_upper_case_globals)]
14716        pub const NoSideEffects: Self = Self::NO_SIDE_EFFECTS;
14717        ///Idiomatic alias for [`Self::IDEMPOTENT`]; `Debug` prints the variant name.
14718        #[allow(non_upper_case_globals)]
14719        pub const Idempotent: Self = Self::IDEMPOTENT;
14720    }
14721    impl ::core::default::Default for IdempotencyLevel {
14722        fn default() -> Self {
14723            Self::IDEMPOTENCY_UNKNOWN
14724        }
14725    }
14726    #[cfg(feature = "json")]
14727    const _: () = {
14728        impl ::serde::Serialize for IdempotencyLevel {
14729            fn serialize<S: ::serde::Serializer>(
14730                &self,
14731                s: S,
14732            ) -> ::core::result::Result<S::Ok, S::Error> {
14733                s.serialize_str(::buffa::Enumeration::proto_name(self))
14734            }
14735        }
14736        impl<'de> ::serde::Deserialize<'de> for IdempotencyLevel {
14737            fn deserialize<D: ::serde::Deserializer<'de>>(
14738                d: D,
14739            ) -> ::core::result::Result<Self, D::Error> {
14740                struct _V;
14741                impl ::serde::de::Visitor<'_> for _V {
14742                    type Value = IdempotencyLevel;
14743                    fn expecting(
14744                        &self,
14745                        f: &mut ::core::fmt::Formatter<'_>,
14746                    ) -> ::core::fmt::Result {
14747                        f.write_str(
14748                            concat!(
14749                                "a string, integer, or null for ",
14750                                stringify!(IdempotencyLevel)
14751                            ),
14752                        )
14753                    }
14754                    fn visit_str<E: ::serde::de::Error>(
14755                        self,
14756                        v: &str,
14757                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14758                        <IdempotencyLevel as ::buffa::Enumeration>::from_proto_name(v)
14759                            .ok_or_else(|| {
14760                                ::serde::de::Error::unknown_variant(v, &[])
14761                            })
14762                    }
14763                    fn visit_i64<E: ::serde::de::Error>(
14764                        self,
14765                        v: i64,
14766                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14767                        let v32 = i32::try_from(v)
14768                            .map_err(|_| {
14769                                ::serde::de::Error::custom(
14770                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14771                                )
14772                            })?;
14773                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14774                            .ok_or_else(|| {
14775                                ::serde::de::Error::custom(
14776                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14777                                )
14778                            })
14779                    }
14780                    fn visit_u64<E: ::serde::de::Error>(
14781                        self,
14782                        v: u64,
14783                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14784                        let v32 = i32::try_from(v)
14785                            .map_err(|_| {
14786                                ::serde::de::Error::custom(
14787                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
14788                                )
14789                            })?;
14790                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
14791                            .ok_or_else(|| {
14792                                ::serde::de::Error::custom(
14793                                    ::buffa::alloc::format!("unknown enum value {v32}"),
14794                                )
14795                            })
14796                    }
14797                    fn visit_unit<E: ::serde::de::Error>(
14798                        self,
14799                    ) -> ::core::result::Result<IdempotencyLevel, E> {
14800                        ::core::result::Result::Ok(::core::default::Default::default())
14801                    }
14802                }
14803                d.deserialize_any(_V)
14804            }
14805        }
14806        impl ::buffa::json_helpers::ProtoElemJson for IdempotencyLevel {
14807            fn serialize_proto_json<S: ::serde::Serializer>(
14808                v: &Self,
14809                s: S,
14810            ) -> ::core::result::Result<S::Ok, S::Error> {
14811                ::serde::Serialize::serialize(v, s)
14812            }
14813            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14814                d: D,
14815            ) -> ::core::result::Result<Self, D::Error> {
14816                <Self as ::serde::Deserialize>::deserialize(d)
14817            }
14818        }
14819    };
14820    impl ::buffa::Enumeration for IdempotencyLevel {
14821        fn from_i32(value: i32) -> ::core::option::Option<Self> {
14822            match value {
14823                0i32 => ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
14824                1i32 => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14825                2i32 => ::core::option::Option::Some(Self::IDEMPOTENT),
14826                _ => ::core::option::Option::None,
14827            }
14828        }
14829        fn to_i32(&self) -> i32 {
14830            *self as i32
14831        }
14832        fn proto_name(&self) -> &'static str {
14833            match self {
14834                Self::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN",
14835                Self::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS",
14836                Self::IDEMPOTENT => "IDEMPOTENT",
14837            }
14838        }
14839        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
14840            match name {
14841                "IDEMPOTENCY_UNKNOWN" => {
14842                    ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN)
14843                }
14844                "NO_SIDE_EFFECTS" => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
14845                "IDEMPOTENT" => ::core::option::Option::Some(Self::IDEMPOTENT),
14846                _ => ::core::option::Option::None,
14847            }
14848        }
14849        fn values() -> &'static [Self] {
14850            &[Self::IDEMPOTENCY_UNKNOWN, Self::NO_SIDE_EFFECTS, Self::IDEMPOTENT]
14851        }
14852    }
14853}
14854/// A message representing a option the parser does not recognize. This only
14855/// appears in options protos created by the compiler::Parser class.
14856/// DescriptorPool resolves these when building Descriptor objects. Therefore,
14857/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
14858/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
14859/// in them.
14860#[derive(Clone, PartialEq, Default)]
14861#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
14862#[cfg_attr(feature = "json", serde(default))]
14863#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14864pub struct UninterpretedOption {
14865    /// Field 2: `name`
14866    #[cfg_attr(
14867        feature = "json",
14868        serde(
14869            rename = "name",
14870            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14871            deserialize_with = "::buffa::json_helpers::null_as_default"
14872        )
14873    )]
14874    pub name: ::buffa::alloc::vec::Vec<uninterpreted_option::NamePart>,
14875    /// The value of the uninterpreted option, in whatever type the tokenizer
14876    /// identified it as during parsing. Exactly one of these should be set.
14877    ///
14878    /// Field 3: `identifier_value`
14879    #[cfg_attr(
14880        feature = "json",
14881        serde(
14882            rename = "identifierValue",
14883            alias = "identifier_value",
14884            skip_serializing_if = "::core::option::Option::is_none"
14885        )
14886    )]
14887    pub identifier_value: ::core::option::Option<::buffa::alloc::string::String>,
14888    /// Field 4: `positive_int_value`
14889    #[cfg_attr(
14890        feature = "json",
14891        serde(
14892            rename = "positiveIntValue",
14893            alias = "positive_int_value",
14894            with = "::buffa::json_helpers::opt_uint64",
14895            skip_serializing_if = "::core::option::Option::is_none"
14896        )
14897    )]
14898    pub positive_int_value: ::core::option::Option<u64>,
14899    /// Field 5: `negative_int_value`
14900    #[cfg_attr(
14901        feature = "json",
14902        serde(
14903            rename = "negativeIntValue",
14904            alias = "negative_int_value",
14905            with = "::buffa::json_helpers::opt_int64",
14906            skip_serializing_if = "::core::option::Option::is_none"
14907        )
14908    )]
14909    pub negative_int_value: ::core::option::Option<i64>,
14910    /// Field 6: `double_value`
14911    #[cfg_attr(
14912        feature = "json",
14913        serde(
14914            rename = "doubleValue",
14915            alias = "double_value",
14916            with = "::buffa::json_helpers::opt_double",
14917            skip_serializing_if = "::core::option::Option::is_none"
14918        )
14919    )]
14920    pub double_value: ::core::option::Option<f64>,
14921    /// Field 7: `string_value`
14922    #[cfg_attr(
14923        feature = "json",
14924        serde(
14925            rename = "stringValue",
14926            alias = "string_value",
14927            with = "::buffa::json_helpers::opt_bytes",
14928            skip_serializing_if = "::core::option::Option::is_none"
14929        )
14930    )]
14931    pub string_value: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
14932    /// Field 8: `aggregate_value`
14933    #[cfg_attr(
14934        feature = "json",
14935        serde(
14936            rename = "aggregateValue",
14937            alias = "aggregate_value",
14938            skip_serializing_if = "::core::option::Option::is_none"
14939        )
14940    )]
14941    pub aggregate_value: ::core::option::Option<::buffa::alloc::string::String>,
14942    #[cfg_attr(feature = "json", serde(skip))]
14943    #[doc(hidden)]
14944    pub __buffa_unknown_fields: ::buffa::UnknownFields,
14945}
14946impl ::core::fmt::Debug for UninterpretedOption {
14947    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14948        f.debug_struct("UninterpretedOption")
14949            .field("name", &self.name)
14950            .field("identifier_value", &self.identifier_value)
14951            .field("positive_int_value", &self.positive_int_value)
14952            .field("negative_int_value", &self.negative_int_value)
14953            .field("double_value", &self.double_value)
14954            .field("string_value", &self.string_value)
14955            .field("aggregate_value", &self.aggregate_value)
14956            .finish()
14957    }
14958}
14959impl UninterpretedOption {
14960    /// Protobuf type URL for this message, for use with `Any::pack` and
14961    /// `Any::unpack_if`.
14962    ///
14963    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14964    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
14965}
14966impl UninterpretedOption {
14967    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14968    #[inline]
14969    ///Sets [`Self::identifier_value`] to `Some(value)`, consuming and returning `self`.
14970    pub fn with_identifier_value(
14971        mut self,
14972        value: impl Into<::buffa::alloc::string::String>,
14973    ) -> Self {
14974        self.identifier_value = Some(value.into());
14975        self
14976    }
14977    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14978    #[inline]
14979    ///Sets [`Self::positive_int_value`] to `Some(value)`, consuming and returning `self`.
14980    pub fn with_positive_int_value(mut self, value: u64) -> Self {
14981        self.positive_int_value = Some(value);
14982        self
14983    }
14984    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14985    #[inline]
14986    ///Sets [`Self::negative_int_value`] to `Some(value)`, consuming and returning `self`.
14987    pub fn with_negative_int_value(mut self, value: i64) -> Self {
14988        self.negative_int_value = Some(value);
14989        self
14990    }
14991    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14992    #[inline]
14993    ///Sets [`Self::double_value`] to `Some(value)`, consuming and returning `self`.
14994    pub fn with_double_value(mut self, value: f64) -> Self {
14995        self.double_value = Some(value);
14996        self
14997    }
14998    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14999    #[inline]
15000    ///Sets [`Self::string_value`] to `Some(value)`, consuming and returning `self`.
15001    pub fn with_string_value(
15002        mut self,
15003        value: impl Into<::buffa::alloc::vec::Vec<u8>>,
15004    ) -> Self {
15005        self.string_value = Some(value.into());
15006        self
15007    }
15008    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15009    #[inline]
15010    ///Sets [`Self::aggregate_value`] to `Some(value)`, consuming and returning `self`.
15011    pub fn with_aggregate_value(
15012        mut self,
15013        value: impl Into<::buffa::alloc::string::String>,
15014    ) -> Self {
15015        self.aggregate_value = Some(value.into());
15016        self
15017    }
15018}
15019::buffa::impl_default_instance!(UninterpretedOption);
15020impl ::buffa::MessageName for UninterpretedOption {
15021    const PACKAGE: &'static str = "google.protobuf";
15022    const NAME: &'static str = "UninterpretedOption";
15023    const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption";
15024    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
15025}
15026impl ::buffa::Message for UninterpretedOption {
15027    /// Returns the total encoded size in bytes.
15028    ///
15029    /// Accumulates in `u64` (which cannot overflow for in-memory
15030    /// data) and saturates to `u32` at return, so a message whose
15031    /// encoded size exceeds the 2 GiB protobuf limit yields a value
15032    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15033    /// points reject, never a silently wrapped size.
15034    #[allow(clippy::let_and_return)]
15035    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
15036        #[allow(unused_imports)]
15037        use ::buffa::Enumeration as _;
15038        let mut size = 0u64;
15039        for v in &self.name {
15040            let __slot = __cache.reserve();
15041            let inner_size = v.compute_size(__cache);
15042            __cache.set(__slot, inner_size);
15043            size
15044                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
15045                    + inner_size as u64;
15046        }
15047        if let Some(ref v) = self.identifier_value {
15048            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
15049        }
15050        if let Some(v) = self.positive_int_value {
15051            size += 1u64 + ::buffa::types::uint64_encoded_len(v) as u64;
15052        }
15053        if let Some(v) = self.negative_int_value {
15054            size += 1u64 + ::buffa::types::int64_encoded_len(v) as u64;
15055        }
15056        if self.double_value.is_some() {
15057            size += 1u64 + ::buffa::types::FIXED64_ENCODED_LEN as u64;
15058        }
15059        if let Some(ref v) = self.string_value {
15060            size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
15061        }
15062        if let Some(ref v) = self.aggregate_value {
15063            size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
15064        }
15065        size += self.__buffa_unknown_fields.encoded_len() as u64;
15066        ::buffa::saturate_size(size)
15067    }
15068    fn write_to(
15069        &self,
15070        __cache: &mut ::buffa::SizeCache,
15071        buf: &mut impl ::buffa::EncodeSink,
15072    ) {
15073        #[allow(unused_imports)]
15074        use ::buffa::Enumeration as _;
15075        for v in &self.name {
15076            ::buffa::types::put_len_delimited_header(
15077                2u32,
15078                u64::from(__cache.consume_next()),
15079                buf,
15080            );
15081            v.write_to(__cache, buf);
15082        }
15083        if let Some(ref v) = self.identifier_value {
15084            ::buffa::types::put_string_field(3u32, v, buf);
15085        }
15086        if let Some(v) = self.positive_int_value {
15087            ::buffa::types::put_uint64_field(4u32, v, buf);
15088        }
15089        if let Some(v) = self.negative_int_value {
15090            ::buffa::types::put_int64_field(5u32, v, buf);
15091        }
15092        if let Some(v) = self.double_value {
15093            ::buffa::types::put_double_field(6u32, v, buf);
15094        }
15095        if let Some(ref v) = self.string_value {
15096            ::buffa::types::put_shared_bytes_field(7u32, v, buf);
15097        }
15098        if let Some(ref v) = self.aggregate_value {
15099            ::buffa::types::put_string_field(8u32, v, buf);
15100        }
15101        self.__buffa_unknown_fields.write_to(buf);
15102    }
15103    fn merge_field(
15104        &mut self,
15105        tag: ::buffa::encoding::Tag,
15106        buf: &mut impl ::buffa::bytes::Buf,
15107        ctx: ::buffa::DecodeContext<'_>,
15108    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15109        #[allow(unused_imports)]
15110        use ::buffa::bytes::Buf as _;
15111        #[allow(unused_imports)]
15112        use ::buffa::Enumeration as _;
15113        match tag.field_number() {
15114            2u32 => {
15115                ::buffa::encoding::check_wire_type(
15116                    tag,
15117                    ::buffa::encoding::WireType::LengthDelimited,
15118                )?;
15119                let mut elem = ::core::default::Default::default();
15120                ctx.register_element_memory(
15121                    ::buffa::__private::element_footprint(&elem),
15122                )?;
15123                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
15124                self.name.push(elem);
15125            }
15126            3u32 => {
15127                ::buffa::encoding::check_wire_type(
15128                    tag,
15129                    ::buffa::encoding::WireType::LengthDelimited,
15130                )?;
15131                ::buffa::types::merge_string(
15132                    self
15133                        .identifier_value
15134                        .get_or_insert_with(::buffa::alloc::string::String::new),
15135                    buf,
15136                )?;
15137            }
15138            4u32 => {
15139                ::buffa::encoding::check_wire_type(
15140                    tag,
15141                    ::buffa::encoding::WireType::Varint,
15142                )?;
15143                self.positive_int_value = ::core::option::Option::Some(
15144                    ::buffa::types::decode_uint64(buf)?,
15145                );
15146            }
15147            5u32 => {
15148                ::buffa::encoding::check_wire_type(
15149                    tag,
15150                    ::buffa::encoding::WireType::Varint,
15151                )?;
15152                self.negative_int_value = ::core::option::Option::Some(
15153                    ::buffa::types::decode_int64(buf)?,
15154                );
15155            }
15156            6u32 => {
15157                ::buffa::encoding::check_wire_type(
15158                    tag,
15159                    ::buffa::encoding::WireType::Fixed64,
15160                )?;
15161                self.double_value = ::core::option::Option::Some(
15162                    ::buffa::types::decode_double(buf)?,
15163                );
15164            }
15165            7u32 => {
15166                ::buffa::encoding::check_wire_type(
15167                    tag,
15168                    ::buffa::encoding::WireType::LengthDelimited,
15169                )?;
15170                ::buffa::types::merge_bytes(
15171                    self.string_value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
15172                    buf,
15173                )?;
15174            }
15175            8u32 => {
15176                ::buffa::encoding::check_wire_type(
15177                    tag,
15178                    ::buffa::encoding::WireType::LengthDelimited,
15179                )?;
15180                ::buffa::types::merge_string(
15181                    self
15182                        .aggregate_value
15183                        .get_or_insert_with(::buffa::alloc::string::String::new),
15184                    buf,
15185                )?;
15186            }
15187            _ => {
15188                self.__buffa_unknown_fields
15189                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15190            }
15191        }
15192        ::core::result::Result::Ok(())
15193    }
15194    fn clear(&mut self) {
15195        self.name.clear();
15196        self.identifier_value = ::core::option::Option::None;
15197        self.positive_int_value = ::core::option::Option::None;
15198        self.negative_int_value = ::core::option::Option::None;
15199        self.double_value = ::core::option::Option::None;
15200        self.string_value = ::core::option::Option::None;
15201        self.aggregate_value = ::core::option::Option::None;
15202        self.__buffa_unknown_fields.clear();
15203    }
15204}
15205impl ::buffa::ExtensionSet for UninterpretedOption {
15206    const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption";
15207    fn unknown_fields(&self) -> &::buffa::UnknownFields {
15208        &self.__buffa_unknown_fields
15209    }
15210    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15211        &mut self.__buffa_unknown_fields
15212    }
15213}
15214#[cfg(feature = "text")]
15215impl ::buffa::text::TextFormat for UninterpretedOption {
15216    fn encode_text(
15217        &self,
15218        enc: &mut ::buffa::text::TextEncoder<'_>,
15219    ) -> ::core::fmt::Result {
15220        #[allow(unused_imports)]
15221        use ::buffa::Enumeration as _;
15222        if let ::core::option::Option::Some(ref __v) = self.identifier_value {
15223            enc.write_field_name("identifier_value")?;
15224            enc.write_string(__v)?;
15225        }
15226        if let ::core::option::Option::Some(ref __v) = self.positive_int_value {
15227            enc.write_field_name("positive_int_value")?;
15228            enc.write_u64(*__v)?;
15229        }
15230        if let ::core::option::Option::Some(ref __v) = self.negative_int_value {
15231            enc.write_field_name("negative_int_value")?;
15232            enc.write_i64(*__v)?;
15233        }
15234        if let ::core::option::Option::Some(ref __v) = self.double_value {
15235            enc.write_field_name("double_value")?;
15236            enc.write_f64(*__v)?;
15237        }
15238        if let ::core::option::Option::Some(ref __v) = self.string_value {
15239            enc.write_field_name("string_value")?;
15240            enc.write_bytes(__v)?;
15241        }
15242        if let ::core::option::Option::Some(ref __v) = self.aggregate_value {
15243            enc.write_field_name("aggregate_value")?;
15244            enc.write_string(__v)?;
15245        }
15246        for __v in &self.name {
15247            enc.write_field_name("name")?;
15248            enc.write_message(__v)?;
15249        }
15250        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15251        ::core::result::Result::Ok(())
15252    }
15253    fn merge_text(
15254        &mut self,
15255        dec: &mut ::buffa::text::TextDecoder<'_>,
15256    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15257        #[allow(unused_imports)]
15258        use ::buffa::Enumeration as _;
15259        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15260            match __name {
15261                "identifier_value" => {
15262                    self.identifier_value = ::core::option::Option::Some(
15263                        dec.read_string()?.into_owned(),
15264                    );
15265                }
15266                "positive_int_value" => {
15267                    self.positive_int_value = ::core::option::Option::Some(
15268                        dec.read_u64()?,
15269                    );
15270                }
15271                "negative_int_value" => {
15272                    self.negative_int_value = ::core::option::Option::Some(
15273                        dec.read_i64()?,
15274                    );
15275                }
15276                "double_value" => {
15277                    self.double_value = ::core::option::Option::Some(dec.read_f64()?);
15278                }
15279                "string_value" => {
15280                    self.string_value = ::core::option::Option::Some(dec.read_bytes()?);
15281                }
15282                "aggregate_value" => {
15283                    self.aggregate_value = ::core::option::Option::Some(
15284                        dec.read_string()?.into_owned(),
15285                    );
15286                }
15287                "name" => {
15288                    dec.read_repeated_into(
15289                        &mut self.name,
15290                        |__d| {
15291                            let mut __m = ::core::default::Default::default();
15292                            __d.merge_message(&mut __m)?;
15293                            ::core::result::Result::Ok(__m)
15294                        },
15295                    )?
15296                }
15297                _ => dec.skip_value()?,
15298            }
15299        }
15300        ::core::result::Result::Ok(())
15301    }
15302}
15303#[cfg(feature = "json")]
15304impl ::buffa::json_helpers::ProtoElemJson for UninterpretedOption {
15305    fn serialize_proto_json<S: ::serde::Serializer>(
15306        v: &Self,
15307        s: S,
15308    ) -> ::core::result::Result<S::Ok, S::Error> {
15309        ::serde::Serialize::serialize(v, s)
15310    }
15311    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15312        d: D,
15313    ) -> ::core::result::Result<Self, D::Error> {
15314        <Self as ::serde::Deserialize>::deserialize(d)
15315    }
15316}
15317#[cfg(feature = "json")]
15318#[doc(hidden)]
15319pub const __UNINTERPRETED_OPTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15320    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15321    to_json: ::buffa::type_registry::any_to_json::<UninterpretedOption>,
15322    from_json: ::buffa::type_registry::any_from_json::<UninterpretedOption>,
15323    is_wkt: false,
15324};
15325#[cfg(feature = "text")]
15326#[doc(hidden)]
15327pub const __UNINTERPRETED_OPTION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15328    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15329    text_encode: ::buffa::type_registry::any_encode_text::<UninterpretedOption>,
15330    text_merge: ::buffa::type_registry::any_merge_text::<UninterpretedOption>,
15331};
15332pub mod uninterpreted_option {
15333    #[allow(unused_imports)]
15334    use super::*;
15335    /// The name of the uninterpreted option.  Each string represents a segment in
15336    /// a dot-separated name.  is_extension is true iff a segment represents an
15337    /// extension (denoted with parentheses in options specs in .proto files).
15338    /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["moo", false\] } represents
15339    /// "foo.(bar.baz).moo".
15340    #[derive(Clone, PartialEq, Default)]
15341    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
15342    #[cfg_attr(feature = "json", serde(default))]
15343    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15344    pub struct NamePart {
15345        /// Field 1: `name_part`
15346        #[cfg_attr(
15347            feature = "json",
15348            serde(
15349                rename = "namePart",
15350                alias = "name_part",
15351                with = "::buffa::json_helpers::proto_string"
15352            )
15353        )]
15354        pub name_part: ::buffa::alloc::string::String,
15355        /// Field 2: `is_extension`
15356        #[cfg_attr(
15357            feature = "json",
15358            serde(
15359                rename = "isExtension",
15360                alias = "is_extension",
15361                with = "::buffa::json_helpers::proto_bool"
15362            )
15363        )]
15364        pub is_extension: bool,
15365        #[cfg_attr(feature = "json", serde(skip))]
15366        #[doc(hidden)]
15367        pub __buffa_unknown_fields: ::buffa::UnknownFields,
15368    }
15369    impl ::core::fmt::Debug for NamePart {
15370        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15371            f.debug_struct("NamePart")
15372                .field("name_part", &self.name_part)
15373                .field("is_extension", &self.is_extension)
15374                .finish()
15375        }
15376    }
15377    impl NamePart {
15378        /// Protobuf type URL for this message, for use with `Any::pack` and
15379        /// `Any::unpack_if`.
15380        ///
15381        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15382        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
15383    }
15384    ::buffa::impl_default_instance!(NamePart);
15385    impl ::buffa::MessageName for NamePart {
15386        const PACKAGE: &'static str = "google.protobuf";
15387        const NAME: &'static str = "UninterpretedOption.NamePart";
15388        const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption.NamePart";
15389        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
15390    }
15391    impl ::buffa::Message for NamePart {
15392        /// Returns the total encoded size in bytes.
15393        ///
15394        /// Accumulates in `u64` (which cannot overflow for in-memory
15395        /// data) and saturates to `u32` at return, so a message whose
15396        /// encoded size exceeds the 2 GiB protobuf limit yields a value
15397        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15398        /// points reject, never a silently wrapped size.
15399        #[allow(clippy::let_and_return)]
15400        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15401            #[allow(unused_imports)]
15402            use ::buffa::Enumeration as _;
15403            let mut size = 0u64;
15404            size += 1u64 + ::buffa::types::string_encoded_len(&self.name_part) as u64;
15405            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
15406            size += self.__buffa_unknown_fields.encoded_len() as u64;
15407            ::buffa::saturate_size(size)
15408        }
15409        fn write_to(
15410            &self,
15411            _cache: &mut ::buffa::SizeCache,
15412            buf: &mut impl ::buffa::EncodeSink,
15413        ) {
15414            #[allow(unused_imports)]
15415            use ::buffa::Enumeration as _;
15416            ::buffa::types::put_string_field(1u32, &self.name_part, buf);
15417            ::buffa::types::put_bool_field(2u32, self.is_extension, buf);
15418            self.__buffa_unknown_fields.write_to(buf);
15419        }
15420        fn merge_field(
15421            &mut self,
15422            tag: ::buffa::encoding::Tag,
15423            buf: &mut impl ::buffa::bytes::Buf,
15424            ctx: ::buffa::DecodeContext<'_>,
15425        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15426            #[allow(unused_imports)]
15427            use ::buffa::bytes::Buf as _;
15428            #[allow(unused_imports)]
15429            use ::buffa::Enumeration as _;
15430            match tag.field_number() {
15431                1u32 => {
15432                    ::buffa::encoding::check_wire_type(
15433                        tag,
15434                        ::buffa::encoding::WireType::LengthDelimited,
15435                    )?;
15436                    ::buffa::types::merge_string(&mut self.name_part, buf)?;
15437                }
15438                2u32 => {
15439                    ::buffa::encoding::check_wire_type(
15440                        tag,
15441                        ::buffa::encoding::WireType::Varint,
15442                    )?;
15443                    self.is_extension = ::buffa::types::decode_bool(buf)?;
15444                }
15445                _ => {
15446                    self.__buffa_unknown_fields
15447                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15448                }
15449            }
15450            ::core::result::Result::Ok(())
15451        }
15452        fn clear(&mut self) {
15453            self.name_part.clear();
15454            self.is_extension = false;
15455            self.__buffa_unknown_fields.clear();
15456        }
15457    }
15458    impl ::buffa::ExtensionSet for NamePart {
15459        const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption.NamePart";
15460        fn unknown_fields(&self) -> &::buffa::UnknownFields {
15461            &self.__buffa_unknown_fields
15462        }
15463        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15464            &mut self.__buffa_unknown_fields
15465        }
15466    }
15467    #[cfg(feature = "text")]
15468    impl ::buffa::text::TextFormat for NamePart {
15469        fn encode_text(
15470            &self,
15471            enc: &mut ::buffa::text::TextEncoder<'_>,
15472        ) -> ::core::fmt::Result {
15473            #[allow(unused_imports)]
15474            use ::buffa::Enumeration as _;
15475            enc.write_field_name("name_part")?;
15476            enc.write_string(&self.name_part)?;
15477            enc.write_field_name("is_extension")?;
15478            enc.write_bool(self.is_extension)?;
15479            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15480            ::core::result::Result::Ok(())
15481        }
15482        fn merge_text(
15483            &mut self,
15484            dec: &mut ::buffa::text::TextDecoder<'_>,
15485        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15486            #[allow(unused_imports)]
15487            use ::buffa::Enumeration as _;
15488            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15489                match __name {
15490                    "name_part" => self.name_part = dec.read_string()?.into_owned(),
15491                    "is_extension" => self.is_extension = dec.read_bool()?,
15492                    _ => dec.skip_value()?,
15493                }
15494            }
15495            ::core::result::Result::Ok(())
15496        }
15497    }
15498    #[cfg(feature = "json")]
15499    impl ::buffa::json_helpers::ProtoElemJson for NamePart {
15500        fn serialize_proto_json<S: ::serde::Serializer>(
15501            v: &Self,
15502            s: S,
15503        ) -> ::core::result::Result<S::Ok, S::Error> {
15504            ::serde::Serialize::serialize(v, s)
15505        }
15506        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15507            d: D,
15508        ) -> ::core::result::Result<Self, D::Error> {
15509            <Self as ::serde::Deserialize>::deserialize(d)
15510        }
15511    }
15512    #[cfg(feature = "json")]
15513    #[doc(hidden)]
15514    pub const __NAME_PART_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15515        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15516        to_json: ::buffa::type_registry::any_to_json::<NamePart>,
15517        from_json: ::buffa::type_registry::any_from_json::<NamePart>,
15518        is_wkt: false,
15519    };
15520    #[cfg(feature = "text")]
15521    #[doc(hidden)]
15522    pub const __NAME_PART_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15523        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
15524        text_encode: ::buffa::type_registry::any_encode_text::<NamePart>,
15525        text_merge: ::buffa::type_registry::any_merge_text::<NamePart>,
15526    };
15527    #[cfg(feature = "views")]
15528    #[doc(inline)]
15529    pub use super::__buffa::view::uninterpreted_option::NamePartView;
15530    #[cfg(feature = "views")]
15531    #[doc(inline)]
15532    pub use super::__buffa::view::uninterpreted_option::NamePartOwnedView;
15533}
15534/// ===================================================================
15535/// Features
15536///
15537/// TODO Enums in C++ gencode (and potentially other languages) are
15538/// not well scoped.  This means that each of the feature enums below can clash
15539/// with each other.  The short names we've chosen maximize call-site
15540/// readability, but leave us very open to this scenario.  A future feature will
15541/// be designed and implemented to handle this, hopefully before we ever hit a
15542/// conflict here.
15543#[derive(Clone, PartialEq, Default)]
15544#[cfg_attr(feature = "json", derive(::serde::Serialize))]
15545#[cfg_attr(feature = "json", serde(default))]
15546#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15547pub struct FeatureSet {
15548    /// Field 1: `field_presence`
15549    #[cfg_attr(
15550        feature = "json",
15551        serde(
15552            rename = "fieldPresence",
15553            alias = "field_presence",
15554            with = "::buffa::json_helpers::opt_closed_enum",
15555            skip_serializing_if = "::core::option::Option::is_none"
15556        )
15557    )]
15558    pub field_presence: ::core::option::Option<feature_set::FieldPresence>,
15559    /// Field 2: `enum_type`
15560    #[cfg_attr(
15561        feature = "json",
15562        serde(
15563            rename = "enumType",
15564            alias = "enum_type",
15565            with = "::buffa::json_helpers::opt_closed_enum",
15566            skip_serializing_if = "::core::option::Option::is_none"
15567        )
15568    )]
15569    pub enum_type: ::core::option::Option<feature_set::EnumType>,
15570    /// Field 3: `repeated_field_encoding`
15571    #[cfg_attr(
15572        feature = "json",
15573        serde(
15574            rename = "repeatedFieldEncoding",
15575            alias = "repeated_field_encoding",
15576            with = "::buffa::json_helpers::opt_closed_enum",
15577            skip_serializing_if = "::core::option::Option::is_none"
15578        )
15579    )]
15580    pub repeated_field_encoding: ::core::option::Option<
15581        feature_set::RepeatedFieldEncoding,
15582    >,
15583    /// Field 4: `utf8_validation`
15584    #[cfg_attr(
15585        feature = "json",
15586        serde(
15587            rename = "utf8Validation",
15588            alias = "utf8_validation",
15589            with = "::buffa::json_helpers::opt_closed_enum",
15590            skip_serializing_if = "::core::option::Option::is_none"
15591        )
15592    )]
15593    pub utf8_validation: ::core::option::Option<feature_set::Utf8Validation>,
15594    /// Field 5: `message_encoding`
15595    #[cfg_attr(
15596        feature = "json",
15597        serde(
15598            rename = "messageEncoding",
15599            alias = "message_encoding",
15600            with = "::buffa::json_helpers::opt_closed_enum",
15601            skip_serializing_if = "::core::option::Option::is_none"
15602        )
15603    )]
15604    pub message_encoding: ::core::option::Option<feature_set::MessageEncoding>,
15605    /// Field 6: `json_format`
15606    #[cfg_attr(
15607        feature = "json",
15608        serde(
15609            rename = "jsonFormat",
15610            alias = "json_format",
15611            with = "::buffa::json_helpers::opt_closed_enum",
15612            skip_serializing_if = "::core::option::Option::is_none"
15613        )
15614    )]
15615    pub json_format: ::core::option::Option<feature_set::JsonFormat>,
15616    /// Field 7: `enforce_naming_style`
15617    #[cfg_attr(
15618        feature = "json",
15619        serde(
15620            rename = "enforceNamingStyle",
15621            alias = "enforce_naming_style",
15622            with = "::buffa::json_helpers::opt_closed_enum",
15623            skip_serializing_if = "::core::option::Option::is_none"
15624        )
15625    )]
15626    pub enforce_naming_style: ::core::option::Option<feature_set::EnforceNamingStyle>,
15627    /// Field 8: `default_symbol_visibility`
15628    #[cfg_attr(
15629        feature = "json",
15630        serde(
15631            rename = "defaultSymbolVisibility",
15632            alias = "default_symbol_visibility",
15633            with = "::buffa::json_helpers::opt_closed_enum",
15634            skip_serializing_if = "::core::option::Option::is_none"
15635        )
15636    )]
15637    pub default_symbol_visibility: ::core::option::Option<
15638        feature_set::visibility_feature::DefaultSymbolVisibility,
15639    >,
15640    #[cfg_attr(feature = "json", serde(flatten))]
15641    #[doc(hidden)]
15642    pub __buffa_unknown_fields: __FeatureSetExtJson,
15643}
15644impl ::core::fmt::Debug for FeatureSet {
15645    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15646        f.debug_struct("FeatureSet")
15647            .field("field_presence", &self.field_presence)
15648            .field("enum_type", &self.enum_type)
15649            .field("repeated_field_encoding", &self.repeated_field_encoding)
15650            .field("utf8_validation", &self.utf8_validation)
15651            .field("message_encoding", &self.message_encoding)
15652            .field("json_format", &self.json_format)
15653            .field("enforce_naming_style", &self.enforce_naming_style)
15654            .field("default_symbol_visibility", &self.default_symbol_visibility)
15655            .finish()
15656    }
15657}
15658impl FeatureSet {
15659    /// Protobuf type URL for this message, for use with `Any::pack` and
15660    /// `Any::unpack_if`.
15661    ///
15662    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15663    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15664}
15665impl FeatureSet {
15666    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15667    #[inline]
15668    ///Sets [`Self::field_presence`] to `Some(value)`, consuming and returning `self`.
15669    pub fn with_field_presence(
15670        mut self,
15671        value: impl Into<feature_set::FieldPresence>,
15672    ) -> Self {
15673        self.field_presence = Some(value.into());
15674        self
15675    }
15676    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15677    #[inline]
15678    ///Sets [`Self::enum_type`] to `Some(value)`, consuming and returning `self`.
15679    pub fn with_enum_type(mut self, value: impl Into<feature_set::EnumType>) -> Self {
15680        self.enum_type = Some(value.into());
15681        self
15682    }
15683    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15684    #[inline]
15685    ///Sets [`Self::repeated_field_encoding`] to `Some(value)`, consuming and returning `self`.
15686    pub fn with_repeated_field_encoding(
15687        mut self,
15688        value: impl Into<feature_set::RepeatedFieldEncoding>,
15689    ) -> Self {
15690        self.repeated_field_encoding = Some(value.into());
15691        self
15692    }
15693    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15694    #[inline]
15695    ///Sets [`Self::utf8_validation`] to `Some(value)`, consuming and returning `self`.
15696    pub fn with_utf8_validation(
15697        mut self,
15698        value: impl Into<feature_set::Utf8Validation>,
15699    ) -> Self {
15700        self.utf8_validation = Some(value.into());
15701        self
15702    }
15703    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15704    #[inline]
15705    ///Sets [`Self::message_encoding`] to `Some(value)`, consuming and returning `self`.
15706    pub fn with_message_encoding(
15707        mut self,
15708        value: impl Into<feature_set::MessageEncoding>,
15709    ) -> Self {
15710        self.message_encoding = Some(value.into());
15711        self
15712    }
15713    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15714    #[inline]
15715    ///Sets [`Self::json_format`] to `Some(value)`, consuming and returning `self`.
15716    pub fn with_json_format(
15717        mut self,
15718        value: impl Into<feature_set::JsonFormat>,
15719    ) -> Self {
15720        self.json_format = Some(value.into());
15721        self
15722    }
15723    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15724    #[inline]
15725    ///Sets [`Self::enforce_naming_style`] to `Some(value)`, consuming and returning `self`.
15726    pub fn with_enforce_naming_style(
15727        mut self,
15728        value: impl Into<feature_set::EnforceNamingStyle>,
15729    ) -> Self {
15730        self.enforce_naming_style = Some(value.into());
15731        self
15732    }
15733    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15734    #[inline]
15735    ///Sets [`Self::default_symbol_visibility`] to `Some(value)`, consuming and returning `self`.
15736    pub fn with_default_symbol_visibility(
15737        mut self,
15738        value: impl Into<feature_set::visibility_feature::DefaultSymbolVisibility>,
15739    ) -> Self {
15740        self.default_symbol_visibility = Some(value.into());
15741        self
15742    }
15743}
15744::buffa::impl_default_instance!(FeatureSet);
15745impl ::buffa::MessageName for FeatureSet {
15746    const PACKAGE: &'static str = "google.protobuf";
15747    const NAME: &'static str = "FeatureSet";
15748    const FULL_NAME: &'static str = "google.protobuf.FeatureSet";
15749    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
15750}
15751impl ::buffa::Message for FeatureSet {
15752    /// Returns the total encoded size in bytes.
15753    ///
15754    /// Accumulates in `u64` (which cannot overflow for in-memory
15755    /// data) and saturates to `u32` at return, so a message whose
15756    /// encoded size exceeds the 2 GiB protobuf limit yields a value
15757    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
15758    /// points reject, never a silently wrapped size.
15759    #[allow(clippy::let_and_return)]
15760    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15761        #[allow(unused_imports)]
15762        use ::buffa::Enumeration as _;
15763        let mut size = 0u64;
15764        if let Some(ref v) = self.field_presence {
15765            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15766        }
15767        if let Some(ref v) = self.enum_type {
15768            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15769        }
15770        if let Some(ref v) = self.repeated_field_encoding {
15771            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15772        }
15773        if let Some(ref v) = self.utf8_validation {
15774            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15775        }
15776        if let Some(ref v) = self.message_encoding {
15777            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15778        }
15779        if let Some(ref v) = self.json_format {
15780            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15781        }
15782        if let Some(ref v) = self.enforce_naming_style {
15783            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15784        }
15785        if let Some(ref v) = self.default_symbol_visibility {
15786            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
15787        }
15788        size += self.__buffa_unknown_fields.encoded_len() as u64;
15789        ::buffa::saturate_size(size)
15790    }
15791    fn write_to(
15792        &self,
15793        _cache: &mut ::buffa::SizeCache,
15794        buf: &mut impl ::buffa::EncodeSink,
15795    ) {
15796        #[allow(unused_imports)]
15797        use ::buffa::Enumeration as _;
15798        if let Some(ref v) = self.field_presence {
15799            ::buffa::types::put_int32_field(1u32, v.to_i32(), buf);
15800        }
15801        if let Some(ref v) = self.enum_type {
15802            ::buffa::types::put_int32_field(2u32, v.to_i32(), buf);
15803        }
15804        if let Some(ref v) = self.repeated_field_encoding {
15805            ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
15806        }
15807        if let Some(ref v) = self.utf8_validation {
15808            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
15809        }
15810        if let Some(ref v) = self.message_encoding {
15811            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
15812        }
15813        if let Some(ref v) = self.json_format {
15814            ::buffa::types::put_int32_field(6u32, v.to_i32(), buf);
15815        }
15816        if let Some(ref v) = self.enforce_naming_style {
15817            ::buffa::types::put_int32_field(7u32, v.to_i32(), buf);
15818        }
15819        if let Some(ref v) = self.default_symbol_visibility {
15820            ::buffa::types::put_int32_field(8u32, v.to_i32(), buf);
15821        }
15822        self.__buffa_unknown_fields.write_to(buf);
15823    }
15824    fn merge_field(
15825        &mut self,
15826        tag: ::buffa::encoding::Tag,
15827        buf: &mut impl ::buffa::bytes::Buf,
15828        ctx: ::buffa::DecodeContext<'_>,
15829    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15830        #[allow(unused_imports)]
15831        use ::buffa::bytes::Buf as _;
15832        #[allow(unused_imports)]
15833        use ::buffa::Enumeration as _;
15834        match tag.field_number() {
15835            1u32 => {
15836                ::buffa::encoding::check_wire_type(
15837                    tag,
15838                    ::buffa::encoding::WireType::Varint,
15839                )?;
15840                let __raw = ::buffa::types::decode_int32(buf)?;
15841                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15842                    __raw,
15843                ) {
15844                    self.field_presence = ::core::option::Option::Some(__v);
15845                } else {
15846                    ctx.register_unknown_field()?;
15847                    self.__buffa_unknown_fields
15848                        .push(::buffa::UnknownField {
15849                            number: 1u32,
15850                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15851                        });
15852                }
15853            }
15854            2u32 => {
15855                ::buffa::encoding::check_wire_type(
15856                    tag,
15857                    ::buffa::encoding::WireType::Varint,
15858                )?;
15859                let __raw = ::buffa::types::decode_int32(buf)?;
15860                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15861                    __raw,
15862                ) {
15863                    self.enum_type = ::core::option::Option::Some(__v);
15864                } else {
15865                    ctx.register_unknown_field()?;
15866                    self.__buffa_unknown_fields
15867                        .push(::buffa::UnknownField {
15868                            number: 2u32,
15869                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15870                        });
15871                }
15872            }
15873            3u32 => {
15874                ::buffa::encoding::check_wire_type(
15875                    tag,
15876                    ::buffa::encoding::WireType::Varint,
15877                )?;
15878                let __raw = ::buffa::types::decode_int32(buf)?;
15879                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15880                    __raw,
15881                ) {
15882                    self.repeated_field_encoding = ::core::option::Option::Some(__v);
15883                } else {
15884                    ctx.register_unknown_field()?;
15885                    self.__buffa_unknown_fields
15886                        .push(::buffa::UnknownField {
15887                            number: 3u32,
15888                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15889                        });
15890                }
15891            }
15892            4u32 => {
15893                ::buffa::encoding::check_wire_type(
15894                    tag,
15895                    ::buffa::encoding::WireType::Varint,
15896                )?;
15897                let __raw = ::buffa::types::decode_int32(buf)?;
15898                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15899                    __raw,
15900                ) {
15901                    self.utf8_validation = ::core::option::Option::Some(__v);
15902                } else {
15903                    ctx.register_unknown_field()?;
15904                    self.__buffa_unknown_fields
15905                        .push(::buffa::UnknownField {
15906                            number: 4u32,
15907                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15908                        });
15909                }
15910            }
15911            5u32 => {
15912                ::buffa::encoding::check_wire_type(
15913                    tag,
15914                    ::buffa::encoding::WireType::Varint,
15915                )?;
15916                let __raw = ::buffa::types::decode_int32(buf)?;
15917                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15918                    __raw,
15919                ) {
15920                    self.message_encoding = ::core::option::Option::Some(__v);
15921                } else {
15922                    ctx.register_unknown_field()?;
15923                    self.__buffa_unknown_fields
15924                        .push(::buffa::UnknownField {
15925                            number: 5u32,
15926                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15927                        });
15928                }
15929            }
15930            6u32 => {
15931                ::buffa::encoding::check_wire_type(
15932                    tag,
15933                    ::buffa::encoding::WireType::Varint,
15934                )?;
15935                let __raw = ::buffa::types::decode_int32(buf)?;
15936                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15937                    __raw,
15938                ) {
15939                    self.json_format = ::core::option::Option::Some(__v);
15940                } else {
15941                    ctx.register_unknown_field()?;
15942                    self.__buffa_unknown_fields
15943                        .push(::buffa::UnknownField {
15944                            number: 6u32,
15945                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15946                        });
15947                }
15948            }
15949            7u32 => {
15950                ::buffa::encoding::check_wire_type(
15951                    tag,
15952                    ::buffa::encoding::WireType::Varint,
15953                )?;
15954                let __raw = ::buffa::types::decode_int32(buf)?;
15955                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15956                    __raw,
15957                ) {
15958                    self.enforce_naming_style = ::core::option::Option::Some(__v);
15959                } else {
15960                    ctx.register_unknown_field()?;
15961                    self.__buffa_unknown_fields
15962                        .push(::buffa::UnknownField {
15963                            number: 7u32,
15964                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15965                        });
15966                }
15967            }
15968            8u32 => {
15969                ::buffa::encoding::check_wire_type(
15970                    tag,
15971                    ::buffa::encoding::WireType::Varint,
15972                )?;
15973                let __raw = ::buffa::types::decode_int32(buf)?;
15974                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
15975                    __raw,
15976                ) {
15977                    self.default_symbol_visibility = ::core::option::Option::Some(__v);
15978                } else {
15979                    ctx.register_unknown_field()?;
15980                    self.__buffa_unknown_fields
15981                        .push(::buffa::UnknownField {
15982                            number: 8u32,
15983                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
15984                        });
15985                }
15986            }
15987            _ => {
15988                self.__buffa_unknown_fields
15989                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
15990            }
15991        }
15992        ::core::result::Result::Ok(())
15993    }
15994    fn clear(&mut self) {
15995        self.field_presence = ::core::option::Option::None;
15996        self.enum_type = ::core::option::Option::None;
15997        self.repeated_field_encoding = ::core::option::Option::None;
15998        self.utf8_validation = ::core::option::Option::None;
15999        self.message_encoding = ::core::option::Option::None;
16000        self.json_format = ::core::option::Option::None;
16001        self.enforce_naming_style = ::core::option::Option::None;
16002        self.default_symbol_visibility = ::core::option::Option::None;
16003        self.__buffa_unknown_fields.clear();
16004    }
16005}
16006impl ::buffa::ExtensionSet for FeatureSet {
16007    const PROTO_FQN: &'static str = "google.protobuf.FeatureSet";
16008    fn unknown_fields(&self) -> &::buffa::UnknownFields {
16009        &self.__buffa_unknown_fields
16010    }
16011    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
16012        &mut self.__buffa_unknown_fields
16013    }
16014}
16015#[cfg(feature = "text")]
16016impl ::buffa::text::TextFormat for FeatureSet {
16017    fn encode_text(
16018        &self,
16019        enc: &mut ::buffa::text::TextEncoder<'_>,
16020    ) -> ::core::fmt::Result {
16021        #[allow(unused_imports)]
16022        use ::buffa::Enumeration as _;
16023        if let ::core::option::Option::Some(ref __v) = self.field_presence {
16024            enc.write_field_name("field_presence")?;
16025            enc.write_enum_name(__v.proto_name())?;
16026        }
16027        if let ::core::option::Option::Some(ref __v) = self.enum_type {
16028            enc.write_field_name("enum_type")?;
16029            enc.write_enum_name(__v.proto_name())?;
16030        }
16031        if let ::core::option::Option::Some(ref __v) = self.repeated_field_encoding {
16032            enc.write_field_name("repeated_field_encoding")?;
16033            enc.write_enum_name(__v.proto_name())?;
16034        }
16035        if let ::core::option::Option::Some(ref __v) = self.utf8_validation {
16036            enc.write_field_name("utf8_validation")?;
16037            enc.write_enum_name(__v.proto_name())?;
16038        }
16039        if let ::core::option::Option::Some(ref __v) = self.message_encoding {
16040            enc.write_field_name("message_encoding")?;
16041            enc.write_enum_name(__v.proto_name())?;
16042        }
16043        if let ::core::option::Option::Some(ref __v) = self.json_format {
16044            enc.write_field_name("json_format")?;
16045            enc.write_enum_name(__v.proto_name())?;
16046        }
16047        if let ::core::option::Option::Some(ref __v) = self.enforce_naming_style {
16048            enc.write_field_name("enforce_naming_style")?;
16049            enc.write_enum_name(__v.proto_name())?;
16050        }
16051        if let ::core::option::Option::Some(ref __v) = self.default_symbol_visibility {
16052            enc.write_field_name("default_symbol_visibility")?;
16053            enc.write_enum_name(__v.proto_name())?;
16054        }
16055        enc.write_extension_fields(
16056            "google.protobuf.FeatureSet",
16057            &self.__buffa_unknown_fields,
16058        )?;
16059        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
16060        ::core::result::Result::Ok(())
16061    }
16062    fn merge_text(
16063        &mut self,
16064        dec: &mut ::buffa::text::TextDecoder<'_>,
16065    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
16066        #[allow(unused_imports)]
16067        use ::buffa::Enumeration as _;
16068        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
16069            match __name {
16070                "field_presence" => {
16071                    self.field_presence = ::core::option::Option::Some(
16072                        dec.read_closed_enum_by_name::<feature_set::FieldPresence>()?,
16073                    );
16074                }
16075                "enum_type" => {
16076                    self.enum_type = ::core::option::Option::Some(
16077                        dec.read_closed_enum_by_name::<feature_set::EnumType>()?,
16078                    );
16079                }
16080                "repeated_field_encoding" => {
16081                    self.repeated_field_encoding = ::core::option::Option::Some(
16082                        dec
16083                            .read_closed_enum_by_name::<
16084                                feature_set::RepeatedFieldEncoding,
16085                            >()?,
16086                    );
16087                }
16088                "utf8_validation" => {
16089                    self.utf8_validation = ::core::option::Option::Some(
16090                        dec.read_closed_enum_by_name::<feature_set::Utf8Validation>()?,
16091                    );
16092                }
16093                "message_encoding" => {
16094                    self.message_encoding = ::core::option::Option::Some(
16095                        dec.read_closed_enum_by_name::<feature_set::MessageEncoding>()?,
16096                    );
16097                }
16098                "json_format" => {
16099                    self.json_format = ::core::option::Option::Some(
16100                        dec.read_closed_enum_by_name::<feature_set::JsonFormat>()?,
16101                    );
16102                }
16103                "enforce_naming_style" => {
16104                    self.enforce_naming_style = ::core::option::Option::Some(
16105                        dec
16106                            .read_closed_enum_by_name::<
16107                                feature_set::EnforceNamingStyle,
16108                            >()?,
16109                    );
16110                }
16111                "default_symbol_visibility" => {
16112                    self.default_symbol_visibility = ::core::option::Option::Some(
16113                        dec
16114                            .read_closed_enum_by_name::<
16115                                feature_set::visibility_feature::DefaultSymbolVisibility,
16116                            >()?,
16117                    );
16118                }
16119                __name if __name.starts_with('[') => {
16120                    for __r in dec.read_extension(__name, "google.protobuf.FeatureSet")?
16121                    {
16122                        self.__buffa_unknown_fields.push(__r);
16123                    }
16124                }
16125                _ => dec.skip_value()?,
16126            }
16127        }
16128        ::core::result::Result::Ok(())
16129    }
16130}
16131#[cfg(feature = "json")]
16132impl<'de> serde::Deserialize<'de> for FeatureSet {
16133    fn deserialize<D: serde::Deserializer<'de>>(
16134        d: D,
16135    ) -> ::core::result::Result<Self, D::Error> {
16136        struct _V;
16137        impl<'de> serde::de::Visitor<'de> for _V {
16138            type Value = FeatureSet;
16139            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
16140                f.write_str("struct FeatureSet")
16141            }
16142            #[allow(clippy::field_reassign_with_default)]
16143            fn visit_map<A: serde::de::MapAccess<'de>>(
16144                self,
16145                mut map: A,
16146            ) -> ::core::result::Result<FeatureSet, A::Error> {
16147                let mut __f_field_presence: ::core::option::Option<
16148                    ::core::option::Option<feature_set::FieldPresence>,
16149                > = None;
16150                let mut __f_enum_type: ::core::option::Option<
16151                    ::core::option::Option<feature_set::EnumType>,
16152                > = None;
16153                let mut __f_repeated_field_encoding: ::core::option::Option<
16154                    ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16155                > = None;
16156                let mut __f_utf8_validation: ::core::option::Option<
16157                    ::core::option::Option<feature_set::Utf8Validation>,
16158                > = None;
16159                let mut __f_message_encoding: ::core::option::Option<
16160                    ::core::option::Option<feature_set::MessageEncoding>,
16161                > = None;
16162                let mut __f_json_format: ::core::option::Option<
16163                    ::core::option::Option<feature_set::JsonFormat>,
16164                > = None;
16165                let mut __f_enforce_naming_style: ::core::option::Option<
16166                    ::core::option::Option<feature_set::EnforceNamingStyle>,
16167                > = None;
16168                let mut __f_default_symbol_visibility: ::core::option::Option<
16169                    ::core::option::Option<
16170                        feature_set::visibility_feature::DefaultSymbolVisibility,
16171                    >,
16172                > = None;
16173                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
16174                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
16175                    match key.as_str() {
16176                        "fieldPresence" | "field_presence" => {
16177                            __f_field_presence = Some({
16178                                struct _S;
16179                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16180                                    type Value = ::core::option::Option<
16181                                        feature_set::FieldPresence,
16182                                    >;
16183                                    fn deserialize<D: serde::Deserializer<'de>>(
16184                                        self,
16185                                        d: D,
16186                                    ) -> ::core::result::Result<
16187                                        ::core::option::Option<feature_set::FieldPresence>,
16188                                        D::Error,
16189                                    > {
16190                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16191                                    }
16192                                }
16193                                map.next_value_seed(_S)?
16194                            });
16195                        }
16196                        "enumType" | "enum_type" => {
16197                            __f_enum_type = Some({
16198                                struct _S;
16199                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16200                                    type Value = ::core::option::Option<feature_set::EnumType>;
16201                                    fn deserialize<D: serde::Deserializer<'de>>(
16202                                        self,
16203                                        d: D,
16204                                    ) -> ::core::result::Result<
16205                                        ::core::option::Option<feature_set::EnumType>,
16206                                        D::Error,
16207                                    > {
16208                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16209                                    }
16210                                }
16211                                map.next_value_seed(_S)?
16212                            });
16213                        }
16214                        "repeatedFieldEncoding" | "repeated_field_encoding" => {
16215                            __f_repeated_field_encoding = Some({
16216                                struct _S;
16217                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16218                                    type Value = ::core::option::Option<
16219                                        feature_set::RepeatedFieldEncoding,
16220                                    >;
16221                                    fn deserialize<D: serde::Deserializer<'de>>(
16222                                        self,
16223                                        d: D,
16224                                    ) -> ::core::result::Result<
16225                                        ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16226                                        D::Error,
16227                                    > {
16228                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16229                                    }
16230                                }
16231                                map.next_value_seed(_S)?
16232                            });
16233                        }
16234                        "utf8Validation" | "utf8_validation" => {
16235                            __f_utf8_validation = Some({
16236                                struct _S;
16237                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16238                                    type Value = ::core::option::Option<
16239                                        feature_set::Utf8Validation,
16240                                    >;
16241                                    fn deserialize<D: serde::Deserializer<'de>>(
16242                                        self,
16243                                        d: D,
16244                                    ) -> ::core::result::Result<
16245                                        ::core::option::Option<feature_set::Utf8Validation>,
16246                                        D::Error,
16247                                    > {
16248                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16249                                    }
16250                                }
16251                                map.next_value_seed(_S)?
16252                            });
16253                        }
16254                        "messageEncoding" | "message_encoding" => {
16255                            __f_message_encoding = Some({
16256                                struct _S;
16257                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16258                                    type Value = ::core::option::Option<
16259                                        feature_set::MessageEncoding,
16260                                    >;
16261                                    fn deserialize<D: serde::Deserializer<'de>>(
16262                                        self,
16263                                        d: D,
16264                                    ) -> ::core::result::Result<
16265                                        ::core::option::Option<feature_set::MessageEncoding>,
16266                                        D::Error,
16267                                    > {
16268                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16269                                    }
16270                                }
16271                                map.next_value_seed(_S)?
16272                            });
16273                        }
16274                        "jsonFormat" | "json_format" => {
16275                            __f_json_format = Some({
16276                                struct _S;
16277                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16278                                    type Value = ::core::option::Option<
16279                                        feature_set::JsonFormat,
16280                                    >;
16281                                    fn deserialize<D: serde::Deserializer<'de>>(
16282                                        self,
16283                                        d: D,
16284                                    ) -> ::core::result::Result<
16285                                        ::core::option::Option<feature_set::JsonFormat>,
16286                                        D::Error,
16287                                    > {
16288                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16289                                    }
16290                                }
16291                                map.next_value_seed(_S)?
16292                            });
16293                        }
16294                        "enforceNamingStyle" | "enforce_naming_style" => {
16295                            __f_enforce_naming_style = Some({
16296                                struct _S;
16297                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16298                                    type Value = ::core::option::Option<
16299                                        feature_set::EnforceNamingStyle,
16300                                    >;
16301                                    fn deserialize<D: serde::Deserializer<'de>>(
16302                                        self,
16303                                        d: D,
16304                                    ) -> ::core::result::Result<
16305                                        ::core::option::Option<feature_set::EnforceNamingStyle>,
16306                                        D::Error,
16307                                    > {
16308                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16309                                    }
16310                                }
16311                                map.next_value_seed(_S)?
16312                            });
16313                        }
16314                        "defaultSymbolVisibility" | "default_symbol_visibility" => {
16315                            __f_default_symbol_visibility = Some({
16316                                struct _S;
16317                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16318                                    type Value = ::core::option::Option<
16319                                        feature_set::visibility_feature::DefaultSymbolVisibility,
16320                                    >;
16321                                    fn deserialize<D: serde::Deserializer<'de>>(
16322                                        self,
16323                                        d: D,
16324                                    ) -> ::core::result::Result<
16325                                        ::core::option::Option<
16326                                            feature_set::visibility_feature::DefaultSymbolVisibility,
16327                                        >,
16328                                        D::Error,
16329                                    > {
16330                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16331                                    }
16332                                }
16333                                map.next_value_seed(_S)?
16334                            });
16335                        }
16336                        __k if __k.starts_with('[') => {
16337                            let __v: ::buffa::serde_json::Value = map.next_value()?;
16338                            match ::buffa::extension_registry::deserialize_extension_key(
16339                                "google.protobuf.FeatureSet",
16340                                __k,
16341                                __v,
16342                            ) {
16343                                ::core::option::Option::Some(
16344                                    ::core::result::Result::Ok(__recs),
16345                                ) => {
16346                                    for __rec in __recs {
16347                                        __ext_records.push(__rec);
16348                                    }
16349                                }
16350                                ::core::option::Option::Some(
16351                                    ::core::result::Result::Err(__e),
16352                                ) => {
16353                                    return ::core::result::Result::Err(
16354                                        <A::Error as ::serde::de::Error>::custom(__e),
16355                                    );
16356                                }
16357                                ::core::option::Option::None => {}
16358                            }
16359                        }
16360                        _ => {
16361                            map.next_value::<serde::de::IgnoredAny>()?;
16362                        }
16363                    }
16364                }
16365                let mut __r = <FeatureSet as ::core::default::Default>::default();
16366                if let ::core::option::Option::Some(v) = __f_field_presence {
16367                    __r.field_presence = v;
16368                }
16369                if let ::core::option::Option::Some(v) = __f_enum_type {
16370                    __r.enum_type = v;
16371                }
16372                if let ::core::option::Option::Some(v) = __f_repeated_field_encoding {
16373                    __r.repeated_field_encoding = v;
16374                }
16375                if let ::core::option::Option::Some(v) = __f_utf8_validation {
16376                    __r.utf8_validation = v;
16377                }
16378                if let ::core::option::Option::Some(v) = __f_message_encoding {
16379                    __r.message_encoding = v;
16380                }
16381                if let ::core::option::Option::Some(v) = __f_json_format {
16382                    __r.json_format = v;
16383                }
16384                if let ::core::option::Option::Some(v) = __f_enforce_naming_style {
16385                    __r.enforce_naming_style = v;
16386                }
16387                if let ::core::option::Option::Some(v) = __f_default_symbol_visibility {
16388                    __r.default_symbol_visibility = v;
16389                }
16390                for __rec in __ext_records {
16391                    __r.__buffa_unknown_fields.push(__rec);
16392                }
16393                Ok(__r)
16394            }
16395        }
16396        d.deserialize_map(_V)
16397    }
16398}
16399#[cfg(feature = "json")]
16400impl ::buffa::json_helpers::ProtoElemJson for FeatureSet {
16401    fn serialize_proto_json<S: ::serde::Serializer>(
16402        v: &Self,
16403        s: S,
16404    ) -> ::core::result::Result<S::Ok, S::Error> {
16405        ::serde::Serialize::serialize(v, s)
16406    }
16407    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16408        d: D,
16409    ) -> ::core::result::Result<Self, D::Error> {
16410        <Self as ::serde::Deserialize>::deserialize(d)
16411    }
16412}
16413#[doc(hidden)]
16414#[derive(Clone, Debug, Default, PartialEq)]
16415#[repr(transparent)]
16416#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16417pub struct __FeatureSetExtJson(pub ::buffa::UnknownFields);
16418impl ::core::ops::Deref for __FeatureSetExtJson {
16419    type Target = ::buffa::UnknownFields;
16420    fn deref(&self) -> &::buffa::UnknownFields {
16421        &self.0
16422    }
16423}
16424impl ::core::ops::DerefMut for __FeatureSetExtJson {
16425    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
16426        &mut self.0
16427    }
16428}
16429impl ::core::convert::From<::buffa::UnknownFields> for __FeatureSetExtJson {
16430    fn from(u: ::buffa::UnknownFields) -> Self {
16431        Self(u)
16432    }
16433}
16434#[cfg(feature = "json")]
16435impl ::serde::Serialize for __FeatureSetExtJson {
16436    fn serialize<S: ::serde::Serializer>(
16437        &self,
16438        s: S,
16439    ) -> ::core::result::Result<S::Ok, S::Error> {
16440        ::buffa::extension_registry::serialize_extensions(
16441            "google.protobuf.FeatureSet",
16442            &self.0,
16443            s,
16444        )
16445    }
16446}
16447#[cfg(feature = "json")]
16448impl<'de> ::serde::Deserialize<'de> for __FeatureSetExtJson {
16449    fn deserialize<D: ::serde::Deserializer<'de>>(
16450        d: D,
16451    ) -> ::core::result::Result<Self, D::Error> {
16452        ::buffa::extension_registry::deserialize_extensions(
16453                "google.protobuf.FeatureSet",
16454                d,
16455            )
16456            .map(Self)
16457    }
16458}
16459#[cfg(feature = "json")]
16460#[doc(hidden)]
16461pub const __FEATURE_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
16462    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16463    to_json: ::buffa::type_registry::any_to_json::<FeatureSet>,
16464    from_json: ::buffa::type_registry::any_from_json::<FeatureSet>,
16465    is_wkt: false,
16466};
16467#[cfg(feature = "text")]
16468#[doc(hidden)]
16469pub const __FEATURE_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
16470    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
16471    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSet>,
16472    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSet>,
16473};
16474pub mod feature_set {
16475    #[allow(unused_imports)]
16476    use super::*;
16477    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16478    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16479    #[repr(i32)]
16480    pub enum FieldPresence {
16481        FIELD_PRESENCE_UNKNOWN = 0i32,
16482        EXPLICIT = 1i32,
16483        IMPLICIT = 2i32,
16484        LEGACY_REQUIRED = 3i32,
16485    }
16486    impl FieldPresence {
16487        ///Idiomatic alias for [`Self::FIELD_PRESENCE_UNKNOWN`]; `Debug` prints the variant name.
16488        #[allow(non_upper_case_globals)]
16489        pub const FieldPresenceUnknown: Self = Self::FIELD_PRESENCE_UNKNOWN;
16490        ///Idiomatic alias for [`Self::EXPLICIT`]; `Debug` prints the variant name.
16491        #[allow(non_upper_case_globals)]
16492        pub const Explicit: Self = Self::EXPLICIT;
16493        ///Idiomatic alias for [`Self::IMPLICIT`]; `Debug` prints the variant name.
16494        #[allow(non_upper_case_globals)]
16495        pub const Implicit: Self = Self::IMPLICIT;
16496        ///Idiomatic alias for [`Self::LEGACY_REQUIRED`]; `Debug` prints the variant name.
16497        #[allow(non_upper_case_globals)]
16498        pub const LegacyRequired: Self = Self::LEGACY_REQUIRED;
16499    }
16500    impl ::core::default::Default for FieldPresence {
16501        fn default() -> Self {
16502            Self::FIELD_PRESENCE_UNKNOWN
16503        }
16504    }
16505    #[cfg(feature = "json")]
16506    const _: () = {
16507        impl ::serde::Serialize for FieldPresence {
16508            fn serialize<S: ::serde::Serializer>(
16509                &self,
16510                s: S,
16511            ) -> ::core::result::Result<S::Ok, S::Error> {
16512                s.serialize_str(::buffa::Enumeration::proto_name(self))
16513            }
16514        }
16515        impl<'de> ::serde::Deserialize<'de> for FieldPresence {
16516            fn deserialize<D: ::serde::Deserializer<'de>>(
16517                d: D,
16518            ) -> ::core::result::Result<Self, D::Error> {
16519                struct _V;
16520                impl ::serde::de::Visitor<'_> for _V {
16521                    type Value = FieldPresence;
16522                    fn expecting(
16523                        &self,
16524                        f: &mut ::core::fmt::Formatter<'_>,
16525                    ) -> ::core::fmt::Result {
16526                        f.write_str(
16527                            concat!(
16528                                "a string, integer, or null for ", stringify!(FieldPresence)
16529                            ),
16530                        )
16531                    }
16532                    fn visit_str<E: ::serde::de::Error>(
16533                        self,
16534                        v: &str,
16535                    ) -> ::core::result::Result<FieldPresence, E> {
16536                        <FieldPresence as ::buffa::Enumeration>::from_proto_name(v)
16537                            .ok_or_else(|| {
16538                                ::serde::de::Error::unknown_variant(v, &[])
16539                            })
16540                    }
16541                    fn visit_i64<E: ::serde::de::Error>(
16542                        self,
16543                        v: i64,
16544                    ) -> ::core::result::Result<FieldPresence, E> {
16545                        let v32 = i32::try_from(v)
16546                            .map_err(|_| {
16547                                ::serde::de::Error::custom(
16548                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16549                                )
16550                            })?;
16551                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16552                            .ok_or_else(|| {
16553                                ::serde::de::Error::custom(
16554                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16555                                )
16556                            })
16557                    }
16558                    fn visit_u64<E: ::serde::de::Error>(
16559                        self,
16560                        v: u64,
16561                    ) -> ::core::result::Result<FieldPresence, E> {
16562                        let v32 = i32::try_from(v)
16563                            .map_err(|_| {
16564                                ::serde::de::Error::custom(
16565                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16566                                )
16567                            })?;
16568                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
16569                            .ok_or_else(|| {
16570                                ::serde::de::Error::custom(
16571                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16572                                )
16573                            })
16574                    }
16575                    fn visit_unit<E: ::serde::de::Error>(
16576                        self,
16577                    ) -> ::core::result::Result<FieldPresence, E> {
16578                        ::core::result::Result::Ok(::core::default::Default::default())
16579                    }
16580                }
16581                d.deserialize_any(_V)
16582            }
16583        }
16584        impl ::buffa::json_helpers::ProtoElemJson for FieldPresence {
16585            fn serialize_proto_json<S: ::serde::Serializer>(
16586                v: &Self,
16587                s: S,
16588            ) -> ::core::result::Result<S::Ok, S::Error> {
16589                ::serde::Serialize::serialize(v, s)
16590            }
16591            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16592                d: D,
16593            ) -> ::core::result::Result<Self, D::Error> {
16594                <Self as ::serde::Deserialize>::deserialize(d)
16595            }
16596        }
16597    };
16598    impl ::buffa::Enumeration for FieldPresence {
16599        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16600            match value {
16601                0i32 => ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
16602                1i32 => ::core::option::Option::Some(Self::EXPLICIT),
16603                2i32 => ::core::option::Option::Some(Self::IMPLICIT),
16604                3i32 => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16605                _ => ::core::option::Option::None,
16606            }
16607        }
16608        fn to_i32(&self) -> i32 {
16609            *self as i32
16610        }
16611        fn proto_name(&self) -> &'static str {
16612            match self {
16613                Self::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN",
16614                Self::EXPLICIT => "EXPLICIT",
16615                Self::IMPLICIT => "IMPLICIT",
16616                Self::LEGACY_REQUIRED => "LEGACY_REQUIRED",
16617            }
16618        }
16619        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16620            match name {
16621                "FIELD_PRESENCE_UNKNOWN" => {
16622                    ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN)
16623                }
16624                "EXPLICIT" => ::core::option::Option::Some(Self::EXPLICIT),
16625                "IMPLICIT" => ::core::option::Option::Some(Self::IMPLICIT),
16626                "LEGACY_REQUIRED" => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
16627                _ => ::core::option::Option::None,
16628            }
16629        }
16630        fn values() -> &'static [Self] {
16631            &[
16632                Self::FIELD_PRESENCE_UNKNOWN,
16633                Self::EXPLICIT,
16634                Self::IMPLICIT,
16635                Self::LEGACY_REQUIRED,
16636            ]
16637        }
16638    }
16639    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16640    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16641    #[repr(i32)]
16642    pub enum EnumType {
16643        ENUM_TYPE_UNKNOWN = 0i32,
16644        OPEN = 1i32,
16645        CLOSED = 2i32,
16646    }
16647    impl EnumType {
16648        ///Idiomatic alias for [`Self::ENUM_TYPE_UNKNOWN`]; `Debug` prints the variant name.
16649        #[allow(non_upper_case_globals)]
16650        pub const EnumTypeUnknown: Self = Self::ENUM_TYPE_UNKNOWN;
16651        ///Idiomatic alias for [`Self::OPEN`]; `Debug` prints the variant name.
16652        #[allow(non_upper_case_globals)]
16653        pub const Open: Self = Self::OPEN;
16654        ///Idiomatic alias for [`Self::CLOSED`]; `Debug` prints the variant name.
16655        #[allow(non_upper_case_globals)]
16656        pub const Closed: Self = Self::CLOSED;
16657    }
16658    impl ::core::default::Default for EnumType {
16659        fn default() -> Self {
16660            Self::ENUM_TYPE_UNKNOWN
16661        }
16662    }
16663    #[cfg(feature = "json")]
16664    const _: () = {
16665        impl ::serde::Serialize for EnumType {
16666            fn serialize<S: ::serde::Serializer>(
16667                &self,
16668                s: S,
16669            ) -> ::core::result::Result<S::Ok, S::Error> {
16670                s.serialize_str(::buffa::Enumeration::proto_name(self))
16671            }
16672        }
16673        impl<'de> ::serde::Deserialize<'de> for EnumType {
16674            fn deserialize<D: ::serde::Deserializer<'de>>(
16675                d: D,
16676            ) -> ::core::result::Result<Self, D::Error> {
16677                struct _V;
16678                impl ::serde::de::Visitor<'_> for _V {
16679                    type Value = EnumType;
16680                    fn expecting(
16681                        &self,
16682                        f: &mut ::core::fmt::Formatter<'_>,
16683                    ) -> ::core::fmt::Result {
16684                        f.write_str(
16685                            concat!(
16686                                "a string, integer, or null for ", stringify!(EnumType)
16687                            ),
16688                        )
16689                    }
16690                    fn visit_str<E: ::serde::de::Error>(
16691                        self,
16692                        v: &str,
16693                    ) -> ::core::result::Result<EnumType, E> {
16694                        <EnumType as ::buffa::Enumeration>::from_proto_name(v)
16695                            .ok_or_else(|| {
16696                                ::serde::de::Error::unknown_variant(v, &[])
16697                            })
16698                    }
16699                    fn visit_i64<E: ::serde::de::Error>(
16700                        self,
16701                        v: i64,
16702                    ) -> ::core::result::Result<EnumType, E> {
16703                        let v32 = i32::try_from(v)
16704                            .map_err(|_| {
16705                                ::serde::de::Error::custom(
16706                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16707                                )
16708                            })?;
16709                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16710                            .ok_or_else(|| {
16711                                ::serde::de::Error::custom(
16712                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16713                                )
16714                            })
16715                    }
16716                    fn visit_u64<E: ::serde::de::Error>(
16717                        self,
16718                        v: u64,
16719                    ) -> ::core::result::Result<EnumType, E> {
16720                        let v32 = i32::try_from(v)
16721                            .map_err(|_| {
16722                                ::serde::de::Error::custom(
16723                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16724                                )
16725                            })?;
16726                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
16727                            .ok_or_else(|| {
16728                                ::serde::de::Error::custom(
16729                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16730                                )
16731                            })
16732                    }
16733                    fn visit_unit<E: ::serde::de::Error>(
16734                        self,
16735                    ) -> ::core::result::Result<EnumType, E> {
16736                        ::core::result::Result::Ok(::core::default::Default::default())
16737                    }
16738                }
16739                d.deserialize_any(_V)
16740            }
16741        }
16742        impl ::buffa::json_helpers::ProtoElemJson for EnumType {
16743            fn serialize_proto_json<S: ::serde::Serializer>(
16744                v: &Self,
16745                s: S,
16746            ) -> ::core::result::Result<S::Ok, S::Error> {
16747                ::serde::Serialize::serialize(v, s)
16748            }
16749            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16750                d: D,
16751            ) -> ::core::result::Result<Self, D::Error> {
16752                <Self as ::serde::Deserialize>::deserialize(d)
16753            }
16754        }
16755    };
16756    impl ::buffa::Enumeration for EnumType {
16757        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16758            match value {
16759                0i32 => ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
16760                1i32 => ::core::option::Option::Some(Self::OPEN),
16761                2i32 => ::core::option::Option::Some(Self::CLOSED),
16762                _ => ::core::option::Option::None,
16763            }
16764        }
16765        fn to_i32(&self) -> i32 {
16766            *self as i32
16767        }
16768        fn proto_name(&self) -> &'static str {
16769            match self {
16770                Self::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN",
16771                Self::OPEN => "OPEN",
16772                Self::CLOSED => "CLOSED",
16773            }
16774        }
16775        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16776            match name {
16777                "ENUM_TYPE_UNKNOWN" => {
16778                    ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN)
16779                }
16780                "OPEN" => ::core::option::Option::Some(Self::OPEN),
16781                "CLOSED" => ::core::option::Option::Some(Self::CLOSED),
16782                _ => ::core::option::Option::None,
16783            }
16784        }
16785        fn values() -> &'static [Self] {
16786            &[Self::ENUM_TYPE_UNKNOWN, Self::OPEN, Self::CLOSED]
16787        }
16788    }
16789    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16790    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16791    #[repr(i32)]
16792    pub enum RepeatedFieldEncoding {
16793        REPEATED_FIELD_ENCODING_UNKNOWN = 0i32,
16794        PACKED = 1i32,
16795        EXPANDED = 2i32,
16796    }
16797    impl RepeatedFieldEncoding {
16798        ///Idiomatic alias for [`Self::REPEATED_FIELD_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
16799        #[allow(non_upper_case_globals)]
16800        pub const RepeatedFieldEncodingUnknown: Self = Self::REPEATED_FIELD_ENCODING_UNKNOWN;
16801        ///Idiomatic alias for [`Self::PACKED`]; `Debug` prints the variant name.
16802        #[allow(non_upper_case_globals)]
16803        pub const Packed: Self = Self::PACKED;
16804        ///Idiomatic alias for [`Self::EXPANDED`]; `Debug` prints the variant name.
16805        #[allow(non_upper_case_globals)]
16806        pub const Expanded: Self = Self::EXPANDED;
16807    }
16808    impl ::core::default::Default for RepeatedFieldEncoding {
16809        fn default() -> Self {
16810            Self::REPEATED_FIELD_ENCODING_UNKNOWN
16811        }
16812    }
16813    #[cfg(feature = "json")]
16814    const _: () = {
16815        impl ::serde::Serialize for RepeatedFieldEncoding {
16816            fn serialize<S: ::serde::Serializer>(
16817                &self,
16818                s: S,
16819            ) -> ::core::result::Result<S::Ok, S::Error> {
16820                s.serialize_str(::buffa::Enumeration::proto_name(self))
16821            }
16822        }
16823        impl<'de> ::serde::Deserialize<'de> for RepeatedFieldEncoding {
16824            fn deserialize<D: ::serde::Deserializer<'de>>(
16825                d: D,
16826            ) -> ::core::result::Result<Self, D::Error> {
16827                struct _V;
16828                impl ::serde::de::Visitor<'_> for _V {
16829                    type Value = RepeatedFieldEncoding;
16830                    fn expecting(
16831                        &self,
16832                        f: &mut ::core::fmt::Formatter<'_>,
16833                    ) -> ::core::fmt::Result {
16834                        f.write_str(
16835                            concat!(
16836                                "a string, integer, or null for ",
16837                                stringify!(RepeatedFieldEncoding)
16838                            ),
16839                        )
16840                    }
16841                    fn visit_str<E: ::serde::de::Error>(
16842                        self,
16843                        v: &str,
16844                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16845                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_proto_name(
16846                                v,
16847                            )
16848                            .ok_or_else(|| {
16849                                ::serde::de::Error::unknown_variant(v, &[])
16850                            })
16851                    }
16852                    fn visit_i64<E: ::serde::de::Error>(
16853                        self,
16854                        v: i64,
16855                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16856                        let v32 = i32::try_from(v)
16857                            .map_err(|_| {
16858                                ::serde::de::Error::custom(
16859                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16860                                )
16861                            })?;
16862                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16863                            .ok_or_else(|| {
16864                                ::serde::de::Error::custom(
16865                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16866                                )
16867                            })
16868                    }
16869                    fn visit_u64<E: ::serde::de::Error>(
16870                        self,
16871                        v: u64,
16872                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16873                        let v32 = i32::try_from(v)
16874                            .map_err(|_| {
16875                                ::serde::de::Error::custom(
16876                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
16877                                )
16878                            })?;
16879                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
16880                            .ok_or_else(|| {
16881                                ::serde::de::Error::custom(
16882                                    ::buffa::alloc::format!("unknown enum value {v32}"),
16883                                )
16884                            })
16885                    }
16886                    fn visit_unit<E: ::serde::de::Error>(
16887                        self,
16888                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
16889                        ::core::result::Result::Ok(::core::default::Default::default())
16890                    }
16891                }
16892                d.deserialize_any(_V)
16893            }
16894        }
16895        impl ::buffa::json_helpers::ProtoElemJson for RepeatedFieldEncoding {
16896            fn serialize_proto_json<S: ::serde::Serializer>(
16897                v: &Self,
16898                s: S,
16899            ) -> ::core::result::Result<S::Ok, S::Error> {
16900                ::serde::Serialize::serialize(v, s)
16901            }
16902            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16903                d: D,
16904            ) -> ::core::result::Result<Self, D::Error> {
16905                <Self as ::serde::Deserialize>::deserialize(d)
16906            }
16907        }
16908    };
16909    impl ::buffa::Enumeration for RepeatedFieldEncoding {
16910        fn from_i32(value: i32) -> ::core::option::Option<Self> {
16911            match value {
16912                0i32 => {
16913                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16914                }
16915                1i32 => ::core::option::Option::Some(Self::PACKED),
16916                2i32 => ::core::option::Option::Some(Self::EXPANDED),
16917                _ => ::core::option::Option::None,
16918            }
16919        }
16920        fn to_i32(&self) -> i32 {
16921            *self as i32
16922        }
16923        fn proto_name(&self) -> &'static str {
16924            match self {
16925                Self::REPEATED_FIELD_ENCODING_UNKNOWN => {
16926                    "REPEATED_FIELD_ENCODING_UNKNOWN"
16927                }
16928                Self::PACKED => "PACKED",
16929                Self::EXPANDED => "EXPANDED",
16930            }
16931        }
16932        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
16933            match name {
16934                "REPEATED_FIELD_ENCODING_UNKNOWN" => {
16935                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
16936                }
16937                "PACKED" => ::core::option::Option::Some(Self::PACKED),
16938                "EXPANDED" => ::core::option::Option::Some(Self::EXPANDED),
16939                _ => ::core::option::Option::None,
16940            }
16941        }
16942        fn values() -> &'static [Self] {
16943            &[Self::REPEATED_FIELD_ENCODING_UNKNOWN, Self::PACKED, Self::EXPANDED]
16944        }
16945    }
16946    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16947    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16948    #[repr(i32)]
16949    pub enum Utf8Validation {
16950        UTF8_VALIDATION_UNKNOWN = 0i32,
16951        VERIFY = 2i32,
16952        NONE = 3i32,
16953    }
16954    impl Utf8Validation {
16955        ///Idiomatic alias for [`Self::UTF8_VALIDATION_UNKNOWN`]; `Debug` prints the variant name.
16956        #[allow(non_upper_case_globals)]
16957        pub const Utf8ValidationUnknown: Self = Self::UTF8_VALIDATION_UNKNOWN;
16958        ///Idiomatic alias for [`Self::VERIFY`]; `Debug` prints the variant name.
16959        #[allow(non_upper_case_globals)]
16960        pub const Verify: Self = Self::VERIFY;
16961        ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
16962        #[allow(non_upper_case_globals)]
16963        pub const None: Self = Self::NONE;
16964    }
16965    impl ::core::default::Default for Utf8Validation {
16966        fn default() -> Self {
16967            Self::UTF8_VALIDATION_UNKNOWN
16968        }
16969    }
16970    #[cfg(feature = "json")]
16971    const _: () = {
16972        impl ::serde::Serialize for Utf8Validation {
16973            fn serialize<S: ::serde::Serializer>(
16974                &self,
16975                s: S,
16976            ) -> ::core::result::Result<S::Ok, S::Error> {
16977                s.serialize_str(::buffa::Enumeration::proto_name(self))
16978            }
16979        }
16980        impl<'de> ::serde::Deserialize<'de> for Utf8Validation {
16981            fn deserialize<D: ::serde::Deserializer<'de>>(
16982                d: D,
16983            ) -> ::core::result::Result<Self, D::Error> {
16984                struct _V;
16985                impl ::serde::de::Visitor<'_> for _V {
16986                    type Value = Utf8Validation;
16987                    fn expecting(
16988                        &self,
16989                        f: &mut ::core::fmt::Formatter<'_>,
16990                    ) -> ::core::fmt::Result {
16991                        f.write_str(
16992                            concat!(
16993                                "a string, integer, or null for ",
16994                                stringify!(Utf8Validation)
16995                            ),
16996                        )
16997                    }
16998                    fn visit_str<E: ::serde::de::Error>(
16999                        self,
17000                        v: &str,
17001                    ) -> ::core::result::Result<Utf8Validation, E> {
17002                        <Utf8Validation as ::buffa::Enumeration>::from_proto_name(v)
17003                            .ok_or_else(|| {
17004                                ::serde::de::Error::unknown_variant(v, &[])
17005                            })
17006                    }
17007                    fn visit_i64<E: ::serde::de::Error>(
17008                        self,
17009                        v: i64,
17010                    ) -> ::core::result::Result<Utf8Validation, E> {
17011                        let v32 = i32::try_from(v)
17012                            .map_err(|_| {
17013                                ::serde::de::Error::custom(
17014                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17015                                )
17016                            })?;
17017                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17018                            .ok_or_else(|| {
17019                                ::serde::de::Error::custom(
17020                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17021                                )
17022                            })
17023                    }
17024                    fn visit_u64<E: ::serde::de::Error>(
17025                        self,
17026                        v: u64,
17027                    ) -> ::core::result::Result<Utf8Validation, E> {
17028                        let v32 = i32::try_from(v)
17029                            .map_err(|_| {
17030                                ::serde::de::Error::custom(
17031                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17032                                )
17033                            })?;
17034                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17035                            .ok_or_else(|| {
17036                                ::serde::de::Error::custom(
17037                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17038                                )
17039                            })
17040                    }
17041                    fn visit_unit<E: ::serde::de::Error>(
17042                        self,
17043                    ) -> ::core::result::Result<Utf8Validation, E> {
17044                        ::core::result::Result::Ok(::core::default::Default::default())
17045                    }
17046                }
17047                d.deserialize_any(_V)
17048            }
17049        }
17050        impl ::buffa::json_helpers::ProtoElemJson for Utf8Validation {
17051            fn serialize_proto_json<S: ::serde::Serializer>(
17052                v: &Self,
17053                s: S,
17054            ) -> ::core::result::Result<S::Ok, S::Error> {
17055                ::serde::Serialize::serialize(v, s)
17056            }
17057            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17058                d: D,
17059            ) -> ::core::result::Result<Self, D::Error> {
17060                <Self as ::serde::Deserialize>::deserialize(d)
17061            }
17062        }
17063    };
17064    impl ::buffa::Enumeration for Utf8Validation {
17065        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17066            match value {
17067                0i32 => ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN),
17068                2i32 => ::core::option::Option::Some(Self::VERIFY),
17069                3i32 => ::core::option::Option::Some(Self::NONE),
17070                _ => ::core::option::Option::None,
17071            }
17072        }
17073        fn to_i32(&self) -> i32 {
17074            *self as i32
17075        }
17076        fn proto_name(&self) -> &'static str {
17077            match self {
17078                Self::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN",
17079                Self::VERIFY => "VERIFY",
17080                Self::NONE => "NONE",
17081            }
17082        }
17083        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17084            match name {
17085                "UTF8_VALIDATION_UNKNOWN" => {
17086                    ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
17087                }
17088                "VERIFY" => ::core::option::Option::Some(Self::VERIFY),
17089                "NONE" => ::core::option::Option::Some(Self::NONE),
17090                _ => ::core::option::Option::None,
17091            }
17092        }
17093        fn values() -> &'static [Self] {
17094            &[Self::UTF8_VALIDATION_UNKNOWN, Self::VERIFY, Self::NONE]
17095        }
17096    }
17097    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17098    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17099    #[repr(i32)]
17100    pub enum MessageEncoding {
17101        MESSAGE_ENCODING_UNKNOWN = 0i32,
17102        LENGTH_PREFIXED = 1i32,
17103        DELIMITED = 2i32,
17104    }
17105    impl MessageEncoding {
17106        ///Idiomatic alias for [`Self::MESSAGE_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
17107        #[allow(non_upper_case_globals)]
17108        pub const MessageEncodingUnknown: Self = Self::MESSAGE_ENCODING_UNKNOWN;
17109        ///Idiomatic alias for [`Self::LENGTH_PREFIXED`]; `Debug` prints the variant name.
17110        #[allow(non_upper_case_globals)]
17111        pub const LengthPrefixed: Self = Self::LENGTH_PREFIXED;
17112        ///Idiomatic alias for [`Self::DELIMITED`]; `Debug` prints the variant name.
17113        #[allow(non_upper_case_globals)]
17114        pub const Delimited: Self = Self::DELIMITED;
17115    }
17116    impl ::core::default::Default for MessageEncoding {
17117        fn default() -> Self {
17118            Self::MESSAGE_ENCODING_UNKNOWN
17119        }
17120    }
17121    #[cfg(feature = "json")]
17122    const _: () = {
17123        impl ::serde::Serialize for MessageEncoding {
17124            fn serialize<S: ::serde::Serializer>(
17125                &self,
17126                s: S,
17127            ) -> ::core::result::Result<S::Ok, S::Error> {
17128                s.serialize_str(::buffa::Enumeration::proto_name(self))
17129            }
17130        }
17131        impl<'de> ::serde::Deserialize<'de> for MessageEncoding {
17132            fn deserialize<D: ::serde::Deserializer<'de>>(
17133                d: D,
17134            ) -> ::core::result::Result<Self, D::Error> {
17135                struct _V;
17136                impl ::serde::de::Visitor<'_> for _V {
17137                    type Value = MessageEncoding;
17138                    fn expecting(
17139                        &self,
17140                        f: &mut ::core::fmt::Formatter<'_>,
17141                    ) -> ::core::fmt::Result {
17142                        f.write_str(
17143                            concat!(
17144                                "a string, integer, or null for ",
17145                                stringify!(MessageEncoding)
17146                            ),
17147                        )
17148                    }
17149                    fn visit_str<E: ::serde::de::Error>(
17150                        self,
17151                        v: &str,
17152                    ) -> ::core::result::Result<MessageEncoding, E> {
17153                        <MessageEncoding as ::buffa::Enumeration>::from_proto_name(v)
17154                            .ok_or_else(|| {
17155                                ::serde::de::Error::unknown_variant(v, &[])
17156                            })
17157                    }
17158                    fn visit_i64<E: ::serde::de::Error>(
17159                        self,
17160                        v: i64,
17161                    ) -> ::core::result::Result<MessageEncoding, E> {
17162                        let v32 = i32::try_from(v)
17163                            .map_err(|_| {
17164                                ::serde::de::Error::custom(
17165                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17166                                )
17167                            })?;
17168                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17169                            .ok_or_else(|| {
17170                                ::serde::de::Error::custom(
17171                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17172                                )
17173                            })
17174                    }
17175                    fn visit_u64<E: ::serde::de::Error>(
17176                        self,
17177                        v: u64,
17178                    ) -> ::core::result::Result<MessageEncoding, E> {
17179                        let v32 = i32::try_from(v)
17180                            .map_err(|_| {
17181                                ::serde::de::Error::custom(
17182                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17183                                )
17184                            })?;
17185                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17186                            .ok_or_else(|| {
17187                                ::serde::de::Error::custom(
17188                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17189                                )
17190                            })
17191                    }
17192                    fn visit_unit<E: ::serde::de::Error>(
17193                        self,
17194                    ) -> ::core::result::Result<MessageEncoding, E> {
17195                        ::core::result::Result::Ok(::core::default::Default::default())
17196                    }
17197                }
17198                d.deserialize_any(_V)
17199            }
17200        }
17201        impl ::buffa::json_helpers::ProtoElemJson for MessageEncoding {
17202            fn serialize_proto_json<S: ::serde::Serializer>(
17203                v: &Self,
17204                s: S,
17205            ) -> ::core::result::Result<S::Ok, S::Error> {
17206                ::serde::Serialize::serialize(v, s)
17207            }
17208            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17209                d: D,
17210            ) -> ::core::result::Result<Self, D::Error> {
17211                <Self as ::serde::Deserialize>::deserialize(d)
17212            }
17213        }
17214    };
17215    impl ::buffa::Enumeration for MessageEncoding {
17216        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17217            match value {
17218                0i32 => ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN),
17219                1i32 => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17220                2i32 => ::core::option::Option::Some(Self::DELIMITED),
17221                _ => ::core::option::Option::None,
17222            }
17223        }
17224        fn to_i32(&self) -> i32 {
17225            *self as i32
17226        }
17227        fn proto_name(&self) -> &'static str {
17228            match self {
17229                Self::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN",
17230                Self::LENGTH_PREFIXED => "LENGTH_PREFIXED",
17231                Self::DELIMITED => "DELIMITED",
17232            }
17233        }
17234        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17235            match name {
17236                "MESSAGE_ENCODING_UNKNOWN" => {
17237                    ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
17238                }
17239                "LENGTH_PREFIXED" => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17240                "DELIMITED" => ::core::option::Option::Some(Self::DELIMITED),
17241                _ => ::core::option::Option::None,
17242            }
17243        }
17244        fn values() -> &'static [Self] {
17245            &[Self::MESSAGE_ENCODING_UNKNOWN, Self::LENGTH_PREFIXED, Self::DELIMITED]
17246        }
17247    }
17248    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17249    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17250    #[repr(i32)]
17251    pub enum JsonFormat {
17252        JSON_FORMAT_UNKNOWN = 0i32,
17253        ALLOW = 1i32,
17254        LEGACY_BEST_EFFORT = 2i32,
17255    }
17256    impl JsonFormat {
17257        ///Idiomatic alias for [`Self::JSON_FORMAT_UNKNOWN`]; `Debug` prints the variant name.
17258        #[allow(non_upper_case_globals)]
17259        pub const JsonFormatUnknown: Self = Self::JSON_FORMAT_UNKNOWN;
17260        ///Idiomatic alias for [`Self::ALLOW`]; `Debug` prints the variant name.
17261        #[allow(non_upper_case_globals)]
17262        pub const Allow: Self = Self::ALLOW;
17263        ///Idiomatic alias for [`Self::LEGACY_BEST_EFFORT`]; `Debug` prints the variant name.
17264        #[allow(non_upper_case_globals)]
17265        pub const LegacyBestEffort: Self = Self::LEGACY_BEST_EFFORT;
17266    }
17267    impl ::core::default::Default for JsonFormat {
17268        fn default() -> Self {
17269            Self::JSON_FORMAT_UNKNOWN
17270        }
17271    }
17272    #[cfg(feature = "json")]
17273    const _: () = {
17274        impl ::serde::Serialize for JsonFormat {
17275            fn serialize<S: ::serde::Serializer>(
17276                &self,
17277                s: S,
17278            ) -> ::core::result::Result<S::Ok, S::Error> {
17279                s.serialize_str(::buffa::Enumeration::proto_name(self))
17280            }
17281        }
17282        impl<'de> ::serde::Deserialize<'de> for JsonFormat {
17283            fn deserialize<D: ::serde::Deserializer<'de>>(
17284                d: D,
17285            ) -> ::core::result::Result<Self, D::Error> {
17286                struct _V;
17287                impl ::serde::de::Visitor<'_> for _V {
17288                    type Value = JsonFormat;
17289                    fn expecting(
17290                        &self,
17291                        f: &mut ::core::fmt::Formatter<'_>,
17292                    ) -> ::core::fmt::Result {
17293                        f.write_str(
17294                            concat!(
17295                                "a string, integer, or null for ", stringify!(JsonFormat)
17296                            ),
17297                        )
17298                    }
17299                    fn visit_str<E: ::serde::de::Error>(
17300                        self,
17301                        v: &str,
17302                    ) -> ::core::result::Result<JsonFormat, E> {
17303                        <JsonFormat as ::buffa::Enumeration>::from_proto_name(v)
17304                            .ok_or_else(|| {
17305                                ::serde::de::Error::unknown_variant(v, &[])
17306                            })
17307                    }
17308                    fn visit_i64<E: ::serde::de::Error>(
17309                        self,
17310                        v: i64,
17311                    ) -> ::core::result::Result<JsonFormat, E> {
17312                        let v32 = i32::try_from(v)
17313                            .map_err(|_| {
17314                                ::serde::de::Error::custom(
17315                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17316                                )
17317                            })?;
17318                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
17319                            .ok_or_else(|| {
17320                                ::serde::de::Error::custom(
17321                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17322                                )
17323                            })
17324                    }
17325                    fn visit_u64<E: ::serde::de::Error>(
17326                        self,
17327                        v: u64,
17328                    ) -> ::core::result::Result<JsonFormat, E> {
17329                        let v32 = i32::try_from(v)
17330                            .map_err(|_| {
17331                                ::serde::de::Error::custom(
17332                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17333                                )
17334                            })?;
17335                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
17336                            .ok_or_else(|| {
17337                                ::serde::de::Error::custom(
17338                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17339                                )
17340                            })
17341                    }
17342                    fn visit_unit<E: ::serde::de::Error>(
17343                        self,
17344                    ) -> ::core::result::Result<JsonFormat, E> {
17345                        ::core::result::Result::Ok(::core::default::Default::default())
17346                    }
17347                }
17348                d.deserialize_any(_V)
17349            }
17350        }
17351        impl ::buffa::json_helpers::ProtoElemJson for JsonFormat {
17352            fn serialize_proto_json<S: ::serde::Serializer>(
17353                v: &Self,
17354                s: S,
17355            ) -> ::core::result::Result<S::Ok, S::Error> {
17356                ::serde::Serialize::serialize(v, s)
17357            }
17358            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17359                d: D,
17360            ) -> ::core::result::Result<Self, D::Error> {
17361                <Self as ::serde::Deserialize>::deserialize(d)
17362            }
17363        }
17364    };
17365    impl ::buffa::Enumeration for JsonFormat {
17366        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17367            match value {
17368                0i32 => ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
17369                1i32 => ::core::option::Option::Some(Self::ALLOW),
17370                2i32 => ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT),
17371                _ => ::core::option::Option::None,
17372            }
17373        }
17374        fn to_i32(&self) -> i32 {
17375            *self as i32
17376        }
17377        fn proto_name(&self) -> &'static str {
17378            match self {
17379                Self::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN",
17380                Self::ALLOW => "ALLOW",
17381                Self::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT",
17382            }
17383        }
17384        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17385            match name {
17386                "JSON_FORMAT_UNKNOWN" => {
17387                    ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN)
17388                }
17389                "ALLOW" => ::core::option::Option::Some(Self::ALLOW),
17390                "LEGACY_BEST_EFFORT" => {
17391                    ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT)
17392                }
17393                _ => ::core::option::Option::None,
17394            }
17395        }
17396        fn values() -> &'static [Self] {
17397            &[Self::JSON_FORMAT_UNKNOWN, Self::ALLOW, Self::LEGACY_BEST_EFFORT]
17398        }
17399    }
17400    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17401    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17402    #[repr(i32)]
17403    pub enum EnforceNamingStyle {
17404        ENFORCE_NAMING_STYLE_UNKNOWN = 0i32,
17405        STYLE2024 = 1i32,
17406        STYLE_LEGACY = 2i32,
17407    }
17408    impl EnforceNamingStyle {
17409        ///Idiomatic alias for [`Self::ENFORCE_NAMING_STYLE_UNKNOWN`]; `Debug` prints the variant name.
17410        #[allow(non_upper_case_globals)]
17411        pub const EnforceNamingStyleUnknown: Self = Self::ENFORCE_NAMING_STYLE_UNKNOWN;
17412        ///Idiomatic alias for [`Self::STYLE2024`]; `Debug` prints the variant name.
17413        #[allow(non_upper_case_globals)]
17414        pub const Style2024: Self = Self::STYLE2024;
17415        ///Idiomatic alias for [`Self::STYLE_LEGACY`]; `Debug` prints the variant name.
17416        #[allow(non_upper_case_globals)]
17417        pub const StyleLegacy: Self = Self::STYLE_LEGACY;
17418    }
17419    impl ::core::default::Default for EnforceNamingStyle {
17420        fn default() -> Self {
17421            Self::ENFORCE_NAMING_STYLE_UNKNOWN
17422        }
17423    }
17424    #[cfg(feature = "json")]
17425    const _: () = {
17426        impl ::serde::Serialize for EnforceNamingStyle {
17427            fn serialize<S: ::serde::Serializer>(
17428                &self,
17429                s: S,
17430            ) -> ::core::result::Result<S::Ok, S::Error> {
17431                s.serialize_str(::buffa::Enumeration::proto_name(self))
17432            }
17433        }
17434        impl<'de> ::serde::Deserialize<'de> for EnforceNamingStyle {
17435            fn deserialize<D: ::serde::Deserializer<'de>>(
17436                d: D,
17437            ) -> ::core::result::Result<Self, D::Error> {
17438                struct _V;
17439                impl ::serde::de::Visitor<'_> for _V {
17440                    type Value = EnforceNamingStyle;
17441                    fn expecting(
17442                        &self,
17443                        f: &mut ::core::fmt::Formatter<'_>,
17444                    ) -> ::core::fmt::Result {
17445                        f.write_str(
17446                            concat!(
17447                                "a string, integer, or null for ",
17448                                stringify!(EnforceNamingStyle)
17449                            ),
17450                        )
17451                    }
17452                    fn visit_str<E: ::serde::de::Error>(
17453                        self,
17454                        v: &str,
17455                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17456                        <EnforceNamingStyle as ::buffa::Enumeration>::from_proto_name(v)
17457                            .ok_or_else(|| {
17458                                ::serde::de::Error::unknown_variant(v, &[])
17459                            })
17460                    }
17461                    fn visit_i64<E: ::serde::de::Error>(
17462                        self,
17463                        v: i64,
17464                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17465                        let v32 = i32::try_from(v)
17466                            .map_err(|_| {
17467                                ::serde::de::Error::custom(
17468                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17469                                )
17470                            })?;
17471                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17472                            .ok_or_else(|| {
17473                                ::serde::de::Error::custom(
17474                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17475                                )
17476                            })
17477                    }
17478                    fn visit_u64<E: ::serde::de::Error>(
17479                        self,
17480                        v: u64,
17481                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17482                        let v32 = i32::try_from(v)
17483                            .map_err(|_| {
17484                                ::serde::de::Error::custom(
17485                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17486                                )
17487                            })?;
17488                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
17489                            .ok_or_else(|| {
17490                                ::serde::de::Error::custom(
17491                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17492                                )
17493                            })
17494                    }
17495                    fn visit_unit<E: ::serde::de::Error>(
17496                        self,
17497                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
17498                        ::core::result::Result::Ok(::core::default::Default::default())
17499                    }
17500                }
17501                d.deserialize_any(_V)
17502            }
17503        }
17504        impl ::buffa::json_helpers::ProtoElemJson for EnforceNamingStyle {
17505            fn serialize_proto_json<S: ::serde::Serializer>(
17506                v: &Self,
17507                s: S,
17508            ) -> ::core::result::Result<S::Ok, S::Error> {
17509                ::serde::Serialize::serialize(v, s)
17510            }
17511            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17512                d: D,
17513            ) -> ::core::result::Result<Self, D::Error> {
17514                <Self as ::serde::Deserialize>::deserialize(d)
17515            }
17516        }
17517    };
17518    impl ::buffa::Enumeration for EnforceNamingStyle {
17519        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17520            match value {
17521                0i32 => ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN),
17522                1i32 => ::core::option::Option::Some(Self::STYLE2024),
17523                2i32 => ::core::option::Option::Some(Self::STYLE_LEGACY),
17524                _ => ::core::option::Option::None,
17525            }
17526        }
17527        fn to_i32(&self) -> i32 {
17528            *self as i32
17529        }
17530        fn proto_name(&self) -> &'static str {
17531            match self {
17532                Self::ENFORCE_NAMING_STYLE_UNKNOWN => "ENFORCE_NAMING_STYLE_UNKNOWN",
17533                Self::STYLE2024 => "STYLE2024",
17534                Self::STYLE_LEGACY => "STYLE_LEGACY",
17535            }
17536        }
17537        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17538            match name {
17539                "ENFORCE_NAMING_STYLE_UNKNOWN" => {
17540                    ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN)
17541                }
17542                "STYLE2024" => ::core::option::Option::Some(Self::STYLE2024),
17543                "STYLE_LEGACY" => ::core::option::Option::Some(Self::STYLE_LEGACY),
17544                _ => ::core::option::Option::None,
17545            }
17546        }
17547        fn values() -> &'static [Self] {
17548            &[Self::ENFORCE_NAMING_STYLE_UNKNOWN, Self::STYLE2024, Self::STYLE_LEGACY]
17549        }
17550    }
17551    #[derive(Clone, PartialEq, Default)]
17552    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17553    #[cfg_attr(feature = "json", serde(default))]
17554    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17555    pub struct VisibilityFeature {
17556        #[cfg_attr(feature = "json", serde(skip))]
17557        #[doc(hidden)]
17558        pub __buffa_unknown_fields: ::buffa::UnknownFields,
17559    }
17560    impl ::core::fmt::Debug for VisibilityFeature {
17561        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17562            f.debug_struct("VisibilityFeature").finish()
17563        }
17564    }
17565    impl VisibilityFeature {
17566        /// Protobuf type URL for this message, for use with `Any::pack` and
17567        /// `Any::unpack_if`.
17568        ///
17569        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17570        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17571    }
17572    ::buffa::impl_default_instance!(VisibilityFeature);
17573    impl ::buffa::MessageName for VisibilityFeature {
17574        const PACKAGE: &'static str = "google.protobuf";
17575        const NAME: &'static str = "FeatureSet.VisibilityFeature";
17576        const FULL_NAME: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17577        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
17578    }
17579    impl ::buffa::Message for VisibilityFeature {
17580        /// Returns the total encoded size in bytes.
17581        ///
17582        /// Accumulates in `u64` (which cannot overflow for in-memory
17583        /// data) and saturates to `u32` at return, so a message whose
17584        /// encoded size exceeds the 2 GiB protobuf limit yields a value
17585        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
17586        /// points reject, never a silently wrapped size.
17587        #[allow(clippy::let_and_return)]
17588        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17589            #[allow(unused_imports)]
17590            use ::buffa::Enumeration as _;
17591            let mut size = 0u64;
17592            size += self.__buffa_unknown_fields.encoded_len() as u64;
17593            ::buffa::saturate_size(size)
17594        }
17595        fn write_to(
17596            &self,
17597            _cache: &mut ::buffa::SizeCache,
17598            buf: &mut impl ::buffa::EncodeSink,
17599        ) {
17600            #[allow(unused_imports)]
17601            use ::buffa::Enumeration as _;
17602            self.__buffa_unknown_fields.write_to(buf);
17603        }
17604        fn merge_field(
17605            &mut self,
17606            tag: ::buffa::encoding::Tag,
17607            buf: &mut impl ::buffa::bytes::Buf,
17608            ctx: ::buffa::DecodeContext<'_>,
17609        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
17610            #[allow(unused_imports)]
17611            use ::buffa::bytes::Buf as _;
17612            #[allow(unused_imports)]
17613            use ::buffa::Enumeration as _;
17614            match tag.field_number() {
17615                _ => {
17616                    self.__buffa_unknown_fields
17617                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
17618                }
17619            }
17620            ::core::result::Result::Ok(())
17621        }
17622        fn clear(&mut self) {
17623            self.__buffa_unknown_fields.clear();
17624        }
17625    }
17626    impl ::buffa::ExtensionSet for VisibilityFeature {
17627        const PROTO_FQN: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
17628        fn unknown_fields(&self) -> &::buffa::UnknownFields {
17629            &self.__buffa_unknown_fields
17630        }
17631        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
17632            &mut self.__buffa_unknown_fields
17633        }
17634    }
17635    #[cfg(feature = "text")]
17636    impl ::buffa::text::TextFormat for VisibilityFeature {
17637        fn encode_text(
17638            &self,
17639            enc: &mut ::buffa::text::TextEncoder<'_>,
17640        ) -> ::core::fmt::Result {
17641            #[allow(unused_imports)]
17642            use ::buffa::Enumeration as _;
17643            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
17644            ::core::result::Result::Ok(())
17645        }
17646        fn merge_text(
17647            &mut self,
17648            dec: &mut ::buffa::text::TextDecoder<'_>,
17649        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
17650            #[allow(unused_imports)]
17651            use ::buffa::Enumeration as _;
17652            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
17653                match __name {
17654                    _ => dec.skip_value()?,
17655                }
17656            }
17657            ::core::result::Result::Ok(())
17658        }
17659    }
17660    #[cfg(feature = "json")]
17661    impl ::buffa::json_helpers::ProtoElemJson for VisibilityFeature {
17662        fn serialize_proto_json<S: ::serde::Serializer>(
17663            v: &Self,
17664            s: S,
17665        ) -> ::core::result::Result<S::Ok, S::Error> {
17666            ::serde::Serialize::serialize(v, s)
17667        }
17668        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17669            d: D,
17670        ) -> ::core::result::Result<Self, D::Error> {
17671            <Self as ::serde::Deserialize>::deserialize(d)
17672        }
17673    }
17674    #[cfg(feature = "json")]
17675    #[doc(hidden)]
17676    pub const __VISIBILITY_FEATURE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
17677        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17678        to_json: ::buffa::type_registry::any_to_json::<VisibilityFeature>,
17679        from_json: ::buffa::type_registry::any_from_json::<VisibilityFeature>,
17680        is_wkt: false,
17681    };
17682    #[cfg(feature = "text")]
17683    #[doc(hidden)]
17684    pub const __VISIBILITY_FEATURE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
17685        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
17686        text_encode: ::buffa::type_registry::any_encode_text::<VisibilityFeature>,
17687        text_merge: ::buffa::type_registry::any_merge_text::<VisibilityFeature>,
17688    };
17689    pub mod visibility_feature {
17690        #[allow(unused_imports)]
17691        use super::*;
17692        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17693        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17694        #[repr(i32)]
17695        pub enum DefaultSymbolVisibility {
17696            DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0i32,
17697            /// Default pre-EDITION_2024, all UNSET visibility are export.
17698            EXPORT_ALL = 1i32,
17699            /// All top-level symbols default to export, nested default to local.
17700            EXPORT_TOP_LEVEL = 2i32,
17701            /// All symbols default to local.
17702            LOCAL_ALL = 3i32,
17703            /// All symbols local by default. Nested types cannot be exported.
17704            /// With special case caveat for message { enum {} reserved 1 to max; }
17705            /// This is the recommended setting for new protos.
17706            STRICT = 4i32,
17707        }
17708        impl DefaultSymbolVisibility {
17709            ///Idiomatic alias for [`Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`]; `Debug` prints the variant name.
17710            #[allow(non_upper_case_globals)]
17711            pub const DefaultSymbolVisibilityUnknown: Self = Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
17712            ///Idiomatic alias for [`Self::EXPORT_ALL`]; `Debug` prints the variant name.
17713            #[allow(non_upper_case_globals)]
17714            pub const ExportAll: Self = Self::EXPORT_ALL;
17715            ///Idiomatic alias for [`Self::EXPORT_TOP_LEVEL`]; `Debug` prints the variant name.
17716            #[allow(non_upper_case_globals)]
17717            pub const ExportTopLevel: Self = Self::EXPORT_TOP_LEVEL;
17718            ///Idiomatic alias for [`Self::LOCAL_ALL`]; `Debug` prints the variant name.
17719            #[allow(non_upper_case_globals)]
17720            pub const LocalAll: Self = Self::LOCAL_ALL;
17721            ///Idiomatic alias for [`Self::STRICT`]; `Debug` prints the variant name.
17722            #[allow(non_upper_case_globals)]
17723            pub const Strict: Self = Self::STRICT;
17724        }
17725        impl ::core::default::Default for DefaultSymbolVisibility {
17726            fn default() -> Self {
17727                Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
17728            }
17729        }
17730        #[cfg(feature = "json")]
17731        const _: () = {
17732            impl ::serde::Serialize for DefaultSymbolVisibility {
17733                fn serialize<S: ::serde::Serializer>(
17734                    &self,
17735                    s: S,
17736                ) -> ::core::result::Result<S::Ok, S::Error> {
17737                    s.serialize_str(::buffa::Enumeration::proto_name(self))
17738                }
17739            }
17740            impl<'de> ::serde::Deserialize<'de> for DefaultSymbolVisibility {
17741                fn deserialize<D: ::serde::Deserializer<'de>>(
17742                    d: D,
17743                ) -> ::core::result::Result<Self, D::Error> {
17744                    struct _V;
17745                    impl ::serde::de::Visitor<'_> for _V {
17746                        type Value = DefaultSymbolVisibility;
17747                        fn expecting(
17748                            &self,
17749                            f: &mut ::core::fmt::Formatter<'_>,
17750                        ) -> ::core::fmt::Result {
17751                            f.write_str(
17752                                concat!(
17753                                    "a string, integer, or null for ",
17754                                    stringify!(DefaultSymbolVisibility)
17755                                ),
17756                            )
17757                        }
17758                        fn visit_str<E: ::serde::de::Error>(
17759                            self,
17760                            v: &str,
17761                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17762                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_proto_name(
17763                                    v,
17764                                )
17765                                .ok_or_else(|| {
17766                                    ::serde::de::Error::unknown_variant(v, &[])
17767                                })
17768                        }
17769                        fn visit_i64<E: ::serde::de::Error>(
17770                            self,
17771                            v: i64,
17772                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17773                            let v32 = i32::try_from(v)
17774                                .map_err(|_| {
17775                                    ::serde::de::Error::custom(
17776                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17777                                    )
17778                                })?;
17779                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17780                                    v32,
17781                                )
17782                                .ok_or_else(|| {
17783                                    ::serde::de::Error::custom(
17784                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17785                                    )
17786                                })
17787                        }
17788                        fn visit_u64<E: ::serde::de::Error>(
17789                            self,
17790                            v: u64,
17791                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17792                            let v32 = i32::try_from(v)
17793                                .map_err(|_| {
17794                                    ::serde::de::Error::custom(
17795                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
17796                                    )
17797                                })?;
17798                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
17799                                    v32,
17800                                )
17801                                .ok_or_else(|| {
17802                                    ::serde::de::Error::custom(
17803                                        ::buffa::alloc::format!("unknown enum value {v32}"),
17804                                    )
17805                                })
17806                        }
17807                        fn visit_unit<E: ::serde::de::Error>(
17808                            self,
17809                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
17810                            ::core::result::Result::Ok(
17811                                ::core::default::Default::default(),
17812                            )
17813                        }
17814                    }
17815                    d.deserialize_any(_V)
17816                }
17817            }
17818            impl ::buffa::json_helpers::ProtoElemJson for DefaultSymbolVisibility {
17819                fn serialize_proto_json<S: ::serde::Serializer>(
17820                    v: &Self,
17821                    s: S,
17822                ) -> ::core::result::Result<S::Ok, S::Error> {
17823                    ::serde::Serialize::serialize(v, s)
17824                }
17825                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17826                    d: D,
17827                ) -> ::core::result::Result<Self, D::Error> {
17828                    <Self as ::serde::Deserialize>::deserialize(d)
17829                }
17830            }
17831        };
17832        impl ::buffa::Enumeration for DefaultSymbolVisibility {
17833            fn from_i32(value: i32) -> ::core::option::Option<Self> {
17834                match value {
17835                    0i32 => {
17836                        ::core::option::Option::Some(
17837                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17838                        )
17839                    }
17840                    1i32 => ::core::option::Option::Some(Self::EXPORT_ALL),
17841                    2i32 => ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL),
17842                    3i32 => ::core::option::Option::Some(Self::LOCAL_ALL),
17843                    4i32 => ::core::option::Option::Some(Self::STRICT),
17844                    _ => ::core::option::Option::None,
17845                }
17846            }
17847            fn to_i32(&self) -> i32 {
17848                *self as i32
17849            }
17850            fn proto_name(&self) -> &'static str {
17851                match self {
17852                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => {
17853                        "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"
17854                    }
17855                    Self::EXPORT_ALL => "EXPORT_ALL",
17856                    Self::EXPORT_TOP_LEVEL => "EXPORT_TOP_LEVEL",
17857                    Self::LOCAL_ALL => "LOCAL_ALL",
17858                    Self::STRICT => "STRICT",
17859                }
17860            }
17861            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17862                match name {
17863                    "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => {
17864                        ::core::option::Option::Some(
17865                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17866                        )
17867                    }
17868                    "EXPORT_ALL" => ::core::option::Option::Some(Self::EXPORT_ALL),
17869                    "EXPORT_TOP_LEVEL" => {
17870                        ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL)
17871                    }
17872                    "LOCAL_ALL" => ::core::option::Option::Some(Self::LOCAL_ALL),
17873                    "STRICT" => ::core::option::Option::Some(Self::STRICT),
17874                    _ => ::core::option::Option::None,
17875                }
17876            }
17877            fn values() -> &'static [Self] {
17878                &[
17879                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
17880                    Self::EXPORT_ALL,
17881                    Self::EXPORT_TOP_LEVEL,
17882                    Self::LOCAL_ALL,
17883                    Self::STRICT,
17884                ]
17885            }
17886        }
17887    }
17888    #[cfg(feature = "views")]
17889    #[doc(inline)]
17890    pub use super::__buffa::view::feature_set::VisibilityFeatureView;
17891    #[cfg(feature = "views")]
17892    #[doc(inline)]
17893    pub use super::__buffa::view::feature_set::VisibilityFeatureOwnedView;
17894}
17895/// A compiled specification for the defaults of a set of features.  These
17896/// messages are generated from FeatureSet extensions and can be used to seed
17897/// feature resolution. The resolution with this object becomes a simple search
17898/// for the closest matching edition, followed by proto merges.
17899#[derive(Clone, PartialEq, Default)]
17900#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
17901#[cfg_attr(feature = "json", serde(default))]
17902#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17903pub struct FeatureSetDefaults {
17904    /// Field 1: `defaults`
17905    #[cfg_attr(
17906        feature = "json",
17907        serde(
17908            rename = "defaults",
17909            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
17910            deserialize_with = "::buffa::json_helpers::null_as_default"
17911        )
17912    )]
17913    pub defaults: ::buffa::alloc::vec::Vec<
17914        feature_set_defaults::FeatureSetEditionDefault,
17915    >,
17916    /// The minimum supported edition (inclusive) when this was constructed.
17917    /// Editions before this will not have defaults.
17918    ///
17919    /// Field 4: `minimum_edition`
17920    #[cfg_attr(
17921        feature = "json",
17922        serde(
17923            rename = "minimumEdition",
17924            alias = "minimum_edition",
17925            with = "::buffa::json_helpers::opt_closed_enum",
17926            skip_serializing_if = "::core::option::Option::is_none"
17927        )
17928    )]
17929    pub minimum_edition: ::core::option::Option<Edition>,
17930    /// The maximum known edition (inclusive) when this was constructed. Editions
17931    /// after this will not have reliable defaults.
17932    ///
17933    /// Field 5: `maximum_edition`
17934    #[cfg_attr(
17935        feature = "json",
17936        serde(
17937            rename = "maximumEdition",
17938            alias = "maximum_edition",
17939            with = "::buffa::json_helpers::opt_closed_enum",
17940            skip_serializing_if = "::core::option::Option::is_none"
17941        )
17942    )]
17943    pub maximum_edition: ::core::option::Option<Edition>,
17944    #[cfg_attr(feature = "json", serde(skip))]
17945    #[doc(hidden)]
17946    pub __buffa_unknown_fields: ::buffa::UnknownFields,
17947}
17948impl ::core::fmt::Debug for FeatureSetDefaults {
17949    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17950        f.debug_struct("FeatureSetDefaults")
17951            .field("defaults", &self.defaults)
17952            .field("minimum_edition", &self.minimum_edition)
17953            .field("maximum_edition", &self.maximum_edition)
17954            .finish()
17955    }
17956}
17957impl FeatureSetDefaults {
17958    /// Protobuf type URL for this message, for use with `Any::pack` and
17959    /// `Any::unpack_if`.
17960    ///
17961    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
17962    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
17963}
17964impl FeatureSetDefaults {
17965    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
17966    #[inline]
17967    ///Sets [`Self::minimum_edition`] to `Some(value)`, consuming and returning `self`.
17968    pub fn with_minimum_edition(mut self, value: impl Into<Edition>) -> Self {
17969        self.minimum_edition = Some(value.into());
17970        self
17971    }
17972    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
17973    #[inline]
17974    ///Sets [`Self::maximum_edition`] to `Some(value)`, consuming and returning `self`.
17975    pub fn with_maximum_edition(mut self, value: impl Into<Edition>) -> Self {
17976        self.maximum_edition = Some(value.into());
17977        self
17978    }
17979}
17980::buffa::impl_default_instance!(FeatureSetDefaults);
17981impl ::buffa::MessageName for FeatureSetDefaults {
17982    const PACKAGE: &'static str = "google.protobuf";
17983    const NAME: &'static str = "FeatureSetDefaults";
17984    const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults";
17985    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
17986}
17987impl ::buffa::Message for FeatureSetDefaults {
17988    /// Returns the total encoded size in bytes.
17989    ///
17990    /// Accumulates in `u64` (which cannot overflow for in-memory
17991    /// data) and saturates to `u32` at return, so a message whose
17992    /// encoded size exceeds the 2 GiB protobuf limit yields a value
17993    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
17994    /// points reject, never a silently wrapped size.
17995    #[allow(clippy::let_and_return)]
17996    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
17997        #[allow(unused_imports)]
17998        use ::buffa::Enumeration as _;
17999        let mut size = 0u64;
18000        for v in &self.defaults {
18001            let __slot = __cache.reserve();
18002            let inner_size = v.compute_size(__cache);
18003            __cache.set(__slot, inner_size);
18004            size
18005                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18006                    + inner_size as u64;
18007        }
18008        if let Some(ref v) = self.minimum_edition {
18009            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18010        }
18011        if let Some(ref v) = self.maximum_edition {
18012            size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18013        }
18014        size += self.__buffa_unknown_fields.encoded_len() as u64;
18015        ::buffa::saturate_size(size)
18016    }
18017    fn write_to(
18018        &self,
18019        __cache: &mut ::buffa::SizeCache,
18020        buf: &mut impl ::buffa::EncodeSink,
18021    ) {
18022        #[allow(unused_imports)]
18023        use ::buffa::Enumeration as _;
18024        for v in &self.defaults {
18025            ::buffa::types::put_len_delimited_header(
18026                1u32,
18027                u64::from(__cache.consume_next()),
18028                buf,
18029            );
18030            v.write_to(__cache, buf);
18031        }
18032        if let Some(ref v) = self.minimum_edition {
18033            ::buffa::types::put_int32_field(4u32, v.to_i32(), buf);
18034        }
18035        if let Some(ref v) = self.maximum_edition {
18036            ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
18037        }
18038        self.__buffa_unknown_fields.write_to(buf);
18039    }
18040    fn merge_field(
18041        &mut self,
18042        tag: ::buffa::encoding::Tag,
18043        buf: &mut impl ::buffa::bytes::Buf,
18044        ctx: ::buffa::DecodeContext<'_>,
18045    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18046        #[allow(unused_imports)]
18047        use ::buffa::bytes::Buf as _;
18048        #[allow(unused_imports)]
18049        use ::buffa::Enumeration as _;
18050        match tag.field_number() {
18051            1u32 => {
18052                ::buffa::encoding::check_wire_type(
18053                    tag,
18054                    ::buffa::encoding::WireType::LengthDelimited,
18055                )?;
18056                let mut elem = ::core::default::Default::default();
18057                ctx.register_element_memory(
18058                    ::buffa::__private::element_footprint(&elem),
18059                )?;
18060                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
18061                self.defaults.push(elem);
18062            }
18063            4u32 => {
18064                ::buffa::encoding::check_wire_type(
18065                    tag,
18066                    ::buffa::encoding::WireType::Varint,
18067                )?;
18068                let __raw = ::buffa::types::decode_int32(buf)?;
18069                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18070                    __raw,
18071                ) {
18072                    self.minimum_edition = ::core::option::Option::Some(__v);
18073                } else {
18074                    ctx.register_unknown_field()?;
18075                    self.__buffa_unknown_fields
18076                        .push(::buffa::UnknownField {
18077                            number: 4u32,
18078                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18079                        });
18080                }
18081            }
18082            5u32 => {
18083                ::buffa::encoding::check_wire_type(
18084                    tag,
18085                    ::buffa::encoding::WireType::Varint,
18086                )?;
18087                let __raw = ::buffa::types::decode_int32(buf)?;
18088                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18089                    __raw,
18090                ) {
18091                    self.maximum_edition = ::core::option::Option::Some(__v);
18092                } else {
18093                    ctx.register_unknown_field()?;
18094                    self.__buffa_unknown_fields
18095                        .push(::buffa::UnknownField {
18096                            number: 5u32,
18097                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18098                        });
18099                }
18100            }
18101            _ => {
18102                self.__buffa_unknown_fields
18103                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18104            }
18105        }
18106        ::core::result::Result::Ok(())
18107    }
18108    fn clear(&mut self) {
18109        self.defaults.clear();
18110        self.minimum_edition = ::core::option::Option::None;
18111        self.maximum_edition = ::core::option::Option::None;
18112        self.__buffa_unknown_fields.clear();
18113    }
18114}
18115impl ::buffa::ExtensionSet for FeatureSetDefaults {
18116    const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults";
18117    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18118        &self.__buffa_unknown_fields
18119    }
18120    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18121        &mut self.__buffa_unknown_fields
18122    }
18123}
18124#[cfg(feature = "text")]
18125impl ::buffa::text::TextFormat for FeatureSetDefaults {
18126    fn encode_text(
18127        &self,
18128        enc: &mut ::buffa::text::TextEncoder<'_>,
18129    ) -> ::core::fmt::Result {
18130        #[allow(unused_imports)]
18131        use ::buffa::Enumeration as _;
18132        if let ::core::option::Option::Some(ref __v) = self.minimum_edition {
18133            enc.write_field_name("minimum_edition")?;
18134            enc.write_enum_name(__v.proto_name())?;
18135        }
18136        if let ::core::option::Option::Some(ref __v) = self.maximum_edition {
18137            enc.write_field_name("maximum_edition")?;
18138            enc.write_enum_name(__v.proto_name())?;
18139        }
18140        for __v in &self.defaults {
18141            enc.write_field_name("defaults")?;
18142            enc.write_message(__v)?;
18143        }
18144        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18145        ::core::result::Result::Ok(())
18146    }
18147    fn merge_text(
18148        &mut self,
18149        dec: &mut ::buffa::text::TextDecoder<'_>,
18150    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18151        #[allow(unused_imports)]
18152        use ::buffa::Enumeration as _;
18153        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18154            match __name {
18155                "minimum_edition" => {
18156                    self.minimum_edition = ::core::option::Option::Some(
18157                        dec.read_closed_enum_by_name::<Edition>()?,
18158                    );
18159                }
18160                "maximum_edition" => {
18161                    self.maximum_edition = ::core::option::Option::Some(
18162                        dec.read_closed_enum_by_name::<Edition>()?,
18163                    );
18164                }
18165                "defaults" => {
18166                    dec.read_repeated_into(
18167                        &mut self.defaults,
18168                        |__d| {
18169                            let mut __m = ::core::default::Default::default();
18170                            __d.merge_message(&mut __m)?;
18171                            ::core::result::Result::Ok(__m)
18172                        },
18173                    )?
18174                }
18175                _ => dec.skip_value()?,
18176            }
18177        }
18178        ::core::result::Result::Ok(())
18179    }
18180}
18181#[cfg(feature = "json")]
18182impl ::buffa::json_helpers::ProtoElemJson for FeatureSetDefaults {
18183    fn serialize_proto_json<S: ::serde::Serializer>(
18184        v: &Self,
18185        s: S,
18186    ) -> ::core::result::Result<S::Ok, S::Error> {
18187        ::serde::Serialize::serialize(v, s)
18188    }
18189    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18190        d: D,
18191    ) -> ::core::result::Result<Self, D::Error> {
18192        <Self as ::serde::Deserialize>::deserialize(d)
18193    }
18194}
18195#[cfg(feature = "json")]
18196#[doc(hidden)]
18197pub const __FEATURE_SET_DEFAULTS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18198    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18199    to_json: ::buffa::type_registry::any_to_json::<FeatureSetDefaults>,
18200    from_json: ::buffa::type_registry::any_from_json::<FeatureSetDefaults>,
18201    is_wkt: false,
18202};
18203#[cfg(feature = "text")]
18204#[doc(hidden)]
18205pub const __FEATURE_SET_DEFAULTS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18206    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18207    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetDefaults>,
18208    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetDefaults>,
18209};
18210pub mod feature_set_defaults {
18211    #[allow(unused_imports)]
18212    use super::*;
18213    /// A map from every known edition with a unique set of defaults to its
18214    /// defaults. Not all editions may be contained here.  For a given edition,
18215    /// the defaults at the closest matching edition ordered at or before it should
18216    /// be used.  This field must be in strict ascending order by edition.
18217    #[derive(Clone, PartialEq, Default)]
18218    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18219    #[cfg_attr(feature = "json", serde(default))]
18220    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18221    pub struct FeatureSetEditionDefault {
18222        /// Field 3: `edition`
18223        #[cfg_attr(
18224            feature = "json",
18225            serde(
18226                rename = "edition",
18227                with = "::buffa::json_helpers::opt_closed_enum",
18228                skip_serializing_if = "::core::option::Option::is_none"
18229            )
18230        )]
18231        pub edition: ::core::option::Option<super::Edition>,
18232        /// Defaults of features that can be overridden in this edition.
18233        ///
18234        /// Field 4: `overridable_features`
18235        #[cfg_attr(
18236            feature = "json",
18237            serde(
18238                rename = "overridableFeatures",
18239                alias = "overridable_features",
18240                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18241            )
18242        )]
18243        pub overridable_features: ::buffa::MessageField<
18244            super::FeatureSet,
18245            ::buffa::Inline<super::FeatureSet>,
18246        >,
18247        /// Defaults of features that can't be overridden in this edition.
18248        ///
18249        /// Field 5: `fixed_features`
18250        #[cfg_attr(
18251            feature = "json",
18252            serde(
18253                rename = "fixedFeatures",
18254                alias = "fixed_features",
18255                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18256            )
18257        )]
18258        pub fixed_features: ::buffa::MessageField<
18259            super::FeatureSet,
18260            ::buffa::Inline<super::FeatureSet>,
18261        >,
18262        #[cfg_attr(feature = "json", serde(skip))]
18263        #[doc(hidden)]
18264        pub __buffa_unknown_fields: ::buffa::UnknownFields,
18265    }
18266    impl ::core::fmt::Debug for FeatureSetEditionDefault {
18267        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18268            f.debug_struct("FeatureSetEditionDefault")
18269                .field("edition", &self.edition)
18270                .field("overridable_features", &self.overridable_features)
18271                .field("fixed_features", &self.fixed_features)
18272                .finish()
18273        }
18274    }
18275    impl FeatureSetEditionDefault {
18276        /// Protobuf type URL for this message, for use with `Any::pack` and
18277        /// `Any::unpack_if`.
18278        ///
18279        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18280        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18281    }
18282    impl FeatureSetEditionDefault {
18283        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18284        #[inline]
18285        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
18286        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
18287            self.edition = Some(value.into());
18288            self
18289        }
18290    }
18291    ::buffa::impl_default_instance!(FeatureSetEditionDefault);
18292    impl ::buffa::MessageName for FeatureSetEditionDefault {
18293        const PACKAGE: &'static str = "google.protobuf";
18294        const NAME: &'static str = "FeatureSetDefaults.FeatureSetEditionDefault";
18295        const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18296        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18297    }
18298    impl ::buffa::Message for FeatureSetEditionDefault {
18299        /// Returns the total encoded size in bytes.
18300        ///
18301        /// Accumulates in `u64` (which cannot overflow for in-memory
18302        /// data) and saturates to `u32` at return, so a message whose
18303        /// encoded size exceeds the 2 GiB protobuf limit yields a value
18304        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
18305        /// points reject, never a silently wrapped size.
18306        #[allow(clippy::let_and_return)]
18307        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18308            #[allow(unused_imports)]
18309            use ::buffa::Enumeration as _;
18310            let mut size = 0u64;
18311            if let Some(ref v) = self.edition {
18312                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
18313            }
18314            if self.overridable_features.is_set() {
18315                let __slot = __cache.reserve();
18316                let inner_size = self.overridable_features.compute_size(__cache);
18317                __cache.set(__slot, inner_size);
18318                size
18319                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18320                        + inner_size as u64;
18321            }
18322            if self.fixed_features.is_set() {
18323                let __slot = __cache.reserve();
18324                let inner_size = self.fixed_features.compute_size(__cache);
18325                __cache.set(__slot, inner_size);
18326                size
18327                    += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18328                        + inner_size as u64;
18329            }
18330            size += self.__buffa_unknown_fields.encoded_len() as u64;
18331            ::buffa::saturate_size(size)
18332        }
18333        fn write_to(
18334            &self,
18335            __cache: &mut ::buffa::SizeCache,
18336            buf: &mut impl ::buffa::EncodeSink,
18337        ) {
18338            #[allow(unused_imports)]
18339            use ::buffa::Enumeration as _;
18340            if let Some(ref v) = self.edition {
18341                ::buffa::types::put_int32_field(3u32, v.to_i32(), buf);
18342            }
18343            if self.overridable_features.is_set() {
18344                ::buffa::types::put_len_delimited_header(
18345                    4u32,
18346                    u64::from(__cache.consume_next()),
18347                    buf,
18348                );
18349                self.overridable_features.write_to(__cache, buf);
18350            }
18351            if self.fixed_features.is_set() {
18352                ::buffa::types::put_len_delimited_header(
18353                    5u32,
18354                    u64::from(__cache.consume_next()),
18355                    buf,
18356                );
18357                self.fixed_features.write_to(__cache, buf);
18358            }
18359            self.__buffa_unknown_fields.write_to(buf);
18360        }
18361        fn merge_field(
18362            &mut self,
18363            tag: ::buffa::encoding::Tag,
18364            buf: &mut impl ::buffa::bytes::Buf,
18365            ctx: ::buffa::DecodeContext<'_>,
18366        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18367            #[allow(unused_imports)]
18368            use ::buffa::bytes::Buf as _;
18369            #[allow(unused_imports)]
18370            use ::buffa::Enumeration as _;
18371            match tag.field_number() {
18372                3u32 => {
18373                    ::buffa::encoding::check_wire_type(
18374                        tag,
18375                        ::buffa::encoding::WireType::Varint,
18376                    )?;
18377                    let __raw = ::buffa::types::decode_int32(buf)?;
18378                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18379                        __raw,
18380                    ) {
18381                        self.edition = ::core::option::Option::Some(__v);
18382                    } else {
18383                        ctx.register_unknown_field()?;
18384                        self.__buffa_unknown_fields
18385                            .push(::buffa::UnknownField {
18386                                number: 3u32,
18387                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18388                            });
18389                    }
18390                }
18391                4u32 => {
18392                    ::buffa::encoding::check_wire_type(
18393                        tag,
18394                        ::buffa::encoding::WireType::LengthDelimited,
18395                    )?;
18396                    ::buffa::Message::merge_length_delimited(
18397                        self.overridable_features.get_or_insert_default(),
18398                        buf,
18399                        ctx,
18400                    )?;
18401                }
18402                5u32 => {
18403                    ::buffa::encoding::check_wire_type(
18404                        tag,
18405                        ::buffa::encoding::WireType::LengthDelimited,
18406                    )?;
18407                    ::buffa::Message::merge_length_delimited(
18408                        self.fixed_features.get_or_insert_default(),
18409                        buf,
18410                        ctx,
18411                    )?;
18412                }
18413                _ => {
18414                    self.__buffa_unknown_fields
18415                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18416                }
18417            }
18418            ::core::result::Result::Ok(())
18419        }
18420        fn clear(&mut self) {
18421            self.edition = ::core::option::Option::None;
18422            self.overridable_features = ::buffa::MessageField::none();
18423            self.fixed_features = ::buffa::MessageField::none();
18424            self.__buffa_unknown_fields.clear();
18425        }
18426    }
18427    impl ::buffa::ExtensionSet for FeatureSetEditionDefault {
18428        const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18429        fn unknown_fields(&self) -> &::buffa::UnknownFields {
18430            &self.__buffa_unknown_fields
18431        }
18432        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18433            &mut self.__buffa_unknown_fields
18434        }
18435    }
18436    #[cfg(feature = "text")]
18437    impl ::buffa::text::TextFormat for FeatureSetEditionDefault {
18438        fn encode_text(
18439            &self,
18440            enc: &mut ::buffa::text::TextEncoder<'_>,
18441        ) -> ::core::fmt::Result {
18442            #[allow(unused_imports)]
18443            use ::buffa::Enumeration as _;
18444            if let ::core::option::Option::Some(ref __v) = self.edition {
18445                enc.write_field_name("edition")?;
18446                enc.write_enum_name(__v.proto_name())?;
18447            }
18448            if self.overridable_features.is_set() {
18449                enc.write_field_name("overridable_features")?;
18450                enc.write_message(&*self.overridable_features)?;
18451            }
18452            if self.fixed_features.is_set() {
18453                enc.write_field_name("fixed_features")?;
18454                enc.write_message(&*self.fixed_features)?;
18455            }
18456            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18457            ::core::result::Result::Ok(())
18458        }
18459        fn merge_text(
18460            &mut self,
18461            dec: &mut ::buffa::text::TextDecoder<'_>,
18462        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18463            #[allow(unused_imports)]
18464            use ::buffa::Enumeration as _;
18465            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18466                match __name {
18467                    "edition" => {
18468                        self.edition = ::core::option::Option::Some(
18469                            dec.read_closed_enum_by_name::<super::Edition>()?,
18470                        );
18471                    }
18472                    "overridable_features" => {
18473                        dec.merge_message(
18474                            self.overridable_features.get_or_insert_default(),
18475                        )?
18476                    }
18477                    "fixed_features" => {
18478                        dec.merge_message(self.fixed_features.get_or_insert_default())?
18479                    }
18480                    _ => dec.skip_value()?,
18481                }
18482            }
18483            ::core::result::Result::Ok(())
18484        }
18485    }
18486    #[cfg(feature = "json")]
18487    impl ::buffa::json_helpers::ProtoElemJson for FeatureSetEditionDefault {
18488        fn serialize_proto_json<S: ::serde::Serializer>(
18489            v: &Self,
18490            s: S,
18491        ) -> ::core::result::Result<S::Ok, S::Error> {
18492            ::serde::Serialize::serialize(v, s)
18493        }
18494        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18495            d: D,
18496        ) -> ::core::result::Result<Self, D::Error> {
18497            <Self as ::serde::Deserialize>::deserialize(d)
18498        }
18499    }
18500    #[cfg(feature = "json")]
18501    #[doc(hidden)]
18502    pub const __FEATURE_SET_EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18503        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18504        to_json: ::buffa::type_registry::any_to_json::<FeatureSetEditionDefault>,
18505        from_json: ::buffa::type_registry::any_from_json::<FeatureSetEditionDefault>,
18506        is_wkt: false,
18507    };
18508    #[cfg(feature = "text")]
18509    #[doc(hidden)]
18510    pub const __FEATURE_SET_EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18511        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
18512        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetEditionDefault>,
18513        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetEditionDefault>,
18514    };
18515    #[cfg(feature = "views")]
18516    #[doc(inline)]
18517    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultView;
18518    #[cfg(feature = "views")]
18519    #[doc(inline)]
18520    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultOwnedView;
18521}
18522/// ===================================================================
18523/// Optional source code info
18524///
18525/// Encapsulates information about the original source file from which a
18526/// FileDescriptorProto was generated.
18527#[derive(Clone, PartialEq, Default)]
18528#[cfg_attr(feature = "json", derive(::serde::Serialize))]
18529#[cfg_attr(feature = "json", serde(default))]
18530#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18531pub struct SourceCodeInfo {
18532    /// A Location identifies a piece of source code in a .proto file which
18533    /// corresponds to a particular definition.  This information is intended
18534    /// to be useful to IDEs, code indexers, documentation generators, and similar
18535    /// tools.
18536    ///
18537    /// For example, say we have a file like:
18538    ///   message Foo {
18539    /// ```text
18540    /// optional string foo = 1;
18541    /// ```
18542    ///   }
18543    /// Let's look at just the field definition:
18544    ///   optional string foo = 1;
18545    ///   ^       ^^     ^^  ^  ^^^
18546    ///   a       bc     de  f  ghi
18547    /// We have the following locations:
18548    ///   span   path               represents
18549    ///   \[a,i)  \[ 4, 0, 2, 0 \]     The whole field definition.
18550    ///   \[a,b)  \[ 4, 0, 2, 0, 4 \]  The label (optional).
18551    ///   \[c,d)  \[ 4, 0, 2, 0, 5 \]  The type (string).
18552    ///   \[e,f)  \[ 4, 0, 2, 0, 1 \]  The name (foo).
18553    ///   \[g,h)  \[ 4, 0, 2, 0, 3 \]  The number (1).
18554    ///
18555    /// Notes:
18556    /// - A location may refer to a repeated field itself (i.e. not to any
18557    ///   particular index within it).  This is used whenever a set of elements are
18558    ///   logically enclosed in a single code segment.  For example, an entire
18559    ///   extend block (possibly containing multiple extension definitions) will
18560    ///   have an outer location whose path refers to the "extensions" repeated
18561    ///   field without an index.
18562    /// - Multiple locations may have the same path.  This happens when a single
18563    ///   logical declaration is spread out across multiple places.  The most
18564    ///   obvious example is the "extend" block again -- there may be multiple
18565    ///   extend blocks in the same scope, each of which will have the same path.
18566    /// - A location's span is not always a subset of its parent's span.  For
18567    ///   example, the "extendee" of an extension declaration appears at the
18568    ///   beginning of the "extend" block and is shared by all extensions within
18569    ///   the block.
18570    /// - Just because a location's span is a subset of some other location's span
18571    ///   does not mean that it is a descendant.  For example, a "group" defines
18572    ///   both a type and a field in a single declaration.  Thus, the locations
18573    ///   corresponding to the type and field and their components will overlap.
18574    /// - Code which tries to interpret locations should probably be designed to
18575    ///   ignore those that it doesn't understand, as more types of locations could
18576    ///   be recorded in the future.
18577    ///
18578    /// Field 1: `location`
18579    #[cfg_attr(
18580        feature = "json",
18581        serde(
18582            rename = "location",
18583            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18584            deserialize_with = "::buffa::json_helpers::null_as_default"
18585        )
18586    )]
18587    pub location: ::buffa::alloc::vec::Vec<source_code_info::Location>,
18588    #[cfg_attr(feature = "json", serde(flatten))]
18589    #[doc(hidden)]
18590    pub __buffa_unknown_fields: __SourceCodeInfoExtJson,
18591}
18592impl ::core::fmt::Debug for SourceCodeInfo {
18593    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18594        f.debug_struct("SourceCodeInfo").field("location", &self.location).finish()
18595    }
18596}
18597impl SourceCodeInfo {
18598    /// Protobuf type URL for this message, for use with `Any::pack` and
18599    /// `Any::unpack_if`.
18600    ///
18601    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18602    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18603}
18604::buffa::impl_default_instance!(SourceCodeInfo);
18605impl ::buffa::MessageName for SourceCodeInfo {
18606    const PACKAGE: &'static str = "google.protobuf";
18607    const NAME: &'static str = "SourceCodeInfo";
18608    const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo";
18609    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
18610}
18611impl ::buffa::Message for SourceCodeInfo {
18612    /// Returns the total encoded size in bytes.
18613    ///
18614    /// Accumulates in `u64` (which cannot overflow for in-memory
18615    /// data) and saturates to `u32` at return, so a message whose
18616    /// encoded size exceeds the 2 GiB protobuf limit yields a value
18617    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
18618    /// points reject, never a silently wrapped size.
18619    #[allow(clippy::let_and_return)]
18620    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18621        #[allow(unused_imports)]
18622        use ::buffa::Enumeration as _;
18623        let mut size = 0u64;
18624        for v in &self.location {
18625            let __slot = __cache.reserve();
18626            let inner_size = v.compute_size(__cache);
18627            __cache.set(__slot, inner_size);
18628            size
18629                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
18630                    + inner_size as u64;
18631        }
18632        size += self.__buffa_unknown_fields.encoded_len() as u64;
18633        ::buffa::saturate_size(size)
18634    }
18635    fn write_to(
18636        &self,
18637        __cache: &mut ::buffa::SizeCache,
18638        buf: &mut impl ::buffa::EncodeSink,
18639    ) {
18640        #[allow(unused_imports)]
18641        use ::buffa::Enumeration as _;
18642        for v in &self.location {
18643            ::buffa::types::put_len_delimited_header(
18644                1u32,
18645                u64::from(__cache.consume_next()),
18646                buf,
18647            );
18648            v.write_to(__cache, buf);
18649        }
18650        self.__buffa_unknown_fields.write_to(buf);
18651    }
18652    fn merge_field(
18653        &mut self,
18654        tag: ::buffa::encoding::Tag,
18655        buf: &mut impl ::buffa::bytes::Buf,
18656        ctx: ::buffa::DecodeContext<'_>,
18657    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18658        #[allow(unused_imports)]
18659        use ::buffa::bytes::Buf as _;
18660        #[allow(unused_imports)]
18661        use ::buffa::Enumeration as _;
18662        match tag.field_number() {
18663            1u32 => {
18664                ::buffa::encoding::check_wire_type(
18665                    tag,
18666                    ::buffa::encoding::WireType::LengthDelimited,
18667                )?;
18668                let mut elem = ::core::default::Default::default();
18669                ctx.register_element_memory(
18670                    ::buffa::__private::element_footprint(&elem),
18671                )?;
18672                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
18673                self.location.push(elem);
18674            }
18675            _ => {
18676                self.__buffa_unknown_fields
18677                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
18678            }
18679        }
18680        ::core::result::Result::Ok(())
18681    }
18682    fn clear(&mut self) {
18683        self.location.clear();
18684        self.__buffa_unknown_fields.clear();
18685    }
18686}
18687impl ::buffa::ExtensionSet for SourceCodeInfo {
18688    const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo";
18689    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18690        &self.__buffa_unknown_fields
18691    }
18692    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18693        &mut self.__buffa_unknown_fields
18694    }
18695}
18696#[cfg(feature = "text")]
18697impl ::buffa::text::TextFormat for SourceCodeInfo {
18698    fn encode_text(
18699        &self,
18700        enc: &mut ::buffa::text::TextEncoder<'_>,
18701    ) -> ::core::fmt::Result {
18702        #[allow(unused_imports)]
18703        use ::buffa::Enumeration as _;
18704        for __v in &self.location {
18705            enc.write_field_name("location")?;
18706            enc.write_message(__v)?;
18707        }
18708        enc.write_extension_fields(
18709            "google.protobuf.SourceCodeInfo",
18710            &self.__buffa_unknown_fields,
18711        )?;
18712        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18713        ::core::result::Result::Ok(())
18714    }
18715    fn merge_text(
18716        &mut self,
18717        dec: &mut ::buffa::text::TextDecoder<'_>,
18718    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18719        #[allow(unused_imports)]
18720        use ::buffa::Enumeration as _;
18721        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18722            match __name {
18723                "location" => {
18724                    dec.read_repeated_into(
18725                        &mut self.location,
18726                        |__d| {
18727                            let mut __m = ::core::default::Default::default();
18728                            __d.merge_message(&mut __m)?;
18729                            ::core::result::Result::Ok(__m)
18730                        },
18731                    )?
18732                }
18733                __name if __name.starts_with('[') => {
18734                    for __r in dec
18735                        .read_extension(__name, "google.protobuf.SourceCodeInfo")?
18736                    {
18737                        self.__buffa_unknown_fields.push(__r);
18738                    }
18739                }
18740                _ => dec.skip_value()?,
18741            }
18742        }
18743        ::core::result::Result::Ok(())
18744    }
18745}
18746#[cfg(feature = "json")]
18747impl<'de> serde::Deserialize<'de> for SourceCodeInfo {
18748    fn deserialize<D: serde::Deserializer<'de>>(
18749        d: D,
18750    ) -> ::core::result::Result<Self, D::Error> {
18751        struct _V;
18752        impl<'de> serde::de::Visitor<'de> for _V {
18753            type Value = SourceCodeInfo;
18754            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18755                f.write_str("struct SourceCodeInfo")
18756            }
18757            #[allow(clippy::field_reassign_with_default)]
18758            fn visit_map<A: serde::de::MapAccess<'de>>(
18759                self,
18760                mut map: A,
18761            ) -> ::core::result::Result<SourceCodeInfo, A::Error> {
18762                let mut __f_location: ::core::option::Option<
18763                    ::buffa::alloc::vec::Vec<source_code_info::Location>,
18764                > = None;
18765                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
18766                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
18767                    match key.as_str() {
18768                        "location" => {
18769                            __f_location = Some({
18770                                struct _S;
18771                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
18772                                    type Value = ::buffa::alloc::vec::Vec<
18773                                        source_code_info::Location,
18774                                    >;
18775                                    fn deserialize<D: serde::Deserializer<'de>>(
18776                                        self,
18777                                        d: D,
18778                                    ) -> ::core::result::Result<
18779                                        ::buffa::alloc::vec::Vec<source_code_info::Location>,
18780                                        D::Error,
18781                                    > {
18782                                        ::buffa::json_helpers::null_as_default(d)
18783                                    }
18784                                }
18785                                map.next_value_seed(_S)?
18786                            });
18787                        }
18788                        __k if __k.starts_with('[') => {
18789                            let __v: ::buffa::serde_json::Value = map.next_value()?;
18790                            match ::buffa::extension_registry::deserialize_extension_key(
18791                                "google.protobuf.SourceCodeInfo",
18792                                __k,
18793                                __v,
18794                            ) {
18795                                ::core::option::Option::Some(
18796                                    ::core::result::Result::Ok(__recs),
18797                                ) => {
18798                                    for __rec in __recs {
18799                                        __ext_records.push(__rec);
18800                                    }
18801                                }
18802                                ::core::option::Option::Some(
18803                                    ::core::result::Result::Err(__e),
18804                                ) => {
18805                                    return ::core::result::Result::Err(
18806                                        <A::Error as ::serde::de::Error>::custom(__e),
18807                                    );
18808                                }
18809                                ::core::option::Option::None => {}
18810                            }
18811                        }
18812                        _ => {
18813                            map.next_value::<serde::de::IgnoredAny>()?;
18814                        }
18815                    }
18816                }
18817                let mut __r = <SourceCodeInfo as ::core::default::Default>::default();
18818                if let ::core::option::Option::Some(v) = __f_location {
18819                    __r.location = v;
18820                }
18821                for __rec in __ext_records {
18822                    __r.__buffa_unknown_fields.push(__rec);
18823                }
18824                Ok(__r)
18825            }
18826        }
18827        d.deserialize_map(_V)
18828    }
18829}
18830#[cfg(feature = "json")]
18831impl ::buffa::json_helpers::ProtoElemJson for SourceCodeInfo {
18832    fn serialize_proto_json<S: ::serde::Serializer>(
18833        v: &Self,
18834        s: S,
18835    ) -> ::core::result::Result<S::Ok, S::Error> {
18836        ::serde::Serialize::serialize(v, s)
18837    }
18838    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18839        d: D,
18840    ) -> ::core::result::Result<Self, D::Error> {
18841        <Self as ::serde::Deserialize>::deserialize(d)
18842    }
18843}
18844#[doc(hidden)]
18845#[derive(Clone, Debug, Default, PartialEq)]
18846#[repr(transparent)]
18847#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18848pub struct __SourceCodeInfoExtJson(pub ::buffa::UnknownFields);
18849impl ::core::ops::Deref for __SourceCodeInfoExtJson {
18850    type Target = ::buffa::UnknownFields;
18851    fn deref(&self) -> &::buffa::UnknownFields {
18852        &self.0
18853    }
18854}
18855impl ::core::ops::DerefMut for __SourceCodeInfoExtJson {
18856    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
18857        &mut self.0
18858    }
18859}
18860impl ::core::convert::From<::buffa::UnknownFields> for __SourceCodeInfoExtJson {
18861    fn from(u: ::buffa::UnknownFields) -> Self {
18862        Self(u)
18863    }
18864}
18865#[cfg(feature = "json")]
18866impl ::serde::Serialize for __SourceCodeInfoExtJson {
18867    fn serialize<S: ::serde::Serializer>(
18868        &self,
18869        s: S,
18870    ) -> ::core::result::Result<S::Ok, S::Error> {
18871        ::buffa::extension_registry::serialize_extensions(
18872            "google.protobuf.SourceCodeInfo",
18873            &self.0,
18874            s,
18875        )
18876    }
18877}
18878#[cfg(feature = "json")]
18879impl<'de> ::serde::Deserialize<'de> for __SourceCodeInfoExtJson {
18880    fn deserialize<D: ::serde::Deserializer<'de>>(
18881        d: D,
18882    ) -> ::core::result::Result<Self, D::Error> {
18883        ::buffa::extension_registry::deserialize_extensions(
18884                "google.protobuf.SourceCodeInfo",
18885                d,
18886            )
18887            .map(Self)
18888    }
18889}
18890#[cfg(feature = "json")]
18891#[doc(hidden)]
18892pub const __SOURCE_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18893    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18894    to_json: ::buffa::type_registry::any_to_json::<SourceCodeInfo>,
18895    from_json: ::buffa::type_registry::any_from_json::<SourceCodeInfo>,
18896    is_wkt: false,
18897};
18898#[cfg(feature = "text")]
18899#[doc(hidden)]
18900pub const __SOURCE_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18901    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
18902    text_encode: ::buffa::type_registry::any_encode_text::<SourceCodeInfo>,
18903    text_merge: ::buffa::type_registry::any_merge_text::<SourceCodeInfo>,
18904};
18905pub mod source_code_info {
18906    #[allow(unused_imports)]
18907    use super::*;
18908    #[derive(Clone, PartialEq, Default)]
18909    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18910    #[cfg_attr(feature = "json", serde(default))]
18911    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18912    pub struct Location {
18913        /// Identifies which part of the FileDescriptorProto was defined at this
18914        /// location.
18915        ///
18916        /// Each element is a field number or an index.  They form a path from
18917        /// the root FileDescriptorProto to the place where the definition appears.
18918        /// For example, this path:
18919        ///   \[ 4, 3, 2, 7, 1 \]
18920        /// refers to:
18921        ///   file.message_type(3)  // 4, 3
18922        /// ```text
18923        ///   .field(7)         // 2, 7
18924        ///   .name()           // 1
18925        /// ```
18926        /// This is because FileDescriptorProto.message_type has field number 4:
18927        ///   repeated DescriptorProto message_type = 4;
18928        /// and DescriptorProto.field has field number 2:
18929        ///   repeated FieldDescriptorProto field = 2;
18930        /// and FieldDescriptorProto.name has field number 1:
18931        ///   optional string name = 1;
18932        ///
18933        /// Thus, the above path gives the location of a field name.  If we removed
18934        /// the last element:
18935        ///   \[ 4, 3, 2, 7 \]
18936        /// this path refers to the whole field declaration (from the beginning
18937        /// of the label to the terminating semicolon).
18938        ///
18939        /// Field 1: `path`
18940        #[cfg_attr(
18941            feature = "json",
18942            serde(
18943                rename = "path",
18944                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18945                deserialize_with = "::buffa::json_helpers::null_as_default"
18946            )
18947        )]
18948        pub path: ::buffa::alloc::vec::Vec<i32>,
18949        /// Always has exactly three or four elements: start line, start column,
18950        /// end line (optional, otherwise assumed same as start line), end column.
18951        /// These are packed into a single field for efficiency.  Note that line
18952        /// and column numbers are zero-based -- typically you will want to add
18953        /// 1 to each before displaying to a user.
18954        ///
18955        /// Field 2: `span`
18956        #[cfg_attr(
18957            feature = "json",
18958            serde(
18959                rename = "span",
18960                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18961                deserialize_with = "::buffa::json_helpers::null_as_default"
18962            )
18963        )]
18964        pub span: ::buffa::alloc::vec::Vec<i32>,
18965        /// If this SourceCodeInfo represents a complete declaration, these are any
18966        /// comments appearing before and after the declaration which appear to be
18967        /// attached to the declaration.
18968        ///
18969        /// A series of line comments appearing on consecutive lines, with no other
18970        /// tokens appearing on those lines, will be treated as a single comment.
18971        ///
18972        /// leading_detached_comments will keep paragraphs of comments that appear
18973        /// before (but not connected to) the current element. Each paragraph,
18974        /// separated by empty lines, will be one comment element in the repeated
18975        /// field.
18976        ///
18977        /// Only the comment content is provided; comment markers (e.g. //) are
18978        /// stripped out.  For block comments, leading whitespace and an asterisk
18979        /// will be stripped from the beginning of each line other than the first.
18980        /// Newlines are included in the output.
18981        ///
18982        /// Examples:
18983        ///
18984        ///   optional int32 foo = 1;  // Comment attached to foo.
18985        ///   // Comment attached to bar.
18986        ///   optional int32 bar = 2;
18987        ///
18988        ///   optional string baz = 3;
18989        ///   // Comment attached to baz.
18990        ///   // Another line attached to baz.
18991        ///
18992        ///   // Comment attached to moo.
18993        ///   //
18994        ///   // Another line attached to moo.
18995        ///   optional double moo = 4;
18996        ///
18997        ///   // Detached comment for corge. This is not leading or trailing comments
18998        ///   // to moo or corge because there are blank lines separating it from
18999        ///   // both.
19000        ///
19001        ///   // Detached comment for corge paragraph 2.
19002        ///
19003        ///   optional string corge = 5;
19004        ///   /* Block comment attached
19005        /// ```text
19006        /// * to corge.  Leading asterisks
19007        /// * will be removed. */
19008        /// ```
19009        ///   /* Block comment attached to
19010        /// ```text
19011        /// * grault. */
19012        /// ```
19013        ///   optional int32 grault = 6;
19014        ///
19015        ///   // ignored detached comments.
19016        ///
19017        /// Field 3: `leading_comments`
19018        #[cfg_attr(
19019            feature = "json",
19020            serde(
19021                rename = "leadingComments",
19022                alias = "leading_comments",
19023                skip_serializing_if = "::core::option::Option::is_none"
19024            )
19025        )]
19026        pub leading_comments: ::core::option::Option<::buffa::alloc::string::String>,
19027        /// Field 4: `trailing_comments`
19028        #[cfg_attr(
19029            feature = "json",
19030            serde(
19031                rename = "trailingComments",
19032                alias = "trailing_comments",
19033                skip_serializing_if = "::core::option::Option::is_none"
19034            )
19035        )]
19036        pub trailing_comments: ::core::option::Option<::buffa::alloc::string::String>,
19037        /// Field 6: `leading_detached_comments`
19038        #[cfg_attr(
19039            feature = "json",
19040            serde(
19041                rename = "leadingDetachedComments",
19042                alias = "leading_detached_comments",
19043                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19044                deserialize_with = "::buffa::json_helpers::null_as_default"
19045            )
19046        )]
19047        pub leading_detached_comments: ::buffa::alloc::vec::Vec<
19048            ::buffa::alloc::string::String,
19049        >,
19050        #[cfg_attr(feature = "json", serde(skip))]
19051        #[doc(hidden)]
19052        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19053    }
19054    impl ::core::fmt::Debug for Location {
19055        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19056            f.debug_struct("Location")
19057                .field("path", &self.path)
19058                .field("span", &self.span)
19059                .field("leading_comments", &self.leading_comments)
19060                .field("trailing_comments", &self.trailing_comments)
19061                .field("leading_detached_comments", &self.leading_detached_comments)
19062                .finish()
19063        }
19064    }
19065    impl Location {
19066        /// Protobuf type URL for this message, for use with `Any::pack` and
19067        /// `Any::unpack_if`.
19068        ///
19069        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19070        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19071    }
19072    impl Location {
19073        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19074        #[inline]
19075        ///Sets [`Self::leading_comments`] to `Some(value)`, consuming and returning `self`.
19076        pub fn with_leading_comments(
19077            mut self,
19078            value: impl Into<::buffa::alloc::string::String>,
19079        ) -> Self {
19080            self.leading_comments = Some(value.into());
19081            self
19082        }
19083        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19084        #[inline]
19085        ///Sets [`Self::trailing_comments`] to `Some(value)`, consuming and returning `self`.
19086        pub fn with_trailing_comments(
19087            mut self,
19088            value: impl Into<::buffa::alloc::string::String>,
19089        ) -> Self {
19090            self.trailing_comments = Some(value.into());
19091            self
19092        }
19093    }
19094    ::buffa::impl_default_instance!(Location);
19095    impl ::buffa::MessageName for Location {
19096        const PACKAGE: &'static str = "google.protobuf";
19097        const NAME: &'static str = "SourceCodeInfo.Location";
19098        const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo.Location";
19099        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19100    }
19101    impl ::buffa::Message for Location {
19102        /// Returns the total encoded size in bytes.
19103        ///
19104        /// Accumulates in `u64` (which cannot overflow for in-memory
19105        /// data) and saturates to `u32` at return, so a message whose
19106        /// encoded size exceeds the 2 GiB protobuf limit yields a value
19107        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19108        /// points reject, never a silently wrapped size.
19109        #[allow(clippy::let_and_return)]
19110        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19111            #[allow(unused_imports)]
19112            use ::buffa::Enumeration as _;
19113            let mut size = 0u64;
19114            if !self.path.is_empty() {
19115                let payload: u64 = self
19116                    .path
19117                    .iter()
19118                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19119                    .sum::<u64>();
19120                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19121            }
19122            if !self.span.is_empty() {
19123                let payload: u64 = self
19124                    .span
19125                    .iter()
19126                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19127                    .sum::<u64>();
19128                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19129            }
19130            if let Some(ref v) = self.leading_comments {
19131                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19132            }
19133            if let Some(ref v) = self.trailing_comments {
19134                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19135            }
19136            for v in &self.leading_detached_comments {
19137                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19138            }
19139            size += self.__buffa_unknown_fields.encoded_len() as u64;
19140            ::buffa::saturate_size(size)
19141        }
19142        fn write_to(
19143            &self,
19144            _cache: &mut ::buffa::SizeCache,
19145            buf: &mut impl ::buffa::EncodeSink,
19146        ) {
19147            #[allow(unused_imports)]
19148            use ::buffa::Enumeration as _;
19149            if !self.path.is_empty() {
19150                let payload: u64 = self
19151                    .path
19152                    .iter()
19153                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19154                    .sum::<u64>();
19155                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
19156                for &v in &self.path {
19157                    ::buffa::types::encode_int32(v, buf);
19158                }
19159            }
19160            if !self.span.is_empty() {
19161                let payload: u64 = self
19162                    .span
19163                    .iter()
19164                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19165                    .sum::<u64>();
19166                ::buffa::types::put_len_delimited_header(2u32, payload, buf);
19167                for &v in &self.span {
19168                    ::buffa::types::encode_int32(v, buf);
19169                }
19170            }
19171            if let Some(ref v) = self.leading_comments {
19172                ::buffa::types::put_string_field(3u32, v, buf);
19173            }
19174            if let Some(ref v) = self.trailing_comments {
19175                ::buffa::types::put_string_field(4u32, v, buf);
19176            }
19177            for v in &self.leading_detached_comments {
19178                ::buffa::types::put_string_field(6u32, v, buf);
19179            }
19180            self.__buffa_unknown_fields.write_to(buf);
19181        }
19182        fn merge_field(
19183            &mut self,
19184            tag: ::buffa::encoding::Tag,
19185            buf: &mut impl ::buffa::bytes::Buf,
19186            ctx: ::buffa::DecodeContext<'_>,
19187        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19188            #[allow(unused_imports)]
19189            use ::buffa::bytes::Buf as _;
19190            #[allow(unused_imports)]
19191            use ::buffa::Enumeration as _;
19192            match tag.field_number() {
19193                1u32 => {
19194                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19195                        let len = ::buffa::encoding::decode_varint(buf)?;
19196                        let len = usize::try_from(len)
19197                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19198                        if buf.remaining() < len {
19199                            return ::core::result::Result::Err(
19200                                ::buffa::DecodeError::UnexpectedEof,
19201                            );
19202                        }
19203                        if buf.chunk().len() >= len {
19204                            ::buffa::types::extend_packed_int32(
19205                                &buf.chunk()[..len],
19206                                &mut self.path,
19207                                len,
19208                            )?;
19209                            buf.advance(len);
19210                        } else {
19211                            self.path.reserve(len);
19212                            let mut limited = buf.take(len);
19213                            while limited.has_remaining() {
19214                                self.path
19215                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19216                            }
19217                            let leftover = limited.remaining();
19218                            if leftover > 0 {
19219                                limited.advance(leftover);
19220                            }
19221                        }
19222                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19223                        self.path.push(::buffa::types::decode_int32(buf)?);
19224                    } else {
19225                        return ::core::result::Result::Err(
19226                            ::buffa::encoding::wire_type_mismatch(
19227                                tag,
19228                                ::buffa::encoding::WireType::LengthDelimited,
19229                            ),
19230                        );
19231                    }
19232                }
19233                2u32 => {
19234                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19235                        let len = ::buffa::encoding::decode_varint(buf)?;
19236                        let len = usize::try_from(len)
19237                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19238                        if buf.remaining() < len {
19239                            return ::core::result::Result::Err(
19240                                ::buffa::DecodeError::UnexpectedEof,
19241                            );
19242                        }
19243                        if buf.chunk().len() >= len {
19244                            ::buffa::types::extend_packed_int32(
19245                                &buf.chunk()[..len],
19246                                &mut self.span,
19247                                len,
19248                            )?;
19249                            buf.advance(len);
19250                        } else {
19251                            self.span.reserve(len);
19252                            let mut limited = buf.take(len);
19253                            while limited.has_remaining() {
19254                                self.span
19255                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19256                            }
19257                            let leftover = limited.remaining();
19258                            if leftover > 0 {
19259                                limited.advance(leftover);
19260                            }
19261                        }
19262                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19263                        self.span.push(::buffa::types::decode_int32(buf)?);
19264                    } else {
19265                        return ::core::result::Result::Err(
19266                            ::buffa::encoding::wire_type_mismatch(
19267                                tag,
19268                                ::buffa::encoding::WireType::LengthDelimited,
19269                            ),
19270                        );
19271                    }
19272                }
19273                3u32 => {
19274                    ::buffa::encoding::check_wire_type(
19275                        tag,
19276                        ::buffa::encoding::WireType::LengthDelimited,
19277                    )?;
19278                    ::buffa::types::merge_string(
19279                        self
19280                            .leading_comments
19281                            .get_or_insert_with(::buffa::alloc::string::String::new),
19282                        buf,
19283                    )?;
19284                }
19285                4u32 => {
19286                    ::buffa::encoding::check_wire_type(
19287                        tag,
19288                        ::buffa::encoding::WireType::LengthDelimited,
19289                    )?;
19290                    ::buffa::types::merge_string(
19291                        self
19292                            .trailing_comments
19293                            .get_or_insert_with(::buffa::alloc::string::String::new),
19294                        buf,
19295                    )?;
19296                }
19297                6u32 => {
19298                    ::buffa::encoding::check_wire_type(
19299                        tag,
19300                        ::buffa::encoding::WireType::LengthDelimited,
19301                    )?;
19302                    let __elem = ::buffa::types::decode_string(buf)?;
19303                    ctx.register_element_memory(
19304                        ::buffa::__private::element_footprint(&__elem),
19305                    )?;
19306                    self.leading_detached_comments.push(__elem);
19307                }
19308                _ => {
19309                    self.__buffa_unknown_fields
19310                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19311                }
19312            }
19313            ::core::result::Result::Ok(())
19314        }
19315        fn clear(&mut self) {
19316            self.path.clear();
19317            self.span.clear();
19318            self.leading_comments = ::core::option::Option::None;
19319            self.trailing_comments = ::core::option::Option::None;
19320            self.leading_detached_comments.clear();
19321            self.__buffa_unknown_fields.clear();
19322        }
19323    }
19324    impl ::buffa::ExtensionSet for Location {
19325        const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo.Location";
19326        fn unknown_fields(&self) -> &::buffa::UnknownFields {
19327            &self.__buffa_unknown_fields
19328        }
19329        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19330            &mut self.__buffa_unknown_fields
19331        }
19332    }
19333    #[cfg(feature = "text")]
19334    impl ::buffa::text::TextFormat for Location {
19335        fn encode_text(
19336            &self,
19337            enc: &mut ::buffa::text::TextEncoder<'_>,
19338        ) -> ::core::fmt::Result {
19339            #[allow(unused_imports)]
19340            use ::buffa::Enumeration as _;
19341            if let ::core::option::Option::Some(ref __v) = self.leading_comments {
19342                enc.write_field_name("leading_comments")?;
19343                enc.write_string(__v)?;
19344            }
19345            if let ::core::option::Option::Some(ref __v) = self.trailing_comments {
19346                enc.write_field_name("trailing_comments")?;
19347                enc.write_string(__v)?;
19348            }
19349            for __v in &self.path {
19350                enc.write_field_name("path")?;
19351                enc.write_i32(*__v)?;
19352            }
19353            for __v in &self.span {
19354                enc.write_field_name("span")?;
19355                enc.write_i32(*__v)?;
19356            }
19357            for __v in &self.leading_detached_comments {
19358                enc.write_field_name("leading_detached_comments")?;
19359                enc.write_string(__v)?;
19360            }
19361            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19362            ::core::result::Result::Ok(())
19363        }
19364        fn merge_text(
19365            &mut self,
19366            dec: &mut ::buffa::text::TextDecoder<'_>,
19367        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19368            #[allow(unused_imports)]
19369            use ::buffa::Enumeration as _;
19370            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19371                match __name {
19372                    "leading_comments" => {
19373                        self.leading_comments = ::core::option::Option::Some(
19374                            dec.read_string()?.into_owned(),
19375                        );
19376                    }
19377                    "trailing_comments" => {
19378                        self.trailing_comments = ::core::option::Option::Some(
19379                            dec.read_string()?.into_owned(),
19380                        );
19381                    }
19382                    "path" => {
19383                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
19384                    }
19385                    "span" => {
19386                        dec.read_repeated_into(&mut self.span, |__d| __d.read_i32())?
19387                    }
19388                    "leading_detached_comments" => {
19389                        dec.read_repeated_into(
19390                            &mut self.leading_detached_comments,
19391                            |__d| ::core::result::Result::Ok(
19392                                __d.read_string()?.into_owned(),
19393                            ),
19394                        )?
19395                    }
19396                    _ => dec.skip_value()?,
19397                }
19398            }
19399            ::core::result::Result::Ok(())
19400        }
19401    }
19402    #[cfg(feature = "json")]
19403    impl ::buffa::json_helpers::ProtoElemJson for Location {
19404        fn serialize_proto_json<S: ::serde::Serializer>(
19405            v: &Self,
19406            s: S,
19407        ) -> ::core::result::Result<S::Ok, S::Error> {
19408            ::serde::Serialize::serialize(v, s)
19409        }
19410        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19411            d: D,
19412        ) -> ::core::result::Result<Self, D::Error> {
19413            <Self as ::serde::Deserialize>::deserialize(d)
19414        }
19415    }
19416    #[cfg(feature = "json")]
19417    #[doc(hidden)]
19418    pub const __LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19419        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
19420        to_json: ::buffa::type_registry::any_to_json::<Location>,
19421        from_json: ::buffa::type_registry::any_from_json::<Location>,
19422        is_wkt: false,
19423    };
19424    #[cfg(feature = "text")]
19425    #[doc(hidden)]
19426    pub const __LOCATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19427        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
19428        text_encode: ::buffa::type_registry::any_encode_text::<Location>,
19429        text_merge: ::buffa::type_registry::any_merge_text::<Location>,
19430    };
19431    #[cfg(feature = "views")]
19432    #[doc(inline)]
19433    pub use super::__buffa::view::source_code_info::LocationView;
19434    #[cfg(feature = "views")]
19435    #[doc(inline)]
19436    pub use super::__buffa::view::source_code_info::LocationOwnedView;
19437}
19438/// Describes the relationship between generated code and its original source
19439/// file. A GeneratedCodeInfo message is associated with only one generated
19440/// source file, but may contain references to different source .proto files.
19441#[derive(Clone, PartialEq, Default)]
19442#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19443#[cfg_attr(feature = "json", serde(default))]
19444#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19445pub struct GeneratedCodeInfo {
19446    /// An Annotation connects some span of text in generated code to an element
19447    /// of its generating .proto file.
19448    ///
19449    /// Field 1: `annotation`
19450    #[cfg_attr(
19451        feature = "json",
19452        serde(
19453            rename = "annotation",
19454            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19455            deserialize_with = "::buffa::json_helpers::null_as_default"
19456        )
19457    )]
19458    pub annotation: ::buffa::alloc::vec::Vec<generated_code_info::Annotation>,
19459    #[cfg_attr(feature = "json", serde(skip))]
19460    #[doc(hidden)]
19461    pub __buffa_unknown_fields: ::buffa::UnknownFields,
19462}
19463impl ::core::fmt::Debug for GeneratedCodeInfo {
19464    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19465        f.debug_struct("GeneratedCodeInfo")
19466            .field("annotation", &self.annotation)
19467            .finish()
19468    }
19469}
19470impl GeneratedCodeInfo {
19471    /// Protobuf type URL for this message, for use with `Any::pack` and
19472    /// `Any::unpack_if`.
19473    ///
19474    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19475    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
19476}
19477::buffa::impl_default_instance!(GeneratedCodeInfo);
19478impl ::buffa::MessageName for GeneratedCodeInfo {
19479    const PACKAGE: &'static str = "google.protobuf";
19480    const NAME: &'static str = "GeneratedCodeInfo";
19481    const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo";
19482    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
19483}
19484impl ::buffa::Message for GeneratedCodeInfo {
19485    /// Returns the total encoded size in bytes.
19486    ///
19487    /// Accumulates in `u64` (which cannot overflow for in-memory
19488    /// data) and saturates to `u32` at return, so a message whose
19489    /// encoded size exceeds the 2 GiB protobuf limit yields a value
19490    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19491    /// points reject, never a silently wrapped size.
19492    #[allow(clippy::let_and_return)]
19493    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19494        #[allow(unused_imports)]
19495        use ::buffa::Enumeration as _;
19496        let mut size = 0u64;
19497        for v in &self.annotation {
19498            let __slot = __cache.reserve();
19499            let inner_size = v.compute_size(__cache);
19500            __cache.set(__slot, inner_size);
19501            size
19502                += 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
19503                    + inner_size as u64;
19504        }
19505        size += self.__buffa_unknown_fields.encoded_len() as u64;
19506        ::buffa::saturate_size(size)
19507    }
19508    fn write_to(
19509        &self,
19510        __cache: &mut ::buffa::SizeCache,
19511        buf: &mut impl ::buffa::EncodeSink,
19512    ) {
19513        #[allow(unused_imports)]
19514        use ::buffa::Enumeration as _;
19515        for v in &self.annotation {
19516            ::buffa::types::put_len_delimited_header(
19517                1u32,
19518                u64::from(__cache.consume_next()),
19519                buf,
19520            );
19521            v.write_to(__cache, buf);
19522        }
19523        self.__buffa_unknown_fields.write_to(buf);
19524    }
19525    fn merge_field(
19526        &mut self,
19527        tag: ::buffa::encoding::Tag,
19528        buf: &mut impl ::buffa::bytes::Buf,
19529        ctx: ::buffa::DecodeContext<'_>,
19530    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19531        #[allow(unused_imports)]
19532        use ::buffa::bytes::Buf as _;
19533        #[allow(unused_imports)]
19534        use ::buffa::Enumeration as _;
19535        match tag.field_number() {
19536            1u32 => {
19537                ::buffa::encoding::check_wire_type(
19538                    tag,
19539                    ::buffa::encoding::WireType::LengthDelimited,
19540                )?;
19541                let mut elem = ::core::default::Default::default();
19542                ctx.register_element_memory(
19543                    ::buffa::__private::element_footprint(&elem),
19544                )?;
19545                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
19546                self.annotation.push(elem);
19547            }
19548            _ => {
19549                self.__buffa_unknown_fields
19550                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19551            }
19552        }
19553        ::core::result::Result::Ok(())
19554    }
19555    fn clear(&mut self) {
19556        self.annotation.clear();
19557        self.__buffa_unknown_fields.clear();
19558    }
19559}
19560impl ::buffa::ExtensionSet for GeneratedCodeInfo {
19561    const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo";
19562    fn unknown_fields(&self) -> &::buffa::UnknownFields {
19563        &self.__buffa_unknown_fields
19564    }
19565    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19566        &mut self.__buffa_unknown_fields
19567    }
19568}
19569#[cfg(feature = "text")]
19570impl ::buffa::text::TextFormat for GeneratedCodeInfo {
19571    fn encode_text(
19572        &self,
19573        enc: &mut ::buffa::text::TextEncoder<'_>,
19574    ) -> ::core::fmt::Result {
19575        #[allow(unused_imports)]
19576        use ::buffa::Enumeration as _;
19577        for __v in &self.annotation {
19578            enc.write_field_name("annotation")?;
19579            enc.write_message(__v)?;
19580        }
19581        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19582        ::core::result::Result::Ok(())
19583    }
19584    fn merge_text(
19585        &mut self,
19586        dec: &mut ::buffa::text::TextDecoder<'_>,
19587    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19588        #[allow(unused_imports)]
19589        use ::buffa::Enumeration as _;
19590        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19591            match __name {
19592                "annotation" => {
19593                    dec.read_repeated_into(
19594                        &mut self.annotation,
19595                        |__d| {
19596                            let mut __m = ::core::default::Default::default();
19597                            __d.merge_message(&mut __m)?;
19598                            ::core::result::Result::Ok(__m)
19599                        },
19600                    )?
19601                }
19602                _ => dec.skip_value()?,
19603            }
19604        }
19605        ::core::result::Result::Ok(())
19606    }
19607}
19608#[cfg(feature = "json")]
19609impl ::buffa::json_helpers::ProtoElemJson for GeneratedCodeInfo {
19610    fn serialize_proto_json<S: ::serde::Serializer>(
19611        v: &Self,
19612        s: S,
19613    ) -> ::core::result::Result<S::Ok, S::Error> {
19614        ::serde::Serialize::serialize(v, s)
19615    }
19616    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19617        d: D,
19618    ) -> ::core::result::Result<Self, D::Error> {
19619        <Self as ::serde::Deserialize>::deserialize(d)
19620    }
19621}
19622#[cfg(feature = "json")]
19623#[doc(hidden)]
19624pub const __GENERATED_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19625    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19626    to_json: ::buffa::type_registry::any_to_json::<GeneratedCodeInfo>,
19627    from_json: ::buffa::type_registry::any_from_json::<GeneratedCodeInfo>,
19628    is_wkt: false,
19629};
19630#[cfg(feature = "text")]
19631#[doc(hidden)]
19632pub const __GENERATED_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19633    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
19634    text_encode: ::buffa::type_registry::any_encode_text::<GeneratedCodeInfo>,
19635    text_merge: ::buffa::type_registry::any_merge_text::<GeneratedCodeInfo>,
19636};
19637pub mod generated_code_info {
19638    #[allow(unused_imports)]
19639    use super::*;
19640    #[derive(Clone, PartialEq, Default)]
19641    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19642    #[cfg_attr(feature = "json", serde(default))]
19643    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19644    pub struct Annotation {
19645        /// Identifies the element in the original source .proto file. This field
19646        /// is formatted the same as SourceCodeInfo.Location.path.
19647        ///
19648        /// Field 1: `path`
19649        #[cfg_attr(
19650            feature = "json",
19651            serde(
19652                rename = "path",
19653                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19654                deserialize_with = "::buffa::json_helpers::null_as_default"
19655            )
19656        )]
19657        pub path: ::buffa::alloc::vec::Vec<i32>,
19658        /// Identifies the filesystem path to the original source .proto.
19659        ///
19660        /// Field 2: `source_file`
19661        #[cfg_attr(
19662            feature = "json",
19663            serde(
19664                rename = "sourceFile",
19665                alias = "source_file",
19666                skip_serializing_if = "::core::option::Option::is_none"
19667            )
19668        )]
19669        pub source_file: ::core::option::Option<::buffa::alloc::string::String>,
19670        /// Identifies the starting offset in bytes in the generated code
19671        /// that relates to the identified object.
19672        ///
19673        /// Field 3: `begin`
19674        #[cfg_attr(
19675            feature = "json",
19676            serde(
19677                rename = "begin",
19678                with = "::buffa::json_helpers::opt_int32",
19679                skip_serializing_if = "::core::option::Option::is_none"
19680            )
19681        )]
19682        pub begin: ::core::option::Option<i32>,
19683        /// Identifies the ending offset in bytes in the generated code that
19684        /// relates to the identified object. The end offset should be one past
19685        /// the last relevant byte (so the length of the text = end - begin).
19686        ///
19687        /// Field 4: `end`
19688        #[cfg_attr(
19689            feature = "json",
19690            serde(
19691                rename = "end",
19692                with = "::buffa::json_helpers::opt_int32",
19693                skip_serializing_if = "::core::option::Option::is_none"
19694            )
19695        )]
19696        pub end: ::core::option::Option<i32>,
19697        /// Field 5: `semantic`
19698        #[cfg_attr(
19699            feature = "json",
19700            serde(
19701                rename = "semantic",
19702                with = "::buffa::json_helpers::opt_closed_enum",
19703                skip_serializing_if = "::core::option::Option::is_none"
19704            )
19705        )]
19706        pub semantic: ::core::option::Option<
19707            super::generated_code_info::annotation::Semantic,
19708        >,
19709        #[cfg_attr(feature = "json", serde(skip))]
19710        #[doc(hidden)]
19711        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19712    }
19713    impl ::core::fmt::Debug for Annotation {
19714        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19715            f.debug_struct("Annotation")
19716                .field("path", &self.path)
19717                .field("source_file", &self.source_file)
19718                .field("begin", &self.begin)
19719                .field("end", &self.end)
19720                .field("semantic", &self.semantic)
19721                .finish()
19722        }
19723    }
19724    impl Annotation {
19725        /// Protobuf type URL for this message, for use with `Any::pack` and
19726        /// `Any::unpack_if`.
19727        ///
19728        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19729        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19730    }
19731    impl Annotation {
19732        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19733        #[inline]
19734        ///Sets [`Self::source_file`] to `Some(value)`, consuming and returning `self`.
19735        pub fn with_source_file(
19736            mut self,
19737            value: impl Into<::buffa::alloc::string::String>,
19738        ) -> Self {
19739            self.source_file = Some(value.into());
19740            self
19741        }
19742        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19743        #[inline]
19744        ///Sets [`Self::begin`] to `Some(value)`, consuming and returning `self`.
19745        pub fn with_begin(mut self, value: i32) -> Self {
19746            self.begin = Some(value);
19747            self
19748        }
19749        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19750        #[inline]
19751        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
19752        pub fn with_end(mut self, value: i32) -> Self {
19753            self.end = Some(value);
19754            self
19755        }
19756        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19757        #[inline]
19758        ///Sets [`Self::semantic`] to `Some(value)`, consuming and returning `self`.
19759        pub fn with_semantic(
19760            mut self,
19761            value: impl Into<super::generated_code_info::annotation::Semantic>,
19762        ) -> Self {
19763            self.semantic = Some(value.into());
19764            self
19765        }
19766    }
19767    ::buffa::impl_default_instance!(Annotation);
19768    impl ::buffa::MessageName for Annotation {
19769        const PACKAGE: &'static str = "google.protobuf";
19770        const NAME: &'static str = "GeneratedCodeInfo.Annotation";
19771        const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
19772        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
19773    }
19774    impl ::buffa::Message for Annotation {
19775        /// Returns the total encoded size in bytes.
19776        ///
19777        /// Accumulates in `u64` (which cannot overflow for in-memory
19778        /// data) and saturates to `u32` at return, so a message whose
19779        /// encoded size exceeds the 2 GiB protobuf limit yields a value
19780        /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
19781        /// points reject, never a silently wrapped size.
19782        #[allow(clippy::let_and_return)]
19783        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19784            #[allow(unused_imports)]
19785            use ::buffa::Enumeration as _;
19786            let mut size = 0u64;
19787            if !self.path.is_empty() {
19788                let payload: u64 = self
19789                    .path
19790                    .iter()
19791                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19792                    .sum::<u64>();
19793                size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
19794            }
19795            if let Some(ref v) = self.source_file {
19796                size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
19797            }
19798            if let Some(v) = self.begin {
19799                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
19800            }
19801            if let Some(v) = self.end {
19802                size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
19803            }
19804            if let Some(ref v) = self.semantic {
19805                size += 1u64 + ::buffa::types::int32_encoded_len(v.to_i32()) as u64;
19806            }
19807            size += self.__buffa_unknown_fields.encoded_len() as u64;
19808            ::buffa::saturate_size(size)
19809        }
19810        fn write_to(
19811            &self,
19812            _cache: &mut ::buffa::SizeCache,
19813            buf: &mut impl ::buffa::EncodeSink,
19814        ) {
19815            #[allow(unused_imports)]
19816            use ::buffa::Enumeration as _;
19817            if !self.path.is_empty() {
19818                let payload: u64 = self
19819                    .path
19820                    .iter()
19821                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
19822                    .sum::<u64>();
19823                ::buffa::types::put_len_delimited_header(1u32, payload, buf);
19824                for &v in &self.path {
19825                    ::buffa::types::encode_int32(v, buf);
19826                }
19827            }
19828            if let Some(ref v) = self.source_file {
19829                ::buffa::types::put_string_field(2u32, v, buf);
19830            }
19831            if let Some(v) = self.begin {
19832                ::buffa::types::put_int32_field(3u32, v, buf);
19833            }
19834            if let Some(v) = self.end {
19835                ::buffa::types::put_int32_field(4u32, v, buf);
19836            }
19837            if let Some(ref v) = self.semantic {
19838                ::buffa::types::put_int32_field(5u32, v.to_i32(), buf);
19839            }
19840            self.__buffa_unknown_fields.write_to(buf);
19841        }
19842        fn merge_field(
19843            &mut self,
19844            tag: ::buffa::encoding::Tag,
19845            buf: &mut impl ::buffa::bytes::Buf,
19846            ctx: ::buffa::DecodeContext<'_>,
19847        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19848            #[allow(unused_imports)]
19849            use ::buffa::bytes::Buf as _;
19850            #[allow(unused_imports)]
19851            use ::buffa::Enumeration as _;
19852            match tag.field_number() {
19853                1u32 => {
19854                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19855                        let len = ::buffa::encoding::decode_varint(buf)?;
19856                        let len = usize::try_from(len)
19857                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19858                        if buf.remaining() < len {
19859                            return ::core::result::Result::Err(
19860                                ::buffa::DecodeError::UnexpectedEof,
19861                            );
19862                        }
19863                        if buf.chunk().len() >= len {
19864                            ::buffa::types::extend_packed_int32(
19865                                &buf.chunk()[..len],
19866                                &mut self.path,
19867                                len,
19868                            )?;
19869                            buf.advance(len);
19870                        } else {
19871                            self.path.reserve(len);
19872                            let mut limited = buf.take(len);
19873                            while limited.has_remaining() {
19874                                self.path
19875                                    .push(::buffa::types::decode_int32_packed(&mut limited)?);
19876                            }
19877                            let leftover = limited.remaining();
19878                            if leftover > 0 {
19879                                limited.advance(leftover);
19880                            }
19881                        }
19882                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19883                        self.path.push(::buffa::types::decode_int32(buf)?);
19884                    } else {
19885                        return ::core::result::Result::Err(
19886                            ::buffa::encoding::wire_type_mismatch(
19887                                tag,
19888                                ::buffa::encoding::WireType::LengthDelimited,
19889                            ),
19890                        );
19891                    }
19892                }
19893                2u32 => {
19894                    ::buffa::encoding::check_wire_type(
19895                        tag,
19896                        ::buffa::encoding::WireType::LengthDelimited,
19897                    )?;
19898                    ::buffa::types::merge_string(
19899                        self
19900                            .source_file
19901                            .get_or_insert_with(::buffa::alloc::string::String::new),
19902                        buf,
19903                    )?;
19904                }
19905                3u32 => {
19906                    ::buffa::encoding::check_wire_type(
19907                        tag,
19908                        ::buffa::encoding::WireType::Varint,
19909                    )?;
19910                    self.begin = ::core::option::Option::Some(
19911                        ::buffa::types::decode_int32(buf)?,
19912                    );
19913                }
19914                4u32 => {
19915                    ::buffa::encoding::check_wire_type(
19916                        tag,
19917                        ::buffa::encoding::WireType::Varint,
19918                    )?;
19919                    self.end = ::core::option::Option::Some(
19920                        ::buffa::types::decode_int32(buf)?,
19921                    );
19922                }
19923                5u32 => {
19924                    ::buffa::encoding::check_wire_type(
19925                        tag,
19926                        ::buffa::encoding::WireType::Varint,
19927                    )?;
19928                    let __raw = ::buffa::types::decode_int32(buf)?;
19929                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
19930                        __raw,
19931                    ) {
19932                        self.semantic = ::core::option::Option::Some(__v);
19933                    } else {
19934                        ctx.register_unknown_field()?;
19935                        self.__buffa_unknown_fields
19936                            .push(::buffa::UnknownField {
19937                                number: 5u32,
19938                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
19939                            });
19940                    }
19941                }
19942                _ => {
19943                    self.__buffa_unknown_fields
19944                        .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
19945                }
19946            }
19947            ::core::result::Result::Ok(())
19948        }
19949        fn clear(&mut self) {
19950            self.path.clear();
19951            self.source_file = ::core::option::Option::None;
19952            self.begin = ::core::option::Option::None;
19953            self.end = ::core::option::Option::None;
19954            self.semantic = ::core::option::Option::None;
19955            self.__buffa_unknown_fields.clear();
19956        }
19957    }
19958    impl ::buffa::ExtensionSet for Annotation {
19959        const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
19960        fn unknown_fields(&self) -> &::buffa::UnknownFields {
19961            &self.__buffa_unknown_fields
19962        }
19963        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19964            &mut self.__buffa_unknown_fields
19965        }
19966    }
19967    #[cfg(feature = "text")]
19968    impl ::buffa::text::TextFormat for Annotation {
19969        fn encode_text(
19970            &self,
19971            enc: &mut ::buffa::text::TextEncoder<'_>,
19972        ) -> ::core::fmt::Result {
19973            #[allow(unused_imports)]
19974            use ::buffa::Enumeration as _;
19975            if let ::core::option::Option::Some(ref __v) = self.source_file {
19976                enc.write_field_name("source_file")?;
19977                enc.write_string(__v)?;
19978            }
19979            if let ::core::option::Option::Some(ref __v) = self.begin {
19980                enc.write_field_name("begin")?;
19981                enc.write_i32(*__v)?;
19982            }
19983            if let ::core::option::Option::Some(ref __v) = self.end {
19984                enc.write_field_name("end")?;
19985                enc.write_i32(*__v)?;
19986            }
19987            if let ::core::option::Option::Some(ref __v) = self.semantic {
19988                enc.write_field_name("semantic")?;
19989                enc.write_enum_name(__v.proto_name())?;
19990            }
19991            for __v in &self.path {
19992                enc.write_field_name("path")?;
19993                enc.write_i32(*__v)?;
19994            }
19995            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19996            ::core::result::Result::Ok(())
19997        }
19998        fn merge_text(
19999            &mut self,
20000            dec: &mut ::buffa::text::TextDecoder<'_>,
20001        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
20002            #[allow(unused_imports)]
20003            use ::buffa::Enumeration as _;
20004            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
20005                match __name {
20006                    "source_file" => {
20007                        self.source_file = ::core::option::Option::Some(
20008                            dec.read_string()?.into_owned(),
20009                        );
20010                    }
20011                    "begin" => self.begin = ::core::option::Option::Some(dec.read_i32()?),
20012                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
20013                    "semantic" => {
20014                        self.semantic = ::core::option::Option::Some(
20015                            dec
20016                                .read_closed_enum_by_name::<
20017                                    super::generated_code_info::annotation::Semantic,
20018                                >()?,
20019                        );
20020                    }
20021                    "path" => {
20022                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
20023                    }
20024                    _ => dec.skip_value()?,
20025                }
20026            }
20027            ::core::result::Result::Ok(())
20028        }
20029    }
20030    #[cfg(feature = "json")]
20031    impl ::buffa::json_helpers::ProtoElemJson for Annotation {
20032        fn serialize_proto_json<S: ::serde::Serializer>(
20033            v: &Self,
20034            s: S,
20035        ) -> ::core::result::Result<S::Ok, S::Error> {
20036            ::serde::Serialize::serialize(v, s)
20037        }
20038        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20039            d: D,
20040        ) -> ::core::result::Result<Self, D::Error> {
20041            <Self as ::serde::Deserialize>::deserialize(d)
20042        }
20043    }
20044    #[cfg(feature = "json")]
20045    #[doc(hidden)]
20046    pub const __ANNOTATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
20047        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20048        to_json: ::buffa::type_registry::any_to_json::<Annotation>,
20049        from_json: ::buffa::type_registry::any_from_json::<Annotation>,
20050        is_wkt: false,
20051    };
20052    #[cfg(feature = "text")]
20053    #[doc(hidden)]
20054    pub const __ANNOTATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
20055        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20056        text_encode: ::buffa::type_registry::any_encode_text::<Annotation>,
20057        text_merge: ::buffa::type_registry::any_merge_text::<Annotation>,
20058    };
20059    pub mod annotation {
20060        #[allow(unused_imports)]
20061        use super::*;
20062        /// Represents the identified object's effect on the element in the original
20063        /// .proto file.
20064        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
20065        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
20066        #[repr(i32)]
20067        pub enum Semantic {
20068            /// There is no effect or the effect is indescribable.
20069            NONE = 0i32,
20070            /// The element is set or otherwise mutated.
20071            SET = 1i32,
20072            /// An alias to the element is returned.
20073            ALIAS = 2i32,
20074        }
20075        impl Semantic {
20076            ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
20077            #[allow(non_upper_case_globals)]
20078            pub const None: Self = Self::NONE;
20079            ///Idiomatic alias for [`Self::SET`]; `Debug` prints the variant name.
20080            #[allow(non_upper_case_globals)]
20081            pub const Set: Self = Self::SET;
20082            ///Idiomatic alias for [`Self::ALIAS`]; `Debug` prints the variant name.
20083            #[allow(non_upper_case_globals)]
20084            pub const Alias: Self = Self::ALIAS;
20085        }
20086        impl ::core::default::Default for Semantic {
20087            fn default() -> Self {
20088                Self::NONE
20089            }
20090        }
20091        #[cfg(feature = "json")]
20092        const _: () = {
20093            impl ::serde::Serialize for Semantic {
20094                fn serialize<S: ::serde::Serializer>(
20095                    &self,
20096                    s: S,
20097                ) -> ::core::result::Result<S::Ok, S::Error> {
20098                    s.serialize_str(::buffa::Enumeration::proto_name(self))
20099                }
20100            }
20101            impl<'de> ::serde::Deserialize<'de> for Semantic {
20102                fn deserialize<D: ::serde::Deserializer<'de>>(
20103                    d: D,
20104                ) -> ::core::result::Result<Self, D::Error> {
20105                    struct _V;
20106                    impl ::serde::de::Visitor<'_> for _V {
20107                        type Value = Semantic;
20108                        fn expecting(
20109                            &self,
20110                            f: &mut ::core::fmt::Formatter<'_>,
20111                        ) -> ::core::fmt::Result {
20112                            f.write_str(
20113                                concat!(
20114                                    "a string, integer, or null for ", stringify!(Semantic)
20115                                ),
20116                            )
20117                        }
20118                        fn visit_str<E: ::serde::de::Error>(
20119                            self,
20120                            v: &str,
20121                        ) -> ::core::result::Result<Semantic, E> {
20122                            <Semantic as ::buffa::Enumeration>::from_proto_name(v)
20123                                .ok_or_else(|| {
20124                                    ::serde::de::Error::unknown_variant(v, &[])
20125                                })
20126                        }
20127                        fn visit_i64<E: ::serde::de::Error>(
20128                            self,
20129                            v: i64,
20130                        ) -> ::core::result::Result<Semantic, E> {
20131                            let v32 = i32::try_from(v)
20132                                .map_err(|_| {
20133                                    ::serde::de::Error::custom(
20134                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20135                                    )
20136                                })?;
20137                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20138                                .ok_or_else(|| {
20139                                    ::serde::de::Error::custom(
20140                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20141                                    )
20142                                })
20143                        }
20144                        fn visit_u64<E: ::serde::de::Error>(
20145                            self,
20146                            v: u64,
20147                        ) -> ::core::result::Result<Semantic, E> {
20148                            let v32 = i32::try_from(v)
20149                                .map_err(|_| {
20150                                    ::serde::de::Error::custom(
20151                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20152                                    )
20153                                })?;
20154                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20155                                .ok_or_else(|| {
20156                                    ::serde::de::Error::custom(
20157                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20158                                    )
20159                                })
20160                        }
20161                        fn visit_unit<E: ::serde::de::Error>(
20162                            self,
20163                        ) -> ::core::result::Result<Semantic, E> {
20164                            ::core::result::Result::Ok(
20165                                ::core::default::Default::default(),
20166                            )
20167                        }
20168                    }
20169                    d.deserialize_any(_V)
20170                }
20171            }
20172            impl ::buffa::json_helpers::ProtoElemJson for Semantic {
20173                fn serialize_proto_json<S: ::serde::Serializer>(
20174                    v: &Self,
20175                    s: S,
20176                ) -> ::core::result::Result<S::Ok, S::Error> {
20177                    ::serde::Serialize::serialize(v, s)
20178                }
20179                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20180                    d: D,
20181                ) -> ::core::result::Result<Self, D::Error> {
20182                    <Self as ::serde::Deserialize>::deserialize(d)
20183                }
20184            }
20185        };
20186        impl ::buffa::Enumeration for Semantic {
20187            fn from_i32(value: i32) -> ::core::option::Option<Self> {
20188                match value {
20189                    0i32 => ::core::option::Option::Some(Self::NONE),
20190                    1i32 => ::core::option::Option::Some(Self::SET),
20191                    2i32 => ::core::option::Option::Some(Self::ALIAS),
20192                    _ => ::core::option::Option::None,
20193                }
20194            }
20195            fn to_i32(&self) -> i32 {
20196                *self as i32
20197            }
20198            fn proto_name(&self) -> &'static str {
20199                match self {
20200                    Self::NONE => "NONE",
20201                    Self::SET => "SET",
20202                    Self::ALIAS => "ALIAS",
20203                }
20204            }
20205            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
20206                match name {
20207                    "NONE" => ::core::option::Option::Some(Self::NONE),
20208                    "SET" => ::core::option::Option::Some(Self::SET),
20209                    "ALIAS" => ::core::option::Option::Some(Self::ALIAS),
20210                    _ => ::core::option::Option::None,
20211                }
20212            }
20213            fn values() -> &'static [Self] {
20214                &[Self::NONE, Self::SET, Self::ALIAS]
20215            }
20216        }
20217    }
20218    #[cfg(feature = "views")]
20219    #[doc(inline)]
20220    pub use super::__buffa::view::generated_code_info::AnnotationView;
20221    #[cfg(feature = "views")]
20222    #[doc(inline)]
20223    pub use super::__buffa::view::generated_code_info::AnnotationOwnedView;
20224}