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}
444impl ::buffa::DefaultInstance for FileDescriptorSet {
445    fn default_instance() -> &'static Self {
446        static VALUE: ::buffa::__private::OnceBox<FileDescriptorSet> = ::buffa::__private::OnceBox::new();
447        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
448    }
449}
450impl ::buffa::MessageName for FileDescriptorSet {
451    const PACKAGE: &'static str = "google.protobuf";
452    const NAME: &'static str = "FileDescriptorSet";
453    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorSet";
454    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
455}
456impl ::buffa::Message for FileDescriptorSet {
457    /// Returns the total encoded size in bytes.
458    ///
459    /// The result is a `u32`; the protobuf specification requires all
460    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
461    /// compliant message will never overflow this type.
462    #[allow(clippy::let_and_return)]
463    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
464        #[allow(unused_imports)]
465        use ::buffa::Enumeration as _;
466        let mut size = 0u32;
467        for v in &self.file {
468            let __slot = __cache.reserve();
469            let inner_size = v.compute_size(__cache);
470            __cache.set(__slot, inner_size);
471            size
472                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
473                    + inner_size;
474        }
475        size += self.__buffa_unknown_fields.encoded_len() as u32;
476        size
477    }
478    fn write_to(
479        &self,
480        __cache: &mut ::buffa::SizeCache,
481        buf: &mut impl ::buffa::bytes::BufMut,
482    ) {
483        #[allow(unused_imports)]
484        use ::buffa::Enumeration as _;
485        for v in &self.file {
486            ::buffa::encoding::Tag::new(
487                    1u32,
488                    ::buffa::encoding::WireType::LengthDelimited,
489                )
490                .encode(buf);
491            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
492            v.write_to(__cache, buf);
493        }
494        self.__buffa_unknown_fields.write_to(buf);
495    }
496    fn merge_field(
497        &mut self,
498        tag: ::buffa::encoding::Tag,
499        buf: &mut impl ::buffa::bytes::Buf,
500        depth: u32,
501    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
502        #[allow(unused_imports)]
503        use ::buffa::bytes::Buf as _;
504        #[allow(unused_imports)]
505        use ::buffa::Enumeration as _;
506        match tag.field_number() {
507            1u32 => {
508                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
509                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
510                        field_number: 1u32,
511                        expected: 2u8,
512                        actual: tag.wire_type() as u8,
513                    });
514                }
515                let mut elem = ::core::default::Default::default();
516                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
517                self.file.push(elem);
518            }
519            _ => {
520                self.__buffa_unknown_fields
521                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
522            }
523        }
524        ::core::result::Result::Ok(())
525    }
526    fn clear(&mut self) {
527        self.file.clear();
528        self.__buffa_unknown_fields.clear();
529    }
530}
531impl ::buffa::ExtensionSet for FileDescriptorSet {
532    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorSet";
533    fn unknown_fields(&self) -> &::buffa::UnknownFields {
534        &self.__buffa_unknown_fields
535    }
536    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
537        &mut self.__buffa_unknown_fields
538    }
539}
540#[cfg(feature = "text")]
541impl ::buffa::text::TextFormat for FileDescriptorSet {
542    fn encode_text(
543        &self,
544        enc: &mut ::buffa::text::TextEncoder<'_>,
545    ) -> ::core::fmt::Result {
546        #[allow(unused_imports)]
547        use ::buffa::Enumeration as _;
548        for __v in &self.file {
549            enc.write_field_name("file")?;
550            enc.write_message(__v)?;
551        }
552        enc.write_extension_fields(
553            "google.protobuf.FileDescriptorSet",
554            &self.__buffa_unknown_fields,
555        )?;
556        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
557        ::core::result::Result::Ok(())
558    }
559    fn merge_text(
560        &mut self,
561        dec: &mut ::buffa::text::TextDecoder<'_>,
562    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
563        #[allow(unused_imports)]
564        use ::buffa::Enumeration as _;
565        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
566            match __name {
567                "file" => {
568                    dec.read_repeated_into(
569                        &mut self.file,
570                        |__d| {
571                            let mut __m = ::core::default::Default::default();
572                            __d.merge_message(&mut __m)?;
573                            ::core::result::Result::Ok(__m)
574                        },
575                    )?
576                }
577                __name if __name.starts_with('[') => {
578                    for __r in dec
579                        .read_extension(__name, "google.protobuf.FileDescriptorSet")?
580                    {
581                        self.__buffa_unknown_fields.push(__r);
582                    }
583                }
584                _ => dec.skip_value()?,
585            }
586        }
587        ::core::result::Result::Ok(())
588    }
589}
590#[cfg(feature = "json")]
591impl<'de> serde::Deserialize<'de> for FileDescriptorSet {
592    fn deserialize<D: serde::Deserializer<'de>>(
593        d: D,
594    ) -> ::core::result::Result<Self, D::Error> {
595        struct _V;
596        impl<'de> serde::de::Visitor<'de> for _V {
597            type Value = FileDescriptorSet;
598            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
599                f.write_str("struct FileDescriptorSet")
600            }
601            #[allow(clippy::field_reassign_with_default)]
602            fn visit_map<A: serde::de::MapAccess<'de>>(
603                self,
604                mut map: A,
605            ) -> ::core::result::Result<FileDescriptorSet, A::Error> {
606                let mut __f_file: ::core::option::Option<
607                    ::buffa::alloc::vec::Vec<FileDescriptorProto>,
608                > = None;
609                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
610                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
611                    match key.as_str() {
612                        "file" => {
613                            __f_file = Some({
614                                struct _S;
615                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
616                                    type Value = ::buffa::alloc::vec::Vec<FileDescriptorProto>;
617                                    fn deserialize<D: serde::Deserializer<'de>>(
618                                        self,
619                                        d: D,
620                                    ) -> ::core::result::Result<
621                                        ::buffa::alloc::vec::Vec<FileDescriptorProto>,
622                                        D::Error,
623                                    > {
624                                        ::buffa::json_helpers::null_as_default(d)
625                                    }
626                                }
627                                map.next_value_seed(_S)?
628                            });
629                        }
630                        __k if __k.starts_with('[') => {
631                            let __v: ::buffa::serde_json::Value = map.next_value()?;
632                            match ::buffa::extension_registry::deserialize_extension_key(
633                                "google.protobuf.FileDescriptorSet",
634                                __k,
635                                __v,
636                            ) {
637                                ::core::option::Option::Some(
638                                    ::core::result::Result::Ok(__recs),
639                                ) => {
640                                    for __rec in __recs {
641                                        __ext_records.push(__rec);
642                                    }
643                                }
644                                ::core::option::Option::Some(
645                                    ::core::result::Result::Err(__e),
646                                ) => {
647                                    return ::core::result::Result::Err(
648                                        <A::Error as ::serde::de::Error>::custom(__e),
649                                    );
650                                }
651                                ::core::option::Option::None => {}
652                            }
653                        }
654                        _ => {
655                            map.next_value::<serde::de::IgnoredAny>()?;
656                        }
657                    }
658                }
659                let mut __r = <FileDescriptorSet as ::core::default::Default>::default();
660                if let ::core::option::Option::Some(v) = __f_file {
661                    __r.file = v;
662                }
663                for __rec in __ext_records {
664                    __r.__buffa_unknown_fields.push(__rec);
665                }
666                Ok(__r)
667            }
668        }
669        d.deserialize_map(_V)
670    }
671}
672#[cfg(feature = "json")]
673impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorSet {
674    fn serialize_proto_json<S: ::serde::Serializer>(
675        v: &Self,
676        s: S,
677    ) -> ::core::result::Result<S::Ok, S::Error> {
678        ::serde::Serialize::serialize(v, s)
679    }
680    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
681        d: D,
682    ) -> ::core::result::Result<Self, D::Error> {
683        <Self as ::serde::Deserialize>::deserialize(d)
684    }
685}
686#[doc(hidden)]
687#[derive(Clone, Debug, Default, PartialEq)]
688#[repr(transparent)]
689#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
690pub struct __FileDescriptorSetExtJson(pub ::buffa::UnknownFields);
691impl ::core::ops::Deref for __FileDescriptorSetExtJson {
692    type Target = ::buffa::UnknownFields;
693    fn deref(&self) -> &::buffa::UnknownFields {
694        &self.0
695    }
696}
697impl ::core::ops::DerefMut for __FileDescriptorSetExtJson {
698    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
699        &mut self.0
700    }
701}
702impl ::core::convert::From<::buffa::UnknownFields> for __FileDescriptorSetExtJson {
703    fn from(u: ::buffa::UnknownFields) -> Self {
704        Self(u)
705    }
706}
707#[cfg(feature = "json")]
708impl ::serde::Serialize for __FileDescriptorSetExtJson {
709    fn serialize<S: ::serde::Serializer>(
710        &self,
711        s: S,
712    ) -> ::core::result::Result<S::Ok, S::Error> {
713        ::buffa::extension_registry::serialize_extensions(
714            "google.protobuf.FileDescriptorSet",
715            &self.0,
716            s,
717        )
718    }
719}
720#[cfg(feature = "json")]
721impl<'de> ::serde::Deserialize<'de> for __FileDescriptorSetExtJson {
722    fn deserialize<D: ::serde::Deserializer<'de>>(
723        d: D,
724    ) -> ::core::result::Result<Self, D::Error> {
725        ::buffa::extension_registry::deserialize_extensions(
726                "google.protobuf.FileDescriptorSet",
727                d,
728            )
729            .map(Self)
730    }
731}
732#[cfg(feature = "json")]
733#[doc(hidden)]
734pub const __FILE_DESCRIPTOR_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
735    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
736    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorSet>,
737    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorSet>,
738    is_wkt: false,
739};
740#[cfg(feature = "text")]
741#[doc(hidden)]
742pub const __FILE_DESCRIPTOR_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
743    type_url: "type.googleapis.com/google.protobuf.FileDescriptorSet",
744    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorSet>,
745    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorSet>,
746};
747/// Describes a complete .proto file.
748#[derive(Clone, PartialEq, Default)]
749#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
750#[cfg_attr(feature = "json", serde(default))]
751#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
752pub struct FileDescriptorProto {
753    /// file name, relative to root of source tree
754    ///
755    /// Field 1: `name`
756    #[cfg_attr(
757        feature = "json",
758        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
759    )]
760    pub name: ::core::option::Option<::buffa::alloc::string::String>,
761    /// e.g. "foo", "foo.bar", etc.
762    ///
763    /// Field 2: `package`
764    #[cfg_attr(
765        feature = "json",
766        serde(
767            rename = "package",
768            skip_serializing_if = "::core::option::Option::is_none"
769        )
770    )]
771    pub package: ::core::option::Option<::buffa::alloc::string::String>,
772    /// Names of files imported by this file.
773    ///
774    /// Field 3: `dependency`
775    #[cfg_attr(
776        feature = "json",
777        serde(
778            rename = "dependency",
779            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
780            deserialize_with = "::buffa::json_helpers::null_as_default"
781        )
782    )]
783    pub dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
784    /// Indexes of the public imported files in the dependency list above.
785    ///
786    /// Field 10: `public_dependency`
787    #[cfg_attr(
788        feature = "json",
789        serde(
790            rename = "publicDependency",
791            alias = "public_dependency",
792            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
793            deserialize_with = "::buffa::json_helpers::null_as_default"
794        )
795    )]
796    pub public_dependency: ::buffa::alloc::vec::Vec<i32>,
797    /// Indexes of the weak imported files in the dependency list.
798    /// For Google-internal migration only. Do not use.
799    ///
800    /// Field 11: `weak_dependency`
801    #[cfg_attr(
802        feature = "json",
803        serde(
804            rename = "weakDependency",
805            alias = "weak_dependency",
806            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
807            deserialize_with = "::buffa::json_helpers::null_as_default"
808        )
809    )]
810    pub weak_dependency: ::buffa::alloc::vec::Vec<i32>,
811    /// Names of files imported by this file purely for the purpose of providing
812    /// option extensions. These are excluded from the dependency list above.
813    ///
814    /// Field 15: `option_dependency`
815    #[cfg_attr(
816        feature = "json",
817        serde(
818            rename = "optionDependency",
819            alias = "option_dependency",
820            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
821            deserialize_with = "::buffa::json_helpers::null_as_default"
822        )
823    )]
824    pub option_dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
825    /// All top-level definitions in this file.
826    ///
827    /// Field 4: `message_type`
828    #[cfg_attr(
829        feature = "json",
830        serde(
831            rename = "messageType",
832            alias = "message_type",
833            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
834            deserialize_with = "::buffa::json_helpers::null_as_default"
835        )
836    )]
837    pub message_type: ::buffa::alloc::vec::Vec<DescriptorProto>,
838    /// Field 5: `enum_type`
839    #[cfg_attr(
840        feature = "json",
841        serde(
842            rename = "enumType",
843            alias = "enum_type",
844            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
845            deserialize_with = "::buffa::json_helpers::null_as_default"
846        )
847    )]
848    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
849    /// Field 6: `service`
850    #[cfg_attr(
851        feature = "json",
852        serde(
853            rename = "service",
854            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
855            deserialize_with = "::buffa::json_helpers::null_as_default"
856        )
857    )]
858    pub service: ::buffa::alloc::vec::Vec<ServiceDescriptorProto>,
859    /// Field 7: `extension`
860    #[cfg_attr(
861        feature = "json",
862        serde(
863            rename = "extension",
864            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
865            deserialize_with = "::buffa::json_helpers::null_as_default"
866        )
867    )]
868    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
869    /// Field 8: `options`
870    #[cfg_attr(
871        feature = "json",
872        serde(
873            rename = "options",
874            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
875        )
876    )]
877    pub options: ::buffa::MessageField<FileOptions>,
878    /// This field contains optional information about the original source code.
879    /// You may safely remove this entire field without harming runtime
880    /// functionality of the descriptors -- the information is needed only by
881    /// development tools.
882    ///
883    /// Field 9: `source_code_info`
884    #[cfg_attr(
885        feature = "json",
886        serde(
887            rename = "sourceCodeInfo",
888            alias = "source_code_info",
889            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
890        )
891    )]
892    pub source_code_info: ::buffa::MessageField<SourceCodeInfo>,
893    /// The syntax of the proto file.
894    /// The supported values are "proto2", "proto3", and "editions".
895    ///
896    /// If `edition` is present, this value must be "editions".
897    /// WARNING: This field should only be used by protobuf plugins or special
898    /// cases like the proto compiler. Other uses are discouraged and
899    /// developers should rely on the protoreflect APIs for their client language.
900    ///
901    /// Field 12: `syntax`
902    #[cfg_attr(
903        feature = "json",
904        serde(rename = "syntax", skip_serializing_if = "::core::option::Option::is_none")
905    )]
906    pub syntax: ::core::option::Option<::buffa::alloc::string::String>,
907    /// The edition of the proto file.
908    /// WARNING: This field should only be used by protobuf plugins or special
909    /// cases like the proto compiler. Other uses are discouraged and
910    /// developers should rely on the protoreflect APIs for their client language.
911    ///
912    /// Field 14: `edition`
913    #[cfg_attr(
914        feature = "json",
915        serde(
916            rename = "edition",
917            with = "::buffa::json_helpers::opt_closed_enum",
918            skip_serializing_if = "::core::option::Option::is_none"
919        )
920    )]
921    pub edition: ::core::option::Option<Edition>,
922    #[cfg_attr(feature = "json", serde(skip))]
923    #[doc(hidden)]
924    pub __buffa_unknown_fields: ::buffa::UnknownFields,
925}
926impl ::core::fmt::Debug for FileDescriptorProto {
927    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
928        f.debug_struct("FileDescriptorProto")
929            .field("name", &self.name)
930            .field("package", &self.package)
931            .field("dependency", &self.dependency)
932            .field("public_dependency", &self.public_dependency)
933            .field("weak_dependency", &self.weak_dependency)
934            .field("option_dependency", &self.option_dependency)
935            .field("message_type", &self.message_type)
936            .field("enum_type", &self.enum_type)
937            .field("service", &self.service)
938            .field("extension", &self.extension)
939            .field("options", &self.options)
940            .field("source_code_info", &self.source_code_info)
941            .field("syntax", &self.syntax)
942            .field("edition", &self.edition)
943            .finish()
944    }
945}
946impl FileDescriptorProto {
947    /// Protobuf type URL for this message, for use with `Any::pack` and
948    /// `Any::unpack_if`.
949    ///
950    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
951    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
952}
953impl FileDescriptorProto {
954    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
955    #[inline]
956    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
957    pub fn with_name(
958        mut self,
959        value: impl Into<::buffa::alloc::string::String>,
960    ) -> Self {
961        self.name = Some(value.into());
962        self
963    }
964    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
965    #[inline]
966    ///Sets [`Self::package`] to `Some(value)`, consuming and returning `self`.
967    pub fn with_package(
968        mut self,
969        value: impl Into<::buffa::alloc::string::String>,
970    ) -> Self {
971        self.package = Some(value.into());
972        self
973    }
974    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
975    #[inline]
976    ///Sets [`Self::syntax`] to `Some(value)`, consuming and returning `self`.
977    pub fn with_syntax(
978        mut self,
979        value: impl Into<::buffa::alloc::string::String>,
980    ) -> Self {
981        self.syntax = Some(value.into());
982        self
983    }
984    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
985    #[inline]
986    ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
987    pub fn with_edition(mut self, value: impl Into<Edition>) -> Self {
988        self.edition = Some(value.into());
989        self
990    }
991}
992impl ::buffa::DefaultInstance for FileDescriptorProto {
993    fn default_instance() -> &'static Self {
994        static VALUE: ::buffa::__private::OnceBox<FileDescriptorProto> = ::buffa::__private::OnceBox::new();
995        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
996    }
997}
998impl ::buffa::MessageName for FileDescriptorProto {
999    const PACKAGE: &'static str = "google.protobuf";
1000    const NAME: &'static str = "FileDescriptorProto";
1001    const FULL_NAME: &'static str = "google.protobuf.FileDescriptorProto";
1002    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
1003}
1004impl ::buffa::Message for FileDescriptorProto {
1005    /// Returns the total encoded size in bytes.
1006    ///
1007    /// The result is a `u32`; the protobuf specification requires all
1008    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1009    /// compliant message will never overflow this type.
1010    #[allow(clippy::let_and_return)]
1011    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1012        #[allow(unused_imports)]
1013        use ::buffa::Enumeration as _;
1014        let mut size = 0u32;
1015        if let Some(ref v) = self.name {
1016            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1017        }
1018        if let Some(ref v) = self.package {
1019            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1020        }
1021        for v in &self.dependency {
1022            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1023        }
1024        for v in &self.message_type {
1025            let __slot = __cache.reserve();
1026            let inner_size = v.compute_size(__cache);
1027            __cache.set(__slot, inner_size);
1028            size
1029                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1030                    + inner_size;
1031        }
1032        for v in &self.enum_type {
1033            let __slot = __cache.reserve();
1034            let inner_size = v.compute_size(__cache);
1035            __cache.set(__slot, inner_size);
1036            size
1037                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1038                    + inner_size;
1039        }
1040        for v in &self.service {
1041            let __slot = __cache.reserve();
1042            let inner_size = v.compute_size(__cache);
1043            __cache.set(__slot, inner_size);
1044            size
1045                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1046                    + inner_size;
1047        }
1048        for v in &self.extension {
1049            let __slot = __cache.reserve();
1050            let inner_size = v.compute_size(__cache);
1051            __cache.set(__slot, inner_size);
1052            size
1053                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1054                    + inner_size;
1055        }
1056        if self.options.is_set() {
1057            let __slot = __cache.reserve();
1058            let inner_size = self.options.compute_size(__cache);
1059            __cache.set(__slot, inner_size);
1060            size
1061                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1062                    + inner_size;
1063        }
1064        if self.source_code_info.is_set() {
1065            let __slot = __cache.reserve();
1066            let inner_size = self.source_code_info.compute_size(__cache);
1067            __cache.set(__slot, inner_size);
1068            size
1069                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1070                    + inner_size;
1071        }
1072        for v in &self.public_dependency {
1073            size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
1074        }
1075        for v in &self.weak_dependency {
1076            size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
1077        }
1078        if let Some(ref v) = self.syntax {
1079            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1080        }
1081        if let Some(ref v) = self.edition {
1082            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
1083        }
1084        for v in &self.option_dependency {
1085            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1086        }
1087        size += self.__buffa_unknown_fields.encoded_len() as u32;
1088        size
1089    }
1090    fn write_to(
1091        &self,
1092        __cache: &mut ::buffa::SizeCache,
1093        buf: &mut impl ::buffa::bytes::BufMut,
1094    ) {
1095        #[allow(unused_imports)]
1096        use ::buffa::Enumeration as _;
1097        if let Some(ref v) = self.name {
1098            ::buffa::encoding::Tag::new(
1099                    1u32,
1100                    ::buffa::encoding::WireType::LengthDelimited,
1101                )
1102                .encode(buf);
1103            ::buffa::types::encode_string(v, buf);
1104        }
1105        if let Some(ref v) = self.package {
1106            ::buffa::encoding::Tag::new(
1107                    2u32,
1108                    ::buffa::encoding::WireType::LengthDelimited,
1109                )
1110                .encode(buf);
1111            ::buffa::types::encode_string(v, buf);
1112        }
1113        for v in &self.dependency {
1114            ::buffa::encoding::Tag::new(
1115                    3u32,
1116                    ::buffa::encoding::WireType::LengthDelimited,
1117                )
1118                .encode(buf);
1119            ::buffa::types::encode_string(v, buf);
1120        }
1121        for v in &self.message_type {
1122            ::buffa::encoding::Tag::new(
1123                    4u32,
1124                    ::buffa::encoding::WireType::LengthDelimited,
1125                )
1126                .encode(buf);
1127            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1128            v.write_to(__cache, buf);
1129        }
1130        for v in &self.enum_type {
1131            ::buffa::encoding::Tag::new(
1132                    5u32,
1133                    ::buffa::encoding::WireType::LengthDelimited,
1134                )
1135                .encode(buf);
1136            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1137            v.write_to(__cache, buf);
1138        }
1139        for v in &self.service {
1140            ::buffa::encoding::Tag::new(
1141                    6u32,
1142                    ::buffa::encoding::WireType::LengthDelimited,
1143                )
1144                .encode(buf);
1145            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1146            v.write_to(__cache, buf);
1147        }
1148        for v in &self.extension {
1149            ::buffa::encoding::Tag::new(
1150                    7u32,
1151                    ::buffa::encoding::WireType::LengthDelimited,
1152                )
1153                .encode(buf);
1154            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1155            v.write_to(__cache, buf);
1156        }
1157        if self.options.is_set() {
1158            ::buffa::encoding::Tag::new(
1159                    8u32,
1160                    ::buffa::encoding::WireType::LengthDelimited,
1161                )
1162                .encode(buf);
1163            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1164            self.options.write_to(__cache, buf);
1165        }
1166        if self.source_code_info.is_set() {
1167            ::buffa::encoding::Tag::new(
1168                    9u32,
1169                    ::buffa::encoding::WireType::LengthDelimited,
1170                )
1171                .encode(buf);
1172            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1173            self.source_code_info.write_to(__cache, buf);
1174        }
1175        for v in &self.public_dependency {
1176            ::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
1177                .encode(buf);
1178            ::buffa::types::encode_int32(*v, buf);
1179        }
1180        for v in &self.weak_dependency {
1181            ::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
1182                .encode(buf);
1183            ::buffa::types::encode_int32(*v, buf);
1184        }
1185        if let Some(ref v) = self.syntax {
1186            ::buffa::encoding::Tag::new(
1187                    12u32,
1188                    ::buffa::encoding::WireType::LengthDelimited,
1189                )
1190                .encode(buf);
1191            ::buffa::types::encode_string(v, buf);
1192        }
1193        if let Some(ref v) = self.edition {
1194            ::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
1195                .encode(buf);
1196            ::buffa::types::encode_int32(v.to_i32(), buf);
1197        }
1198        for v in &self.option_dependency {
1199            ::buffa::encoding::Tag::new(
1200                    15u32,
1201                    ::buffa::encoding::WireType::LengthDelimited,
1202                )
1203                .encode(buf);
1204            ::buffa::types::encode_string(v, buf);
1205        }
1206        self.__buffa_unknown_fields.write_to(buf);
1207    }
1208    fn merge_field(
1209        &mut self,
1210        tag: ::buffa::encoding::Tag,
1211        buf: &mut impl ::buffa::bytes::Buf,
1212        depth: u32,
1213    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1214        #[allow(unused_imports)]
1215        use ::buffa::bytes::Buf as _;
1216        #[allow(unused_imports)]
1217        use ::buffa::Enumeration as _;
1218        match tag.field_number() {
1219            1u32 => {
1220                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1221                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1222                        field_number: 1u32,
1223                        expected: 2u8,
1224                        actual: tag.wire_type() as u8,
1225                    });
1226                }
1227                ::buffa::types::merge_string(
1228                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
1229                    buf,
1230                )?;
1231            }
1232            2u32 => {
1233                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1234                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1235                        field_number: 2u32,
1236                        expected: 2u8,
1237                        actual: tag.wire_type() as u8,
1238                    });
1239                }
1240                ::buffa::types::merge_string(
1241                    self.package.get_or_insert_with(::buffa::alloc::string::String::new),
1242                    buf,
1243                )?;
1244            }
1245            3u32 => {
1246                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1247                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1248                        field_number: 3u32,
1249                        expected: 2u8,
1250                        actual: tag.wire_type() as u8,
1251                    });
1252                }
1253                self.dependency.push(::buffa::types::decode_string(buf)?);
1254            }
1255            4u32 => {
1256                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1257                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1258                        field_number: 4u32,
1259                        expected: 2u8,
1260                        actual: tag.wire_type() as u8,
1261                    });
1262                }
1263                let mut elem = ::core::default::Default::default();
1264                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1265                self.message_type.push(elem);
1266            }
1267            5u32 => {
1268                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1269                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1270                        field_number: 5u32,
1271                        expected: 2u8,
1272                        actual: tag.wire_type() as u8,
1273                    });
1274                }
1275                let mut elem = ::core::default::Default::default();
1276                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1277                self.enum_type.push(elem);
1278            }
1279            6u32 => {
1280                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1281                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1282                        field_number: 6u32,
1283                        expected: 2u8,
1284                        actual: tag.wire_type() as u8,
1285                    });
1286                }
1287                let mut elem = ::core::default::Default::default();
1288                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1289                self.service.push(elem);
1290            }
1291            7u32 => {
1292                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1293                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1294                        field_number: 7u32,
1295                        expected: 2u8,
1296                        actual: tag.wire_type() as u8,
1297                    });
1298                }
1299                let mut elem = ::core::default::Default::default();
1300                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1301                self.extension.push(elem);
1302            }
1303            8u32 => {
1304                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1305                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1306                        field_number: 8u32,
1307                        expected: 2u8,
1308                        actual: tag.wire_type() as u8,
1309                    });
1310                }
1311                ::buffa::Message::merge_length_delimited(
1312                    self.options.get_or_insert_default(),
1313                    buf,
1314                    depth,
1315                )?;
1316            }
1317            9u32 => {
1318                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1319                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1320                        field_number: 9u32,
1321                        expected: 2u8,
1322                        actual: tag.wire_type() as u8,
1323                    });
1324                }
1325                ::buffa::Message::merge_length_delimited(
1326                    self.source_code_info.get_or_insert_default(),
1327                    buf,
1328                    depth,
1329                )?;
1330            }
1331            10u32 => {
1332                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1333                    let len = ::buffa::encoding::decode_varint(buf)?;
1334                    let len = usize::try_from(len)
1335                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1336                    if buf.remaining() < len {
1337                        return ::core::result::Result::Err(
1338                            ::buffa::DecodeError::UnexpectedEof,
1339                        );
1340                    }
1341                    self.public_dependency.reserve(len);
1342                    let mut limited = buf.take(len);
1343                    while limited.has_remaining() {
1344                        self.public_dependency
1345                            .push(::buffa::types::decode_int32(&mut limited)?);
1346                    }
1347                    let leftover = limited.remaining();
1348                    if leftover > 0 {
1349                        limited.advance(leftover);
1350                    }
1351                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1352                    self.public_dependency.push(::buffa::types::decode_int32(buf)?);
1353                } else {
1354                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1355                        field_number: 10u32,
1356                        expected: 2u8,
1357                        actual: tag.wire_type() as u8,
1358                    });
1359                }
1360            }
1361            11u32 => {
1362                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1363                    let len = ::buffa::encoding::decode_varint(buf)?;
1364                    let len = usize::try_from(len)
1365                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1366                    if buf.remaining() < len {
1367                        return ::core::result::Result::Err(
1368                            ::buffa::DecodeError::UnexpectedEof,
1369                        );
1370                    }
1371                    self.weak_dependency.reserve(len);
1372                    let mut limited = buf.take(len);
1373                    while limited.has_remaining() {
1374                        self.weak_dependency
1375                            .push(::buffa::types::decode_int32(&mut limited)?);
1376                    }
1377                    let leftover = limited.remaining();
1378                    if leftover > 0 {
1379                        limited.advance(leftover);
1380                    }
1381                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1382                    self.weak_dependency.push(::buffa::types::decode_int32(buf)?);
1383                } else {
1384                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1385                        field_number: 11u32,
1386                        expected: 2u8,
1387                        actual: tag.wire_type() as u8,
1388                    });
1389                }
1390            }
1391            12u32 => {
1392                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1393                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1394                        field_number: 12u32,
1395                        expected: 2u8,
1396                        actual: tag.wire_type() as u8,
1397                    });
1398                }
1399                ::buffa::types::merge_string(
1400                    self.syntax.get_or_insert_with(::buffa::alloc::string::String::new),
1401                    buf,
1402                )?;
1403            }
1404            14u32 => {
1405                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1406                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1407                        field_number: 14u32,
1408                        expected: 0u8,
1409                        actual: tag.wire_type() as u8,
1410                    });
1411                }
1412                let __raw = ::buffa::types::decode_int32(buf)?;
1413                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
1414                    __raw,
1415                ) {
1416                    self.edition = ::core::option::Option::Some(__v);
1417                } else {
1418                    self.__buffa_unknown_fields
1419                        .push(::buffa::UnknownField {
1420                            number: 14u32,
1421                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
1422                        });
1423                }
1424            }
1425            15u32 => {
1426                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1427                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1428                        field_number: 15u32,
1429                        expected: 2u8,
1430                        actual: tag.wire_type() as u8,
1431                    });
1432                }
1433                self.option_dependency.push(::buffa::types::decode_string(buf)?);
1434            }
1435            _ => {
1436                self.__buffa_unknown_fields
1437                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1438            }
1439        }
1440        ::core::result::Result::Ok(())
1441    }
1442    fn clear(&mut self) {
1443        self.name = ::core::option::Option::None;
1444        self.package = ::core::option::Option::None;
1445        self.dependency.clear();
1446        self.message_type.clear();
1447        self.enum_type.clear();
1448        self.service.clear();
1449        self.extension.clear();
1450        self.options = ::buffa::MessageField::none();
1451        self.source_code_info = ::buffa::MessageField::none();
1452        self.public_dependency.clear();
1453        self.weak_dependency.clear();
1454        self.syntax = ::core::option::Option::None;
1455        self.edition = ::core::option::Option::None;
1456        self.option_dependency.clear();
1457        self.__buffa_unknown_fields.clear();
1458    }
1459}
1460impl ::buffa::ExtensionSet for FileDescriptorProto {
1461    const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto";
1462    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1463        &self.__buffa_unknown_fields
1464    }
1465    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1466        &mut self.__buffa_unknown_fields
1467    }
1468}
1469#[cfg(feature = "text")]
1470impl ::buffa::text::TextFormat for FileDescriptorProto {
1471    fn encode_text(
1472        &self,
1473        enc: &mut ::buffa::text::TextEncoder<'_>,
1474    ) -> ::core::fmt::Result {
1475        #[allow(unused_imports)]
1476        use ::buffa::Enumeration as _;
1477        if let ::core::option::Option::Some(ref __v) = self.name {
1478            enc.write_field_name("name")?;
1479            enc.write_string(__v)?;
1480        }
1481        if let ::core::option::Option::Some(ref __v) = self.package {
1482            enc.write_field_name("package")?;
1483            enc.write_string(__v)?;
1484        }
1485        if self.options.is_set() {
1486            enc.write_field_name("options")?;
1487            enc.write_message(&*self.options)?;
1488        }
1489        if self.source_code_info.is_set() {
1490            enc.write_field_name("source_code_info")?;
1491            enc.write_message(&*self.source_code_info)?;
1492        }
1493        if let ::core::option::Option::Some(ref __v) = self.syntax {
1494            enc.write_field_name("syntax")?;
1495            enc.write_string(__v)?;
1496        }
1497        if let ::core::option::Option::Some(ref __v) = self.edition {
1498            enc.write_field_name("edition")?;
1499            enc.write_enum_name(__v.proto_name())?;
1500        }
1501        for __v in &self.dependency {
1502            enc.write_field_name("dependency")?;
1503            enc.write_string(__v)?;
1504        }
1505        for __v in &self.public_dependency {
1506            enc.write_field_name("public_dependency")?;
1507            enc.write_i32(*__v)?;
1508        }
1509        for __v in &self.weak_dependency {
1510            enc.write_field_name("weak_dependency")?;
1511            enc.write_i32(*__v)?;
1512        }
1513        for __v in &self.option_dependency {
1514            enc.write_field_name("option_dependency")?;
1515            enc.write_string(__v)?;
1516        }
1517        for __v in &self.message_type {
1518            enc.write_field_name("message_type")?;
1519            enc.write_message(__v)?;
1520        }
1521        for __v in &self.enum_type {
1522            enc.write_field_name("enum_type")?;
1523            enc.write_message(__v)?;
1524        }
1525        for __v in &self.service {
1526            enc.write_field_name("service")?;
1527            enc.write_message(__v)?;
1528        }
1529        for __v in &self.extension {
1530            enc.write_field_name("extension")?;
1531            enc.write_message(__v)?;
1532        }
1533        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1534        ::core::result::Result::Ok(())
1535    }
1536    fn merge_text(
1537        &mut self,
1538        dec: &mut ::buffa::text::TextDecoder<'_>,
1539    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1540        #[allow(unused_imports)]
1541        use ::buffa::Enumeration as _;
1542        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1543            match __name {
1544                "name" => {
1545                    self.name = ::core::option::Option::Some(
1546                        dec.read_string()?.into_owned(),
1547                    );
1548                }
1549                "package" => {
1550                    self.package = ::core::option::Option::Some(
1551                        dec.read_string()?.into_owned(),
1552                    );
1553                }
1554                "options" => dec.merge_message(self.options.get_or_insert_default())?,
1555                "source_code_info" => {
1556                    dec.merge_message(self.source_code_info.get_or_insert_default())?
1557                }
1558                "syntax" => {
1559                    self.syntax = ::core::option::Option::Some(
1560                        dec.read_string()?.into_owned(),
1561                    );
1562                }
1563                "edition" => {
1564                    self.edition = ::core::option::Option::Some(
1565                        dec.read_closed_enum_by_name::<Edition>()?,
1566                    );
1567                }
1568                "dependency" => {
1569                    dec.read_repeated_into(
1570                        &mut self.dependency,
1571                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1572                    )?
1573                }
1574                "public_dependency" => {
1575                    dec.read_repeated_into(
1576                        &mut self.public_dependency,
1577                        |__d| __d.read_i32(),
1578                    )?
1579                }
1580                "weak_dependency" => {
1581                    dec.read_repeated_into(
1582                        &mut self.weak_dependency,
1583                        |__d| __d.read_i32(),
1584                    )?
1585                }
1586                "option_dependency" => {
1587                    dec.read_repeated_into(
1588                        &mut self.option_dependency,
1589                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
1590                    )?
1591                }
1592                "message_type" => {
1593                    dec.read_repeated_into(
1594                        &mut self.message_type,
1595                        |__d| {
1596                            let mut __m = ::core::default::Default::default();
1597                            __d.merge_message(&mut __m)?;
1598                            ::core::result::Result::Ok(__m)
1599                        },
1600                    )?
1601                }
1602                "enum_type" => {
1603                    dec.read_repeated_into(
1604                        &mut self.enum_type,
1605                        |__d| {
1606                            let mut __m = ::core::default::Default::default();
1607                            __d.merge_message(&mut __m)?;
1608                            ::core::result::Result::Ok(__m)
1609                        },
1610                    )?
1611                }
1612                "service" => {
1613                    dec.read_repeated_into(
1614                        &mut self.service,
1615                        |__d| {
1616                            let mut __m = ::core::default::Default::default();
1617                            __d.merge_message(&mut __m)?;
1618                            ::core::result::Result::Ok(__m)
1619                        },
1620                    )?
1621                }
1622                "extension" => {
1623                    dec.read_repeated_into(
1624                        &mut self.extension,
1625                        |__d| {
1626                            let mut __m = ::core::default::Default::default();
1627                            __d.merge_message(&mut __m)?;
1628                            ::core::result::Result::Ok(__m)
1629                        },
1630                    )?
1631                }
1632                _ => dec.skip_value()?,
1633            }
1634        }
1635        ::core::result::Result::Ok(())
1636    }
1637}
1638#[cfg(feature = "json")]
1639impl ::buffa::json_helpers::ProtoElemJson for FileDescriptorProto {
1640    fn serialize_proto_json<S: ::serde::Serializer>(
1641        v: &Self,
1642        s: S,
1643    ) -> ::core::result::Result<S::Ok, S::Error> {
1644        ::serde::Serialize::serialize(v, s)
1645    }
1646    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1647        d: D,
1648    ) -> ::core::result::Result<Self, D::Error> {
1649        <Self as ::serde::Deserialize>::deserialize(d)
1650    }
1651}
1652#[cfg(feature = "json")]
1653#[doc(hidden)]
1654pub const __FILE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1655    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1656    to_json: ::buffa::type_registry::any_to_json::<FileDescriptorProto>,
1657    from_json: ::buffa::type_registry::any_from_json::<FileDescriptorProto>,
1658    is_wkt: false,
1659};
1660#[cfg(feature = "text")]
1661#[doc(hidden)]
1662pub const __FILE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1663    type_url: "type.googleapis.com/google.protobuf.FileDescriptorProto",
1664    text_encode: ::buffa::type_registry::any_encode_text::<FileDescriptorProto>,
1665    text_merge: ::buffa::type_registry::any_merge_text::<FileDescriptorProto>,
1666};
1667/// Describes a message type.
1668#[derive(Clone, PartialEq, Default)]
1669#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
1670#[cfg_attr(feature = "json", serde(default))]
1671#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1672pub struct DescriptorProto {
1673    /// Field 1: `name`
1674    #[cfg_attr(
1675        feature = "json",
1676        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
1677    )]
1678    pub name: ::core::option::Option<::buffa::alloc::string::String>,
1679    /// Field 2: `field`
1680    #[cfg_attr(
1681        feature = "json",
1682        serde(
1683            rename = "field",
1684            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1685            deserialize_with = "::buffa::json_helpers::null_as_default"
1686        )
1687    )]
1688    pub field: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1689    /// Field 6: `extension`
1690    #[cfg_attr(
1691        feature = "json",
1692        serde(
1693            rename = "extension",
1694            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1695            deserialize_with = "::buffa::json_helpers::null_as_default"
1696        )
1697    )]
1698    pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
1699    /// Field 3: `nested_type`
1700    #[cfg_attr(
1701        feature = "json",
1702        serde(
1703            rename = "nestedType",
1704            alias = "nested_type",
1705            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1706            deserialize_with = "::buffa::json_helpers::null_as_default"
1707        )
1708    )]
1709    pub nested_type: ::buffa::alloc::vec::Vec<Self>,
1710    /// Field 4: `enum_type`
1711    #[cfg_attr(
1712        feature = "json",
1713        serde(
1714            rename = "enumType",
1715            alias = "enum_type",
1716            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1717            deserialize_with = "::buffa::json_helpers::null_as_default"
1718        )
1719    )]
1720    pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
1721    /// Field 5: `extension_range`
1722    #[cfg_attr(
1723        feature = "json",
1724        serde(
1725            rename = "extensionRange",
1726            alias = "extension_range",
1727            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1728            deserialize_with = "::buffa::json_helpers::null_as_default"
1729        )
1730    )]
1731    pub extension_range: ::buffa::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
1732    /// Field 8: `oneof_decl`
1733    #[cfg_attr(
1734        feature = "json",
1735        serde(
1736            rename = "oneofDecl",
1737            alias = "oneof_decl",
1738            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1739            deserialize_with = "::buffa::json_helpers::null_as_default"
1740        )
1741    )]
1742    pub oneof_decl: ::buffa::alloc::vec::Vec<OneofDescriptorProto>,
1743    /// Field 7: `options`
1744    #[cfg_attr(
1745        feature = "json",
1746        serde(
1747            rename = "options",
1748            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1749        )
1750    )]
1751    pub options: ::buffa::MessageField<MessageOptions>,
1752    /// Field 9: `reserved_range`
1753    #[cfg_attr(
1754        feature = "json",
1755        serde(
1756            rename = "reservedRange",
1757            alias = "reserved_range",
1758            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1759            deserialize_with = "::buffa::json_helpers::null_as_default"
1760        )
1761    )]
1762    pub reserved_range: ::buffa::alloc::vec::Vec<descriptor_proto::ReservedRange>,
1763    /// Reserved field names, which may not be used by fields in the same message.
1764    /// A given name may only be reserved once.
1765    ///
1766    /// Field 10: `reserved_name`
1767    #[cfg_attr(
1768        feature = "json",
1769        serde(
1770            rename = "reservedName",
1771            alias = "reserved_name",
1772            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1773            deserialize_with = "::buffa::json_helpers::null_as_default"
1774        )
1775    )]
1776    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1777    /// Support for `export` and `local` keywords on enums.
1778    ///
1779    /// Field 11: `visibility`
1780    #[cfg_attr(
1781        feature = "json",
1782        serde(
1783            rename = "visibility",
1784            with = "::buffa::json_helpers::opt_closed_enum",
1785            skip_serializing_if = "::core::option::Option::is_none"
1786        )
1787    )]
1788    pub visibility: ::core::option::Option<SymbolVisibility>,
1789    #[cfg_attr(feature = "json", serde(skip))]
1790    #[doc(hidden)]
1791    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1792}
1793impl ::core::fmt::Debug for DescriptorProto {
1794    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1795        f.debug_struct("DescriptorProto")
1796            .field("name", &self.name)
1797            .field("field", &self.field)
1798            .field("extension", &self.extension)
1799            .field("nested_type", &self.nested_type)
1800            .field("enum_type", &self.enum_type)
1801            .field("extension_range", &self.extension_range)
1802            .field("oneof_decl", &self.oneof_decl)
1803            .field("options", &self.options)
1804            .field("reserved_range", &self.reserved_range)
1805            .field("reserved_name", &self.reserved_name)
1806            .field("visibility", &self.visibility)
1807            .finish()
1808    }
1809}
1810impl DescriptorProto {
1811    /// Protobuf type URL for this message, for use with `Any::pack` and
1812    /// `Any::unpack_if`.
1813    ///
1814    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1815    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1816}
1817impl DescriptorProto {
1818    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1819    #[inline]
1820    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
1821    pub fn with_name(
1822        mut self,
1823        value: impl Into<::buffa::alloc::string::String>,
1824    ) -> Self {
1825        self.name = Some(value.into());
1826        self
1827    }
1828    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1829    #[inline]
1830    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
1831    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
1832        self.visibility = Some(value.into());
1833        self
1834    }
1835}
1836impl ::buffa::DefaultInstance for DescriptorProto {
1837    fn default_instance() -> &'static Self {
1838        static VALUE: ::buffa::__private::OnceBox<DescriptorProto> = ::buffa::__private::OnceBox::new();
1839        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1840    }
1841}
1842impl ::buffa::MessageName for DescriptorProto {
1843    const PACKAGE: &'static str = "google.protobuf";
1844    const NAME: &'static str = "DescriptorProto";
1845    const FULL_NAME: &'static str = "google.protobuf.DescriptorProto";
1846    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
1847}
1848impl ::buffa::Message for DescriptorProto {
1849    /// Returns the total encoded size in bytes.
1850    ///
1851    /// The result is a `u32`; the protobuf specification requires all
1852    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1853    /// compliant message will never overflow this type.
1854    #[allow(clippy::let_and_return)]
1855    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1856        #[allow(unused_imports)]
1857        use ::buffa::Enumeration as _;
1858        let mut size = 0u32;
1859        if let Some(ref v) = self.name {
1860            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1861        }
1862        for v in &self.field {
1863            let __slot = __cache.reserve();
1864            let inner_size = v.compute_size(__cache);
1865            __cache.set(__slot, inner_size);
1866            size
1867                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1868                    + inner_size;
1869        }
1870        for v in &self.nested_type {
1871            let __slot = __cache.reserve();
1872            let inner_size = v.compute_size(__cache);
1873            __cache.set(__slot, inner_size);
1874            size
1875                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1876                    + inner_size;
1877        }
1878        for v in &self.enum_type {
1879            let __slot = __cache.reserve();
1880            let inner_size = v.compute_size(__cache);
1881            __cache.set(__slot, inner_size);
1882            size
1883                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1884                    + inner_size;
1885        }
1886        for v in &self.extension_range {
1887            let __slot = __cache.reserve();
1888            let inner_size = v.compute_size(__cache);
1889            __cache.set(__slot, inner_size);
1890            size
1891                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1892                    + inner_size;
1893        }
1894        for v in &self.extension {
1895            let __slot = __cache.reserve();
1896            let inner_size = v.compute_size(__cache);
1897            __cache.set(__slot, inner_size);
1898            size
1899                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1900                    + inner_size;
1901        }
1902        if self.options.is_set() {
1903            let __slot = __cache.reserve();
1904            let inner_size = self.options.compute_size(__cache);
1905            __cache.set(__slot, inner_size);
1906            size
1907                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1908                    + inner_size;
1909        }
1910        for v in &self.oneof_decl {
1911            let __slot = __cache.reserve();
1912            let inner_size = v.compute_size(__cache);
1913            __cache.set(__slot, inner_size);
1914            size
1915                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1916                    + inner_size;
1917        }
1918        for v in &self.reserved_range {
1919            let __slot = __cache.reserve();
1920            let inner_size = v.compute_size(__cache);
1921            __cache.set(__slot, inner_size);
1922            size
1923                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1924                    + inner_size;
1925        }
1926        for v in &self.reserved_name {
1927            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1928        }
1929        if let Some(ref v) = self.visibility {
1930            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
1931        }
1932        size += self.__buffa_unknown_fields.encoded_len() as u32;
1933        size
1934    }
1935    fn write_to(
1936        &self,
1937        __cache: &mut ::buffa::SizeCache,
1938        buf: &mut impl ::buffa::bytes::BufMut,
1939    ) {
1940        #[allow(unused_imports)]
1941        use ::buffa::Enumeration as _;
1942        if let Some(ref v) = self.name {
1943            ::buffa::encoding::Tag::new(
1944                    1u32,
1945                    ::buffa::encoding::WireType::LengthDelimited,
1946                )
1947                .encode(buf);
1948            ::buffa::types::encode_string(v, buf);
1949        }
1950        for v in &self.field {
1951            ::buffa::encoding::Tag::new(
1952                    2u32,
1953                    ::buffa::encoding::WireType::LengthDelimited,
1954                )
1955                .encode(buf);
1956            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1957            v.write_to(__cache, buf);
1958        }
1959        for v in &self.nested_type {
1960            ::buffa::encoding::Tag::new(
1961                    3u32,
1962                    ::buffa::encoding::WireType::LengthDelimited,
1963                )
1964                .encode(buf);
1965            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1966            v.write_to(__cache, buf);
1967        }
1968        for v in &self.enum_type {
1969            ::buffa::encoding::Tag::new(
1970                    4u32,
1971                    ::buffa::encoding::WireType::LengthDelimited,
1972                )
1973                .encode(buf);
1974            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1975            v.write_to(__cache, buf);
1976        }
1977        for v in &self.extension_range {
1978            ::buffa::encoding::Tag::new(
1979                    5u32,
1980                    ::buffa::encoding::WireType::LengthDelimited,
1981                )
1982                .encode(buf);
1983            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1984            v.write_to(__cache, buf);
1985        }
1986        for v in &self.extension {
1987            ::buffa::encoding::Tag::new(
1988                    6u32,
1989                    ::buffa::encoding::WireType::LengthDelimited,
1990                )
1991                .encode(buf);
1992            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1993            v.write_to(__cache, buf);
1994        }
1995        if self.options.is_set() {
1996            ::buffa::encoding::Tag::new(
1997                    7u32,
1998                    ::buffa::encoding::WireType::LengthDelimited,
1999                )
2000                .encode(buf);
2001            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
2002            self.options.write_to(__cache, buf);
2003        }
2004        for v in &self.oneof_decl {
2005            ::buffa::encoding::Tag::new(
2006                    8u32,
2007                    ::buffa::encoding::WireType::LengthDelimited,
2008                )
2009                .encode(buf);
2010            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
2011            v.write_to(__cache, buf);
2012        }
2013        for v in &self.reserved_range {
2014            ::buffa::encoding::Tag::new(
2015                    9u32,
2016                    ::buffa::encoding::WireType::LengthDelimited,
2017                )
2018                .encode(buf);
2019            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
2020            v.write_to(__cache, buf);
2021        }
2022        for v in &self.reserved_name {
2023            ::buffa::encoding::Tag::new(
2024                    10u32,
2025                    ::buffa::encoding::WireType::LengthDelimited,
2026                )
2027                .encode(buf);
2028            ::buffa::types::encode_string(v, buf);
2029        }
2030        if let Some(ref v) = self.visibility {
2031            ::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
2032                .encode(buf);
2033            ::buffa::types::encode_int32(v.to_i32(), buf);
2034        }
2035        self.__buffa_unknown_fields.write_to(buf);
2036    }
2037    fn merge_field(
2038        &mut self,
2039        tag: ::buffa::encoding::Tag,
2040        buf: &mut impl ::buffa::bytes::Buf,
2041        depth: u32,
2042    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2043        #[allow(unused_imports)]
2044        use ::buffa::bytes::Buf as _;
2045        #[allow(unused_imports)]
2046        use ::buffa::Enumeration as _;
2047        match tag.field_number() {
2048            1u32 => {
2049                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2050                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2051                        field_number: 1u32,
2052                        expected: 2u8,
2053                        actual: tag.wire_type() as u8,
2054                    });
2055                }
2056                ::buffa::types::merge_string(
2057                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
2058                    buf,
2059                )?;
2060            }
2061            2u32 => {
2062                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2063                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2064                        field_number: 2u32,
2065                        expected: 2u8,
2066                        actual: tag.wire_type() as u8,
2067                    });
2068                }
2069                let mut elem = ::core::default::Default::default();
2070                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2071                self.field.push(elem);
2072            }
2073            3u32 => {
2074                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2075                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2076                        field_number: 3u32,
2077                        expected: 2u8,
2078                        actual: tag.wire_type() as u8,
2079                    });
2080                }
2081                let mut elem = ::core::default::Default::default();
2082                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2083                self.nested_type.push(elem);
2084            }
2085            4u32 => {
2086                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2087                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2088                        field_number: 4u32,
2089                        expected: 2u8,
2090                        actual: tag.wire_type() as u8,
2091                    });
2092                }
2093                let mut elem = ::core::default::Default::default();
2094                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2095                self.enum_type.push(elem);
2096            }
2097            5u32 => {
2098                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2099                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2100                        field_number: 5u32,
2101                        expected: 2u8,
2102                        actual: tag.wire_type() as u8,
2103                    });
2104                }
2105                let mut elem = ::core::default::Default::default();
2106                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2107                self.extension_range.push(elem);
2108            }
2109            6u32 => {
2110                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2111                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2112                        field_number: 6u32,
2113                        expected: 2u8,
2114                        actual: tag.wire_type() as u8,
2115                    });
2116                }
2117                let mut elem = ::core::default::Default::default();
2118                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2119                self.extension.push(elem);
2120            }
2121            7u32 => {
2122                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2123                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2124                        field_number: 7u32,
2125                        expected: 2u8,
2126                        actual: tag.wire_type() as u8,
2127                    });
2128                }
2129                ::buffa::Message::merge_length_delimited(
2130                    self.options.get_or_insert_default(),
2131                    buf,
2132                    depth,
2133                )?;
2134            }
2135            8u32 => {
2136                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2137                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2138                        field_number: 8u32,
2139                        expected: 2u8,
2140                        actual: tag.wire_type() as u8,
2141                    });
2142                }
2143                let mut elem = ::core::default::Default::default();
2144                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2145                self.oneof_decl.push(elem);
2146            }
2147            9u32 => {
2148                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2149                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2150                        field_number: 9u32,
2151                        expected: 2u8,
2152                        actual: tag.wire_type() as u8,
2153                    });
2154                }
2155                let mut elem = ::core::default::Default::default();
2156                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
2157                self.reserved_range.push(elem);
2158            }
2159            10u32 => {
2160                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2161                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2162                        field_number: 10u32,
2163                        expected: 2u8,
2164                        actual: tag.wire_type() as u8,
2165                    });
2166                }
2167                self.reserved_name.push(::buffa::types::decode_string(buf)?);
2168            }
2169            11u32 => {
2170                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2171                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2172                        field_number: 11u32,
2173                        expected: 0u8,
2174                        actual: tag.wire_type() as u8,
2175                    });
2176                }
2177                let __raw = ::buffa::types::decode_int32(buf)?;
2178                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
2179                    __raw,
2180                ) {
2181                    self.visibility = ::core::option::Option::Some(__v);
2182                } else {
2183                    self.__buffa_unknown_fields
2184                        .push(::buffa::UnknownField {
2185                            number: 11u32,
2186                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
2187                        });
2188                }
2189            }
2190            _ => {
2191                self.__buffa_unknown_fields
2192                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2193            }
2194        }
2195        ::core::result::Result::Ok(())
2196    }
2197    fn clear(&mut self) {
2198        self.name = ::core::option::Option::None;
2199        self.field.clear();
2200        self.nested_type.clear();
2201        self.enum_type.clear();
2202        self.extension_range.clear();
2203        self.extension.clear();
2204        self.options = ::buffa::MessageField::none();
2205        self.oneof_decl.clear();
2206        self.reserved_range.clear();
2207        self.reserved_name.clear();
2208        self.visibility = ::core::option::Option::None;
2209        self.__buffa_unknown_fields.clear();
2210    }
2211}
2212impl ::buffa::ExtensionSet for DescriptorProto {
2213    const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto";
2214    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2215        &self.__buffa_unknown_fields
2216    }
2217    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2218        &mut self.__buffa_unknown_fields
2219    }
2220}
2221#[cfg(feature = "text")]
2222impl ::buffa::text::TextFormat for DescriptorProto {
2223    fn encode_text(
2224        &self,
2225        enc: &mut ::buffa::text::TextEncoder<'_>,
2226    ) -> ::core::fmt::Result {
2227        #[allow(unused_imports)]
2228        use ::buffa::Enumeration as _;
2229        if let ::core::option::Option::Some(ref __v) = self.name {
2230            enc.write_field_name("name")?;
2231            enc.write_string(__v)?;
2232        }
2233        if self.options.is_set() {
2234            enc.write_field_name("options")?;
2235            enc.write_message(&*self.options)?;
2236        }
2237        if let ::core::option::Option::Some(ref __v) = self.visibility {
2238            enc.write_field_name("visibility")?;
2239            enc.write_enum_name(__v.proto_name())?;
2240        }
2241        for __v in &self.field {
2242            enc.write_field_name("field")?;
2243            enc.write_message(__v)?;
2244        }
2245        for __v in &self.extension {
2246            enc.write_field_name("extension")?;
2247            enc.write_message(__v)?;
2248        }
2249        for __v in &self.nested_type {
2250            enc.write_field_name("nested_type")?;
2251            enc.write_message(__v)?;
2252        }
2253        for __v in &self.enum_type {
2254            enc.write_field_name("enum_type")?;
2255            enc.write_message(__v)?;
2256        }
2257        for __v in &self.extension_range {
2258            enc.write_field_name("extension_range")?;
2259            enc.write_message(__v)?;
2260        }
2261        for __v in &self.oneof_decl {
2262            enc.write_field_name("oneof_decl")?;
2263            enc.write_message(__v)?;
2264        }
2265        for __v in &self.reserved_range {
2266            enc.write_field_name("reserved_range")?;
2267            enc.write_message(__v)?;
2268        }
2269        for __v in &self.reserved_name {
2270            enc.write_field_name("reserved_name")?;
2271            enc.write_string(__v)?;
2272        }
2273        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2274        ::core::result::Result::Ok(())
2275    }
2276    fn merge_text(
2277        &mut self,
2278        dec: &mut ::buffa::text::TextDecoder<'_>,
2279    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2280        #[allow(unused_imports)]
2281        use ::buffa::Enumeration as _;
2282        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2283            match __name {
2284                "name" => {
2285                    self.name = ::core::option::Option::Some(
2286                        dec.read_string()?.into_owned(),
2287                    );
2288                }
2289                "options" => dec.merge_message(self.options.get_or_insert_default())?,
2290                "visibility" => {
2291                    self.visibility = ::core::option::Option::Some(
2292                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
2293                    );
2294                }
2295                "field" => {
2296                    dec.read_repeated_into(
2297                        &mut self.field,
2298                        |__d| {
2299                            let mut __m = ::core::default::Default::default();
2300                            __d.merge_message(&mut __m)?;
2301                            ::core::result::Result::Ok(__m)
2302                        },
2303                    )?
2304                }
2305                "extension" => {
2306                    dec.read_repeated_into(
2307                        &mut self.extension,
2308                        |__d| {
2309                            let mut __m = ::core::default::Default::default();
2310                            __d.merge_message(&mut __m)?;
2311                            ::core::result::Result::Ok(__m)
2312                        },
2313                    )?
2314                }
2315                "nested_type" => {
2316                    dec.read_repeated_into(
2317                        &mut self.nested_type,
2318                        |__d| {
2319                            let mut __m = ::core::default::Default::default();
2320                            __d.merge_message(&mut __m)?;
2321                            ::core::result::Result::Ok(__m)
2322                        },
2323                    )?
2324                }
2325                "enum_type" => {
2326                    dec.read_repeated_into(
2327                        &mut self.enum_type,
2328                        |__d| {
2329                            let mut __m = ::core::default::Default::default();
2330                            __d.merge_message(&mut __m)?;
2331                            ::core::result::Result::Ok(__m)
2332                        },
2333                    )?
2334                }
2335                "extension_range" => {
2336                    dec.read_repeated_into(
2337                        &mut self.extension_range,
2338                        |__d| {
2339                            let mut __m = ::core::default::Default::default();
2340                            __d.merge_message(&mut __m)?;
2341                            ::core::result::Result::Ok(__m)
2342                        },
2343                    )?
2344                }
2345                "oneof_decl" => {
2346                    dec.read_repeated_into(
2347                        &mut self.oneof_decl,
2348                        |__d| {
2349                            let mut __m = ::core::default::Default::default();
2350                            __d.merge_message(&mut __m)?;
2351                            ::core::result::Result::Ok(__m)
2352                        },
2353                    )?
2354                }
2355                "reserved_range" => {
2356                    dec.read_repeated_into(
2357                        &mut self.reserved_range,
2358                        |__d| {
2359                            let mut __m = ::core::default::Default::default();
2360                            __d.merge_message(&mut __m)?;
2361                            ::core::result::Result::Ok(__m)
2362                        },
2363                    )?
2364                }
2365                "reserved_name" => {
2366                    dec.read_repeated_into(
2367                        &mut self.reserved_name,
2368                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
2369                    )?
2370                }
2371                _ => dec.skip_value()?,
2372            }
2373        }
2374        ::core::result::Result::Ok(())
2375    }
2376}
2377#[cfg(feature = "json")]
2378impl ::buffa::json_helpers::ProtoElemJson for DescriptorProto {
2379    fn serialize_proto_json<S: ::serde::Serializer>(
2380        v: &Self,
2381        s: S,
2382    ) -> ::core::result::Result<S::Ok, S::Error> {
2383        ::serde::Serialize::serialize(v, s)
2384    }
2385    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2386        d: D,
2387    ) -> ::core::result::Result<Self, D::Error> {
2388        <Self as ::serde::Deserialize>::deserialize(d)
2389    }
2390}
2391#[cfg(feature = "json")]
2392#[doc(hidden)]
2393pub const __DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2394    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2395    to_json: ::buffa::type_registry::any_to_json::<DescriptorProto>,
2396    from_json: ::buffa::type_registry::any_from_json::<DescriptorProto>,
2397    is_wkt: false,
2398};
2399#[cfg(feature = "text")]
2400#[doc(hidden)]
2401pub const __DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2402    type_url: "type.googleapis.com/google.protobuf.DescriptorProto",
2403    text_encode: ::buffa::type_registry::any_encode_text::<DescriptorProto>,
2404    text_merge: ::buffa::type_registry::any_merge_text::<DescriptorProto>,
2405};
2406pub mod descriptor_proto {
2407    #[allow(unused_imports)]
2408    use super::*;
2409    #[derive(Clone, PartialEq, Default)]
2410    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2411    #[cfg_attr(feature = "json", serde(default))]
2412    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2413    pub struct ExtensionRange {
2414        /// Inclusive.
2415        ///
2416        /// Field 1: `start`
2417        #[cfg_attr(
2418            feature = "json",
2419            serde(
2420                rename = "start",
2421                with = "::buffa::json_helpers::opt_int32",
2422                skip_serializing_if = "::core::option::Option::is_none"
2423            )
2424        )]
2425        pub start: ::core::option::Option<i32>,
2426        /// Exclusive.
2427        ///
2428        /// Field 2: `end`
2429        #[cfg_attr(
2430            feature = "json",
2431            serde(
2432                rename = "end",
2433                with = "::buffa::json_helpers::opt_int32",
2434                skip_serializing_if = "::core::option::Option::is_none"
2435            )
2436        )]
2437        pub end: ::core::option::Option<i32>,
2438        /// Field 3: `options`
2439        #[cfg_attr(
2440            feature = "json",
2441            serde(
2442                rename = "options",
2443                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2444            )
2445        )]
2446        pub options: ::buffa::MessageField<super::ExtensionRangeOptions>,
2447        #[cfg_attr(feature = "json", serde(skip))]
2448        #[doc(hidden)]
2449        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2450    }
2451    impl ::core::fmt::Debug for ExtensionRange {
2452        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2453            f.debug_struct("ExtensionRange")
2454                .field("start", &self.start)
2455                .field("end", &self.end)
2456                .field("options", &self.options)
2457                .finish()
2458        }
2459    }
2460    impl ExtensionRange {
2461        /// Protobuf type URL for this message, for use with `Any::pack` and
2462        /// `Any::unpack_if`.
2463        ///
2464        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2465        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2466    }
2467    impl ExtensionRange {
2468        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2469        #[inline]
2470        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2471        pub fn with_start(mut self, value: i32) -> Self {
2472            self.start = Some(value);
2473            self
2474        }
2475        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2476        #[inline]
2477        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2478        pub fn with_end(mut self, value: i32) -> Self {
2479            self.end = Some(value);
2480            self
2481        }
2482    }
2483    impl ::buffa::DefaultInstance for ExtensionRange {
2484        fn default_instance() -> &'static Self {
2485            static VALUE: ::buffa::__private::OnceBox<ExtensionRange> = ::buffa::__private::OnceBox::new();
2486            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2487        }
2488    }
2489    impl ::buffa::MessageName for ExtensionRange {
2490        const PACKAGE: &'static str = "google.protobuf";
2491        const NAME: &'static str = "DescriptorProto.ExtensionRange";
2492        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2493        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
2494    }
2495    impl ::buffa::Message for ExtensionRange {
2496        /// Returns the total encoded size in bytes.
2497        ///
2498        /// The result is a `u32`; the protobuf specification requires all
2499        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2500        /// compliant message will never overflow this type.
2501        #[allow(clippy::let_and_return)]
2502        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2503            #[allow(unused_imports)]
2504            use ::buffa::Enumeration as _;
2505            let mut size = 0u32;
2506            if let Some(v) = self.start {
2507                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2508            }
2509            if let Some(v) = self.end {
2510                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2511            }
2512            if self.options.is_set() {
2513                let __slot = __cache.reserve();
2514                let inner_size = self.options.compute_size(__cache);
2515                __cache.set(__slot, inner_size);
2516                size
2517                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2518                        + inner_size;
2519            }
2520            size += self.__buffa_unknown_fields.encoded_len() as u32;
2521            size
2522        }
2523        fn write_to(
2524            &self,
2525            __cache: &mut ::buffa::SizeCache,
2526            buf: &mut impl ::buffa::bytes::BufMut,
2527        ) {
2528            #[allow(unused_imports)]
2529            use ::buffa::Enumeration as _;
2530            if let Some(v) = self.start {
2531                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
2532                    .encode(buf);
2533                ::buffa::types::encode_int32(v, buf);
2534            }
2535            if let Some(v) = self.end {
2536                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
2537                    .encode(buf);
2538                ::buffa::types::encode_int32(v, buf);
2539            }
2540            if self.options.is_set() {
2541                ::buffa::encoding::Tag::new(
2542                        3u32,
2543                        ::buffa::encoding::WireType::LengthDelimited,
2544                    )
2545                    .encode(buf);
2546                ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
2547                self.options.write_to(__cache, buf);
2548            }
2549            self.__buffa_unknown_fields.write_to(buf);
2550        }
2551        fn merge_field(
2552            &mut self,
2553            tag: ::buffa::encoding::Tag,
2554            buf: &mut impl ::buffa::bytes::Buf,
2555            depth: u32,
2556        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2557            #[allow(unused_imports)]
2558            use ::buffa::bytes::Buf as _;
2559            #[allow(unused_imports)]
2560            use ::buffa::Enumeration as _;
2561            match tag.field_number() {
2562                1u32 => {
2563                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2564                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2565                            field_number: 1u32,
2566                            expected: 0u8,
2567                            actual: tag.wire_type() as u8,
2568                        });
2569                    }
2570                    self.start = ::core::option::Option::Some(
2571                        ::buffa::types::decode_int32(buf)?,
2572                    );
2573                }
2574                2u32 => {
2575                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2576                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2577                            field_number: 2u32,
2578                            expected: 0u8,
2579                            actual: tag.wire_type() as u8,
2580                        });
2581                    }
2582                    self.end = ::core::option::Option::Some(
2583                        ::buffa::types::decode_int32(buf)?,
2584                    );
2585                }
2586                3u32 => {
2587                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2588                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2589                            field_number: 3u32,
2590                            expected: 2u8,
2591                            actual: tag.wire_type() as u8,
2592                        });
2593                    }
2594                    ::buffa::Message::merge_length_delimited(
2595                        self.options.get_or_insert_default(),
2596                        buf,
2597                        depth,
2598                    )?;
2599                }
2600                _ => {
2601                    self.__buffa_unknown_fields
2602                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2603                }
2604            }
2605            ::core::result::Result::Ok(())
2606        }
2607        fn clear(&mut self) {
2608            self.start = ::core::option::Option::None;
2609            self.end = ::core::option::Option::None;
2610            self.options = ::buffa::MessageField::none();
2611            self.__buffa_unknown_fields.clear();
2612        }
2613    }
2614    impl ::buffa::ExtensionSet for ExtensionRange {
2615        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
2616        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2617            &self.__buffa_unknown_fields
2618        }
2619        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2620            &mut self.__buffa_unknown_fields
2621        }
2622    }
2623    #[cfg(feature = "text")]
2624    impl ::buffa::text::TextFormat for ExtensionRange {
2625        fn encode_text(
2626            &self,
2627            enc: &mut ::buffa::text::TextEncoder<'_>,
2628        ) -> ::core::fmt::Result {
2629            #[allow(unused_imports)]
2630            use ::buffa::Enumeration as _;
2631            if let ::core::option::Option::Some(ref __v) = self.start {
2632                enc.write_field_name("start")?;
2633                enc.write_i32(*__v)?;
2634            }
2635            if let ::core::option::Option::Some(ref __v) = self.end {
2636                enc.write_field_name("end")?;
2637                enc.write_i32(*__v)?;
2638            }
2639            if self.options.is_set() {
2640                enc.write_field_name("options")?;
2641                enc.write_message(&*self.options)?;
2642            }
2643            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2644            ::core::result::Result::Ok(())
2645        }
2646        fn merge_text(
2647            &mut self,
2648            dec: &mut ::buffa::text::TextDecoder<'_>,
2649        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2650            #[allow(unused_imports)]
2651            use ::buffa::Enumeration as _;
2652            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2653                match __name {
2654                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2655                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2656                    "options" => dec.merge_message(self.options.get_or_insert_default())?,
2657                    _ => dec.skip_value()?,
2658                }
2659            }
2660            ::core::result::Result::Ok(())
2661        }
2662    }
2663    #[cfg(feature = "json")]
2664    impl ::buffa::json_helpers::ProtoElemJson for ExtensionRange {
2665        fn serialize_proto_json<S: ::serde::Serializer>(
2666            v: &Self,
2667            s: S,
2668        ) -> ::core::result::Result<S::Ok, S::Error> {
2669            ::serde::Serialize::serialize(v, s)
2670        }
2671        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2672            d: D,
2673        ) -> ::core::result::Result<Self, D::Error> {
2674            <Self as ::serde::Deserialize>::deserialize(d)
2675        }
2676    }
2677    #[cfg(feature = "json")]
2678    #[doc(hidden)]
2679    pub const __EXTENSION_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2680        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2681        to_json: ::buffa::type_registry::any_to_json::<ExtensionRange>,
2682        from_json: ::buffa::type_registry::any_from_json::<ExtensionRange>,
2683        is_wkt: false,
2684    };
2685    #[cfg(feature = "text")]
2686    #[doc(hidden)]
2687    pub const __EXTENSION_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2688        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange",
2689        text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRange>,
2690        text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRange>,
2691    };
2692    /// Range of reserved tag numbers. Reserved tag numbers may not be used by
2693    /// fields or extension ranges in the same message. Reserved ranges may
2694    /// not overlap.
2695    #[derive(Clone, PartialEq, Default)]
2696    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
2697    #[cfg_attr(feature = "json", serde(default))]
2698    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2699    pub struct ReservedRange {
2700        /// Inclusive.
2701        ///
2702        /// Field 1: `start`
2703        #[cfg_attr(
2704            feature = "json",
2705            serde(
2706                rename = "start",
2707                with = "::buffa::json_helpers::opt_int32",
2708                skip_serializing_if = "::core::option::Option::is_none"
2709            )
2710        )]
2711        pub start: ::core::option::Option<i32>,
2712        /// Exclusive.
2713        ///
2714        /// Field 2: `end`
2715        #[cfg_attr(
2716            feature = "json",
2717            serde(
2718                rename = "end",
2719                with = "::buffa::json_helpers::opt_int32",
2720                skip_serializing_if = "::core::option::Option::is_none"
2721            )
2722        )]
2723        pub end: ::core::option::Option<i32>,
2724        #[cfg_attr(feature = "json", serde(skip))]
2725        #[doc(hidden)]
2726        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2727    }
2728    impl ::core::fmt::Debug for ReservedRange {
2729        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2730            f.debug_struct("ReservedRange")
2731                .field("start", &self.start)
2732                .field("end", &self.end)
2733                .finish()
2734        }
2735    }
2736    impl ReservedRange {
2737        /// Protobuf type URL for this message, for use with `Any::pack` and
2738        /// `Any::unpack_if`.
2739        ///
2740        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2741        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2742    }
2743    impl ReservedRange {
2744        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2745        #[inline]
2746        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
2747        pub fn with_start(mut self, value: i32) -> Self {
2748            self.start = Some(value);
2749            self
2750        }
2751        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2752        #[inline]
2753        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
2754        pub fn with_end(mut self, value: i32) -> Self {
2755            self.end = Some(value);
2756            self
2757        }
2758    }
2759    impl ::buffa::DefaultInstance for ReservedRange {
2760        fn default_instance() -> &'static Self {
2761            static VALUE: ::buffa::__private::OnceBox<ReservedRange> = ::buffa::__private::OnceBox::new();
2762            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2763        }
2764    }
2765    impl ::buffa::MessageName for ReservedRange {
2766        const PACKAGE: &'static str = "google.protobuf";
2767        const NAME: &'static str = "DescriptorProto.ReservedRange";
2768        const FULL_NAME: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2769        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
2770    }
2771    impl ::buffa::Message for ReservedRange {
2772        /// Returns the total encoded size in bytes.
2773        ///
2774        /// The result is a `u32`; the protobuf specification requires all
2775        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2776        /// compliant message will never overflow this type.
2777        #[allow(clippy::let_and_return)]
2778        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2779            #[allow(unused_imports)]
2780            use ::buffa::Enumeration as _;
2781            let mut size = 0u32;
2782            if let Some(v) = self.start {
2783                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2784            }
2785            if let Some(v) = self.end {
2786                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
2787            }
2788            size += self.__buffa_unknown_fields.encoded_len() as u32;
2789            size
2790        }
2791        fn write_to(
2792            &self,
2793            _cache: &mut ::buffa::SizeCache,
2794            buf: &mut impl ::buffa::bytes::BufMut,
2795        ) {
2796            #[allow(unused_imports)]
2797            use ::buffa::Enumeration as _;
2798            if let Some(v) = self.start {
2799                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
2800                    .encode(buf);
2801                ::buffa::types::encode_int32(v, buf);
2802            }
2803            if let Some(v) = self.end {
2804                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
2805                    .encode(buf);
2806                ::buffa::types::encode_int32(v, buf);
2807            }
2808            self.__buffa_unknown_fields.write_to(buf);
2809        }
2810        fn merge_field(
2811            &mut self,
2812            tag: ::buffa::encoding::Tag,
2813            buf: &mut impl ::buffa::bytes::Buf,
2814            depth: u32,
2815        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2816            #[allow(unused_imports)]
2817            use ::buffa::bytes::Buf as _;
2818            #[allow(unused_imports)]
2819            use ::buffa::Enumeration as _;
2820            match tag.field_number() {
2821                1u32 => {
2822                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2823                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2824                            field_number: 1u32,
2825                            expected: 0u8,
2826                            actual: tag.wire_type() as u8,
2827                        });
2828                    }
2829                    self.start = ::core::option::Option::Some(
2830                        ::buffa::types::decode_int32(buf)?,
2831                    );
2832                }
2833                2u32 => {
2834                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2835                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2836                            field_number: 2u32,
2837                            expected: 0u8,
2838                            actual: tag.wire_type() as u8,
2839                        });
2840                    }
2841                    self.end = ::core::option::Option::Some(
2842                        ::buffa::types::decode_int32(buf)?,
2843                    );
2844                }
2845                _ => {
2846                    self.__buffa_unknown_fields
2847                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2848                }
2849            }
2850            ::core::result::Result::Ok(())
2851        }
2852        fn clear(&mut self) {
2853            self.start = ::core::option::Option::None;
2854            self.end = ::core::option::Option::None;
2855            self.__buffa_unknown_fields.clear();
2856        }
2857    }
2858    impl ::buffa::ExtensionSet for ReservedRange {
2859        const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
2860        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2861            &self.__buffa_unknown_fields
2862        }
2863        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2864            &mut self.__buffa_unknown_fields
2865        }
2866    }
2867    #[cfg(feature = "text")]
2868    impl ::buffa::text::TextFormat for ReservedRange {
2869        fn encode_text(
2870            &self,
2871            enc: &mut ::buffa::text::TextEncoder<'_>,
2872        ) -> ::core::fmt::Result {
2873            #[allow(unused_imports)]
2874            use ::buffa::Enumeration as _;
2875            if let ::core::option::Option::Some(ref __v) = self.start {
2876                enc.write_field_name("start")?;
2877                enc.write_i32(*__v)?;
2878            }
2879            if let ::core::option::Option::Some(ref __v) = self.end {
2880                enc.write_field_name("end")?;
2881                enc.write_i32(*__v)?;
2882            }
2883            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2884            ::core::result::Result::Ok(())
2885        }
2886        fn merge_text(
2887            &mut self,
2888            dec: &mut ::buffa::text::TextDecoder<'_>,
2889        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2890            #[allow(unused_imports)]
2891            use ::buffa::Enumeration as _;
2892            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2893                match __name {
2894                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
2895                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
2896                    _ => dec.skip_value()?,
2897                }
2898            }
2899            ::core::result::Result::Ok(())
2900        }
2901    }
2902    #[cfg(feature = "json")]
2903    impl ::buffa::json_helpers::ProtoElemJson for ReservedRange {
2904        fn serialize_proto_json<S: ::serde::Serializer>(
2905            v: &Self,
2906            s: S,
2907        ) -> ::core::result::Result<S::Ok, S::Error> {
2908            ::serde::Serialize::serialize(v, s)
2909        }
2910        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2911            d: D,
2912        ) -> ::core::result::Result<Self, D::Error> {
2913            <Self as ::serde::Deserialize>::deserialize(d)
2914        }
2915    }
2916    #[cfg(feature = "json")]
2917    #[doc(hidden)]
2918    pub const __RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2919        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2920        to_json: ::buffa::type_registry::any_to_json::<ReservedRange>,
2921        from_json: ::buffa::type_registry::any_from_json::<ReservedRange>,
2922        is_wkt: false,
2923    };
2924    #[cfg(feature = "text")]
2925    #[doc(hidden)]
2926    pub const __RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2927        type_url: "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange",
2928        text_encode: ::buffa::type_registry::any_encode_text::<ReservedRange>,
2929        text_merge: ::buffa::type_registry::any_merge_text::<ReservedRange>,
2930    };
2931    #[cfg(feature = "views")]
2932    #[doc(inline)]
2933    pub use super::__buffa::view::descriptor_proto::ExtensionRangeView;
2934    #[cfg(feature = "views")]
2935    #[doc(inline)]
2936    pub use super::__buffa::view::descriptor_proto::ExtensionRangeOwnedView;
2937    #[cfg(feature = "views")]
2938    #[doc(inline)]
2939    pub use super::__buffa::view::descriptor_proto::ReservedRangeView;
2940    #[cfg(feature = "views")]
2941    #[doc(inline)]
2942    pub use super::__buffa::view::descriptor_proto::ReservedRangeOwnedView;
2943}
2944#[derive(Clone, PartialEq, Default)]
2945#[cfg_attr(feature = "json", derive(::serde::Serialize))]
2946#[cfg_attr(feature = "json", serde(default))]
2947#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
2948pub struct ExtensionRangeOptions {
2949    /// The parser stores options it doesn't recognize here. See above.
2950    ///
2951    /// Field 999: `uninterpreted_option`
2952    #[cfg_attr(
2953        feature = "json",
2954        serde(
2955            rename = "uninterpretedOption",
2956            alias = "uninterpreted_option",
2957            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2958            deserialize_with = "::buffa::json_helpers::null_as_default"
2959        )
2960    )]
2961    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
2962    /// For external users: DO NOT USE. We are in the process of open sourcing
2963    /// extension declaration and executing internal cleanups before it can be
2964    /// used externally.
2965    ///
2966    /// Field 2: `declaration`
2967    #[cfg_attr(
2968        feature = "json",
2969        serde(
2970            rename = "declaration",
2971            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2972            deserialize_with = "::buffa::json_helpers::null_as_default"
2973        )
2974    )]
2975    pub declaration: ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
2976    /// Any features defined in the specific edition.
2977    ///
2978    /// Field 50: `features`
2979    #[cfg_attr(
2980        feature = "json",
2981        serde(
2982            rename = "features",
2983            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2984        )
2985    )]
2986    pub features: ::buffa::MessageField<FeatureSet>,
2987    /// The verification state of the range.
2988    /// TODO: flip the default to DECLARATION once all empty ranges
2989    /// are marked as UNVERIFIED.
2990    ///
2991    /// Field 3: `verification`
2992    #[cfg_attr(
2993        feature = "json",
2994        serde(
2995            rename = "verification",
2996            with = "::buffa::json_helpers::opt_closed_enum",
2997            skip_serializing_if = "::core::option::Option::is_none"
2998        )
2999    )]
3000    pub verification: ::core::option::Option<extension_range_options::VerificationState>,
3001    #[cfg_attr(feature = "json", serde(flatten))]
3002    #[doc(hidden)]
3003    pub __buffa_unknown_fields: __ExtensionRangeOptionsExtJson,
3004}
3005impl ::core::fmt::Debug for ExtensionRangeOptions {
3006    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3007        f.debug_struct("ExtensionRangeOptions")
3008            .field("uninterpreted_option", &self.uninterpreted_option)
3009            .field("declaration", &self.declaration)
3010            .field("features", &self.features)
3011            .field("verification", &self.verification)
3012            .finish()
3013    }
3014}
3015impl ExtensionRangeOptions {
3016    /// Protobuf type URL for this message, for use with `Any::pack` and
3017    /// `Any::unpack_if`.
3018    ///
3019    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3020    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
3021}
3022impl ExtensionRangeOptions {
3023    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3024    #[inline]
3025    ///Sets [`Self::verification`] to `Some(value)`, consuming and returning `self`.
3026    pub fn with_verification(
3027        mut self,
3028        value: impl Into<extension_range_options::VerificationState>,
3029    ) -> Self {
3030        self.verification = Some(value.into());
3031        self
3032    }
3033}
3034impl ::buffa::DefaultInstance for ExtensionRangeOptions {
3035    fn default_instance() -> &'static Self {
3036        static VALUE: ::buffa::__private::OnceBox<ExtensionRangeOptions> = ::buffa::__private::OnceBox::new();
3037        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
3038    }
3039}
3040impl ::buffa::MessageName for ExtensionRangeOptions {
3041    const PACKAGE: &'static str = "google.protobuf";
3042    const NAME: &'static str = "ExtensionRangeOptions";
3043    const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions";
3044    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
3045}
3046impl ::buffa::Message for ExtensionRangeOptions {
3047    /// Returns the total encoded size in bytes.
3048    ///
3049    /// The result is a `u32`; the protobuf specification requires all
3050    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3051    /// compliant message will never overflow this type.
3052    #[allow(clippy::let_and_return)]
3053    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3054        #[allow(unused_imports)]
3055        use ::buffa::Enumeration as _;
3056        let mut size = 0u32;
3057        for v in &self.declaration {
3058            let __slot = __cache.reserve();
3059            let inner_size = v.compute_size(__cache);
3060            __cache.set(__slot, inner_size);
3061            size
3062                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3063                    + inner_size;
3064        }
3065        if let Some(ref v) = self.verification {
3066            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
3067        }
3068        if self.features.is_set() {
3069            let __slot = __cache.reserve();
3070            let inner_size = self.features.compute_size(__cache);
3071            __cache.set(__slot, inner_size);
3072            size
3073                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3074                    + inner_size;
3075        }
3076        for v in &self.uninterpreted_option {
3077            let __slot = __cache.reserve();
3078            let inner_size = v.compute_size(__cache);
3079            __cache.set(__slot, inner_size);
3080            size
3081                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3082                    + inner_size;
3083        }
3084        size += self.__buffa_unknown_fields.encoded_len() as u32;
3085        size
3086    }
3087    fn write_to(
3088        &self,
3089        __cache: &mut ::buffa::SizeCache,
3090        buf: &mut impl ::buffa::bytes::BufMut,
3091    ) {
3092        #[allow(unused_imports)]
3093        use ::buffa::Enumeration as _;
3094        for v in &self.declaration {
3095            ::buffa::encoding::Tag::new(
3096                    2u32,
3097                    ::buffa::encoding::WireType::LengthDelimited,
3098                )
3099                .encode(buf);
3100            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
3101            v.write_to(__cache, buf);
3102        }
3103        if let Some(ref v) = self.verification {
3104            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
3105                .encode(buf);
3106            ::buffa::types::encode_int32(v.to_i32(), buf);
3107        }
3108        if self.features.is_set() {
3109            ::buffa::encoding::Tag::new(
3110                    50u32,
3111                    ::buffa::encoding::WireType::LengthDelimited,
3112                )
3113                .encode(buf);
3114            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
3115            self.features.write_to(__cache, buf);
3116        }
3117        for v in &self.uninterpreted_option {
3118            ::buffa::encoding::Tag::new(
3119                    999u32,
3120                    ::buffa::encoding::WireType::LengthDelimited,
3121                )
3122                .encode(buf);
3123            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
3124            v.write_to(__cache, buf);
3125        }
3126        self.__buffa_unknown_fields.write_to(buf);
3127    }
3128    fn merge_field(
3129        &mut self,
3130        tag: ::buffa::encoding::Tag,
3131        buf: &mut impl ::buffa::bytes::Buf,
3132        depth: u32,
3133    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3134        #[allow(unused_imports)]
3135        use ::buffa::bytes::Buf as _;
3136        #[allow(unused_imports)]
3137        use ::buffa::Enumeration as _;
3138        match tag.field_number() {
3139            2u32 => {
3140                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3141                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3142                        field_number: 2u32,
3143                        expected: 2u8,
3144                        actual: tag.wire_type() as u8,
3145                    });
3146                }
3147                let mut elem = ::core::default::Default::default();
3148                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
3149                self.declaration.push(elem);
3150            }
3151            3u32 => {
3152                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3153                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3154                        field_number: 3u32,
3155                        expected: 0u8,
3156                        actual: tag.wire_type() as u8,
3157                    });
3158                }
3159                let __raw = ::buffa::types::decode_int32(buf)?;
3160                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
3161                    __raw,
3162                ) {
3163                    self.verification = ::core::option::Option::Some(__v);
3164                } else {
3165                    self.__buffa_unknown_fields
3166                        .push(::buffa::UnknownField {
3167                            number: 3u32,
3168                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
3169                        });
3170                }
3171            }
3172            50u32 => {
3173                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3174                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3175                        field_number: 50u32,
3176                        expected: 2u8,
3177                        actual: tag.wire_type() as u8,
3178                    });
3179                }
3180                ::buffa::Message::merge_length_delimited(
3181                    self.features.get_or_insert_default(),
3182                    buf,
3183                    depth,
3184                )?;
3185            }
3186            999u32 => {
3187                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3188                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3189                        field_number: 999u32,
3190                        expected: 2u8,
3191                        actual: tag.wire_type() as u8,
3192                    });
3193                }
3194                let mut elem = ::core::default::Default::default();
3195                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
3196                self.uninterpreted_option.push(elem);
3197            }
3198            _ => {
3199                self.__buffa_unknown_fields
3200                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
3201            }
3202        }
3203        ::core::result::Result::Ok(())
3204    }
3205    fn clear(&mut self) {
3206        self.declaration.clear();
3207        self.verification = ::core::option::Option::None;
3208        self.features = ::buffa::MessageField::none();
3209        self.uninterpreted_option.clear();
3210        self.__buffa_unknown_fields.clear();
3211    }
3212}
3213impl ::buffa::ExtensionSet for ExtensionRangeOptions {
3214    const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions";
3215    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3216        &self.__buffa_unknown_fields
3217    }
3218    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3219        &mut self.__buffa_unknown_fields
3220    }
3221}
3222#[cfg(feature = "text")]
3223impl ::buffa::text::TextFormat for ExtensionRangeOptions {
3224    fn encode_text(
3225        &self,
3226        enc: &mut ::buffa::text::TextEncoder<'_>,
3227    ) -> ::core::fmt::Result {
3228        #[allow(unused_imports)]
3229        use ::buffa::Enumeration as _;
3230        if self.features.is_set() {
3231            enc.write_field_name("features")?;
3232            enc.write_message(&*self.features)?;
3233        }
3234        if let ::core::option::Option::Some(ref __v) = self.verification {
3235            enc.write_field_name("verification")?;
3236            enc.write_enum_name(__v.proto_name())?;
3237        }
3238        for __v in &self.uninterpreted_option {
3239            enc.write_field_name("uninterpreted_option")?;
3240            enc.write_message(__v)?;
3241        }
3242        for __v in &self.declaration {
3243            enc.write_field_name("declaration")?;
3244            enc.write_message(__v)?;
3245        }
3246        enc.write_extension_fields(
3247            "google.protobuf.ExtensionRangeOptions",
3248            &self.__buffa_unknown_fields,
3249        )?;
3250        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
3251        ::core::result::Result::Ok(())
3252    }
3253    fn merge_text(
3254        &mut self,
3255        dec: &mut ::buffa::text::TextDecoder<'_>,
3256    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
3257        #[allow(unused_imports)]
3258        use ::buffa::Enumeration as _;
3259        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
3260            match __name {
3261                "features" => dec.merge_message(self.features.get_or_insert_default())?,
3262                "verification" => {
3263                    self.verification = ::core::option::Option::Some(
3264                        dec
3265                            .read_closed_enum_by_name::<
3266                                extension_range_options::VerificationState,
3267                            >()?,
3268                    );
3269                }
3270                "uninterpreted_option" => {
3271                    dec.read_repeated_into(
3272                        &mut self.uninterpreted_option,
3273                        |__d| {
3274                            let mut __m = ::core::default::Default::default();
3275                            __d.merge_message(&mut __m)?;
3276                            ::core::result::Result::Ok(__m)
3277                        },
3278                    )?
3279                }
3280                "declaration" => {
3281                    dec.read_repeated_into(
3282                        &mut self.declaration,
3283                        |__d| {
3284                            let mut __m = ::core::default::Default::default();
3285                            __d.merge_message(&mut __m)?;
3286                            ::core::result::Result::Ok(__m)
3287                        },
3288                    )?
3289                }
3290                __name if __name.starts_with('[') => {
3291                    for __r in dec
3292                        .read_extension(__name, "google.protobuf.ExtensionRangeOptions")?
3293                    {
3294                        self.__buffa_unknown_fields.push(__r);
3295                    }
3296                }
3297                _ => dec.skip_value()?,
3298            }
3299        }
3300        ::core::result::Result::Ok(())
3301    }
3302}
3303#[cfg(feature = "json")]
3304impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions {
3305    fn deserialize<D: serde::Deserializer<'de>>(
3306        d: D,
3307    ) -> ::core::result::Result<Self, D::Error> {
3308        struct _V;
3309        impl<'de> serde::de::Visitor<'de> for _V {
3310            type Value = ExtensionRangeOptions;
3311            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3312                f.write_str("struct ExtensionRangeOptions")
3313            }
3314            #[allow(clippy::field_reassign_with_default)]
3315            fn visit_map<A: serde::de::MapAccess<'de>>(
3316                self,
3317                mut map: A,
3318            ) -> ::core::result::Result<ExtensionRangeOptions, A::Error> {
3319                let mut __f_uninterpreted_option: ::core::option::Option<
3320                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
3321                > = None;
3322                let mut __f_declaration: ::core::option::Option<
3323                    ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
3324                > = None;
3325                let mut __f_features: ::core::option::Option<
3326                    ::buffa::MessageField<FeatureSet>,
3327                > = None;
3328                let mut __f_verification: ::core::option::Option<
3329                    ::core::option::Option<extension_range_options::VerificationState>,
3330                > = None;
3331                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
3332                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
3333                    match key.as_str() {
3334                        "uninterpretedOption" | "uninterpreted_option" => {
3335                            __f_uninterpreted_option = Some({
3336                                struct _S;
3337                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3338                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
3339                                    fn deserialize<D: serde::Deserializer<'de>>(
3340                                        self,
3341                                        d: D,
3342                                    ) -> ::core::result::Result<
3343                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
3344                                        D::Error,
3345                                    > {
3346                                        ::buffa::json_helpers::null_as_default(d)
3347                                    }
3348                                }
3349                                map.next_value_seed(_S)?
3350                            });
3351                        }
3352                        "declaration" => {
3353                            __f_declaration = Some({
3354                                struct _S;
3355                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3356                                    type Value = ::buffa::alloc::vec::Vec<
3357                                        extension_range_options::Declaration,
3358                                    >;
3359                                    fn deserialize<D: serde::Deserializer<'de>>(
3360                                        self,
3361                                        d: D,
3362                                    ) -> ::core::result::Result<
3363                                        ::buffa::alloc::vec::Vec<
3364                                            extension_range_options::Declaration,
3365                                        >,
3366                                        D::Error,
3367                                    > {
3368                                        ::buffa::json_helpers::null_as_default(d)
3369                                    }
3370                                }
3371                                map.next_value_seed(_S)?
3372                            });
3373                        }
3374                        "features" => {
3375                            __f_features = Some(
3376                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
3377                            );
3378                        }
3379                        "verification" => {
3380                            __f_verification = Some({
3381                                struct _S;
3382                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
3383                                    type Value = ::core::option::Option<
3384                                        extension_range_options::VerificationState,
3385                                    >;
3386                                    fn deserialize<D: serde::Deserializer<'de>>(
3387                                        self,
3388                                        d: D,
3389                                    ) -> ::core::result::Result<
3390                                        ::core::option::Option<
3391                                            extension_range_options::VerificationState,
3392                                        >,
3393                                        D::Error,
3394                                    > {
3395                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
3396                                    }
3397                                }
3398                                map.next_value_seed(_S)?
3399                            });
3400                        }
3401                        __k if __k.starts_with('[') => {
3402                            let __v: ::buffa::serde_json::Value = map.next_value()?;
3403                            match ::buffa::extension_registry::deserialize_extension_key(
3404                                "google.protobuf.ExtensionRangeOptions",
3405                                __k,
3406                                __v,
3407                            ) {
3408                                ::core::option::Option::Some(
3409                                    ::core::result::Result::Ok(__recs),
3410                                ) => {
3411                                    for __rec in __recs {
3412                                        __ext_records.push(__rec);
3413                                    }
3414                                }
3415                                ::core::option::Option::Some(
3416                                    ::core::result::Result::Err(__e),
3417                                ) => {
3418                                    return ::core::result::Result::Err(
3419                                        <A::Error as ::serde::de::Error>::custom(__e),
3420                                    );
3421                                }
3422                                ::core::option::Option::None => {}
3423                            }
3424                        }
3425                        _ => {
3426                            map.next_value::<serde::de::IgnoredAny>()?;
3427                        }
3428                    }
3429                }
3430                let mut __r = <ExtensionRangeOptions as ::core::default::Default>::default();
3431                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
3432                    __r.uninterpreted_option = v;
3433                }
3434                if let ::core::option::Option::Some(v) = __f_declaration {
3435                    __r.declaration = v;
3436                }
3437                if let ::core::option::Option::Some(v) = __f_features {
3438                    __r.features = v;
3439                }
3440                if let ::core::option::Option::Some(v) = __f_verification {
3441                    __r.verification = v;
3442                }
3443                for __rec in __ext_records {
3444                    __r.__buffa_unknown_fields.push(__rec);
3445                }
3446                Ok(__r)
3447            }
3448        }
3449        d.deserialize_map(_V)
3450    }
3451}
3452#[cfg(feature = "json")]
3453impl ::buffa::json_helpers::ProtoElemJson for ExtensionRangeOptions {
3454    fn serialize_proto_json<S: ::serde::Serializer>(
3455        v: &Self,
3456        s: S,
3457    ) -> ::core::result::Result<S::Ok, S::Error> {
3458        ::serde::Serialize::serialize(v, s)
3459    }
3460    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3461        d: D,
3462    ) -> ::core::result::Result<Self, D::Error> {
3463        <Self as ::serde::Deserialize>::deserialize(d)
3464    }
3465}
3466#[doc(hidden)]
3467#[derive(Clone, Debug, Default, PartialEq)]
3468#[repr(transparent)]
3469#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3470pub struct __ExtensionRangeOptionsExtJson(pub ::buffa::UnknownFields);
3471impl ::core::ops::Deref for __ExtensionRangeOptionsExtJson {
3472    type Target = ::buffa::UnknownFields;
3473    fn deref(&self) -> &::buffa::UnknownFields {
3474        &self.0
3475    }
3476}
3477impl ::core::ops::DerefMut for __ExtensionRangeOptionsExtJson {
3478    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
3479        &mut self.0
3480    }
3481}
3482impl ::core::convert::From<::buffa::UnknownFields> for __ExtensionRangeOptionsExtJson {
3483    fn from(u: ::buffa::UnknownFields) -> Self {
3484        Self(u)
3485    }
3486}
3487#[cfg(feature = "json")]
3488impl ::serde::Serialize for __ExtensionRangeOptionsExtJson {
3489    fn serialize<S: ::serde::Serializer>(
3490        &self,
3491        s: S,
3492    ) -> ::core::result::Result<S::Ok, S::Error> {
3493        ::buffa::extension_registry::serialize_extensions(
3494            "google.protobuf.ExtensionRangeOptions",
3495            &self.0,
3496            s,
3497        )
3498    }
3499}
3500#[cfg(feature = "json")]
3501impl<'de> ::serde::Deserialize<'de> for __ExtensionRangeOptionsExtJson {
3502    fn deserialize<D: ::serde::Deserializer<'de>>(
3503        d: D,
3504    ) -> ::core::result::Result<Self, D::Error> {
3505        ::buffa::extension_registry::deserialize_extensions(
3506                "google.protobuf.ExtensionRangeOptions",
3507                d,
3508            )
3509            .map(Self)
3510    }
3511}
3512#[cfg(feature = "json")]
3513#[doc(hidden)]
3514pub const __EXTENSION_RANGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3515    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3516    to_json: ::buffa::type_registry::any_to_json::<ExtensionRangeOptions>,
3517    from_json: ::buffa::type_registry::any_from_json::<ExtensionRangeOptions>,
3518    is_wkt: false,
3519};
3520#[cfg(feature = "text")]
3521#[doc(hidden)]
3522pub const __EXTENSION_RANGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
3523    type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions",
3524    text_encode: ::buffa::type_registry::any_encode_text::<ExtensionRangeOptions>,
3525    text_merge: ::buffa::type_registry::any_merge_text::<ExtensionRangeOptions>,
3526};
3527pub mod extension_range_options {
3528    #[allow(unused_imports)]
3529    use super::*;
3530    /// The verification state of the extension range.
3531    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
3532    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3533    #[repr(i32)]
3534    pub enum VerificationState {
3535        /// All the extensions of the range must be declared.
3536        DECLARATION = 0i32,
3537        UNVERIFIED = 1i32,
3538    }
3539    impl VerificationState {
3540        ///Idiomatic alias for [`Self::DECLARATION`]; `Debug` prints the variant name.
3541        #[allow(non_upper_case_globals)]
3542        pub const Declaration: Self = Self::DECLARATION;
3543        ///Idiomatic alias for [`Self::UNVERIFIED`]; `Debug` prints the variant name.
3544        #[allow(non_upper_case_globals)]
3545        pub const Unverified: Self = Self::UNVERIFIED;
3546    }
3547    impl ::core::default::Default for VerificationState {
3548        fn default() -> Self {
3549            Self::DECLARATION
3550        }
3551    }
3552    #[cfg(feature = "json")]
3553    const _: () = {
3554        impl ::serde::Serialize for VerificationState {
3555            fn serialize<S: ::serde::Serializer>(
3556                &self,
3557                s: S,
3558            ) -> ::core::result::Result<S::Ok, S::Error> {
3559                s.serialize_str(::buffa::Enumeration::proto_name(self))
3560            }
3561        }
3562        impl<'de> ::serde::Deserialize<'de> for VerificationState {
3563            fn deserialize<D: ::serde::Deserializer<'de>>(
3564                d: D,
3565            ) -> ::core::result::Result<Self, D::Error> {
3566                struct _V;
3567                impl ::serde::de::Visitor<'_> for _V {
3568                    type Value = VerificationState;
3569                    fn expecting(
3570                        &self,
3571                        f: &mut ::core::fmt::Formatter<'_>,
3572                    ) -> ::core::fmt::Result {
3573                        f.write_str(
3574                            concat!(
3575                                "a string, integer, or null for ",
3576                                stringify!(VerificationState)
3577                            ),
3578                        )
3579                    }
3580                    fn visit_str<E: ::serde::de::Error>(
3581                        self,
3582                        v: &str,
3583                    ) -> ::core::result::Result<VerificationState, E> {
3584                        <VerificationState as ::buffa::Enumeration>::from_proto_name(v)
3585                            .ok_or_else(|| {
3586                                ::serde::de::Error::unknown_variant(v, &[])
3587                            })
3588                    }
3589                    fn visit_i64<E: ::serde::de::Error>(
3590                        self,
3591                        v: i64,
3592                    ) -> ::core::result::Result<VerificationState, E> {
3593                        let v32 = i32::try_from(v)
3594                            .map_err(|_| {
3595                                ::serde::de::Error::custom(
3596                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3597                                )
3598                            })?;
3599                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3600                            .ok_or_else(|| {
3601                                ::serde::de::Error::custom(
3602                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3603                                )
3604                            })
3605                    }
3606                    fn visit_u64<E: ::serde::de::Error>(
3607                        self,
3608                        v: u64,
3609                    ) -> ::core::result::Result<VerificationState, E> {
3610                        let v32 = i32::try_from(v)
3611                            .map_err(|_| {
3612                                ::serde::de::Error::custom(
3613                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
3614                                )
3615                            })?;
3616                        <VerificationState as ::buffa::Enumeration>::from_i32(v32)
3617                            .ok_or_else(|| {
3618                                ::serde::de::Error::custom(
3619                                    ::buffa::alloc::format!("unknown enum value {v32}"),
3620                                )
3621                            })
3622                    }
3623                    fn visit_unit<E: ::serde::de::Error>(
3624                        self,
3625                    ) -> ::core::result::Result<VerificationState, E> {
3626                        ::core::result::Result::Ok(::core::default::Default::default())
3627                    }
3628                }
3629                d.deserialize_any(_V)
3630            }
3631        }
3632        impl ::buffa::json_helpers::ProtoElemJson for VerificationState {
3633            fn serialize_proto_json<S: ::serde::Serializer>(
3634                v: &Self,
3635                s: S,
3636            ) -> ::core::result::Result<S::Ok, S::Error> {
3637                ::serde::Serialize::serialize(v, s)
3638            }
3639            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3640                d: D,
3641            ) -> ::core::result::Result<Self, D::Error> {
3642                <Self as ::serde::Deserialize>::deserialize(d)
3643            }
3644        }
3645    };
3646    impl ::buffa::Enumeration for VerificationState {
3647        fn from_i32(value: i32) -> ::core::option::Option<Self> {
3648            match value {
3649                0i32 => ::core::option::Option::Some(Self::DECLARATION),
3650                1i32 => ::core::option::Option::Some(Self::UNVERIFIED),
3651                _ => ::core::option::Option::None,
3652            }
3653        }
3654        fn to_i32(&self) -> i32 {
3655            *self as i32
3656        }
3657        fn proto_name(&self) -> &'static str {
3658            match self {
3659                Self::DECLARATION => "DECLARATION",
3660                Self::UNVERIFIED => "UNVERIFIED",
3661            }
3662        }
3663        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
3664            match name {
3665                "DECLARATION" => ::core::option::Option::Some(Self::DECLARATION),
3666                "UNVERIFIED" => ::core::option::Option::Some(Self::UNVERIFIED),
3667                _ => ::core::option::Option::None,
3668            }
3669        }
3670        fn values() -> &'static [Self] {
3671            &[Self::DECLARATION, Self::UNVERIFIED]
3672        }
3673    }
3674    #[derive(Clone, PartialEq, Default)]
3675    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
3676    #[cfg_attr(feature = "json", serde(default))]
3677    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
3678    pub struct Declaration {
3679        /// The extension number declared within the extension range.
3680        ///
3681        /// Field 1: `number`
3682        #[cfg_attr(
3683            feature = "json",
3684            serde(
3685                rename = "number",
3686                with = "::buffa::json_helpers::opt_int32",
3687                skip_serializing_if = "::core::option::Option::is_none"
3688            )
3689        )]
3690        pub number: ::core::option::Option<i32>,
3691        /// The fully-qualified name of the extension field. There must be a leading
3692        /// dot in front of the full name.
3693        ///
3694        /// Field 2: `full_name`
3695        #[cfg_attr(
3696            feature = "json",
3697            serde(
3698                rename = "fullName",
3699                alias = "full_name",
3700                skip_serializing_if = "::core::option::Option::is_none"
3701            )
3702        )]
3703        pub full_name: ::core::option::Option<::buffa::alloc::string::String>,
3704        /// The fully-qualified type name of the extension field. Unlike
3705        /// Metadata.type, Declaration.type must have a leading dot for messages
3706        /// and enums.
3707        ///
3708        /// Field 3: `type`
3709        #[cfg_attr(
3710            feature = "json",
3711            serde(
3712                rename = "type",
3713                skip_serializing_if = "::core::option::Option::is_none"
3714            )
3715        )]
3716        pub r#type: ::core::option::Option<::buffa::alloc::string::String>,
3717        /// If true, indicates that the number is reserved in the extension range,
3718        /// and any extension field with the number will fail to compile. Set this
3719        /// when a declared extension field is deleted.
3720        ///
3721        /// Field 5: `reserved`
3722        #[cfg_attr(
3723            feature = "json",
3724            serde(
3725                rename = "reserved",
3726                skip_serializing_if = "::core::option::Option::is_none"
3727            )
3728        )]
3729        pub reserved: ::core::option::Option<bool>,
3730        /// If true, indicates that the extension must be defined as repeated.
3731        /// Otherwise the extension must be defined as optional.
3732        ///
3733        /// Field 6: `repeated`
3734        #[cfg_attr(
3735            feature = "json",
3736            serde(
3737                rename = "repeated",
3738                skip_serializing_if = "::core::option::Option::is_none"
3739            )
3740        )]
3741        pub repeated: ::core::option::Option<bool>,
3742        #[cfg_attr(feature = "json", serde(skip))]
3743        #[doc(hidden)]
3744        pub __buffa_unknown_fields: ::buffa::UnknownFields,
3745    }
3746    impl ::core::fmt::Debug for Declaration {
3747        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3748            f.debug_struct("Declaration")
3749                .field("number", &self.number)
3750                .field("full_name", &self.full_name)
3751                .field("type", &self.r#type)
3752                .field("reserved", &self.reserved)
3753                .field("repeated", &self.repeated)
3754                .finish()
3755        }
3756    }
3757    impl Declaration {
3758        /// Protobuf type URL for this message, for use with `Any::pack` and
3759        /// `Any::unpack_if`.
3760        ///
3761        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3762        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3763    }
3764    impl Declaration {
3765        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3766        #[inline]
3767        ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
3768        pub fn with_number(mut self, value: i32) -> Self {
3769            self.number = Some(value);
3770            self
3771        }
3772        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3773        #[inline]
3774        ///Sets [`Self::full_name`] to `Some(value)`, consuming and returning `self`.
3775        pub fn with_full_name(
3776            mut self,
3777            value: impl Into<::buffa::alloc::string::String>,
3778        ) -> Self {
3779            self.full_name = Some(value.into());
3780            self
3781        }
3782        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3783        #[inline]
3784        ///Sets `type` to `Some(value)`, consuming and returning `self`.
3785        pub fn with_type(
3786            mut self,
3787            value: impl Into<::buffa::alloc::string::String>,
3788        ) -> Self {
3789            self.r#type = Some(value.into());
3790            self
3791        }
3792        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3793        #[inline]
3794        ///Sets [`Self::reserved`] to `Some(value)`, consuming and returning `self`.
3795        pub fn with_reserved(mut self, value: bool) -> Self {
3796            self.reserved = Some(value);
3797            self
3798        }
3799        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
3800        #[inline]
3801        ///Sets [`Self::repeated`] to `Some(value)`, consuming and returning `self`.
3802        pub fn with_repeated(mut self, value: bool) -> Self {
3803            self.repeated = Some(value);
3804            self
3805        }
3806    }
3807    impl ::buffa::DefaultInstance for Declaration {
3808        fn default_instance() -> &'static Self {
3809            static VALUE: ::buffa::__private::OnceBox<Declaration> = ::buffa::__private::OnceBox::new();
3810            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
3811        }
3812    }
3813    impl ::buffa::MessageName for Declaration {
3814        const PACKAGE: &'static str = "google.protobuf";
3815        const NAME: &'static str = "ExtensionRangeOptions.Declaration";
3816        const FULL_NAME: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3817        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
3818    }
3819    impl ::buffa::Message for Declaration {
3820        /// Returns the total encoded size in bytes.
3821        ///
3822        /// The result is a `u32`; the protobuf specification requires all
3823        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3824        /// compliant message will never overflow this type.
3825        #[allow(clippy::let_and_return)]
3826        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3827            #[allow(unused_imports)]
3828            use ::buffa::Enumeration as _;
3829            let mut size = 0u32;
3830            if let Some(v) = self.number {
3831                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
3832            }
3833            if let Some(ref v) = self.full_name {
3834                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3835            }
3836            if let Some(ref v) = self.r#type {
3837                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3838            }
3839            if self.reserved.is_some() {
3840                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3841            }
3842            if self.repeated.is_some() {
3843                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3844            }
3845            size += self.__buffa_unknown_fields.encoded_len() as u32;
3846            size
3847        }
3848        fn write_to(
3849            &self,
3850            _cache: &mut ::buffa::SizeCache,
3851            buf: &mut impl ::buffa::bytes::BufMut,
3852        ) {
3853            #[allow(unused_imports)]
3854            use ::buffa::Enumeration as _;
3855            if let Some(v) = self.number {
3856                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
3857                    .encode(buf);
3858                ::buffa::types::encode_int32(v, buf);
3859            }
3860            if let Some(ref v) = self.full_name {
3861                ::buffa::encoding::Tag::new(
3862                        2u32,
3863                        ::buffa::encoding::WireType::LengthDelimited,
3864                    )
3865                    .encode(buf);
3866                ::buffa::types::encode_string(v, buf);
3867            }
3868            if let Some(ref v) = self.r#type {
3869                ::buffa::encoding::Tag::new(
3870                        3u32,
3871                        ::buffa::encoding::WireType::LengthDelimited,
3872                    )
3873                    .encode(buf);
3874                ::buffa::types::encode_string(v, buf);
3875            }
3876            if let Some(v) = self.reserved {
3877                ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
3878                    .encode(buf);
3879                ::buffa::types::encode_bool(v, buf);
3880            }
3881            if let Some(v) = self.repeated {
3882                ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
3883                    .encode(buf);
3884                ::buffa::types::encode_bool(v, buf);
3885            }
3886            self.__buffa_unknown_fields.write_to(buf);
3887        }
3888        fn merge_field(
3889            &mut self,
3890            tag: ::buffa::encoding::Tag,
3891            buf: &mut impl ::buffa::bytes::Buf,
3892            depth: u32,
3893        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3894            #[allow(unused_imports)]
3895            use ::buffa::bytes::Buf as _;
3896            #[allow(unused_imports)]
3897            use ::buffa::Enumeration as _;
3898            match tag.field_number() {
3899                1u32 => {
3900                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3901                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3902                            field_number: 1u32,
3903                            expected: 0u8,
3904                            actual: tag.wire_type() as u8,
3905                        });
3906                    }
3907                    self.number = ::core::option::Option::Some(
3908                        ::buffa::types::decode_int32(buf)?,
3909                    );
3910                }
3911                2u32 => {
3912                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3913                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3914                            field_number: 2u32,
3915                            expected: 2u8,
3916                            actual: tag.wire_type() as u8,
3917                        });
3918                    }
3919                    ::buffa::types::merge_string(
3920                        self
3921                            .full_name
3922                            .get_or_insert_with(::buffa::alloc::string::String::new),
3923                        buf,
3924                    )?;
3925                }
3926                3u32 => {
3927                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3928                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3929                            field_number: 3u32,
3930                            expected: 2u8,
3931                            actual: tag.wire_type() as u8,
3932                        });
3933                    }
3934                    ::buffa::types::merge_string(
3935                        self
3936                            .r#type
3937                            .get_or_insert_with(::buffa::alloc::string::String::new),
3938                        buf,
3939                    )?;
3940                }
3941                5u32 => {
3942                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3943                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3944                            field_number: 5u32,
3945                            expected: 0u8,
3946                            actual: tag.wire_type() as u8,
3947                        });
3948                    }
3949                    self.reserved = ::core::option::Option::Some(
3950                        ::buffa::types::decode_bool(buf)?,
3951                    );
3952                }
3953                6u32 => {
3954                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3955                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3956                            field_number: 6u32,
3957                            expected: 0u8,
3958                            actual: tag.wire_type() as u8,
3959                        });
3960                    }
3961                    self.repeated = ::core::option::Option::Some(
3962                        ::buffa::types::decode_bool(buf)?,
3963                    );
3964                }
3965                _ => {
3966                    self.__buffa_unknown_fields
3967                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
3968                }
3969            }
3970            ::core::result::Result::Ok(())
3971        }
3972        fn clear(&mut self) {
3973            self.number = ::core::option::Option::None;
3974            self.full_name = ::core::option::Option::None;
3975            self.r#type = ::core::option::Option::None;
3976            self.reserved = ::core::option::Option::None;
3977            self.repeated = ::core::option::Option::None;
3978            self.__buffa_unknown_fields.clear();
3979        }
3980    }
3981    impl ::buffa::ExtensionSet for Declaration {
3982        const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
3983        fn unknown_fields(&self) -> &::buffa::UnknownFields {
3984            &self.__buffa_unknown_fields
3985        }
3986        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3987            &mut self.__buffa_unknown_fields
3988        }
3989    }
3990    #[cfg(feature = "text")]
3991    impl ::buffa::text::TextFormat for Declaration {
3992        fn encode_text(
3993            &self,
3994            enc: &mut ::buffa::text::TextEncoder<'_>,
3995        ) -> ::core::fmt::Result {
3996            #[allow(unused_imports)]
3997            use ::buffa::Enumeration as _;
3998            if let ::core::option::Option::Some(ref __v) = self.number {
3999                enc.write_field_name("number")?;
4000                enc.write_i32(*__v)?;
4001            }
4002            if let ::core::option::Option::Some(ref __v) = self.full_name {
4003                enc.write_field_name("full_name")?;
4004                enc.write_string(__v)?;
4005            }
4006            if let ::core::option::Option::Some(ref __v) = self.r#type {
4007                enc.write_field_name("type")?;
4008                enc.write_string(__v)?;
4009            }
4010            if let ::core::option::Option::Some(ref __v) = self.reserved {
4011                enc.write_field_name("reserved")?;
4012                enc.write_bool(*__v)?;
4013            }
4014            if let ::core::option::Option::Some(ref __v) = self.repeated {
4015                enc.write_field_name("repeated")?;
4016                enc.write_bool(*__v)?;
4017            }
4018            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
4019            ::core::result::Result::Ok(())
4020        }
4021        fn merge_text(
4022            &mut self,
4023            dec: &mut ::buffa::text::TextDecoder<'_>,
4024        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
4025            #[allow(unused_imports)]
4026            use ::buffa::Enumeration as _;
4027            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
4028                match __name {
4029                    "number" => {
4030                        self.number = ::core::option::Option::Some(dec.read_i32()?);
4031                    }
4032                    "full_name" => {
4033                        self.full_name = ::core::option::Option::Some(
4034                            dec.read_string()?.into_owned(),
4035                        );
4036                    }
4037                    "type" => {
4038                        self.r#type = ::core::option::Option::Some(
4039                            dec.read_string()?.into_owned(),
4040                        );
4041                    }
4042                    "reserved" => {
4043                        self.reserved = ::core::option::Option::Some(dec.read_bool()?);
4044                    }
4045                    "repeated" => {
4046                        self.repeated = ::core::option::Option::Some(dec.read_bool()?);
4047                    }
4048                    _ => dec.skip_value()?,
4049                }
4050            }
4051            ::core::result::Result::Ok(())
4052        }
4053    }
4054    #[cfg(feature = "json")]
4055    impl ::buffa::json_helpers::ProtoElemJson for Declaration {
4056        fn serialize_proto_json<S: ::serde::Serializer>(
4057            v: &Self,
4058            s: S,
4059        ) -> ::core::result::Result<S::Ok, S::Error> {
4060            ::serde::Serialize::serialize(v, s)
4061        }
4062        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4063            d: D,
4064        ) -> ::core::result::Result<Self, D::Error> {
4065            <Self as ::serde::Deserialize>::deserialize(d)
4066        }
4067    }
4068    #[cfg(feature = "json")]
4069    #[doc(hidden)]
4070    pub const __DECLARATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4071        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
4072        to_json: ::buffa::type_registry::any_to_json::<Declaration>,
4073        from_json: ::buffa::type_registry::any_from_json::<Declaration>,
4074        is_wkt: false,
4075    };
4076    #[cfg(feature = "text")]
4077    #[doc(hidden)]
4078    pub const __DECLARATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
4079        type_url: "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration",
4080        text_encode: ::buffa::type_registry::any_encode_text::<Declaration>,
4081        text_merge: ::buffa::type_registry::any_merge_text::<Declaration>,
4082    };
4083    #[cfg(feature = "views")]
4084    #[doc(inline)]
4085    pub use super::__buffa::view::extension_range_options::DeclarationView;
4086    #[cfg(feature = "views")]
4087    #[doc(inline)]
4088    pub use super::__buffa::view::extension_range_options::DeclarationOwnedView;
4089}
4090/// Describes a field within a message.
4091#[derive(Clone, PartialEq, Default)]
4092#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
4093#[cfg_attr(feature = "json", serde(default))]
4094#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4095pub struct FieldDescriptorProto {
4096    /// Field 1: `name`
4097    #[cfg_attr(
4098        feature = "json",
4099        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
4100    )]
4101    pub name: ::core::option::Option<::buffa::alloc::string::String>,
4102    /// Field 3: `number`
4103    #[cfg_attr(
4104        feature = "json",
4105        serde(
4106            rename = "number",
4107            with = "::buffa::json_helpers::opt_int32",
4108            skip_serializing_if = "::core::option::Option::is_none"
4109        )
4110    )]
4111    pub number: ::core::option::Option<i32>,
4112    /// Field 4: `label`
4113    #[cfg_attr(
4114        feature = "json",
4115        serde(
4116            rename = "label",
4117            with = "::buffa::json_helpers::opt_closed_enum",
4118            skip_serializing_if = "::core::option::Option::is_none"
4119        )
4120    )]
4121    pub label: ::core::option::Option<field_descriptor_proto::Label>,
4122    /// If type_name is set, this need not be set.  If both this and type_name
4123    /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
4124    ///
4125    /// Field 5: `type`
4126    #[cfg_attr(
4127        feature = "json",
4128        serde(
4129            rename = "type",
4130            with = "::buffa::json_helpers::opt_closed_enum",
4131            skip_serializing_if = "::core::option::Option::is_none"
4132        )
4133    )]
4134    pub r#type: ::core::option::Option<field_descriptor_proto::Type>,
4135    /// For message and enum types, this is the name of the type.  If the name
4136    /// starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
4137    /// rules are used to find the type (i.e. first the nested types within this
4138    /// message are searched, then within the parent, on up to the root
4139    /// namespace).
4140    ///
4141    /// Field 6: `type_name`
4142    #[cfg_attr(
4143        feature = "json",
4144        serde(
4145            rename = "typeName",
4146            alias = "type_name",
4147            skip_serializing_if = "::core::option::Option::is_none"
4148        )
4149    )]
4150    pub type_name: ::core::option::Option<::buffa::alloc::string::String>,
4151    /// For extensions, this is the name of the type being extended.  It is
4152    /// resolved in the same manner as type_name.
4153    ///
4154    /// Field 2: `extendee`
4155    #[cfg_attr(
4156        feature = "json",
4157        serde(
4158            rename = "extendee",
4159            skip_serializing_if = "::core::option::Option::is_none"
4160        )
4161    )]
4162    pub extendee: ::core::option::Option<::buffa::alloc::string::String>,
4163    /// For numeric types, contains the original text representation of the value.
4164    /// For booleans, "true" or "false".
4165    /// For strings, contains the default text contents (not escaped in any way).
4166    /// For bytes, contains the C escaped value.  All bytes \>= 128 are escaped.
4167    ///
4168    /// Field 7: `default_value`
4169    #[cfg_attr(
4170        feature = "json",
4171        serde(
4172            rename = "defaultValue",
4173            alias = "default_value",
4174            skip_serializing_if = "::core::option::Option::is_none"
4175        )
4176    )]
4177    pub default_value: ::core::option::Option<::buffa::alloc::string::String>,
4178    /// If set, gives the index of a oneof in the containing type's oneof_decl
4179    /// list.  This field is a member of that oneof.
4180    ///
4181    /// Field 9: `oneof_index`
4182    #[cfg_attr(
4183        feature = "json",
4184        serde(
4185            rename = "oneofIndex",
4186            alias = "oneof_index",
4187            with = "::buffa::json_helpers::opt_int32",
4188            skip_serializing_if = "::core::option::Option::is_none"
4189        )
4190    )]
4191    pub oneof_index: ::core::option::Option<i32>,
4192    /// JSON name of this field. The value is set by protocol compiler. If the
4193    /// user has set a "json_name" option on this field, that option's value
4194    /// will be used. Otherwise, it's deduced from the field's name by converting
4195    /// it to camelCase.
4196    ///
4197    /// Field 10: `json_name`
4198    #[cfg_attr(
4199        feature = "json",
4200        serde(
4201            rename = "jsonName",
4202            alias = "json_name",
4203            skip_serializing_if = "::core::option::Option::is_none"
4204        )
4205    )]
4206    pub json_name: ::core::option::Option<::buffa::alloc::string::String>,
4207    /// Field 8: `options`
4208    #[cfg_attr(
4209        feature = "json",
4210        serde(
4211            rename = "options",
4212            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4213        )
4214    )]
4215    pub options: ::buffa::MessageField<FieldOptions>,
4216    /// If true, this is a proto3 "optional". When a proto3 field is optional, it
4217    /// tracks presence regardless of field type.
4218    ///
4219    /// When proto3_optional is true, this field must belong to a oneof to signal
4220    /// to old proto3 clients that presence is tracked for this field. This oneof
4221    /// is known as a "synthetic" oneof, and this field must be its sole member
4222    /// (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
4223    /// exist in the descriptor only, and do not generate any API. Synthetic oneofs
4224    /// must be ordered after all "real" oneofs.
4225    ///
4226    /// For message fields, proto3_optional doesn't create any semantic change,
4227    /// since non-repeated message fields always track presence. However it still
4228    /// indicates the semantic detail of whether the user wrote "optional" or not.
4229    /// This can be useful for round-tripping the .proto file. For consistency we
4230    /// give message fields a synthetic oneof also, even though it is not required
4231    /// to track presence. This is especially important because the parser can't
4232    /// tell if a field is a message or an enum, so it must always create a
4233    /// synthetic oneof.
4234    ///
4235    /// Proto2 optional fields do not set this flag, because they already indicate
4236    /// optional with `LABEL_OPTIONAL`.
4237    ///
4238    /// Field 17: `proto3_optional`
4239    #[cfg_attr(
4240        feature = "json",
4241        serde(
4242            rename = "proto3Optional",
4243            alias = "proto3_optional",
4244            skip_serializing_if = "::core::option::Option::is_none"
4245        )
4246    )]
4247    pub proto3_optional: ::core::option::Option<bool>,
4248    #[cfg_attr(feature = "json", serde(skip))]
4249    #[doc(hidden)]
4250    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4251}
4252impl ::core::fmt::Debug for FieldDescriptorProto {
4253    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4254        f.debug_struct("FieldDescriptorProto")
4255            .field("name", &self.name)
4256            .field("number", &self.number)
4257            .field("label", &self.label)
4258            .field("type", &self.r#type)
4259            .field("type_name", &self.type_name)
4260            .field("extendee", &self.extendee)
4261            .field("default_value", &self.default_value)
4262            .field("oneof_index", &self.oneof_index)
4263            .field("json_name", &self.json_name)
4264            .field("options", &self.options)
4265            .field("proto3_optional", &self.proto3_optional)
4266            .finish()
4267    }
4268}
4269impl FieldDescriptorProto {
4270    /// Protobuf type URL for this message, for use with `Any::pack` and
4271    /// `Any::unpack_if`.
4272    ///
4273    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4274    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4275}
4276impl FieldDescriptorProto {
4277    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4278    #[inline]
4279    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
4280    pub fn with_name(
4281        mut self,
4282        value: impl Into<::buffa::alloc::string::String>,
4283    ) -> Self {
4284        self.name = Some(value.into());
4285        self
4286    }
4287    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4288    #[inline]
4289    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
4290    pub fn with_number(mut self, value: i32) -> Self {
4291        self.number = Some(value);
4292        self
4293    }
4294    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4295    #[inline]
4296    ///Sets [`Self::label`] to `Some(value)`, consuming and returning `self`.
4297    pub fn with_label(
4298        mut self,
4299        value: impl Into<field_descriptor_proto::Label>,
4300    ) -> Self {
4301        self.label = Some(value.into());
4302        self
4303    }
4304    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4305    #[inline]
4306    ///Sets `type` to `Some(value)`, consuming and returning `self`.
4307    pub fn with_type(mut self, value: impl Into<field_descriptor_proto::Type>) -> Self {
4308        self.r#type = Some(value.into());
4309        self
4310    }
4311    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4312    #[inline]
4313    ///Sets [`Self::type_name`] to `Some(value)`, consuming and returning `self`.
4314    pub fn with_type_name(
4315        mut self,
4316        value: impl Into<::buffa::alloc::string::String>,
4317    ) -> Self {
4318        self.type_name = Some(value.into());
4319        self
4320    }
4321    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4322    #[inline]
4323    ///Sets [`Self::extendee`] to `Some(value)`, consuming and returning `self`.
4324    pub fn with_extendee(
4325        mut self,
4326        value: impl Into<::buffa::alloc::string::String>,
4327    ) -> Self {
4328        self.extendee = Some(value.into());
4329        self
4330    }
4331    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4332    #[inline]
4333    ///Sets [`Self::default_value`] to `Some(value)`, consuming and returning `self`.
4334    pub fn with_default_value(
4335        mut self,
4336        value: impl Into<::buffa::alloc::string::String>,
4337    ) -> Self {
4338        self.default_value = Some(value.into());
4339        self
4340    }
4341    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4342    #[inline]
4343    ///Sets [`Self::oneof_index`] to `Some(value)`, consuming and returning `self`.
4344    pub fn with_oneof_index(mut self, value: i32) -> Self {
4345        self.oneof_index = Some(value);
4346        self
4347    }
4348    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4349    #[inline]
4350    ///Sets [`Self::json_name`] to `Some(value)`, consuming and returning `self`.
4351    pub fn with_json_name(
4352        mut self,
4353        value: impl Into<::buffa::alloc::string::String>,
4354    ) -> Self {
4355        self.json_name = Some(value.into());
4356        self
4357    }
4358    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
4359    #[inline]
4360    ///Sets [`Self::proto3_optional`] to `Some(value)`, consuming and returning `self`.
4361    pub fn with_proto3_optional(mut self, value: bool) -> Self {
4362        self.proto3_optional = Some(value);
4363        self
4364    }
4365}
4366impl ::buffa::DefaultInstance for FieldDescriptorProto {
4367    fn default_instance() -> &'static Self {
4368        static VALUE: ::buffa::__private::OnceBox<FieldDescriptorProto> = ::buffa::__private::OnceBox::new();
4369        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
4370    }
4371}
4372impl ::buffa::MessageName for FieldDescriptorProto {
4373    const PACKAGE: &'static str = "google.protobuf";
4374    const NAME: &'static str = "FieldDescriptorProto";
4375    const FULL_NAME: &'static str = "google.protobuf.FieldDescriptorProto";
4376    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
4377}
4378impl ::buffa::Message for FieldDescriptorProto {
4379    /// Returns the total encoded size in bytes.
4380    ///
4381    /// The result is a `u32`; the protobuf specification requires all
4382    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4383    /// compliant message will never overflow this type.
4384    #[allow(clippy::let_and_return)]
4385    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4386        #[allow(unused_imports)]
4387        use ::buffa::Enumeration as _;
4388        let mut size = 0u32;
4389        if let Some(ref v) = self.name {
4390            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4391        }
4392        if let Some(ref v) = self.extendee {
4393            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4394        }
4395        if let Some(v) = self.number {
4396            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4397        }
4398        if let Some(ref v) = self.label {
4399            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
4400        }
4401        if let Some(ref v) = self.r#type {
4402            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
4403        }
4404        if let Some(ref v) = self.type_name {
4405            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4406        }
4407        if let Some(ref v) = self.default_value {
4408            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4409        }
4410        if self.options.is_set() {
4411            let __slot = __cache.reserve();
4412            let inner_size = self.options.compute_size(__cache);
4413            __cache.set(__slot, inner_size);
4414            size
4415                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4416                    + inner_size;
4417        }
4418        if let Some(v) = self.oneof_index {
4419            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4420        }
4421        if let Some(ref v) = self.json_name {
4422            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4423        }
4424        if self.proto3_optional.is_some() {
4425            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4426        }
4427        size += self.__buffa_unknown_fields.encoded_len() as u32;
4428        size
4429    }
4430    fn write_to(
4431        &self,
4432        __cache: &mut ::buffa::SizeCache,
4433        buf: &mut impl ::buffa::bytes::BufMut,
4434    ) {
4435        #[allow(unused_imports)]
4436        use ::buffa::Enumeration as _;
4437        if let Some(ref v) = self.name {
4438            ::buffa::encoding::Tag::new(
4439                    1u32,
4440                    ::buffa::encoding::WireType::LengthDelimited,
4441                )
4442                .encode(buf);
4443            ::buffa::types::encode_string(v, buf);
4444        }
4445        if let Some(ref v) = self.extendee {
4446            ::buffa::encoding::Tag::new(
4447                    2u32,
4448                    ::buffa::encoding::WireType::LengthDelimited,
4449                )
4450                .encode(buf);
4451            ::buffa::types::encode_string(v, buf);
4452        }
4453        if let Some(v) = self.number {
4454            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
4455                .encode(buf);
4456            ::buffa::types::encode_int32(v, buf);
4457        }
4458        if let Some(ref v) = self.label {
4459            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
4460                .encode(buf);
4461            ::buffa::types::encode_int32(v.to_i32(), buf);
4462        }
4463        if let Some(ref v) = self.r#type {
4464            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
4465                .encode(buf);
4466            ::buffa::types::encode_int32(v.to_i32(), buf);
4467        }
4468        if let Some(ref v) = self.type_name {
4469            ::buffa::encoding::Tag::new(
4470                    6u32,
4471                    ::buffa::encoding::WireType::LengthDelimited,
4472                )
4473                .encode(buf);
4474            ::buffa::types::encode_string(v, buf);
4475        }
4476        if let Some(ref v) = self.default_value {
4477            ::buffa::encoding::Tag::new(
4478                    7u32,
4479                    ::buffa::encoding::WireType::LengthDelimited,
4480                )
4481                .encode(buf);
4482            ::buffa::types::encode_string(v, buf);
4483        }
4484        if self.options.is_set() {
4485            ::buffa::encoding::Tag::new(
4486                    8u32,
4487                    ::buffa::encoding::WireType::LengthDelimited,
4488                )
4489                .encode(buf);
4490            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
4491            self.options.write_to(__cache, buf);
4492        }
4493        if let Some(v) = self.oneof_index {
4494            ::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
4495                .encode(buf);
4496            ::buffa::types::encode_int32(v, buf);
4497        }
4498        if let Some(ref v) = self.json_name {
4499            ::buffa::encoding::Tag::new(
4500                    10u32,
4501                    ::buffa::encoding::WireType::LengthDelimited,
4502                )
4503                .encode(buf);
4504            ::buffa::types::encode_string(v, buf);
4505        }
4506        if let Some(v) = self.proto3_optional {
4507            ::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
4508                .encode(buf);
4509            ::buffa::types::encode_bool(v, buf);
4510        }
4511        self.__buffa_unknown_fields.write_to(buf);
4512    }
4513    fn merge_field(
4514        &mut self,
4515        tag: ::buffa::encoding::Tag,
4516        buf: &mut impl ::buffa::bytes::Buf,
4517        depth: u32,
4518    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4519        #[allow(unused_imports)]
4520        use ::buffa::bytes::Buf as _;
4521        #[allow(unused_imports)]
4522        use ::buffa::Enumeration as _;
4523        match tag.field_number() {
4524            1u32 => {
4525                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4526                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4527                        field_number: 1u32,
4528                        expected: 2u8,
4529                        actual: tag.wire_type() as u8,
4530                    });
4531                }
4532                ::buffa::types::merge_string(
4533                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
4534                    buf,
4535                )?;
4536            }
4537            2u32 => {
4538                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4539                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4540                        field_number: 2u32,
4541                        expected: 2u8,
4542                        actual: tag.wire_type() as u8,
4543                    });
4544                }
4545                ::buffa::types::merge_string(
4546                    self
4547                        .extendee
4548                        .get_or_insert_with(::buffa::alloc::string::String::new),
4549                    buf,
4550                )?;
4551            }
4552            3u32 => {
4553                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4554                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4555                        field_number: 3u32,
4556                        expected: 0u8,
4557                        actual: tag.wire_type() as u8,
4558                    });
4559                }
4560                self.number = ::core::option::Option::Some(
4561                    ::buffa::types::decode_int32(buf)?,
4562                );
4563            }
4564            4u32 => {
4565                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4566                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4567                        field_number: 4u32,
4568                        expected: 0u8,
4569                        actual: tag.wire_type() as u8,
4570                    });
4571                }
4572                let __raw = ::buffa::types::decode_int32(buf)?;
4573                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4574                    __raw,
4575                ) {
4576                    self.label = ::core::option::Option::Some(__v);
4577                } else {
4578                    self.__buffa_unknown_fields
4579                        .push(::buffa::UnknownField {
4580                            number: 4u32,
4581                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4582                        });
4583                }
4584            }
4585            5u32 => {
4586                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4587                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4588                        field_number: 5u32,
4589                        expected: 0u8,
4590                        actual: tag.wire_type() as u8,
4591                    });
4592                }
4593                let __raw = ::buffa::types::decode_int32(buf)?;
4594                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
4595                    __raw,
4596                ) {
4597                    self.r#type = ::core::option::Option::Some(__v);
4598                } else {
4599                    self.__buffa_unknown_fields
4600                        .push(::buffa::UnknownField {
4601                            number: 5u32,
4602                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
4603                        });
4604                }
4605            }
4606            6u32 => {
4607                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4608                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4609                        field_number: 6u32,
4610                        expected: 2u8,
4611                        actual: tag.wire_type() as u8,
4612                    });
4613                }
4614                ::buffa::types::merge_string(
4615                    self
4616                        .type_name
4617                        .get_or_insert_with(::buffa::alloc::string::String::new),
4618                    buf,
4619                )?;
4620            }
4621            7u32 => {
4622                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4623                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4624                        field_number: 7u32,
4625                        expected: 2u8,
4626                        actual: tag.wire_type() as u8,
4627                    });
4628                }
4629                ::buffa::types::merge_string(
4630                    self
4631                        .default_value
4632                        .get_or_insert_with(::buffa::alloc::string::String::new),
4633                    buf,
4634                )?;
4635            }
4636            8u32 => {
4637                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4638                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4639                        field_number: 8u32,
4640                        expected: 2u8,
4641                        actual: tag.wire_type() as u8,
4642                    });
4643                }
4644                ::buffa::Message::merge_length_delimited(
4645                    self.options.get_or_insert_default(),
4646                    buf,
4647                    depth,
4648                )?;
4649            }
4650            9u32 => {
4651                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4652                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4653                        field_number: 9u32,
4654                        expected: 0u8,
4655                        actual: tag.wire_type() as u8,
4656                    });
4657                }
4658                self.oneof_index = ::core::option::Option::Some(
4659                    ::buffa::types::decode_int32(buf)?,
4660                );
4661            }
4662            10u32 => {
4663                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4664                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4665                        field_number: 10u32,
4666                        expected: 2u8,
4667                        actual: tag.wire_type() as u8,
4668                    });
4669                }
4670                ::buffa::types::merge_string(
4671                    self
4672                        .json_name
4673                        .get_or_insert_with(::buffa::alloc::string::String::new),
4674                    buf,
4675                )?;
4676            }
4677            17u32 => {
4678                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4679                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4680                        field_number: 17u32,
4681                        expected: 0u8,
4682                        actual: tag.wire_type() as u8,
4683                    });
4684                }
4685                self.proto3_optional = ::core::option::Option::Some(
4686                    ::buffa::types::decode_bool(buf)?,
4687                );
4688            }
4689            _ => {
4690                self.__buffa_unknown_fields
4691                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
4692            }
4693        }
4694        ::core::result::Result::Ok(())
4695    }
4696    fn clear(&mut self) {
4697        self.name = ::core::option::Option::None;
4698        self.extendee = ::core::option::Option::None;
4699        self.number = ::core::option::Option::None;
4700        self.label = ::core::option::Option::None;
4701        self.r#type = ::core::option::Option::None;
4702        self.type_name = ::core::option::Option::None;
4703        self.default_value = ::core::option::Option::None;
4704        self.options = ::buffa::MessageField::none();
4705        self.oneof_index = ::core::option::Option::None;
4706        self.json_name = ::core::option::Option::None;
4707        self.proto3_optional = ::core::option::Option::None;
4708        self.__buffa_unknown_fields.clear();
4709    }
4710}
4711impl ::buffa::ExtensionSet for FieldDescriptorProto {
4712    const PROTO_FQN: &'static str = "google.protobuf.FieldDescriptorProto";
4713    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4714        &self.__buffa_unknown_fields
4715    }
4716    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4717        &mut self.__buffa_unknown_fields
4718    }
4719}
4720#[cfg(feature = "text")]
4721impl ::buffa::text::TextFormat for FieldDescriptorProto {
4722    fn encode_text(
4723        &self,
4724        enc: &mut ::buffa::text::TextEncoder<'_>,
4725    ) -> ::core::fmt::Result {
4726        #[allow(unused_imports)]
4727        use ::buffa::Enumeration as _;
4728        if let ::core::option::Option::Some(ref __v) = self.name {
4729            enc.write_field_name("name")?;
4730            enc.write_string(__v)?;
4731        }
4732        if let ::core::option::Option::Some(ref __v) = self.number {
4733            enc.write_field_name("number")?;
4734            enc.write_i32(*__v)?;
4735        }
4736        if let ::core::option::Option::Some(ref __v) = self.label {
4737            enc.write_field_name("label")?;
4738            enc.write_enum_name(__v.proto_name())?;
4739        }
4740        if let ::core::option::Option::Some(ref __v) = self.r#type {
4741            enc.write_field_name("type")?;
4742            enc.write_enum_name(__v.proto_name())?;
4743        }
4744        if let ::core::option::Option::Some(ref __v) = self.type_name {
4745            enc.write_field_name("type_name")?;
4746            enc.write_string(__v)?;
4747        }
4748        if let ::core::option::Option::Some(ref __v) = self.extendee {
4749            enc.write_field_name("extendee")?;
4750            enc.write_string(__v)?;
4751        }
4752        if let ::core::option::Option::Some(ref __v) = self.default_value {
4753            enc.write_field_name("default_value")?;
4754            enc.write_string(__v)?;
4755        }
4756        if let ::core::option::Option::Some(ref __v) = self.oneof_index {
4757            enc.write_field_name("oneof_index")?;
4758            enc.write_i32(*__v)?;
4759        }
4760        if let ::core::option::Option::Some(ref __v) = self.json_name {
4761            enc.write_field_name("json_name")?;
4762            enc.write_string(__v)?;
4763        }
4764        if self.options.is_set() {
4765            enc.write_field_name("options")?;
4766            enc.write_message(&*self.options)?;
4767        }
4768        if let ::core::option::Option::Some(ref __v) = self.proto3_optional {
4769            enc.write_field_name("proto3_optional")?;
4770            enc.write_bool(*__v)?;
4771        }
4772        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
4773        ::core::result::Result::Ok(())
4774    }
4775    fn merge_text(
4776        &mut self,
4777        dec: &mut ::buffa::text::TextDecoder<'_>,
4778    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
4779        #[allow(unused_imports)]
4780        use ::buffa::Enumeration as _;
4781        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
4782            match __name {
4783                "name" => {
4784                    self.name = ::core::option::Option::Some(
4785                        dec.read_string()?.into_owned(),
4786                    );
4787                }
4788                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
4789                "label" => {
4790                    self.label = ::core::option::Option::Some(
4791                        dec.read_closed_enum_by_name::<field_descriptor_proto::Label>()?,
4792                    );
4793                }
4794                "type" => {
4795                    self.r#type = ::core::option::Option::Some(
4796                        dec.read_closed_enum_by_name::<field_descriptor_proto::Type>()?,
4797                    );
4798                }
4799                "type_name" => {
4800                    self.type_name = ::core::option::Option::Some(
4801                        dec.read_string()?.into_owned(),
4802                    );
4803                }
4804                "extendee" => {
4805                    self.extendee = ::core::option::Option::Some(
4806                        dec.read_string()?.into_owned(),
4807                    );
4808                }
4809                "default_value" => {
4810                    self.default_value = ::core::option::Option::Some(
4811                        dec.read_string()?.into_owned(),
4812                    );
4813                }
4814                "oneof_index" => {
4815                    self.oneof_index = ::core::option::Option::Some(dec.read_i32()?);
4816                }
4817                "json_name" => {
4818                    self.json_name = ::core::option::Option::Some(
4819                        dec.read_string()?.into_owned(),
4820                    );
4821                }
4822                "options" => dec.merge_message(self.options.get_or_insert_default())?,
4823                "proto3_optional" => {
4824                    self.proto3_optional = ::core::option::Option::Some(dec.read_bool()?);
4825                }
4826                _ => dec.skip_value()?,
4827            }
4828        }
4829        ::core::result::Result::Ok(())
4830    }
4831}
4832#[cfg(feature = "json")]
4833impl ::buffa::json_helpers::ProtoElemJson for FieldDescriptorProto {
4834    fn serialize_proto_json<S: ::serde::Serializer>(
4835        v: &Self,
4836        s: S,
4837    ) -> ::core::result::Result<S::Ok, S::Error> {
4838        ::serde::Serialize::serialize(v, s)
4839    }
4840    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4841        d: D,
4842    ) -> ::core::result::Result<Self, D::Error> {
4843        <Self as ::serde::Deserialize>::deserialize(d)
4844    }
4845}
4846#[cfg(feature = "json")]
4847#[doc(hidden)]
4848pub const __FIELD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4849    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4850    to_json: ::buffa::type_registry::any_to_json::<FieldDescriptorProto>,
4851    from_json: ::buffa::type_registry::any_from_json::<FieldDescriptorProto>,
4852    is_wkt: false,
4853};
4854#[cfg(feature = "text")]
4855#[doc(hidden)]
4856pub const __FIELD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
4857    type_url: "type.googleapis.com/google.protobuf.FieldDescriptorProto",
4858    text_encode: ::buffa::type_registry::any_encode_text::<FieldDescriptorProto>,
4859    text_merge: ::buffa::type_registry::any_merge_text::<FieldDescriptorProto>,
4860};
4861pub mod field_descriptor_proto {
4862    #[allow(unused_imports)]
4863    use super::*;
4864    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4865    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
4866    #[repr(i32)]
4867    pub enum Type {
4868        /// 0 is reserved for errors.
4869        /// Order is weird for historical reasons.
4870        TYPE_DOUBLE = 1i32,
4871        TYPE_FLOAT = 2i32,
4872        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
4873        /// negative values are likely.
4874        TYPE_INT64 = 3i32,
4875        TYPE_UINT64 = 4i32,
4876        /// Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
4877        /// negative values are likely.
4878        TYPE_INT32 = 5i32,
4879        TYPE_FIXED64 = 6i32,
4880        TYPE_FIXED32 = 7i32,
4881        TYPE_BOOL = 8i32,
4882        TYPE_STRING = 9i32,
4883        /// Tag-delimited aggregate.
4884        /// Group type is deprecated and not supported after google.protobuf. However, Proto3
4885        /// implementations should still be able to parse the group wire format and
4886        /// treat group fields as unknown fields.  In Editions, the group wire format
4887        /// can be enabled via the `message_encoding` feature.
4888        TYPE_GROUP = 10i32,
4889        /// Length-delimited aggregate.
4890        TYPE_MESSAGE = 11i32,
4891        /// New in version 2.
4892        TYPE_BYTES = 12i32,
4893        TYPE_UINT32 = 13i32,
4894        TYPE_ENUM = 14i32,
4895        TYPE_SFIXED32 = 15i32,
4896        TYPE_SFIXED64 = 16i32,
4897        /// Uses ZigZag encoding.
4898        TYPE_SINT32 = 17i32,
4899        /// Uses ZigZag encoding.
4900        TYPE_SINT64 = 18i32,
4901    }
4902    impl Type {
4903        ///Idiomatic alias for [`Self::TYPE_DOUBLE`]; `Debug` prints the variant name.
4904        #[allow(non_upper_case_globals)]
4905        pub const Double: Self = Self::TYPE_DOUBLE;
4906        ///Idiomatic alias for [`Self::TYPE_FLOAT`]; `Debug` prints the variant name.
4907        #[allow(non_upper_case_globals)]
4908        pub const Float: Self = Self::TYPE_FLOAT;
4909        ///Idiomatic alias for [`Self::TYPE_INT64`]; `Debug` prints the variant name.
4910        #[allow(non_upper_case_globals)]
4911        pub const Int64: Self = Self::TYPE_INT64;
4912        ///Idiomatic alias for [`Self::TYPE_UINT64`]; `Debug` prints the variant name.
4913        #[allow(non_upper_case_globals)]
4914        pub const Uint64: Self = Self::TYPE_UINT64;
4915        ///Idiomatic alias for [`Self::TYPE_INT32`]; `Debug` prints the variant name.
4916        #[allow(non_upper_case_globals)]
4917        pub const Int32: Self = Self::TYPE_INT32;
4918        ///Idiomatic alias for [`Self::TYPE_FIXED64`]; `Debug` prints the variant name.
4919        #[allow(non_upper_case_globals)]
4920        pub const Fixed64: Self = Self::TYPE_FIXED64;
4921        ///Idiomatic alias for [`Self::TYPE_FIXED32`]; `Debug` prints the variant name.
4922        #[allow(non_upper_case_globals)]
4923        pub const Fixed32: Self = Self::TYPE_FIXED32;
4924        ///Idiomatic alias for [`Self::TYPE_BOOL`]; `Debug` prints the variant name.
4925        #[allow(non_upper_case_globals)]
4926        pub const Bool: Self = Self::TYPE_BOOL;
4927        ///Idiomatic alias for [`Self::TYPE_STRING`]; `Debug` prints the variant name.
4928        #[allow(non_upper_case_globals)]
4929        pub const String: Self = Self::TYPE_STRING;
4930        ///Idiomatic alias for [`Self::TYPE_GROUP`]; `Debug` prints the variant name.
4931        #[allow(non_upper_case_globals)]
4932        pub const Group: Self = Self::TYPE_GROUP;
4933        ///Idiomatic alias for [`Self::TYPE_MESSAGE`]; `Debug` prints the variant name.
4934        #[allow(non_upper_case_globals)]
4935        pub const Message: Self = Self::TYPE_MESSAGE;
4936        ///Idiomatic alias for [`Self::TYPE_BYTES`]; `Debug` prints the variant name.
4937        #[allow(non_upper_case_globals)]
4938        pub const Bytes: Self = Self::TYPE_BYTES;
4939        ///Idiomatic alias for [`Self::TYPE_UINT32`]; `Debug` prints the variant name.
4940        #[allow(non_upper_case_globals)]
4941        pub const Uint32: Self = Self::TYPE_UINT32;
4942        ///Idiomatic alias for [`Self::TYPE_ENUM`]; `Debug` prints the variant name.
4943        #[allow(non_upper_case_globals)]
4944        pub const Enum: Self = Self::TYPE_ENUM;
4945        ///Idiomatic alias for [`Self::TYPE_SFIXED32`]; `Debug` prints the variant name.
4946        #[allow(non_upper_case_globals)]
4947        pub const Sfixed32: Self = Self::TYPE_SFIXED32;
4948        ///Idiomatic alias for [`Self::TYPE_SFIXED64`]; `Debug` prints the variant name.
4949        #[allow(non_upper_case_globals)]
4950        pub const Sfixed64: Self = Self::TYPE_SFIXED64;
4951        ///Idiomatic alias for [`Self::TYPE_SINT32`]; `Debug` prints the variant name.
4952        #[allow(non_upper_case_globals)]
4953        pub const Sint32: Self = Self::TYPE_SINT32;
4954        ///Idiomatic alias for [`Self::TYPE_SINT64`]; `Debug` prints the variant name.
4955        #[allow(non_upper_case_globals)]
4956        pub const Sint64: Self = Self::TYPE_SINT64;
4957    }
4958    impl ::core::default::Default for Type {
4959        fn default() -> Self {
4960            Self::TYPE_DOUBLE
4961        }
4962    }
4963    #[cfg(feature = "json")]
4964    const _: () = {
4965        impl ::serde::Serialize for Type {
4966            fn serialize<S: ::serde::Serializer>(
4967                &self,
4968                s: S,
4969            ) -> ::core::result::Result<S::Ok, S::Error> {
4970                s.serialize_str(::buffa::Enumeration::proto_name(self))
4971            }
4972        }
4973        impl<'de> ::serde::Deserialize<'de> for Type {
4974            fn deserialize<D: ::serde::Deserializer<'de>>(
4975                d: D,
4976            ) -> ::core::result::Result<Self, D::Error> {
4977                struct _V;
4978                impl ::serde::de::Visitor<'_> for _V {
4979                    type Value = Type;
4980                    fn expecting(
4981                        &self,
4982                        f: &mut ::core::fmt::Formatter<'_>,
4983                    ) -> ::core::fmt::Result {
4984                        f.write_str(
4985                            concat!("a string, integer, or null for ", stringify!(Type)),
4986                        )
4987                    }
4988                    fn visit_str<E: ::serde::de::Error>(
4989                        self,
4990                        v: &str,
4991                    ) -> ::core::result::Result<Type, E> {
4992                        <Type as ::buffa::Enumeration>::from_proto_name(v)
4993                            .ok_or_else(|| {
4994                                ::serde::de::Error::unknown_variant(v, &[])
4995                            })
4996                    }
4997                    fn visit_i64<E: ::serde::de::Error>(
4998                        self,
4999                        v: i64,
5000                    ) -> ::core::result::Result<Type, E> {
5001                        let v32 = i32::try_from(v)
5002                            .map_err(|_| {
5003                                ::serde::de::Error::custom(
5004                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5005                                )
5006                            })?;
5007                        <Type as ::buffa::Enumeration>::from_i32(v32)
5008                            .ok_or_else(|| {
5009                                ::serde::de::Error::custom(
5010                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5011                                )
5012                            })
5013                    }
5014                    fn visit_u64<E: ::serde::de::Error>(
5015                        self,
5016                        v: u64,
5017                    ) -> ::core::result::Result<Type, E> {
5018                        let v32 = i32::try_from(v)
5019                            .map_err(|_| {
5020                                ::serde::de::Error::custom(
5021                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5022                                )
5023                            })?;
5024                        <Type as ::buffa::Enumeration>::from_i32(v32)
5025                            .ok_or_else(|| {
5026                                ::serde::de::Error::custom(
5027                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5028                                )
5029                            })
5030                    }
5031                    fn visit_unit<E: ::serde::de::Error>(
5032                        self,
5033                    ) -> ::core::result::Result<Type, E> {
5034                        ::core::result::Result::Ok(::core::default::Default::default())
5035                    }
5036                }
5037                d.deserialize_any(_V)
5038            }
5039        }
5040        impl ::buffa::json_helpers::ProtoElemJson for Type {
5041            fn serialize_proto_json<S: ::serde::Serializer>(
5042                v: &Self,
5043                s: S,
5044            ) -> ::core::result::Result<S::Ok, S::Error> {
5045                ::serde::Serialize::serialize(v, s)
5046            }
5047            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5048                d: D,
5049            ) -> ::core::result::Result<Self, D::Error> {
5050                <Self as ::serde::Deserialize>::deserialize(d)
5051            }
5052        }
5053    };
5054    impl ::buffa::Enumeration for Type {
5055        fn from_i32(value: i32) -> ::core::option::Option<Self> {
5056            match value {
5057                1i32 => ::core::option::Option::Some(Self::TYPE_DOUBLE),
5058                2i32 => ::core::option::Option::Some(Self::TYPE_FLOAT),
5059                3i32 => ::core::option::Option::Some(Self::TYPE_INT64),
5060                4i32 => ::core::option::Option::Some(Self::TYPE_UINT64),
5061                5i32 => ::core::option::Option::Some(Self::TYPE_INT32),
5062                6i32 => ::core::option::Option::Some(Self::TYPE_FIXED64),
5063                7i32 => ::core::option::Option::Some(Self::TYPE_FIXED32),
5064                8i32 => ::core::option::Option::Some(Self::TYPE_BOOL),
5065                9i32 => ::core::option::Option::Some(Self::TYPE_STRING),
5066                10i32 => ::core::option::Option::Some(Self::TYPE_GROUP),
5067                11i32 => ::core::option::Option::Some(Self::TYPE_MESSAGE),
5068                12i32 => ::core::option::Option::Some(Self::TYPE_BYTES),
5069                13i32 => ::core::option::Option::Some(Self::TYPE_UINT32),
5070                14i32 => ::core::option::Option::Some(Self::TYPE_ENUM),
5071                15i32 => ::core::option::Option::Some(Self::TYPE_SFIXED32),
5072                16i32 => ::core::option::Option::Some(Self::TYPE_SFIXED64),
5073                17i32 => ::core::option::Option::Some(Self::TYPE_SINT32),
5074                18i32 => ::core::option::Option::Some(Self::TYPE_SINT64),
5075                _ => ::core::option::Option::None,
5076            }
5077        }
5078        fn to_i32(&self) -> i32 {
5079            *self as i32
5080        }
5081        fn proto_name(&self) -> &'static str {
5082            match self {
5083                Self::TYPE_DOUBLE => "TYPE_DOUBLE",
5084                Self::TYPE_FLOAT => "TYPE_FLOAT",
5085                Self::TYPE_INT64 => "TYPE_INT64",
5086                Self::TYPE_UINT64 => "TYPE_UINT64",
5087                Self::TYPE_INT32 => "TYPE_INT32",
5088                Self::TYPE_FIXED64 => "TYPE_FIXED64",
5089                Self::TYPE_FIXED32 => "TYPE_FIXED32",
5090                Self::TYPE_BOOL => "TYPE_BOOL",
5091                Self::TYPE_STRING => "TYPE_STRING",
5092                Self::TYPE_GROUP => "TYPE_GROUP",
5093                Self::TYPE_MESSAGE => "TYPE_MESSAGE",
5094                Self::TYPE_BYTES => "TYPE_BYTES",
5095                Self::TYPE_UINT32 => "TYPE_UINT32",
5096                Self::TYPE_ENUM => "TYPE_ENUM",
5097                Self::TYPE_SFIXED32 => "TYPE_SFIXED32",
5098                Self::TYPE_SFIXED64 => "TYPE_SFIXED64",
5099                Self::TYPE_SINT32 => "TYPE_SINT32",
5100                Self::TYPE_SINT64 => "TYPE_SINT64",
5101            }
5102        }
5103        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
5104            match name {
5105                "TYPE_DOUBLE" => ::core::option::Option::Some(Self::TYPE_DOUBLE),
5106                "TYPE_FLOAT" => ::core::option::Option::Some(Self::TYPE_FLOAT),
5107                "TYPE_INT64" => ::core::option::Option::Some(Self::TYPE_INT64),
5108                "TYPE_UINT64" => ::core::option::Option::Some(Self::TYPE_UINT64),
5109                "TYPE_INT32" => ::core::option::Option::Some(Self::TYPE_INT32),
5110                "TYPE_FIXED64" => ::core::option::Option::Some(Self::TYPE_FIXED64),
5111                "TYPE_FIXED32" => ::core::option::Option::Some(Self::TYPE_FIXED32),
5112                "TYPE_BOOL" => ::core::option::Option::Some(Self::TYPE_BOOL),
5113                "TYPE_STRING" => ::core::option::Option::Some(Self::TYPE_STRING),
5114                "TYPE_GROUP" => ::core::option::Option::Some(Self::TYPE_GROUP),
5115                "TYPE_MESSAGE" => ::core::option::Option::Some(Self::TYPE_MESSAGE),
5116                "TYPE_BYTES" => ::core::option::Option::Some(Self::TYPE_BYTES),
5117                "TYPE_UINT32" => ::core::option::Option::Some(Self::TYPE_UINT32),
5118                "TYPE_ENUM" => ::core::option::Option::Some(Self::TYPE_ENUM),
5119                "TYPE_SFIXED32" => ::core::option::Option::Some(Self::TYPE_SFIXED32),
5120                "TYPE_SFIXED64" => ::core::option::Option::Some(Self::TYPE_SFIXED64),
5121                "TYPE_SINT32" => ::core::option::Option::Some(Self::TYPE_SINT32),
5122                "TYPE_SINT64" => ::core::option::Option::Some(Self::TYPE_SINT64),
5123                _ => ::core::option::Option::None,
5124            }
5125        }
5126        fn values() -> &'static [Self] {
5127            &[
5128                Self::TYPE_DOUBLE,
5129                Self::TYPE_FLOAT,
5130                Self::TYPE_INT64,
5131                Self::TYPE_UINT64,
5132                Self::TYPE_INT32,
5133                Self::TYPE_FIXED64,
5134                Self::TYPE_FIXED32,
5135                Self::TYPE_BOOL,
5136                Self::TYPE_STRING,
5137                Self::TYPE_GROUP,
5138                Self::TYPE_MESSAGE,
5139                Self::TYPE_BYTES,
5140                Self::TYPE_UINT32,
5141                Self::TYPE_ENUM,
5142                Self::TYPE_SFIXED32,
5143                Self::TYPE_SFIXED64,
5144                Self::TYPE_SINT32,
5145                Self::TYPE_SINT64,
5146            ]
5147        }
5148    }
5149    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
5150    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5151    #[repr(i32)]
5152    pub enum Label {
5153        /// 0 is reserved for errors
5154        LABEL_OPTIONAL = 1i32,
5155        LABEL_REPEATED = 3i32,
5156        /// The required label is only allowed in google.protobuf.  In proto3 and Editions
5157        /// it's explicitly prohibited.  In Editions, the `field_presence` feature
5158        /// can be used to get this behavior.
5159        LABEL_REQUIRED = 2i32,
5160    }
5161    impl Label {
5162        ///Idiomatic alias for [`Self::LABEL_OPTIONAL`]; `Debug` prints the variant name.
5163        #[allow(non_upper_case_globals)]
5164        pub const Optional: Self = Self::LABEL_OPTIONAL;
5165        ///Idiomatic alias for [`Self::LABEL_REPEATED`]; `Debug` prints the variant name.
5166        #[allow(non_upper_case_globals)]
5167        pub const Repeated: Self = Self::LABEL_REPEATED;
5168        ///Idiomatic alias for [`Self::LABEL_REQUIRED`]; `Debug` prints the variant name.
5169        #[allow(non_upper_case_globals)]
5170        pub const Required: Self = Self::LABEL_REQUIRED;
5171    }
5172    impl ::core::default::Default for Label {
5173        fn default() -> Self {
5174            Self::LABEL_OPTIONAL
5175        }
5176    }
5177    #[cfg(feature = "json")]
5178    const _: () = {
5179        impl ::serde::Serialize for Label {
5180            fn serialize<S: ::serde::Serializer>(
5181                &self,
5182                s: S,
5183            ) -> ::core::result::Result<S::Ok, S::Error> {
5184                s.serialize_str(::buffa::Enumeration::proto_name(self))
5185            }
5186        }
5187        impl<'de> ::serde::Deserialize<'de> for Label {
5188            fn deserialize<D: ::serde::Deserializer<'de>>(
5189                d: D,
5190            ) -> ::core::result::Result<Self, D::Error> {
5191                struct _V;
5192                impl ::serde::de::Visitor<'_> for _V {
5193                    type Value = Label;
5194                    fn expecting(
5195                        &self,
5196                        f: &mut ::core::fmt::Formatter<'_>,
5197                    ) -> ::core::fmt::Result {
5198                        f.write_str(
5199                            concat!("a string, integer, or null for ", stringify!(Label)),
5200                        )
5201                    }
5202                    fn visit_str<E: ::serde::de::Error>(
5203                        self,
5204                        v: &str,
5205                    ) -> ::core::result::Result<Label, E> {
5206                        <Label as ::buffa::Enumeration>::from_proto_name(v)
5207                            .ok_or_else(|| {
5208                                ::serde::de::Error::unknown_variant(v, &[])
5209                            })
5210                    }
5211                    fn visit_i64<E: ::serde::de::Error>(
5212                        self,
5213                        v: i64,
5214                    ) -> ::core::result::Result<Label, E> {
5215                        let v32 = i32::try_from(v)
5216                            .map_err(|_| {
5217                                ::serde::de::Error::custom(
5218                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5219                                )
5220                            })?;
5221                        <Label as ::buffa::Enumeration>::from_i32(v32)
5222                            .ok_or_else(|| {
5223                                ::serde::de::Error::custom(
5224                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5225                                )
5226                            })
5227                    }
5228                    fn visit_u64<E: ::serde::de::Error>(
5229                        self,
5230                        v: u64,
5231                    ) -> ::core::result::Result<Label, E> {
5232                        let v32 = i32::try_from(v)
5233                            .map_err(|_| {
5234                                ::serde::de::Error::custom(
5235                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
5236                                )
5237                            })?;
5238                        <Label as ::buffa::Enumeration>::from_i32(v32)
5239                            .ok_or_else(|| {
5240                                ::serde::de::Error::custom(
5241                                    ::buffa::alloc::format!("unknown enum value {v32}"),
5242                                )
5243                            })
5244                    }
5245                    fn visit_unit<E: ::serde::de::Error>(
5246                        self,
5247                    ) -> ::core::result::Result<Label, E> {
5248                        ::core::result::Result::Ok(::core::default::Default::default())
5249                    }
5250                }
5251                d.deserialize_any(_V)
5252            }
5253        }
5254        impl ::buffa::json_helpers::ProtoElemJson for Label {
5255            fn serialize_proto_json<S: ::serde::Serializer>(
5256                v: &Self,
5257                s: S,
5258            ) -> ::core::result::Result<S::Ok, S::Error> {
5259                ::serde::Serialize::serialize(v, s)
5260            }
5261            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5262                d: D,
5263            ) -> ::core::result::Result<Self, D::Error> {
5264                <Self as ::serde::Deserialize>::deserialize(d)
5265            }
5266        }
5267    };
5268    impl ::buffa::Enumeration for Label {
5269        fn from_i32(value: i32) -> ::core::option::Option<Self> {
5270            match value {
5271                1i32 => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5272                3i32 => ::core::option::Option::Some(Self::LABEL_REPEATED),
5273                2i32 => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5274                _ => ::core::option::Option::None,
5275            }
5276        }
5277        fn to_i32(&self) -> i32 {
5278            *self as i32
5279        }
5280        fn proto_name(&self) -> &'static str {
5281            match self {
5282                Self::LABEL_OPTIONAL => "LABEL_OPTIONAL",
5283                Self::LABEL_REPEATED => "LABEL_REPEATED",
5284                Self::LABEL_REQUIRED => "LABEL_REQUIRED",
5285            }
5286        }
5287        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
5288            match name {
5289                "LABEL_OPTIONAL" => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
5290                "LABEL_REPEATED" => ::core::option::Option::Some(Self::LABEL_REPEATED),
5291                "LABEL_REQUIRED" => ::core::option::Option::Some(Self::LABEL_REQUIRED),
5292                _ => ::core::option::Option::None,
5293            }
5294        }
5295        fn values() -> &'static [Self] {
5296            &[Self::LABEL_OPTIONAL, Self::LABEL_REPEATED, Self::LABEL_REQUIRED]
5297        }
5298    }
5299}
5300/// Describes a oneof.
5301#[derive(Clone, PartialEq, Default)]
5302#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5303#[cfg_attr(feature = "json", serde(default))]
5304#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5305pub struct OneofDescriptorProto {
5306    /// Field 1: `name`
5307    #[cfg_attr(
5308        feature = "json",
5309        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5310    )]
5311    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5312    /// Field 2: `options`
5313    #[cfg_attr(
5314        feature = "json",
5315        serde(
5316            rename = "options",
5317            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5318        )
5319    )]
5320    pub options: ::buffa::MessageField<OneofOptions>,
5321    #[cfg_attr(feature = "json", serde(skip))]
5322    #[doc(hidden)]
5323    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5324}
5325impl ::core::fmt::Debug for OneofDescriptorProto {
5326    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5327        f.debug_struct("OneofDescriptorProto")
5328            .field("name", &self.name)
5329            .field("options", &self.options)
5330            .finish()
5331    }
5332}
5333impl OneofDescriptorProto {
5334    /// Protobuf type URL for this message, for use with `Any::pack` and
5335    /// `Any::unpack_if`.
5336    ///
5337    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5338    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5339}
5340impl OneofDescriptorProto {
5341    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5342    #[inline]
5343    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5344    pub fn with_name(
5345        mut self,
5346        value: impl Into<::buffa::alloc::string::String>,
5347    ) -> Self {
5348        self.name = Some(value.into());
5349        self
5350    }
5351}
5352impl ::buffa::DefaultInstance for OneofDescriptorProto {
5353    fn default_instance() -> &'static Self {
5354        static VALUE: ::buffa::__private::OnceBox<OneofDescriptorProto> = ::buffa::__private::OnceBox::new();
5355        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
5356    }
5357}
5358impl ::buffa::MessageName for OneofDescriptorProto {
5359    const PACKAGE: &'static str = "google.protobuf";
5360    const NAME: &'static str = "OneofDescriptorProto";
5361    const FULL_NAME: &'static str = "google.protobuf.OneofDescriptorProto";
5362    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
5363}
5364impl ::buffa::Message for OneofDescriptorProto {
5365    /// Returns the total encoded size in bytes.
5366    ///
5367    /// The result is a `u32`; the protobuf specification requires all
5368    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5369    /// compliant message will never overflow this type.
5370    #[allow(clippy::let_and_return)]
5371    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5372        #[allow(unused_imports)]
5373        use ::buffa::Enumeration as _;
5374        let mut size = 0u32;
5375        if let Some(ref v) = self.name {
5376            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5377        }
5378        if self.options.is_set() {
5379            let __slot = __cache.reserve();
5380            let inner_size = self.options.compute_size(__cache);
5381            __cache.set(__slot, inner_size);
5382            size
5383                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5384                    + inner_size;
5385        }
5386        size += self.__buffa_unknown_fields.encoded_len() as u32;
5387        size
5388    }
5389    fn write_to(
5390        &self,
5391        __cache: &mut ::buffa::SizeCache,
5392        buf: &mut impl ::buffa::bytes::BufMut,
5393    ) {
5394        #[allow(unused_imports)]
5395        use ::buffa::Enumeration as _;
5396        if let Some(ref v) = self.name {
5397            ::buffa::encoding::Tag::new(
5398                    1u32,
5399                    ::buffa::encoding::WireType::LengthDelimited,
5400                )
5401                .encode(buf);
5402            ::buffa::types::encode_string(v, buf);
5403        }
5404        if self.options.is_set() {
5405            ::buffa::encoding::Tag::new(
5406                    2u32,
5407                    ::buffa::encoding::WireType::LengthDelimited,
5408                )
5409                .encode(buf);
5410            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
5411            self.options.write_to(__cache, buf);
5412        }
5413        self.__buffa_unknown_fields.write_to(buf);
5414    }
5415    fn merge_field(
5416        &mut self,
5417        tag: ::buffa::encoding::Tag,
5418        buf: &mut impl ::buffa::bytes::Buf,
5419        depth: u32,
5420    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5421        #[allow(unused_imports)]
5422        use ::buffa::bytes::Buf as _;
5423        #[allow(unused_imports)]
5424        use ::buffa::Enumeration as _;
5425        match tag.field_number() {
5426            1u32 => {
5427                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5428                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5429                        field_number: 1u32,
5430                        expected: 2u8,
5431                        actual: tag.wire_type() as u8,
5432                    });
5433                }
5434                ::buffa::types::merge_string(
5435                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5436                    buf,
5437                )?;
5438            }
5439            2u32 => {
5440                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5441                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5442                        field_number: 2u32,
5443                        expected: 2u8,
5444                        actual: tag.wire_type() as u8,
5445                    });
5446                }
5447                ::buffa::Message::merge_length_delimited(
5448                    self.options.get_or_insert_default(),
5449                    buf,
5450                    depth,
5451                )?;
5452            }
5453            _ => {
5454                self.__buffa_unknown_fields
5455                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
5456            }
5457        }
5458        ::core::result::Result::Ok(())
5459    }
5460    fn clear(&mut self) {
5461        self.name = ::core::option::Option::None;
5462        self.options = ::buffa::MessageField::none();
5463        self.__buffa_unknown_fields.clear();
5464    }
5465}
5466impl ::buffa::ExtensionSet for OneofDescriptorProto {
5467    const PROTO_FQN: &'static str = "google.protobuf.OneofDescriptorProto";
5468    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5469        &self.__buffa_unknown_fields
5470    }
5471    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5472        &mut self.__buffa_unknown_fields
5473    }
5474}
5475#[cfg(feature = "text")]
5476impl ::buffa::text::TextFormat for OneofDescriptorProto {
5477    fn encode_text(
5478        &self,
5479        enc: &mut ::buffa::text::TextEncoder<'_>,
5480    ) -> ::core::fmt::Result {
5481        #[allow(unused_imports)]
5482        use ::buffa::Enumeration as _;
5483        if let ::core::option::Option::Some(ref __v) = self.name {
5484            enc.write_field_name("name")?;
5485            enc.write_string(__v)?;
5486        }
5487        if self.options.is_set() {
5488            enc.write_field_name("options")?;
5489            enc.write_message(&*self.options)?;
5490        }
5491        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5492        ::core::result::Result::Ok(())
5493    }
5494    fn merge_text(
5495        &mut self,
5496        dec: &mut ::buffa::text::TextDecoder<'_>,
5497    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5498        #[allow(unused_imports)]
5499        use ::buffa::Enumeration as _;
5500        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5501            match __name {
5502                "name" => {
5503                    self.name = ::core::option::Option::Some(
5504                        dec.read_string()?.into_owned(),
5505                    );
5506                }
5507                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5508                _ => dec.skip_value()?,
5509            }
5510        }
5511        ::core::result::Result::Ok(())
5512    }
5513}
5514#[cfg(feature = "json")]
5515impl ::buffa::json_helpers::ProtoElemJson for OneofDescriptorProto {
5516    fn serialize_proto_json<S: ::serde::Serializer>(
5517        v: &Self,
5518        s: S,
5519    ) -> ::core::result::Result<S::Ok, S::Error> {
5520        ::serde::Serialize::serialize(v, s)
5521    }
5522    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5523        d: D,
5524    ) -> ::core::result::Result<Self, D::Error> {
5525        <Self as ::serde::Deserialize>::deserialize(d)
5526    }
5527}
5528#[cfg(feature = "json")]
5529#[doc(hidden)]
5530pub const __ONEOF_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5531    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5532    to_json: ::buffa::type_registry::any_to_json::<OneofDescriptorProto>,
5533    from_json: ::buffa::type_registry::any_from_json::<OneofDescriptorProto>,
5534    is_wkt: false,
5535};
5536#[cfg(feature = "text")]
5537#[doc(hidden)]
5538pub const __ONEOF_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
5539    type_url: "type.googleapis.com/google.protobuf.OneofDescriptorProto",
5540    text_encode: ::buffa::type_registry::any_encode_text::<OneofDescriptorProto>,
5541    text_merge: ::buffa::type_registry::any_merge_text::<OneofDescriptorProto>,
5542};
5543/// Describes an enum type.
5544#[derive(Clone, PartialEq, Default)]
5545#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
5546#[cfg_attr(feature = "json", serde(default))]
5547#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
5548pub struct EnumDescriptorProto {
5549    /// Field 1: `name`
5550    #[cfg_attr(
5551        feature = "json",
5552        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
5553    )]
5554    pub name: ::core::option::Option<::buffa::alloc::string::String>,
5555    /// Field 2: `value`
5556    #[cfg_attr(
5557        feature = "json",
5558        serde(
5559            rename = "value",
5560            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5561            deserialize_with = "::buffa::json_helpers::null_as_default"
5562        )
5563    )]
5564    pub value: ::buffa::alloc::vec::Vec<EnumValueDescriptorProto>,
5565    /// Field 3: `options`
5566    #[cfg_attr(
5567        feature = "json",
5568        serde(
5569            rename = "options",
5570            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
5571        )
5572    )]
5573    pub options: ::buffa::MessageField<EnumOptions>,
5574    /// Range of reserved numeric values. Reserved numeric values may not be used
5575    /// by enum values in the same enum declaration. Reserved ranges may not
5576    /// overlap.
5577    ///
5578    /// Field 4: `reserved_range`
5579    #[cfg_attr(
5580        feature = "json",
5581        serde(
5582            rename = "reservedRange",
5583            alias = "reserved_range",
5584            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5585            deserialize_with = "::buffa::json_helpers::null_as_default"
5586        )
5587    )]
5588    pub reserved_range: ::buffa::alloc::vec::Vec<
5589        enum_descriptor_proto::EnumReservedRange,
5590    >,
5591    /// Reserved enum value names, which may not be reused. A given name may only
5592    /// be reserved once.
5593    ///
5594    /// Field 5: `reserved_name`
5595    #[cfg_attr(
5596        feature = "json",
5597        serde(
5598            rename = "reservedName",
5599            alias = "reserved_name",
5600            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
5601            deserialize_with = "::buffa::json_helpers::null_as_default"
5602        )
5603    )]
5604    pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
5605    /// Support for `export` and `local` keywords on enums.
5606    ///
5607    /// Field 6: `visibility`
5608    #[cfg_attr(
5609        feature = "json",
5610        serde(
5611            rename = "visibility",
5612            with = "::buffa::json_helpers::opt_closed_enum",
5613            skip_serializing_if = "::core::option::Option::is_none"
5614        )
5615    )]
5616    pub visibility: ::core::option::Option<SymbolVisibility>,
5617    #[cfg_attr(feature = "json", serde(skip))]
5618    #[doc(hidden)]
5619    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5620}
5621impl ::core::fmt::Debug for EnumDescriptorProto {
5622    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5623        f.debug_struct("EnumDescriptorProto")
5624            .field("name", &self.name)
5625            .field("value", &self.value)
5626            .field("options", &self.options)
5627            .field("reserved_range", &self.reserved_range)
5628            .field("reserved_name", &self.reserved_name)
5629            .field("visibility", &self.visibility)
5630            .finish()
5631    }
5632}
5633impl EnumDescriptorProto {
5634    /// Protobuf type URL for this message, for use with `Any::pack` and
5635    /// `Any::unpack_if`.
5636    ///
5637    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5638    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5639}
5640impl EnumDescriptorProto {
5641    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5642    #[inline]
5643    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
5644    pub fn with_name(
5645        mut self,
5646        value: impl Into<::buffa::alloc::string::String>,
5647    ) -> Self {
5648        self.name = Some(value.into());
5649        self
5650    }
5651    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5652    #[inline]
5653    ///Sets [`Self::visibility`] to `Some(value)`, consuming and returning `self`.
5654    pub fn with_visibility(mut self, value: impl Into<SymbolVisibility>) -> Self {
5655        self.visibility = Some(value.into());
5656        self
5657    }
5658}
5659impl ::buffa::DefaultInstance for EnumDescriptorProto {
5660    fn default_instance() -> &'static Self {
5661        static VALUE: ::buffa::__private::OnceBox<EnumDescriptorProto> = ::buffa::__private::OnceBox::new();
5662        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
5663    }
5664}
5665impl ::buffa::MessageName for EnumDescriptorProto {
5666    const PACKAGE: &'static str = "google.protobuf";
5667    const NAME: &'static str = "EnumDescriptorProto";
5668    const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto";
5669    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
5670}
5671impl ::buffa::Message for EnumDescriptorProto {
5672    /// Returns the total encoded size in bytes.
5673    ///
5674    /// The result is a `u32`; the protobuf specification requires all
5675    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5676    /// compliant message will never overflow this type.
5677    #[allow(clippy::let_and_return)]
5678    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5679        #[allow(unused_imports)]
5680        use ::buffa::Enumeration as _;
5681        let mut size = 0u32;
5682        if let Some(ref v) = self.name {
5683            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5684        }
5685        for v in &self.value {
5686            let __slot = __cache.reserve();
5687            let inner_size = v.compute_size(__cache);
5688            __cache.set(__slot, inner_size);
5689            size
5690                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5691                    + inner_size;
5692        }
5693        if self.options.is_set() {
5694            let __slot = __cache.reserve();
5695            let inner_size = self.options.compute_size(__cache);
5696            __cache.set(__slot, inner_size);
5697            size
5698                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5699                    + inner_size;
5700        }
5701        for v in &self.reserved_range {
5702            let __slot = __cache.reserve();
5703            let inner_size = v.compute_size(__cache);
5704            __cache.set(__slot, inner_size);
5705            size
5706                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5707                    + inner_size;
5708        }
5709        for v in &self.reserved_name {
5710            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5711        }
5712        if let Some(ref v) = self.visibility {
5713            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
5714        }
5715        size += self.__buffa_unknown_fields.encoded_len() as u32;
5716        size
5717    }
5718    fn write_to(
5719        &self,
5720        __cache: &mut ::buffa::SizeCache,
5721        buf: &mut impl ::buffa::bytes::BufMut,
5722    ) {
5723        #[allow(unused_imports)]
5724        use ::buffa::Enumeration as _;
5725        if let Some(ref v) = self.name {
5726            ::buffa::encoding::Tag::new(
5727                    1u32,
5728                    ::buffa::encoding::WireType::LengthDelimited,
5729                )
5730                .encode(buf);
5731            ::buffa::types::encode_string(v, buf);
5732        }
5733        for v in &self.value {
5734            ::buffa::encoding::Tag::new(
5735                    2u32,
5736                    ::buffa::encoding::WireType::LengthDelimited,
5737                )
5738                .encode(buf);
5739            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
5740            v.write_to(__cache, buf);
5741        }
5742        if self.options.is_set() {
5743            ::buffa::encoding::Tag::new(
5744                    3u32,
5745                    ::buffa::encoding::WireType::LengthDelimited,
5746                )
5747                .encode(buf);
5748            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
5749            self.options.write_to(__cache, buf);
5750        }
5751        for v in &self.reserved_range {
5752            ::buffa::encoding::Tag::new(
5753                    4u32,
5754                    ::buffa::encoding::WireType::LengthDelimited,
5755                )
5756                .encode(buf);
5757            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
5758            v.write_to(__cache, buf);
5759        }
5760        for v in &self.reserved_name {
5761            ::buffa::encoding::Tag::new(
5762                    5u32,
5763                    ::buffa::encoding::WireType::LengthDelimited,
5764                )
5765                .encode(buf);
5766            ::buffa::types::encode_string(v, buf);
5767        }
5768        if let Some(ref v) = self.visibility {
5769            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
5770                .encode(buf);
5771            ::buffa::types::encode_int32(v.to_i32(), buf);
5772        }
5773        self.__buffa_unknown_fields.write_to(buf);
5774    }
5775    fn merge_field(
5776        &mut self,
5777        tag: ::buffa::encoding::Tag,
5778        buf: &mut impl ::buffa::bytes::Buf,
5779        depth: u32,
5780    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5781        #[allow(unused_imports)]
5782        use ::buffa::bytes::Buf as _;
5783        #[allow(unused_imports)]
5784        use ::buffa::Enumeration as _;
5785        match tag.field_number() {
5786            1u32 => {
5787                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5788                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5789                        field_number: 1u32,
5790                        expected: 2u8,
5791                        actual: tag.wire_type() as u8,
5792                    });
5793                }
5794                ::buffa::types::merge_string(
5795                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
5796                    buf,
5797                )?;
5798            }
5799            2u32 => {
5800                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5801                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5802                        field_number: 2u32,
5803                        expected: 2u8,
5804                        actual: tag.wire_type() as u8,
5805                    });
5806                }
5807                let mut elem = ::core::default::Default::default();
5808                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
5809                self.value.push(elem);
5810            }
5811            3u32 => {
5812                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5813                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5814                        field_number: 3u32,
5815                        expected: 2u8,
5816                        actual: tag.wire_type() as u8,
5817                    });
5818                }
5819                ::buffa::Message::merge_length_delimited(
5820                    self.options.get_or_insert_default(),
5821                    buf,
5822                    depth,
5823                )?;
5824            }
5825            4u32 => {
5826                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5827                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5828                        field_number: 4u32,
5829                        expected: 2u8,
5830                        actual: tag.wire_type() as u8,
5831                    });
5832                }
5833                let mut elem = ::core::default::Default::default();
5834                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
5835                self.reserved_range.push(elem);
5836            }
5837            5u32 => {
5838                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5839                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5840                        field_number: 5u32,
5841                        expected: 2u8,
5842                        actual: tag.wire_type() as u8,
5843                    });
5844                }
5845                self.reserved_name.push(::buffa::types::decode_string(buf)?);
5846            }
5847            6u32 => {
5848                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5849                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5850                        field_number: 6u32,
5851                        expected: 0u8,
5852                        actual: tag.wire_type() as u8,
5853                    });
5854                }
5855                let __raw = ::buffa::types::decode_int32(buf)?;
5856                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
5857                    __raw,
5858                ) {
5859                    self.visibility = ::core::option::Option::Some(__v);
5860                } else {
5861                    self.__buffa_unknown_fields
5862                        .push(::buffa::UnknownField {
5863                            number: 6u32,
5864                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
5865                        });
5866                }
5867            }
5868            _ => {
5869                self.__buffa_unknown_fields
5870                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
5871            }
5872        }
5873        ::core::result::Result::Ok(())
5874    }
5875    fn clear(&mut self) {
5876        self.name = ::core::option::Option::None;
5877        self.value.clear();
5878        self.options = ::buffa::MessageField::none();
5879        self.reserved_range.clear();
5880        self.reserved_name.clear();
5881        self.visibility = ::core::option::Option::None;
5882        self.__buffa_unknown_fields.clear();
5883    }
5884}
5885impl ::buffa::ExtensionSet for EnumDescriptorProto {
5886    const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto";
5887    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5888        &self.__buffa_unknown_fields
5889    }
5890    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5891        &mut self.__buffa_unknown_fields
5892    }
5893}
5894#[cfg(feature = "text")]
5895impl ::buffa::text::TextFormat for EnumDescriptorProto {
5896    fn encode_text(
5897        &self,
5898        enc: &mut ::buffa::text::TextEncoder<'_>,
5899    ) -> ::core::fmt::Result {
5900        #[allow(unused_imports)]
5901        use ::buffa::Enumeration as _;
5902        if let ::core::option::Option::Some(ref __v) = self.name {
5903            enc.write_field_name("name")?;
5904            enc.write_string(__v)?;
5905        }
5906        if self.options.is_set() {
5907            enc.write_field_name("options")?;
5908            enc.write_message(&*self.options)?;
5909        }
5910        if let ::core::option::Option::Some(ref __v) = self.visibility {
5911            enc.write_field_name("visibility")?;
5912            enc.write_enum_name(__v.proto_name())?;
5913        }
5914        for __v in &self.value {
5915            enc.write_field_name("value")?;
5916            enc.write_message(__v)?;
5917        }
5918        for __v in &self.reserved_range {
5919            enc.write_field_name("reserved_range")?;
5920            enc.write_message(__v)?;
5921        }
5922        for __v in &self.reserved_name {
5923            enc.write_field_name("reserved_name")?;
5924            enc.write_string(__v)?;
5925        }
5926        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
5927        ::core::result::Result::Ok(())
5928    }
5929    fn merge_text(
5930        &mut self,
5931        dec: &mut ::buffa::text::TextDecoder<'_>,
5932    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
5933        #[allow(unused_imports)]
5934        use ::buffa::Enumeration as _;
5935        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
5936            match __name {
5937                "name" => {
5938                    self.name = ::core::option::Option::Some(
5939                        dec.read_string()?.into_owned(),
5940                    );
5941                }
5942                "options" => dec.merge_message(self.options.get_or_insert_default())?,
5943                "visibility" => {
5944                    self.visibility = ::core::option::Option::Some(
5945                        dec.read_closed_enum_by_name::<SymbolVisibility>()?,
5946                    );
5947                }
5948                "value" => {
5949                    dec.read_repeated_into(
5950                        &mut self.value,
5951                        |__d| {
5952                            let mut __m = ::core::default::Default::default();
5953                            __d.merge_message(&mut __m)?;
5954                            ::core::result::Result::Ok(__m)
5955                        },
5956                    )?
5957                }
5958                "reserved_range" => {
5959                    dec.read_repeated_into(
5960                        &mut self.reserved_range,
5961                        |__d| {
5962                            let mut __m = ::core::default::Default::default();
5963                            __d.merge_message(&mut __m)?;
5964                            ::core::result::Result::Ok(__m)
5965                        },
5966                    )?
5967                }
5968                "reserved_name" => {
5969                    dec.read_repeated_into(
5970                        &mut self.reserved_name,
5971                        |__d| ::core::result::Result::Ok(__d.read_string()?.into_owned()),
5972                    )?
5973                }
5974                _ => dec.skip_value()?,
5975            }
5976        }
5977        ::core::result::Result::Ok(())
5978    }
5979}
5980#[cfg(feature = "json")]
5981impl ::buffa::json_helpers::ProtoElemJson for EnumDescriptorProto {
5982    fn serialize_proto_json<S: ::serde::Serializer>(
5983        v: &Self,
5984        s: S,
5985    ) -> ::core::result::Result<S::Ok, S::Error> {
5986        ::serde::Serialize::serialize(v, s)
5987    }
5988    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5989        d: D,
5990    ) -> ::core::result::Result<Self, D::Error> {
5991        <Self as ::serde::Deserialize>::deserialize(d)
5992    }
5993}
5994#[cfg(feature = "json")]
5995#[doc(hidden)]
5996pub const __ENUM_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5997    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
5998    to_json: ::buffa::type_registry::any_to_json::<EnumDescriptorProto>,
5999    from_json: ::buffa::type_registry::any_from_json::<EnumDescriptorProto>,
6000    is_wkt: false,
6001};
6002#[cfg(feature = "text")]
6003#[doc(hidden)]
6004pub const __ENUM_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6005    type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto",
6006    text_encode: ::buffa::type_registry::any_encode_text::<EnumDescriptorProto>,
6007    text_merge: ::buffa::type_registry::any_merge_text::<EnumDescriptorProto>,
6008};
6009pub mod enum_descriptor_proto {
6010    #[allow(unused_imports)]
6011    use super::*;
6012    /// Range of reserved numeric values. Reserved values may not be used by
6013    /// entries in the same enum. Reserved ranges may not overlap.
6014    ///
6015    /// Note that this is distinct from DescriptorProto.ReservedRange in that it
6016    /// is inclusive such that it can appropriately represent the entire int32
6017    /// domain.
6018    #[derive(Clone, PartialEq, Default)]
6019    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6020    #[cfg_attr(feature = "json", serde(default))]
6021    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6022    pub struct EnumReservedRange {
6023        /// Inclusive.
6024        ///
6025        /// Field 1: `start`
6026        #[cfg_attr(
6027            feature = "json",
6028            serde(
6029                rename = "start",
6030                with = "::buffa::json_helpers::opt_int32",
6031                skip_serializing_if = "::core::option::Option::is_none"
6032            )
6033        )]
6034        pub start: ::core::option::Option<i32>,
6035        /// Inclusive.
6036        ///
6037        /// Field 2: `end`
6038        #[cfg_attr(
6039            feature = "json",
6040            serde(
6041                rename = "end",
6042                with = "::buffa::json_helpers::opt_int32",
6043                skip_serializing_if = "::core::option::Option::is_none"
6044            )
6045        )]
6046        pub end: ::core::option::Option<i32>,
6047        #[cfg_attr(feature = "json", serde(skip))]
6048        #[doc(hidden)]
6049        pub __buffa_unknown_fields: ::buffa::UnknownFields,
6050    }
6051    impl ::core::fmt::Debug for EnumReservedRange {
6052        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6053            f.debug_struct("EnumReservedRange")
6054                .field("start", &self.start)
6055                .field("end", &self.end)
6056                .finish()
6057        }
6058    }
6059    impl EnumReservedRange {
6060        /// Protobuf type URL for this message, for use with `Any::pack` and
6061        /// `Any::unpack_if`.
6062        ///
6063        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6064        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
6065    }
6066    impl EnumReservedRange {
6067        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6068        #[inline]
6069        ///Sets [`Self::start`] to `Some(value)`, consuming and returning `self`.
6070        pub fn with_start(mut self, value: i32) -> Self {
6071            self.start = Some(value);
6072            self
6073        }
6074        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6075        #[inline]
6076        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
6077        pub fn with_end(mut self, value: i32) -> Self {
6078            self.end = Some(value);
6079            self
6080        }
6081    }
6082    impl ::buffa::DefaultInstance for EnumReservedRange {
6083        fn default_instance() -> &'static Self {
6084            static VALUE: ::buffa::__private::OnceBox<EnumReservedRange> = ::buffa::__private::OnceBox::new();
6085            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6086        }
6087    }
6088    impl ::buffa::MessageName for EnumReservedRange {
6089        const PACKAGE: &'static str = "google.protobuf";
6090        const NAME: &'static str = "EnumDescriptorProto.EnumReservedRange";
6091        const FULL_NAME: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
6092        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
6093    }
6094    impl ::buffa::Message for EnumReservedRange {
6095        /// Returns the total encoded size in bytes.
6096        ///
6097        /// The result is a `u32`; the protobuf specification requires all
6098        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6099        /// compliant message will never overflow this type.
6100        #[allow(clippy::let_and_return)]
6101        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6102            #[allow(unused_imports)]
6103            use ::buffa::Enumeration as _;
6104            let mut size = 0u32;
6105            if let Some(v) = self.start {
6106                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
6107            }
6108            if let Some(v) = self.end {
6109                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
6110            }
6111            size += self.__buffa_unknown_fields.encoded_len() as u32;
6112            size
6113        }
6114        fn write_to(
6115            &self,
6116            _cache: &mut ::buffa::SizeCache,
6117            buf: &mut impl ::buffa::bytes::BufMut,
6118        ) {
6119            #[allow(unused_imports)]
6120            use ::buffa::Enumeration as _;
6121            if let Some(v) = self.start {
6122                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
6123                    .encode(buf);
6124                ::buffa::types::encode_int32(v, buf);
6125            }
6126            if let Some(v) = self.end {
6127                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
6128                    .encode(buf);
6129                ::buffa::types::encode_int32(v, buf);
6130            }
6131            self.__buffa_unknown_fields.write_to(buf);
6132        }
6133        fn merge_field(
6134            &mut self,
6135            tag: ::buffa::encoding::Tag,
6136            buf: &mut impl ::buffa::bytes::Buf,
6137            depth: u32,
6138        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6139            #[allow(unused_imports)]
6140            use ::buffa::bytes::Buf as _;
6141            #[allow(unused_imports)]
6142            use ::buffa::Enumeration as _;
6143            match tag.field_number() {
6144                1u32 => {
6145                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6146                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6147                            field_number: 1u32,
6148                            expected: 0u8,
6149                            actual: tag.wire_type() as u8,
6150                        });
6151                    }
6152                    self.start = ::core::option::Option::Some(
6153                        ::buffa::types::decode_int32(buf)?,
6154                    );
6155                }
6156                2u32 => {
6157                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6158                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6159                            field_number: 2u32,
6160                            expected: 0u8,
6161                            actual: tag.wire_type() as u8,
6162                        });
6163                    }
6164                    self.end = ::core::option::Option::Some(
6165                        ::buffa::types::decode_int32(buf)?,
6166                    );
6167                }
6168                _ => {
6169                    self.__buffa_unknown_fields
6170                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
6171                }
6172            }
6173            ::core::result::Result::Ok(())
6174        }
6175        fn clear(&mut self) {
6176            self.start = ::core::option::Option::None;
6177            self.end = ::core::option::Option::None;
6178            self.__buffa_unknown_fields.clear();
6179        }
6180    }
6181    impl ::buffa::ExtensionSet for EnumReservedRange {
6182        const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
6183        fn unknown_fields(&self) -> &::buffa::UnknownFields {
6184            &self.__buffa_unknown_fields
6185        }
6186        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6187            &mut self.__buffa_unknown_fields
6188        }
6189    }
6190    #[cfg(feature = "text")]
6191    impl ::buffa::text::TextFormat for EnumReservedRange {
6192        fn encode_text(
6193            &self,
6194            enc: &mut ::buffa::text::TextEncoder<'_>,
6195        ) -> ::core::fmt::Result {
6196            #[allow(unused_imports)]
6197            use ::buffa::Enumeration as _;
6198            if let ::core::option::Option::Some(ref __v) = self.start {
6199                enc.write_field_name("start")?;
6200                enc.write_i32(*__v)?;
6201            }
6202            if let ::core::option::Option::Some(ref __v) = self.end {
6203                enc.write_field_name("end")?;
6204                enc.write_i32(*__v)?;
6205            }
6206            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6207            ::core::result::Result::Ok(())
6208        }
6209        fn merge_text(
6210            &mut self,
6211            dec: &mut ::buffa::text::TextDecoder<'_>,
6212        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6213            #[allow(unused_imports)]
6214            use ::buffa::Enumeration as _;
6215            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6216                match __name {
6217                    "start" => self.start = ::core::option::Option::Some(dec.read_i32()?),
6218                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
6219                    _ => dec.skip_value()?,
6220                }
6221            }
6222            ::core::result::Result::Ok(())
6223        }
6224    }
6225    #[cfg(feature = "json")]
6226    impl ::buffa::json_helpers::ProtoElemJson for EnumReservedRange {
6227        fn serialize_proto_json<S: ::serde::Serializer>(
6228            v: &Self,
6229            s: S,
6230        ) -> ::core::result::Result<S::Ok, S::Error> {
6231            ::serde::Serialize::serialize(v, s)
6232        }
6233        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6234            d: D,
6235        ) -> ::core::result::Result<Self, D::Error> {
6236            <Self as ::serde::Deserialize>::deserialize(d)
6237        }
6238    }
6239    #[cfg(feature = "json")]
6240    #[doc(hidden)]
6241    pub const __ENUM_RESERVED_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6242        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
6243        to_json: ::buffa::type_registry::any_to_json::<EnumReservedRange>,
6244        from_json: ::buffa::type_registry::any_from_json::<EnumReservedRange>,
6245        is_wkt: false,
6246    };
6247    #[cfg(feature = "text")]
6248    #[doc(hidden)]
6249    pub const __ENUM_RESERVED_RANGE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6250        type_url: "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange",
6251        text_encode: ::buffa::type_registry::any_encode_text::<EnumReservedRange>,
6252        text_merge: ::buffa::type_registry::any_merge_text::<EnumReservedRange>,
6253    };
6254    #[cfg(feature = "views")]
6255    #[doc(inline)]
6256    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeView;
6257    #[cfg(feature = "views")]
6258    #[doc(inline)]
6259    pub use super::__buffa::view::enum_descriptor_proto::EnumReservedRangeOwnedView;
6260}
6261/// Describes a value within an enum.
6262#[derive(Clone, PartialEq, Default)]
6263#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6264#[cfg_attr(feature = "json", serde(default))]
6265#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6266pub struct EnumValueDescriptorProto {
6267    /// Field 1: `name`
6268    #[cfg_attr(
6269        feature = "json",
6270        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6271    )]
6272    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6273    /// Field 2: `number`
6274    #[cfg_attr(
6275        feature = "json",
6276        serde(
6277            rename = "number",
6278            with = "::buffa::json_helpers::opt_int32",
6279            skip_serializing_if = "::core::option::Option::is_none"
6280        )
6281    )]
6282    pub number: ::core::option::Option<i32>,
6283    /// Field 3: `options`
6284    #[cfg_attr(
6285        feature = "json",
6286        serde(
6287            rename = "options",
6288            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6289        )
6290    )]
6291    pub options: ::buffa::MessageField<EnumValueOptions>,
6292    #[cfg_attr(feature = "json", serde(skip))]
6293    #[doc(hidden)]
6294    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6295}
6296impl ::core::fmt::Debug for EnumValueDescriptorProto {
6297    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6298        f.debug_struct("EnumValueDescriptorProto")
6299            .field("name", &self.name)
6300            .field("number", &self.number)
6301            .field("options", &self.options)
6302            .finish()
6303    }
6304}
6305impl EnumValueDescriptorProto {
6306    /// Protobuf type URL for this message, for use with `Any::pack` and
6307    /// `Any::unpack_if`.
6308    ///
6309    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6310    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6311}
6312impl EnumValueDescriptorProto {
6313    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6314    #[inline]
6315    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6316    pub fn with_name(
6317        mut self,
6318        value: impl Into<::buffa::alloc::string::String>,
6319    ) -> Self {
6320        self.name = Some(value.into());
6321        self
6322    }
6323    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6324    #[inline]
6325    ///Sets [`Self::number`] to `Some(value)`, consuming and returning `self`.
6326    pub fn with_number(mut self, value: i32) -> Self {
6327        self.number = Some(value);
6328        self
6329    }
6330}
6331impl ::buffa::DefaultInstance for EnumValueDescriptorProto {
6332    fn default_instance() -> &'static Self {
6333        static VALUE: ::buffa::__private::OnceBox<EnumValueDescriptorProto> = ::buffa::__private::OnceBox::new();
6334        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6335    }
6336}
6337impl ::buffa::MessageName for EnumValueDescriptorProto {
6338    const PACKAGE: &'static str = "google.protobuf";
6339    const NAME: &'static str = "EnumValueDescriptorProto";
6340    const FULL_NAME: &'static str = "google.protobuf.EnumValueDescriptorProto";
6341    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
6342}
6343impl ::buffa::Message for EnumValueDescriptorProto {
6344    /// Returns the total encoded size in bytes.
6345    ///
6346    /// The result is a `u32`; the protobuf specification requires all
6347    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6348    /// compliant message will never overflow this type.
6349    #[allow(clippy::let_and_return)]
6350    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6351        #[allow(unused_imports)]
6352        use ::buffa::Enumeration as _;
6353        let mut size = 0u32;
6354        if let Some(ref v) = self.name {
6355            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6356        }
6357        if let Some(v) = self.number {
6358            size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
6359        }
6360        if self.options.is_set() {
6361            let __slot = __cache.reserve();
6362            let inner_size = self.options.compute_size(__cache);
6363            __cache.set(__slot, inner_size);
6364            size
6365                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6366                    + inner_size;
6367        }
6368        size += self.__buffa_unknown_fields.encoded_len() as u32;
6369        size
6370    }
6371    fn write_to(
6372        &self,
6373        __cache: &mut ::buffa::SizeCache,
6374        buf: &mut impl ::buffa::bytes::BufMut,
6375    ) {
6376        #[allow(unused_imports)]
6377        use ::buffa::Enumeration as _;
6378        if let Some(ref v) = self.name {
6379            ::buffa::encoding::Tag::new(
6380                    1u32,
6381                    ::buffa::encoding::WireType::LengthDelimited,
6382                )
6383                .encode(buf);
6384            ::buffa::types::encode_string(v, buf);
6385        }
6386        if let Some(v) = self.number {
6387            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
6388                .encode(buf);
6389            ::buffa::types::encode_int32(v, buf);
6390        }
6391        if self.options.is_set() {
6392            ::buffa::encoding::Tag::new(
6393                    3u32,
6394                    ::buffa::encoding::WireType::LengthDelimited,
6395                )
6396                .encode(buf);
6397            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
6398            self.options.write_to(__cache, buf);
6399        }
6400        self.__buffa_unknown_fields.write_to(buf);
6401    }
6402    fn merge_field(
6403        &mut self,
6404        tag: ::buffa::encoding::Tag,
6405        buf: &mut impl ::buffa::bytes::Buf,
6406        depth: u32,
6407    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6408        #[allow(unused_imports)]
6409        use ::buffa::bytes::Buf as _;
6410        #[allow(unused_imports)]
6411        use ::buffa::Enumeration as _;
6412        match tag.field_number() {
6413            1u32 => {
6414                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6415                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6416                        field_number: 1u32,
6417                        expected: 2u8,
6418                        actual: tag.wire_type() as u8,
6419                    });
6420                }
6421                ::buffa::types::merge_string(
6422                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6423                    buf,
6424                )?;
6425            }
6426            2u32 => {
6427                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6428                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6429                        field_number: 2u32,
6430                        expected: 0u8,
6431                        actual: tag.wire_type() as u8,
6432                    });
6433                }
6434                self.number = ::core::option::Option::Some(
6435                    ::buffa::types::decode_int32(buf)?,
6436                );
6437            }
6438            3u32 => {
6439                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6440                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6441                        field_number: 3u32,
6442                        expected: 2u8,
6443                        actual: tag.wire_type() as u8,
6444                    });
6445                }
6446                ::buffa::Message::merge_length_delimited(
6447                    self.options.get_or_insert_default(),
6448                    buf,
6449                    depth,
6450                )?;
6451            }
6452            _ => {
6453                self.__buffa_unknown_fields
6454                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
6455            }
6456        }
6457        ::core::result::Result::Ok(())
6458    }
6459    fn clear(&mut self) {
6460        self.name = ::core::option::Option::None;
6461        self.number = ::core::option::Option::None;
6462        self.options = ::buffa::MessageField::none();
6463        self.__buffa_unknown_fields.clear();
6464    }
6465}
6466impl ::buffa::ExtensionSet for EnumValueDescriptorProto {
6467    const PROTO_FQN: &'static str = "google.protobuf.EnumValueDescriptorProto";
6468    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6469        &self.__buffa_unknown_fields
6470    }
6471    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6472        &mut self.__buffa_unknown_fields
6473    }
6474}
6475#[cfg(feature = "text")]
6476impl ::buffa::text::TextFormat for EnumValueDescriptorProto {
6477    fn encode_text(
6478        &self,
6479        enc: &mut ::buffa::text::TextEncoder<'_>,
6480    ) -> ::core::fmt::Result {
6481        #[allow(unused_imports)]
6482        use ::buffa::Enumeration as _;
6483        if let ::core::option::Option::Some(ref __v) = self.name {
6484            enc.write_field_name("name")?;
6485            enc.write_string(__v)?;
6486        }
6487        if let ::core::option::Option::Some(ref __v) = self.number {
6488            enc.write_field_name("number")?;
6489            enc.write_i32(*__v)?;
6490        }
6491        if self.options.is_set() {
6492            enc.write_field_name("options")?;
6493            enc.write_message(&*self.options)?;
6494        }
6495        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6496        ::core::result::Result::Ok(())
6497    }
6498    fn merge_text(
6499        &mut self,
6500        dec: &mut ::buffa::text::TextDecoder<'_>,
6501    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6502        #[allow(unused_imports)]
6503        use ::buffa::Enumeration as _;
6504        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6505            match __name {
6506                "name" => {
6507                    self.name = ::core::option::Option::Some(
6508                        dec.read_string()?.into_owned(),
6509                    );
6510                }
6511                "number" => self.number = ::core::option::Option::Some(dec.read_i32()?),
6512                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6513                _ => dec.skip_value()?,
6514            }
6515        }
6516        ::core::result::Result::Ok(())
6517    }
6518}
6519#[cfg(feature = "json")]
6520impl ::buffa::json_helpers::ProtoElemJson for EnumValueDescriptorProto {
6521    fn serialize_proto_json<S: ::serde::Serializer>(
6522        v: &Self,
6523        s: S,
6524    ) -> ::core::result::Result<S::Ok, S::Error> {
6525        ::serde::Serialize::serialize(v, s)
6526    }
6527    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6528        d: D,
6529    ) -> ::core::result::Result<Self, D::Error> {
6530        <Self as ::serde::Deserialize>::deserialize(d)
6531    }
6532}
6533#[cfg(feature = "json")]
6534#[doc(hidden)]
6535pub const __ENUM_VALUE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6536    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6537    to_json: ::buffa::type_registry::any_to_json::<EnumValueDescriptorProto>,
6538    from_json: ::buffa::type_registry::any_from_json::<EnumValueDescriptorProto>,
6539    is_wkt: false,
6540};
6541#[cfg(feature = "text")]
6542#[doc(hidden)]
6543pub const __ENUM_VALUE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6544    type_url: "type.googleapis.com/google.protobuf.EnumValueDescriptorProto",
6545    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueDescriptorProto>,
6546    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueDescriptorProto>,
6547};
6548/// Describes a service.
6549#[derive(Clone, PartialEq, Default)]
6550#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6551#[cfg_attr(feature = "json", serde(default))]
6552#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6553pub struct ServiceDescriptorProto {
6554    /// Field 1: `name`
6555    #[cfg_attr(
6556        feature = "json",
6557        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6558    )]
6559    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6560    /// Field 2: `method`
6561    #[cfg_attr(
6562        feature = "json",
6563        serde(
6564            rename = "method",
6565            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
6566            deserialize_with = "::buffa::json_helpers::null_as_default"
6567        )
6568    )]
6569    pub method: ::buffa::alloc::vec::Vec<MethodDescriptorProto>,
6570    /// Field 3: `options`
6571    #[cfg_attr(
6572        feature = "json",
6573        serde(
6574            rename = "options",
6575            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6576        )
6577    )]
6578    pub options: ::buffa::MessageField<ServiceOptions>,
6579    #[cfg_attr(feature = "json", serde(skip))]
6580    #[doc(hidden)]
6581    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6582}
6583impl ::core::fmt::Debug for ServiceDescriptorProto {
6584    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6585        f.debug_struct("ServiceDescriptorProto")
6586            .field("name", &self.name)
6587            .field("method", &self.method)
6588            .field("options", &self.options)
6589            .finish()
6590    }
6591}
6592impl ServiceDescriptorProto {
6593    /// Protobuf type URL for this message, for use with `Any::pack` and
6594    /// `Any::unpack_if`.
6595    ///
6596    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6597    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6598}
6599impl ServiceDescriptorProto {
6600    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6601    #[inline]
6602    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6603    pub fn with_name(
6604        mut self,
6605        value: impl Into<::buffa::alloc::string::String>,
6606    ) -> Self {
6607        self.name = Some(value.into());
6608        self
6609    }
6610}
6611impl ::buffa::DefaultInstance for ServiceDescriptorProto {
6612    fn default_instance() -> &'static Self {
6613        static VALUE: ::buffa::__private::OnceBox<ServiceDescriptorProto> = ::buffa::__private::OnceBox::new();
6614        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6615    }
6616}
6617impl ::buffa::MessageName for ServiceDescriptorProto {
6618    const PACKAGE: &'static str = "google.protobuf";
6619    const NAME: &'static str = "ServiceDescriptorProto";
6620    const FULL_NAME: &'static str = "google.protobuf.ServiceDescriptorProto";
6621    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
6622}
6623impl ::buffa::Message for ServiceDescriptorProto {
6624    /// Returns the total encoded size in bytes.
6625    ///
6626    /// The result is a `u32`; the protobuf specification requires all
6627    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6628    /// compliant message will never overflow this type.
6629    #[allow(clippy::let_and_return)]
6630    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6631        #[allow(unused_imports)]
6632        use ::buffa::Enumeration as _;
6633        let mut size = 0u32;
6634        if let Some(ref v) = self.name {
6635            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6636        }
6637        for v in &self.method {
6638            let __slot = __cache.reserve();
6639            let inner_size = v.compute_size(__cache);
6640            __cache.set(__slot, inner_size);
6641            size
6642                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6643                    + inner_size;
6644        }
6645        if self.options.is_set() {
6646            let __slot = __cache.reserve();
6647            let inner_size = self.options.compute_size(__cache);
6648            __cache.set(__slot, inner_size);
6649            size
6650                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6651                    + inner_size;
6652        }
6653        size += self.__buffa_unknown_fields.encoded_len() as u32;
6654        size
6655    }
6656    fn write_to(
6657        &self,
6658        __cache: &mut ::buffa::SizeCache,
6659        buf: &mut impl ::buffa::bytes::BufMut,
6660    ) {
6661        #[allow(unused_imports)]
6662        use ::buffa::Enumeration as _;
6663        if let Some(ref v) = self.name {
6664            ::buffa::encoding::Tag::new(
6665                    1u32,
6666                    ::buffa::encoding::WireType::LengthDelimited,
6667                )
6668                .encode(buf);
6669            ::buffa::types::encode_string(v, buf);
6670        }
6671        for v in &self.method {
6672            ::buffa::encoding::Tag::new(
6673                    2u32,
6674                    ::buffa::encoding::WireType::LengthDelimited,
6675                )
6676                .encode(buf);
6677            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
6678            v.write_to(__cache, buf);
6679        }
6680        if self.options.is_set() {
6681            ::buffa::encoding::Tag::new(
6682                    3u32,
6683                    ::buffa::encoding::WireType::LengthDelimited,
6684                )
6685                .encode(buf);
6686            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
6687            self.options.write_to(__cache, buf);
6688        }
6689        self.__buffa_unknown_fields.write_to(buf);
6690    }
6691    fn merge_field(
6692        &mut self,
6693        tag: ::buffa::encoding::Tag,
6694        buf: &mut impl ::buffa::bytes::Buf,
6695        depth: u32,
6696    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6697        #[allow(unused_imports)]
6698        use ::buffa::bytes::Buf as _;
6699        #[allow(unused_imports)]
6700        use ::buffa::Enumeration as _;
6701        match tag.field_number() {
6702            1u32 => {
6703                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6704                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6705                        field_number: 1u32,
6706                        expected: 2u8,
6707                        actual: tag.wire_type() as u8,
6708                    });
6709                }
6710                ::buffa::types::merge_string(
6711                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
6712                    buf,
6713                )?;
6714            }
6715            2u32 => {
6716                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6717                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6718                        field_number: 2u32,
6719                        expected: 2u8,
6720                        actual: tag.wire_type() as u8,
6721                    });
6722                }
6723                let mut elem = ::core::default::Default::default();
6724                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
6725                self.method.push(elem);
6726            }
6727            3u32 => {
6728                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6729                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6730                        field_number: 3u32,
6731                        expected: 2u8,
6732                        actual: tag.wire_type() as u8,
6733                    });
6734                }
6735                ::buffa::Message::merge_length_delimited(
6736                    self.options.get_or_insert_default(),
6737                    buf,
6738                    depth,
6739                )?;
6740            }
6741            _ => {
6742                self.__buffa_unknown_fields
6743                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
6744            }
6745        }
6746        ::core::result::Result::Ok(())
6747    }
6748    fn clear(&mut self) {
6749        self.name = ::core::option::Option::None;
6750        self.method.clear();
6751        self.options = ::buffa::MessageField::none();
6752        self.__buffa_unknown_fields.clear();
6753    }
6754}
6755impl ::buffa::ExtensionSet for ServiceDescriptorProto {
6756    const PROTO_FQN: &'static str = "google.protobuf.ServiceDescriptorProto";
6757    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6758        &self.__buffa_unknown_fields
6759    }
6760    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6761        &mut self.__buffa_unknown_fields
6762    }
6763}
6764#[cfg(feature = "text")]
6765impl ::buffa::text::TextFormat for ServiceDescriptorProto {
6766    fn encode_text(
6767        &self,
6768        enc: &mut ::buffa::text::TextEncoder<'_>,
6769    ) -> ::core::fmt::Result {
6770        #[allow(unused_imports)]
6771        use ::buffa::Enumeration as _;
6772        if let ::core::option::Option::Some(ref __v) = self.name {
6773            enc.write_field_name("name")?;
6774            enc.write_string(__v)?;
6775        }
6776        if self.options.is_set() {
6777            enc.write_field_name("options")?;
6778            enc.write_message(&*self.options)?;
6779        }
6780        for __v in &self.method {
6781            enc.write_field_name("method")?;
6782            enc.write_message(__v)?;
6783        }
6784        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
6785        ::core::result::Result::Ok(())
6786    }
6787    fn merge_text(
6788        &mut self,
6789        dec: &mut ::buffa::text::TextDecoder<'_>,
6790    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
6791        #[allow(unused_imports)]
6792        use ::buffa::Enumeration as _;
6793        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
6794            match __name {
6795                "name" => {
6796                    self.name = ::core::option::Option::Some(
6797                        dec.read_string()?.into_owned(),
6798                    );
6799                }
6800                "options" => dec.merge_message(self.options.get_or_insert_default())?,
6801                "method" => {
6802                    dec.read_repeated_into(
6803                        &mut self.method,
6804                        |__d| {
6805                            let mut __m = ::core::default::Default::default();
6806                            __d.merge_message(&mut __m)?;
6807                            ::core::result::Result::Ok(__m)
6808                        },
6809                    )?
6810                }
6811                _ => dec.skip_value()?,
6812            }
6813        }
6814        ::core::result::Result::Ok(())
6815    }
6816}
6817#[cfg(feature = "json")]
6818impl ::buffa::json_helpers::ProtoElemJson for ServiceDescriptorProto {
6819    fn serialize_proto_json<S: ::serde::Serializer>(
6820        v: &Self,
6821        s: S,
6822    ) -> ::core::result::Result<S::Ok, S::Error> {
6823        ::serde::Serialize::serialize(v, s)
6824    }
6825    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6826        d: D,
6827    ) -> ::core::result::Result<Self, D::Error> {
6828        <Self as ::serde::Deserialize>::deserialize(d)
6829    }
6830}
6831#[cfg(feature = "json")]
6832#[doc(hidden)]
6833pub const __SERVICE_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6834    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6835    to_json: ::buffa::type_registry::any_to_json::<ServiceDescriptorProto>,
6836    from_json: ::buffa::type_registry::any_from_json::<ServiceDescriptorProto>,
6837    is_wkt: false,
6838};
6839#[cfg(feature = "text")]
6840#[doc(hidden)]
6841pub const __SERVICE_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
6842    type_url: "type.googleapis.com/google.protobuf.ServiceDescriptorProto",
6843    text_encode: ::buffa::type_registry::any_encode_text::<ServiceDescriptorProto>,
6844    text_merge: ::buffa::type_registry::any_merge_text::<ServiceDescriptorProto>,
6845};
6846/// Describes a method of a service.
6847#[derive(Clone, PartialEq, Default)]
6848#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
6849#[cfg_attr(feature = "json", serde(default))]
6850#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6851pub struct MethodDescriptorProto {
6852    /// Field 1: `name`
6853    #[cfg_attr(
6854        feature = "json",
6855        serde(rename = "name", skip_serializing_if = "::core::option::Option::is_none")
6856    )]
6857    pub name: ::core::option::Option<::buffa::alloc::string::String>,
6858    /// Input and output type names.  These are resolved in the same way as
6859    /// FieldDescriptorProto.type_name, but must refer to a message type.
6860    ///
6861    /// Field 2: `input_type`
6862    #[cfg_attr(
6863        feature = "json",
6864        serde(
6865            rename = "inputType",
6866            alias = "input_type",
6867            skip_serializing_if = "::core::option::Option::is_none"
6868        )
6869    )]
6870    pub input_type: ::core::option::Option<::buffa::alloc::string::String>,
6871    /// Field 3: `output_type`
6872    #[cfg_attr(
6873        feature = "json",
6874        serde(
6875            rename = "outputType",
6876            alias = "output_type",
6877            skip_serializing_if = "::core::option::Option::is_none"
6878        )
6879    )]
6880    pub output_type: ::core::option::Option<::buffa::alloc::string::String>,
6881    /// Field 4: `options`
6882    #[cfg_attr(
6883        feature = "json",
6884        serde(
6885            rename = "options",
6886            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6887        )
6888    )]
6889    pub options: ::buffa::MessageField<MethodOptions>,
6890    /// Identifies if client streams multiple client messages
6891    ///
6892    /// Field 5: `client_streaming`
6893    #[cfg_attr(
6894        feature = "json",
6895        serde(
6896            rename = "clientStreaming",
6897            alias = "client_streaming",
6898            skip_serializing_if = "::core::option::Option::is_none"
6899        )
6900    )]
6901    pub client_streaming: ::core::option::Option<bool>,
6902    /// Identifies if server streams multiple server messages
6903    ///
6904    /// Field 6: `server_streaming`
6905    #[cfg_attr(
6906        feature = "json",
6907        serde(
6908            rename = "serverStreaming",
6909            alias = "server_streaming",
6910            skip_serializing_if = "::core::option::Option::is_none"
6911        )
6912    )]
6913    pub server_streaming: ::core::option::Option<bool>,
6914    #[cfg_attr(feature = "json", serde(skip))]
6915    #[doc(hidden)]
6916    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6917}
6918impl ::core::fmt::Debug for MethodDescriptorProto {
6919    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6920        f.debug_struct("MethodDescriptorProto")
6921            .field("name", &self.name)
6922            .field("input_type", &self.input_type)
6923            .field("output_type", &self.output_type)
6924            .field("options", &self.options)
6925            .field("client_streaming", &self.client_streaming)
6926            .field("server_streaming", &self.server_streaming)
6927            .finish()
6928    }
6929}
6930impl MethodDescriptorProto {
6931    /// Protobuf type URL for this message, for use with `Any::pack` and
6932    /// `Any::unpack_if`.
6933    ///
6934    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6935    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6936}
6937impl MethodDescriptorProto {
6938    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6939    #[inline]
6940    ///Sets [`Self::name`] to `Some(value)`, consuming and returning `self`.
6941    pub fn with_name(
6942        mut self,
6943        value: impl Into<::buffa::alloc::string::String>,
6944    ) -> Self {
6945        self.name = Some(value.into());
6946        self
6947    }
6948    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6949    #[inline]
6950    ///Sets [`Self::input_type`] to `Some(value)`, consuming and returning `self`.
6951    pub fn with_input_type(
6952        mut self,
6953        value: impl Into<::buffa::alloc::string::String>,
6954    ) -> Self {
6955        self.input_type = Some(value.into());
6956        self
6957    }
6958    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6959    #[inline]
6960    ///Sets [`Self::output_type`] to `Some(value)`, consuming and returning `self`.
6961    pub fn with_output_type(
6962        mut self,
6963        value: impl Into<::buffa::alloc::string::String>,
6964    ) -> Self {
6965        self.output_type = Some(value.into());
6966        self
6967    }
6968    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6969    #[inline]
6970    ///Sets [`Self::client_streaming`] to `Some(value)`, consuming and returning `self`.
6971    pub fn with_client_streaming(mut self, value: bool) -> Self {
6972        self.client_streaming = Some(value);
6973        self
6974    }
6975    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
6976    #[inline]
6977    ///Sets [`Self::server_streaming`] to `Some(value)`, consuming and returning `self`.
6978    pub fn with_server_streaming(mut self, value: bool) -> Self {
6979        self.server_streaming = Some(value);
6980        self
6981    }
6982}
6983impl ::buffa::DefaultInstance for MethodDescriptorProto {
6984    fn default_instance() -> &'static Self {
6985        static VALUE: ::buffa::__private::OnceBox<MethodDescriptorProto> = ::buffa::__private::OnceBox::new();
6986        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6987    }
6988}
6989impl ::buffa::MessageName for MethodDescriptorProto {
6990    const PACKAGE: &'static str = "google.protobuf";
6991    const NAME: &'static str = "MethodDescriptorProto";
6992    const FULL_NAME: &'static str = "google.protobuf.MethodDescriptorProto";
6993    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
6994}
6995impl ::buffa::Message for MethodDescriptorProto {
6996    /// Returns the total encoded size in bytes.
6997    ///
6998    /// The result is a `u32`; the protobuf specification requires all
6999    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7000    /// compliant message will never overflow this type.
7001    #[allow(clippy::let_and_return)]
7002    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7003        #[allow(unused_imports)]
7004        use ::buffa::Enumeration as _;
7005        let mut size = 0u32;
7006        if let Some(ref v) = self.name {
7007            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7008        }
7009        if let Some(ref v) = self.input_type {
7010            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7011        }
7012        if let Some(ref v) = self.output_type {
7013            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7014        }
7015        if self.options.is_set() {
7016            let __slot = __cache.reserve();
7017            let inner_size = self.options.compute_size(__cache);
7018            __cache.set(__slot, inner_size);
7019            size
7020                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7021                    + inner_size;
7022        }
7023        if self.client_streaming.is_some() {
7024            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7025        }
7026        if self.server_streaming.is_some() {
7027            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7028        }
7029        size += self.__buffa_unknown_fields.encoded_len() as u32;
7030        size
7031    }
7032    fn write_to(
7033        &self,
7034        __cache: &mut ::buffa::SizeCache,
7035        buf: &mut impl ::buffa::bytes::BufMut,
7036    ) {
7037        #[allow(unused_imports)]
7038        use ::buffa::Enumeration as _;
7039        if let Some(ref v) = self.name {
7040            ::buffa::encoding::Tag::new(
7041                    1u32,
7042                    ::buffa::encoding::WireType::LengthDelimited,
7043                )
7044                .encode(buf);
7045            ::buffa::types::encode_string(v, buf);
7046        }
7047        if let Some(ref v) = self.input_type {
7048            ::buffa::encoding::Tag::new(
7049                    2u32,
7050                    ::buffa::encoding::WireType::LengthDelimited,
7051                )
7052                .encode(buf);
7053            ::buffa::types::encode_string(v, buf);
7054        }
7055        if let Some(ref v) = self.output_type {
7056            ::buffa::encoding::Tag::new(
7057                    3u32,
7058                    ::buffa::encoding::WireType::LengthDelimited,
7059                )
7060                .encode(buf);
7061            ::buffa::types::encode_string(v, buf);
7062        }
7063        if self.options.is_set() {
7064            ::buffa::encoding::Tag::new(
7065                    4u32,
7066                    ::buffa::encoding::WireType::LengthDelimited,
7067                )
7068                .encode(buf);
7069            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
7070            self.options.write_to(__cache, buf);
7071        }
7072        if let Some(v) = self.client_streaming {
7073            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
7074                .encode(buf);
7075            ::buffa::types::encode_bool(v, buf);
7076        }
7077        if let Some(v) = self.server_streaming {
7078            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
7079                .encode(buf);
7080            ::buffa::types::encode_bool(v, buf);
7081        }
7082        self.__buffa_unknown_fields.write_to(buf);
7083    }
7084    fn merge_field(
7085        &mut self,
7086        tag: ::buffa::encoding::Tag,
7087        buf: &mut impl ::buffa::bytes::Buf,
7088        depth: u32,
7089    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7090        #[allow(unused_imports)]
7091        use ::buffa::bytes::Buf as _;
7092        #[allow(unused_imports)]
7093        use ::buffa::Enumeration as _;
7094        match tag.field_number() {
7095            1u32 => {
7096                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7097                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7098                        field_number: 1u32,
7099                        expected: 2u8,
7100                        actual: tag.wire_type() as u8,
7101                    });
7102                }
7103                ::buffa::types::merge_string(
7104                    self.name.get_or_insert_with(::buffa::alloc::string::String::new),
7105                    buf,
7106                )?;
7107            }
7108            2u32 => {
7109                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7110                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7111                        field_number: 2u32,
7112                        expected: 2u8,
7113                        actual: tag.wire_type() as u8,
7114                    });
7115                }
7116                ::buffa::types::merge_string(
7117                    self
7118                        .input_type
7119                        .get_or_insert_with(::buffa::alloc::string::String::new),
7120                    buf,
7121                )?;
7122            }
7123            3u32 => {
7124                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7125                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7126                        field_number: 3u32,
7127                        expected: 2u8,
7128                        actual: tag.wire_type() as u8,
7129                    });
7130                }
7131                ::buffa::types::merge_string(
7132                    self
7133                        .output_type
7134                        .get_or_insert_with(::buffa::alloc::string::String::new),
7135                    buf,
7136                )?;
7137            }
7138            4u32 => {
7139                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7140                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7141                        field_number: 4u32,
7142                        expected: 2u8,
7143                        actual: tag.wire_type() as u8,
7144                    });
7145                }
7146                ::buffa::Message::merge_length_delimited(
7147                    self.options.get_or_insert_default(),
7148                    buf,
7149                    depth,
7150                )?;
7151            }
7152            5u32 => {
7153                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7154                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7155                        field_number: 5u32,
7156                        expected: 0u8,
7157                        actual: tag.wire_type() as u8,
7158                    });
7159                }
7160                self.client_streaming = ::core::option::Option::Some(
7161                    ::buffa::types::decode_bool(buf)?,
7162                );
7163            }
7164            6u32 => {
7165                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7166                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7167                        field_number: 6u32,
7168                        expected: 0u8,
7169                        actual: tag.wire_type() as u8,
7170                    });
7171                }
7172                self.server_streaming = ::core::option::Option::Some(
7173                    ::buffa::types::decode_bool(buf)?,
7174                );
7175            }
7176            _ => {
7177                self.__buffa_unknown_fields
7178                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
7179            }
7180        }
7181        ::core::result::Result::Ok(())
7182    }
7183    fn clear(&mut self) {
7184        self.name = ::core::option::Option::None;
7185        self.input_type = ::core::option::Option::None;
7186        self.output_type = ::core::option::Option::None;
7187        self.options = ::buffa::MessageField::none();
7188        self.client_streaming = ::core::option::Option::None;
7189        self.server_streaming = ::core::option::Option::None;
7190        self.__buffa_unknown_fields.clear();
7191    }
7192}
7193impl ::buffa::ExtensionSet for MethodDescriptorProto {
7194    const PROTO_FQN: &'static str = "google.protobuf.MethodDescriptorProto";
7195    fn unknown_fields(&self) -> &::buffa::UnknownFields {
7196        &self.__buffa_unknown_fields
7197    }
7198    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7199        &mut self.__buffa_unknown_fields
7200    }
7201}
7202#[cfg(feature = "text")]
7203impl ::buffa::text::TextFormat for MethodDescriptorProto {
7204    fn encode_text(
7205        &self,
7206        enc: &mut ::buffa::text::TextEncoder<'_>,
7207    ) -> ::core::fmt::Result {
7208        #[allow(unused_imports)]
7209        use ::buffa::Enumeration as _;
7210        if let ::core::option::Option::Some(ref __v) = self.name {
7211            enc.write_field_name("name")?;
7212            enc.write_string(__v)?;
7213        }
7214        if let ::core::option::Option::Some(ref __v) = self.input_type {
7215            enc.write_field_name("input_type")?;
7216            enc.write_string(__v)?;
7217        }
7218        if let ::core::option::Option::Some(ref __v) = self.output_type {
7219            enc.write_field_name("output_type")?;
7220            enc.write_string(__v)?;
7221        }
7222        if self.options.is_set() {
7223            enc.write_field_name("options")?;
7224            enc.write_message(&*self.options)?;
7225        }
7226        if let ::core::option::Option::Some(ref __v) = self.client_streaming {
7227            enc.write_field_name("client_streaming")?;
7228            enc.write_bool(*__v)?;
7229        }
7230        if let ::core::option::Option::Some(ref __v) = self.server_streaming {
7231            enc.write_field_name("server_streaming")?;
7232            enc.write_bool(*__v)?;
7233        }
7234        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
7235        ::core::result::Result::Ok(())
7236    }
7237    fn merge_text(
7238        &mut self,
7239        dec: &mut ::buffa::text::TextDecoder<'_>,
7240    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
7241        #[allow(unused_imports)]
7242        use ::buffa::Enumeration as _;
7243        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
7244            match __name {
7245                "name" => {
7246                    self.name = ::core::option::Option::Some(
7247                        dec.read_string()?.into_owned(),
7248                    );
7249                }
7250                "input_type" => {
7251                    self.input_type = ::core::option::Option::Some(
7252                        dec.read_string()?.into_owned(),
7253                    );
7254                }
7255                "output_type" => {
7256                    self.output_type = ::core::option::Option::Some(
7257                        dec.read_string()?.into_owned(),
7258                    );
7259                }
7260                "options" => dec.merge_message(self.options.get_or_insert_default())?,
7261                "client_streaming" => {
7262                    self.client_streaming = ::core::option::Option::Some(
7263                        dec.read_bool()?,
7264                    );
7265                }
7266                "server_streaming" => {
7267                    self.server_streaming = ::core::option::Option::Some(
7268                        dec.read_bool()?,
7269                    );
7270                }
7271                _ => dec.skip_value()?,
7272            }
7273        }
7274        ::core::result::Result::Ok(())
7275    }
7276}
7277#[cfg(feature = "json")]
7278impl ::buffa::json_helpers::ProtoElemJson for MethodDescriptorProto {
7279    fn serialize_proto_json<S: ::serde::Serializer>(
7280        v: &Self,
7281        s: S,
7282    ) -> ::core::result::Result<S::Ok, S::Error> {
7283        ::serde::Serialize::serialize(v, s)
7284    }
7285    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
7286        d: D,
7287    ) -> ::core::result::Result<Self, D::Error> {
7288        <Self as ::serde::Deserialize>::deserialize(d)
7289    }
7290}
7291#[cfg(feature = "json")]
7292#[doc(hidden)]
7293pub const __METHOD_DESCRIPTOR_PROTO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
7294    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
7295    to_json: ::buffa::type_registry::any_to_json::<MethodDescriptorProto>,
7296    from_json: ::buffa::type_registry::any_from_json::<MethodDescriptorProto>,
7297    is_wkt: false,
7298};
7299#[cfg(feature = "text")]
7300#[doc(hidden)]
7301pub const __METHOD_DESCRIPTOR_PROTO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
7302    type_url: "type.googleapis.com/google.protobuf.MethodDescriptorProto",
7303    text_encode: ::buffa::type_registry::any_encode_text::<MethodDescriptorProto>,
7304    text_merge: ::buffa::type_registry::any_merge_text::<MethodDescriptorProto>,
7305};
7306/// ===================================================================
7307/// Options
7308///
7309/// Each of the definitions above may have "options" attached.  These are
7310/// just annotations which may cause code to be generated slightly differently
7311/// or may contain hints for code that manipulates protocol messages.
7312///
7313/// Clients may define custom options as extensions of the *Options messages.
7314/// These extensions may not yet be known at parsing time, so the parser cannot
7315/// store the values in them.  Instead it stores them in a field in the *Options
7316/// message called uninterpreted_option. This field must have the same name
7317/// across all *Options messages. We then use this field to populate the
7318/// extensions when we build a descriptor, at which point all protos have been
7319/// parsed and so all extensions are known.
7320///
7321/// Extension numbers for custom options may be chosen as follows:
7322/// * For options which will only be used within a single application or
7323///   organization, or for experimental options, use field numbers 50000
7324///   through 99999.  It is up to you to ensure that you do not use the
7325///   same number for multiple options.
7326/// * For options which will be published and used publicly by multiple
7327///   independent entities, e-mail protobuf-global-extension-registry@google.com
7328///   to reserve extension numbers. Simply provide your project name (e.g.
7329///   Objective-C plugin) and your project website (if available) -- there's no
7330///   need to explain how you intend to use them. Usually you only need one
7331///   extension number. You can declare multiple options with only one extension
7332///   number by putting them in a sub-message. See the Custom Options section of
7333///   the docs for examples:
7334///   <https://developers.google.com/protocol-buffers/docs/proto#options>
7335///   If this turns out to be popular, a web service will be set up
7336///   to automatically assign option numbers.
7337#[derive(Clone, PartialEq, Default)]
7338#[cfg_attr(feature = "json", derive(::serde::Serialize))]
7339#[cfg_attr(feature = "json", serde(default))]
7340#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
7341pub struct FileOptions {
7342    /// Sets the Java package where classes generated from this .proto will be
7343    /// placed.  By default, the proto package is used, but this is often
7344    /// inappropriate because proto packages do not normally start with backwards
7345    /// domain names.
7346    ///
7347    /// Field 1: `java_package`
7348    #[cfg_attr(
7349        feature = "json",
7350        serde(
7351            rename = "javaPackage",
7352            alias = "java_package",
7353            skip_serializing_if = "::core::option::Option::is_none"
7354        )
7355    )]
7356    pub java_package: ::core::option::Option<::buffa::alloc::string::String>,
7357    /// Controls the name of the wrapper Java class generated for the .proto file.
7358    /// That class will always contain the .proto file's getDescriptor() method as
7359    /// well as any top-level extensions defined in the .proto file.
7360    /// If java_multiple_files is disabled, then all the other classes from the
7361    /// .proto file will be nested inside the single wrapper outer class.
7362    ///
7363    /// Field 8: `java_outer_classname`
7364    #[cfg_attr(
7365        feature = "json",
7366        serde(
7367            rename = "javaOuterClassname",
7368            alias = "java_outer_classname",
7369            skip_serializing_if = "::core::option::Option::is_none"
7370        )
7371    )]
7372    pub java_outer_classname: ::core::option::Option<::buffa::alloc::string::String>,
7373    /// If enabled, then the Java code generator will generate a separate .java
7374    /// file for each top-level message, enum, and service defined in the .proto
7375    /// file.  Thus, these types will *not* be nested inside the wrapper class
7376    /// named by java_outer_classname.  However, the wrapper class will still be
7377    /// generated to contain the file's getDescriptor() method as well as any
7378    /// top-level extensions defined in the file.
7379    ///
7380    /// Field 10: `java_multiple_files`
7381    #[cfg_attr(
7382        feature = "json",
7383        serde(
7384            rename = "javaMultipleFiles",
7385            alias = "java_multiple_files",
7386            skip_serializing_if = "::core::option::Option::is_none"
7387        )
7388    )]
7389    pub java_multiple_files: ::core::option::Option<bool>,
7390    /// This option does nothing.
7391    ///
7392    /// Field 20: `java_generate_equals_and_hash`
7393    #[cfg_attr(
7394        feature = "json",
7395        serde(
7396            rename = "javaGenerateEqualsAndHash",
7397            alias = "java_generate_equals_and_hash",
7398            skip_serializing_if = "::core::option::Option::is_none"
7399        )
7400    )]
7401    pub java_generate_equals_and_hash: ::core::option::Option<bool>,
7402    /// A proto2 file can set this to true to opt in to UTF-8 checking for Java,
7403    /// which will throw an exception if invalid UTF-8 is parsed from the wire or
7404    /// assigned to a string field.
7405    ///
7406    /// TODO: clarify exactly what kinds of field types this option
7407    /// applies to, and update these docs accordingly.
7408    ///
7409    /// Proto3 files already perform these checks. Setting the option explicitly to
7410    /// false has no effect: it cannot be used to opt proto3 files out of UTF-8
7411    /// checks.
7412    ///
7413    /// Field 27: `java_string_check_utf8`
7414    #[cfg_attr(
7415        feature = "json",
7416        serde(
7417            rename = "javaStringCheckUtf8",
7418            alias = "java_string_check_utf8",
7419            skip_serializing_if = "::core::option::Option::is_none"
7420        )
7421    )]
7422    pub java_string_check_utf8: ::core::option::Option<bool>,
7423    /// Field 9: `optimize_for`
7424    #[cfg_attr(
7425        feature = "json",
7426        serde(
7427            rename = "optimizeFor",
7428            alias = "optimize_for",
7429            with = "::buffa::json_helpers::opt_closed_enum",
7430            skip_serializing_if = "::core::option::Option::is_none"
7431        )
7432    )]
7433    pub optimize_for: ::core::option::Option<file_options::OptimizeMode>,
7434    /// Sets the Go package where structs generated from this .proto will be
7435    /// placed. If omitted, the Go package will be derived from the following:
7436    ///   - The basename of the package import path, if provided.
7437    ///   - Otherwise, the package statement in the .proto file, if present.
7438    ///   - Otherwise, the basename of the .proto file, without extension.
7439    ///
7440    /// Field 11: `go_package`
7441    #[cfg_attr(
7442        feature = "json",
7443        serde(
7444            rename = "goPackage",
7445            alias = "go_package",
7446            skip_serializing_if = "::core::option::Option::is_none"
7447        )
7448    )]
7449    pub go_package: ::core::option::Option<::buffa::alloc::string::String>,
7450    /// Should generic services be generated in each language?  "Generic" services
7451    /// are not specific to any particular RPC system.  They are generated by the
7452    /// main code generators in each language (without additional plugins).
7453    /// Generic services were the only kind of service generation supported by
7454    /// early versions of google.protobuf.
7455    ///
7456    /// Generic services are now considered deprecated in favor of using plugins
7457    /// that generate code specific to your particular RPC system.  Therefore,
7458    /// these default to false.  Old code which depends on generic services should
7459    /// explicitly set them to true.
7460    ///
7461    /// Field 16: `cc_generic_services`
7462    #[cfg_attr(
7463        feature = "json",
7464        serde(
7465            rename = "ccGenericServices",
7466            alias = "cc_generic_services",
7467            skip_serializing_if = "::core::option::Option::is_none"
7468        )
7469    )]
7470    pub cc_generic_services: ::core::option::Option<bool>,
7471    /// Field 17: `java_generic_services`
7472    #[cfg_attr(
7473        feature = "json",
7474        serde(
7475            rename = "javaGenericServices",
7476            alias = "java_generic_services",
7477            skip_serializing_if = "::core::option::Option::is_none"
7478        )
7479    )]
7480    pub java_generic_services: ::core::option::Option<bool>,
7481    /// Field 18: `py_generic_services`
7482    #[cfg_attr(
7483        feature = "json",
7484        serde(
7485            rename = "pyGenericServices",
7486            alias = "py_generic_services",
7487            skip_serializing_if = "::core::option::Option::is_none"
7488        )
7489    )]
7490    pub py_generic_services: ::core::option::Option<bool>,
7491    /// Is this file deprecated?
7492    /// Depending on the target platform, this can emit Deprecated annotations
7493    /// for everything in the file, or it will be completely ignored; in the very
7494    /// least, this is a formalization for deprecating files.
7495    ///
7496    /// Field 23: `deprecated`
7497    #[cfg_attr(
7498        feature = "json",
7499        serde(
7500            rename = "deprecated",
7501            skip_serializing_if = "::core::option::Option::is_none"
7502        )
7503    )]
7504    pub deprecated: ::core::option::Option<bool>,
7505    /// Enables the use of arenas for the proto messages in this file. This applies
7506    /// only to generated classes for C++.
7507    ///
7508    /// Field 31: `cc_enable_arenas`
7509    #[cfg_attr(
7510        feature = "json",
7511        serde(
7512            rename = "ccEnableArenas",
7513            alias = "cc_enable_arenas",
7514            skip_serializing_if = "::core::option::Option::is_none"
7515        )
7516    )]
7517    pub cc_enable_arenas: ::core::option::Option<bool>,
7518    /// Sets the objective c class prefix which is prepended to all objective c
7519    /// generated classes from this .proto. There is no default.
7520    ///
7521    /// Field 36: `objc_class_prefix`
7522    #[cfg_attr(
7523        feature = "json",
7524        serde(
7525            rename = "objcClassPrefix",
7526            alias = "objc_class_prefix",
7527            skip_serializing_if = "::core::option::Option::is_none"
7528        )
7529    )]
7530    pub objc_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7531    /// Namespace for generated classes; defaults to the package.
7532    ///
7533    /// Field 37: `csharp_namespace`
7534    #[cfg_attr(
7535        feature = "json",
7536        serde(
7537            rename = "csharpNamespace",
7538            alias = "csharp_namespace",
7539            skip_serializing_if = "::core::option::Option::is_none"
7540        )
7541    )]
7542    pub csharp_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7543    /// By default Swift generators will take the proto package and CamelCase it
7544    /// replacing '.' with underscore and use that to prefix the types/symbols
7545    /// defined. When this options is provided, they will use this value instead
7546    /// to prefix the types/symbols defined.
7547    ///
7548    /// Field 39: `swift_prefix`
7549    #[cfg_attr(
7550        feature = "json",
7551        serde(
7552            rename = "swiftPrefix",
7553            alias = "swift_prefix",
7554            skip_serializing_if = "::core::option::Option::is_none"
7555        )
7556    )]
7557    pub swift_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7558    /// Sets the php class prefix which is prepended to all php generated classes
7559    /// from this .proto. Default is empty.
7560    ///
7561    /// Field 40: `php_class_prefix`
7562    #[cfg_attr(
7563        feature = "json",
7564        serde(
7565            rename = "phpClassPrefix",
7566            alias = "php_class_prefix",
7567            skip_serializing_if = "::core::option::Option::is_none"
7568        )
7569    )]
7570    pub php_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
7571    /// Use this option to change the namespace of php generated classes. Default
7572    /// is empty. When this option is empty, the package name will be used for
7573    /// determining the namespace.
7574    ///
7575    /// Field 41: `php_namespace`
7576    #[cfg_attr(
7577        feature = "json",
7578        serde(
7579            rename = "phpNamespace",
7580            alias = "php_namespace",
7581            skip_serializing_if = "::core::option::Option::is_none"
7582        )
7583    )]
7584    pub php_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7585    /// Use this option to change the namespace of php generated metadata classes.
7586    /// Default is empty. When this option is empty, the proto file name will be
7587    /// used for determining the namespace.
7588    ///
7589    /// Field 44: `php_metadata_namespace`
7590    #[cfg_attr(
7591        feature = "json",
7592        serde(
7593            rename = "phpMetadataNamespace",
7594            alias = "php_metadata_namespace",
7595            skip_serializing_if = "::core::option::Option::is_none"
7596        )
7597    )]
7598    pub php_metadata_namespace: ::core::option::Option<::buffa::alloc::string::String>,
7599    /// Use this option to change the package of ruby generated classes. Default
7600    /// is empty. When this option is not set, the package name will be used for
7601    /// determining the ruby package.
7602    ///
7603    /// Field 45: `ruby_package`
7604    #[cfg_attr(
7605        feature = "json",
7606        serde(
7607            rename = "rubyPackage",
7608            alias = "ruby_package",
7609            skip_serializing_if = "::core::option::Option::is_none"
7610        )
7611    )]
7612    pub ruby_package: ::core::option::Option<::buffa::alloc::string::String>,
7613    /// Any features defined in the specific edition.
7614    /// WARNING: This field should only be used by protobuf plugins or special
7615    /// cases like the proto compiler. Other uses are discouraged and
7616    /// developers should rely on the protoreflect APIs for their client language.
7617    ///
7618    /// Field 50: `features`
7619    #[cfg_attr(
7620        feature = "json",
7621        serde(
7622            rename = "features",
7623            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7624        )
7625    )]
7626    pub features: ::buffa::MessageField<FeatureSet>,
7627    /// The parser stores options it doesn't recognize here.
7628    /// See the documentation for the "Options" section above.
7629    ///
7630    /// Field 999: `uninterpreted_option`
7631    #[cfg_attr(
7632        feature = "json",
7633        serde(
7634            rename = "uninterpretedOption",
7635            alias = "uninterpreted_option",
7636            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
7637            deserialize_with = "::buffa::json_helpers::null_as_default"
7638        )
7639    )]
7640    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
7641    #[cfg_attr(feature = "json", serde(flatten))]
7642    #[doc(hidden)]
7643    pub __buffa_unknown_fields: __FileOptionsExtJson,
7644}
7645impl ::core::fmt::Debug for FileOptions {
7646    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7647        f.debug_struct("FileOptions")
7648            .field("java_package", &self.java_package)
7649            .field("java_outer_classname", &self.java_outer_classname)
7650            .field("java_multiple_files", &self.java_multiple_files)
7651            .field("java_generate_equals_and_hash", &self.java_generate_equals_and_hash)
7652            .field("java_string_check_utf8", &self.java_string_check_utf8)
7653            .field("optimize_for", &self.optimize_for)
7654            .field("go_package", &self.go_package)
7655            .field("cc_generic_services", &self.cc_generic_services)
7656            .field("java_generic_services", &self.java_generic_services)
7657            .field("py_generic_services", &self.py_generic_services)
7658            .field("deprecated", &self.deprecated)
7659            .field("cc_enable_arenas", &self.cc_enable_arenas)
7660            .field("objc_class_prefix", &self.objc_class_prefix)
7661            .field("csharp_namespace", &self.csharp_namespace)
7662            .field("swift_prefix", &self.swift_prefix)
7663            .field("php_class_prefix", &self.php_class_prefix)
7664            .field("php_namespace", &self.php_namespace)
7665            .field("php_metadata_namespace", &self.php_metadata_namespace)
7666            .field("ruby_package", &self.ruby_package)
7667            .field("features", &self.features)
7668            .field("uninterpreted_option", &self.uninterpreted_option)
7669            .finish()
7670    }
7671}
7672impl FileOptions {
7673    /// Protobuf type URL for this message, for use with `Any::pack` and
7674    /// `Any::unpack_if`.
7675    ///
7676    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7677    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7678}
7679impl FileOptions {
7680    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7681    #[inline]
7682    ///Sets [`Self::java_package`] to `Some(value)`, consuming and returning `self`.
7683    pub fn with_java_package(
7684        mut self,
7685        value: impl Into<::buffa::alloc::string::String>,
7686    ) -> Self {
7687        self.java_package = Some(value.into());
7688        self
7689    }
7690    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7691    #[inline]
7692    ///Sets [`Self::java_outer_classname`] to `Some(value)`, consuming and returning `self`.
7693    pub fn with_java_outer_classname(
7694        mut self,
7695        value: impl Into<::buffa::alloc::string::String>,
7696    ) -> Self {
7697        self.java_outer_classname = Some(value.into());
7698        self
7699    }
7700    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7701    #[inline]
7702    ///Sets [`Self::java_multiple_files`] to `Some(value)`, consuming and returning `self`.
7703    pub fn with_java_multiple_files(mut self, value: bool) -> Self {
7704        self.java_multiple_files = Some(value);
7705        self
7706    }
7707    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7708    #[inline]
7709    ///Sets [`Self::java_generate_equals_and_hash`] to `Some(value)`, consuming and returning `self`.
7710    pub fn with_java_generate_equals_and_hash(mut self, value: bool) -> Self {
7711        self.java_generate_equals_and_hash = Some(value);
7712        self
7713    }
7714    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7715    #[inline]
7716    ///Sets [`Self::java_string_check_utf8`] to `Some(value)`, consuming and returning `self`.
7717    pub fn with_java_string_check_utf8(mut self, value: bool) -> Self {
7718        self.java_string_check_utf8 = Some(value);
7719        self
7720    }
7721    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7722    #[inline]
7723    ///Sets [`Self::optimize_for`] to `Some(value)`, consuming and returning `self`.
7724    pub fn with_optimize_for(
7725        mut self,
7726        value: impl Into<file_options::OptimizeMode>,
7727    ) -> Self {
7728        self.optimize_for = Some(value.into());
7729        self
7730    }
7731    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7732    #[inline]
7733    ///Sets [`Self::go_package`] to `Some(value)`, consuming and returning `self`.
7734    pub fn with_go_package(
7735        mut self,
7736        value: impl Into<::buffa::alloc::string::String>,
7737    ) -> Self {
7738        self.go_package = Some(value.into());
7739        self
7740    }
7741    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7742    #[inline]
7743    ///Sets [`Self::cc_generic_services`] to `Some(value)`, consuming and returning `self`.
7744    pub fn with_cc_generic_services(mut self, value: bool) -> Self {
7745        self.cc_generic_services = Some(value);
7746        self
7747    }
7748    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7749    #[inline]
7750    ///Sets [`Self::java_generic_services`] to `Some(value)`, consuming and returning `self`.
7751    pub fn with_java_generic_services(mut self, value: bool) -> Self {
7752        self.java_generic_services = Some(value);
7753        self
7754    }
7755    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7756    #[inline]
7757    ///Sets [`Self::py_generic_services`] to `Some(value)`, consuming and returning `self`.
7758    pub fn with_py_generic_services(mut self, value: bool) -> Self {
7759        self.py_generic_services = Some(value);
7760        self
7761    }
7762    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7763    #[inline]
7764    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
7765    pub fn with_deprecated(mut self, value: bool) -> Self {
7766        self.deprecated = Some(value);
7767        self
7768    }
7769    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7770    #[inline]
7771    ///Sets [`Self::cc_enable_arenas`] to `Some(value)`, consuming and returning `self`.
7772    pub fn with_cc_enable_arenas(mut self, value: bool) -> Self {
7773        self.cc_enable_arenas = Some(value);
7774        self
7775    }
7776    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7777    #[inline]
7778    ///Sets [`Self::objc_class_prefix`] to `Some(value)`, consuming and returning `self`.
7779    pub fn with_objc_class_prefix(
7780        mut self,
7781        value: impl Into<::buffa::alloc::string::String>,
7782    ) -> Self {
7783        self.objc_class_prefix = Some(value.into());
7784        self
7785    }
7786    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7787    #[inline]
7788    ///Sets [`Self::csharp_namespace`] to `Some(value)`, consuming and returning `self`.
7789    pub fn with_csharp_namespace(
7790        mut self,
7791        value: impl Into<::buffa::alloc::string::String>,
7792    ) -> Self {
7793        self.csharp_namespace = Some(value.into());
7794        self
7795    }
7796    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7797    #[inline]
7798    ///Sets [`Self::swift_prefix`] to `Some(value)`, consuming and returning `self`.
7799    pub fn with_swift_prefix(
7800        mut self,
7801        value: impl Into<::buffa::alloc::string::String>,
7802    ) -> Self {
7803        self.swift_prefix = Some(value.into());
7804        self
7805    }
7806    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7807    #[inline]
7808    ///Sets [`Self::php_class_prefix`] to `Some(value)`, consuming and returning `self`.
7809    pub fn with_php_class_prefix(
7810        mut self,
7811        value: impl Into<::buffa::alloc::string::String>,
7812    ) -> Self {
7813        self.php_class_prefix = Some(value.into());
7814        self
7815    }
7816    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7817    #[inline]
7818    ///Sets [`Self::php_namespace`] to `Some(value)`, consuming and returning `self`.
7819    pub fn with_php_namespace(
7820        mut self,
7821        value: impl Into<::buffa::alloc::string::String>,
7822    ) -> Self {
7823        self.php_namespace = Some(value.into());
7824        self
7825    }
7826    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7827    #[inline]
7828    ///Sets [`Self::php_metadata_namespace`] to `Some(value)`, consuming and returning `self`.
7829    pub fn with_php_metadata_namespace(
7830        mut self,
7831        value: impl Into<::buffa::alloc::string::String>,
7832    ) -> Self {
7833        self.php_metadata_namespace = Some(value.into());
7834        self
7835    }
7836    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
7837    #[inline]
7838    ///Sets [`Self::ruby_package`] to `Some(value)`, consuming and returning `self`.
7839    pub fn with_ruby_package(
7840        mut self,
7841        value: impl Into<::buffa::alloc::string::String>,
7842    ) -> Self {
7843        self.ruby_package = Some(value.into());
7844        self
7845    }
7846}
7847impl ::buffa::DefaultInstance for FileOptions {
7848    fn default_instance() -> &'static Self {
7849        static VALUE: ::buffa::__private::OnceBox<FileOptions> = ::buffa::__private::OnceBox::new();
7850        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7851    }
7852}
7853impl ::buffa::MessageName for FileOptions {
7854    const PACKAGE: &'static str = "google.protobuf";
7855    const NAME: &'static str = "FileOptions";
7856    const FULL_NAME: &'static str = "google.protobuf.FileOptions";
7857    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
7858}
7859impl ::buffa::Message for FileOptions {
7860    /// Returns the total encoded size in bytes.
7861    ///
7862    /// The result is a `u32`; the protobuf specification requires all
7863    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7864    /// compliant message will never overflow this type.
7865    #[allow(clippy::let_and_return)]
7866    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7867        #[allow(unused_imports)]
7868        use ::buffa::Enumeration as _;
7869        let mut size = 0u32;
7870        if let Some(ref v) = self.java_package {
7871            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7872        }
7873        if let Some(ref v) = self.java_outer_classname {
7874            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7875        }
7876        if let Some(ref v) = self.optimize_for {
7877            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
7878        }
7879        if self.java_multiple_files.is_some() {
7880            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7881        }
7882        if let Some(ref v) = self.go_package {
7883            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
7884        }
7885        if self.cc_generic_services.is_some() {
7886            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7887        }
7888        if self.java_generic_services.is_some() {
7889            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7890        }
7891        if self.py_generic_services.is_some() {
7892            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7893        }
7894        if self.java_generate_equals_and_hash.is_some() {
7895            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7896        }
7897        if self.deprecated.is_some() {
7898            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7899        }
7900        if self.java_string_check_utf8.is_some() {
7901            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7902        }
7903        if self.cc_enable_arenas.is_some() {
7904            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7905        }
7906        if let Some(ref v) = self.objc_class_prefix {
7907            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7908        }
7909        if let Some(ref v) = self.csharp_namespace {
7910            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7911        }
7912        if let Some(ref v) = self.swift_prefix {
7913            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7914        }
7915        if let Some(ref v) = self.php_class_prefix {
7916            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7917        }
7918        if let Some(ref v) = self.php_namespace {
7919            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7920        }
7921        if let Some(ref v) = self.php_metadata_namespace {
7922            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7923        }
7924        if let Some(ref v) = self.ruby_package {
7925            size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
7926        }
7927        if self.features.is_set() {
7928            let __slot = __cache.reserve();
7929            let inner_size = self.features.compute_size(__cache);
7930            __cache.set(__slot, inner_size);
7931            size
7932                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7933                    + inner_size;
7934        }
7935        for v in &self.uninterpreted_option {
7936            let __slot = __cache.reserve();
7937            let inner_size = v.compute_size(__cache);
7938            __cache.set(__slot, inner_size);
7939            size
7940                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7941                    + inner_size;
7942        }
7943        size += self.__buffa_unknown_fields.encoded_len() as u32;
7944        size
7945    }
7946    fn write_to(
7947        &self,
7948        __cache: &mut ::buffa::SizeCache,
7949        buf: &mut impl ::buffa::bytes::BufMut,
7950    ) {
7951        #[allow(unused_imports)]
7952        use ::buffa::Enumeration as _;
7953        if let Some(ref v) = self.java_package {
7954            ::buffa::encoding::Tag::new(
7955                    1u32,
7956                    ::buffa::encoding::WireType::LengthDelimited,
7957                )
7958                .encode(buf);
7959            ::buffa::types::encode_string(v, buf);
7960        }
7961        if let Some(ref v) = self.java_outer_classname {
7962            ::buffa::encoding::Tag::new(
7963                    8u32,
7964                    ::buffa::encoding::WireType::LengthDelimited,
7965                )
7966                .encode(buf);
7967            ::buffa::types::encode_string(v, buf);
7968        }
7969        if let Some(ref v) = self.optimize_for {
7970            ::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
7971                .encode(buf);
7972            ::buffa::types::encode_int32(v.to_i32(), buf);
7973        }
7974        if let Some(v) = self.java_multiple_files {
7975            ::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
7976                .encode(buf);
7977            ::buffa::types::encode_bool(v, buf);
7978        }
7979        if let Some(ref v) = self.go_package {
7980            ::buffa::encoding::Tag::new(
7981                    11u32,
7982                    ::buffa::encoding::WireType::LengthDelimited,
7983                )
7984                .encode(buf);
7985            ::buffa::types::encode_string(v, buf);
7986        }
7987        if let Some(v) = self.cc_generic_services {
7988            ::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
7989                .encode(buf);
7990            ::buffa::types::encode_bool(v, buf);
7991        }
7992        if let Some(v) = self.java_generic_services {
7993            ::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
7994                .encode(buf);
7995            ::buffa::types::encode_bool(v, buf);
7996        }
7997        if let Some(v) = self.py_generic_services {
7998            ::buffa::encoding::Tag::new(18u32, ::buffa::encoding::WireType::Varint)
7999                .encode(buf);
8000            ::buffa::types::encode_bool(v, buf);
8001        }
8002        if let Some(v) = self.java_generate_equals_and_hash {
8003            ::buffa::encoding::Tag::new(20u32, ::buffa::encoding::WireType::Varint)
8004                .encode(buf);
8005            ::buffa::types::encode_bool(v, buf);
8006        }
8007        if let Some(v) = self.deprecated {
8008            ::buffa::encoding::Tag::new(23u32, ::buffa::encoding::WireType::Varint)
8009                .encode(buf);
8010            ::buffa::types::encode_bool(v, buf);
8011        }
8012        if let Some(v) = self.java_string_check_utf8 {
8013            ::buffa::encoding::Tag::new(27u32, ::buffa::encoding::WireType::Varint)
8014                .encode(buf);
8015            ::buffa::types::encode_bool(v, buf);
8016        }
8017        if let Some(v) = self.cc_enable_arenas {
8018            ::buffa::encoding::Tag::new(31u32, ::buffa::encoding::WireType::Varint)
8019                .encode(buf);
8020            ::buffa::types::encode_bool(v, buf);
8021        }
8022        if let Some(ref v) = self.objc_class_prefix {
8023            ::buffa::encoding::Tag::new(
8024                    36u32,
8025                    ::buffa::encoding::WireType::LengthDelimited,
8026                )
8027                .encode(buf);
8028            ::buffa::types::encode_string(v, buf);
8029        }
8030        if let Some(ref v) = self.csharp_namespace {
8031            ::buffa::encoding::Tag::new(
8032                    37u32,
8033                    ::buffa::encoding::WireType::LengthDelimited,
8034                )
8035                .encode(buf);
8036            ::buffa::types::encode_string(v, buf);
8037        }
8038        if let Some(ref v) = self.swift_prefix {
8039            ::buffa::encoding::Tag::new(
8040                    39u32,
8041                    ::buffa::encoding::WireType::LengthDelimited,
8042                )
8043                .encode(buf);
8044            ::buffa::types::encode_string(v, buf);
8045        }
8046        if let Some(ref v) = self.php_class_prefix {
8047            ::buffa::encoding::Tag::new(
8048                    40u32,
8049                    ::buffa::encoding::WireType::LengthDelimited,
8050                )
8051                .encode(buf);
8052            ::buffa::types::encode_string(v, buf);
8053        }
8054        if let Some(ref v) = self.php_namespace {
8055            ::buffa::encoding::Tag::new(
8056                    41u32,
8057                    ::buffa::encoding::WireType::LengthDelimited,
8058                )
8059                .encode(buf);
8060            ::buffa::types::encode_string(v, buf);
8061        }
8062        if let Some(ref v) = self.php_metadata_namespace {
8063            ::buffa::encoding::Tag::new(
8064                    44u32,
8065                    ::buffa::encoding::WireType::LengthDelimited,
8066                )
8067                .encode(buf);
8068            ::buffa::types::encode_string(v, buf);
8069        }
8070        if let Some(ref v) = self.ruby_package {
8071            ::buffa::encoding::Tag::new(
8072                    45u32,
8073                    ::buffa::encoding::WireType::LengthDelimited,
8074                )
8075                .encode(buf);
8076            ::buffa::types::encode_string(v, buf);
8077        }
8078        if self.features.is_set() {
8079            ::buffa::encoding::Tag::new(
8080                    50u32,
8081                    ::buffa::encoding::WireType::LengthDelimited,
8082                )
8083                .encode(buf);
8084            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
8085            self.features.write_to(__cache, buf);
8086        }
8087        for v in &self.uninterpreted_option {
8088            ::buffa::encoding::Tag::new(
8089                    999u32,
8090                    ::buffa::encoding::WireType::LengthDelimited,
8091                )
8092                .encode(buf);
8093            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
8094            v.write_to(__cache, buf);
8095        }
8096        self.__buffa_unknown_fields.write_to(buf);
8097    }
8098    fn merge_field(
8099        &mut self,
8100        tag: ::buffa::encoding::Tag,
8101        buf: &mut impl ::buffa::bytes::Buf,
8102        depth: u32,
8103    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8104        #[allow(unused_imports)]
8105        use ::buffa::bytes::Buf as _;
8106        #[allow(unused_imports)]
8107        use ::buffa::Enumeration as _;
8108        match tag.field_number() {
8109            1u32 => {
8110                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8111                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8112                        field_number: 1u32,
8113                        expected: 2u8,
8114                        actual: tag.wire_type() as u8,
8115                    });
8116                }
8117                ::buffa::types::merge_string(
8118                    self
8119                        .java_package
8120                        .get_or_insert_with(::buffa::alloc::string::String::new),
8121                    buf,
8122                )?;
8123            }
8124            8u32 => {
8125                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8126                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8127                        field_number: 8u32,
8128                        expected: 2u8,
8129                        actual: tag.wire_type() as u8,
8130                    });
8131                }
8132                ::buffa::types::merge_string(
8133                    self
8134                        .java_outer_classname
8135                        .get_or_insert_with(::buffa::alloc::string::String::new),
8136                    buf,
8137                )?;
8138            }
8139            9u32 => {
8140                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8141                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8142                        field_number: 9u32,
8143                        expected: 0u8,
8144                        actual: tag.wire_type() as u8,
8145                    });
8146                }
8147                let __raw = ::buffa::types::decode_int32(buf)?;
8148                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
8149                    __raw,
8150                ) {
8151                    self.optimize_for = ::core::option::Option::Some(__v);
8152                } else {
8153                    self.__buffa_unknown_fields
8154                        .push(::buffa::UnknownField {
8155                            number: 9u32,
8156                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
8157                        });
8158                }
8159            }
8160            10u32 => {
8161                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8162                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8163                        field_number: 10u32,
8164                        expected: 0u8,
8165                        actual: tag.wire_type() as u8,
8166                    });
8167                }
8168                self.java_multiple_files = ::core::option::Option::Some(
8169                    ::buffa::types::decode_bool(buf)?,
8170                );
8171            }
8172            11u32 => {
8173                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8174                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8175                        field_number: 11u32,
8176                        expected: 2u8,
8177                        actual: tag.wire_type() as u8,
8178                    });
8179                }
8180                ::buffa::types::merge_string(
8181                    self
8182                        .go_package
8183                        .get_or_insert_with(::buffa::alloc::string::String::new),
8184                    buf,
8185                )?;
8186            }
8187            16u32 => {
8188                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8189                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8190                        field_number: 16u32,
8191                        expected: 0u8,
8192                        actual: tag.wire_type() as u8,
8193                    });
8194                }
8195                self.cc_generic_services = ::core::option::Option::Some(
8196                    ::buffa::types::decode_bool(buf)?,
8197                );
8198            }
8199            17u32 => {
8200                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8201                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8202                        field_number: 17u32,
8203                        expected: 0u8,
8204                        actual: tag.wire_type() as u8,
8205                    });
8206                }
8207                self.java_generic_services = ::core::option::Option::Some(
8208                    ::buffa::types::decode_bool(buf)?,
8209                );
8210            }
8211            18u32 => {
8212                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8213                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8214                        field_number: 18u32,
8215                        expected: 0u8,
8216                        actual: tag.wire_type() as u8,
8217                    });
8218                }
8219                self.py_generic_services = ::core::option::Option::Some(
8220                    ::buffa::types::decode_bool(buf)?,
8221                );
8222            }
8223            20u32 => {
8224                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8225                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8226                        field_number: 20u32,
8227                        expected: 0u8,
8228                        actual: tag.wire_type() as u8,
8229                    });
8230                }
8231                self.java_generate_equals_and_hash = ::core::option::Option::Some(
8232                    ::buffa::types::decode_bool(buf)?,
8233                );
8234            }
8235            23u32 => {
8236                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8237                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8238                        field_number: 23u32,
8239                        expected: 0u8,
8240                        actual: tag.wire_type() as u8,
8241                    });
8242                }
8243                self.deprecated = ::core::option::Option::Some(
8244                    ::buffa::types::decode_bool(buf)?,
8245                );
8246            }
8247            27u32 => {
8248                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8249                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8250                        field_number: 27u32,
8251                        expected: 0u8,
8252                        actual: tag.wire_type() as u8,
8253                    });
8254                }
8255                self.java_string_check_utf8 = ::core::option::Option::Some(
8256                    ::buffa::types::decode_bool(buf)?,
8257                );
8258            }
8259            31u32 => {
8260                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
8261                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8262                        field_number: 31u32,
8263                        expected: 0u8,
8264                        actual: tag.wire_type() as u8,
8265                    });
8266                }
8267                self.cc_enable_arenas = ::core::option::Option::Some(
8268                    ::buffa::types::decode_bool(buf)?,
8269                );
8270            }
8271            36u32 => {
8272                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8273                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8274                        field_number: 36u32,
8275                        expected: 2u8,
8276                        actual: tag.wire_type() as u8,
8277                    });
8278                }
8279                ::buffa::types::merge_string(
8280                    self
8281                        .objc_class_prefix
8282                        .get_or_insert_with(::buffa::alloc::string::String::new),
8283                    buf,
8284                )?;
8285            }
8286            37u32 => {
8287                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8288                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8289                        field_number: 37u32,
8290                        expected: 2u8,
8291                        actual: tag.wire_type() as u8,
8292                    });
8293                }
8294                ::buffa::types::merge_string(
8295                    self
8296                        .csharp_namespace
8297                        .get_or_insert_with(::buffa::alloc::string::String::new),
8298                    buf,
8299                )?;
8300            }
8301            39u32 => {
8302                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8303                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8304                        field_number: 39u32,
8305                        expected: 2u8,
8306                        actual: tag.wire_type() as u8,
8307                    });
8308                }
8309                ::buffa::types::merge_string(
8310                    self
8311                        .swift_prefix
8312                        .get_or_insert_with(::buffa::alloc::string::String::new),
8313                    buf,
8314                )?;
8315            }
8316            40u32 => {
8317                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8318                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8319                        field_number: 40u32,
8320                        expected: 2u8,
8321                        actual: tag.wire_type() as u8,
8322                    });
8323                }
8324                ::buffa::types::merge_string(
8325                    self
8326                        .php_class_prefix
8327                        .get_or_insert_with(::buffa::alloc::string::String::new),
8328                    buf,
8329                )?;
8330            }
8331            41u32 => {
8332                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8333                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8334                        field_number: 41u32,
8335                        expected: 2u8,
8336                        actual: tag.wire_type() as u8,
8337                    });
8338                }
8339                ::buffa::types::merge_string(
8340                    self
8341                        .php_namespace
8342                        .get_or_insert_with(::buffa::alloc::string::String::new),
8343                    buf,
8344                )?;
8345            }
8346            44u32 => {
8347                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8348                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8349                        field_number: 44u32,
8350                        expected: 2u8,
8351                        actual: tag.wire_type() as u8,
8352                    });
8353                }
8354                ::buffa::types::merge_string(
8355                    self
8356                        .php_metadata_namespace
8357                        .get_or_insert_with(::buffa::alloc::string::String::new),
8358                    buf,
8359                )?;
8360            }
8361            45u32 => {
8362                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8363                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8364                        field_number: 45u32,
8365                        expected: 2u8,
8366                        actual: tag.wire_type() as u8,
8367                    });
8368                }
8369                ::buffa::types::merge_string(
8370                    self
8371                        .ruby_package
8372                        .get_or_insert_with(::buffa::alloc::string::String::new),
8373                    buf,
8374                )?;
8375            }
8376            50u32 => {
8377                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8378                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8379                        field_number: 50u32,
8380                        expected: 2u8,
8381                        actual: tag.wire_type() as u8,
8382                    });
8383                }
8384                ::buffa::Message::merge_length_delimited(
8385                    self.features.get_or_insert_default(),
8386                    buf,
8387                    depth,
8388                )?;
8389            }
8390            999u32 => {
8391                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8392                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8393                        field_number: 999u32,
8394                        expected: 2u8,
8395                        actual: tag.wire_type() as u8,
8396                    });
8397                }
8398                let mut elem = ::core::default::Default::default();
8399                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
8400                self.uninterpreted_option.push(elem);
8401            }
8402            _ => {
8403                self.__buffa_unknown_fields
8404                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
8405            }
8406        }
8407        ::core::result::Result::Ok(())
8408    }
8409    fn clear(&mut self) {
8410        self.java_package = ::core::option::Option::None;
8411        self.java_outer_classname = ::core::option::Option::None;
8412        self.optimize_for = ::core::option::Option::None;
8413        self.java_multiple_files = ::core::option::Option::None;
8414        self.go_package = ::core::option::Option::None;
8415        self.cc_generic_services = ::core::option::Option::None;
8416        self.java_generic_services = ::core::option::Option::None;
8417        self.py_generic_services = ::core::option::Option::None;
8418        self.java_generate_equals_and_hash = ::core::option::Option::None;
8419        self.deprecated = ::core::option::Option::None;
8420        self.java_string_check_utf8 = ::core::option::Option::None;
8421        self.cc_enable_arenas = ::core::option::Option::None;
8422        self.objc_class_prefix = ::core::option::Option::None;
8423        self.csharp_namespace = ::core::option::Option::None;
8424        self.swift_prefix = ::core::option::Option::None;
8425        self.php_class_prefix = ::core::option::Option::None;
8426        self.php_namespace = ::core::option::Option::None;
8427        self.php_metadata_namespace = ::core::option::Option::None;
8428        self.ruby_package = ::core::option::Option::None;
8429        self.features = ::buffa::MessageField::none();
8430        self.uninterpreted_option.clear();
8431        self.__buffa_unknown_fields.clear();
8432    }
8433}
8434impl ::buffa::ExtensionSet for FileOptions {
8435    const PROTO_FQN: &'static str = "google.protobuf.FileOptions";
8436    fn unknown_fields(&self) -> &::buffa::UnknownFields {
8437        &self.__buffa_unknown_fields
8438    }
8439    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8440        &mut self.__buffa_unknown_fields
8441    }
8442}
8443#[cfg(feature = "text")]
8444impl ::buffa::text::TextFormat for FileOptions {
8445    fn encode_text(
8446        &self,
8447        enc: &mut ::buffa::text::TextEncoder<'_>,
8448    ) -> ::core::fmt::Result {
8449        #[allow(unused_imports)]
8450        use ::buffa::Enumeration as _;
8451        if let ::core::option::Option::Some(ref __v) = self.java_package {
8452            enc.write_field_name("java_package")?;
8453            enc.write_string(__v)?;
8454        }
8455        if let ::core::option::Option::Some(ref __v) = self.java_outer_classname {
8456            enc.write_field_name("java_outer_classname")?;
8457            enc.write_string(__v)?;
8458        }
8459        if let ::core::option::Option::Some(ref __v) = self.java_multiple_files {
8460            enc.write_field_name("java_multiple_files")?;
8461            enc.write_bool(*__v)?;
8462        }
8463        if let ::core::option::Option::Some(ref __v) = self.java_generate_equals_and_hash
8464        {
8465            enc.write_field_name("java_generate_equals_and_hash")?;
8466            enc.write_bool(*__v)?;
8467        }
8468        if let ::core::option::Option::Some(ref __v) = self.java_string_check_utf8 {
8469            enc.write_field_name("java_string_check_utf8")?;
8470            enc.write_bool(*__v)?;
8471        }
8472        if let ::core::option::Option::Some(ref __v) = self.optimize_for {
8473            enc.write_field_name("optimize_for")?;
8474            enc.write_enum_name(__v.proto_name())?;
8475        }
8476        if let ::core::option::Option::Some(ref __v) = self.go_package {
8477            enc.write_field_name("go_package")?;
8478            enc.write_string(__v)?;
8479        }
8480        if let ::core::option::Option::Some(ref __v) = self.cc_generic_services {
8481            enc.write_field_name("cc_generic_services")?;
8482            enc.write_bool(*__v)?;
8483        }
8484        if let ::core::option::Option::Some(ref __v) = self.java_generic_services {
8485            enc.write_field_name("java_generic_services")?;
8486            enc.write_bool(*__v)?;
8487        }
8488        if let ::core::option::Option::Some(ref __v) = self.py_generic_services {
8489            enc.write_field_name("py_generic_services")?;
8490            enc.write_bool(*__v)?;
8491        }
8492        if let ::core::option::Option::Some(ref __v) = self.deprecated {
8493            enc.write_field_name("deprecated")?;
8494            enc.write_bool(*__v)?;
8495        }
8496        if let ::core::option::Option::Some(ref __v) = self.cc_enable_arenas {
8497            enc.write_field_name("cc_enable_arenas")?;
8498            enc.write_bool(*__v)?;
8499        }
8500        if let ::core::option::Option::Some(ref __v) = self.objc_class_prefix {
8501            enc.write_field_name("objc_class_prefix")?;
8502            enc.write_string(__v)?;
8503        }
8504        if let ::core::option::Option::Some(ref __v) = self.csharp_namespace {
8505            enc.write_field_name("csharp_namespace")?;
8506            enc.write_string(__v)?;
8507        }
8508        if let ::core::option::Option::Some(ref __v) = self.swift_prefix {
8509            enc.write_field_name("swift_prefix")?;
8510            enc.write_string(__v)?;
8511        }
8512        if let ::core::option::Option::Some(ref __v) = self.php_class_prefix {
8513            enc.write_field_name("php_class_prefix")?;
8514            enc.write_string(__v)?;
8515        }
8516        if let ::core::option::Option::Some(ref __v) = self.php_namespace {
8517            enc.write_field_name("php_namespace")?;
8518            enc.write_string(__v)?;
8519        }
8520        if let ::core::option::Option::Some(ref __v) = self.php_metadata_namespace {
8521            enc.write_field_name("php_metadata_namespace")?;
8522            enc.write_string(__v)?;
8523        }
8524        if let ::core::option::Option::Some(ref __v) = self.ruby_package {
8525            enc.write_field_name("ruby_package")?;
8526            enc.write_string(__v)?;
8527        }
8528        if self.features.is_set() {
8529            enc.write_field_name("features")?;
8530            enc.write_message(&*self.features)?;
8531        }
8532        for __v in &self.uninterpreted_option {
8533            enc.write_field_name("uninterpreted_option")?;
8534            enc.write_message(__v)?;
8535        }
8536        enc.write_extension_fields(
8537            "google.protobuf.FileOptions",
8538            &self.__buffa_unknown_fields,
8539        )?;
8540        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
8541        ::core::result::Result::Ok(())
8542    }
8543    fn merge_text(
8544        &mut self,
8545        dec: &mut ::buffa::text::TextDecoder<'_>,
8546    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
8547        #[allow(unused_imports)]
8548        use ::buffa::Enumeration as _;
8549        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
8550            match __name {
8551                "java_package" => {
8552                    self.java_package = ::core::option::Option::Some(
8553                        dec.read_string()?.into_owned(),
8554                    );
8555                }
8556                "java_outer_classname" => {
8557                    self.java_outer_classname = ::core::option::Option::Some(
8558                        dec.read_string()?.into_owned(),
8559                    );
8560                }
8561                "java_multiple_files" => {
8562                    self.java_multiple_files = ::core::option::Option::Some(
8563                        dec.read_bool()?,
8564                    );
8565                }
8566                "java_generate_equals_and_hash" => {
8567                    self.java_generate_equals_and_hash = ::core::option::Option::Some(
8568                        dec.read_bool()?,
8569                    );
8570                }
8571                "java_string_check_utf8" => {
8572                    self.java_string_check_utf8 = ::core::option::Option::Some(
8573                        dec.read_bool()?,
8574                    );
8575                }
8576                "optimize_for" => {
8577                    self.optimize_for = ::core::option::Option::Some(
8578                        dec.read_closed_enum_by_name::<file_options::OptimizeMode>()?,
8579                    );
8580                }
8581                "go_package" => {
8582                    self.go_package = ::core::option::Option::Some(
8583                        dec.read_string()?.into_owned(),
8584                    );
8585                }
8586                "cc_generic_services" => {
8587                    self.cc_generic_services = ::core::option::Option::Some(
8588                        dec.read_bool()?,
8589                    );
8590                }
8591                "java_generic_services" => {
8592                    self.java_generic_services = ::core::option::Option::Some(
8593                        dec.read_bool()?,
8594                    );
8595                }
8596                "py_generic_services" => {
8597                    self.py_generic_services = ::core::option::Option::Some(
8598                        dec.read_bool()?,
8599                    );
8600                }
8601                "deprecated" => {
8602                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
8603                }
8604                "cc_enable_arenas" => {
8605                    self.cc_enable_arenas = ::core::option::Option::Some(
8606                        dec.read_bool()?,
8607                    );
8608                }
8609                "objc_class_prefix" => {
8610                    self.objc_class_prefix = ::core::option::Option::Some(
8611                        dec.read_string()?.into_owned(),
8612                    );
8613                }
8614                "csharp_namespace" => {
8615                    self.csharp_namespace = ::core::option::Option::Some(
8616                        dec.read_string()?.into_owned(),
8617                    );
8618                }
8619                "swift_prefix" => {
8620                    self.swift_prefix = ::core::option::Option::Some(
8621                        dec.read_string()?.into_owned(),
8622                    );
8623                }
8624                "php_class_prefix" => {
8625                    self.php_class_prefix = ::core::option::Option::Some(
8626                        dec.read_string()?.into_owned(),
8627                    );
8628                }
8629                "php_namespace" => {
8630                    self.php_namespace = ::core::option::Option::Some(
8631                        dec.read_string()?.into_owned(),
8632                    );
8633                }
8634                "php_metadata_namespace" => {
8635                    self.php_metadata_namespace = ::core::option::Option::Some(
8636                        dec.read_string()?.into_owned(),
8637                    );
8638                }
8639                "ruby_package" => {
8640                    self.ruby_package = ::core::option::Option::Some(
8641                        dec.read_string()?.into_owned(),
8642                    );
8643                }
8644                "features" => dec.merge_message(self.features.get_or_insert_default())?,
8645                "uninterpreted_option" => {
8646                    dec.read_repeated_into(
8647                        &mut self.uninterpreted_option,
8648                        |__d| {
8649                            let mut __m = ::core::default::Default::default();
8650                            __d.merge_message(&mut __m)?;
8651                            ::core::result::Result::Ok(__m)
8652                        },
8653                    )?
8654                }
8655                __name if __name.starts_with('[') => {
8656                    for __r in dec.read_extension(__name, "google.protobuf.FileOptions")?
8657                    {
8658                        self.__buffa_unknown_fields.push(__r);
8659                    }
8660                }
8661                _ => dec.skip_value()?,
8662            }
8663        }
8664        ::core::result::Result::Ok(())
8665    }
8666}
8667#[cfg(feature = "json")]
8668impl<'de> serde::Deserialize<'de> for FileOptions {
8669    fn deserialize<D: serde::Deserializer<'de>>(
8670        d: D,
8671    ) -> ::core::result::Result<Self, D::Error> {
8672        struct _V;
8673        impl<'de> serde::de::Visitor<'de> for _V {
8674            type Value = FileOptions;
8675            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8676                f.write_str("struct FileOptions")
8677            }
8678            #[allow(clippy::field_reassign_with_default)]
8679            fn visit_map<A: serde::de::MapAccess<'de>>(
8680                self,
8681                mut map: A,
8682            ) -> ::core::result::Result<FileOptions, A::Error> {
8683                let mut __f_java_package: ::core::option::Option<
8684                    ::core::option::Option<::buffa::alloc::string::String>,
8685                > = None;
8686                let mut __f_java_outer_classname: ::core::option::Option<
8687                    ::core::option::Option<::buffa::alloc::string::String>,
8688                > = None;
8689                let mut __f_java_multiple_files: ::core::option::Option<
8690                    ::core::option::Option<bool>,
8691                > = None;
8692                let mut __f_java_generate_equals_and_hash: ::core::option::Option<
8693                    ::core::option::Option<bool>,
8694                > = None;
8695                let mut __f_java_string_check_utf8: ::core::option::Option<
8696                    ::core::option::Option<bool>,
8697                > = None;
8698                let mut __f_optimize_for: ::core::option::Option<
8699                    ::core::option::Option<file_options::OptimizeMode>,
8700                > = None;
8701                let mut __f_go_package: ::core::option::Option<
8702                    ::core::option::Option<::buffa::alloc::string::String>,
8703                > = None;
8704                let mut __f_cc_generic_services: ::core::option::Option<
8705                    ::core::option::Option<bool>,
8706                > = None;
8707                let mut __f_java_generic_services: ::core::option::Option<
8708                    ::core::option::Option<bool>,
8709                > = None;
8710                let mut __f_py_generic_services: ::core::option::Option<
8711                    ::core::option::Option<bool>,
8712                > = None;
8713                let mut __f_deprecated: ::core::option::Option<
8714                    ::core::option::Option<bool>,
8715                > = None;
8716                let mut __f_cc_enable_arenas: ::core::option::Option<
8717                    ::core::option::Option<bool>,
8718                > = None;
8719                let mut __f_objc_class_prefix: ::core::option::Option<
8720                    ::core::option::Option<::buffa::alloc::string::String>,
8721                > = None;
8722                let mut __f_csharp_namespace: ::core::option::Option<
8723                    ::core::option::Option<::buffa::alloc::string::String>,
8724                > = None;
8725                let mut __f_swift_prefix: ::core::option::Option<
8726                    ::core::option::Option<::buffa::alloc::string::String>,
8727                > = None;
8728                let mut __f_php_class_prefix: ::core::option::Option<
8729                    ::core::option::Option<::buffa::alloc::string::String>,
8730                > = None;
8731                let mut __f_php_namespace: ::core::option::Option<
8732                    ::core::option::Option<::buffa::alloc::string::String>,
8733                > = None;
8734                let mut __f_php_metadata_namespace: ::core::option::Option<
8735                    ::core::option::Option<::buffa::alloc::string::String>,
8736                > = None;
8737                let mut __f_ruby_package: ::core::option::Option<
8738                    ::core::option::Option<::buffa::alloc::string::String>,
8739                > = None;
8740                let mut __f_features: ::core::option::Option<
8741                    ::buffa::MessageField<FeatureSet>,
8742                > = None;
8743                let mut __f_uninterpreted_option: ::core::option::Option<
8744                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
8745                > = None;
8746                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
8747                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
8748                    match key.as_str() {
8749                        "javaPackage" | "java_package" => {
8750                            __f_java_package = Some(
8751                                map
8752                                    .next_value::<
8753                                        ::core::option::Option<::buffa::alloc::string::String>,
8754                                    >()?,
8755                            );
8756                        }
8757                        "javaOuterClassname" | "java_outer_classname" => {
8758                            __f_java_outer_classname = Some(
8759                                map
8760                                    .next_value::<
8761                                        ::core::option::Option<::buffa::alloc::string::String>,
8762                                    >()?,
8763                            );
8764                        }
8765                        "javaMultipleFiles" | "java_multiple_files" => {
8766                            __f_java_multiple_files = Some(
8767                                map.next_value::<::core::option::Option<bool>>()?,
8768                            );
8769                        }
8770                        "javaGenerateEqualsAndHash"
8771                        | "java_generate_equals_and_hash" => {
8772                            __f_java_generate_equals_and_hash = Some(
8773                                map.next_value::<::core::option::Option<bool>>()?,
8774                            );
8775                        }
8776                        "javaStringCheckUtf8" | "java_string_check_utf8" => {
8777                            __f_java_string_check_utf8 = Some(
8778                                map.next_value::<::core::option::Option<bool>>()?,
8779                            );
8780                        }
8781                        "optimizeFor" | "optimize_for" => {
8782                            __f_optimize_for = Some({
8783                                struct _S;
8784                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8785                                    type Value = ::core::option::Option<
8786                                        file_options::OptimizeMode,
8787                                    >;
8788                                    fn deserialize<D: serde::Deserializer<'de>>(
8789                                        self,
8790                                        d: D,
8791                                    ) -> ::core::result::Result<
8792                                        ::core::option::Option<file_options::OptimizeMode>,
8793                                        D::Error,
8794                                    > {
8795                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
8796                                    }
8797                                }
8798                                map.next_value_seed(_S)?
8799                            });
8800                        }
8801                        "goPackage" | "go_package" => {
8802                            __f_go_package = Some(
8803                                map
8804                                    .next_value::<
8805                                        ::core::option::Option<::buffa::alloc::string::String>,
8806                                    >()?,
8807                            );
8808                        }
8809                        "ccGenericServices" | "cc_generic_services" => {
8810                            __f_cc_generic_services = Some(
8811                                map.next_value::<::core::option::Option<bool>>()?,
8812                            );
8813                        }
8814                        "javaGenericServices" | "java_generic_services" => {
8815                            __f_java_generic_services = Some(
8816                                map.next_value::<::core::option::Option<bool>>()?,
8817                            );
8818                        }
8819                        "pyGenericServices" | "py_generic_services" => {
8820                            __f_py_generic_services = Some(
8821                                map.next_value::<::core::option::Option<bool>>()?,
8822                            );
8823                        }
8824                        "deprecated" => {
8825                            __f_deprecated = Some(
8826                                map.next_value::<::core::option::Option<bool>>()?,
8827                            );
8828                        }
8829                        "ccEnableArenas" | "cc_enable_arenas" => {
8830                            __f_cc_enable_arenas = Some(
8831                                map.next_value::<::core::option::Option<bool>>()?,
8832                            );
8833                        }
8834                        "objcClassPrefix" | "objc_class_prefix" => {
8835                            __f_objc_class_prefix = Some(
8836                                map
8837                                    .next_value::<
8838                                        ::core::option::Option<::buffa::alloc::string::String>,
8839                                    >()?,
8840                            );
8841                        }
8842                        "csharpNamespace" | "csharp_namespace" => {
8843                            __f_csharp_namespace = Some(
8844                                map
8845                                    .next_value::<
8846                                        ::core::option::Option<::buffa::alloc::string::String>,
8847                                    >()?,
8848                            );
8849                        }
8850                        "swiftPrefix" | "swift_prefix" => {
8851                            __f_swift_prefix = Some(
8852                                map
8853                                    .next_value::<
8854                                        ::core::option::Option<::buffa::alloc::string::String>,
8855                                    >()?,
8856                            );
8857                        }
8858                        "phpClassPrefix" | "php_class_prefix" => {
8859                            __f_php_class_prefix = Some(
8860                                map
8861                                    .next_value::<
8862                                        ::core::option::Option<::buffa::alloc::string::String>,
8863                                    >()?,
8864                            );
8865                        }
8866                        "phpNamespace" | "php_namespace" => {
8867                            __f_php_namespace = Some(
8868                                map
8869                                    .next_value::<
8870                                        ::core::option::Option<::buffa::alloc::string::String>,
8871                                    >()?,
8872                            );
8873                        }
8874                        "phpMetadataNamespace" | "php_metadata_namespace" => {
8875                            __f_php_metadata_namespace = Some(
8876                                map
8877                                    .next_value::<
8878                                        ::core::option::Option<::buffa::alloc::string::String>,
8879                                    >()?,
8880                            );
8881                        }
8882                        "rubyPackage" | "ruby_package" => {
8883                            __f_ruby_package = Some(
8884                                map
8885                                    .next_value::<
8886                                        ::core::option::Option<::buffa::alloc::string::String>,
8887                                    >()?,
8888                            );
8889                        }
8890                        "features" => {
8891                            __f_features = Some(
8892                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
8893                            );
8894                        }
8895                        "uninterpretedOption" | "uninterpreted_option" => {
8896                            __f_uninterpreted_option = Some({
8897                                struct _S;
8898                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
8899                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
8900                                    fn deserialize<D: serde::Deserializer<'de>>(
8901                                        self,
8902                                        d: D,
8903                                    ) -> ::core::result::Result<
8904                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
8905                                        D::Error,
8906                                    > {
8907                                        ::buffa::json_helpers::null_as_default(d)
8908                                    }
8909                                }
8910                                map.next_value_seed(_S)?
8911                            });
8912                        }
8913                        __k if __k.starts_with('[') => {
8914                            let __v: ::buffa::serde_json::Value = map.next_value()?;
8915                            match ::buffa::extension_registry::deserialize_extension_key(
8916                                "google.protobuf.FileOptions",
8917                                __k,
8918                                __v,
8919                            ) {
8920                                ::core::option::Option::Some(
8921                                    ::core::result::Result::Ok(__recs),
8922                                ) => {
8923                                    for __rec in __recs {
8924                                        __ext_records.push(__rec);
8925                                    }
8926                                }
8927                                ::core::option::Option::Some(
8928                                    ::core::result::Result::Err(__e),
8929                                ) => {
8930                                    return ::core::result::Result::Err(
8931                                        <A::Error as ::serde::de::Error>::custom(__e),
8932                                    );
8933                                }
8934                                ::core::option::Option::None => {}
8935                            }
8936                        }
8937                        _ => {
8938                            map.next_value::<serde::de::IgnoredAny>()?;
8939                        }
8940                    }
8941                }
8942                let mut __r = <FileOptions as ::core::default::Default>::default();
8943                if let ::core::option::Option::Some(v) = __f_java_package {
8944                    __r.java_package = v;
8945                }
8946                if let ::core::option::Option::Some(v) = __f_java_outer_classname {
8947                    __r.java_outer_classname = v;
8948                }
8949                if let ::core::option::Option::Some(v) = __f_java_multiple_files {
8950                    __r.java_multiple_files = v;
8951                }
8952                if let ::core::option::Option::Some(v) = __f_java_generate_equals_and_hash {
8953                    __r.java_generate_equals_and_hash = v;
8954                }
8955                if let ::core::option::Option::Some(v) = __f_java_string_check_utf8 {
8956                    __r.java_string_check_utf8 = v;
8957                }
8958                if let ::core::option::Option::Some(v) = __f_optimize_for {
8959                    __r.optimize_for = v;
8960                }
8961                if let ::core::option::Option::Some(v) = __f_go_package {
8962                    __r.go_package = v;
8963                }
8964                if let ::core::option::Option::Some(v) = __f_cc_generic_services {
8965                    __r.cc_generic_services = v;
8966                }
8967                if let ::core::option::Option::Some(v) = __f_java_generic_services {
8968                    __r.java_generic_services = v;
8969                }
8970                if let ::core::option::Option::Some(v) = __f_py_generic_services {
8971                    __r.py_generic_services = v;
8972                }
8973                if let ::core::option::Option::Some(v) = __f_deprecated {
8974                    __r.deprecated = v;
8975                }
8976                if let ::core::option::Option::Some(v) = __f_cc_enable_arenas {
8977                    __r.cc_enable_arenas = v;
8978                }
8979                if let ::core::option::Option::Some(v) = __f_objc_class_prefix {
8980                    __r.objc_class_prefix = v;
8981                }
8982                if let ::core::option::Option::Some(v) = __f_csharp_namespace {
8983                    __r.csharp_namespace = v;
8984                }
8985                if let ::core::option::Option::Some(v) = __f_swift_prefix {
8986                    __r.swift_prefix = v;
8987                }
8988                if let ::core::option::Option::Some(v) = __f_php_class_prefix {
8989                    __r.php_class_prefix = v;
8990                }
8991                if let ::core::option::Option::Some(v) = __f_php_namespace {
8992                    __r.php_namespace = v;
8993                }
8994                if let ::core::option::Option::Some(v) = __f_php_metadata_namespace {
8995                    __r.php_metadata_namespace = v;
8996                }
8997                if let ::core::option::Option::Some(v) = __f_ruby_package {
8998                    __r.ruby_package = v;
8999                }
9000                if let ::core::option::Option::Some(v) = __f_features {
9001                    __r.features = v;
9002                }
9003                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
9004                    __r.uninterpreted_option = v;
9005                }
9006                for __rec in __ext_records {
9007                    __r.__buffa_unknown_fields.push(__rec);
9008                }
9009                Ok(__r)
9010            }
9011        }
9012        d.deserialize_map(_V)
9013    }
9014}
9015#[cfg(feature = "json")]
9016impl ::buffa::json_helpers::ProtoElemJson for FileOptions {
9017    fn serialize_proto_json<S: ::serde::Serializer>(
9018        v: &Self,
9019        s: S,
9020    ) -> ::core::result::Result<S::Ok, S::Error> {
9021        ::serde::Serialize::serialize(v, s)
9022    }
9023    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9024        d: D,
9025    ) -> ::core::result::Result<Self, D::Error> {
9026        <Self as ::serde::Deserialize>::deserialize(d)
9027    }
9028}
9029#[doc(hidden)]
9030#[derive(Clone, Debug, Default, PartialEq)]
9031#[repr(transparent)]
9032#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9033pub struct __FileOptionsExtJson(pub ::buffa::UnknownFields);
9034impl ::core::ops::Deref for __FileOptionsExtJson {
9035    type Target = ::buffa::UnknownFields;
9036    fn deref(&self) -> &::buffa::UnknownFields {
9037        &self.0
9038    }
9039}
9040impl ::core::ops::DerefMut for __FileOptionsExtJson {
9041    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
9042        &mut self.0
9043    }
9044}
9045impl ::core::convert::From<::buffa::UnknownFields> for __FileOptionsExtJson {
9046    fn from(u: ::buffa::UnknownFields) -> Self {
9047        Self(u)
9048    }
9049}
9050#[cfg(feature = "json")]
9051impl ::serde::Serialize for __FileOptionsExtJson {
9052    fn serialize<S: ::serde::Serializer>(
9053        &self,
9054        s: S,
9055    ) -> ::core::result::Result<S::Ok, S::Error> {
9056        ::buffa::extension_registry::serialize_extensions(
9057            "google.protobuf.FileOptions",
9058            &self.0,
9059            s,
9060        )
9061    }
9062}
9063#[cfg(feature = "json")]
9064impl<'de> ::serde::Deserialize<'de> for __FileOptionsExtJson {
9065    fn deserialize<D: ::serde::Deserializer<'de>>(
9066        d: D,
9067    ) -> ::core::result::Result<Self, D::Error> {
9068        ::buffa::extension_registry::deserialize_extensions(
9069                "google.protobuf.FileOptions",
9070                d,
9071            )
9072            .map(Self)
9073    }
9074}
9075#[cfg(feature = "json")]
9076#[doc(hidden)]
9077pub const __FILE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9078    type_url: "type.googleapis.com/google.protobuf.FileOptions",
9079    to_json: ::buffa::type_registry::any_to_json::<FileOptions>,
9080    from_json: ::buffa::type_registry::any_from_json::<FileOptions>,
9081    is_wkt: false,
9082};
9083#[cfg(feature = "text")]
9084#[doc(hidden)]
9085pub const __FILE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
9086    type_url: "type.googleapis.com/google.protobuf.FileOptions",
9087    text_encode: ::buffa::type_registry::any_encode_text::<FileOptions>,
9088    text_merge: ::buffa::type_registry::any_merge_text::<FileOptions>,
9089};
9090pub mod file_options {
9091    #[allow(unused_imports)]
9092    use super::*;
9093    /// Generated classes can be optimized for speed or code size.
9094    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
9095    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9096    #[repr(i32)]
9097    pub enum OptimizeMode {
9098        /// Generate complete code for parsing, serialization,
9099        SPEED = 1i32,
9100        /// etc.
9101        ///
9102        /// Use ReflectionOps to implement these methods.
9103        CODE_SIZE = 2i32,
9104        /// Generate code using MessageLite and the lite runtime.
9105        LITE_RUNTIME = 3i32,
9106    }
9107    impl OptimizeMode {
9108        ///Idiomatic alias for [`Self::SPEED`]; `Debug` prints the variant name.
9109        #[allow(non_upper_case_globals)]
9110        pub const Speed: Self = Self::SPEED;
9111        ///Idiomatic alias for [`Self::CODE_SIZE`]; `Debug` prints the variant name.
9112        #[allow(non_upper_case_globals)]
9113        pub const CodeSize: Self = Self::CODE_SIZE;
9114        ///Idiomatic alias for [`Self::LITE_RUNTIME`]; `Debug` prints the variant name.
9115        #[allow(non_upper_case_globals)]
9116        pub const LiteRuntime: Self = Self::LITE_RUNTIME;
9117    }
9118    impl ::core::default::Default for OptimizeMode {
9119        fn default() -> Self {
9120            Self::SPEED
9121        }
9122    }
9123    #[cfg(feature = "json")]
9124    const _: () = {
9125        impl ::serde::Serialize for OptimizeMode {
9126            fn serialize<S: ::serde::Serializer>(
9127                &self,
9128                s: S,
9129            ) -> ::core::result::Result<S::Ok, S::Error> {
9130                s.serialize_str(::buffa::Enumeration::proto_name(self))
9131            }
9132        }
9133        impl<'de> ::serde::Deserialize<'de> for OptimizeMode {
9134            fn deserialize<D: ::serde::Deserializer<'de>>(
9135                d: D,
9136            ) -> ::core::result::Result<Self, D::Error> {
9137                struct _V;
9138                impl ::serde::de::Visitor<'_> for _V {
9139                    type Value = OptimizeMode;
9140                    fn expecting(
9141                        &self,
9142                        f: &mut ::core::fmt::Formatter<'_>,
9143                    ) -> ::core::fmt::Result {
9144                        f.write_str(
9145                            concat!(
9146                                "a string, integer, or null for ", stringify!(OptimizeMode)
9147                            ),
9148                        )
9149                    }
9150                    fn visit_str<E: ::serde::de::Error>(
9151                        self,
9152                        v: &str,
9153                    ) -> ::core::result::Result<OptimizeMode, E> {
9154                        <OptimizeMode as ::buffa::Enumeration>::from_proto_name(v)
9155                            .ok_or_else(|| {
9156                                ::serde::de::Error::unknown_variant(v, &[])
9157                            })
9158                    }
9159                    fn visit_i64<E: ::serde::de::Error>(
9160                        self,
9161                        v: i64,
9162                    ) -> ::core::result::Result<OptimizeMode, E> {
9163                        let v32 = i32::try_from(v)
9164                            .map_err(|_| {
9165                                ::serde::de::Error::custom(
9166                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
9167                                )
9168                            })?;
9169                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
9170                            .ok_or_else(|| {
9171                                ::serde::de::Error::custom(
9172                                    ::buffa::alloc::format!("unknown enum value {v32}"),
9173                                )
9174                            })
9175                    }
9176                    fn visit_u64<E: ::serde::de::Error>(
9177                        self,
9178                        v: u64,
9179                    ) -> ::core::result::Result<OptimizeMode, E> {
9180                        let v32 = i32::try_from(v)
9181                            .map_err(|_| {
9182                                ::serde::de::Error::custom(
9183                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
9184                                )
9185                            })?;
9186                        <OptimizeMode as ::buffa::Enumeration>::from_i32(v32)
9187                            .ok_or_else(|| {
9188                                ::serde::de::Error::custom(
9189                                    ::buffa::alloc::format!("unknown enum value {v32}"),
9190                                )
9191                            })
9192                    }
9193                    fn visit_unit<E: ::serde::de::Error>(
9194                        self,
9195                    ) -> ::core::result::Result<OptimizeMode, E> {
9196                        ::core::result::Result::Ok(::core::default::Default::default())
9197                    }
9198                }
9199                d.deserialize_any(_V)
9200            }
9201        }
9202        impl ::buffa::json_helpers::ProtoElemJson for OptimizeMode {
9203            fn serialize_proto_json<S: ::serde::Serializer>(
9204                v: &Self,
9205                s: S,
9206            ) -> ::core::result::Result<S::Ok, S::Error> {
9207                ::serde::Serialize::serialize(v, s)
9208            }
9209            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9210                d: D,
9211            ) -> ::core::result::Result<Self, D::Error> {
9212                <Self as ::serde::Deserialize>::deserialize(d)
9213            }
9214        }
9215    };
9216    impl ::buffa::Enumeration for OptimizeMode {
9217        fn from_i32(value: i32) -> ::core::option::Option<Self> {
9218            match value {
9219                1i32 => ::core::option::Option::Some(Self::SPEED),
9220                2i32 => ::core::option::Option::Some(Self::CODE_SIZE),
9221                3i32 => ::core::option::Option::Some(Self::LITE_RUNTIME),
9222                _ => ::core::option::Option::None,
9223            }
9224        }
9225        fn to_i32(&self) -> i32 {
9226            *self as i32
9227        }
9228        fn proto_name(&self) -> &'static str {
9229            match self {
9230                Self::SPEED => "SPEED",
9231                Self::CODE_SIZE => "CODE_SIZE",
9232                Self::LITE_RUNTIME => "LITE_RUNTIME",
9233            }
9234        }
9235        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
9236            match name {
9237                "SPEED" => ::core::option::Option::Some(Self::SPEED),
9238                "CODE_SIZE" => ::core::option::Option::Some(Self::CODE_SIZE),
9239                "LITE_RUNTIME" => ::core::option::Option::Some(Self::LITE_RUNTIME),
9240                _ => ::core::option::Option::None,
9241            }
9242        }
9243        fn values() -> &'static [Self] {
9244            &[Self::SPEED, Self::CODE_SIZE, Self::LITE_RUNTIME]
9245        }
9246    }
9247}
9248#[derive(Clone, PartialEq, Default)]
9249#[cfg_attr(feature = "json", derive(::serde::Serialize))]
9250#[cfg_attr(feature = "json", serde(default))]
9251#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9252pub struct MessageOptions {
9253    /// Set true to use the old proto1 MessageSet wire format for extensions.
9254    /// This is provided for backwards-compatibility with the MessageSet wire
9255    /// format.  You should not use this for any other reason:  It's less
9256    /// efficient, has fewer features, and is more complicated.
9257    ///
9258    /// The message must be defined exactly as follows:
9259    ///   message Foo {
9260    /// ```text
9261    /// option message_set_wire_format = true;
9262    /// extensions 4 to max;
9263    /// ```
9264    ///   }
9265    /// Note that the message cannot have any defined fields; MessageSets only
9266    /// have extensions.
9267    ///
9268    /// All extensions of your type must be singular messages; e.g. they cannot
9269    /// be int32s, enums, or repeated messages.
9270    ///
9271    /// Because this is an option, the above two restrictions are not enforced by
9272    /// the protocol compiler.
9273    ///
9274    /// Field 1: `message_set_wire_format`
9275    #[cfg_attr(
9276        feature = "json",
9277        serde(
9278            rename = "messageSetWireFormat",
9279            alias = "message_set_wire_format",
9280            skip_serializing_if = "::core::option::Option::is_none"
9281        )
9282    )]
9283    pub message_set_wire_format: ::core::option::Option<bool>,
9284    /// Disables the generation of the standard "descriptor()" accessor, which can
9285    /// conflict with a field of the same name.  This is meant to make migration
9286    /// from proto1 easier; new code should avoid fields named "descriptor".
9287    ///
9288    /// Field 2: `no_standard_descriptor_accessor`
9289    #[cfg_attr(
9290        feature = "json",
9291        serde(
9292            rename = "noStandardDescriptorAccessor",
9293            alias = "no_standard_descriptor_accessor",
9294            skip_serializing_if = "::core::option::Option::is_none"
9295        )
9296    )]
9297    pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
9298    /// Is this message deprecated?
9299    /// Depending on the target platform, this can emit Deprecated annotations
9300    /// for the message, or it will be completely ignored; in the very least,
9301    /// this is a formalization for deprecating messages.
9302    ///
9303    /// Field 3: `deprecated`
9304    #[cfg_attr(
9305        feature = "json",
9306        serde(
9307            rename = "deprecated",
9308            skip_serializing_if = "::core::option::Option::is_none"
9309        )
9310    )]
9311    pub deprecated: ::core::option::Option<bool>,
9312    /// Whether the message is an automatically generated map entry type for the
9313    /// maps field.
9314    ///
9315    /// For maps fields:
9316    /// ```text
9317    /// map<KeyType, ValueType> map_field = 1;
9318    /// ```
9319    /// The parsed descriptor looks like:
9320    /// ```text
9321    /// message MapFieldEntry {
9322    ///     option map_entry = true;
9323    ///     optional KeyType key = 1;
9324    ///     optional ValueType value = 2;
9325    /// }
9326    /// repeated MapFieldEntry map_field = 1;
9327    /// ```
9328    ///
9329    /// Implementations may choose not to generate the map_entry=true message, but
9330    /// use a native map in the target language to hold the keys and values.
9331    /// The reflection APIs in such implementations still need to work as
9332    /// if the field is a repeated message field.
9333    ///
9334    /// NOTE: Do not set the option in .proto files. Always use the maps syntax
9335    /// instead. The option should only be implicitly set by the proto compiler
9336    /// parser.
9337    ///
9338    /// Field 7: `map_entry`
9339    #[cfg_attr(
9340        feature = "json",
9341        serde(
9342            rename = "mapEntry",
9343            alias = "map_entry",
9344            skip_serializing_if = "::core::option::Option::is_none"
9345        )
9346    )]
9347    pub map_entry: ::core::option::Option<bool>,
9348    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
9349    /// and strips underscored from the fields before comparison in proto3 only.
9350    /// The new behavior takes `json_name` into account and applies to proto2 as
9351    /// well.
9352    ///
9353    /// This should only be used as a temporary measure against broken builds due
9354    /// to the change in behavior for JSON field name conflicts.
9355    ///
9356    /// TODO This is legacy behavior we plan to remove once downstream
9357    /// teams have had time to migrate.
9358    ///
9359    /// Field 11: `deprecated_legacy_json_field_conflicts`
9360    #[cfg_attr(
9361        feature = "json",
9362        serde(
9363            rename = "deprecatedLegacyJsonFieldConflicts",
9364            alias = "deprecated_legacy_json_field_conflicts",
9365            skip_serializing_if = "::core::option::Option::is_none"
9366        )
9367    )]
9368    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
9369    /// Any features defined in the specific edition.
9370    /// WARNING: This field should only be used by protobuf plugins or special
9371    /// cases like the proto compiler. Other uses are discouraged and
9372    /// developers should rely on the protoreflect APIs for their client language.
9373    ///
9374    /// Field 12: `features`
9375    #[cfg_attr(
9376        feature = "json",
9377        serde(
9378            rename = "features",
9379            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9380        )
9381    )]
9382    pub features: ::buffa::MessageField<FeatureSet>,
9383    /// The parser stores options it doesn't recognize here. See above.
9384    ///
9385    /// Field 999: `uninterpreted_option`
9386    #[cfg_attr(
9387        feature = "json",
9388        serde(
9389            rename = "uninterpretedOption",
9390            alias = "uninterpreted_option",
9391            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
9392            deserialize_with = "::buffa::json_helpers::null_as_default"
9393        )
9394    )]
9395    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
9396    #[cfg_attr(feature = "json", serde(flatten))]
9397    #[doc(hidden)]
9398    pub __buffa_unknown_fields: __MessageOptionsExtJson,
9399}
9400impl ::core::fmt::Debug for MessageOptions {
9401    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9402        f.debug_struct("MessageOptions")
9403            .field("message_set_wire_format", &self.message_set_wire_format)
9404            .field(
9405                "no_standard_descriptor_accessor",
9406                &self.no_standard_descriptor_accessor,
9407            )
9408            .field("deprecated", &self.deprecated)
9409            .field("map_entry", &self.map_entry)
9410            .field(
9411                "deprecated_legacy_json_field_conflicts",
9412                &self.deprecated_legacy_json_field_conflicts,
9413            )
9414            .field("features", &self.features)
9415            .field("uninterpreted_option", &self.uninterpreted_option)
9416            .finish()
9417    }
9418}
9419impl MessageOptions {
9420    /// Protobuf type URL for this message, for use with `Any::pack` and
9421    /// `Any::unpack_if`.
9422    ///
9423    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9424    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
9425}
9426impl MessageOptions {
9427    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9428    #[inline]
9429    ///Sets [`Self::message_set_wire_format`] to `Some(value)`, consuming and returning `self`.
9430    pub fn with_message_set_wire_format(mut self, value: bool) -> Self {
9431        self.message_set_wire_format = Some(value);
9432        self
9433    }
9434    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9435    #[inline]
9436    ///Sets [`Self::no_standard_descriptor_accessor`] to `Some(value)`, consuming and returning `self`.
9437    pub fn with_no_standard_descriptor_accessor(mut self, value: bool) -> Self {
9438        self.no_standard_descriptor_accessor = Some(value);
9439        self
9440    }
9441    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9442    #[inline]
9443    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
9444    pub fn with_deprecated(mut self, value: bool) -> Self {
9445        self.deprecated = Some(value);
9446        self
9447    }
9448    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9449    #[inline]
9450    ///Sets [`Self::map_entry`] to `Some(value)`, consuming and returning `self`.
9451    pub fn with_map_entry(mut self, value: bool) -> Self {
9452        self.map_entry = Some(value);
9453        self
9454    }
9455    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
9456    #[inline]
9457    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
9458    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
9459        self.deprecated_legacy_json_field_conflicts = Some(value);
9460        self
9461    }
9462}
9463impl ::buffa::DefaultInstance for MessageOptions {
9464    fn default_instance() -> &'static Self {
9465        static VALUE: ::buffa::__private::OnceBox<MessageOptions> = ::buffa::__private::OnceBox::new();
9466        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9467    }
9468}
9469impl ::buffa::MessageName for MessageOptions {
9470    const PACKAGE: &'static str = "google.protobuf";
9471    const NAME: &'static str = "MessageOptions";
9472    const FULL_NAME: &'static str = "google.protobuf.MessageOptions";
9473    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
9474}
9475impl ::buffa::Message for MessageOptions {
9476    /// Returns the total encoded size in bytes.
9477    ///
9478    /// The result is a `u32`; the protobuf specification requires all
9479    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
9480    /// compliant message will never overflow this type.
9481    #[allow(clippy::let_and_return)]
9482    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9483        #[allow(unused_imports)]
9484        use ::buffa::Enumeration as _;
9485        let mut size = 0u32;
9486        if self.message_set_wire_format.is_some() {
9487            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9488        }
9489        if self.no_standard_descriptor_accessor.is_some() {
9490            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9491        }
9492        if self.deprecated.is_some() {
9493            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9494        }
9495        if self.map_entry.is_some() {
9496            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9497        }
9498        if self.deprecated_legacy_json_field_conflicts.is_some() {
9499            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
9500        }
9501        if self.features.is_set() {
9502            let __slot = __cache.reserve();
9503            let inner_size = self.features.compute_size(__cache);
9504            __cache.set(__slot, inner_size);
9505            size
9506                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9507                    + inner_size;
9508        }
9509        for v in &self.uninterpreted_option {
9510            let __slot = __cache.reserve();
9511            let inner_size = v.compute_size(__cache);
9512            __cache.set(__slot, inner_size);
9513            size
9514                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9515                    + inner_size;
9516        }
9517        size += self.__buffa_unknown_fields.encoded_len() as u32;
9518        size
9519    }
9520    fn write_to(
9521        &self,
9522        __cache: &mut ::buffa::SizeCache,
9523        buf: &mut impl ::buffa::bytes::BufMut,
9524    ) {
9525        #[allow(unused_imports)]
9526        use ::buffa::Enumeration as _;
9527        if let Some(v) = self.message_set_wire_format {
9528            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
9529                .encode(buf);
9530            ::buffa::types::encode_bool(v, buf);
9531        }
9532        if let Some(v) = self.no_standard_descriptor_accessor {
9533            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
9534                .encode(buf);
9535            ::buffa::types::encode_bool(v, buf);
9536        }
9537        if let Some(v) = self.deprecated {
9538            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
9539                .encode(buf);
9540            ::buffa::types::encode_bool(v, buf);
9541        }
9542        if let Some(v) = self.map_entry {
9543            ::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
9544                .encode(buf);
9545            ::buffa::types::encode_bool(v, buf);
9546        }
9547        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
9548            ::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
9549                .encode(buf);
9550            ::buffa::types::encode_bool(v, buf);
9551        }
9552        if self.features.is_set() {
9553            ::buffa::encoding::Tag::new(
9554                    12u32,
9555                    ::buffa::encoding::WireType::LengthDelimited,
9556                )
9557                .encode(buf);
9558            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
9559            self.features.write_to(__cache, buf);
9560        }
9561        for v in &self.uninterpreted_option {
9562            ::buffa::encoding::Tag::new(
9563                    999u32,
9564                    ::buffa::encoding::WireType::LengthDelimited,
9565                )
9566                .encode(buf);
9567            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
9568            v.write_to(__cache, buf);
9569        }
9570        self.__buffa_unknown_fields.write_to(buf);
9571    }
9572    fn merge_field(
9573        &mut self,
9574        tag: ::buffa::encoding::Tag,
9575        buf: &mut impl ::buffa::bytes::Buf,
9576        depth: u32,
9577    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9578        #[allow(unused_imports)]
9579        use ::buffa::bytes::Buf as _;
9580        #[allow(unused_imports)]
9581        use ::buffa::Enumeration as _;
9582        match tag.field_number() {
9583            1u32 => {
9584                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
9585                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9586                        field_number: 1u32,
9587                        expected: 0u8,
9588                        actual: tag.wire_type() as u8,
9589                    });
9590                }
9591                self.message_set_wire_format = ::core::option::Option::Some(
9592                    ::buffa::types::decode_bool(buf)?,
9593                );
9594            }
9595            2u32 => {
9596                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
9597                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9598                        field_number: 2u32,
9599                        expected: 0u8,
9600                        actual: tag.wire_type() as u8,
9601                    });
9602                }
9603                self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9604                    ::buffa::types::decode_bool(buf)?,
9605                );
9606            }
9607            3u32 => {
9608                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
9609                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9610                        field_number: 3u32,
9611                        expected: 0u8,
9612                        actual: tag.wire_type() as u8,
9613                    });
9614                }
9615                self.deprecated = ::core::option::Option::Some(
9616                    ::buffa::types::decode_bool(buf)?,
9617                );
9618            }
9619            7u32 => {
9620                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
9621                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9622                        field_number: 7u32,
9623                        expected: 0u8,
9624                        actual: tag.wire_type() as u8,
9625                    });
9626                }
9627                self.map_entry = ::core::option::Option::Some(
9628                    ::buffa::types::decode_bool(buf)?,
9629                );
9630            }
9631            11u32 => {
9632                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
9633                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9634                        field_number: 11u32,
9635                        expected: 0u8,
9636                        actual: tag.wire_type() as u8,
9637                    });
9638                }
9639                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9640                    ::buffa::types::decode_bool(buf)?,
9641                );
9642            }
9643            12u32 => {
9644                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
9645                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9646                        field_number: 12u32,
9647                        expected: 2u8,
9648                        actual: tag.wire_type() as u8,
9649                    });
9650                }
9651                ::buffa::Message::merge_length_delimited(
9652                    self.features.get_or_insert_default(),
9653                    buf,
9654                    depth,
9655                )?;
9656            }
9657            999u32 => {
9658                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
9659                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9660                        field_number: 999u32,
9661                        expected: 2u8,
9662                        actual: tag.wire_type() as u8,
9663                    });
9664                }
9665                let mut elem = ::core::default::Default::default();
9666                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
9667                self.uninterpreted_option.push(elem);
9668            }
9669            _ => {
9670                self.__buffa_unknown_fields
9671                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
9672            }
9673        }
9674        ::core::result::Result::Ok(())
9675    }
9676    fn clear(&mut self) {
9677        self.message_set_wire_format = ::core::option::Option::None;
9678        self.no_standard_descriptor_accessor = ::core::option::Option::None;
9679        self.deprecated = ::core::option::Option::None;
9680        self.map_entry = ::core::option::Option::None;
9681        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
9682        self.features = ::buffa::MessageField::none();
9683        self.uninterpreted_option.clear();
9684        self.__buffa_unknown_fields.clear();
9685    }
9686}
9687impl ::buffa::ExtensionSet for MessageOptions {
9688    const PROTO_FQN: &'static str = "google.protobuf.MessageOptions";
9689    fn unknown_fields(&self) -> &::buffa::UnknownFields {
9690        &self.__buffa_unknown_fields
9691    }
9692    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9693        &mut self.__buffa_unknown_fields
9694    }
9695}
9696#[cfg(feature = "text")]
9697impl ::buffa::text::TextFormat for MessageOptions {
9698    fn encode_text(
9699        &self,
9700        enc: &mut ::buffa::text::TextEncoder<'_>,
9701    ) -> ::core::fmt::Result {
9702        #[allow(unused_imports)]
9703        use ::buffa::Enumeration as _;
9704        if let ::core::option::Option::Some(ref __v) = self.message_set_wire_format {
9705            enc.write_field_name("message_set_wire_format")?;
9706            enc.write_bool(*__v)?;
9707        }
9708        if let ::core::option::Option::Some(ref __v) = self
9709            .no_standard_descriptor_accessor
9710        {
9711            enc.write_field_name("no_standard_descriptor_accessor")?;
9712            enc.write_bool(*__v)?;
9713        }
9714        if let ::core::option::Option::Some(ref __v) = self.deprecated {
9715            enc.write_field_name("deprecated")?;
9716            enc.write_bool(*__v)?;
9717        }
9718        if let ::core::option::Option::Some(ref __v) = self.map_entry {
9719            enc.write_field_name("map_entry")?;
9720            enc.write_bool(*__v)?;
9721        }
9722        if let ::core::option::Option::Some(ref __v) = self
9723            .deprecated_legacy_json_field_conflicts
9724        {
9725            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
9726            enc.write_bool(*__v)?;
9727        }
9728        if self.features.is_set() {
9729            enc.write_field_name("features")?;
9730            enc.write_message(&*self.features)?;
9731        }
9732        for __v in &self.uninterpreted_option {
9733            enc.write_field_name("uninterpreted_option")?;
9734            enc.write_message(__v)?;
9735        }
9736        enc.write_extension_fields(
9737            "google.protobuf.MessageOptions",
9738            &self.__buffa_unknown_fields,
9739        )?;
9740        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
9741        ::core::result::Result::Ok(())
9742    }
9743    fn merge_text(
9744        &mut self,
9745        dec: &mut ::buffa::text::TextDecoder<'_>,
9746    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
9747        #[allow(unused_imports)]
9748        use ::buffa::Enumeration as _;
9749        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
9750            match __name {
9751                "message_set_wire_format" => {
9752                    self.message_set_wire_format = ::core::option::Option::Some(
9753                        dec.read_bool()?,
9754                    );
9755                }
9756                "no_standard_descriptor_accessor" => {
9757                    self.no_standard_descriptor_accessor = ::core::option::Option::Some(
9758                        dec.read_bool()?,
9759                    );
9760                }
9761                "deprecated" => {
9762                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
9763                }
9764                "map_entry" => {
9765                    self.map_entry = ::core::option::Option::Some(dec.read_bool()?);
9766                }
9767                "deprecated_legacy_json_field_conflicts" => {
9768                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
9769                        dec.read_bool()?,
9770                    );
9771                }
9772                "features" => dec.merge_message(self.features.get_or_insert_default())?,
9773                "uninterpreted_option" => {
9774                    dec.read_repeated_into(
9775                        &mut self.uninterpreted_option,
9776                        |__d| {
9777                            let mut __m = ::core::default::Default::default();
9778                            __d.merge_message(&mut __m)?;
9779                            ::core::result::Result::Ok(__m)
9780                        },
9781                    )?
9782                }
9783                __name if __name.starts_with('[') => {
9784                    for __r in dec
9785                        .read_extension(__name, "google.protobuf.MessageOptions")?
9786                    {
9787                        self.__buffa_unknown_fields.push(__r);
9788                    }
9789                }
9790                _ => dec.skip_value()?,
9791            }
9792        }
9793        ::core::result::Result::Ok(())
9794    }
9795}
9796#[cfg(feature = "json")]
9797impl<'de> serde::Deserialize<'de> for MessageOptions {
9798    fn deserialize<D: serde::Deserializer<'de>>(
9799        d: D,
9800    ) -> ::core::result::Result<Self, D::Error> {
9801        struct _V;
9802        impl<'de> serde::de::Visitor<'de> for _V {
9803            type Value = MessageOptions;
9804            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9805                f.write_str("struct MessageOptions")
9806            }
9807            #[allow(clippy::field_reassign_with_default)]
9808            fn visit_map<A: serde::de::MapAccess<'de>>(
9809                self,
9810                mut map: A,
9811            ) -> ::core::result::Result<MessageOptions, A::Error> {
9812                let mut __f_message_set_wire_format: ::core::option::Option<
9813                    ::core::option::Option<bool>,
9814                > = None;
9815                let mut __f_no_standard_descriptor_accessor: ::core::option::Option<
9816                    ::core::option::Option<bool>,
9817                > = None;
9818                let mut __f_deprecated: ::core::option::Option<
9819                    ::core::option::Option<bool>,
9820                > = None;
9821                let mut __f_map_entry: ::core::option::Option<
9822                    ::core::option::Option<bool>,
9823                > = None;
9824                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
9825                    ::core::option::Option<bool>,
9826                > = None;
9827                let mut __f_features: ::core::option::Option<
9828                    ::buffa::MessageField<FeatureSet>,
9829                > = None;
9830                let mut __f_uninterpreted_option: ::core::option::Option<
9831                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
9832                > = None;
9833                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
9834                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
9835                    match key.as_str() {
9836                        "messageSetWireFormat" | "message_set_wire_format" => {
9837                            __f_message_set_wire_format = Some(
9838                                map.next_value::<::core::option::Option<bool>>()?,
9839                            );
9840                        }
9841                        "noStandardDescriptorAccessor"
9842                        | "no_standard_descriptor_accessor" => {
9843                            __f_no_standard_descriptor_accessor = Some(
9844                                map.next_value::<::core::option::Option<bool>>()?,
9845                            );
9846                        }
9847                        "deprecated" => {
9848                            __f_deprecated = Some(
9849                                map.next_value::<::core::option::Option<bool>>()?,
9850                            );
9851                        }
9852                        "mapEntry" | "map_entry" => {
9853                            __f_map_entry = Some(
9854                                map.next_value::<::core::option::Option<bool>>()?,
9855                            );
9856                        }
9857                        "deprecatedLegacyJsonFieldConflicts"
9858                        | "deprecated_legacy_json_field_conflicts" => {
9859                            __f_deprecated_legacy_json_field_conflicts = Some(
9860                                map.next_value::<::core::option::Option<bool>>()?,
9861                            );
9862                        }
9863                        "features" => {
9864                            __f_features = Some(
9865                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
9866                            );
9867                        }
9868                        "uninterpretedOption" | "uninterpreted_option" => {
9869                            __f_uninterpreted_option = Some({
9870                                struct _S;
9871                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
9872                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
9873                                    fn deserialize<D: serde::Deserializer<'de>>(
9874                                        self,
9875                                        d: D,
9876                                    ) -> ::core::result::Result<
9877                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
9878                                        D::Error,
9879                                    > {
9880                                        ::buffa::json_helpers::null_as_default(d)
9881                                    }
9882                                }
9883                                map.next_value_seed(_S)?
9884                            });
9885                        }
9886                        __k if __k.starts_with('[') => {
9887                            let __v: ::buffa::serde_json::Value = map.next_value()?;
9888                            match ::buffa::extension_registry::deserialize_extension_key(
9889                                "google.protobuf.MessageOptions",
9890                                __k,
9891                                __v,
9892                            ) {
9893                                ::core::option::Option::Some(
9894                                    ::core::result::Result::Ok(__recs),
9895                                ) => {
9896                                    for __rec in __recs {
9897                                        __ext_records.push(__rec);
9898                                    }
9899                                }
9900                                ::core::option::Option::Some(
9901                                    ::core::result::Result::Err(__e),
9902                                ) => {
9903                                    return ::core::result::Result::Err(
9904                                        <A::Error as ::serde::de::Error>::custom(__e),
9905                                    );
9906                                }
9907                                ::core::option::Option::None => {}
9908                            }
9909                        }
9910                        _ => {
9911                            map.next_value::<serde::de::IgnoredAny>()?;
9912                        }
9913                    }
9914                }
9915                let mut __r = <MessageOptions as ::core::default::Default>::default();
9916                if let ::core::option::Option::Some(v) = __f_message_set_wire_format {
9917                    __r.message_set_wire_format = v;
9918                }
9919                if let ::core::option::Option::Some(v) = __f_no_standard_descriptor_accessor {
9920                    __r.no_standard_descriptor_accessor = v;
9921                }
9922                if let ::core::option::Option::Some(v) = __f_deprecated {
9923                    __r.deprecated = v;
9924                }
9925                if let ::core::option::Option::Some(v) = __f_map_entry {
9926                    __r.map_entry = v;
9927                }
9928                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
9929                    __r.deprecated_legacy_json_field_conflicts = v;
9930                }
9931                if let ::core::option::Option::Some(v) = __f_features {
9932                    __r.features = v;
9933                }
9934                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
9935                    __r.uninterpreted_option = v;
9936                }
9937                for __rec in __ext_records {
9938                    __r.__buffa_unknown_fields.push(__rec);
9939                }
9940                Ok(__r)
9941            }
9942        }
9943        d.deserialize_map(_V)
9944    }
9945}
9946#[cfg(feature = "json")]
9947impl ::buffa::json_helpers::ProtoElemJson for MessageOptions {
9948    fn serialize_proto_json<S: ::serde::Serializer>(
9949        v: &Self,
9950        s: S,
9951    ) -> ::core::result::Result<S::Ok, S::Error> {
9952        ::serde::Serialize::serialize(v, s)
9953    }
9954    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9955        d: D,
9956    ) -> ::core::result::Result<Self, D::Error> {
9957        <Self as ::serde::Deserialize>::deserialize(d)
9958    }
9959}
9960#[doc(hidden)]
9961#[derive(Clone, Debug, Default, PartialEq)]
9962#[repr(transparent)]
9963#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9964pub struct __MessageOptionsExtJson(pub ::buffa::UnknownFields);
9965impl ::core::ops::Deref for __MessageOptionsExtJson {
9966    type Target = ::buffa::UnknownFields;
9967    fn deref(&self) -> &::buffa::UnknownFields {
9968        &self.0
9969    }
9970}
9971impl ::core::ops::DerefMut for __MessageOptionsExtJson {
9972    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
9973        &mut self.0
9974    }
9975}
9976impl ::core::convert::From<::buffa::UnknownFields> for __MessageOptionsExtJson {
9977    fn from(u: ::buffa::UnknownFields) -> Self {
9978        Self(u)
9979    }
9980}
9981#[cfg(feature = "json")]
9982impl ::serde::Serialize for __MessageOptionsExtJson {
9983    fn serialize<S: ::serde::Serializer>(
9984        &self,
9985        s: S,
9986    ) -> ::core::result::Result<S::Ok, S::Error> {
9987        ::buffa::extension_registry::serialize_extensions(
9988            "google.protobuf.MessageOptions",
9989            &self.0,
9990            s,
9991        )
9992    }
9993}
9994#[cfg(feature = "json")]
9995impl<'de> ::serde::Deserialize<'de> for __MessageOptionsExtJson {
9996    fn deserialize<D: ::serde::Deserializer<'de>>(
9997        d: D,
9998    ) -> ::core::result::Result<Self, D::Error> {
9999        ::buffa::extension_registry::deserialize_extensions(
10000                "google.protobuf.MessageOptions",
10001                d,
10002            )
10003            .map(Self)
10004    }
10005}
10006#[cfg(feature = "json")]
10007#[doc(hidden)]
10008pub const __MESSAGE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10009    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
10010    to_json: ::buffa::type_registry::any_to_json::<MessageOptions>,
10011    from_json: ::buffa::type_registry::any_from_json::<MessageOptions>,
10012    is_wkt: false,
10013};
10014#[cfg(feature = "text")]
10015#[doc(hidden)]
10016pub const __MESSAGE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
10017    type_url: "type.googleapis.com/google.protobuf.MessageOptions",
10018    text_encode: ::buffa::type_registry::any_encode_text::<MessageOptions>,
10019    text_merge: ::buffa::type_registry::any_merge_text::<MessageOptions>,
10020};
10021#[derive(Clone, PartialEq, Default)]
10022#[cfg_attr(feature = "json", derive(::serde::Serialize))]
10023#[cfg_attr(feature = "json", serde(default))]
10024#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
10025pub struct FieldOptions {
10026    /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
10027    /// The ctype option instructs the C++ code generator to use a different
10028    /// representation of the field than it normally would.  See the specific
10029    /// options below.  This option is only implemented to support use of
10030    /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
10031    /// type "bytes" in the open source release.
10032    /// TODO: make ctype actually deprecated.
10033    ///
10034    /// Field 1: `ctype`
10035    #[cfg_attr(
10036        feature = "json",
10037        serde(
10038            rename = "ctype",
10039            with = "::buffa::json_helpers::opt_closed_enum",
10040            skip_serializing_if = "::core::option::Option::is_none"
10041        )
10042    )]
10043    pub ctype: ::core::option::Option<field_options::CType>,
10044    /// The packed option can be enabled for repeated primitive fields to enable
10045    /// a more efficient representation on the wire. Rather than repeatedly
10046    /// writing the tag and type for each element, the entire array is encoded as
10047    /// a single length-delimited blob. In proto3, only explicit setting it to
10048    /// false will avoid using packed encoding.  This option is prohibited in
10049    /// Editions, but the `repeated_field_encoding` feature can be used to control
10050    /// the behavior.
10051    ///
10052    /// Field 2: `packed`
10053    #[cfg_attr(
10054        feature = "json",
10055        serde(rename = "packed", skip_serializing_if = "::core::option::Option::is_none")
10056    )]
10057    pub packed: ::core::option::Option<bool>,
10058    /// The jstype option determines the JavaScript type used for values of the
10059    /// field.  The option is permitted only for 64 bit integral and fixed types
10060    /// (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
10061    /// is represented as JavaScript string, which avoids loss of precision that
10062    /// can happen when a large value is converted to a floating point JavaScript.
10063    /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
10064    /// use the JavaScript "number" type.  The behavior of the default option
10065    /// JS_NORMAL is implementation dependent.
10066    ///
10067    /// This option is an enum to permit additional types to be added, e.g.
10068    /// goog.math.Integer.
10069    ///
10070    /// Field 6: `jstype`
10071    #[cfg_attr(
10072        feature = "json",
10073        serde(
10074            rename = "jstype",
10075            with = "::buffa::json_helpers::opt_closed_enum",
10076            skip_serializing_if = "::core::option::Option::is_none"
10077        )
10078    )]
10079    pub jstype: ::core::option::Option<field_options::JSType>,
10080    /// Should this field be parsed lazily?  Lazy applies only to message-type
10081    /// fields.  It means that when the outer message is initially parsed, the
10082    /// inner message's contents will not be parsed but instead stored in encoded
10083    /// form.  The inner message will actually be parsed when it is first accessed.
10084    ///
10085    /// This is only a hint.  Implementations are free to choose whether to use
10086    /// eager or lazy parsing regardless of the value of this option.  However,
10087    /// setting this option true suggests that the protocol author believes that
10088    /// using lazy parsing on this field is worth the additional bookkeeping
10089    /// overhead typically needed to implement it.
10090    ///
10091    /// This option does not affect the public interface of any generated code;
10092    /// all method signatures remain the same.  Furthermore, thread-safety of the
10093    /// interface is not affected by this option; const methods remain safe to
10094    /// call from multiple threads concurrently, while non-const methods continue
10095    /// to require exclusive access.
10096    ///
10097    /// Note that lazy message fields are still eagerly verified to check
10098    /// ill-formed wireformat or missing required fields. Calling IsInitialized()
10099    /// on the outer message would fail if the inner message has missing required
10100    /// fields. Failed verification would result in parsing failure (except when
10101    /// uninitialized messages are acceptable).
10102    ///
10103    /// Field 5: `lazy`
10104    #[cfg_attr(
10105        feature = "json",
10106        serde(rename = "lazy", skip_serializing_if = "::core::option::Option::is_none")
10107    )]
10108    pub lazy: ::core::option::Option<bool>,
10109    /// unverified_lazy does no correctness checks on the byte stream. This should
10110    /// only be used where lazy with verification is prohibitive for performance
10111    /// reasons.
10112    ///
10113    /// Field 15: `unverified_lazy`
10114    #[cfg_attr(
10115        feature = "json",
10116        serde(
10117            rename = "unverifiedLazy",
10118            alias = "unverified_lazy",
10119            skip_serializing_if = "::core::option::Option::is_none"
10120        )
10121    )]
10122    pub unverified_lazy: ::core::option::Option<bool>,
10123    /// Is this field deprecated?
10124    /// Depending on the target platform, this can emit Deprecated annotations
10125    /// for accessors, or it will be completely ignored; in the very least, this
10126    /// is a formalization for deprecating fields.
10127    ///
10128    /// Field 3: `deprecated`
10129    #[cfg_attr(
10130        feature = "json",
10131        serde(
10132            rename = "deprecated",
10133            skip_serializing_if = "::core::option::Option::is_none"
10134        )
10135    )]
10136    pub deprecated: ::core::option::Option<bool>,
10137    /// DEPRECATED. DO NOT USE!
10138    /// For Google-internal migration only. Do not use.
10139    ///
10140    /// Field 10: `weak`
10141    #[cfg_attr(
10142        feature = "json",
10143        serde(rename = "weak", skip_serializing_if = "::core::option::Option::is_none")
10144    )]
10145    pub weak: ::core::option::Option<bool>,
10146    /// Indicate that the field value should not be printed out when using debug
10147    /// formats, e.g. when the field contains sensitive credentials.
10148    ///
10149    /// Field 16: `debug_redact`
10150    #[cfg_attr(
10151        feature = "json",
10152        serde(
10153            rename = "debugRedact",
10154            alias = "debug_redact",
10155            skip_serializing_if = "::core::option::Option::is_none"
10156        )
10157    )]
10158    pub debug_redact: ::core::option::Option<bool>,
10159    /// Field 17: `retention`
10160    #[cfg_attr(
10161        feature = "json",
10162        serde(
10163            rename = "retention",
10164            with = "::buffa::json_helpers::opt_closed_enum",
10165            skip_serializing_if = "::core::option::Option::is_none"
10166        )
10167    )]
10168    pub retention: ::core::option::Option<field_options::OptionRetention>,
10169    /// Field 19: `targets`
10170    #[cfg_attr(
10171        feature = "json",
10172        serde(
10173            rename = "targets",
10174            with = "::buffa::json_helpers::repeated_closed_enum",
10175            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
10176        )
10177    )]
10178    pub targets: ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10179    /// Field 20: `edition_defaults`
10180    #[cfg_attr(
10181        feature = "json",
10182        serde(
10183            rename = "editionDefaults",
10184            alias = "edition_defaults",
10185            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
10186            deserialize_with = "::buffa::json_helpers::null_as_default"
10187        )
10188    )]
10189    pub edition_defaults: ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10190    /// Any features defined in the specific edition.
10191    /// WARNING: This field should only be used by protobuf plugins or special
10192    /// cases like the proto compiler. Other uses are discouraged and
10193    /// developers should rely on the protoreflect APIs for their client language.
10194    ///
10195    /// Field 21: `features`
10196    #[cfg_attr(
10197        feature = "json",
10198        serde(
10199            rename = "features",
10200            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
10201        )
10202    )]
10203    pub features: ::buffa::MessageField<FeatureSet>,
10204    /// Field 22: `feature_support`
10205    #[cfg_attr(
10206        feature = "json",
10207        serde(
10208            rename = "featureSupport",
10209            alias = "feature_support",
10210            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
10211        )
10212    )]
10213    pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
10214    /// The parser stores options it doesn't recognize here. See above.
10215    ///
10216    /// Field 999: `uninterpreted_option`
10217    #[cfg_attr(
10218        feature = "json",
10219        serde(
10220            rename = "uninterpretedOption",
10221            alias = "uninterpreted_option",
10222            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
10223            deserialize_with = "::buffa::json_helpers::null_as_default"
10224        )
10225    )]
10226    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
10227    #[cfg_attr(feature = "json", serde(flatten))]
10228    #[doc(hidden)]
10229    pub __buffa_unknown_fields: __FieldOptionsExtJson,
10230}
10231impl ::core::fmt::Debug for FieldOptions {
10232    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10233        f.debug_struct("FieldOptions")
10234            .field("ctype", &self.ctype)
10235            .field("packed", &self.packed)
10236            .field("jstype", &self.jstype)
10237            .field("lazy", &self.lazy)
10238            .field("unverified_lazy", &self.unverified_lazy)
10239            .field("deprecated", &self.deprecated)
10240            .field("weak", &self.weak)
10241            .field("debug_redact", &self.debug_redact)
10242            .field("retention", &self.retention)
10243            .field("targets", &self.targets)
10244            .field("edition_defaults", &self.edition_defaults)
10245            .field("features", &self.features)
10246            .field("feature_support", &self.feature_support)
10247            .field("uninterpreted_option", &self.uninterpreted_option)
10248            .finish()
10249    }
10250}
10251impl FieldOptions {
10252    /// Protobuf type URL for this message, for use with `Any::pack` and
10253    /// `Any::unpack_if`.
10254    ///
10255    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
10256    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
10257}
10258impl FieldOptions {
10259    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10260    #[inline]
10261    ///Sets [`Self::ctype`] to `Some(value)`, consuming and returning `self`.
10262    pub fn with_ctype(mut self, value: impl Into<field_options::CType>) -> Self {
10263        self.ctype = Some(value.into());
10264        self
10265    }
10266    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10267    #[inline]
10268    ///Sets [`Self::packed`] to `Some(value)`, consuming and returning `self`.
10269    pub fn with_packed(mut self, value: bool) -> Self {
10270        self.packed = Some(value);
10271        self
10272    }
10273    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10274    #[inline]
10275    ///Sets [`Self::jstype`] to `Some(value)`, consuming and returning `self`.
10276    pub fn with_jstype(mut self, value: impl Into<field_options::JSType>) -> Self {
10277        self.jstype = Some(value.into());
10278        self
10279    }
10280    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10281    #[inline]
10282    ///Sets [`Self::lazy`] to `Some(value)`, consuming and returning `self`.
10283    pub fn with_lazy(mut self, value: bool) -> Self {
10284        self.lazy = Some(value);
10285        self
10286    }
10287    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10288    #[inline]
10289    ///Sets [`Self::unverified_lazy`] to `Some(value)`, consuming and returning `self`.
10290    pub fn with_unverified_lazy(mut self, value: bool) -> Self {
10291        self.unverified_lazy = Some(value);
10292        self
10293    }
10294    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10295    #[inline]
10296    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
10297    pub fn with_deprecated(mut self, value: bool) -> Self {
10298        self.deprecated = Some(value);
10299        self
10300    }
10301    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10302    #[inline]
10303    ///Sets [`Self::weak`] to `Some(value)`, consuming and returning `self`.
10304    pub fn with_weak(mut self, value: bool) -> Self {
10305        self.weak = Some(value);
10306        self
10307    }
10308    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10309    #[inline]
10310    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
10311    pub fn with_debug_redact(mut self, value: bool) -> Self {
10312        self.debug_redact = Some(value);
10313        self
10314    }
10315    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
10316    #[inline]
10317    ///Sets [`Self::retention`] to `Some(value)`, consuming and returning `self`.
10318    pub fn with_retention(
10319        mut self,
10320        value: impl Into<field_options::OptionRetention>,
10321    ) -> Self {
10322        self.retention = Some(value.into());
10323        self
10324    }
10325}
10326impl ::buffa::DefaultInstance for FieldOptions {
10327    fn default_instance() -> &'static Self {
10328        static VALUE: ::buffa::__private::OnceBox<FieldOptions> = ::buffa::__private::OnceBox::new();
10329        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10330    }
10331}
10332impl ::buffa::MessageName for FieldOptions {
10333    const PACKAGE: &'static str = "google.protobuf";
10334    const NAME: &'static str = "FieldOptions";
10335    const FULL_NAME: &'static str = "google.protobuf.FieldOptions";
10336    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
10337}
10338impl ::buffa::Message for FieldOptions {
10339    /// Returns the total encoded size in bytes.
10340    ///
10341    /// The result is a `u32`; the protobuf specification requires all
10342    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
10343    /// compliant message will never overflow this type.
10344    #[allow(clippy::let_and_return)]
10345    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
10346        #[allow(unused_imports)]
10347        use ::buffa::Enumeration as _;
10348        let mut size = 0u32;
10349        if let Some(ref v) = self.ctype {
10350            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
10351        }
10352        if self.packed.is_some() {
10353            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10354        }
10355        if self.deprecated.is_some() {
10356            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10357        }
10358        if self.lazy.is_some() {
10359            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10360        }
10361        if let Some(ref v) = self.jstype {
10362            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
10363        }
10364        if self.weak.is_some() {
10365            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10366        }
10367        if self.unverified_lazy.is_some() {
10368            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10369        }
10370        if self.debug_redact.is_some() {
10371            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10372        }
10373        if let Some(ref v) = self.retention {
10374            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
10375        }
10376        for v in &self.targets {
10377            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
10378        }
10379        for v in &self.edition_defaults {
10380            let __slot = __cache.reserve();
10381            let inner_size = v.compute_size(__cache);
10382            __cache.set(__slot, inner_size);
10383            size
10384                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10385                    + inner_size;
10386        }
10387        if self.features.is_set() {
10388            let __slot = __cache.reserve();
10389            let inner_size = self.features.compute_size(__cache);
10390            __cache.set(__slot, inner_size);
10391            size
10392                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10393                    + inner_size;
10394        }
10395        if self.feature_support.is_set() {
10396            let __slot = __cache.reserve();
10397            let inner_size = self.feature_support.compute_size(__cache);
10398            __cache.set(__slot, inner_size);
10399            size
10400                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10401                    + inner_size;
10402        }
10403        for v in &self.uninterpreted_option {
10404            let __slot = __cache.reserve();
10405            let inner_size = v.compute_size(__cache);
10406            __cache.set(__slot, inner_size);
10407            size
10408                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10409                    + inner_size;
10410        }
10411        size += self.__buffa_unknown_fields.encoded_len() as u32;
10412        size
10413    }
10414    fn write_to(
10415        &self,
10416        __cache: &mut ::buffa::SizeCache,
10417        buf: &mut impl ::buffa::bytes::BufMut,
10418    ) {
10419        #[allow(unused_imports)]
10420        use ::buffa::Enumeration as _;
10421        if let Some(ref v) = self.ctype {
10422            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
10423                .encode(buf);
10424            ::buffa::types::encode_int32(v.to_i32(), buf);
10425        }
10426        if let Some(v) = self.packed {
10427            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
10428                .encode(buf);
10429            ::buffa::types::encode_bool(v, buf);
10430        }
10431        if let Some(v) = self.deprecated {
10432            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
10433                .encode(buf);
10434            ::buffa::types::encode_bool(v, buf);
10435        }
10436        if let Some(v) = self.lazy {
10437            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
10438                .encode(buf);
10439            ::buffa::types::encode_bool(v, buf);
10440        }
10441        if let Some(ref v) = self.jstype {
10442            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
10443                .encode(buf);
10444            ::buffa::types::encode_int32(v.to_i32(), buf);
10445        }
10446        if let Some(v) = self.weak {
10447            ::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
10448                .encode(buf);
10449            ::buffa::types::encode_bool(v, buf);
10450        }
10451        if let Some(v) = self.unverified_lazy {
10452            ::buffa::encoding::Tag::new(15u32, ::buffa::encoding::WireType::Varint)
10453                .encode(buf);
10454            ::buffa::types::encode_bool(v, buf);
10455        }
10456        if let Some(v) = self.debug_redact {
10457            ::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
10458                .encode(buf);
10459            ::buffa::types::encode_bool(v, buf);
10460        }
10461        if let Some(ref v) = self.retention {
10462            ::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
10463                .encode(buf);
10464            ::buffa::types::encode_int32(v.to_i32(), buf);
10465        }
10466        for v in &self.targets {
10467            ::buffa::encoding::Tag::new(19u32, ::buffa::encoding::WireType::Varint)
10468                .encode(buf);
10469            ::buffa::types::encode_int32(v.to_i32(), buf);
10470        }
10471        for v in &self.edition_defaults {
10472            ::buffa::encoding::Tag::new(
10473                    20u32,
10474                    ::buffa::encoding::WireType::LengthDelimited,
10475                )
10476                .encode(buf);
10477            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
10478            v.write_to(__cache, buf);
10479        }
10480        if self.features.is_set() {
10481            ::buffa::encoding::Tag::new(
10482                    21u32,
10483                    ::buffa::encoding::WireType::LengthDelimited,
10484                )
10485                .encode(buf);
10486            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
10487            self.features.write_to(__cache, buf);
10488        }
10489        if self.feature_support.is_set() {
10490            ::buffa::encoding::Tag::new(
10491                    22u32,
10492                    ::buffa::encoding::WireType::LengthDelimited,
10493                )
10494                .encode(buf);
10495            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
10496            self.feature_support.write_to(__cache, buf);
10497        }
10498        for v in &self.uninterpreted_option {
10499            ::buffa::encoding::Tag::new(
10500                    999u32,
10501                    ::buffa::encoding::WireType::LengthDelimited,
10502                )
10503                .encode(buf);
10504            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
10505            v.write_to(__cache, buf);
10506        }
10507        self.__buffa_unknown_fields.write_to(buf);
10508    }
10509    fn merge_field(
10510        &mut self,
10511        tag: ::buffa::encoding::Tag,
10512        buf: &mut impl ::buffa::bytes::Buf,
10513        depth: u32,
10514    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10515        #[allow(unused_imports)]
10516        use ::buffa::bytes::Buf as _;
10517        #[allow(unused_imports)]
10518        use ::buffa::Enumeration as _;
10519        match tag.field_number() {
10520            1u32 => {
10521                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10522                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10523                        field_number: 1u32,
10524                        expected: 0u8,
10525                        actual: tag.wire_type() as u8,
10526                    });
10527                }
10528                let __raw = ::buffa::types::decode_int32(buf)?;
10529                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10530                    __raw,
10531                ) {
10532                    self.ctype = ::core::option::Option::Some(__v);
10533                } else {
10534                    self.__buffa_unknown_fields
10535                        .push(::buffa::UnknownField {
10536                            number: 1u32,
10537                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10538                        });
10539                }
10540            }
10541            2u32 => {
10542                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10543                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10544                        field_number: 2u32,
10545                        expected: 0u8,
10546                        actual: tag.wire_type() as u8,
10547                    });
10548                }
10549                self.packed = ::core::option::Option::Some(
10550                    ::buffa::types::decode_bool(buf)?,
10551                );
10552            }
10553            3u32 => {
10554                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10555                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10556                        field_number: 3u32,
10557                        expected: 0u8,
10558                        actual: tag.wire_type() as u8,
10559                    });
10560                }
10561                self.deprecated = ::core::option::Option::Some(
10562                    ::buffa::types::decode_bool(buf)?,
10563                );
10564            }
10565            5u32 => {
10566                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10567                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10568                        field_number: 5u32,
10569                        expected: 0u8,
10570                        actual: tag.wire_type() as u8,
10571                    });
10572                }
10573                self.lazy = ::core::option::Option::Some(
10574                    ::buffa::types::decode_bool(buf)?,
10575                );
10576            }
10577            6u32 => {
10578                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10579                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10580                        field_number: 6u32,
10581                        expected: 0u8,
10582                        actual: tag.wire_type() as u8,
10583                    });
10584                }
10585                let __raw = ::buffa::types::decode_int32(buf)?;
10586                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10587                    __raw,
10588                ) {
10589                    self.jstype = ::core::option::Option::Some(__v);
10590                } else {
10591                    self.__buffa_unknown_fields
10592                        .push(::buffa::UnknownField {
10593                            number: 6u32,
10594                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10595                        });
10596                }
10597            }
10598            10u32 => {
10599                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10600                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10601                        field_number: 10u32,
10602                        expected: 0u8,
10603                        actual: tag.wire_type() as u8,
10604                    });
10605                }
10606                self.weak = ::core::option::Option::Some(
10607                    ::buffa::types::decode_bool(buf)?,
10608                );
10609            }
10610            15u32 => {
10611                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10612                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10613                        field_number: 15u32,
10614                        expected: 0u8,
10615                        actual: tag.wire_type() as u8,
10616                    });
10617                }
10618                self.unverified_lazy = ::core::option::Option::Some(
10619                    ::buffa::types::decode_bool(buf)?,
10620                );
10621            }
10622            16u32 => {
10623                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10624                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10625                        field_number: 16u32,
10626                        expected: 0u8,
10627                        actual: tag.wire_type() as u8,
10628                    });
10629                }
10630                self.debug_redact = ::core::option::Option::Some(
10631                    ::buffa::types::decode_bool(buf)?,
10632                );
10633            }
10634            17u32 => {
10635                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10636                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10637                        field_number: 17u32,
10638                        expected: 0u8,
10639                        actual: tag.wire_type() as u8,
10640                    });
10641                }
10642                let __raw = ::buffa::types::decode_int32(buf)?;
10643                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10644                    __raw,
10645                ) {
10646                    self.retention = ::core::option::Option::Some(__v);
10647                } else {
10648                    self.__buffa_unknown_fields
10649                        .push(::buffa::UnknownField {
10650                            number: 17u32,
10651                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10652                        });
10653                }
10654            }
10655            19u32 => {
10656                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
10657                    let len = ::buffa::encoding::decode_varint(buf)?;
10658                    let len = usize::try_from(len)
10659                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
10660                    if buf.remaining() < len {
10661                        return ::core::result::Result::Err(
10662                            ::buffa::DecodeError::UnexpectedEof,
10663                        );
10664                    }
10665                    self.targets.reserve(len);
10666                    let mut limited = buf.take(len);
10667                    while limited.has_remaining() {
10668                        let __raw = ::buffa::types::decode_int32(&mut limited)?;
10669                        if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10670                            __raw,
10671                        ) {
10672                            self.targets.push(__v);
10673                        } else {
10674                            self.__buffa_unknown_fields
10675                                .push(::buffa::UnknownField {
10676                                    number: 19u32,
10677                                    data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10678                                });
10679                        }
10680                    }
10681                    let leftover = limited.remaining();
10682                    if leftover > 0 {
10683                        limited.advance(leftover);
10684                    }
10685                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
10686                    let __raw = ::buffa::types::decode_int32(buf)?;
10687                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
10688                        __raw,
10689                    ) {
10690                        self.targets.push(__v);
10691                    } else {
10692                        self.__buffa_unknown_fields
10693                            .push(::buffa::UnknownField {
10694                                number: 19u32,
10695                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
10696                            });
10697                    }
10698                } else {
10699                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10700                        field_number: 19u32,
10701                        expected: 2u8,
10702                        actual: tag.wire_type() as u8,
10703                    });
10704                }
10705            }
10706            20u32 => {
10707                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10708                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10709                        field_number: 20u32,
10710                        expected: 2u8,
10711                        actual: tag.wire_type() as u8,
10712                    });
10713                }
10714                let mut elem = ::core::default::Default::default();
10715                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
10716                self.edition_defaults.push(elem);
10717            }
10718            21u32 => {
10719                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10720                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10721                        field_number: 21u32,
10722                        expected: 2u8,
10723                        actual: tag.wire_type() as u8,
10724                    });
10725                }
10726                ::buffa::Message::merge_length_delimited(
10727                    self.features.get_or_insert_default(),
10728                    buf,
10729                    depth,
10730                )?;
10731            }
10732            22u32 => {
10733                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10734                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10735                        field_number: 22u32,
10736                        expected: 2u8,
10737                        actual: tag.wire_type() as u8,
10738                    });
10739                }
10740                ::buffa::Message::merge_length_delimited(
10741                    self.feature_support.get_or_insert_default(),
10742                    buf,
10743                    depth,
10744                )?;
10745            }
10746            999u32 => {
10747                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10748                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10749                        field_number: 999u32,
10750                        expected: 2u8,
10751                        actual: tag.wire_type() as u8,
10752                    });
10753                }
10754                let mut elem = ::core::default::Default::default();
10755                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
10756                self.uninterpreted_option.push(elem);
10757            }
10758            _ => {
10759                self.__buffa_unknown_fields
10760                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
10761            }
10762        }
10763        ::core::result::Result::Ok(())
10764    }
10765    fn clear(&mut self) {
10766        self.ctype = ::core::option::Option::None;
10767        self.packed = ::core::option::Option::None;
10768        self.deprecated = ::core::option::Option::None;
10769        self.lazy = ::core::option::Option::None;
10770        self.jstype = ::core::option::Option::None;
10771        self.weak = ::core::option::Option::None;
10772        self.unverified_lazy = ::core::option::Option::None;
10773        self.debug_redact = ::core::option::Option::None;
10774        self.retention = ::core::option::Option::None;
10775        self.targets.clear();
10776        self.edition_defaults.clear();
10777        self.features = ::buffa::MessageField::none();
10778        self.feature_support = ::buffa::MessageField::none();
10779        self.uninterpreted_option.clear();
10780        self.__buffa_unknown_fields.clear();
10781    }
10782}
10783impl ::buffa::ExtensionSet for FieldOptions {
10784    const PROTO_FQN: &'static str = "google.protobuf.FieldOptions";
10785    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10786        &self.__buffa_unknown_fields
10787    }
10788    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10789        &mut self.__buffa_unknown_fields
10790    }
10791}
10792#[cfg(feature = "text")]
10793impl ::buffa::text::TextFormat for FieldOptions {
10794    fn encode_text(
10795        &self,
10796        enc: &mut ::buffa::text::TextEncoder<'_>,
10797    ) -> ::core::fmt::Result {
10798        #[allow(unused_imports)]
10799        use ::buffa::Enumeration as _;
10800        if let ::core::option::Option::Some(ref __v) = self.ctype {
10801            enc.write_field_name("ctype")?;
10802            enc.write_enum_name(__v.proto_name())?;
10803        }
10804        if let ::core::option::Option::Some(ref __v) = self.packed {
10805            enc.write_field_name("packed")?;
10806            enc.write_bool(*__v)?;
10807        }
10808        if let ::core::option::Option::Some(ref __v) = self.jstype {
10809            enc.write_field_name("jstype")?;
10810            enc.write_enum_name(__v.proto_name())?;
10811        }
10812        if let ::core::option::Option::Some(ref __v) = self.lazy {
10813            enc.write_field_name("lazy")?;
10814            enc.write_bool(*__v)?;
10815        }
10816        if let ::core::option::Option::Some(ref __v) = self.unverified_lazy {
10817            enc.write_field_name("unverified_lazy")?;
10818            enc.write_bool(*__v)?;
10819        }
10820        if let ::core::option::Option::Some(ref __v) = self.deprecated {
10821            enc.write_field_name("deprecated")?;
10822            enc.write_bool(*__v)?;
10823        }
10824        if let ::core::option::Option::Some(ref __v) = self.weak {
10825            enc.write_field_name("weak")?;
10826            enc.write_bool(*__v)?;
10827        }
10828        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
10829            enc.write_field_name("debug_redact")?;
10830            enc.write_bool(*__v)?;
10831        }
10832        if let ::core::option::Option::Some(ref __v) = self.retention {
10833            enc.write_field_name("retention")?;
10834            enc.write_enum_name(__v.proto_name())?;
10835        }
10836        if self.features.is_set() {
10837            enc.write_field_name("features")?;
10838            enc.write_message(&*self.features)?;
10839        }
10840        if self.feature_support.is_set() {
10841            enc.write_field_name("feature_support")?;
10842            enc.write_message(&*self.feature_support)?;
10843        }
10844        for __v in &self.targets {
10845            enc.write_field_name("targets")?;
10846            enc.write_enum_name(__v.proto_name())?;
10847        }
10848        for __v in &self.edition_defaults {
10849            enc.write_field_name("edition_defaults")?;
10850            enc.write_message(__v)?;
10851        }
10852        for __v in &self.uninterpreted_option {
10853            enc.write_field_name("uninterpreted_option")?;
10854            enc.write_message(__v)?;
10855        }
10856        enc.write_extension_fields(
10857            "google.protobuf.FieldOptions",
10858            &self.__buffa_unknown_fields,
10859        )?;
10860        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
10861        ::core::result::Result::Ok(())
10862    }
10863    fn merge_text(
10864        &mut self,
10865        dec: &mut ::buffa::text::TextDecoder<'_>,
10866    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
10867        #[allow(unused_imports)]
10868        use ::buffa::Enumeration as _;
10869        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
10870            match __name {
10871                "ctype" => {
10872                    self.ctype = ::core::option::Option::Some(
10873                        dec.read_closed_enum_by_name::<field_options::CType>()?,
10874                    );
10875                }
10876                "packed" => self.packed = ::core::option::Option::Some(dec.read_bool()?),
10877                "jstype" => {
10878                    self.jstype = ::core::option::Option::Some(
10879                        dec.read_closed_enum_by_name::<field_options::JSType>()?,
10880                    );
10881                }
10882                "lazy" => self.lazy = ::core::option::Option::Some(dec.read_bool()?),
10883                "unverified_lazy" => {
10884                    self.unverified_lazy = ::core::option::Option::Some(dec.read_bool()?);
10885                }
10886                "deprecated" => {
10887                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
10888                }
10889                "weak" => self.weak = ::core::option::Option::Some(dec.read_bool()?),
10890                "debug_redact" => {
10891                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
10892                }
10893                "retention" => {
10894                    self.retention = ::core::option::Option::Some(
10895                        dec.read_closed_enum_by_name::<field_options::OptionRetention>()?,
10896                    );
10897                }
10898                "features" => dec.merge_message(self.features.get_or_insert_default())?,
10899                "feature_support" => {
10900                    dec.merge_message(self.feature_support.get_or_insert_default())?
10901                }
10902                "targets" => {
10903                    dec.read_repeated_into(
10904                        &mut self.targets,
10905                        |__d| {
10906                            __d
10907                                .read_closed_enum_by_name::<
10908                                    field_options::OptionTargetType,
10909                                >()
10910                        },
10911                    )?
10912                }
10913                "edition_defaults" => {
10914                    dec.read_repeated_into(
10915                        &mut self.edition_defaults,
10916                        |__d| {
10917                            let mut __m = ::core::default::Default::default();
10918                            __d.merge_message(&mut __m)?;
10919                            ::core::result::Result::Ok(__m)
10920                        },
10921                    )?
10922                }
10923                "uninterpreted_option" => {
10924                    dec.read_repeated_into(
10925                        &mut self.uninterpreted_option,
10926                        |__d| {
10927                            let mut __m = ::core::default::Default::default();
10928                            __d.merge_message(&mut __m)?;
10929                            ::core::result::Result::Ok(__m)
10930                        },
10931                    )?
10932                }
10933                __name if __name.starts_with('[') => {
10934                    for __r in dec
10935                        .read_extension(__name, "google.protobuf.FieldOptions")?
10936                    {
10937                        self.__buffa_unknown_fields.push(__r);
10938                    }
10939                }
10940                _ => dec.skip_value()?,
10941            }
10942        }
10943        ::core::result::Result::Ok(())
10944    }
10945}
10946#[cfg(feature = "json")]
10947impl<'de> serde::Deserialize<'de> for FieldOptions {
10948    fn deserialize<D: serde::Deserializer<'de>>(
10949        d: D,
10950    ) -> ::core::result::Result<Self, D::Error> {
10951        struct _V;
10952        impl<'de> serde::de::Visitor<'de> for _V {
10953            type Value = FieldOptions;
10954            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10955                f.write_str("struct FieldOptions")
10956            }
10957            #[allow(clippy::field_reassign_with_default)]
10958            fn visit_map<A: serde::de::MapAccess<'de>>(
10959                self,
10960                mut map: A,
10961            ) -> ::core::result::Result<FieldOptions, A::Error> {
10962                let mut __f_ctype: ::core::option::Option<
10963                    ::core::option::Option<field_options::CType>,
10964                > = None;
10965                let mut __f_packed: ::core::option::Option<
10966                    ::core::option::Option<bool>,
10967                > = None;
10968                let mut __f_jstype: ::core::option::Option<
10969                    ::core::option::Option<field_options::JSType>,
10970                > = None;
10971                let mut __f_lazy: ::core::option::Option<::core::option::Option<bool>> = None;
10972                let mut __f_unverified_lazy: ::core::option::Option<
10973                    ::core::option::Option<bool>,
10974                > = None;
10975                let mut __f_deprecated: ::core::option::Option<
10976                    ::core::option::Option<bool>,
10977                > = None;
10978                let mut __f_weak: ::core::option::Option<::core::option::Option<bool>> = None;
10979                let mut __f_debug_redact: ::core::option::Option<
10980                    ::core::option::Option<bool>,
10981                > = None;
10982                let mut __f_retention: ::core::option::Option<
10983                    ::core::option::Option<field_options::OptionRetention>,
10984                > = None;
10985                let mut __f_targets: ::core::option::Option<
10986                    ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
10987                > = None;
10988                let mut __f_edition_defaults: ::core::option::Option<
10989                    ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
10990                > = None;
10991                let mut __f_features: ::core::option::Option<
10992                    ::buffa::MessageField<FeatureSet>,
10993                > = None;
10994                let mut __f_feature_support: ::core::option::Option<
10995                    ::buffa::MessageField<field_options::FeatureSupport>,
10996                > = None;
10997                let mut __f_uninterpreted_option: ::core::option::Option<
10998                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
10999                > = None;
11000                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
11001                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
11002                    match key.as_str() {
11003                        "ctype" => {
11004                            __f_ctype = Some({
11005                                struct _S;
11006                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11007                                    type Value = ::core::option::Option<field_options::CType>;
11008                                    fn deserialize<D: serde::Deserializer<'de>>(
11009                                        self,
11010                                        d: D,
11011                                    ) -> ::core::result::Result<
11012                                        ::core::option::Option<field_options::CType>,
11013                                        D::Error,
11014                                    > {
11015                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
11016                                    }
11017                                }
11018                                map.next_value_seed(_S)?
11019                            });
11020                        }
11021                        "packed" => {
11022                            __f_packed = Some(
11023                                map.next_value::<::core::option::Option<bool>>()?,
11024                            );
11025                        }
11026                        "jstype" => {
11027                            __f_jstype = Some({
11028                                struct _S;
11029                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11030                                    type Value = ::core::option::Option<field_options::JSType>;
11031                                    fn deserialize<D: serde::Deserializer<'de>>(
11032                                        self,
11033                                        d: D,
11034                                    ) -> ::core::result::Result<
11035                                        ::core::option::Option<field_options::JSType>,
11036                                        D::Error,
11037                                    > {
11038                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
11039                                    }
11040                                }
11041                                map.next_value_seed(_S)?
11042                            });
11043                        }
11044                        "lazy" => {
11045                            __f_lazy = Some(
11046                                map.next_value::<::core::option::Option<bool>>()?,
11047                            );
11048                        }
11049                        "unverifiedLazy" | "unverified_lazy" => {
11050                            __f_unverified_lazy = Some(
11051                                map.next_value::<::core::option::Option<bool>>()?,
11052                            );
11053                        }
11054                        "deprecated" => {
11055                            __f_deprecated = Some(
11056                                map.next_value::<::core::option::Option<bool>>()?,
11057                            );
11058                        }
11059                        "weak" => {
11060                            __f_weak = Some(
11061                                map.next_value::<::core::option::Option<bool>>()?,
11062                            );
11063                        }
11064                        "debugRedact" | "debug_redact" => {
11065                            __f_debug_redact = Some(
11066                                map.next_value::<::core::option::Option<bool>>()?,
11067                            );
11068                        }
11069                        "retention" => {
11070                            __f_retention = Some({
11071                                struct _S;
11072                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11073                                    type Value = ::core::option::Option<
11074                                        field_options::OptionRetention,
11075                                    >;
11076                                    fn deserialize<D: serde::Deserializer<'de>>(
11077                                        self,
11078                                        d: D,
11079                                    ) -> ::core::result::Result<
11080                                        ::core::option::Option<field_options::OptionRetention>,
11081                                        D::Error,
11082                                    > {
11083                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
11084                                    }
11085                                }
11086                                map.next_value_seed(_S)?
11087                            });
11088                        }
11089                        "targets" => {
11090                            __f_targets = Some({
11091                                struct _S;
11092                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11093                                    type Value = ::buffa::alloc::vec::Vec<
11094                                        field_options::OptionTargetType,
11095                                    >;
11096                                    fn deserialize<D: serde::Deserializer<'de>>(
11097                                        self,
11098                                        d: D,
11099                                    ) -> ::core::result::Result<
11100                                        ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
11101                                        D::Error,
11102                                    > {
11103                                        ::buffa::json_helpers::repeated_closed_enum::deserialize(d)
11104                                    }
11105                                }
11106                                map.next_value_seed(_S)?
11107                            });
11108                        }
11109                        "editionDefaults" | "edition_defaults" => {
11110                            __f_edition_defaults = Some({
11111                                struct _S;
11112                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11113                                    type Value = ::buffa::alloc::vec::Vec<
11114                                        field_options::EditionDefault,
11115                                    >;
11116                                    fn deserialize<D: serde::Deserializer<'de>>(
11117                                        self,
11118                                        d: D,
11119                                    ) -> ::core::result::Result<
11120                                        ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
11121                                        D::Error,
11122                                    > {
11123                                        ::buffa::json_helpers::null_as_default(d)
11124                                    }
11125                                }
11126                                map.next_value_seed(_S)?
11127                            });
11128                        }
11129                        "features" => {
11130                            __f_features = Some(
11131                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
11132                            );
11133                        }
11134                        "featureSupport" | "feature_support" => {
11135                            __f_feature_support = Some(
11136                                map
11137                                    .next_value::<
11138                                        ::buffa::MessageField<field_options::FeatureSupport>,
11139                                    >()?,
11140                            );
11141                        }
11142                        "uninterpretedOption" | "uninterpreted_option" => {
11143                            __f_uninterpreted_option = Some({
11144                                struct _S;
11145                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
11146                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
11147                                    fn deserialize<D: serde::Deserializer<'de>>(
11148                                        self,
11149                                        d: D,
11150                                    ) -> ::core::result::Result<
11151                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
11152                                        D::Error,
11153                                    > {
11154                                        ::buffa::json_helpers::null_as_default(d)
11155                                    }
11156                                }
11157                                map.next_value_seed(_S)?
11158                            });
11159                        }
11160                        __k if __k.starts_with('[') => {
11161                            let __v: ::buffa::serde_json::Value = map.next_value()?;
11162                            match ::buffa::extension_registry::deserialize_extension_key(
11163                                "google.protobuf.FieldOptions",
11164                                __k,
11165                                __v,
11166                            ) {
11167                                ::core::option::Option::Some(
11168                                    ::core::result::Result::Ok(__recs),
11169                                ) => {
11170                                    for __rec in __recs {
11171                                        __ext_records.push(__rec);
11172                                    }
11173                                }
11174                                ::core::option::Option::Some(
11175                                    ::core::result::Result::Err(__e),
11176                                ) => {
11177                                    return ::core::result::Result::Err(
11178                                        <A::Error as ::serde::de::Error>::custom(__e),
11179                                    );
11180                                }
11181                                ::core::option::Option::None => {}
11182                            }
11183                        }
11184                        _ => {
11185                            map.next_value::<serde::de::IgnoredAny>()?;
11186                        }
11187                    }
11188                }
11189                let mut __r = <FieldOptions as ::core::default::Default>::default();
11190                if let ::core::option::Option::Some(v) = __f_ctype {
11191                    __r.ctype = v;
11192                }
11193                if let ::core::option::Option::Some(v) = __f_packed {
11194                    __r.packed = v;
11195                }
11196                if let ::core::option::Option::Some(v) = __f_jstype {
11197                    __r.jstype = v;
11198                }
11199                if let ::core::option::Option::Some(v) = __f_lazy {
11200                    __r.lazy = v;
11201                }
11202                if let ::core::option::Option::Some(v) = __f_unverified_lazy {
11203                    __r.unverified_lazy = v;
11204                }
11205                if let ::core::option::Option::Some(v) = __f_deprecated {
11206                    __r.deprecated = v;
11207                }
11208                if let ::core::option::Option::Some(v) = __f_weak {
11209                    __r.weak = v;
11210                }
11211                if let ::core::option::Option::Some(v) = __f_debug_redact {
11212                    __r.debug_redact = v;
11213                }
11214                if let ::core::option::Option::Some(v) = __f_retention {
11215                    __r.retention = v;
11216                }
11217                if let ::core::option::Option::Some(v) = __f_targets {
11218                    __r.targets = v;
11219                }
11220                if let ::core::option::Option::Some(v) = __f_edition_defaults {
11221                    __r.edition_defaults = v;
11222                }
11223                if let ::core::option::Option::Some(v) = __f_features {
11224                    __r.features = v;
11225                }
11226                if let ::core::option::Option::Some(v) = __f_feature_support {
11227                    __r.feature_support = v;
11228                }
11229                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
11230                    __r.uninterpreted_option = v;
11231                }
11232                for __rec in __ext_records {
11233                    __r.__buffa_unknown_fields.push(__rec);
11234                }
11235                Ok(__r)
11236            }
11237        }
11238        d.deserialize_map(_V)
11239    }
11240}
11241#[cfg(feature = "json")]
11242impl ::buffa::json_helpers::ProtoElemJson for FieldOptions {
11243    fn serialize_proto_json<S: ::serde::Serializer>(
11244        v: &Self,
11245        s: S,
11246    ) -> ::core::result::Result<S::Ok, S::Error> {
11247        ::serde::Serialize::serialize(v, s)
11248    }
11249    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11250        d: D,
11251    ) -> ::core::result::Result<Self, D::Error> {
11252        <Self as ::serde::Deserialize>::deserialize(d)
11253    }
11254}
11255#[doc(hidden)]
11256#[derive(Clone, Debug, Default, PartialEq)]
11257#[repr(transparent)]
11258#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11259pub struct __FieldOptionsExtJson(pub ::buffa::UnknownFields);
11260impl ::core::ops::Deref for __FieldOptionsExtJson {
11261    type Target = ::buffa::UnknownFields;
11262    fn deref(&self) -> &::buffa::UnknownFields {
11263        &self.0
11264    }
11265}
11266impl ::core::ops::DerefMut for __FieldOptionsExtJson {
11267    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
11268        &mut self.0
11269    }
11270}
11271impl ::core::convert::From<::buffa::UnknownFields> for __FieldOptionsExtJson {
11272    fn from(u: ::buffa::UnknownFields) -> Self {
11273        Self(u)
11274    }
11275}
11276#[cfg(feature = "json")]
11277impl ::serde::Serialize for __FieldOptionsExtJson {
11278    fn serialize<S: ::serde::Serializer>(
11279        &self,
11280        s: S,
11281    ) -> ::core::result::Result<S::Ok, S::Error> {
11282        ::buffa::extension_registry::serialize_extensions(
11283            "google.protobuf.FieldOptions",
11284            &self.0,
11285            s,
11286        )
11287    }
11288}
11289#[cfg(feature = "json")]
11290impl<'de> ::serde::Deserialize<'de> for __FieldOptionsExtJson {
11291    fn deserialize<D: ::serde::Deserializer<'de>>(
11292        d: D,
11293    ) -> ::core::result::Result<Self, D::Error> {
11294        ::buffa::extension_registry::deserialize_extensions(
11295                "google.protobuf.FieldOptions",
11296                d,
11297            )
11298            .map(Self)
11299    }
11300}
11301#[cfg(feature = "json")]
11302#[doc(hidden)]
11303pub const __FIELD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11304    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
11305    to_json: ::buffa::type_registry::any_to_json::<FieldOptions>,
11306    from_json: ::buffa::type_registry::any_from_json::<FieldOptions>,
11307    is_wkt: false,
11308};
11309#[cfg(feature = "text")]
11310#[doc(hidden)]
11311pub const __FIELD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
11312    type_url: "type.googleapis.com/google.protobuf.FieldOptions",
11313    text_encode: ::buffa::type_registry::any_encode_text::<FieldOptions>,
11314    text_merge: ::buffa::type_registry::any_merge_text::<FieldOptions>,
11315};
11316pub mod field_options {
11317    #[allow(unused_imports)]
11318    use super::*;
11319    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11320    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11321    #[repr(i32)]
11322    pub enum CType {
11323        /// Default mode.
11324        STRING = 0i32,
11325        /// The option \[ctype=CORD\] may be applied to a non-repeated field of type
11326        /// "bytes". It indicates that in C++, the data should be stored in a Cord
11327        /// instead of a string.  For very large strings, this may reduce memory
11328        /// fragmentation. It may also allow better performance when parsing from a
11329        /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then
11330        /// alias the original buffer.
11331        CORD = 1i32,
11332        STRING_PIECE = 2i32,
11333    }
11334    impl CType {
11335        ///Idiomatic alias for [`Self::STRING`]; `Debug` prints the variant name.
11336        #[allow(non_upper_case_globals)]
11337        pub const String: Self = Self::STRING;
11338        ///Idiomatic alias for [`Self::CORD`]; `Debug` prints the variant name.
11339        #[allow(non_upper_case_globals)]
11340        pub const Cord: Self = Self::CORD;
11341        ///Idiomatic alias for [`Self::STRING_PIECE`]; `Debug` prints the variant name.
11342        #[allow(non_upper_case_globals)]
11343        pub const StringPiece: Self = Self::STRING_PIECE;
11344    }
11345    impl ::core::default::Default for CType {
11346        fn default() -> Self {
11347            Self::STRING
11348        }
11349    }
11350    #[cfg(feature = "json")]
11351    const _: () = {
11352        impl ::serde::Serialize for CType {
11353            fn serialize<S: ::serde::Serializer>(
11354                &self,
11355                s: S,
11356            ) -> ::core::result::Result<S::Ok, S::Error> {
11357                s.serialize_str(::buffa::Enumeration::proto_name(self))
11358            }
11359        }
11360        impl<'de> ::serde::Deserialize<'de> for CType {
11361            fn deserialize<D: ::serde::Deserializer<'de>>(
11362                d: D,
11363            ) -> ::core::result::Result<Self, D::Error> {
11364                struct _V;
11365                impl ::serde::de::Visitor<'_> for _V {
11366                    type Value = CType;
11367                    fn expecting(
11368                        &self,
11369                        f: &mut ::core::fmt::Formatter<'_>,
11370                    ) -> ::core::fmt::Result {
11371                        f.write_str(
11372                            concat!("a string, integer, or null for ", stringify!(CType)),
11373                        )
11374                    }
11375                    fn visit_str<E: ::serde::de::Error>(
11376                        self,
11377                        v: &str,
11378                    ) -> ::core::result::Result<CType, E> {
11379                        <CType as ::buffa::Enumeration>::from_proto_name(v)
11380                            .ok_or_else(|| {
11381                                ::serde::de::Error::unknown_variant(v, &[])
11382                            })
11383                    }
11384                    fn visit_i64<E: ::serde::de::Error>(
11385                        self,
11386                        v: i64,
11387                    ) -> ::core::result::Result<CType, E> {
11388                        let v32 = i32::try_from(v)
11389                            .map_err(|_| {
11390                                ::serde::de::Error::custom(
11391                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11392                                )
11393                            })?;
11394                        <CType as ::buffa::Enumeration>::from_i32(v32)
11395                            .ok_or_else(|| {
11396                                ::serde::de::Error::custom(
11397                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11398                                )
11399                            })
11400                    }
11401                    fn visit_u64<E: ::serde::de::Error>(
11402                        self,
11403                        v: u64,
11404                    ) -> ::core::result::Result<CType, E> {
11405                        let v32 = i32::try_from(v)
11406                            .map_err(|_| {
11407                                ::serde::de::Error::custom(
11408                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11409                                )
11410                            })?;
11411                        <CType as ::buffa::Enumeration>::from_i32(v32)
11412                            .ok_or_else(|| {
11413                                ::serde::de::Error::custom(
11414                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11415                                )
11416                            })
11417                    }
11418                    fn visit_unit<E: ::serde::de::Error>(
11419                        self,
11420                    ) -> ::core::result::Result<CType, E> {
11421                        ::core::result::Result::Ok(::core::default::Default::default())
11422                    }
11423                }
11424                d.deserialize_any(_V)
11425            }
11426        }
11427        impl ::buffa::json_helpers::ProtoElemJson for CType {
11428            fn serialize_proto_json<S: ::serde::Serializer>(
11429                v: &Self,
11430                s: S,
11431            ) -> ::core::result::Result<S::Ok, S::Error> {
11432                ::serde::Serialize::serialize(v, s)
11433            }
11434            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11435                d: D,
11436            ) -> ::core::result::Result<Self, D::Error> {
11437                <Self as ::serde::Deserialize>::deserialize(d)
11438            }
11439        }
11440    };
11441    impl ::buffa::Enumeration for CType {
11442        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11443            match value {
11444                0i32 => ::core::option::Option::Some(Self::STRING),
11445                1i32 => ::core::option::Option::Some(Self::CORD),
11446                2i32 => ::core::option::Option::Some(Self::STRING_PIECE),
11447                _ => ::core::option::Option::None,
11448            }
11449        }
11450        fn to_i32(&self) -> i32 {
11451            *self as i32
11452        }
11453        fn proto_name(&self) -> &'static str {
11454            match self {
11455                Self::STRING => "STRING",
11456                Self::CORD => "CORD",
11457                Self::STRING_PIECE => "STRING_PIECE",
11458            }
11459        }
11460        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11461            match name {
11462                "STRING" => ::core::option::Option::Some(Self::STRING),
11463                "CORD" => ::core::option::Option::Some(Self::CORD),
11464                "STRING_PIECE" => ::core::option::Option::Some(Self::STRING_PIECE),
11465                _ => ::core::option::Option::None,
11466            }
11467        }
11468        fn values() -> &'static [Self] {
11469            &[Self::STRING, Self::CORD, Self::STRING_PIECE]
11470        }
11471    }
11472    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11473    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11474    #[repr(i32)]
11475    pub enum JSType {
11476        /// Use the default type.
11477        JS_NORMAL = 0i32,
11478        /// Use JavaScript strings.
11479        JS_STRING = 1i32,
11480        /// Use JavaScript numbers.
11481        JS_NUMBER = 2i32,
11482    }
11483    impl JSType {
11484        ///Idiomatic alias for [`Self::JS_NORMAL`]; `Debug` prints the variant name.
11485        #[allow(non_upper_case_globals)]
11486        pub const JsNormal: Self = Self::JS_NORMAL;
11487        ///Idiomatic alias for [`Self::JS_STRING`]; `Debug` prints the variant name.
11488        #[allow(non_upper_case_globals)]
11489        pub const JsString: Self = Self::JS_STRING;
11490        ///Idiomatic alias for [`Self::JS_NUMBER`]; `Debug` prints the variant name.
11491        #[allow(non_upper_case_globals)]
11492        pub const JsNumber: Self = Self::JS_NUMBER;
11493    }
11494    impl ::core::default::Default for JSType {
11495        fn default() -> Self {
11496            Self::JS_NORMAL
11497        }
11498    }
11499    #[cfg(feature = "json")]
11500    const _: () = {
11501        impl ::serde::Serialize for JSType {
11502            fn serialize<S: ::serde::Serializer>(
11503                &self,
11504                s: S,
11505            ) -> ::core::result::Result<S::Ok, S::Error> {
11506                s.serialize_str(::buffa::Enumeration::proto_name(self))
11507            }
11508        }
11509        impl<'de> ::serde::Deserialize<'de> for JSType {
11510            fn deserialize<D: ::serde::Deserializer<'de>>(
11511                d: D,
11512            ) -> ::core::result::Result<Self, D::Error> {
11513                struct _V;
11514                impl ::serde::de::Visitor<'_> for _V {
11515                    type Value = JSType;
11516                    fn expecting(
11517                        &self,
11518                        f: &mut ::core::fmt::Formatter<'_>,
11519                    ) -> ::core::fmt::Result {
11520                        f.write_str(
11521                            concat!(
11522                                "a string, integer, or null for ", stringify!(JSType)
11523                            ),
11524                        )
11525                    }
11526                    fn visit_str<E: ::serde::de::Error>(
11527                        self,
11528                        v: &str,
11529                    ) -> ::core::result::Result<JSType, E> {
11530                        <JSType as ::buffa::Enumeration>::from_proto_name(v)
11531                            .ok_or_else(|| {
11532                                ::serde::de::Error::unknown_variant(v, &[])
11533                            })
11534                    }
11535                    fn visit_i64<E: ::serde::de::Error>(
11536                        self,
11537                        v: i64,
11538                    ) -> ::core::result::Result<JSType, E> {
11539                        let v32 = i32::try_from(v)
11540                            .map_err(|_| {
11541                                ::serde::de::Error::custom(
11542                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11543                                )
11544                            })?;
11545                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11546                            .ok_or_else(|| {
11547                                ::serde::de::Error::custom(
11548                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11549                                )
11550                            })
11551                    }
11552                    fn visit_u64<E: ::serde::de::Error>(
11553                        self,
11554                        v: u64,
11555                    ) -> ::core::result::Result<JSType, E> {
11556                        let v32 = i32::try_from(v)
11557                            .map_err(|_| {
11558                                ::serde::de::Error::custom(
11559                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11560                                )
11561                            })?;
11562                        <JSType as ::buffa::Enumeration>::from_i32(v32)
11563                            .ok_or_else(|| {
11564                                ::serde::de::Error::custom(
11565                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11566                                )
11567                            })
11568                    }
11569                    fn visit_unit<E: ::serde::de::Error>(
11570                        self,
11571                    ) -> ::core::result::Result<JSType, E> {
11572                        ::core::result::Result::Ok(::core::default::Default::default())
11573                    }
11574                }
11575                d.deserialize_any(_V)
11576            }
11577        }
11578        impl ::buffa::json_helpers::ProtoElemJson for JSType {
11579            fn serialize_proto_json<S: ::serde::Serializer>(
11580                v: &Self,
11581                s: S,
11582            ) -> ::core::result::Result<S::Ok, S::Error> {
11583                ::serde::Serialize::serialize(v, s)
11584            }
11585            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11586                d: D,
11587            ) -> ::core::result::Result<Self, D::Error> {
11588                <Self as ::serde::Deserialize>::deserialize(d)
11589            }
11590        }
11591    };
11592    impl ::buffa::Enumeration for JSType {
11593        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11594            match value {
11595                0i32 => ::core::option::Option::Some(Self::JS_NORMAL),
11596                1i32 => ::core::option::Option::Some(Self::JS_STRING),
11597                2i32 => ::core::option::Option::Some(Self::JS_NUMBER),
11598                _ => ::core::option::Option::None,
11599            }
11600        }
11601        fn to_i32(&self) -> i32 {
11602            *self as i32
11603        }
11604        fn proto_name(&self) -> &'static str {
11605            match self {
11606                Self::JS_NORMAL => "JS_NORMAL",
11607                Self::JS_STRING => "JS_STRING",
11608                Self::JS_NUMBER => "JS_NUMBER",
11609            }
11610        }
11611        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11612            match name {
11613                "JS_NORMAL" => ::core::option::Option::Some(Self::JS_NORMAL),
11614                "JS_STRING" => ::core::option::Option::Some(Self::JS_STRING),
11615                "JS_NUMBER" => ::core::option::Option::Some(Self::JS_NUMBER),
11616                _ => ::core::option::Option::None,
11617            }
11618        }
11619        fn values() -> &'static [Self] {
11620            &[Self::JS_NORMAL, Self::JS_STRING, Self::JS_NUMBER]
11621        }
11622    }
11623    /// If set to RETENTION_SOURCE, the option will be omitted from the binary.
11624    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11625    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11626    #[repr(i32)]
11627    pub enum OptionRetention {
11628        RETENTION_UNKNOWN = 0i32,
11629        RETENTION_RUNTIME = 1i32,
11630        RETENTION_SOURCE = 2i32,
11631    }
11632    impl OptionRetention {
11633        ///Idiomatic alias for [`Self::RETENTION_UNKNOWN`]; `Debug` prints the variant name.
11634        #[allow(non_upper_case_globals)]
11635        pub const RetentionUnknown: Self = Self::RETENTION_UNKNOWN;
11636        ///Idiomatic alias for [`Self::RETENTION_RUNTIME`]; `Debug` prints the variant name.
11637        #[allow(non_upper_case_globals)]
11638        pub const RetentionRuntime: Self = Self::RETENTION_RUNTIME;
11639        ///Idiomatic alias for [`Self::RETENTION_SOURCE`]; `Debug` prints the variant name.
11640        #[allow(non_upper_case_globals)]
11641        pub const RetentionSource: Self = Self::RETENTION_SOURCE;
11642    }
11643    impl ::core::default::Default for OptionRetention {
11644        fn default() -> Self {
11645            Self::RETENTION_UNKNOWN
11646        }
11647    }
11648    #[cfg(feature = "json")]
11649    const _: () = {
11650        impl ::serde::Serialize for OptionRetention {
11651            fn serialize<S: ::serde::Serializer>(
11652                &self,
11653                s: S,
11654            ) -> ::core::result::Result<S::Ok, S::Error> {
11655                s.serialize_str(::buffa::Enumeration::proto_name(self))
11656            }
11657        }
11658        impl<'de> ::serde::Deserialize<'de> for OptionRetention {
11659            fn deserialize<D: ::serde::Deserializer<'de>>(
11660                d: D,
11661            ) -> ::core::result::Result<Self, D::Error> {
11662                struct _V;
11663                impl ::serde::de::Visitor<'_> for _V {
11664                    type Value = OptionRetention;
11665                    fn expecting(
11666                        &self,
11667                        f: &mut ::core::fmt::Formatter<'_>,
11668                    ) -> ::core::fmt::Result {
11669                        f.write_str(
11670                            concat!(
11671                                "a string, integer, or null for ",
11672                                stringify!(OptionRetention)
11673                            ),
11674                        )
11675                    }
11676                    fn visit_str<E: ::serde::de::Error>(
11677                        self,
11678                        v: &str,
11679                    ) -> ::core::result::Result<OptionRetention, E> {
11680                        <OptionRetention as ::buffa::Enumeration>::from_proto_name(v)
11681                            .ok_or_else(|| {
11682                                ::serde::de::Error::unknown_variant(v, &[])
11683                            })
11684                    }
11685                    fn visit_i64<E: ::serde::de::Error>(
11686                        self,
11687                        v: i64,
11688                    ) -> ::core::result::Result<OptionRetention, E> {
11689                        let v32 = i32::try_from(v)
11690                            .map_err(|_| {
11691                                ::serde::de::Error::custom(
11692                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11693                                )
11694                            })?;
11695                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11696                            .ok_or_else(|| {
11697                                ::serde::de::Error::custom(
11698                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11699                                )
11700                            })
11701                    }
11702                    fn visit_u64<E: ::serde::de::Error>(
11703                        self,
11704                        v: u64,
11705                    ) -> ::core::result::Result<OptionRetention, E> {
11706                        let v32 = i32::try_from(v)
11707                            .map_err(|_| {
11708                                ::serde::de::Error::custom(
11709                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11710                                )
11711                            })?;
11712                        <OptionRetention as ::buffa::Enumeration>::from_i32(v32)
11713                            .ok_or_else(|| {
11714                                ::serde::de::Error::custom(
11715                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11716                                )
11717                            })
11718                    }
11719                    fn visit_unit<E: ::serde::de::Error>(
11720                        self,
11721                    ) -> ::core::result::Result<OptionRetention, E> {
11722                        ::core::result::Result::Ok(::core::default::Default::default())
11723                    }
11724                }
11725                d.deserialize_any(_V)
11726            }
11727        }
11728        impl ::buffa::json_helpers::ProtoElemJson for OptionRetention {
11729            fn serialize_proto_json<S: ::serde::Serializer>(
11730                v: &Self,
11731                s: S,
11732            ) -> ::core::result::Result<S::Ok, S::Error> {
11733                ::serde::Serialize::serialize(v, s)
11734            }
11735            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11736                d: D,
11737            ) -> ::core::result::Result<Self, D::Error> {
11738                <Self as ::serde::Deserialize>::deserialize(d)
11739            }
11740        }
11741    };
11742    impl ::buffa::Enumeration for OptionRetention {
11743        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11744            match value {
11745                0i32 => ::core::option::Option::Some(Self::RETENTION_UNKNOWN),
11746                1i32 => ::core::option::Option::Some(Self::RETENTION_RUNTIME),
11747                2i32 => ::core::option::Option::Some(Self::RETENTION_SOURCE),
11748                _ => ::core::option::Option::None,
11749            }
11750        }
11751        fn to_i32(&self) -> i32 {
11752            *self as i32
11753        }
11754        fn proto_name(&self) -> &'static str {
11755            match self {
11756                Self::RETENTION_UNKNOWN => "RETENTION_UNKNOWN",
11757                Self::RETENTION_RUNTIME => "RETENTION_RUNTIME",
11758                Self::RETENTION_SOURCE => "RETENTION_SOURCE",
11759            }
11760        }
11761        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11762            match name {
11763                "RETENTION_UNKNOWN" => {
11764                    ::core::option::Option::Some(Self::RETENTION_UNKNOWN)
11765                }
11766                "RETENTION_RUNTIME" => {
11767                    ::core::option::Option::Some(Self::RETENTION_RUNTIME)
11768                }
11769                "RETENTION_SOURCE" => {
11770                    ::core::option::Option::Some(Self::RETENTION_SOURCE)
11771                }
11772                _ => ::core::option::Option::None,
11773            }
11774        }
11775        fn values() -> &'static [Self] {
11776            &[Self::RETENTION_UNKNOWN, Self::RETENTION_RUNTIME, Self::RETENTION_SOURCE]
11777        }
11778    }
11779    /// This indicates the types of entities that the field may apply to when used
11780    /// as an option. If it is unset, then the field may be freely used as an
11781    /// option on any kind of entity.
11782    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
11783    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
11784    #[repr(i32)]
11785    pub enum OptionTargetType {
11786        TARGET_TYPE_UNKNOWN = 0i32,
11787        TARGET_TYPE_FILE = 1i32,
11788        TARGET_TYPE_EXTENSION_RANGE = 2i32,
11789        TARGET_TYPE_MESSAGE = 3i32,
11790        TARGET_TYPE_FIELD = 4i32,
11791        TARGET_TYPE_ONEOF = 5i32,
11792        TARGET_TYPE_ENUM = 6i32,
11793        TARGET_TYPE_ENUM_ENTRY = 7i32,
11794        TARGET_TYPE_SERVICE = 8i32,
11795        TARGET_TYPE_METHOD = 9i32,
11796    }
11797    impl OptionTargetType {
11798        ///Idiomatic alias for [`Self::TARGET_TYPE_UNKNOWN`]; `Debug` prints the variant name.
11799        #[allow(non_upper_case_globals)]
11800        pub const TargetTypeUnknown: Self = Self::TARGET_TYPE_UNKNOWN;
11801        ///Idiomatic alias for [`Self::TARGET_TYPE_FILE`]; `Debug` prints the variant name.
11802        #[allow(non_upper_case_globals)]
11803        pub const TargetTypeFile: Self = Self::TARGET_TYPE_FILE;
11804        ///Idiomatic alias for [`Self::TARGET_TYPE_EXTENSION_RANGE`]; `Debug` prints the variant name.
11805        #[allow(non_upper_case_globals)]
11806        pub const TargetTypeExtensionRange: Self = Self::TARGET_TYPE_EXTENSION_RANGE;
11807        ///Idiomatic alias for [`Self::TARGET_TYPE_MESSAGE`]; `Debug` prints the variant name.
11808        #[allow(non_upper_case_globals)]
11809        pub const TargetTypeMessage: Self = Self::TARGET_TYPE_MESSAGE;
11810        ///Idiomatic alias for [`Self::TARGET_TYPE_FIELD`]; `Debug` prints the variant name.
11811        #[allow(non_upper_case_globals)]
11812        pub const TargetTypeField: Self = Self::TARGET_TYPE_FIELD;
11813        ///Idiomatic alias for [`Self::TARGET_TYPE_ONEOF`]; `Debug` prints the variant name.
11814        #[allow(non_upper_case_globals)]
11815        pub const TargetTypeOneof: Self = Self::TARGET_TYPE_ONEOF;
11816        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM`]; `Debug` prints the variant name.
11817        #[allow(non_upper_case_globals)]
11818        pub const TargetTypeEnum: Self = Self::TARGET_TYPE_ENUM;
11819        ///Idiomatic alias for [`Self::TARGET_TYPE_ENUM_ENTRY`]; `Debug` prints the variant name.
11820        #[allow(non_upper_case_globals)]
11821        pub const TargetTypeEnumEntry: Self = Self::TARGET_TYPE_ENUM_ENTRY;
11822        ///Idiomatic alias for [`Self::TARGET_TYPE_SERVICE`]; `Debug` prints the variant name.
11823        #[allow(non_upper_case_globals)]
11824        pub const TargetTypeService: Self = Self::TARGET_TYPE_SERVICE;
11825        ///Idiomatic alias for [`Self::TARGET_TYPE_METHOD`]; `Debug` prints the variant name.
11826        #[allow(non_upper_case_globals)]
11827        pub const TargetTypeMethod: Self = Self::TARGET_TYPE_METHOD;
11828    }
11829    impl ::core::default::Default for OptionTargetType {
11830        fn default() -> Self {
11831            Self::TARGET_TYPE_UNKNOWN
11832        }
11833    }
11834    #[cfg(feature = "json")]
11835    const _: () = {
11836        impl ::serde::Serialize for OptionTargetType {
11837            fn serialize<S: ::serde::Serializer>(
11838                &self,
11839                s: S,
11840            ) -> ::core::result::Result<S::Ok, S::Error> {
11841                s.serialize_str(::buffa::Enumeration::proto_name(self))
11842            }
11843        }
11844        impl<'de> ::serde::Deserialize<'de> for OptionTargetType {
11845            fn deserialize<D: ::serde::Deserializer<'de>>(
11846                d: D,
11847            ) -> ::core::result::Result<Self, D::Error> {
11848                struct _V;
11849                impl ::serde::de::Visitor<'_> for _V {
11850                    type Value = OptionTargetType;
11851                    fn expecting(
11852                        &self,
11853                        f: &mut ::core::fmt::Formatter<'_>,
11854                    ) -> ::core::fmt::Result {
11855                        f.write_str(
11856                            concat!(
11857                                "a string, integer, or null for ",
11858                                stringify!(OptionTargetType)
11859                            ),
11860                        )
11861                    }
11862                    fn visit_str<E: ::serde::de::Error>(
11863                        self,
11864                        v: &str,
11865                    ) -> ::core::result::Result<OptionTargetType, E> {
11866                        <OptionTargetType as ::buffa::Enumeration>::from_proto_name(v)
11867                            .ok_or_else(|| {
11868                                ::serde::de::Error::unknown_variant(v, &[])
11869                            })
11870                    }
11871                    fn visit_i64<E: ::serde::de::Error>(
11872                        self,
11873                        v: i64,
11874                    ) -> ::core::result::Result<OptionTargetType, E> {
11875                        let v32 = i32::try_from(v)
11876                            .map_err(|_| {
11877                                ::serde::de::Error::custom(
11878                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11879                                )
11880                            })?;
11881                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11882                            .ok_or_else(|| {
11883                                ::serde::de::Error::custom(
11884                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11885                                )
11886                            })
11887                    }
11888                    fn visit_u64<E: ::serde::de::Error>(
11889                        self,
11890                        v: u64,
11891                    ) -> ::core::result::Result<OptionTargetType, E> {
11892                        let v32 = i32::try_from(v)
11893                            .map_err(|_| {
11894                                ::serde::de::Error::custom(
11895                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
11896                                )
11897                            })?;
11898                        <OptionTargetType as ::buffa::Enumeration>::from_i32(v32)
11899                            .ok_or_else(|| {
11900                                ::serde::de::Error::custom(
11901                                    ::buffa::alloc::format!("unknown enum value {v32}"),
11902                                )
11903                            })
11904                    }
11905                    fn visit_unit<E: ::serde::de::Error>(
11906                        self,
11907                    ) -> ::core::result::Result<OptionTargetType, E> {
11908                        ::core::result::Result::Ok(::core::default::Default::default())
11909                    }
11910                }
11911                d.deserialize_any(_V)
11912            }
11913        }
11914        impl ::buffa::json_helpers::ProtoElemJson for OptionTargetType {
11915            fn serialize_proto_json<S: ::serde::Serializer>(
11916                v: &Self,
11917                s: S,
11918            ) -> ::core::result::Result<S::Ok, S::Error> {
11919                ::serde::Serialize::serialize(v, s)
11920            }
11921            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11922                d: D,
11923            ) -> ::core::result::Result<Self, D::Error> {
11924                <Self as ::serde::Deserialize>::deserialize(d)
11925            }
11926        }
11927    };
11928    impl ::buffa::Enumeration for OptionTargetType {
11929        fn from_i32(value: i32) -> ::core::option::Option<Self> {
11930            match value {
11931                0i32 => ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
11932                1i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FILE),
11933                2i32 => ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE),
11934                3i32 => ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
11935                4i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FIELD),
11936                5i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF),
11937                6i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM),
11938                7i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
11939                8i32 => ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE),
11940                9i32 => ::core::option::Option::Some(Self::TARGET_TYPE_METHOD),
11941                _ => ::core::option::Option::None,
11942            }
11943        }
11944        fn to_i32(&self) -> i32 {
11945            *self as i32
11946        }
11947        fn proto_name(&self) -> &'static str {
11948            match self {
11949                Self::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN",
11950                Self::TARGET_TYPE_FILE => "TARGET_TYPE_FILE",
11951                Self::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE",
11952                Self::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE",
11953                Self::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD",
11954                Self::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF",
11955                Self::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM",
11956                Self::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY",
11957                Self::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE",
11958                Self::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD",
11959            }
11960        }
11961        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
11962            match name {
11963                "TARGET_TYPE_UNKNOWN" => {
11964                    ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN)
11965                }
11966                "TARGET_TYPE_FILE" => {
11967                    ::core::option::Option::Some(Self::TARGET_TYPE_FILE)
11968                }
11969                "TARGET_TYPE_EXTENSION_RANGE" => {
11970                    ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
11971                }
11972                "TARGET_TYPE_MESSAGE" => {
11973                    ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE)
11974                }
11975                "TARGET_TYPE_FIELD" => {
11976                    ::core::option::Option::Some(Self::TARGET_TYPE_FIELD)
11977                }
11978                "TARGET_TYPE_ONEOF" => {
11979                    ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF)
11980                }
11981                "TARGET_TYPE_ENUM" => {
11982                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM)
11983                }
11984                "TARGET_TYPE_ENUM_ENTRY" => {
11985                    ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY)
11986                }
11987                "TARGET_TYPE_SERVICE" => {
11988                    ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE)
11989                }
11990                "TARGET_TYPE_METHOD" => {
11991                    ::core::option::Option::Some(Self::TARGET_TYPE_METHOD)
11992                }
11993                _ => ::core::option::Option::None,
11994            }
11995        }
11996        fn values() -> &'static [Self] {
11997            &[
11998                Self::TARGET_TYPE_UNKNOWN,
11999                Self::TARGET_TYPE_FILE,
12000                Self::TARGET_TYPE_EXTENSION_RANGE,
12001                Self::TARGET_TYPE_MESSAGE,
12002                Self::TARGET_TYPE_FIELD,
12003                Self::TARGET_TYPE_ONEOF,
12004                Self::TARGET_TYPE_ENUM,
12005                Self::TARGET_TYPE_ENUM_ENTRY,
12006                Self::TARGET_TYPE_SERVICE,
12007                Self::TARGET_TYPE_METHOD,
12008            ]
12009        }
12010    }
12011    #[derive(Clone, PartialEq, Default)]
12012    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
12013    #[cfg_attr(feature = "json", serde(default))]
12014    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12015    pub struct EditionDefault {
12016        /// Field 3: `edition`
12017        #[cfg_attr(
12018            feature = "json",
12019            serde(
12020                rename = "edition",
12021                with = "::buffa::json_helpers::opt_closed_enum",
12022                skip_serializing_if = "::core::option::Option::is_none"
12023            )
12024        )]
12025        pub edition: ::core::option::Option<super::Edition>,
12026        /// Textproto value.
12027        ///
12028        /// Field 2: `value`
12029        #[cfg_attr(
12030            feature = "json",
12031            serde(
12032                rename = "value",
12033                skip_serializing_if = "::core::option::Option::is_none"
12034            )
12035        )]
12036        pub value: ::core::option::Option<::buffa::alloc::string::String>,
12037        #[cfg_attr(feature = "json", serde(skip))]
12038        #[doc(hidden)]
12039        pub __buffa_unknown_fields: ::buffa::UnknownFields,
12040    }
12041    impl ::core::fmt::Debug for EditionDefault {
12042        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12043            f.debug_struct("EditionDefault")
12044                .field("edition", &self.edition)
12045                .field("value", &self.value)
12046                .finish()
12047        }
12048    }
12049    impl EditionDefault {
12050        /// Protobuf type URL for this message, for use with `Any::pack` and
12051        /// `Any::unpack_if`.
12052        ///
12053        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12054        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
12055    }
12056    impl EditionDefault {
12057        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12058        #[inline]
12059        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
12060        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
12061            self.edition = Some(value.into());
12062            self
12063        }
12064        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12065        #[inline]
12066        ///Sets [`Self::value`] to `Some(value)`, consuming and returning `self`.
12067        pub fn with_value(
12068            mut self,
12069            value: impl Into<::buffa::alloc::string::String>,
12070        ) -> Self {
12071            self.value = Some(value.into());
12072            self
12073        }
12074    }
12075    impl ::buffa::DefaultInstance for EditionDefault {
12076        fn default_instance() -> &'static Self {
12077            static VALUE: ::buffa::__private::OnceBox<EditionDefault> = ::buffa::__private::OnceBox::new();
12078            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12079        }
12080    }
12081    impl ::buffa::MessageName for EditionDefault {
12082        const PACKAGE: &'static str = "google.protobuf";
12083        const NAME: &'static str = "FieldOptions.EditionDefault";
12084        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.EditionDefault";
12085        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
12086    }
12087    impl ::buffa::Message for EditionDefault {
12088        /// Returns the total encoded size in bytes.
12089        ///
12090        /// The result is a `u32`; the protobuf specification requires all
12091        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12092        /// compliant message will never overflow this type.
12093        #[allow(clippy::let_and_return)]
12094        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
12095            #[allow(unused_imports)]
12096            use ::buffa::Enumeration as _;
12097            let mut size = 0u32;
12098            if let Some(ref v) = self.value {
12099                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
12100            }
12101            if let Some(ref v) = self.edition {
12102                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
12103            }
12104            size += self.__buffa_unknown_fields.encoded_len() as u32;
12105            size
12106        }
12107        fn write_to(
12108            &self,
12109            _cache: &mut ::buffa::SizeCache,
12110            buf: &mut impl ::buffa::bytes::BufMut,
12111        ) {
12112            #[allow(unused_imports)]
12113            use ::buffa::Enumeration as _;
12114            if let Some(ref v) = self.value {
12115                ::buffa::encoding::Tag::new(
12116                        2u32,
12117                        ::buffa::encoding::WireType::LengthDelimited,
12118                    )
12119                    .encode(buf);
12120                ::buffa::types::encode_string(v, buf);
12121            }
12122            if let Some(ref v) = self.edition {
12123                ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
12124                    .encode(buf);
12125                ::buffa::types::encode_int32(v.to_i32(), buf);
12126            }
12127            self.__buffa_unknown_fields.write_to(buf);
12128        }
12129        fn merge_field(
12130            &mut self,
12131            tag: ::buffa::encoding::Tag,
12132            buf: &mut impl ::buffa::bytes::Buf,
12133            depth: u32,
12134        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12135            #[allow(unused_imports)]
12136            use ::buffa::bytes::Buf as _;
12137            #[allow(unused_imports)]
12138            use ::buffa::Enumeration as _;
12139            match tag.field_number() {
12140                2u32 => {
12141                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12142                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12143                            field_number: 2u32,
12144                            expected: 2u8,
12145                            actual: tag.wire_type() as u8,
12146                        });
12147                    }
12148                    ::buffa::types::merge_string(
12149                        self
12150                            .value
12151                            .get_or_insert_with(::buffa::alloc::string::String::new),
12152                        buf,
12153                    )?;
12154                }
12155                3u32 => {
12156                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12157                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12158                            field_number: 3u32,
12159                            expected: 0u8,
12160                            actual: tag.wire_type() as u8,
12161                        });
12162                    }
12163                    let __raw = ::buffa::types::decode_int32(buf)?;
12164                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
12165                        __raw,
12166                    ) {
12167                        self.edition = ::core::option::Option::Some(__v);
12168                    } else {
12169                        self.__buffa_unknown_fields
12170                            .push(::buffa::UnknownField {
12171                                number: 3u32,
12172                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
12173                            });
12174                    }
12175                }
12176                _ => {
12177                    self.__buffa_unknown_fields
12178                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12179                }
12180            }
12181            ::core::result::Result::Ok(())
12182        }
12183        fn clear(&mut self) {
12184            self.value = ::core::option::Option::None;
12185            self.edition = ::core::option::Option::None;
12186            self.__buffa_unknown_fields.clear();
12187        }
12188    }
12189    impl ::buffa::ExtensionSet for EditionDefault {
12190        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.EditionDefault";
12191        fn unknown_fields(&self) -> &::buffa::UnknownFields {
12192            &self.__buffa_unknown_fields
12193        }
12194        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12195            &mut self.__buffa_unknown_fields
12196        }
12197    }
12198    #[cfg(feature = "text")]
12199    impl ::buffa::text::TextFormat for EditionDefault {
12200        fn encode_text(
12201            &self,
12202            enc: &mut ::buffa::text::TextEncoder<'_>,
12203        ) -> ::core::fmt::Result {
12204            #[allow(unused_imports)]
12205            use ::buffa::Enumeration as _;
12206            if let ::core::option::Option::Some(ref __v) = self.edition {
12207                enc.write_field_name("edition")?;
12208                enc.write_enum_name(__v.proto_name())?;
12209            }
12210            if let ::core::option::Option::Some(ref __v) = self.value {
12211                enc.write_field_name("value")?;
12212                enc.write_string(__v)?;
12213            }
12214            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12215            ::core::result::Result::Ok(())
12216        }
12217        fn merge_text(
12218            &mut self,
12219            dec: &mut ::buffa::text::TextDecoder<'_>,
12220        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12221            #[allow(unused_imports)]
12222            use ::buffa::Enumeration as _;
12223            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12224                match __name {
12225                    "edition" => {
12226                        self.edition = ::core::option::Option::Some(
12227                            dec.read_closed_enum_by_name::<super::Edition>()?,
12228                        );
12229                    }
12230                    "value" => {
12231                        self.value = ::core::option::Option::Some(
12232                            dec.read_string()?.into_owned(),
12233                        );
12234                    }
12235                    _ => dec.skip_value()?,
12236                }
12237            }
12238            ::core::result::Result::Ok(())
12239        }
12240    }
12241    #[cfg(feature = "json")]
12242    impl ::buffa::json_helpers::ProtoElemJson for EditionDefault {
12243        fn serialize_proto_json<S: ::serde::Serializer>(
12244            v: &Self,
12245            s: S,
12246        ) -> ::core::result::Result<S::Ok, S::Error> {
12247            ::serde::Serialize::serialize(v, s)
12248        }
12249        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12250            d: D,
12251        ) -> ::core::result::Result<Self, D::Error> {
12252            <Self as ::serde::Deserialize>::deserialize(d)
12253        }
12254    }
12255    #[cfg(feature = "json")]
12256    #[doc(hidden)]
12257    pub const __EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12258        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
12259        to_json: ::buffa::type_registry::any_to_json::<EditionDefault>,
12260        from_json: ::buffa::type_registry::any_from_json::<EditionDefault>,
12261        is_wkt: false,
12262    };
12263    #[cfg(feature = "text")]
12264    #[doc(hidden)]
12265    pub const __EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12266        type_url: "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault",
12267        text_encode: ::buffa::type_registry::any_encode_text::<EditionDefault>,
12268        text_merge: ::buffa::type_registry::any_merge_text::<EditionDefault>,
12269    };
12270    /// Information about the support window of a feature.
12271    #[derive(Clone, PartialEq, Default)]
12272    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
12273    #[cfg_attr(feature = "json", serde(default))]
12274    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12275    pub struct FeatureSupport {
12276        /// The edition that this feature was first available in.  In editions
12277        /// earlier than this one, the default assigned to EDITION_LEGACY will be
12278        /// used, and proto files will not be able to override it.
12279        ///
12280        /// Field 1: `edition_introduced`
12281        #[cfg_attr(
12282            feature = "json",
12283            serde(
12284                rename = "editionIntroduced",
12285                alias = "edition_introduced",
12286                with = "::buffa::json_helpers::opt_closed_enum",
12287                skip_serializing_if = "::core::option::Option::is_none"
12288            )
12289        )]
12290        pub edition_introduced: ::core::option::Option<super::Edition>,
12291        /// The edition this feature becomes deprecated in.  Using this after this
12292        /// edition may trigger warnings.
12293        ///
12294        /// Field 2: `edition_deprecated`
12295        #[cfg_attr(
12296            feature = "json",
12297            serde(
12298                rename = "editionDeprecated",
12299                alias = "edition_deprecated",
12300                with = "::buffa::json_helpers::opt_closed_enum",
12301                skip_serializing_if = "::core::option::Option::is_none"
12302            )
12303        )]
12304        pub edition_deprecated: ::core::option::Option<super::Edition>,
12305        /// The deprecation warning text if this feature is used after the edition it
12306        /// was marked deprecated in.
12307        ///
12308        /// Field 3: `deprecation_warning`
12309        #[cfg_attr(
12310            feature = "json",
12311            serde(
12312                rename = "deprecationWarning",
12313                alias = "deprecation_warning",
12314                skip_serializing_if = "::core::option::Option::is_none"
12315            )
12316        )]
12317        pub deprecation_warning: ::core::option::Option<::buffa::alloc::string::String>,
12318        /// The edition this feature is no longer available in.  In editions after
12319        /// this one, the last default assigned will be used, and proto files will
12320        /// not be able to override it.
12321        ///
12322        /// Field 4: `edition_removed`
12323        #[cfg_attr(
12324            feature = "json",
12325            serde(
12326                rename = "editionRemoved",
12327                alias = "edition_removed",
12328                with = "::buffa::json_helpers::opt_closed_enum",
12329                skip_serializing_if = "::core::option::Option::is_none"
12330            )
12331        )]
12332        pub edition_removed: ::core::option::Option<super::Edition>,
12333        #[cfg_attr(feature = "json", serde(skip))]
12334        #[doc(hidden)]
12335        pub __buffa_unknown_fields: ::buffa::UnknownFields,
12336    }
12337    impl ::core::fmt::Debug for FeatureSupport {
12338        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12339            f.debug_struct("FeatureSupport")
12340                .field("edition_introduced", &self.edition_introduced)
12341                .field("edition_deprecated", &self.edition_deprecated)
12342                .field("deprecation_warning", &self.deprecation_warning)
12343                .field("edition_removed", &self.edition_removed)
12344                .finish()
12345        }
12346    }
12347    impl FeatureSupport {
12348        /// Protobuf type URL for this message, for use with `Any::pack` and
12349        /// `Any::unpack_if`.
12350        ///
12351        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12352        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
12353    }
12354    impl FeatureSupport {
12355        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12356        #[inline]
12357        ///Sets [`Self::edition_introduced`] to `Some(value)`, consuming and returning `self`.
12358        pub fn with_edition_introduced(
12359            mut self,
12360            value: impl Into<super::Edition>,
12361        ) -> Self {
12362            self.edition_introduced = Some(value.into());
12363            self
12364        }
12365        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12366        #[inline]
12367        ///Sets [`Self::edition_deprecated`] to `Some(value)`, consuming and returning `self`.
12368        pub fn with_edition_deprecated(
12369            mut self,
12370            value: impl Into<super::Edition>,
12371        ) -> Self {
12372            self.edition_deprecated = Some(value.into());
12373            self
12374        }
12375        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12376        #[inline]
12377        ///Sets [`Self::deprecation_warning`] to `Some(value)`, consuming and returning `self`.
12378        pub fn with_deprecation_warning(
12379            mut self,
12380            value: impl Into<::buffa::alloc::string::String>,
12381        ) -> Self {
12382            self.deprecation_warning = Some(value.into());
12383            self
12384        }
12385        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
12386        #[inline]
12387        ///Sets [`Self::edition_removed`] to `Some(value)`, consuming and returning `self`.
12388        pub fn with_edition_removed(mut self, value: impl Into<super::Edition>) -> Self {
12389            self.edition_removed = Some(value.into());
12390            self
12391        }
12392    }
12393    impl ::buffa::DefaultInstance for FeatureSupport {
12394        fn default_instance() -> &'static Self {
12395            static VALUE: ::buffa::__private::OnceBox<FeatureSupport> = ::buffa::__private::OnceBox::new();
12396            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12397        }
12398    }
12399    impl ::buffa::MessageName for FeatureSupport {
12400        const PACKAGE: &'static str = "google.protobuf";
12401        const NAME: &'static str = "FieldOptions.FeatureSupport";
12402        const FULL_NAME: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
12403        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
12404    }
12405    impl ::buffa::Message for FeatureSupport {
12406        /// Returns the total encoded size in bytes.
12407        ///
12408        /// The result is a `u32`; the protobuf specification requires all
12409        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12410        /// compliant message will never overflow this type.
12411        #[allow(clippy::let_and_return)]
12412        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
12413            #[allow(unused_imports)]
12414            use ::buffa::Enumeration as _;
12415            let mut size = 0u32;
12416            if let Some(ref v) = self.edition_introduced {
12417                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
12418            }
12419            if let Some(ref v) = self.edition_deprecated {
12420                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
12421            }
12422            if let Some(ref v) = self.deprecation_warning {
12423                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
12424            }
12425            if let Some(ref v) = self.edition_removed {
12426                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
12427            }
12428            size += self.__buffa_unknown_fields.encoded_len() as u32;
12429            size
12430        }
12431        fn write_to(
12432            &self,
12433            _cache: &mut ::buffa::SizeCache,
12434            buf: &mut impl ::buffa::bytes::BufMut,
12435        ) {
12436            #[allow(unused_imports)]
12437            use ::buffa::Enumeration as _;
12438            if let Some(ref v) = self.edition_introduced {
12439                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
12440                    .encode(buf);
12441                ::buffa::types::encode_int32(v.to_i32(), buf);
12442            }
12443            if let Some(ref v) = self.edition_deprecated {
12444                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
12445                    .encode(buf);
12446                ::buffa::types::encode_int32(v.to_i32(), buf);
12447            }
12448            if let Some(ref v) = self.deprecation_warning {
12449                ::buffa::encoding::Tag::new(
12450                        3u32,
12451                        ::buffa::encoding::WireType::LengthDelimited,
12452                    )
12453                    .encode(buf);
12454                ::buffa::types::encode_string(v, buf);
12455            }
12456            if let Some(ref v) = self.edition_removed {
12457                ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
12458                    .encode(buf);
12459                ::buffa::types::encode_int32(v.to_i32(), buf);
12460            }
12461            self.__buffa_unknown_fields.write_to(buf);
12462        }
12463        fn merge_field(
12464            &mut self,
12465            tag: ::buffa::encoding::Tag,
12466            buf: &mut impl ::buffa::bytes::Buf,
12467            depth: u32,
12468        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12469            #[allow(unused_imports)]
12470            use ::buffa::bytes::Buf as _;
12471            #[allow(unused_imports)]
12472            use ::buffa::Enumeration as _;
12473            match tag.field_number() {
12474                1u32 => {
12475                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12476                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12477                            field_number: 1u32,
12478                            expected: 0u8,
12479                            actual: tag.wire_type() as u8,
12480                        });
12481                    }
12482                    let __raw = ::buffa::types::decode_int32(buf)?;
12483                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
12484                        __raw,
12485                    ) {
12486                        self.edition_introduced = ::core::option::Option::Some(__v);
12487                    } else {
12488                        self.__buffa_unknown_fields
12489                            .push(::buffa::UnknownField {
12490                                number: 1u32,
12491                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
12492                            });
12493                    }
12494                }
12495                2u32 => {
12496                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12497                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12498                            field_number: 2u32,
12499                            expected: 0u8,
12500                            actual: tag.wire_type() as u8,
12501                        });
12502                    }
12503                    let __raw = ::buffa::types::decode_int32(buf)?;
12504                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
12505                        __raw,
12506                    ) {
12507                        self.edition_deprecated = ::core::option::Option::Some(__v);
12508                    } else {
12509                        self.__buffa_unknown_fields
12510                            .push(::buffa::UnknownField {
12511                                number: 2u32,
12512                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
12513                            });
12514                    }
12515                }
12516                3u32 => {
12517                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12518                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12519                            field_number: 3u32,
12520                            expected: 2u8,
12521                            actual: tag.wire_type() as u8,
12522                        });
12523                    }
12524                    ::buffa::types::merge_string(
12525                        self
12526                            .deprecation_warning
12527                            .get_or_insert_with(::buffa::alloc::string::String::new),
12528                        buf,
12529                    )?;
12530                }
12531                4u32 => {
12532                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12533                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12534                            field_number: 4u32,
12535                            expected: 0u8,
12536                            actual: tag.wire_type() as u8,
12537                        });
12538                    }
12539                    let __raw = ::buffa::types::decode_int32(buf)?;
12540                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
12541                        __raw,
12542                    ) {
12543                        self.edition_removed = ::core::option::Option::Some(__v);
12544                    } else {
12545                        self.__buffa_unknown_fields
12546                            .push(::buffa::UnknownField {
12547                                number: 4u32,
12548                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
12549                            });
12550                    }
12551                }
12552                _ => {
12553                    self.__buffa_unknown_fields
12554                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12555                }
12556            }
12557            ::core::result::Result::Ok(())
12558        }
12559        fn clear(&mut self) {
12560            self.edition_introduced = ::core::option::Option::None;
12561            self.edition_deprecated = ::core::option::Option::None;
12562            self.deprecation_warning = ::core::option::Option::None;
12563            self.edition_removed = ::core::option::Option::None;
12564            self.__buffa_unknown_fields.clear();
12565        }
12566    }
12567    impl ::buffa::ExtensionSet for FeatureSupport {
12568        const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
12569        fn unknown_fields(&self) -> &::buffa::UnknownFields {
12570            &self.__buffa_unknown_fields
12571        }
12572        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12573            &mut self.__buffa_unknown_fields
12574        }
12575    }
12576    #[cfg(feature = "text")]
12577    impl ::buffa::text::TextFormat for FeatureSupport {
12578        fn encode_text(
12579            &self,
12580            enc: &mut ::buffa::text::TextEncoder<'_>,
12581        ) -> ::core::fmt::Result {
12582            #[allow(unused_imports)]
12583            use ::buffa::Enumeration as _;
12584            if let ::core::option::Option::Some(ref __v) = self.edition_introduced {
12585                enc.write_field_name("edition_introduced")?;
12586                enc.write_enum_name(__v.proto_name())?;
12587            }
12588            if let ::core::option::Option::Some(ref __v) = self.edition_deprecated {
12589                enc.write_field_name("edition_deprecated")?;
12590                enc.write_enum_name(__v.proto_name())?;
12591            }
12592            if let ::core::option::Option::Some(ref __v) = self.deprecation_warning {
12593                enc.write_field_name("deprecation_warning")?;
12594                enc.write_string(__v)?;
12595            }
12596            if let ::core::option::Option::Some(ref __v) = self.edition_removed {
12597                enc.write_field_name("edition_removed")?;
12598                enc.write_enum_name(__v.proto_name())?;
12599            }
12600            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12601            ::core::result::Result::Ok(())
12602        }
12603        fn merge_text(
12604            &mut self,
12605            dec: &mut ::buffa::text::TextDecoder<'_>,
12606        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12607            #[allow(unused_imports)]
12608            use ::buffa::Enumeration as _;
12609            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12610                match __name {
12611                    "edition_introduced" => {
12612                        self.edition_introduced = ::core::option::Option::Some(
12613                            dec.read_closed_enum_by_name::<super::Edition>()?,
12614                        );
12615                    }
12616                    "edition_deprecated" => {
12617                        self.edition_deprecated = ::core::option::Option::Some(
12618                            dec.read_closed_enum_by_name::<super::Edition>()?,
12619                        );
12620                    }
12621                    "deprecation_warning" => {
12622                        self.deprecation_warning = ::core::option::Option::Some(
12623                            dec.read_string()?.into_owned(),
12624                        );
12625                    }
12626                    "edition_removed" => {
12627                        self.edition_removed = ::core::option::Option::Some(
12628                            dec.read_closed_enum_by_name::<super::Edition>()?,
12629                        );
12630                    }
12631                    _ => dec.skip_value()?,
12632                }
12633            }
12634            ::core::result::Result::Ok(())
12635        }
12636    }
12637    #[cfg(feature = "json")]
12638    impl ::buffa::json_helpers::ProtoElemJson for FeatureSupport {
12639        fn serialize_proto_json<S: ::serde::Serializer>(
12640            v: &Self,
12641            s: S,
12642        ) -> ::core::result::Result<S::Ok, S::Error> {
12643            ::serde::Serialize::serialize(v, s)
12644        }
12645        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12646            d: D,
12647        ) -> ::core::result::Result<Self, D::Error> {
12648            <Self as ::serde::Deserialize>::deserialize(d)
12649        }
12650    }
12651    #[cfg(feature = "json")]
12652    #[doc(hidden)]
12653    pub const __FEATURE_SUPPORT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12654        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12655        to_json: ::buffa::type_registry::any_to_json::<FeatureSupport>,
12656        from_json: ::buffa::type_registry::any_from_json::<FeatureSupport>,
12657        is_wkt: false,
12658    };
12659    #[cfg(feature = "text")]
12660    #[doc(hidden)]
12661    pub const __FEATURE_SUPPORT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
12662        type_url: "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport",
12663        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSupport>,
12664        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSupport>,
12665    };
12666    #[cfg(feature = "views")]
12667    #[doc(inline)]
12668    pub use super::__buffa::view::field_options::EditionDefaultView;
12669    #[cfg(feature = "views")]
12670    #[doc(inline)]
12671    pub use super::__buffa::view::field_options::EditionDefaultOwnedView;
12672    #[cfg(feature = "views")]
12673    #[doc(inline)]
12674    pub use super::__buffa::view::field_options::FeatureSupportView;
12675    #[cfg(feature = "views")]
12676    #[doc(inline)]
12677    pub use super::__buffa::view::field_options::FeatureSupportOwnedView;
12678}
12679#[derive(Clone, PartialEq, Default)]
12680#[cfg_attr(feature = "json", derive(::serde::Serialize))]
12681#[cfg_attr(feature = "json", serde(default))]
12682#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
12683pub struct OneofOptions {
12684    /// Any features defined in the specific edition.
12685    /// WARNING: This field should only be used by protobuf plugins or special
12686    /// cases like the proto compiler. Other uses are discouraged and
12687    /// developers should rely on the protoreflect APIs for their client language.
12688    ///
12689    /// Field 1: `features`
12690    #[cfg_attr(
12691        feature = "json",
12692        serde(
12693            rename = "features",
12694            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
12695        )
12696    )]
12697    pub features: ::buffa::MessageField<FeatureSet>,
12698    /// The parser stores options it doesn't recognize here. See above.
12699    ///
12700    /// Field 999: `uninterpreted_option`
12701    #[cfg_attr(
12702        feature = "json",
12703        serde(
12704            rename = "uninterpretedOption",
12705            alias = "uninterpreted_option",
12706            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12707            deserialize_with = "::buffa::json_helpers::null_as_default"
12708        )
12709    )]
12710    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
12711    #[cfg_attr(feature = "json", serde(flatten))]
12712    #[doc(hidden)]
12713    pub __buffa_unknown_fields: __OneofOptionsExtJson,
12714}
12715impl ::core::fmt::Debug for OneofOptions {
12716    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12717        f.debug_struct("OneofOptions")
12718            .field("features", &self.features)
12719            .field("uninterpreted_option", &self.uninterpreted_option)
12720            .finish()
12721    }
12722}
12723impl OneofOptions {
12724    /// Protobuf type URL for this message, for use with `Any::pack` and
12725    /// `Any::unpack_if`.
12726    ///
12727    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12728    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12729}
12730impl ::buffa::DefaultInstance for OneofOptions {
12731    fn default_instance() -> &'static Self {
12732        static VALUE: ::buffa::__private::OnceBox<OneofOptions> = ::buffa::__private::OnceBox::new();
12733        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12734    }
12735}
12736impl ::buffa::MessageName for OneofOptions {
12737    const PACKAGE: &'static str = "google.protobuf";
12738    const NAME: &'static str = "OneofOptions";
12739    const FULL_NAME: &'static str = "google.protobuf.OneofOptions";
12740    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
12741}
12742impl ::buffa::Message for OneofOptions {
12743    /// Returns the total encoded size in bytes.
12744    ///
12745    /// The result is a `u32`; the protobuf specification requires all
12746    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12747    /// compliant message will never overflow this type.
12748    #[allow(clippy::let_and_return)]
12749    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12750        #[allow(unused_imports)]
12751        use ::buffa::Enumeration as _;
12752        let mut size = 0u32;
12753        if self.features.is_set() {
12754            let __slot = __cache.reserve();
12755            let inner_size = self.features.compute_size(__cache);
12756            __cache.set(__slot, inner_size);
12757            size
12758                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12759                    + inner_size;
12760        }
12761        for v in &self.uninterpreted_option {
12762            let __slot = __cache.reserve();
12763            let inner_size = v.compute_size(__cache);
12764            __cache.set(__slot, inner_size);
12765            size
12766                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12767                    + inner_size;
12768        }
12769        size += self.__buffa_unknown_fields.encoded_len() as u32;
12770        size
12771    }
12772    fn write_to(
12773        &self,
12774        __cache: &mut ::buffa::SizeCache,
12775        buf: &mut impl ::buffa::bytes::BufMut,
12776    ) {
12777        #[allow(unused_imports)]
12778        use ::buffa::Enumeration as _;
12779        if self.features.is_set() {
12780            ::buffa::encoding::Tag::new(
12781                    1u32,
12782                    ::buffa::encoding::WireType::LengthDelimited,
12783                )
12784                .encode(buf);
12785            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
12786            self.features.write_to(__cache, buf);
12787        }
12788        for v in &self.uninterpreted_option {
12789            ::buffa::encoding::Tag::new(
12790                    999u32,
12791                    ::buffa::encoding::WireType::LengthDelimited,
12792                )
12793                .encode(buf);
12794            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
12795            v.write_to(__cache, buf);
12796        }
12797        self.__buffa_unknown_fields.write_to(buf);
12798    }
12799    fn merge_field(
12800        &mut self,
12801        tag: ::buffa::encoding::Tag,
12802        buf: &mut impl ::buffa::bytes::Buf,
12803        depth: u32,
12804    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12805        #[allow(unused_imports)]
12806        use ::buffa::bytes::Buf as _;
12807        #[allow(unused_imports)]
12808        use ::buffa::Enumeration as _;
12809        match tag.field_number() {
12810            1u32 => {
12811                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12812                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12813                        field_number: 1u32,
12814                        expected: 2u8,
12815                        actual: tag.wire_type() as u8,
12816                    });
12817                }
12818                ::buffa::Message::merge_length_delimited(
12819                    self.features.get_or_insert_default(),
12820                    buf,
12821                    depth,
12822                )?;
12823            }
12824            999u32 => {
12825                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12826                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12827                        field_number: 999u32,
12828                        expected: 2u8,
12829                        actual: tag.wire_type() as u8,
12830                    });
12831                }
12832                let mut elem = ::core::default::Default::default();
12833                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
12834                self.uninterpreted_option.push(elem);
12835            }
12836            _ => {
12837                self.__buffa_unknown_fields
12838                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12839            }
12840        }
12841        ::core::result::Result::Ok(())
12842    }
12843    fn clear(&mut self) {
12844        self.features = ::buffa::MessageField::none();
12845        self.uninterpreted_option.clear();
12846        self.__buffa_unknown_fields.clear();
12847    }
12848}
12849impl ::buffa::ExtensionSet for OneofOptions {
12850    const PROTO_FQN: &'static str = "google.protobuf.OneofOptions";
12851    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12852        &self.__buffa_unknown_fields
12853    }
12854    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12855        &mut self.__buffa_unknown_fields
12856    }
12857}
12858#[cfg(feature = "text")]
12859impl ::buffa::text::TextFormat for OneofOptions {
12860    fn encode_text(
12861        &self,
12862        enc: &mut ::buffa::text::TextEncoder<'_>,
12863    ) -> ::core::fmt::Result {
12864        #[allow(unused_imports)]
12865        use ::buffa::Enumeration as _;
12866        if self.features.is_set() {
12867            enc.write_field_name("features")?;
12868            enc.write_message(&*self.features)?;
12869        }
12870        for __v in &self.uninterpreted_option {
12871            enc.write_field_name("uninterpreted_option")?;
12872            enc.write_message(__v)?;
12873        }
12874        enc.write_extension_fields(
12875            "google.protobuf.OneofOptions",
12876            &self.__buffa_unknown_fields,
12877        )?;
12878        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
12879        ::core::result::Result::Ok(())
12880    }
12881    fn merge_text(
12882        &mut self,
12883        dec: &mut ::buffa::text::TextDecoder<'_>,
12884    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
12885        #[allow(unused_imports)]
12886        use ::buffa::Enumeration as _;
12887        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
12888            match __name {
12889                "features" => dec.merge_message(self.features.get_or_insert_default())?,
12890                "uninterpreted_option" => {
12891                    dec.read_repeated_into(
12892                        &mut self.uninterpreted_option,
12893                        |__d| {
12894                            let mut __m = ::core::default::Default::default();
12895                            __d.merge_message(&mut __m)?;
12896                            ::core::result::Result::Ok(__m)
12897                        },
12898                    )?
12899                }
12900                __name if __name.starts_with('[') => {
12901                    for __r in dec
12902                        .read_extension(__name, "google.protobuf.OneofOptions")?
12903                    {
12904                        self.__buffa_unknown_fields.push(__r);
12905                    }
12906                }
12907                _ => dec.skip_value()?,
12908            }
12909        }
12910        ::core::result::Result::Ok(())
12911    }
12912}
12913#[cfg(feature = "json")]
12914impl<'de> serde::Deserialize<'de> for OneofOptions {
12915    fn deserialize<D: serde::Deserializer<'de>>(
12916        d: D,
12917    ) -> ::core::result::Result<Self, D::Error> {
12918        struct _V;
12919        impl<'de> serde::de::Visitor<'de> for _V {
12920            type Value = OneofOptions;
12921            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12922                f.write_str("struct OneofOptions")
12923            }
12924            #[allow(clippy::field_reassign_with_default)]
12925            fn visit_map<A: serde::de::MapAccess<'de>>(
12926                self,
12927                mut map: A,
12928            ) -> ::core::result::Result<OneofOptions, A::Error> {
12929                let mut __f_features: ::core::option::Option<
12930                    ::buffa::MessageField<FeatureSet>,
12931                > = None;
12932                let mut __f_uninterpreted_option: ::core::option::Option<
12933                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
12934                > = None;
12935                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
12936                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
12937                    match key.as_str() {
12938                        "features" => {
12939                            __f_features = Some(
12940                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
12941                            );
12942                        }
12943                        "uninterpretedOption" | "uninterpreted_option" => {
12944                            __f_uninterpreted_option = Some({
12945                                struct _S;
12946                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
12947                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
12948                                    fn deserialize<D: serde::Deserializer<'de>>(
12949                                        self,
12950                                        d: D,
12951                                    ) -> ::core::result::Result<
12952                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
12953                                        D::Error,
12954                                    > {
12955                                        ::buffa::json_helpers::null_as_default(d)
12956                                    }
12957                                }
12958                                map.next_value_seed(_S)?
12959                            });
12960                        }
12961                        __k if __k.starts_with('[') => {
12962                            let __v: ::buffa::serde_json::Value = map.next_value()?;
12963                            match ::buffa::extension_registry::deserialize_extension_key(
12964                                "google.protobuf.OneofOptions",
12965                                __k,
12966                                __v,
12967                            ) {
12968                                ::core::option::Option::Some(
12969                                    ::core::result::Result::Ok(__recs),
12970                                ) => {
12971                                    for __rec in __recs {
12972                                        __ext_records.push(__rec);
12973                                    }
12974                                }
12975                                ::core::option::Option::Some(
12976                                    ::core::result::Result::Err(__e),
12977                                ) => {
12978                                    return ::core::result::Result::Err(
12979                                        <A::Error as ::serde::de::Error>::custom(__e),
12980                                    );
12981                                }
12982                                ::core::option::Option::None => {}
12983                            }
12984                        }
12985                        _ => {
12986                            map.next_value::<serde::de::IgnoredAny>()?;
12987                        }
12988                    }
12989                }
12990                let mut __r = <OneofOptions as ::core::default::Default>::default();
12991                if let ::core::option::Option::Some(v) = __f_features {
12992                    __r.features = v;
12993                }
12994                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
12995                    __r.uninterpreted_option = v;
12996                }
12997                for __rec in __ext_records {
12998                    __r.__buffa_unknown_fields.push(__rec);
12999                }
13000                Ok(__r)
13001            }
13002        }
13003        d.deserialize_map(_V)
13004    }
13005}
13006#[cfg(feature = "json")]
13007impl ::buffa::json_helpers::ProtoElemJson for OneofOptions {
13008    fn serialize_proto_json<S: ::serde::Serializer>(
13009        v: &Self,
13010        s: S,
13011    ) -> ::core::result::Result<S::Ok, S::Error> {
13012        ::serde::Serialize::serialize(v, s)
13013    }
13014    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13015        d: D,
13016    ) -> ::core::result::Result<Self, D::Error> {
13017        <Self as ::serde::Deserialize>::deserialize(d)
13018    }
13019}
13020#[doc(hidden)]
13021#[derive(Clone, Debug, Default, PartialEq)]
13022#[repr(transparent)]
13023#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13024pub struct __OneofOptionsExtJson(pub ::buffa::UnknownFields);
13025impl ::core::ops::Deref for __OneofOptionsExtJson {
13026    type Target = ::buffa::UnknownFields;
13027    fn deref(&self) -> &::buffa::UnknownFields {
13028        &self.0
13029    }
13030}
13031impl ::core::ops::DerefMut for __OneofOptionsExtJson {
13032    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13033        &mut self.0
13034    }
13035}
13036impl ::core::convert::From<::buffa::UnknownFields> for __OneofOptionsExtJson {
13037    fn from(u: ::buffa::UnknownFields) -> Self {
13038        Self(u)
13039    }
13040}
13041#[cfg(feature = "json")]
13042impl ::serde::Serialize for __OneofOptionsExtJson {
13043    fn serialize<S: ::serde::Serializer>(
13044        &self,
13045        s: S,
13046    ) -> ::core::result::Result<S::Ok, S::Error> {
13047        ::buffa::extension_registry::serialize_extensions(
13048            "google.protobuf.OneofOptions",
13049            &self.0,
13050            s,
13051        )
13052    }
13053}
13054#[cfg(feature = "json")]
13055impl<'de> ::serde::Deserialize<'de> for __OneofOptionsExtJson {
13056    fn deserialize<D: ::serde::Deserializer<'de>>(
13057        d: D,
13058    ) -> ::core::result::Result<Self, D::Error> {
13059        ::buffa::extension_registry::deserialize_extensions(
13060                "google.protobuf.OneofOptions",
13061                d,
13062            )
13063            .map(Self)
13064    }
13065}
13066#[cfg(feature = "json")]
13067#[doc(hidden)]
13068pub const __ONEOF_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13069    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
13070    to_json: ::buffa::type_registry::any_to_json::<OneofOptions>,
13071    from_json: ::buffa::type_registry::any_from_json::<OneofOptions>,
13072    is_wkt: false,
13073};
13074#[cfg(feature = "text")]
13075#[doc(hidden)]
13076pub const __ONEOF_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13077    type_url: "type.googleapis.com/google.protobuf.OneofOptions",
13078    text_encode: ::buffa::type_registry::any_encode_text::<OneofOptions>,
13079    text_merge: ::buffa::type_registry::any_merge_text::<OneofOptions>,
13080};
13081#[derive(Clone, PartialEq, Default)]
13082#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13083#[cfg_attr(feature = "json", serde(default))]
13084#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13085pub struct EnumOptions {
13086    /// Set this option to true to allow mapping different tag names to the same
13087    /// value.
13088    ///
13089    /// Field 2: `allow_alias`
13090    #[cfg_attr(
13091        feature = "json",
13092        serde(
13093            rename = "allowAlias",
13094            alias = "allow_alias",
13095            skip_serializing_if = "::core::option::Option::is_none"
13096        )
13097    )]
13098    pub allow_alias: ::core::option::Option<bool>,
13099    /// Is this enum deprecated?
13100    /// Depending on the target platform, this can emit Deprecated annotations
13101    /// for the enum, or it will be completely ignored; in the very least, this
13102    /// is a formalization for deprecating enums.
13103    ///
13104    /// Field 3: `deprecated`
13105    #[cfg_attr(
13106        feature = "json",
13107        serde(
13108            rename = "deprecated",
13109            skip_serializing_if = "::core::option::Option::is_none"
13110        )
13111    )]
13112    pub deprecated: ::core::option::Option<bool>,
13113    /// Enable the legacy handling of JSON field name conflicts.  This lowercases
13114    /// and strips underscored from the fields before comparison in proto3 only.
13115    /// The new behavior takes `json_name` into account and applies to proto2 as
13116    /// well.
13117    /// TODO Remove this legacy behavior once downstream teams have
13118    /// had time to migrate.
13119    ///
13120    /// Field 6: `deprecated_legacy_json_field_conflicts`
13121    #[cfg_attr(
13122        feature = "json",
13123        serde(
13124            rename = "deprecatedLegacyJsonFieldConflicts",
13125            alias = "deprecated_legacy_json_field_conflicts",
13126            skip_serializing_if = "::core::option::Option::is_none"
13127        )
13128    )]
13129    pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
13130    /// Any features defined in the specific edition.
13131    /// WARNING: This field should only be used by protobuf plugins or special
13132    /// cases like the proto compiler. Other uses are discouraged and
13133    /// developers should rely on the protoreflect APIs for their client language.
13134    ///
13135    /// Field 7: `features`
13136    #[cfg_attr(
13137        feature = "json",
13138        serde(
13139            rename = "features",
13140            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13141        )
13142    )]
13143    pub features: ::buffa::MessageField<FeatureSet>,
13144    /// The parser stores options it doesn't recognize here. See above.
13145    ///
13146    /// Field 999: `uninterpreted_option`
13147    #[cfg_attr(
13148        feature = "json",
13149        serde(
13150            rename = "uninterpretedOption",
13151            alias = "uninterpreted_option",
13152            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13153            deserialize_with = "::buffa::json_helpers::null_as_default"
13154        )
13155    )]
13156    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13157    #[cfg_attr(feature = "json", serde(flatten))]
13158    #[doc(hidden)]
13159    pub __buffa_unknown_fields: __EnumOptionsExtJson,
13160}
13161impl ::core::fmt::Debug for EnumOptions {
13162    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13163        f.debug_struct("EnumOptions")
13164            .field("allow_alias", &self.allow_alias)
13165            .field("deprecated", &self.deprecated)
13166            .field(
13167                "deprecated_legacy_json_field_conflicts",
13168                &self.deprecated_legacy_json_field_conflicts,
13169            )
13170            .field("features", &self.features)
13171            .field("uninterpreted_option", &self.uninterpreted_option)
13172            .finish()
13173    }
13174}
13175impl EnumOptions {
13176    /// Protobuf type URL for this message, for use with `Any::pack` and
13177    /// `Any::unpack_if`.
13178    ///
13179    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13180    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
13181}
13182impl EnumOptions {
13183    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13184    #[inline]
13185    ///Sets [`Self::allow_alias`] to `Some(value)`, consuming and returning `self`.
13186    pub fn with_allow_alias(mut self, value: bool) -> Self {
13187        self.allow_alias = Some(value);
13188        self
13189    }
13190    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13191    #[inline]
13192    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13193    pub fn with_deprecated(mut self, value: bool) -> Self {
13194        self.deprecated = Some(value);
13195        self
13196    }
13197    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13198    #[inline]
13199    ///Sets [`Self::deprecated_legacy_json_field_conflicts`] to `Some(value)`, consuming and returning `self`.
13200    pub fn with_deprecated_legacy_json_field_conflicts(mut self, value: bool) -> Self {
13201        self.deprecated_legacy_json_field_conflicts = Some(value);
13202        self
13203    }
13204}
13205impl ::buffa::DefaultInstance for EnumOptions {
13206    fn default_instance() -> &'static Self {
13207        static VALUE: ::buffa::__private::OnceBox<EnumOptions> = ::buffa::__private::OnceBox::new();
13208        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13209    }
13210}
13211impl ::buffa::MessageName for EnumOptions {
13212    const PACKAGE: &'static str = "google.protobuf";
13213    const NAME: &'static str = "EnumOptions";
13214    const FULL_NAME: &'static str = "google.protobuf.EnumOptions";
13215    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
13216}
13217impl ::buffa::Message for EnumOptions {
13218    /// Returns the total encoded size in bytes.
13219    ///
13220    /// The result is a `u32`; the protobuf specification requires all
13221    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13222    /// compliant message will never overflow this type.
13223    #[allow(clippy::let_and_return)]
13224    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13225        #[allow(unused_imports)]
13226        use ::buffa::Enumeration as _;
13227        let mut size = 0u32;
13228        if self.allow_alias.is_some() {
13229            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13230        }
13231        if self.deprecated.is_some() {
13232            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13233        }
13234        if self.deprecated_legacy_json_field_conflicts.is_some() {
13235            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13236        }
13237        if self.features.is_set() {
13238            let __slot = __cache.reserve();
13239            let inner_size = self.features.compute_size(__cache);
13240            __cache.set(__slot, inner_size);
13241            size
13242                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13243                    + inner_size;
13244        }
13245        for v in &self.uninterpreted_option {
13246            let __slot = __cache.reserve();
13247            let inner_size = v.compute_size(__cache);
13248            __cache.set(__slot, inner_size);
13249            size
13250                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13251                    + inner_size;
13252        }
13253        size += self.__buffa_unknown_fields.encoded_len() as u32;
13254        size
13255    }
13256    fn write_to(
13257        &self,
13258        __cache: &mut ::buffa::SizeCache,
13259        buf: &mut impl ::buffa::bytes::BufMut,
13260    ) {
13261        #[allow(unused_imports)]
13262        use ::buffa::Enumeration as _;
13263        if let Some(v) = self.allow_alias {
13264            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
13265                .encode(buf);
13266            ::buffa::types::encode_bool(v, buf);
13267        }
13268        if let Some(v) = self.deprecated {
13269            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
13270                .encode(buf);
13271            ::buffa::types::encode_bool(v, buf);
13272        }
13273        if let Some(v) = self.deprecated_legacy_json_field_conflicts {
13274            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
13275                .encode(buf);
13276            ::buffa::types::encode_bool(v, buf);
13277        }
13278        if self.features.is_set() {
13279            ::buffa::encoding::Tag::new(
13280                    7u32,
13281                    ::buffa::encoding::WireType::LengthDelimited,
13282                )
13283                .encode(buf);
13284            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
13285            self.features.write_to(__cache, buf);
13286        }
13287        for v in &self.uninterpreted_option {
13288            ::buffa::encoding::Tag::new(
13289                    999u32,
13290                    ::buffa::encoding::WireType::LengthDelimited,
13291                )
13292                .encode(buf);
13293            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
13294            v.write_to(__cache, buf);
13295        }
13296        self.__buffa_unknown_fields.write_to(buf);
13297    }
13298    fn merge_field(
13299        &mut self,
13300        tag: ::buffa::encoding::Tag,
13301        buf: &mut impl ::buffa::bytes::Buf,
13302        depth: u32,
13303    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13304        #[allow(unused_imports)]
13305        use ::buffa::bytes::Buf as _;
13306        #[allow(unused_imports)]
13307        use ::buffa::Enumeration as _;
13308        match tag.field_number() {
13309            2u32 => {
13310                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13311                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13312                        field_number: 2u32,
13313                        expected: 0u8,
13314                        actual: tag.wire_type() as u8,
13315                    });
13316                }
13317                self.allow_alias = ::core::option::Option::Some(
13318                    ::buffa::types::decode_bool(buf)?,
13319                );
13320            }
13321            3u32 => {
13322                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13323                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13324                        field_number: 3u32,
13325                        expected: 0u8,
13326                        actual: tag.wire_type() as u8,
13327                    });
13328                }
13329                self.deprecated = ::core::option::Option::Some(
13330                    ::buffa::types::decode_bool(buf)?,
13331                );
13332            }
13333            6u32 => {
13334                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13335                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13336                        field_number: 6u32,
13337                        expected: 0u8,
13338                        actual: tag.wire_type() as u8,
13339                    });
13340                }
13341                self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
13342                    ::buffa::types::decode_bool(buf)?,
13343                );
13344            }
13345            7u32 => {
13346                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13347                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13348                        field_number: 7u32,
13349                        expected: 2u8,
13350                        actual: tag.wire_type() as u8,
13351                    });
13352                }
13353                ::buffa::Message::merge_length_delimited(
13354                    self.features.get_or_insert_default(),
13355                    buf,
13356                    depth,
13357                )?;
13358            }
13359            999u32 => {
13360                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13361                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13362                        field_number: 999u32,
13363                        expected: 2u8,
13364                        actual: tag.wire_type() as u8,
13365                    });
13366                }
13367                let mut elem = ::core::default::Default::default();
13368                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
13369                self.uninterpreted_option.push(elem);
13370            }
13371            _ => {
13372                self.__buffa_unknown_fields
13373                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
13374            }
13375        }
13376        ::core::result::Result::Ok(())
13377    }
13378    fn clear(&mut self) {
13379        self.allow_alias = ::core::option::Option::None;
13380        self.deprecated = ::core::option::Option::None;
13381        self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
13382        self.features = ::buffa::MessageField::none();
13383        self.uninterpreted_option.clear();
13384        self.__buffa_unknown_fields.clear();
13385    }
13386}
13387impl ::buffa::ExtensionSet for EnumOptions {
13388    const PROTO_FQN: &'static str = "google.protobuf.EnumOptions";
13389    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13390        &self.__buffa_unknown_fields
13391    }
13392    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13393        &mut self.__buffa_unknown_fields
13394    }
13395}
13396#[cfg(feature = "text")]
13397impl ::buffa::text::TextFormat for EnumOptions {
13398    fn encode_text(
13399        &self,
13400        enc: &mut ::buffa::text::TextEncoder<'_>,
13401    ) -> ::core::fmt::Result {
13402        #[allow(unused_imports)]
13403        use ::buffa::Enumeration as _;
13404        if let ::core::option::Option::Some(ref __v) = self.allow_alias {
13405            enc.write_field_name("allow_alias")?;
13406            enc.write_bool(*__v)?;
13407        }
13408        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13409            enc.write_field_name("deprecated")?;
13410            enc.write_bool(*__v)?;
13411        }
13412        if let ::core::option::Option::Some(ref __v) = self
13413            .deprecated_legacy_json_field_conflicts
13414        {
13415            enc.write_field_name("deprecated_legacy_json_field_conflicts")?;
13416            enc.write_bool(*__v)?;
13417        }
13418        if self.features.is_set() {
13419            enc.write_field_name("features")?;
13420            enc.write_message(&*self.features)?;
13421        }
13422        for __v in &self.uninterpreted_option {
13423            enc.write_field_name("uninterpreted_option")?;
13424            enc.write_message(__v)?;
13425        }
13426        enc.write_extension_fields(
13427            "google.protobuf.EnumOptions",
13428            &self.__buffa_unknown_fields,
13429        )?;
13430        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
13431        ::core::result::Result::Ok(())
13432    }
13433    fn merge_text(
13434        &mut self,
13435        dec: &mut ::buffa::text::TextDecoder<'_>,
13436    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
13437        #[allow(unused_imports)]
13438        use ::buffa::Enumeration as _;
13439        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
13440            match __name {
13441                "allow_alias" => {
13442                    self.allow_alias = ::core::option::Option::Some(dec.read_bool()?);
13443                }
13444                "deprecated" => {
13445                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
13446                }
13447                "deprecated_legacy_json_field_conflicts" => {
13448                    self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
13449                        dec.read_bool()?,
13450                    );
13451                }
13452                "features" => dec.merge_message(self.features.get_or_insert_default())?,
13453                "uninterpreted_option" => {
13454                    dec.read_repeated_into(
13455                        &mut self.uninterpreted_option,
13456                        |__d| {
13457                            let mut __m = ::core::default::Default::default();
13458                            __d.merge_message(&mut __m)?;
13459                            ::core::result::Result::Ok(__m)
13460                        },
13461                    )?
13462                }
13463                __name if __name.starts_with('[') => {
13464                    for __r in dec.read_extension(__name, "google.protobuf.EnumOptions")?
13465                    {
13466                        self.__buffa_unknown_fields.push(__r);
13467                    }
13468                }
13469                _ => dec.skip_value()?,
13470            }
13471        }
13472        ::core::result::Result::Ok(())
13473    }
13474}
13475#[cfg(feature = "json")]
13476impl<'de> serde::Deserialize<'de> for EnumOptions {
13477    fn deserialize<D: serde::Deserializer<'de>>(
13478        d: D,
13479    ) -> ::core::result::Result<Self, D::Error> {
13480        struct _V;
13481        impl<'de> serde::de::Visitor<'de> for _V {
13482            type Value = EnumOptions;
13483            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13484                f.write_str("struct EnumOptions")
13485            }
13486            #[allow(clippy::field_reassign_with_default)]
13487            fn visit_map<A: serde::de::MapAccess<'de>>(
13488                self,
13489                mut map: A,
13490            ) -> ::core::result::Result<EnumOptions, A::Error> {
13491                let mut __f_allow_alias: ::core::option::Option<
13492                    ::core::option::Option<bool>,
13493                > = None;
13494                let mut __f_deprecated: ::core::option::Option<
13495                    ::core::option::Option<bool>,
13496                > = None;
13497                let mut __f_deprecated_legacy_json_field_conflicts: ::core::option::Option<
13498                    ::core::option::Option<bool>,
13499                > = None;
13500                let mut __f_features: ::core::option::Option<
13501                    ::buffa::MessageField<FeatureSet>,
13502                > = None;
13503                let mut __f_uninterpreted_option: ::core::option::Option<
13504                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
13505                > = None;
13506                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
13507                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
13508                    match key.as_str() {
13509                        "allowAlias" | "allow_alias" => {
13510                            __f_allow_alias = Some(
13511                                map.next_value::<::core::option::Option<bool>>()?,
13512                            );
13513                        }
13514                        "deprecated" => {
13515                            __f_deprecated = Some(
13516                                map.next_value::<::core::option::Option<bool>>()?,
13517                            );
13518                        }
13519                        "deprecatedLegacyJsonFieldConflicts"
13520                        | "deprecated_legacy_json_field_conflicts" => {
13521                            __f_deprecated_legacy_json_field_conflicts = Some(
13522                                map.next_value::<::core::option::Option<bool>>()?,
13523                            );
13524                        }
13525                        "features" => {
13526                            __f_features = Some(
13527                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
13528                            );
13529                        }
13530                        "uninterpretedOption" | "uninterpreted_option" => {
13531                            __f_uninterpreted_option = Some({
13532                                struct _S;
13533                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
13534                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
13535                                    fn deserialize<D: serde::Deserializer<'de>>(
13536                                        self,
13537                                        d: D,
13538                                    ) -> ::core::result::Result<
13539                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
13540                                        D::Error,
13541                                    > {
13542                                        ::buffa::json_helpers::null_as_default(d)
13543                                    }
13544                                }
13545                                map.next_value_seed(_S)?
13546                            });
13547                        }
13548                        __k if __k.starts_with('[') => {
13549                            let __v: ::buffa::serde_json::Value = map.next_value()?;
13550                            match ::buffa::extension_registry::deserialize_extension_key(
13551                                "google.protobuf.EnumOptions",
13552                                __k,
13553                                __v,
13554                            ) {
13555                                ::core::option::Option::Some(
13556                                    ::core::result::Result::Ok(__recs),
13557                                ) => {
13558                                    for __rec in __recs {
13559                                        __ext_records.push(__rec);
13560                                    }
13561                                }
13562                                ::core::option::Option::Some(
13563                                    ::core::result::Result::Err(__e),
13564                                ) => {
13565                                    return ::core::result::Result::Err(
13566                                        <A::Error as ::serde::de::Error>::custom(__e),
13567                                    );
13568                                }
13569                                ::core::option::Option::None => {}
13570                            }
13571                        }
13572                        _ => {
13573                            map.next_value::<serde::de::IgnoredAny>()?;
13574                        }
13575                    }
13576                }
13577                let mut __r = <EnumOptions as ::core::default::Default>::default();
13578                if let ::core::option::Option::Some(v) = __f_allow_alias {
13579                    __r.allow_alias = v;
13580                }
13581                if let ::core::option::Option::Some(v) = __f_deprecated {
13582                    __r.deprecated = v;
13583                }
13584                if let ::core::option::Option::Some(v) = __f_deprecated_legacy_json_field_conflicts {
13585                    __r.deprecated_legacy_json_field_conflicts = v;
13586                }
13587                if let ::core::option::Option::Some(v) = __f_features {
13588                    __r.features = v;
13589                }
13590                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
13591                    __r.uninterpreted_option = v;
13592                }
13593                for __rec in __ext_records {
13594                    __r.__buffa_unknown_fields.push(__rec);
13595                }
13596                Ok(__r)
13597            }
13598        }
13599        d.deserialize_map(_V)
13600    }
13601}
13602#[cfg(feature = "json")]
13603impl ::buffa::json_helpers::ProtoElemJson for EnumOptions {
13604    fn serialize_proto_json<S: ::serde::Serializer>(
13605        v: &Self,
13606        s: S,
13607    ) -> ::core::result::Result<S::Ok, S::Error> {
13608        ::serde::Serialize::serialize(v, s)
13609    }
13610    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13611        d: D,
13612    ) -> ::core::result::Result<Self, D::Error> {
13613        <Self as ::serde::Deserialize>::deserialize(d)
13614    }
13615}
13616#[doc(hidden)]
13617#[derive(Clone, Debug, Default, PartialEq)]
13618#[repr(transparent)]
13619#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13620pub struct __EnumOptionsExtJson(pub ::buffa::UnknownFields);
13621impl ::core::ops::Deref for __EnumOptionsExtJson {
13622    type Target = ::buffa::UnknownFields;
13623    fn deref(&self) -> &::buffa::UnknownFields {
13624        &self.0
13625    }
13626}
13627impl ::core::ops::DerefMut for __EnumOptionsExtJson {
13628    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
13629        &mut self.0
13630    }
13631}
13632impl ::core::convert::From<::buffa::UnknownFields> for __EnumOptionsExtJson {
13633    fn from(u: ::buffa::UnknownFields) -> Self {
13634        Self(u)
13635    }
13636}
13637#[cfg(feature = "json")]
13638impl ::serde::Serialize for __EnumOptionsExtJson {
13639    fn serialize<S: ::serde::Serializer>(
13640        &self,
13641        s: S,
13642    ) -> ::core::result::Result<S::Ok, S::Error> {
13643        ::buffa::extension_registry::serialize_extensions(
13644            "google.protobuf.EnumOptions",
13645            &self.0,
13646            s,
13647        )
13648    }
13649}
13650#[cfg(feature = "json")]
13651impl<'de> ::serde::Deserialize<'de> for __EnumOptionsExtJson {
13652    fn deserialize<D: ::serde::Deserializer<'de>>(
13653        d: D,
13654    ) -> ::core::result::Result<Self, D::Error> {
13655        ::buffa::extension_registry::deserialize_extensions(
13656                "google.protobuf.EnumOptions",
13657                d,
13658            )
13659            .map(Self)
13660    }
13661}
13662#[cfg(feature = "json")]
13663#[doc(hidden)]
13664pub const __ENUM_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13665    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13666    to_json: ::buffa::type_registry::any_to_json::<EnumOptions>,
13667    from_json: ::buffa::type_registry::any_from_json::<EnumOptions>,
13668    is_wkt: false,
13669};
13670#[cfg(feature = "text")]
13671#[doc(hidden)]
13672pub const __ENUM_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
13673    type_url: "type.googleapis.com/google.protobuf.EnumOptions",
13674    text_encode: ::buffa::type_registry::any_encode_text::<EnumOptions>,
13675    text_merge: ::buffa::type_registry::any_merge_text::<EnumOptions>,
13676};
13677#[derive(Clone, PartialEq, Default)]
13678#[cfg_attr(feature = "json", derive(::serde::Serialize))]
13679#[cfg_attr(feature = "json", serde(default))]
13680#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
13681pub struct EnumValueOptions {
13682    /// Is this enum value deprecated?
13683    /// Depending on the target platform, this can emit Deprecated annotations
13684    /// for the enum value, or it will be completely ignored; in the very least,
13685    /// this is a formalization for deprecating enum values.
13686    ///
13687    /// Field 1: `deprecated`
13688    #[cfg_attr(
13689        feature = "json",
13690        serde(
13691            rename = "deprecated",
13692            skip_serializing_if = "::core::option::Option::is_none"
13693        )
13694    )]
13695    pub deprecated: ::core::option::Option<bool>,
13696    /// Any features defined in the specific edition.
13697    /// WARNING: This field should only be used by protobuf plugins or special
13698    /// cases like the proto compiler. Other uses are discouraged and
13699    /// developers should rely on the protoreflect APIs for their client language.
13700    ///
13701    /// Field 2: `features`
13702    #[cfg_attr(
13703        feature = "json",
13704        serde(
13705            rename = "features",
13706            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13707        )
13708    )]
13709    pub features: ::buffa::MessageField<FeatureSet>,
13710    /// Indicate that fields annotated with this enum value should not be printed
13711    /// out when using debug formats, e.g. when the field contains sensitive
13712    /// credentials.
13713    ///
13714    /// Field 3: `debug_redact`
13715    #[cfg_attr(
13716        feature = "json",
13717        serde(
13718            rename = "debugRedact",
13719            alias = "debug_redact",
13720            skip_serializing_if = "::core::option::Option::is_none"
13721        )
13722    )]
13723    pub debug_redact: ::core::option::Option<bool>,
13724    /// Information about the support window of a feature value.
13725    ///
13726    /// Field 4: `feature_support`
13727    #[cfg_attr(
13728        feature = "json",
13729        serde(
13730            rename = "featureSupport",
13731            alias = "feature_support",
13732            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13733        )
13734    )]
13735    pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
13736    /// The parser stores options it doesn't recognize here. See above.
13737    ///
13738    /// Field 999: `uninterpreted_option`
13739    #[cfg_attr(
13740        feature = "json",
13741        serde(
13742            rename = "uninterpretedOption",
13743            alias = "uninterpreted_option",
13744            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13745            deserialize_with = "::buffa::json_helpers::null_as_default"
13746        )
13747    )]
13748    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
13749    #[cfg_attr(feature = "json", serde(flatten))]
13750    #[doc(hidden)]
13751    pub __buffa_unknown_fields: __EnumValueOptionsExtJson,
13752}
13753impl ::core::fmt::Debug for EnumValueOptions {
13754    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13755        f.debug_struct("EnumValueOptions")
13756            .field("deprecated", &self.deprecated)
13757            .field("features", &self.features)
13758            .field("debug_redact", &self.debug_redact)
13759            .field("feature_support", &self.feature_support)
13760            .field("uninterpreted_option", &self.uninterpreted_option)
13761            .finish()
13762    }
13763}
13764impl EnumValueOptions {
13765    /// Protobuf type URL for this message, for use with `Any::pack` and
13766    /// `Any::unpack_if`.
13767    ///
13768    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13769    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13770}
13771impl EnumValueOptions {
13772    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13773    #[inline]
13774    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
13775    pub fn with_deprecated(mut self, value: bool) -> Self {
13776        self.deprecated = Some(value);
13777        self
13778    }
13779    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
13780    #[inline]
13781    ///Sets [`Self::debug_redact`] to `Some(value)`, consuming and returning `self`.
13782    pub fn with_debug_redact(mut self, value: bool) -> Self {
13783        self.debug_redact = Some(value);
13784        self
13785    }
13786}
13787impl ::buffa::DefaultInstance for EnumValueOptions {
13788    fn default_instance() -> &'static Self {
13789        static VALUE: ::buffa::__private::OnceBox<EnumValueOptions> = ::buffa::__private::OnceBox::new();
13790        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13791    }
13792}
13793impl ::buffa::MessageName for EnumValueOptions {
13794    const PACKAGE: &'static str = "google.protobuf";
13795    const NAME: &'static str = "EnumValueOptions";
13796    const FULL_NAME: &'static str = "google.protobuf.EnumValueOptions";
13797    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
13798}
13799impl ::buffa::Message for EnumValueOptions {
13800    /// Returns the total encoded size in bytes.
13801    ///
13802    /// The result is a `u32`; the protobuf specification requires all
13803    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13804    /// compliant message will never overflow this type.
13805    #[allow(clippy::let_and_return)]
13806    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13807        #[allow(unused_imports)]
13808        use ::buffa::Enumeration as _;
13809        let mut size = 0u32;
13810        if self.deprecated.is_some() {
13811            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13812        }
13813        if self.features.is_set() {
13814            let __slot = __cache.reserve();
13815            let inner_size = self.features.compute_size(__cache);
13816            __cache.set(__slot, inner_size);
13817            size
13818                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13819                    + inner_size;
13820        }
13821        if self.debug_redact.is_some() {
13822            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
13823        }
13824        if self.feature_support.is_set() {
13825            let __slot = __cache.reserve();
13826            let inner_size = self.feature_support.compute_size(__cache);
13827            __cache.set(__slot, inner_size);
13828            size
13829                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13830                    + inner_size;
13831        }
13832        for v in &self.uninterpreted_option {
13833            let __slot = __cache.reserve();
13834            let inner_size = v.compute_size(__cache);
13835            __cache.set(__slot, inner_size);
13836            size
13837                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13838                    + inner_size;
13839        }
13840        size += self.__buffa_unknown_fields.encoded_len() as u32;
13841        size
13842    }
13843    fn write_to(
13844        &self,
13845        __cache: &mut ::buffa::SizeCache,
13846        buf: &mut impl ::buffa::bytes::BufMut,
13847    ) {
13848        #[allow(unused_imports)]
13849        use ::buffa::Enumeration as _;
13850        if let Some(v) = self.deprecated {
13851            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
13852                .encode(buf);
13853            ::buffa::types::encode_bool(v, buf);
13854        }
13855        if self.features.is_set() {
13856            ::buffa::encoding::Tag::new(
13857                    2u32,
13858                    ::buffa::encoding::WireType::LengthDelimited,
13859                )
13860                .encode(buf);
13861            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
13862            self.features.write_to(__cache, buf);
13863        }
13864        if let Some(v) = self.debug_redact {
13865            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
13866                .encode(buf);
13867            ::buffa::types::encode_bool(v, buf);
13868        }
13869        if self.feature_support.is_set() {
13870            ::buffa::encoding::Tag::new(
13871                    4u32,
13872                    ::buffa::encoding::WireType::LengthDelimited,
13873                )
13874                .encode(buf);
13875            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
13876            self.feature_support.write_to(__cache, buf);
13877        }
13878        for v in &self.uninterpreted_option {
13879            ::buffa::encoding::Tag::new(
13880                    999u32,
13881                    ::buffa::encoding::WireType::LengthDelimited,
13882                )
13883                .encode(buf);
13884            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
13885            v.write_to(__cache, buf);
13886        }
13887        self.__buffa_unknown_fields.write_to(buf);
13888    }
13889    fn merge_field(
13890        &mut self,
13891        tag: ::buffa::encoding::Tag,
13892        buf: &mut impl ::buffa::bytes::Buf,
13893        depth: u32,
13894    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13895        #[allow(unused_imports)]
13896        use ::buffa::bytes::Buf as _;
13897        #[allow(unused_imports)]
13898        use ::buffa::Enumeration as _;
13899        match tag.field_number() {
13900            1u32 => {
13901                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13902                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13903                        field_number: 1u32,
13904                        expected: 0u8,
13905                        actual: tag.wire_type() as u8,
13906                    });
13907                }
13908                self.deprecated = ::core::option::Option::Some(
13909                    ::buffa::types::decode_bool(buf)?,
13910                );
13911            }
13912            2u32 => {
13913                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13914                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13915                        field_number: 2u32,
13916                        expected: 2u8,
13917                        actual: tag.wire_type() as u8,
13918                    });
13919                }
13920                ::buffa::Message::merge_length_delimited(
13921                    self.features.get_or_insert_default(),
13922                    buf,
13923                    depth,
13924                )?;
13925            }
13926            3u32 => {
13927                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13928                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13929                        field_number: 3u32,
13930                        expected: 0u8,
13931                        actual: tag.wire_type() as u8,
13932                    });
13933                }
13934                self.debug_redact = ::core::option::Option::Some(
13935                    ::buffa::types::decode_bool(buf)?,
13936                );
13937            }
13938            4u32 => {
13939                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13940                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13941                        field_number: 4u32,
13942                        expected: 2u8,
13943                        actual: tag.wire_type() as u8,
13944                    });
13945                }
13946                ::buffa::Message::merge_length_delimited(
13947                    self.feature_support.get_or_insert_default(),
13948                    buf,
13949                    depth,
13950                )?;
13951            }
13952            999u32 => {
13953                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13954                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13955                        field_number: 999u32,
13956                        expected: 2u8,
13957                        actual: tag.wire_type() as u8,
13958                    });
13959                }
13960                let mut elem = ::core::default::Default::default();
13961                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
13962                self.uninterpreted_option.push(elem);
13963            }
13964            _ => {
13965                self.__buffa_unknown_fields
13966                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
13967            }
13968        }
13969        ::core::result::Result::Ok(())
13970    }
13971    fn clear(&mut self) {
13972        self.deprecated = ::core::option::Option::None;
13973        self.features = ::buffa::MessageField::none();
13974        self.debug_redact = ::core::option::Option::None;
13975        self.feature_support = ::buffa::MessageField::none();
13976        self.uninterpreted_option.clear();
13977        self.__buffa_unknown_fields.clear();
13978    }
13979}
13980impl ::buffa::ExtensionSet for EnumValueOptions {
13981    const PROTO_FQN: &'static str = "google.protobuf.EnumValueOptions";
13982    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13983        &self.__buffa_unknown_fields
13984    }
13985    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13986        &mut self.__buffa_unknown_fields
13987    }
13988}
13989#[cfg(feature = "text")]
13990impl ::buffa::text::TextFormat for EnumValueOptions {
13991    fn encode_text(
13992        &self,
13993        enc: &mut ::buffa::text::TextEncoder<'_>,
13994    ) -> ::core::fmt::Result {
13995        #[allow(unused_imports)]
13996        use ::buffa::Enumeration as _;
13997        if let ::core::option::Option::Some(ref __v) = self.deprecated {
13998            enc.write_field_name("deprecated")?;
13999            enc.write_bool(*__v)?;
14000        }
14001        if self.features.is_set() {
14002            enc.write_field_name("features")?;
14003            enc.write_message(&*self.features)?;
14004        }
14005        if let ::core::option::Option::Some(ref __v) = self.debug_redact {
14006            enc.write_field_name("debug_redact")?;
14007            enc.write_bool(*__v)?;
14008        }
14009        if self.feature_support.is_set() {
14010            enc.write_field_name("feature_support")?;
14011            enc.write_message(&*self.feature_support)?;
14012        }
14013        for __v in &self.uninterpreted_option {
14014            enc.write_field_name("uninterpreted_option")?;
14015            enc.write_message(__v)?;
14016        }
14017        enc.write_extension_fields(
14018            "google.protobuf.EnumValueOptions",
14019            &self.__buffa_unknown_fields,
14020        )?;
14021        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14022        ::core::result::Result::Ok(())
14023    }
14024    fn merge_text(
14025        &mut self,
14026        dec: &mut ::buffa::text::TextDecoder<'_>,
14027    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14028        #[allow(unused_imports)]
14029        use ::buffa::Enumeration as _;
14030        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14031            match __name {
14032                "deprecated" => {
14033                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
14034                }
14035                "features" => dec.merge_message(self.features.get_or_insert_default())?,
14036                "debug_redact" => {
14037                    self.debug_redact = ::core::option::Option::Some(dec.read_bool()?);
14038                }
14039                "feature_support" => {
14040                    dec.merge_message(self.feature_support.get_or_insert_default())?
14041                }
14042                "uninterpreted_option" => {
14043                    dec.read_repeated_into(
14044                        &mut self.uninterpreted_option,
14045                        |__d| {
14046                            let mut __m = ::core::default::Default::default();
14047                            __d.merge_message(&mut __m)?;
14048                            ::core::result::Result::Ok(__m)
14049                        },
14050                    )?
14051                }
14052                __name if __name.starts_with('[') => {
14053                    for __r in dec
14054                        .read_extension(__name, "google.protobuf.EnumValueOptions")?
14055                    {
14056                        self.__buffa_unknown_fields.push(__r);
14057                    }
14058                }
14059                _ => dec.skip_value()?,
14060            }
14061        }
14062        ::core::result::Result::Ok(())
14063    }
14064}
14065#[cfg(feature = "json")]
14066impl<'de> serde::Deserialize<'de> for EnumValueOptions {
14067    fn deserialize<D: serde::Deserializer<'de>>(
14068        d: D,
14069    ) -> ::core::result::Result<Self, D::Error> {
14070        struct _V;
14071        impl<'de> serde::de::Visitor<'de> for _V {
14072            type Value = EnumValueOptions;
14073            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14074                f.write_str("struct EnumValueOptions")
14075            }
14076            #[allow(clippy::field_reassign_with_default)]
14077            fn visit_map<A: serde::de::MapAccess<'de>>(
14078                self,
14079                mut map: A,
14080            ) -> ::core::result::Result<EnumValueOptions, A::Error> {
14081                let mut __f_deprecated: ::core::option::Option<
14082                    ::core::option::Option<bool>,
14083                > = None;
14084                let mut __f_features: ::core::option::Option<
14085                    ::buffa::MessageField<FeatureSet>,
14086                > = None;
14087                let mut __f_debug_redact: ::core::option::Option<
14088                    ::core::option::Option<bool>,
14089                > = None;
14090                let mut __f_feature_support: ::core::option::Option<
14091                    ::buffa::MessageField<field_options::FeatureSupport>,
14092                > = None;
14093                let mut __f_uninterpreted_option: ::core::option::Option<
14094                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14095                > = None;
14096                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14097                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14098                    match key.as_str() {
14099                        "deprecated" => {
14100                            __f_deprecated = Some(
14101                                map.next_value::<::core::option::Option<bool>>()?,
14102                            );
14103                        }
14104                        "features" => {
14105                            __f_features = Some(
14106                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
14107                            );
14108                        }
14109                        "debugRedact" | "debug_redact" => {
14110                            __f_debug_redact = Some(
14111                                map.next_value::<::core::option::Option<bool>>()?,
14112                            );
14113                        }
14114                        "featureSupport" | "feature_support" => {
14115                            __f_feature_support = Some(
14116                                map
14117                                    .next_value::<
14118                                        ::buffa::MessageField<field_options::FeatureSupport>,
14119                                    >()?,
14120                            );
14121                        }
14122                        "uninterpretedOption" | "uninterpreted_option" => {
14123                            __f_uninterpreted_option = Some({
14124                                struct _S;
14125                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14126                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14127                                    fn deserialize<D: serde::Deserializer<'de>>(
14128                                        self,
14129                                        d: D,
14130                                    ) -> ::core::result::Result<
14131                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14132                                        D::Error,
14133                                    > {
14134                                        ::buffa::json_helpers::null_as_default(d)
14135                                    }
14136                                }
14137                                map.next_value_seed(_S)?
14138                            });
14139                        }
14140                        __k if __k.starts_with('[') => {
14141                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14142                            match ::buffa::extension_registry::deserialize_extension_key(
14143                                "google.protobuf.EnumValueOptions",
14144                                __k,
14145                                __v,
14146                            ) {
14147                                ::core::option::Option::Some(
14148                                    ::core::result::Result::Ok(__recs),
14149                                ) => {
14150                                    for __rec in __recs {
14151                                        __ext_records.push(__rec);
14152                                    }
14153                                }
14154                                ::core::option::Option::Some(
14155                                    ::core::result::Result::Err(__e),
14156                                ) => {
14157                                    return ::core::result::Result::Err(
14158                                        <A::Error as ::serde::de::Error>::custom(__e),
14159                                    );
14160                                }
14161                                ::core::option::Option::None => {}
14162                            }
14163                        }
14164                        _ => {
14165                            map.next_value::<serde::de::IgnoredAny>()?;
14166                        }
14167                    }
14168                }
14169                let mut __r = <EnumValueOptions as ::core::default::Default>::default();
14170                if let ::core::option::Option::Some(v) = __f_deprecated {
14171                    __r.deprecated = v;
14172                }
14173                if let ::core::option::Option::Some(v) = __f_features {
14174                    __r.features = v;
14175                }
14176                if let ::core::option::Option::Some(v) = __f_debug_redact {
14177                    __r.debug_redact = v;
14178                }
14179                if let ::core::option::Option::Some(v) = __f_feature_support {
14180                    __r.feature_support = v;
14181                }
14182                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14183                    __r.uninterpreted_option = v;
14184                }
14185                for __rec in __ext_records {
14186                    __r.__buffa_unknown_fields.push(__rec);
14187                }
14188                Ok(__r)
14189            }
14190        }
14191        d.deserialize_map(_V)
14192    }
14193}
14194#[cfg(feature = "json")]
14195impl ::buffa::json_helpers::ProtoElemJson for EnumValueOptions {
14196    fn serialize_proto_json<S: ::serde::Serializer>(
14197        v: &Self,
14198        s: S,
14199    ) -> ::core::result::Result<S::Ok, S::Error> {
14200        ::serde::Serialize::serialize(v, s)
14201    }
14202    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14203        d: D,
14204    ) -> ::core::result::Result<Self, D::Error> {
14205        <Self as ::serde::Deserialize>::deserialize(d)
14206    }
14207}
14208#[doc(hidden)]
14209#[derive(Clone, Debug, Default, PartialEq)]
14210#[repr(transparent)]
14211#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14212pub struct __EnumValueOptionsExtJson(pub ::buffa::UnknownFields);
14213impl ::core::ops::Deref for __EnumValueOptionsExtJson {
14214    type Target = ::buffa::UnknownFields;
14215    fn deref(&self) -> &::buffa::UnknownFields {
14216        &self.0
14217    }
14218}
14219impl ::core::ops::DerefMut for __EnumValueOptionsExtJson {
14220    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14221        &mut self.0
14222    }
14223}
14224impl ::core::convert::From<::buffa::UnknownFields> for __EnumValueOptionsExtJson {
14225    fn from(u: ::buffa::UnknownFields) -> Self {
14226        Self(u)
14227    }
14228}
14229#[cfg(feature = "json")]
14230impl ::serde::Serialize for __EnumValueOptionsExtJson {
14231    fn serialize<S: ::serde::Serializer>(
14232        &self,
14233        s: S,
14234    ) -> ::core::result::Result<S::Ok, S::Error> {
14235        ::buffa::extension_registry::serialize_extensions(
14236            "google.protobuf.EnumValueOptions",
14237            &self.0,
14238            s,
14239        )
14240    }
14241}
14242#[cfg(feature = "json")]
14243impl<'de> ::serde::Deserialize<'de> for __EnumValueOptionsExtJson {
14244    fn deserialize<D: ::serde::Deserializer<'de>>(
14245        d: D,
14246    ) -> ::core::result::Result<Self, D::Error> {
14247        ::buffa::extension_registry::deserialize_extensions(
14248                "google.protobuf.EnumValueOptions",
14249                d,
14250            )
14251            .map(Self)
14252    }
14253}
14254#[cfg(feature = "json")]
14255#[doc(hidden)]
14256pub const __ENUM_VALUE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14257    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
14258    to_json: ::buffa::type_registry::any_to_json::<EnumValueOptions>,
14259    from_json: ::buffa::type_registry::any_from_json::<EnumValueOptions>,
14260    is_wkt: false,
14261};
14262#[cfg(feature = "text")]
14263#[doc(hidden)]
14264pub const __ENUM_VALUE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14265    type_url: "type.googleapis.com/google.protobuf.EnumValueOptions",
14266    text_encode: ::buffa::type_registry::any_encode_text::<EnumValueOptions>,
14267    text_merge: ::buffa::type_registry::any_merge_text::<EnumValueOptions>,
14268};
14269#[derive(Clone, PartialEq, Default)]
14270#[cfg_attr(feature = "json", derive(::serde::Serialize))]
14271#[cfg_attr(feature = "json", serde(default))]
14272#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14273pub struct ServiceOptions {
14274    /// Any features defined in the specific edition.
14275    /// WARNING: This field should only be used by protobuf plugins or special
14276    /// cases like the proto compiler. Other uses are discouraged and
14277    /// developers should rely on the protoreflect APIs for their client language.
14278    ///
14279    /// Field 34: `features`
14280    #[cfg_attr(
14281        feature = "json",
14282        serde(
14283            rename = "features",
14284            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
14285        )
14286    )]
14287    pub features: ::buffa::MessageField<FeatureSet>,
14288    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
14289    ///   framework.  We apologize for hoarding these numbers to ourselves, but
14290    ///   we were already using them long before we decided to release Protocol
14291    ///   Buffers.
14292    ///
14293    /// Is this service deprecated?
14294    /// Depending on the target platform, this can emit Deprecated annotations
14295    /// for the service, or it will be completely ignored; in the very least,
14296    /// this is a formalization for deprecating services.
14297    ///
14298    /// Field 33: `deprecated`
14299    #[cfg_attr(
14300        feature = "json",
14301        serde(
14302            rename = "deprecated",
14303            skip_serializing_if = "::core::option::Option::is_none"
14304        )
14305    )]
14306    pub deprecated: ::core::option::Option<bool>,
14307    /// The parser stores options it doesn't recognize here. See above.
14308    ///
14309    /// Field 999: `uninterpreted_option`
14310    #[cfg_attr(
14311        feature = "json",
14312        serde(
14313            rename = "uninterpretedOption",
14314            alias = "uninterpreted_option",
14315            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14316            deserialize_with = "::buffa::json_helpers::null_as_default"
14317        )
14318    )]
14319    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
14320    #[cfg_attr(feature = "json", serde(flatten))]
14321    #[doc(hidden)]
14322    pub __buffa_unknown_fields: __ServiceOptionsExtJson,
14323}
14324impl ::core::fmt::Debug for ServiceOptions {
14325    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14326        f.debug_struct("ServiceOptions")
14327            .field("features", &self.features)
14328            .field("deprecated", &self.deprecated)
14329            .field("uninterpreted_option", &self.uninterpreted_option)
14330            .finish()
14331    }
14332}
14333impl ServiceOptions {
14334    /// Protobuf type URL for this message, for use with `Any::pack` and
14335    /// `Any::unpack_if`.
14336    ///
14337    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14338    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
14339}
14340impl ServiceOptions {
14341    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14342    #[inline]
14343    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
14344    pub fn with_deprecated(mut self, value: bool) -> Self {
14345        self.deprecated = Some(value);
14346        self
14347    }
14348}
14349impl ::buffa::DefaultInstance for ServiceOptions {
14350    fn default_instance() -> &'static Self {
14351        static VALUE: ::buffa::__private::OnceBox<ServiceOptions> = ::buffa::__private::OnceBox::new();
14352        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
14353    }
14354}
14355impl ::buffa::MessageName for ServiceOptions {
14356    const PACKAGE: &'static str = "google.protobuf";
14357    const NAME: &'static str = "ServiceOptions";
14358    const FULL_NAME: &'static str = "google.protobuf.ServiceOptions";
14359    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
14360}
14361impl ::buffa::Message for ServiceOptions {
14362    /// Returns the total encoded size in bytes.
14363    ///
14364    /// The result is a `u32`; the protobuf specification requires all
14365    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
14366    /// compliant message will never overflow this type.
14367    #[allow(clippy::let_and_return)]
14368    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14369        #[allow(unused_imports)]
14370        use ::buffa::Enumeration as _;
14371        let mut size = 0u32;
14372        if self.deprecated.is_some() {
14373            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
14374        }
14375        if self.features.is_set() {
14376            let __slot = __cache.reserve();
14377            let inner_size = self.features.compute_size(__cache);
14378            __cache.set(__slot, inner_size);
14379            size
14380                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14381                    + inner_size;
14382        }
14383        for v in &self.uninterpreted_option {
14384            let __slot = __cache.reserve();
14385            let inner_size = v.compute_size(__cache);
14386            __cache.set(__slot, inner_size);
14387            size
14388                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14389                    + inner_size;
14390        }
14391        size += self.__buffa_unknown_fields.encoded_len() as u32;
14392        size
14393    }
14394    fn write_to(
14395        &self,
14396        __cache: &mut ::buffa::SizeCache,
14397        buf: &mut impl ::buffa::bytes::BufMut,
14398    ) {
14399        #[allow(unused_imports)]
14400        use ::buffa::Enumeration as _;
14401        if let Some(v) = self.deprecated {
14402            ::buffa::encoding::Tag::new(33u32, ::buffa::encoding::WireType::Varint)
14403                .encode(buf);
14404            ::buffa::types::encode_bool(v, buf);
14405        }
14406        if self.features.is_set() {
14407            ::buffa::encoding::Tag::new(
14408                    34u32,
14409                    ::buffa::encoding::WireType::LengthDelimited,
14410                )
14411                .encode(buf);
14412            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
14413            self.features.write_to(__cache, buf);
14414        }
14415        for v in &self.uninterpreted_option {
14416            ::buffa::encoding::Tag::new(
14417                    999u32,
14418                    ::buffa::encoding::WireType::LengthDelimited,
14419                )
14420                .encode(buf);
14421            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
14422            v.write_to(__cache, buf);
14423        }
14424        self.__buffa_unknown_fields.write_to(buf);
14425    }
14426    fn merge_field(
14427        &mut self,
14428        tag: ::buffa::encoding::Tag,
14429        buf: &mut impl ::buffa::bytes::Buf,
14430        depth: u32,
14431    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14432        #[allow(unused_imports)]
14433        use ::buffa::bytes::Buf as _;
14434        #[allow(unused_imports)]
14435        use ::buffa::Enumeration as _;
14436        match tag.field_number() {
14437            33u32 => {
14438                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
14439                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14440                        field_number: 33u32,
14441                        expected: 0u8,
14442                        actual: tag.wire_type() as u8,
14443                    });
14444                }
14445                self.deprecated = ::core::option::Option::Some(
14446                    ::buffa::types::decode_bool(buf)?,
14447                );
14448            }
14449            34u32 => {
14450                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14451                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14452                        field_number: 34u32,
14453                        expected: 2u8,
14454                        actual: tag.wire_type() as u8,
14455                    });
14456                }
14457                ::buffa::Message::merge_length_delimited(
14458                    self.features.get_or_insert_default(),
14459                    buf,
14460                    depth,
14461                )?;
14462            }
14463            999u32 => {
14464                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14465                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14466                        field_number: 999u32,
14467                        expected: 2u8,
14468                        actual: tag.wire_type() as u8,
14469                    });
14470                }
14471                let mut elem = ::core::default::Default::default();
14472                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
14473                self.uninterpreted_option.push(elem);
14474            }
14475            _ => {
14476                self.__buffa_unknown_fields
14477                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
14478            }
14479        }
14480        ::core::result::Result::Ok(())
14481    }
14482    fn clear(&mut self) {
14483        self.deprecated = ::core::option::Option::None;
14484        self.features = ::buffa::MessageField::none();
14485        self.uninterpreted_option.clear();
14486        self.__buffa_unknown_fields.clear();
14487    }
14488}
14489impl ::buffa::ExtensionSet for ServiceOptions {
14490    const PROTO_FQN: &'static str = "google.protobuf.ServiceOptions";
14491    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14492        &self.__buffa_unknown_fields
14493    }
14494    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14495        &mut self.__buffa_unknown_fields
14496    }
14497}
14498#[cfg(feature = "text")]
14499impl ::buffa::text::TextFormat for ServiceOptions {
14500    fn encode_text(
14501        &self,
14502        enc: &mut ::buffa::text::TextEncoder<'_>,
14503    ) -> ::core::fmt::Result {
14504        #[allow(unused_imports)]
14505        use ::buffa::Enumeration as _;
14506        if self.features.is_set() {
14507            enc.write_field_name("features")?;
14508            enc.write_message(&*self.features)?;
14509        }
14510        if let ::core::option::Option::Some(ref __v) = self.deprecated {
14511            enc.write_field_name("deprecated")?;
14512            enc.write_bool(*__v)?;
14513        }
14514        for __v in &self.uninterpreted_option {
14515            enc.write_field_name("uninterpreted_option")?;
14516            enc.write_message(__v)?;
14517        }
14518        enc.write_extension_fields(
14519            "google.protobuf.ServiceOptions",
14520            &self.__buffa_unknown_fields,
14521        )?;
14522        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
14523        ::core::result::Result::Ok(())
14524    }
14525    fn merge_text(
14526        &mut self,
14527        dec: &mut ::buffa::text::TextDecoder<'_>,
14528    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
14529        #[allow(unused_imports)]
14530        use ::buffa::Enumeration as _;
14531        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
14532            match __name {
14533                "features" => dec.merge_message(self.features.get_or_insert_default())?,
14534                "deprecated" => {
14535                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
14536                }
14537                "uninterpreted_option" => {
14538                    dec.read_repeated_into(
14539                        &mut self.uninterpreted_option,
14540                        |__d| {
14541                            let mut __m = ::core::default::Default::default();
14542                            __d.merge_message(&mut __m)?;
14543                            ::core::result::Result::Ok(__m)
14544                        },
14545                    )?
14546                }
14547                __name if __name.starts_with('[') => {
14548                    for __r in dec
14549                        .read_extension(__name, "google.protobuf.ServiceOptions")?
14550                    {
14551                        self.__buffa_unknown_fields.push(__r);
14552                    }
14553                }
14554                _ => dec.skip_value()?,
14555            }
14556        }
14557        ::core::result::Result::Ok(())
14558    }
14559}
14560#[cfg(feature = "json")]
14561impl<'de> serde::Deserialize<'de> for ServiceOptions {
14562    fn deserialize<D: serde::Deserializer<'de>>(
14563        d: D,
14564    ) -> ::core::result::Result<Self, D::Error> {
14565        struct _V;
14566        impl<'de> serde::de::Visitor<'de> for _V {
14567            type Value = ServiceOptions;
14568            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14569                f.write_str("struct ServiceOptions")
14570            }
14571            #[allow(clippy::field_reassign_with_default)]
14572            fn visit_map<A: serde::de::MapAccess<'de>>(
14573                self,
14574                mut map: A,
14575            ) -> ::core::result::Result<ServiceOptions, A::Error> {
14576                let mut __f_features: ::core::option::Option<
14577                    ::buffa::MessageField<FeatureSet>,
14578                > = None;
14579                let mut __f_deprecated: ::core::option::Option<
14580                    ::core::option::Option<bool>,
14581                > = None;
14582                let mut __f_uninterpreted_option: ::core::option::Option<
14583                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
14584                > = None;
14585                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
14586                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
14587                    match key.as_str() {
14588                        "features" => {
14589                            __f_features = Some(
14590                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
14591                            );
14592                        }
14593                        "deprecated" => {
14594                            __f_deprecated = Some(
14595                                map.next_value::<::core::option::Option<bool>>()?,
14596                            );
14597                        }
14598                        "uninterpretedOption" | "uninterpreted_option" => {
14599                            __f_uninterpreted_option = Some({
14600                                struct _S;
14601                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
14602                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
14603                                    fn deserialize<D: serde::Deserializer<'de>>(
14604                                        self,
14605                                        d: D,
14606                                    ) -> ::core::result::Result<
14607                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
14608                                        D::Error,
14609                                    > {
14610                                        ::buffa::json_helpers::null_as_default(d)
14611                                    }
14612                                }
14613                                map.next_value_seed(_S)?
14614                            });
14615                        }
14616                        __k if __k.starts_with('[') => {
14617                            let __v: ::buffa::serde_json::Value = map.next_value()?;
14618                            match ::buffa::extension_registry::deserialize_extension_key(
14619                                "google.protobuf.ServiceOptions",
14620                                __k,
14621                                __v,
14622                            ) {
14623                                ::core::option::Option::Some(
14624                                    ::core::result::Result::Ok(__recs),
14625                                ) => {
14626                                    for __rec in __recs {
14627                                        __ext_records.push(__rec);
14628                                    }
14629                                }
14630                                ::core::option::Option::Some(
14631                                    ::core::result::Result::Err(__e),
14632                                ) => {
14633                                    return ::core::result::Result::Err(
14634                                        <A::Error as ::serde::de::Error>::custom(__e),
14635                                    );
14636                                }
14637                                ::core::option::Option::None => {}
14638                            }
14639                        }
14640                        _ => {
14641                            map.next_value::<serde::de::IgnoredAny>()?;
14642                        }
14643                    }
14644                }
14645                let mut __r = <ServiceOptions as ::core::default::Default>::default();
14646                if let ::core::option::Option::Some(v) = __f_features {
14647                    __r.features = v;
14648                }
14649                if let ::core::option::Option::Some(v) = __f_deprecated {
14650                    __r.deprecated = v;
14651                }
14652                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
14653                    __r.uninterpreted_option = v;
14654                }
14655                for __rec in __ext_records {
14656                    __r.__buffa_unknown_fields.push(__rec);
14657                }
14658                Ok(__r)
14659            }
14660        }
14661        d.deserialize_map(_V)
14662    }
14663}
14664#[cfg(feature = "json")]
14665impl ::buffa::json_helpers::ProtoElemJson for ServiceOptions {
14666    fn serialize_proto_json<S: ::serde::Serializer>(
14667        v: &Self,
14668        s: S,
14669    ) -> ::core::result::Result<S::Ok, S::Error> {
14670        ::serde::Serialize::serialize(v, s)
14671    }
14672    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14673        d: D,
14674    ) -> ::core::result::Result<Self, D::Error> {
14675        <Self as ::serde::Deserialize>::deserialize(d)
14676    }
14677}
14678#[doc(hidden)]
14679#[derive(Clone, Debug, Default, PartialEq)]
14680#[repr(transparent)]
14681#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14682pub struct __ServiceOptionsExtJson(pub ::buffa::UnknownFields);
14683impl ::core::ops::Deref for __ServiceOptionsExtJson {
14684    type Target = ::buffa::UnknownFields;
14685    fn deref(&self) -> &::buffa::UnknownFields {
14686        &self.0
14687    }
14688}
14689impl ::core::ops::DerefMut for __ServiceOptionsExtJson {
14690    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
14691        &mut self.0
14692    }
14693}
14694impl ::core::convert::From<::buffa::UnknownFields> for __ServiceOptionsExtJson {
14695    fn from(u: ::buffa::UnknownFields) -> Self {
14696        Self(u)
14697    }
14698}
14699#[cfg(feature = "json")]
14700impl ::serde::Serialize for __ServiceOptionsExtJson {
14701    fn serialize<S: ::serde::Serializer>(
14702        &self,
14703        s: S,
14704    ) -> ::core::result::Result<S::Ok, S::Error> {
14705        ::buffa::extension_registry::serialize_extensions(
14706            "google.protobuf.ServiceOptions",
14707            &self.0,
14708            s,
14709        )
14710    }
14711}
14712#[cfg(feature = "json")]
14713impl<'de> ::serde::Deserialize<'de> for __ServiceOptionsExtJson {
14714    fn deserialize<D: ::serde::Deserializer<'de>>(
14715        d: D,
14716    ) -> ::core::result::Result<Self, D::Error> {
14717        ::buffa::extension_registry::deserialize_extensions(
14718                "google.protobuf.ServiceOptions",
14719                d,
14720            )
14721            .map(Self)
14722    }
14723}
14724#[cfg(feature = "json")]
14725#[doc(hidden)]
14726pub const __SERVICE_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14727    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14728    to_json: ::buffa::type_registry::any_to_json::<ServiceOptions>,
14729    from_json: ::buffa::type_registry::any_from_json::<ServiceOptions>,
14730    is_wkt: false,
14731};
14732#[cfg(feature = "text")]
14733#[doc(hidden)]
14734pub const __SERVICE_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
14735    type_url: "type.googleapis.com/google.protobuf.ServiceOptions",
14736    text_encode: ::buffa::type_registry::any_encode_text::<ServiceOptions>,
14737    text_merge: ::buffa::type_registry::any_merge_text::<ServiceOptions>,
14738};
14739#[derive(Clone, PartialEq, Default)]
14740#[cfg_attr(feature = "json", derive(::serde::Serialize))]
14741#[cfg_attr(feature = "json", serde(default))]
14742#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
14743pub struct MethodOptions {
14744    /// Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
14745    ///   framework.  We apologize for hoarding these numbers to ourselves, but
14746    ///   we were already using them long before we decided to release Protocol
14747    ///   Buffers.
14748    ///
14749    /// Is this method deprecated?
14750    /// Depending on the target platform, this can emit Deprecated annotations
14751    /// for the method, or it will be completely ignored; in the very least,
14752    /// this is a formalization for deprecating methods.
14753    ///
14754    /// Field 33: `deprecated`
14755    #[cfg_attr(
14756        feature = "json",
14757        serde(
14758            rename = "deprecated",
14759            skip_serializing_if = "::core::option::Option::is_none"
14760        )
14761    )]
14762    pub deprecated: ::core::option::Option<bool>,
14763    /// Field 34: `idempotency_level`
14764    #[cfg_attr(
14765        feature = "json",
14766        serde(
14767            rename = "idempotencyLevel",
14768            alias = "idempotency_level",
14769            with = "::buffa::json_helpers::opt_closed_enum",
14770            skip_serializing_if = "::core::option::Option::is_none"
14771        )
14772    )]
14773    pub idempotency_level: ::core::option::Option<method_options::IdempotencyLevel>,
14774    /// Any features defined in the specific edition.
14775    /// WARNING: This field should only be used by protobuf plugins or special
14776    /// cases like the proto compiler. Other uses are discouraged and
14777    /// developers should rely on the protoreflect APIs for their client language.
14778    ///
14779    /// Field 35: `features`
14780    #[cfg_attr(
14781        feature = "json",
14782        serde(
14783            rename = "features",
14784            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
14785        )
14786    )]
14787    pub features: ::buffa::MessageField<FeatureSet>,
14788    /// The parser stores options it doesn't recognize here. See above.
14789    ///
14790    /// Field 999: `uninterpreted_option`
14791    #[cfg_attr(
14792        feature = "json",
14793        serde(
14794            rename = "uninterpretedOption",
14795            alias = "uninterpreted_option",
14796            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14797            deserialize_with = "::buffa::json_helpers::null_as_default"
14798        )
14799    )]
14800    pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
14801    #[cfg_attr(feature = "json", serde(flatten))]
14802    #[doc(hidden)]
14803    pub __buffa_unknown_fields: __MethodOptionsExtJson,
14804}
14805impl ::core::fmt::Debug for MethodOptions {
14806    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14807        f.debug_struct("MethodOptions")
14808            .field("deprecated", &self.deprecated)
14809            .field("idempotency_level", &self.idempotency_level)
14810            .field("features", &self.features)
14811            .field("uninterpreted_option", &self.uninterpreted_option)
14812            .finish()
14813    }
14814}
14815impl MethodOptions {
14816    /// Protobuf type URL for this message, for use with `Any::pack` and
14817    /// `Any::unpack_if`.
14818    ///
14819    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14820    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14821}
14822impl MethodOptions {
14823    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14824    #[inline]
14825    ///Sets [`Self::deprecated`] to `Some(value)`, consuming and returning `self`.
14826    pub fn with_deprecated(mut self, value: bool) -> Self {
14827        self.deprecated = Some(value);
14828        self
14829    }
14830    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
14831    #[inline]
14832    ///Sets [`Self::idempotency_level`] to `Some(value)`, consuming and returning `self`.
14833    pub fn with_idempotency_level(
14834        mut self,
14835        value: impl Into<method_options::IdempotencyLevel>,
14836    ) -> Self {
14837        self.idempotency_level = Some(value.into());
14838        self
14839    }
14840}
14841impl ::buffa::DefaultInstance for MethodOptions {
14842    fn default_instance() -> &'static Self {
14843        static VALUE: ::buffa::__private::OnceBox<MethodOptions> = ::buffa::__private::OnceBox::new();
14844        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
14845    }
14846}
14847impl ::buffa::MessageName for MethodOptions {
14848    const PACKAGE: &'static str = "google.protobuf";
14849    const NAME: &'static str = "MethodOptions";
14850    const FULL_NAME: &'static str = "google.protobuf.MethodOptions";
14851    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
14852}
14853impl ::buffa::Message for MethodOptions {
14854    /// Returns the total encoded size in bytes.
14855    ///
14856    /// The result is a `u32`; the protobuf specification requires all
14857    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
14858    /// compliant message will never overflow this type.
14859    #[allow(clippy::let_and_return)]
14860    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14861        #[allow(unused_imports)]
14862        use ::buffa::Enumeration as _;
14863        let mut size = 0u32;
14864        if self.deprecated.is_some() {
14865            size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
14866        }
14867        if let Some(ref v) = self.idempotency_level {
14868            size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
14869        }
14870        if self.features.is_set() {
14871            let __slot = __cache.reserve();
14872            let inner_size = self.features.compute_size(__cache);
14873            __cache.set(__slot, inner_size);
14874            size
14875                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14876                    + inner_size;
14877        }
14878        for v in &self.uninterpreted_option {
14879            let __slot = __cache.reserve();
14880            let inner_size = v.compute_size(__cache);
14881            __cache.set(__slot, inner_size);
14882            size
14883                += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14884                    + inner_size;
14885        }
14886        size += self.__buffa_unknown_fields.encoded_len() as u32;
14887        size
14888    }
14889    fn write_to(
14890        &self,
14891        __cache: &mut ::buffa::SizeCache,
14892        buf: &mut impl ::buffa::bytes::BufMut,
14893    ) {
14894        #[allow(unused_imports)]
14895        use ::buffa::Enumeration as _;
14896        if let Some(v) = self.deprecated {
14897            ::buffa::encoding::Tag::new(33u32, ::buffa::encoding::WireType::Varint)
14898                .encode(buf);
14899            ::buffa::types::encode_bool(v, buf);
14900        }
14901        if let Some(ref v) = self.idempotency_level {
14902            ::buffa::encoding::Tag::new(34u32, ::buffa::encoding::WireType::Varint)
14903                .encode(buf);
14904            ::buffa::types::encode_int32(v.to_i32(), buf);
14905        }
14906        if self.features.is_set() {
14907            ::buffa::encoding::Tag::new(
14908                    35u32,
14909                    ::buffa::encoding::WireType::LengthDelimited,
14910                )
14911                .encode(buf);
14912            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
14913            self.features.write_to(__cache, buf);
14914        }
14915        for v in &self.uninterpreted_option {
14916            ::buffa::encoding::Tag::new(
14917                    999u32,
14918                    ::buffa::encoding::WireType::LengthDelimited,
14919                )
14920                .encode(buf);
14921            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
14922            v.write_to(__cache, buf);
14923        }
14924        self.__buffa_unknown_fields.write_to(buf);
14925    }
14926    fn merge_field(
14927        &mut self,
14928        tag: ::buffa::encoding::Tag,
14929        buf: &mut impl ::buffa::bytes::Buf,
14930        depth: u32,
14931    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14932        #[allow(unused_imports)]
14933        use ::buffa::bytes::Buf as _;
14934        #[allow(unused_imports)]
14935        use ::buffa::Enumeration as _;
14936        match tag.field_number() {
14937            33u32 => {
14938                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
14939                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14940                        field_number: 33u32,
14941                        expected: 0u8,
14942                        actual: tag.wire_type() as u8,
14943                    });
14944                }
14945                self.deprecated = ::core::option::Option::Some(
14946                    ::buffa::types::decode_bool(buf)?,
14947                );
14948            }
14949            34u32 => {
14950                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
14951                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14952                        field_number: 34u32,
14953                        expected: 0u8,
14954                        actual: tag.wire_type() as u8,
14955                    });
14956                }
14957                let __raw = ::buffa::types::decode_int32(buf)?;
14958                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
14959                    __raw,
14960                ) {
14961                    self.idempotency_level = ::core::option::Option::Some(__v);
14962                } else {
14963                    self.__buffa_unknown_fields
14964                        .push(::buffa::UnknownField {
14965                            number: 34u32,
14966                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
14967                        });
14968                }
14969            }
14970            35u32 => {
14971                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14972                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14973                        field_number: 35u32,
14974                        expected: 2u8,
14975                        actual: tag.wire_type() as u8,
14976                    });
14977                }
14978                ::buffa::Message::merge_length_delimited(
14979                    self.features.get_or_insert_default(),
14980                    buf,
14981                    depth,
14982                )?;
14983            }
14984            999u32 => {
14985                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14986                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14987                        field_number: 999u32,
14988                        expected: 2u8,
14989                        actual: tag.wire_type() as u8,
14990                    });
14991                }
14992                let mut elem = ::core::default::Default::default();
14993                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
14994                self.uninterpreted_option.push(elem);
14995            }
14996            _ => {
14997                self.__buffa_unknown_fields
14998                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
14999            }
15000        }
15001        ::core::result::Result::Ok(())
15002    }
15003    fn clear(&mut self) {
15004        self.deprecated = ::core::option::Option::None;
15005        self.idempotency_level = ::core::option::Option::None;
15006        self.features = ::buffa::MessageField::none();
15007        self.uninterpreted_option.clear();
15008        self.__buffa_unknown_fields.clear();
15009    }
15010}
15011impl ::buffa::ExtensionSet for MethodOptions {
15012    const PROTO_FQN: &'static str = "google.protobuf.MethodOptions";
15013    fn unknown_fields(&self) -> &::buffa::UnknownFields {
15014        &self.__buffa_unknown_fields
15015    }
15016    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15017        &mut self.__buffa_unknown_fields
15018    }
15019}
15020#[cfg(feature = "text")]
15021impl ::buffa::text::TextFormat for MethodOptions {
15022    fn encode_text(
15023        &self,
15024        enc: &mut ::buffa::text::TextEncoder<'_>,
15025    ) -> ::core::fmt::Result {
15026        #[allow(unused_imports)]
15027        use ::buffa::Enumeration as _;
15028        if let ::core::option::Option::Some(ref __v) = self.deprecated {
15029            enc.write_field_name("deprecated")?;
15030            enc.write_bool(*__v)?;
15031        }
15032        if let ::core::option::Option::Some(ref __v) = self.idempotency_level {
15033            enc.write_field_name("idempotency_level")?;
15034            enc.write_enum_name(__v.proto_name())?;
15035        }
15036        if self.features.is_set() {
15037            enc.write_field_name("features")?;
15038            enc.write_message(&*self.features)?;
15039        }
15040        for __v in &self.uninterpreted_option {
15041            enc.write_field_name("uninterpreted_option")?;
15042            enc.write_message(__v)?;
15043        }
15044        enc.write_extension_fields(
15045            "google.protobuf.MethodOptions",
15046            &self.__buffa_unknown_fields,
15047        )?;
15048        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15049        ::core::result::Result::Ok(())
15050    }
15051    fn merge_text(
15052        &mut self,
15053        dec: &mut ::buffa::text::TextDecoder<'_>,
15054    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15055        #[allow(unused_imports)]
15056        use ::buffa::Enumeration as _;
15057        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15058            match __name {
15059                "deprecated" => {
15060                    self.deprecated = ::core::option::Option::Some(dec.read_bool()?);
15061                }
15062                "idempotency_level" => {
15063                    self.idempotency_level = ::core::option::Option::Some(
15064                        dec
15065                            .read_closed_enum_by_name::<
15066                                method_options::IdempotencyLevel,
15067                            >()?,
15068                    );
15069                }
15070                "features" => dec.merge_message(self.features.get_or_insert_default())?,
15071                "uninterpreted_option" => {
15072                    dec.read_repeated_into(
15073                        &mut self.uninterpreted_option,
15074                        |__d| {
15075                            let mut __m = ::core::default::Default::default();
15076                            __d.merge_message(&mut __m)?;
15077                            ::core::result::Result::Ok(__m)
15078                        },
15079                    )?
15080                }
15081                __name if __name.starts_with('[') => {
15082                    for __r in dec
15083                        .read_extension(__name, "google.protobuf.MethodOptions")?
15084                    {
15085                        self.__buffa_unknown_fields.push(__r);
15086                    }
15087                }
15088                _ => dec.skip_value()?,
15089            }
15090        }
15091        ::core::result::Result::Ok(())
15092    }
15093}
15094#[cfg(feature = "json")]
15095impl<'de> serde::Deserialize<'de> for MethodOptions {
15096    fn deserialize<D: serde::Deserializer<'de>>(
15097        d: D,
15098    ) -> ::core::result::Result<Self, D::Error> {
15099        struct _V;
15100        impl<'de> serde::de::Visitor<'de> for _V {
15101            type Value = MethodOptions;
15102            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15103                f.write_str("struct MethodOptions")
15104            }
15105            #[allow(clippy::field_reassign_with_default)]
15106            fn visit_map<A: serde::de::MapAccess<'de>>(
15107                self,
15108                mut map: A,
15109            ) -> ::core::result::Result<MethodOptions, A::Error> {
15110                let mut __f_deprecated: ::core::option::Option<
15111                    ::core::option::Option<bool>,
15112                > = None;
15113                let mut __f_idempotency_level: ::core::option::Option<
15114                    ::core::option::Option<method_options::IdempotencyLevel>,
15115                > = None;
15116                let mut __f_features: ::core::option::Option<
15117                    ::buffa::MessageField<FeatureSet>,
15118                > = None;
15119                let mut __f_uninterpreted_option: ::core::option::Option<
15120                    ::buffa::alloc::vec::Vec<UninterpretedOption>,
15121                > = None;
15122                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
15123                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
15124                    match key.as_str() {
15125                        "deprecated" => {
15126                            __f_deprecated = Some(
15127                                map.next_value::<::core::option::Option<bool>>()?,
15128                            );
15129                        }
15130                        "idempotencyLevel" | "idempotency_level" => {
15131                            __f_idempotency_level = Some({
15132                                struct _S;
15133                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15134                                    type Value = ::core::option::Option<
15135                                        method_options::IdempotencyLevel,
15136                                    >;
15137                                    fn deserialize<D: serde::Deserializer<'de>>(
15138                                        self,
15139                                        d: D,
15140                                    ) -> ::core::result::Result<
15141                                        ::core::option::Option<method_options::IdempotencyLevel>,
15142                                        D::Error,
15143                                    > {
15144                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
15145                                    }
15146                                }
15147                                map.next_value_seed(_S)?
15148                            });
15149                        }
15150                        "features" => {
15151                            __f_features = Some(
15152                                map.next_value::<::buffa::MessageField<FeatureSet>>()?,
15153                            );
15154                        }
15155                        "uninterpretedOption" | "uninterpreted_option" => {
15156                            __f_uninterpreted_option = Some({
15157                                struct _S;
15158                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
15159                                    type Value = ::buffa::alloc::vec::Vec<UninterpretedOption>;
15160                                    fn deserialize<D: serde::Deserializer<'de>>(
15161                                        self,
15162                                        d: D,
15163                                    ) -> ::core::result::Result<
15164                                        ::buffa::alloc::vec::Vec<UninterpretedOption>,
15165                                        D::Error,
15166                                    > {
15167                                        ::buffa::json_helpers::null_as_default(d)
15168                                    }
15169                                }
15170                                map.next_value_seed(_S)?
15171                            });
15172                        }
15173                        __k if __k.starts_with('[') => {
15174                            let __v: ::buffa::serde_json::Value = map.next_value()?;
15175                            match ::buffa::extension_registry::deserialize_extension_key(
15176                                "google.protobuf.MethodOptions",
15177                                __k,
15178                                __v,
15179                            ) {
15180                                ::core::option::Option::Some(
15181                                    ::core::result::Result::Ok(__recs),
15182                                ) => {
15183                                    for __rec in __recs {
15184                                        __ext_records.push(__rec);
15185                                    }
15186                                }
15187                                ::core::option::Option::Some(
15188                                    ::core::result::Result::Err(__e),
15189                                ) => {
15190                                    return ::core::result::Result::Err(
15191                                        <A::Error as ::serde::de::Error>::custom(__e),
15192                                    );
15193                                }
15194                                ::core::option::Option::None => {}
15195                            }
15196                        }
15197                        _ => {
15198                            map.next_value::<serde::de::IgnoredAny>()?;
15199                        }
15200                    }
15201                }
15202                let mut __r = <MethodOptions as ::core::default::Default>::default();
15203                if let ::core::option::Option::Some(v) = __f_deprecated {
15204                    __r.deprecated = v;
15205                }
15206                if let ::core::option::Option::Some(v) = __f_idempotency_level {
15207                    __r.idempotency_level = v;
15208                }
15209                if let ::core::option::Option::Some(v) = __f_features {
15210                    __r.features = v;
15211                }
15212                if let ::core::option::Option::Some(v) = __f_uninterpreted_option {
15213                    __r.uninterpreted_option = v;
15214                }
15215                for __rec in __ext_records {
15216                    __r.__buffa_unknown_fields.push(__rec);
15217                }
15218                Ok(__r)
15219            }
15220        }
15221        d.deserialize_map(_V)
15222    }
15223}
15224#[cfg(feature = "json")]
15225impl ::buffa::json_helpers::ProtoElemJson for MethodOptions {
15226    fn serialize_proto_json<S: ::serde::Serializer>(
15227        v: &Self,
15228        s: S,
15229    ) -> ::core::result::Result<S::Ok, S::Error> {
15230        ::serde::Serialize::serialize(v, s)
15231    }
15232    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15233        d: D,
15234    ) -> ::core::result::Result<Self, D::Error> {
15235        <Self as ::serde::Deserialize>::deserialize(d)
15236    }
15237}
15238#[doc(hidden)]
15239#[derive(Clone, Debug, Default, PartialEq)]
15240#[repr(transparent)]
15241#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15242pub struct __MethodOptionsExtJson(pub ::buffa::UnknownFields);
15243impl ::core::ops::Deref for __MethodOptionsExtJson {
15244    type Target = ::buffa::UnknownFields;
15245    fn deref(&self) -> &::buffa::UnknownFields {
15246        &self.0
15247    }
15248}
15249impl ::core::ops::DerefMut for __MethodOptionsExtJson {
15250    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
15251        &mut self.0
15252    }
15253}
15254impl ::core::convert::From<::buffa::UnknownFields> for __MethodOptionsExtJson {
15255    fn from(u: ::buffa::UnknownFields) -> Self {
15256        Self(u)
15257    }
15258}
15259#[cfg(feature = "json")]
15260impl ::serde::Serialize for __MethodOptionsExtJson {
15261    fn serialize<S: ::serde::Serializer>(
15262        &self,
15263        s: S,
15264    ) -> ::core::result::Result<S::Ok, S::Error> {
15265        ::buffa::extension_registry::serialize_extensions(
15266            "google.protobuf.MethodOptions",
15267            &self.0,
15268            s,
15269        )
15270    }
15271}
15272#[cfg(feature = "json")]
15273impl<'de> ::serde::Deserialize<'de> for __MethodOptionsExtJson {
15274    fn deserialize<D: ::serde::Deserializer<'de>>(
15275        d: D,
15276    ) -> ::core::result::Result<Self, D::Error> {
15277        ::buffa::extension_registry::deserialize_extensions(
15278                "google.protobuf.MethodOptions",
15279                d,
15280            )
15281            .map(Self)
15282    }
15283}
15284#[cfg(feature = "json")]
15285#[doc(hidden)]
15286pub const __METHOD_OPTIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15287    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
15288    to_json: ::buffa::type_registry::any_to_json::<MethodOptions>,
15289    from_json: ::buffa::type_registry::any_from_json::<MethodOptions>,
15290    is_wkt: false,
15291};
15292#[cfg(feature = "text")]
15293#[doc(hidden)]
15294pub const __METHOD_OPTIONS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15295    type_url: "type.googleapis.com/google.protobuf.MethodOptions",
15296    text_encode: ::buffa::type_registry::any_encode_text::<MethodOptions>,
15297    text_merge: ::buffa::type_registry::any_merge_text::<MethodOptions>,
15298};
15299pub mod method_options {
15300    #[allow(unused_imports)]
15301    use super::*;
15302    /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
15303    /// or neither? HTTP based RPC implementation may choose GET verb for safe
15304    /// methods, and PUT verb for idempotent methods instead of the default POST.
15305    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
15306    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15307    #[repr(i32)]
15308    pub enum IdempotencyLevel {
15309        IDEMPOTENCY_UNKNOWN = 0i32,
15310        /// implies idempotent
15311        NO_SIDE_EFFECTS = 1i32,
15312        /// idempotent, but may have side effects
15313        IDEMPOTENT = 2i32,
15314    }
15315    impl IdempotencyLevel {
15316        ///Idiomatic alias for [`Self::IDEMPOTENCY_UNKNOWN`]; `Debug` prints the variant name.
15317        #[allow(non_upper_case_globals)]
15318        pub const IdempotencyUnknown: Self = Self::IDEMPOTENCY_UNKNOWN;
15319        ///Idiomatic alias for [`Self::NO_SIDE_EFFECTS`]; `Debug` prints the variant name.
15320        #[allow(non_upper_case_globals)]
15321        pub const NoSideEffects: Self = Self::NO_SIDE_EFFECTS;
15322        ///Idiomatic alias for [`Self::IDEMPOTENT`]; `Debug` prints the variant name.
15323        #[allow(non_upper_case_globals)]
15324        pub const Idempotent: Self = Self::IDEMPOTENT;
15325    }
15326    impl ::core::default::Default for IdempotencyLevel {
15327        fn default() -> Self {
15328            Self::IDEMPOTENCY_UNKNOWN
15329        }
15330    }
15331    #[cfg(feature = "json")]
15332    const _: () = {
15333        impl ::serde::Serialize for IdempotencyLevel {
15334            fn serialize<S: ::serde::Serializer>(
15335                &self,
15336                s: S,
15337            ) -> ::core::result::Result<S::Ok, S::Error> {
15338                s.serialize_str(::buffa::Enumeration::proto_name(self))
15339            }
15340        }
15341        impl<'de> ::serde::Deserialize<'de> for IdempotencyLevel {
15342            fn deserialize<D: ::serde::Deserializer<'de>>(
15343                d: D,
15344            ) -> ::core::result::Result<Self, D::Error> {
15345                struct _V;
15346                impl ::serde::de::Visitor<'_> for _V {
15347                    type Value = IdempotencyLevel;
15348                    fn expecting(
15349                        &self,
15350                        f: &mut ::core::fmt::Formatter<'_>,
15351                    ) -> ::core::fmt::Result {
15352                        f.write_str(
15353                            concat!(
15354                                "a string, integer, or null for ",
15355                                stringify!(IdempotencyLevel)
15356                            ),
15357                        )
15358                    }
15359                    fn visit_str<E: ::serde::de::Error>(
15360                        self,
15361                        v: &str,
15362                    ) -> ::core::result::Result<IdempotencyLevel, E> {
15363                        <IdempotencyLevel as ::buffa::Enumeration>::from_proto_name(v)
15364                            .ok_or_else(|| {
15365                                ::serde::de::Error::unknown_variant(v, &[])
15366                            })
15367                    }
15368                    fn visit_i64<E: ::serde::de::Error>(
15369                        self,
15370                        v: i64,
15371                    ) -> ::core::result::Result<IdempotencyLevel, E> {
15372                        let v32 = i32::try_from(v)
15373                            .map_err(|_| {
15374                                ::serde::de::Error::custom(
15375                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
15376                                )
15377                            })?;
15378                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
15379                            .ok_or_else(|| {
15380                                ::serde::de::Error::custom(
15381                                    ::buffa::alloc::format!("unknown enum value {v32}"),
15382                                )
15383                            })
15384                    }
15385                    fn visit_u64<E: ::serde::de::Error>(
15386                        self,
15387                        v: u64,
15388                    ) -> ::core::result::Result<IdempotencyLevel, E> {
15389                        let v32 = i32::try_from(v)
15390                            .map_err(|_| {
15391                                ::serde::de::Error::custom(
15392                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
15393                                )
15394                            })?;
15395                        <IdempotencyLevel as ::buffa::Enumeration>::from_i32(v32)
15396                            .ok_or_else(|| {
15397                                ::serde::de::Error::custom(
15398                                    ::buffa::alloc::format!("unknown enum value {v32}"),
15399                                )
15400                            })
15401                    }
15402                    fn visit_unit<E: ::serde::de::Error>(
15403                        self,
15404                    ) -> ::core::result::Result<IdempotencyLevel, E> {
15405                        ::core::result::Result::Ok(::core::default::Default::default())
15406                    }
15407                }
15408                d.deserialize_any(_V)
15409            }
15410        }
15411        impl ::buffa::json_helpers::ProtoElemJson for IdempotencyLevel {
15412            fn serialize_proto_json<S: ::serde::Serializer>(
15413                v: &Self,
15414                s: S,
15415            ) -> ::core::result::Result<S::Ok, S::Error> {
15416                ::serde::Serialize::serialize(v, s)
15417            }
15418            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15419                d: D,
15420            ) -> ::core::result::Result<Self, D::Error> {
15421                <Self as ::serde::Deserialize>::deserialize(d)
15422            }
15423        }
15424    };
15425    impl ::buffa::Enumeration for IdempotencyLevel {
15426        fn from_i32(value: i32) -> ::core::option::Option<Self> {
15427            match value {
15428                0i32 => ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
15429                1i32 => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
15430                2i32 => ::core::option::Option::Some(Self::IDEMPOTENT),
15431                _ => ::core::option::Option::None,
15432            }
15433        }
15434        fn to_i32(&self) -> i32 {
15435            *self as i32
15436        }
15437        fn proto_name(&self) -> &'static str {
15438            match self {
15439                Self::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN",
15440                Self::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS",
15441                Self::IDEMPOTENT => "IDEMPOTENT",
15442            }
15443        }
15444        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
15445            match name {
15446                "IDEMPOTENCY_UNKNOWN" => {
15447                    ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN)
15448                }
15449                "NO_SIDE_EFFECTS" => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
15450                "IDEMPOTENT" => ::core::option::Option::Some(Self::IDEMPOTENT),
15451                _ => ::core::option::Option::None,
15452            }
15453        }
15454        fn values() -> &'static [Self] {
15455            &[Self::IDEMPOTENCY_UNKNOWN, Self::NO_SIDE_EFFECTS, Self::IDEMPOTENT]
15456        }
15457    }
15458}
15459/// A message representing a option the parser does not recognize. This only
15460/// appears in options protos created by the compiler::Parser class.
15461/// DescriptorPool resolves these when building Descriptor objects. Therefore,
15462/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
15463/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
15464/// in them.
15465#[derive(Clone, PartialEq, Default)]
15466#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
15467#[cfg_attr(feature = "json", serde(default))]
15468#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15469pub struct UninterpretedOption {
15470    /// Field 2: `name`
15471    #[cfg_attr(
15472        feature = "json",
15473        serde(
15474            rename = "name",
15475            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
15476            deserialize_with = "::buffa::json_helpers::null_as_default"
15477        )
15478    )]
15479    pub name: ::buffa::alloc::vec::Vec<uninterpreted_option::NamePart>,
15480    /// The value of the uninterpreted option, in whatever type the tokenizer
15481    /// identified it as during parsing. Exactly one of these should be set.
15482    ///
15483    /// Field 3: `identifier_value`
15484    #[cfg_attr(
15485        feature = "json",
15486        serde(
15487            rename = "identifierValue",
15488            alias = "identifier_value",
15489            skip_serializing_if = "::core::option::Option::is_none"
15490        )
15491    )]
15492    pub identifier_value: ::core::option::Option<::buffa::alloc::string::String>,
15493    /// Field 4: `positive_int_value`
15494    #[cfg_attr(
15495        feature = "json",
15496        serde(
15497            rename = "positiveIntValue",
15498            alias = "positive_int_value",
15499            with = "::buffa::json_helpers::opt_uint64",
15500            skip_serializing_if = "::core::option::Option::is_none"
15501        )
15502    )]
15503    pub positive_int_value: ::core::option::Option<u64>,
15504    /// Field 5: `negative_int_value`
15505    #[cfg_attr(
15506        feature = "json",
15507        serde(
15508            rename = "negativeIntValue",
15509            alias = "negative_int_value",
15510            with = "::buffa::json_helpers::opt_int64",
15511            skip_serializing_if = "::core::option::Option::is_none"
15512        )
15513    )]
15514    pub negative_int_value: ::core::option::Option<i64>,
15515    /// Field 6: `double_value`
15516    #[cfg_attr(
15517        feature = "json",
15518        serde(
15519            rename = "doubleValue",
15520            alias = "double_value",
15521            with = "::buffa::json_helpers::opt_double",
15522            skip_serializing_if = "::core::option::Option::is_none"
15523        )
15524    )]
15525    pub double_value: ::core::option::Option<f64>,
15526    /// Field 7: `string_value`
15527    #[cfg_attr(
15528        feature = "json",
15529        serde(
15530            rename = "stringValue",
15531            alias = "string_value",
15532            with = "::buffa::json_helpers::opt_bytes",
15533            skip_serializing_if = "::core::option::Option::is_none"
15534        )
15535    )]
15536    pub string_value: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
15537    /// Field 8: `aggregate_value`
15538    #[cfg_attr(
15539        feature = "json",
15540        serde(
15541            rename = "aggregateValue",
15542            alias = "aggregate_value",
15543            skip_serializing_if = "::core::option::Option::is_none"
15544        )
15545    )]
15546    pub aggregate_value: ::core::option::Option<::buffa::alloc::string::String>,
15547    #[cfg_attr(feature = "json", serde(skip))]
15548    #[doc(hidden)]
15549    pub __buffa_unknown_fields: ::buffa::UnknownFields,
15550}
15551impl ::core::fmt::Debug for UninterpretedOption {
15552    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
15553        f.debug_struct("UninterpretedOption")
15554            .field("name", &self.name)
15555            .field("identifier_value", &self.identifier_value)
15556            .field("positive_int_value", &self.positive_int_value)
15557            .field("negative_int_value", &self.negative_int_value)
15558            .field("double_value", &self.double_value)
15559            .field("string_value", &self.string_value)
15560            .field("aggregate_value", &self.aggregate_value)
15561            .finish()
15562    }
15563}
15564impl UninterpretedOption {
15565    /// Protobuf type URL for this message, for use with `Any::pack` and
15566    /// `Any::unpack_if`.
15567    ///
15568    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
15569    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
15570}
15571impl UninterpretedOption {
15572    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15573    #[inline]
15574    ///Sets [`Self::identifier_value`] to `Some(value)`, consuming and returning `self`.
15575    pub fn with_identifier_value(
15576        mut self,
15577        value: impl Into<::buffa::alloc::string::String>,
15578    ) -> Self {
15579        self.identifier_value = Some(value.into());
15580        self
15581    }
15582    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15583    #[inline]
15584    ///Sets [`Self::positive_int_value`] to `Some(value)`, consuming and returning `self`.
15585    pub fn with_positive_int_value(mut self, value: u64) -> Self {
15586        self.positive_int_value = Some(value);
15587        self
15588    }
15589    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15590    #[inline]
15591    ///Sets [`Self::negative_int_value`] to `Some(value)`, consuming and returning `self`.
15592    pub fn with_negative_int_value(mut self, value: i64) -> Self {
15593        self.negative_int_value = Some(value);
15594        self
15595    }
15596    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15597    #[inline]
15598    ///Sets [`Self::double_value`] to `Some(value)`, consuming and returning `self`.
15599    pub fn with_double_value(mut self, value: f64) -> Self {
15600        self.double_value = Some(value);
15601        self
15602    }
15603    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15604    #[inline]
15605    ///Sets [`Self::string_value`] to `Some(value)`, consuming and returning `self`.
15606    pub fn with_string_value(
15607        mut self,
15608        value: impl Into<::buffa::alloc::vec::Vec<u8>>,
15609    ) -> Self {
15610        self.string_value = Some(value.into());
15611        self
15612    }
15613    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
15614    #[inline]
15615    ///Sets [`Self::aggregate_value`] to `Some(value)`, consuming and returning `self`.
15616    pub fn with_aggregate_value(
15617        mut self,
15618        value: impl Into<::buffa::alloc::string::String>,
15619    ) -> Self {
15620        self.aggregate_value = Some(value.into());
15621        self
15622    }
15623}
15624impl ::buffa::DefaultInstance for UninterpretedOption {
15625    fn default_instance() -> &'static Self {
15626        static VALUE: ::buffa::__private::OnceBox<UninterpretedOption> = ::buffa::__private::OnceBox::new();
15627        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
15628    }
15629}
15630impl ::buffa::MessageName for UninterpretedOption {
15631    const PACKAGE: &'static str = "google.protobuf";
15632    const NAME: &'static str = "UninterpretedOption";
15633    const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption";
15634    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
15635}
15636impl ::buffa::Message for UninterpretedOption {
15637    /// Returns the total encoded size in bytes.
15638    ///
15639    /// The result is a `u32`; the protobuf specification requires all
15640    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
15641    /// compliant message will never overflow this type.
15642    #[allow(clippy::let_and_return)]
15643    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
15644        #[allow(unused_imports)]
15645        use ::buffa::Enumeration as _;
15646        let mut size = 0u32;
15647        for v in &self.name {
15648            let __slot = __cache.reserve();
15649            let inner_size = v.compute_size(__cache);
15650            __cache.set(__slot, inner_size);
15651            size
15652                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
15653                    + inner_size;
15654        }
15655        if let Some(ref v) = self.identifier_value {
15656            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
15657        }
15658        if let Some(v) = self.positive_int_value {
15659            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
15660        }
15661        if let Some(v) = self.negative_int_value {
15662            size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
15663        }
15664        if self.double_value.is_some() {
15665            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15666        }
15667        if let Some(ref v) = self.string_value {
15668            size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
15669        }
15670        if let Some(ref v) = self.aggregate_value {
15671            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
15672        }
15673        size += self.__buffa_unknown_fields.encoded_len() as u32;
15674        size
15675    }
15676    fn write_to(
15677        &self,
15678        __cache: &mut ::buffa::SizeCache,
15679        buf: &mut impl ::buffa::bytes::BufMut,
15680    ) {
15681        #[allow(unused_imports)]
15682        use ::buffa::Enumeration as _;
15683        for v in &self.name {
15684            ::buffa::encoding::Tag::new(
15685                    2u32,
15686                    ::buffa::encoding::WireType::LengthDelimited,
15687                )
15688                .encode(buf);
15689            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
15690            v.write_to(__cache, buf);
15691        }
15692        if let Some(ref v) = self.identifier_value {
15693            ::buffa::encoding::Tag::new(
15694                    3u32,
15695                    ::buffa::encoding::WireType::LengthDelimited,
15696                )
15697                .encode(buf);
15698            ::buffa::types::encode_string(v, buf);
15699        }
15700        if let Some(v) = self.positive_int_value {
15701            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
15702                .encode(buf);
15703            ::buffa::types::encode_uint64(v, buf);
15704        }
15705        if let Some(v) = self.negative_int_value {
15706            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
15707                .encode(buf);
15708            ::buffa::types::encode_int64(v, buf);
15709        }
15710        if let Some(v) = self.double_value {
15711            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Fixed64)
15712                .encode(buf);
15713            ::buffa::types::encode_double(v, buf);
15714        }
15715        if let Some(ref v) = self.string_value {
15716            ::buffa::encoding::Tag::new(
15717                    7u32,
15718                    ::buffa::encoding::WireType::LengthDelimited,
15719                )
15720                .encode(buf);
15721            ::buffa::types::encode_bytes(v, buf);
15722        }
15723        if let Some(ref v) = self.aggregate_value {
15724            ::buffa::encoding::Tag::new(
15725                    8u32,
15726                    ::buffa::encoding::WireType::LengthDelimited,
15727                )
15728                .encode(buf);
15729            ::buffa::types::encode_string(v, buf);
15730        }
15731        self.__buffa_unknown_fields.write_to(buf);
15732    }
15733    fn merge_field(
15734        &mut self,
15735        tag: ::buffa::encoding::Tag,
15736        buf: &mut impl ::buffa::bytes::Buf,
15737        depth: u32,
15738    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
15739        #[allow(unused_imports)]
15740        use ::buffa::bytes::Buf as _;
15741        #[allow(unused_imports)]
15742        use ::buffa::Enumeration as _;
15743        match tag.field_number() {
15744            2u32 => {
15745                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
15746                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15747                        field_number: 2u32,
15748                        expected: 2u8,
15749                        actual: tag.wire_type() as u8,
15750                    });
15751                }
15752                let mut elem = ::core::default::Default::default();
15753                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
15754                self.name.push(elem);
15755            }
15756            3u32 => {
15757                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
15758                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15759                        field_number: 3u32,
15760                        expected: 2u8,
15761                        actual: tag.wire_type() as u8,
15762                    });
15763                }
15764                ::buffa::types::merge_string(
15765                    self
15766                        .identifier_value
15767                        .get_or_insert_with(::buffa::alloc::string::String::new),
15768                    buf,
15769                )?;
15770            }
15771            4u32 => {
15772                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
15773                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15774                        field_number: 4u32,
15775                        expected: 0u8,
15776                        actual: tag.wire_type() as u8,
15777                    });
15778                }
15779                self.positive_int_value = ::core::option::Option::Some(
15780                    ::buffa::types::decode_uint64(buf)?,
15781                );
15782            }
15783            5u32 => {
15784                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
15785                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15786                        field_number: 5u32,
15787                        expected: 0u8,
15788                        actual: tag.wire_type() as u8,
15789                    });
15790                }
15791                self.negative_int_value = ::core::option::Option::Some(
15792                    ::buffa::types::decode_int64(buf)?,
15793                );
15794            }
15795            6u32 => {
15796                if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
15797                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15798                        field_number: 6u32,
15799                        expected: 1u8,
15800                        actual: tag.wire_type() as u8,
15801                    });
15802                }
15803                self.double_value = ::core::option::Option::Some(
15804                    ::buffa::types::decode_double(buf)?,
15805                );
15806            }
15807            7u32 => {
15808                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
15809                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15810                        field_number: 7u32,
15811                        expected: 2u8,
15812                        actual: tag.wire_type() as u8,
15813                    });
15814                }
15815                ::buffa::types::merge_bytes(
15816                    self.string_value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
15817                    buf,
15818                )?;
15819            }
15820            8u32 => {
15821                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
15822                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
15823                        field_number: 8u32,
15824                        expected: 2u8,
15825                        actual: tag.wire_type() as u8,
15826                    });
15827                }
15828                ::buffa::types::merge_string(
15829                    self
15830                        .aggregate_value
15831                        .get_or_insert_with(::buffa::alloc::string::String::new),
15832                    buf,
15833                )?;
15834            }
15835            _ => {
15836                self.__buffa_unknown_fields
15837                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
15838            }
15839        }
15840        ::core::result::Result::Ok(())
15841    }
15842    fn clear(&mut self) {
15843        self.name.clear();
15844        self.identifier_value = ::core::option::Option::None;
15845        self.positive_int_value = ::core::option::Option::None;
15846        self.negative_int_value = ::core::option::Option::None;
15847        self.double_value = ::core::option::Option::None;
15848        self.string_value = ::core::option::Option::None;
15849        self.aggregate_value = ::core::option::Option::None;
15850        self.__buffa_unknown_fields.clear();
15851    }
15852}
15853impl ::buffa::ExtensionSet for UninterpretedOption {
15854    const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption";
15855    fn unknown_fields(&self) -> &::buffa::UnknownFields {
15856        &self.__buffa_unknown_fields
15857    }
15858    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
15859        &mut self.__buffa_unknown_fields
15860    }
15861}
15862#[cfg(feature = "text")]
15863impl ::buffa::text::TextFormat for UninterpretedOption {
15864    fn encode_text(
15865        &self,
15866        enc: &mut ::buffa::text::TextEncoder<'_>,
15867    ) -> ::core::fmt::Result {
15868        #[allow(unused_imports)]
15869        use ::buffa::Enumeration as _;
15870        if let ::core::option::Option::Some(ref __v) = self.identifier_value {
15871            enc.write_field_name("identifier_value")?;
15872            enc.write_string(__v)?;
15873        }
15874        if let ::core::option::Option::Some(ref __v) = self.positive_int_value {
15875            enc.write_field_name("positive_int_value")?;
15876            enc.write_u64(*__v)?;
15877        }
15878        if let ::core::option::Option::Some(ref __v) = self.negative_int_value {
15879            enc.write_field_name("negative_int_value")?;
15880            enc.write_i64(*__v)?;
15881        }
15882        if let ::core::option::Option::Some(ref __v) = self.double_value {
15883            enc.write_field_name("double_value")?;
15884            enc.write_f64(*__v)?;
15885        }
15886        if let ::core::option::Option::Some(ref __v) = self.string_value {
15887            enc.write_field_name("string_value")?;
15888            enc.write_bytes(__v)?;
15889        }
15890        if let ::core::option::Option::Some(ref __v) = self.aggregate_value {
15891            enc.write_field_name("aggregate_value")?;
15892            enc.write_string(__v)?;
15893        }
15894        for __v in &self.name {
15895            enc.write_field_name("name")?;
15896            enc.write_message(__v)?;
15897        }
15898        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
15899        ::core::result::Result::Ok(())
15900    }
15901    fn merge_text(
15902        &mut self,
15903        dec: &mut ::buffa::text::TextDecoder<'_>,
15904    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
15905        #[allow(unused_imports)]
15906        use ::buffa::Enumeration as _;
15907        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
15908            match __name {
15909                "identifier_value" => {
15910                    self.identifier_value = ::core::option::Option::Some(
15911                        dec.read_string()?.into_owned(),
15912                    );
15913                }
15914                "positive_int_value" => {
15915                    self.positive_int_value = ::core::option::Option::Some(
15916                        dec.read_u64()?,
15917                    );
15918                }
15919                "negative_int_value" => {
15920                    self.negative_int_value = ::core::option::Option::Some(
15921                        dec.read_i64()?,
15922                    );
15923                }
15924                "double_value" => {
15925                    self.double_value = ::core::option::Option::Some(dec.read_f64()?);
15926                }
15927                "string_value" => {
15928                    self.string_value = ::core::option::Option::Some(dec.read_bytes()?);
15929                }
15930                "aggregate_value" => {
15931                    self.aggregate_value = ::core::option::Option::Some(
15932                        dec.read_string()?.into_owned(),
15933                    );
15934                }
15935                "name" => {
15936                    dec.read_repeated_into(
15937                        &mut self.name,
15938                        |__d| {
15939                            let mut __m = ::core::default::Default::default();
15940                            __d.merge_message(&mut __m)?;
15941                            ::core::result::Result::Ok(__m)
15942                        },
15943                    )?
15944                }
15945                _ => dec.skip_value()?,
15946            }
15947        }
15948        ::core::result::Result::Ok(())
15949    }
15950}
15951#[cfg(feature = "json")]
15952impl ::buffa::json_helpers::ProtoElemJson for UninterpretedOption {
15953    fn serialize_proto_json<S: ::serde::Serializer>(
15954        v: &Self,
15955        s: S,
15956    ) -> ::core::result::Result<S::Ok, S::Error> {
15957        ::serde::Serialize::serialize(v, s)
15958    }
15959    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
15960        d: D,
15961    ) -> ::core::result::Result<Self, D::Error> {
15962        <Self as ::serde::Deserialize>::deserialize(d)
15963    }
15964}
15965#[cfg(feature = "json")]
15966#[doc(hidden)]
15967pub const __UNINTERPRETED_OPTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
15968    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15969    to_json: ::buffa::type_registry::any_to_json::<UninterpretedOption>,
15970    from_json: ::buffa::type_registry::any_from_json::<UninterpretedOption>,
15971    is_wkt: false,
15972};
15973#[cfg(feature = "text")]
15974#[doc(hidden)]
15975pub const __UNINTERPRETED_OPTION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
15976    type_url: "type.googleapis.com/google.protobuf.UninterpretedOption",
15977    text_encode: ::buffa::type_registry::any_encode_text::<UninterpretedOption>,
15978    text_merge: ::buffa::type_registry::any_merge_text::<UninterpretedOption>,
15979};
15980pub mod uninterpreted_option {
15981    #[allow(unused_imports)]
15982    use super::*;
15983    /// The name of the uninterpreted option.  Each string represents a segment in
15984    /// a dot-separated name.  is_extension is true iff a segment represents an
15985    /// extension (denoted with parentheses in options specs in .proto files).
15986    /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["moo", false\] } represents
15987    /// "foo.(bar.baz).moo".
15988    #[derive(Clone, PartialEq, Default)]
15989    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
15990    #[cfg_attr(feature = "json", serde(default))]
15991    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
15992    pub struct NamePart {
15993        /// Field 1: `name_part`
15994        #[cfg_attr(
15995            feature = "json",
15996            serde(
15997                rename = "namePart",
15998                alias = "name_part",
15999                with = "::buffa::json_helpers::proto_string"
16000            )
16001        )]
16002        pub name_part: ::buffa::alloc::string::String,
16003        /// Field 2: `is_extension`
16004        #[cfg_attr(
16005            feature = "json",
16006            serde(
16007                rename = "isExtension",
16008                alias = "is_extension",
16009                with = "::buffa::json_helpers::proto_bool"
16010            )
16011        )]
16012        pub is_extension: bool,
16013        #[cfg_attr(feature = "json", serde(skip))]
16014        #[doc(hidden)]
16015        pub __buffa_unknown_fields: ::buffa::UnknownFields,
16016    }
16017    impl ::core::fmt::Debug for NamePart {
16018        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16019            f.debug_struct("NamePart")
16020                .field("name_part", &self.name_part)
16021                .field("is_extension", &self.is_extension)
16022                .finish()
16023        }
16024    }
16025    impl NamePart {
16026        /// Protobuf type URL for this message, for use with `Any::pack` and
16027        /// `Any::unpack_if`.
16028        ///
16029        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
16030        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
16031    }
16032    impl ::buffa::DefaultInstance for NamePart {
16033        fn default_instance() -> &'static Self {
16034            static VALUE: ::buffa::__private::OnceBox<NamePart> = ::buffa::__private::OnceBox::new();
16035            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
16036        }
16037    }
16038    impl ::buffa::MessageName for NamePart {
16039        const PACKAGE: &'static str = "google.protobuf";
16040        const NAME: &'static str = "UninterpretedOption.NamePart";
16041        const FULL_NAME: &'static str = "google.protobuf.UninterpretedOption.NamePart";
16042        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
16043    }
16044    impl ::buffa::Message for NamePart {
16045        /// Returns the total encoded size in bytes.
16046        ///
16047        /// The result is a `u32`; the protobuf specification requires all
16048        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
16049        /// compliant message will never overflow this type.
16050        #[allow(clippy::let_and_return)]
16051        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
16052            #[allow(unused_imports)]
16053            use ::buffa::Enumeration as _;
16054            let mut size = 0u32;
16055            size += 1u32 + ::buffa::types::string_encoded_len(&self.name_part) as u32;
16056            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
16057            size += self.__buffa_unknown_fields.encoded_len() as u32;
16058            size
16059        }
16060        fn write_to(
16061            &self,
16062            _cache: &mut ::buffa::SizeCache,
16063            buf: &mut impl ::buffa::bytes::BufMut,
16064        ) {
16065            #[allow(unused_imports)]
16066            use ::buffa::Enumeration as _;
16067            ::buffa::encoding::Tag::new(
16068                    1u32,
16069                    ::buffa::encoding::WireType::LengthDelimited,
16070                )
16071                .encode(buf);
16072            ::buffa::types::encode_string(&self.name_part, buf);
16073            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
16074                .encode(buf);
16075            ::buffa::types::encode_bool(self.is_extension, buf);
16076            self.__buffa_unknown_fields.write_to(buf);
16077        }
16078        fn merge_field(
16079            &mut self,
16080            tag: ::buffa::encoding::Tag,
16081            buf: &mut impl ::buffa::bytes::Buf,
16082            depth: u32,
16083        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
16084            #[allow(unused_imports)]
16085            use ::buffa::bytes::Buf as _;
16086            #[allow(unused_imports)]
16087            use ::buffa::Enumeration as _;
16088            match tag.field_number() {
16089                1u32 => {
16090                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
16091                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16092                            field_number: 1u32,
16093                            expected: 2u8,
16094                            actual: tag.wire_type() as u8,
16095                        });
16096                    }
16097                    ::buffa::types::merge_string(&mut self.name_part, buf)?;
16098                }
16099                2u32 => {
16100                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16101                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16102                            field_number: 2u32,
16103                            expected: 0u8,
16104                            actual: tag.wire_type() as u8,
16105                        });
16106                    }
16107                    self.is_extension = ::buffa::types::decode_bool(buf)?;
16108                }
16109                _ => {
16110                    self.__buffa_unknown_fields
16111                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
16112                }
16113            }
16114            ::core::result::Result::Ok(())
16115        }
16116        fn clear(&mut self) {
16117            self.name_part.clear();
16118            self.is_extension = false;
16119            self.__buffa_unknown_fields.clear();
16120        }
16121    }
16122    impl ::buffa::ExtensionSet for NamePart {
16123        const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption.NamePart";
16124        fn unknown_fields(&self) -> &::buffa::UnknownFields {
16125            &self.__buffa_unknown_fields
16126        }
16127        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
16128            &mut self.__buffa_unknown_fields
16129        }
16130    }
16131    #[cfg(feature = "text")]
16132    impl ::buffa::text::TextFormat for NamePart {
16133        fn encode_text(
16134            &self,
16135            enc: &mut ::buffa::text::TextEncoder<'_>,
16136        ) -> ::core::fmt::Result {
16137            #[allow(unused_imports)]
16138            use ::buffa::Enumeration as _;
16139            enc.write_field_name("name_part")?;
16140            enc.write_string(&self.name_part)?;
16141            enc.write_field_name("is_extension")?;
16142            enc.write_bool(self.is_extension)?;
16143            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
16144            ::core::result::Result::Ok(())
16145        }
16146        fn merge_text(
16147            &mut self,
16148            dec: &mut ::buffa::text::TextDecoder<'_>,
16149        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
16150            #[allow(unused_imports)]
16151            use ::buffa::Enumeration as _;
16152            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
16153                match __name {
16154                    "name_part" => self.name_part = dec.read_string()?.into_owned(),
16155                    "is_extension" => self.is_extension = dec.read_bool()?,
16156                    _ => dec.skip_value()?,
16157                }
16158            }
16159            ::core::result::Result::Ok(())
16160        }
16161    }
16162    #[cfg(feature = "json")]
16163    impl ::buffa::json_helpers::ProtoElemJson for NamePart {
16164        fn serialize_proto_json<S: ::serde::Serializer>(
16165            v: &Self,
16166            s: S,
16167        ) -> ::core::result::Result<S::Ok, S::Error> {
16168            ::serde::Serialize::serialize(v, s)
16169        }
16170        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
16171            d: D,
16172        ) -> ::core::result::Result<Self, D::Error> {
16173            <Self as ::serde::Deserialize>::deserialize(d)
16174        }
16175    }
16176    #[cfg(feature = "json")]
16177    #[doc(hidden)]
16178    pub const __NAME_PART_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
16179        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
16180        to_json: ::buffa::type_registry::any_to_json::<NamePart>,
16181        from_json: ::buffa::type_registry::any_from_json::<NamePart>,
16182        is_wkt: false,
16183    };
16184    #[cfg(feature = "text")]
16185    #[doc(hidden)]
16186    pub const __NAME_PART_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
16187        type_url: "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart",
16188        text_encode: ::buffa::type_registry::any_encode_text::<NamePart>,
16189        text_merge: ::buffa::type_registry::any_merge_text::<NamePart>,
16190    };
16191    #[cfg(feature = "views")]
16192    #[doc(inline)]
16193    pub use super::__buffa::view::uninterpreted_option::NamePartView;
16194    #[cfg(feature = "views")]
16195    #[doc(inline)]
16196    pub use super::__buffa::view::uninterpreted_option::NamePartOwnedView;
16197}
16198/// ===================================================================
16199/// Features
16200///
16201/// TODO Enums in C++ gencode (and potentially other languages) are
16202/// not well scoped.  This means that each of the feature enums below can clash
16203/// with each other.  The short names we've chosen maximize call-site
16204/// readability, but leave us very open to this scenario.  A future feature will
16205/// be designed and implemented to handle this, hopefully before we ever hit a
16206/// conflict here.
16207#[derive(Clone, PartialEq, Default)]
16208#[cfg_attr(feature = "json", derive(::serde::Serialize))]
16209#[cfg_attr(feature = "json", serde(default))]
16210#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
16211pub struct FeatureSet {
16212    /// Field 1: `field_presence`
16213    #[cfg_attr(
16214        feature = "json",
16215        serde(
16216            rename = "fieldPresence",
16217            alias = "field_presence",
16218            with = "::buffa::json_helpers::opt_closed_enum",
16219            skip_serializing_if = "::core::option::Option::is_none"
16220        )
16221    )]
16222    pub field_presence: ::core::option::Option<feature_set::FieldPresence>,
16223    /// Field 2: `enum_type`
16224    #[cfg_attr(
16225        feature = "json",
16226        serde(
16227            rename = "enumType",
16228            alias = "enum_type",
16229            with = "::buffa::json_helpers::opt_closed_enum",
16230            skip_serializing_if = "::core::option::Option::is_none"
16231        )
16232    )]
16233    pub enum_type: ::core::option::Option<feature_set::EnumType>,
16234    /// Field 3: `repeated_field_encoding`
16235    #[cfg_attr(
16236        feature = "json",
16237        serde(
16238            rename = "repeatedFieldEncoding",
16239            alias = "repeated_field_encoding",
16240            with = "::buffa::json_helpers::opt_closed_enum",
16241            skip_serializing_if = "::core::option::Option::is_none"
16242        )
16243    )]
16244    pub repeated_field_encoding: ::core::option::Option<
16245        feature_set::RepeatedFieldEncoding,
16246    >,
16247    /// Field 4: `utf8_validation`
16248    #[cfg_attr(
16249        feature = "json",
16250        serde(
16251            rename = "utf8Validation",
16252            alias = "utf8_validation",
16253            with = "::buffa::json_helpers::opt_closed_enum",
16254            skip_serializing_if = "::core::option::Option::is_none"
16255        )
16256    )]
16257    pub utf8_validation: ::core::option::Option<feature_set::Utf8Validation>,
16258    /// Field 5: `message_encoding`
16259    #[cfg_attr(
16260        feature = "json",
16261        serde(
16262            rename = "messageEncoding",
16263            alias = "message_encoding",
16264            with = "::buffa::json_helpers::opt_closed_enum",
16265            skip_serializing_if = "::core::option::Option::is_none"
16266        )
16267    )]
16268    pub message_encoding: ::core::option::Option<feature_set::MessageEncoding>,
16269    /// Field 6: `json_format`
16270    #[cfg_attr(
16271        feature = "json",
16272        serde(
16273            rename = "jsonFormat",
16274            alias = "json_format",
16275            with = "::buffa::json_helpers::opt_closed_enum",
16276            skip_serializing_if = "::core::option::Option::is_none"
16277        )
16278    )]
16279    pub json_format: ::core::option::Option<feature_set::JsonFormat>,
16280    /// Field 7: `enforce_naming_style`
16281    #[cfg_attr(
16282        feature = "json",
16283        serde(
16284            rename = "enforceNamingStyle",
16285            alias = "enforce_naming_style",
16286            with = "::buffa::json_helpers::opt_closed_enum",
16287            skip_serializing_if = "::core::option::Option::is_none"
16288        )
16289    )]
16290    pub enforce_naming_style: ::core::option::Option<feature_set::EnforceNamingStyle>,
16291    /// Field 8: `default_symbol_visibility`
16292    #[cfg_attr(
16293        feature = "json",
16294        serde(
16295            rename = "defaultSymbolVisibility",
16296            alias = "default_symbol_visibility",
16297            with = "::buffa::json_helpers::opt_closed_enum",
16298            skip_serializing_if = "::core::option::Option::is_none"
16299        )
16300    )]
16301    pub default_symbol_visibility: ::core::option::Option<
16302        feature_set::visibility_feature::DefaultSymbolVisibility,
16303    >,
16304    #[cfg_attr(feature = "json", serde(flatten))]
16305    #[doc(hidden)]
16306    pub __buffa_unknown_fields: __FeatureSetExtJson,
16307}
16308impl ::core::fmt::Debug for FeatureSet {
16309    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16310        f.debug_struct("FeatureSet")
16311            .field("field_presence", &self.field_presence)
16312            .field("enum_type", &self.enum_type)
16313            .field("repeated_field_encoding", &self.repeated_field_encoding)
16314            .field("utf8_validation", &self.utf8_validation)
16315            .field("message_encoding", &self.message_encoding)
16316            .field("json_format", &self.json_format)
16317            .field("enforce_naming_style", &self.enforce_naming_style)
16318            .field("default_symbol_visibility", &self.default_symbol_visibility)
16319            .finish()
16320    }
16321}
16322impl FeatureSet {
16323    /// Protobuf type URL for this message, for use with `Any::pack` and
16324    /// `Any::unpack_if`.
16325    ///
16326    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
16327    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
16328}
16329impl FeatureSet {
16330    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16331    #[inline]
16332    ///Sets [`Self::field_presence`] to `Some(value)`, consuming and returning `self`.
16333    pub fn with_field_presence(
16334        mut self,
16335        value: impl Into<feature_set::FieldPresence>,
16336    ) -> Self {
16337        self.field_presence = Some(value.into());
16338        self
16339    }
16340    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16341    #[inline]
16342    ///Sets [`Self::enum_type`] to `Some(value)`, consuming and returning `self`.
16343    pub fn with_enum_type(mut self, value: impl Into<feature_set::EnumType>) -> Self {
16344        self.enum_type = Some(value.into());
16345        self
16346    }
16347    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16348    #[inline]
16349    ///Sets [`Self::repeated_field_encoding`] to `Some(value)`, consuming and returning `self`.
16350    pub fn with_repeated_field_encoding(
16351        mut self,
16352        value: impl Into<feature_set::RepeatedFieldEncoding>,
16353    ) -> Self {
16354        self.repeated_field_encoding = Some(value.into());
16355        self
16356    }
16357    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16358    #[inline]
16359    ///Sets [`Self::utf8_validation`] to `Some(value)`, consuming and returning `self`.
16360    pub fn with_utf8_validation(
16361        mut self,
16362        value: impl Into<feature_set::Utf8Validation>,
16363    ) -> Self {
16364        self.utf8_validation = Some(value.into());
16365        self
16366    }
16367    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16368    #[inline]
16369    ///Sets [`Self::message_encoding`] to `Some(value)`, consuming and returning `self`.
16370    pub fn with_message_encoding(
16371        mut self,
16372        value: impl Into<feature_set::MessageEncoding>,
16373    ) -> Self {
16374        self.message_encoding = Some(value.into());
16375        self
16376    }
16377    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16378    #[inline]
16379    ///Sets [`Self::json_format`] to `Some(value)`, consuming and returning `self`.
16380    pub fn with_json_format(
16381        mut self,
16382        value: impl Into<feature_set::JsonFormat>,
16383    ) -> Self {
16384        self.json_format = Some(value.into());
16385        self
16386    }
16387    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16388    #[inline]
16389    ///Sets [`Self::enforce_naming_style`] to `Some(value)`, consuming and returning `self`.
16390    pub fn with_enforce_naming_style(
16391        mut self,
16392        value: impl Into<feature_set::EnforceNamingStyle>,
16393    ) -> Self {
16394        self.enforce_naming_style = Some(value.into());
16395        self
16396    }
16397    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
16398    #[inline]
16399    ///Sets [`Self::default_symbol_visibility`] to `Some(value)`, consuming and returning `self`.
16400    pub fn with_default_symbol_visibility(
16401        mut self,
16402        value: impl Into<feature_set::visibility_feature::DefaultSymbolVisibility>,
16403    ) -> Self {
16404        self.default_symbol_visibility = Some(value.into());
16405        self
16406    }
16407}
16408impl ::buffa::DefaultInstance for FeatureSet {
16409    fn default_instance() -> &'static Self {
16410        static VALUE: ::buffa::__private::OnceBox<FeatureSet> = ::buffa::__private::OnceBox::new();
16411        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
16412    }
16413}
16414impl ::buffa::MessageName for FeatureSet {
16415    const PACKAGE: &'static str = "google.protobuf";
16416    const NAME: &'static str = "FeatureSet";
16417    const FULL_NAME: &'static str = "google.protobuf.FeatureSet";
16418    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
16419}
16420impl ::buffa::Message for FeatureSet {
16421    /// Returns the total encoded size in bytes.
16422    ///
16423    /// The result is a `u32`; the protobuf specification requires all
16424    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
16425    /// compliant message will never overflow this type.
16426    #[allow(clippy::let_and_return)]
16427    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
16428        #[allow(unused_imports)]
16429        use ::buffa::Enumeration as _;
16430        let mut size = 0u32;
16431        if let Some(ref v) = self.field_presence {
16432            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16433        }
16434        if let Some(ref v) = self.enum_type {
16435            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16436        }
16437        if let Some(ref v) = self.repeated_field_encoding {
16438            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16439        }
16440        if let Some(ref v) = self.utf8_validation {
16441            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16442        }
16443        if let Some(ref v) = self.message_encoding {
16444            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16445        }
16446        if let Some(ref v) = self.json_format {
16447            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16448        }
16449        if let Some(ref v) = self.enforce_naming_style {
16450            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16451        }
16452        if let Some(ref v) = self.default_symbol_visibility {
16453            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
16454        }
16455        size += self.__buffa_unknown_fields.encoded_len() as u32;
16456        size
16457    }
16458    fn write_to(
16459        &self,
16460        _cache: &mut ::buffa::SizeCache,
16461        buf: &mut impl ::buffa::bytes::BufMut,
16462    ) {
16463        #[allow(unused_imports)]
16464        use ::buffa::Enumeration as _;
16465        if let Some(ref v) = self.field_presence {
16466            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
16467                .encode(buf);
16468            ::buffa::types::encode_int32(v.to_i32(), buf);
16469        }
16470        if let Some(ref v) = self.enum_type {
16471            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
16472                .encode(buf);
16473            ::buffa::types::encode_int32(v.to_i32(), buf);
16474        }
16475        if let Some(ref v) = self.repeated_field_encoding {
16476            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
16477                .encode(buf);
16478            ::buffa::types::encode_int32(v.to_i32(), buf);
16479        }
16480        if let Some(ref v) = self.utf8_validation {
16481            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
16482                .encode(buf);
16483            ::buffa::types::encode_int32(v.to_i32(), buf);
16484        }
16485        if let Some(ref v) = self.message_encoding {
16486            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
16487                .encode(buf);
16488            ::buffa::types::encode_int32(v.to_i32(), buf);
16489        }
16490        if let Some(ref v) = self.json_format {
16491            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
16492                .encode(buf);
16493            ::buffa::types::encode_int32(v.to_i32(), buf);
16494        }
16495        if let Some(ref v) = self.enforce_naming_style {
16496            ::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
16497                .encode(buf);
16498            ::buffa::types::encode_int32(v.to_i32(), buf);
16499        }
16500        if let Some(ref v) = self.default_symbol_visibility {
16501            ::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
16502                .encode(buf);
16503            ::buffa::types::encode_int32(v.to_i32(), buf);
16504        }
16505        self.__buffa_unknown_fields.write_to(buf);
16506    }
16507    fn merge_field(
16508        &mut self,
16509        tag: ::buffa::encoding::Tag,
16510        buf: &mut impl ::buffa::bytes::Buf,
16511        depth: u32,
16512    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
16513        #[allow(unused_imports)]
16514        use ::buffa::bytes::Buf as _;
16515        #[allow(unused_imports)]
16516        use ::buffa::Enumeration as _;
16517        match tag.field_number() {
16518            1u32 => {
16519                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16520                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16521                        field_number: 1u32,
16522                        expected: 0u8,
16523                        actual: tag.wire_type() as u8,
16524                    });
16525                }
16526                let __raw = ::buffa::types::decode_int32(buf)?;
16527                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16528                    __raw,
16529                ) {
16530                    self.field_presence = ::core::option::Option::Some(__v);
16531                } else {
16532                    self.__buffa_unknown_fields
16533                        .push(::buffa::UnknownField {
16534                            number: 1u32,
16535                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16536                        });
16537                }
16538            }
16539            2u32 => {
16540                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16541                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16542                        field_number: 2u32,
16543                        expected: 0u8,
16544                        actual: tag.wire_type() as u8,
16545                    });
16546                }
16547                let __raw = ::buffa::types::decode_int32(buf)?;
16548                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16549                    __raw,
16550                ) {
16551                    self.enum_type = ::core::option::Option::Some(__v);
16552                } else {
16553                    self.__buffa_unknown_fields
16554                        .push(::buffa::UnknownField {
16555                            number: 2u32,
16556                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16557                        });
16558                }
16559            }
16560            3u32 => {
16561                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16562                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16563                        field_number: 3u32,
16564                        expected: 0u8,
16565                        actual: tag.wire_type() as u8,
16566                    });
16567                }
16568                let __raw = ::buffa::types::decode_int32(buf)?;
16569                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16570                    __raw,
16571                ) {
16572                    self.repeated_field_encoding = ::core::option::Option::Some(__v);
16573                } else {
16574                    self.__buffa_unknown_fields
16575                        .push(::buffa::UnknownField {
16576                            number: 3u32,
16577                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16578                        });
16579                }
16580            }
16581            4u32 => {
16582                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16583                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16584                        field_number: 4u32,
16585                        expected: 0u8,
16586                        actual: tag.wire_type() as u8,
16587                    });
16588                }
16589                let __raw = ::buffa::types::decode_int32(buf)?;
16590                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16591                    __raw,
16592                ) {
16593                    self.utf8_validation = ::core::option::Option::Some(__v);
16594                } else {
16595                    self.__buffa_unknown_fields
16596                        .push(::buffa::UnknownField {
16597                            number: 4u32,
16598                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16599                        });
16600                }
16601            }
16602            5u32 => {
16603                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16604                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16605                        field_number: 5u32,
16606                        expected: 0u8,
16607                        actual: tag.wire_type() as u8,
16608                    });
16609                }
16610                let __raw = ::buffa::types::decode_int32(buf)?;
16611                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16612                    __raw,
16613                ) {
16614                    self.message_encoding = ::core::option::Option::Some(__v);
16615                } else {
16616                    self.__buffa_unknown_fields
16617                        .push(::buffa::UnknownField {
16618                            number: 5u32,
16619                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16620                        });
16621                }
16622            }
16623            6u32 => {
16624                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16625                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16626                        field_number: 6u32,
16627                        expected: 0u8,
16628                        actual: tag.wire_type() as u8,
16629                    });
16630                }
16631                let __raw = ::buffa::types::decode_int32(buf)?;
16632                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16633                    __raw,
16634                ) {
16635                    self.json_format = ::core::option::Option::Some(__v);
16636                } else {
16637                    self.__buffa_unknown_fields
16638                        .push(::buffa::UnknownField {
16639                            number: 6u32,
16640                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16641                        });
16642                }
16643            }
16644            7u32 => {
16645                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16646                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16647                        field_number: 7u32,
16648                        expected: 0u8,
16649                        actual: tag.wire_type() as u8,
16650                    });
16651                }
16652                let __raw = ::buffa::types::decode_int32(buf)?;
16653                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16654                    __raw,
16655                ) {
16656                    self.enforce_naming_style = ::core::option::Option::Some(__v);
16657                } else {
16658                    self.__buffa_unknown_fields
16659                        .push(::buffa::UnknownField {
16660                            number: 7u32,
16661                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16662                        });
16663                }
16664            }
16665            8u32 => {
16666                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
16667                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
16668                        field_number: 8u32,
16669                        expected: 0u8,
16670                        actual: tag.wire_type() as u8,
16671                    });
16672                }
16673                let __raw = ::buffa::types::decode_int32(buf)?;
16674                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
16675                    __raw,
16676                ) {
16677                    self.default_symbol_visibility = ::core::option::Option::Some(__v);
16678                } else {
16679                    self.__buffa_unknown_fields
16680                        .push(::buffa::UnknownField {
16681                            number: 8u32,
16682                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
16683                        });
16684                }
16685            }
16686            _ => {
16687                self.__buffa_unknown_fields
16688                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
16689            }
16690        }
16691        ::core::result::Result::Ok(())
16692    }
16693    fn clear(&mut self) {
16694        self.field_presence = ::core::option::Option::None;
16695        self.enum_type = ::core::option::Option::None;
16696        self.repeated_field_encoding = ::core::option::Option::None;
16697        self.utf8_validation = ::core::option::Option::None;
16698        self.message_encoding = ::core::option::Option::None;
16699        self.json_format = ::core::option::Option::None;
16700        self.enforce_naming_style = ::core::option::Option::None;
16701        self.default_symbol_visibility = ::core::option::Option::None;
16702        self.__buffa_unknown_fields.clear();
16703    }
16704}
16705impl ::buffa::ExtensionSet for FeatureSet {
16706    const PROTO_FQN: &'static str = "google.protobuf.FeatureSet";
16707    fn unknown_fields(&self) -> &::buffa::UnknownFields {
16708        &self.__buffa_unknown_fields
16709    }
16710    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
16711        &mut self.__buffa_unknown_fields
16712    }
16713}
16714#[cfg(feature = "text")]
16715impl ::buffa::text::TextFormat for FeatureSet {
16716    fn encode_text(
16717        &self,
16718        enc: &mut ::buffa::text::TextEncoder<'_>,
16719    ) -> ::core::fmt::Result {
16720        #[allow(unused_imports)]
16721        use ::buffa::Enumeration as _;
16722        if let ::core::option::Option::Some(ref __v) = self.field_presence {
16723            enc.write_field_name("field_presence")?;
16724            enc.write_enum_name(__v.proto_name())?;
16725        }
16726        if let ::core::option::Option::Some(ref __v) = self.enum_type {
16727            enc.write_field_name("enum_type")?;
16728            enc.write_enum_name(__v.proto_name())?;
16729        }
16730        if let ::core::option::Option::Some(ref __v) = self.repeated_field_encoding {
16731            enc.write_field_name("repeated_field_encoding")?;
16732            enc.write_enum_name(__v.proto_name())?;
16733        }
16734        if let ::core::option::Option::Some(ref __v) = self.utf8_validation {
16735            enc.write_field_name("utf8_validation")?;
16736            enc.write_enum_name(__v.proto_name())?;
16737        }
16738        if let ::core::option::Option::Some(ref __v) = self.message_encoding {
16739            enc.write_field_name("message_encoding")?;
16740            enc.write_enum_name(__v.proto_name())?;
16741        }
16742        if let ::core::option::Option::Some(ref __v) = self.json_format {
16743            enc.write_field_name("json_format")?;
16744            enc.write_enum_name(__v.proto_name())?;
16745        }
16746        if let ::core::option::Option::Some(ref __v) = self.enforce_naming_style {
16747            enc.write_field_name("enforce_naming_style")?;
16748            enc.write_enum_name(__v.proto_name())?;
16749        }
16750        if let ::core::option::Option::Some(ref __v) = self.default_symbol_visibility {
16751            enc.write_field_name("default_symbol_visibility")?;
16752            enc.write_enum_name(__v.proto_name())?;
16753        }
16754        enc.write_extension_fields(
16755            "google.protobuf.FeatureSet",
16756            &self.__buffa_unknown_fields,
16757        )?;
16758        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
16759        ::core::result::Result::Ok(())
16760    }
16761    fn merge_text(
16762        &mut self,
16763        dec: &mut ::buffa::text::TextDecoder<'_>,
16764    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
16765        #[allow(unused_imports)]
16766        use ::buffa::Enumeration as _;
16767        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
16768            match __name {
16769                "field_presence" => {
16770                    self.field_presence = ::core::option::Option::Some(
16771                        dec.read_closed_enum_by_name::<feature_set::FieldPresence>()?,
16772                    );
16773                }
16774                "enum_type" => {
16775                    self.enum_type = ::core::option::Option::Some(
16776                        dec.read_closed_enum_by_name::<feature_set::EnumType>()?,
16777                    );
16778                }
16779                "repeated_field_encoding" => {
16780                    self.repeated_field_encoding = ::core::option::Option::Some(
16781                        dec
16782                            .read_closed_enum_by_name::<
16783                                feature_set::RepeatedFieldEncoding,
16784                            >()?,
16785                    );
16786                }
16787                "utf8_validation" => {
16788                    self.utf8_validation = ::core::option::Option::Some(
16789                        dec.read_closed_enum_by_name::<feature_set::Utf8Validation>()?,
16790                    );
16791                }
16792                "message_encoding" => {
16793                    self.message_encoding = ::core::option::Option::Some(
16794                        dec.read_closed_enum_by_name::<feature_set::MessageEncoding>()?,
16795                    );
16796                }
16797                "json_format" => {
16798                    self.json_format = ::core::option::Option::Some(
16799                        dec.read_closed_enum_by_name::<feature_set::JsonFormat>()?,
16800                    );
16801                }
16802                "enforce_naming_style" => {
16803                    self.enforce_naming_style = ::core::option::Option::Some(
16804                        dec
16805                            .read_closed_enum_by_name::<
16806                                feature_set::EnforceNamingStyle,
16807                            >()?,
16808                    );
16809                }
16810                "default_symbol_visibility" => {
16811                    self.default_symbol_visibility = ::core::option::Option::Some(
16812                        dec
16813                            .read_closed_enum_by_name::<
16814                                feature_set::visibility_feature::DefaultSymbolVisibility,
16815                            >()?,
16816                    );
16817                }
16818                __name if __name.starts_with('[') => {
16819                    for __r in dec.read_extension(__name, "google.protobuf.FeatureSet")?
16820                    {
16821                        self.__buffa_unknown_fields.push(__r);
16822                    }
16823                }
16824                _ => dec.skip_value()?,
16825            }
16826        }
16827        ::core::result::Result::Ok(())
16828    }
16829}
16830#[cfg(feature = "json")]
16831impl<'de> serde::Deserialize<'de> for FeatureSet {
16832    fn deserialize<D: serde::Deserializer<'de>>(
16833        d: D,
16834    ) -> ::core::result::Result<Self, D::Error> {
16835        struct _V;
16836        impl<'de> serde::de::Visitor<'de> for _V {
16837            type Value = FeatureSet;
16838            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
16839                f.write_str("struct FeatureSet")
16840            }
16841            #[allow(clippy::field_reassign_with_default)]
16842            fn visit_map<A: serde::de::MapAccess<'de>>(
16843                self,
16844                mut map: A,
16845            ) -> ::core::result::Result<FeatureSet, A::Error> {
16846                let mut __f_field_presence: ::core::option::Option<
16847                    ::core::option::Option<feature_set::FieldPresence>,
16848                > = None;
16849                let mut __f_enum_type: ::core::option::Option<
16850                    ::core::option::Option<feature_set::EnumType>,
16851                > = None;
16852                let mut __f_repeated_field_encoding: ::core::option::Option<
16853                    ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16854                > = None;
16855                let mut __f_utf8_validation: ::core::option::Option<
16856                    ::core::option::Option<feature_set::Utf8Validation>,
16857                > = None;
16858                let mut __f_message_encoding: ::core::option::Option<
16859                    ::core::option::Option<feature_set::MessageEncoding>,
16860                > = None;
16861                let mut __f_json_format: ::core::option::Option<
16862                    ::core::option::Option<feature_set::JsonFormat>,
16863                > = None;
16864                let mut __f_enforce_naming_style: ::core::option::Option<
16865                    ::core::option::Option<feature_set::EnforceNamingStyle>,
16866                > = None;
16867                let mut __f_default_symbol_visibility: ::core::option::Option<
16868                    ::core::option::Option<
16869                        feature_set::visibility_feature::DefaultSymbolVisibility,
16870                    >,
16871                > = None;
16872                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
16873                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
16874                    match key.as_str() {
16875                        "fieldPresence" | "field_presence" => {
16876                            __f_field_presence = Some({
16877                                struct _S;
16878                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16879                                    type Value = ::core::option::Option<
16880                                        feature_set::FieldPresence,
16881                                    >;
16882                                    fn deserialize<D: serde::Deserializer<'de>>(
16883                                        self,
16884                                        d: D,
16885                                    ) -> ::core::result::Result<
16886                                        ::core::option::Option<feature_set::FieldPresence>,
16887                                        D::Error,
16888                                    > {
16889                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16890                                    }
16891                                }
16892                                map.next_value_seed(_S)?
16893                            });
16894                        }
16895                        "enumType" | "enum_type" => {
16896                            __f_enum_type = Some({
16897                                struct _S;
16898                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16899                                    type Value = ::core::option::Option<feature_set::EnumType>;
16900                                    fn deserialize<D: serde::Deserializer<'de>>(
16901                                        self,
16902                                        d: D,
16903                                    ) -> ::core::result::Result<
16904                                        ::core::option::Option<feature_set::EnumType>,
16905                                        D::Error,
16906                                    > {
16907                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16908                                    }
16909                                }
16910                                map.next_value_seed(_S)?
16911                            });
16912                        }
16913                        "repeatedFieldEncoding" | "repeated_field_encoding" => {
16914                            __f_repeated_field_encoding = Some({
16915                                struct _S;
16916                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16917                                    type Value = ::core::option::Option<
16918                                        feature_set::RepeatedFieldEncoding,
16919                                    >;
16920                                    fn deserialize<D: serde::Deserializer<'de>>(
16921                                        self,
16922                                        d: D,
16923                                    ) -> ::core::result::Result<
16924                                        ::core::option::Option<feature_set::RepeatedFieldEncoding>,
16925                                        D::Error,
16926                                    > {
16927                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16928                                    }
16929                                }
16930                                map.next_value_seed(_S)?
16931                            });
16932                        }
16933                        "utf8Validation" | "utf8_validation" => {
16934                            __f_utf8_validation = Some({
16935                                struct _S;
16936                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16937                                    type Value = ::core::option::Option<
16938                                        feature_set::Utf8Validation,
16939                                    >;
16940                                    fn deserialize<D: serde::Deserializer<'de>>(
16941                                        self,
16942                                        d: D,
16943                                    ) -> ::core::result::Result<
16944                                        ::core::option::Option<feature_set::Utf8Validation>,
16945                                        D::Error,
16946                                    > {
16947                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16948                                    }
16949                                }
16950                                map.next_value_seed(_S)?
16951                            });
16952                        }
16953                        "messageEncoding" | "message_encoding" => {
16954                            __f_message_encoding = Some({
16955                                struct _S;
16956                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16957                                    type Value = ::core::option::Option<
16958                                        feature_set::MessageEncoding,
16959                                    >;
16960                                    fn deserialize<D: serde::Deserializer<'de>>(
16961                                        self,
16962                                        d: D,
16963                                    ) -> ::core::result::Result<
16964                                        ::core::option::Option<feature_set::MessageEncoding>,
16965                                        D::Error,
16966                                    > {
16967                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16968                                    }
16969                                }
16970                                map.next_value_seed(_S)?
16971                            });
16972                        }
16973                        "jsonFormat" | "json_format" => {
16974                            __f_json_format = Some({
16975                                struct _S;
16976                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16977                                    type Value = ::core::option::Option<
16978                                        feature_set::JsonFormat,
16979                                    >;
16980                                    fn deserialize<D: serde::Deserializer<'de>>(
16981                                        self,
16982                                        d: D,
16983                                    ) -> ::core::result::Result<
16984                                        ::core::option::Option<feature_set::JsonFormat>,
16985                                        D::Error,
16986                                    > {
16987                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
16988                                    }
16989                                }
16990                                map.next_value_seed(_S)?
16991                            });
16992                        }
16993                        "enforceNamingStyle" | "enforce_naming_style" => {
16994                            __f_enforce_naming_style = Some({
16995                                struct _S;
16996                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
16997                                    type Value = ::core::option::Option<
16998                                        feature_set::EnforceNamingStyle,
16999                                    >;
17000                                    fn deserialize<D: serde::Deserializer<'de>>(
17001                                        self,
17002                                        d: D,
17003                                    ) -> ::core::result::Result<
17004                                        ::core::option::Option<feature_set::EnforceNamingStyle>,
17005                                        D::Error,
17006                                    > {
17007                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
17008                                    }
17009                                }
17010                                map.next_value_seed(_S)?
17011                            });
17012                        }
17013                        "defaultSymbolVisibility" | "default_symbol_visibility" => {
17014                            __f_default_symbol_visibility = Some({
17015                                struct _S;
17016                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
17017                                    type Value = ::core::option::Option<
17018                                        feature_set::visibility_feature::DefaultSymbolVisibility,
17019                                    >;
17020                                    fn deserialize<D: serde::Deserializer<'de>>(
17021                                        self,
17022                                        d: D,
17023                                    ) -> ::core::result::Result<
17024                                        ::core::option::Option<
17025                                            feature_set::visibility_feature::DefaultSymbolVisibility,
17026                                        >,
17027                                        D::Error,
17028                                    > {
17029                                        ::buffa::json_helpers::opt_closed_enum::deserialize(d)
17030                                    }
17031                                }
17032                                map.next_value_seed(_S)?
17033                            });
17034                        }
17035                        __k if __k.starts_with('[') => {
17036                            let __v: ::buffa::serde_json::Value = map.next_value()?;
17037                            match ::buffa::extension_registry::deserialize_extension_key(
17038                                "google.protobuf.FeatureSet",
17039                                __k,
17040                                __v,
17041                            ) {
17042                                ::core::option::Option::Some(
17043                                    ::core::result::Result::Ok(__recs),
17044                                ) => {
17045                                    for __rec in __recs {
17046                                        __ext_records.push(__rec);
17047                                    }
17048                                }
17049                                ::core::option::Option::Some(
17050                                    ::core::result::Result::Err(__e),
17051                                ) => {
17052                                    return ::core::result::Result::Err(
17053                                        <A::Error as ::serde::de::Error>::custom(__e),
17054                                    );
17055                                }
17056                                ::core::option::Option::None => {}
17057                            }
17058                        }
17059                        _ => {
17060                            map.next_value::<serde::de::IgnoredAny>()?;
17061                        }
17062                    }
17063                }
17064                let mut __r = <FeatureSet as ::core::default::Default>::default();
17065                if let ::core::option::Option::Some(v) = __f_field_presence {
17066                    __r.field_presence = v;
17067                }
17068                if let ::core::option::Option::Some(v) = __f_enum_type {
17069                    __r.enum_type = v;
17070                }
17071                if let ::core::option::Option::Some(v) = __f_repeated_field_encoding {
17072                    __r.repeated_field_encoding = v;
17073                }
17074                if let ::core::option::Option::Some(v) = __f_utf8_validation {
17075                    __r.utf8_validation = v;
17076                }
17077                if let ::core::option::Option::Some(v) = __f_message_encoding {
17078                    __r.message_encoding = v;
17079                }
17080                if let ::core::option::Option::Some(v) = __f_json_format {
17081                    __r.json_format = v;
17082                }
17083                if let ::core::option::Option::Some(v) = __f_enforce_naming_style {
17084                    __r.enforce_naming_style = v;
17085                }
17086                if let ::core::option::Option::Some(v) = __f_default_symbol_visibility {
17087                    __r.default_symbol_visibility = v;
17088                }
17089                for __rec in __ext_records {
17090                    __r.__buffa_unknown_fields.push(__rec);
17091                }
17092                Ok(__r)
17093            }
17094        }
17095        d.deserialize_map(_V)
17096    }
17097}
17098#[cfg(feature = "json")]
17099impl ::buffa::json_helpers::ProtoElemJson for FeatureSet {
17100    fn serialize_proto_json<S: ::serde::Serializer>(
17101        v: &Self,
17102        s: S,
17103    ) -> ::core::result::Result<S::Ok, S::Error> {
17104        ::serde::Serialize::serialize(v, s)
17105    }
17106    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17107        d: D,
17108    ) -> ::core::result::Result<Self, D::Error> {
17109        <Self as ::serde::Deserialize>::deserialize(d)
17110    }
17111}
17112#[doc(hidden)]
17113#[derive(Clone, Debug, Default, PartialEq)]
17114#[repr(transparent)]
17115#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17116pub struct __FeatureSetExtJson(pub ::buffa::UnknownFields);
17117impl ::core::ops::Deref for __FeatureSetExtJson {
17118    type Target = ::buffa::UnknownFields;
17119    fn deref(&self) -> &::buffa::UnknownFields {
17120        &self.0
17121    }
17122}
17123impl ::core::ops::DerefMut for __FeatureSetExtJson {
17124    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
17125        &mut self.0
17126    }
17127}
17128impl ::core::convert::From<::buffa::UnknownFields> for __FeatureSetExtJson {
17129    fn from(u: ::buffa::UnknownFields) -> Self {
17130        Self(u)
17131    }
17132}
17133#[cfg(feature = "json")]
17134impl ::serde::Serialize for __FeatureSetExtJson {
17135    fn serialize<S: ::serde::Serializer>(
17136        &self,
17137        s: S,
17138    ) -> ::core::result::Result<S::Ok, S::Error> {
17139        ::buffa::extension_registry::serialize_extensions(
17140            "google.protobuf.FeatureSet",
17141            &self.0,
17142            s,
17143        )
17144    }
17145}
17146#[cfg(feature = "json")]
17147impl<'de> ::serde::Deserialize<'de> for __FeatureSetExtJson {
17148    fn deserialize<D: ::serde::Deserializer<'de>>(
17149        d: D,
17150    ) -> ::core::result::Result<Self, D::Error> {
17151        ::buffa::extension_registry::deserialize_extensions(
17152                "google.protobuf.FeatureSet",
17153                d,
17154            )
17155            .map(Self)
17156    }
17157}
17158#[cfg(feature = "json")]
17159#[doc(hidden)]
17160pub const __FEATURE_SET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
17161    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
17162    to_json: ::buffa::type_registry::any_to_json::<FeatureSet>,
17163    from_json: ::buffa::type_registry::any_from_json::<FeatureSet>,
17164    is_wkt: false,
17165};
17166#[cfg(feature = "text")]
17167#[doc(hidden)]
17168pub const __FEATURE_SET_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
17169    type_url: "type.googleapis.com/google.protobuf.FeatureSet",
17170    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSet>,
17171    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSet>,
17172};
17173pub mod feature_set {
17174    #[allow(unused_imports)]
17175    use super::*;
17176    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17177    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17178    #[repr(i32)]
17179    pub enum FieldPresence {
17180        FIELD_PRESENCE_UNKNOWN = 0i32,
17181        EXPLICIT = 1i32,
17182        IMPLICIT = 2i32,
17183        LEGACY_REQUIRED = 3i32,
17184    }
17185    impl FieldPresence {
17186        ///Idiomatic alias for [`Self::FIELD_PRESENCE_UNKNOWN`]; `Debug` prints the variant name.
17187        #[allow(non_upper_case_globals)]
17188        pub const FieldPresenceUnknown: Self = Self::FIELD_PRESENCE_UNKNOWN;
17189        ///Idiomatic alias for [`Self::EXPLICIT`]; `Debug` prints the variant name.
17190        #[allow(non_upper_case_globals)]
17191        pub const Explicit: Self = Self::EXPLICIT;
17192        ///Idiomatic alias for [`Self::IMPLICIT`]; `Debug` prints the variant name.
17193        #[allow(non_upper_case_globals)]
17194        pub const Implicit: Self = Self::IMPLICIT;
17195        ///Idiomatic alias for [`Self::LEGACY_REQUIRED`]; `Debug` prints the variant name.
17196        #[allow(non_upper_case_globals)]
17197        pub const LegacyRequired: Self = Self::LEGACY_REQUIRED;
17198    }
17199    impl ::core::default::Default for FieldPresence {
17200        fn default() -> Self {
17201            Self::FIELD_PRESENCE_UNKNOWN
17202        }
17203    }
17204    #[cfg(feature = "json")]
17205    const _: () = {
17206        impl ::serde::Serialize for FieldPresence {
17207            fn serialize<S: ::serde::Serializer>(
17208                &self,
17209                s: S,
17210            ) -> ::core::result::Result<S::Ok, S::Error> {
17211                s.serialize_str(::buffa::Enumeration::proto_name(self))
17212            }
17213        }
17214        impl<'de> ::serde::Deserialize<'de> for FieldPresence {
17215            fn deserialize<D: ::serde::Deserializer<'de>>(
17216                d: D,
17217            ) -> ::core::result::Result<Self, D::Error> {
17218                struct _V;
17219                impl ::serde::de::Visitor<'_> for _V {
17220                    type Value = FieldPresence;
17221                    fn expecting(
17222                        &self,
17223                        f: &mut ::core::fmt::Formatter<'_>,
17224                    ) -> ::core::fmt::Result {
17225                        f.write_str(
17226                            concat!(
17227                                "a string, integer, or null for ", stringify!(FieldPresence)
17228                            ),
17229                        )
17230                    }
17231                    fn visit_str<E: ::serde::de::Error>(
17232                        self,
17233                        v: &str,
17234                    ) -> ::core::result::Result<FieldPresence, E> {
17235                        <FieldPresence as ::buffa::Enumeration>::from_proto_name(v)
17236                            .ok_or_else(|| {
17237                                ::serde::de::Error::unknown_variant(v, &[])
17238                            })
17239                    }
17240                    fn visit_i64<E: ::serde::de::Error>(
17241                        self,
17242                        v: i64,
17243                    ) -> ::core::result::Result<FieldPresence, E> {
17244                        let v32 = i32::try_from(v)
17245                            .map_err(|_| {
17246                                ::serde::de::Error::custom(
17247                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17248                                )
17249                            })?;
17250                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
17251                            .ok_or_else(|| {
17252                                ::serde::de::Error::custom(
17253                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17254                                )
17255                            })
17256                    }
17257                    fn visit_u64<E: ::serde::de::Error>(
17258                        self,
17259                        v: u64,
17260                    ) -> ::core::result::Result<FieldPresence, E> {
17261                        let v32 = i32::try_from(v)
17262                            .map_err(|_| {
17263                                ::serde::de::Error::custom(
17264                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17265                                )
17266                            })?;
17267                        <FieldPresence as ::buffa::Enumeration>::from_i32(v32)
17268                            .ok_or_else(|| {
17269                                ::serde::de::Error::custom(
17270                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17271                                )
17272                            })
17273                    }
17274                    fn visit_unit<E: ::serde::de::Error>(
17275                        self,
17276                    ) -> ::core::result::Result<FieldPresence, E> {
17277                        ::core::result::Result::Ok(::core::default::Default::default())
17278                    }
17279                }
17280                d.deserialize_any(_V)
17281            }
17282        }
17283        impl ::buffa::json_helpers::ProtoElemJson for FieldPresence {
17284            fn serialize_proto_json<S: ::serde::Serializer>(
17285                v: &Self,
17286                s: S,
17287            ) -> ::core::result::Result<S::Ok, S::Error> {
17288                ::serde::Serialize::serialize(v, s)
17289            }
17290            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17291                d: D,
17292            ) -> ::core::result::Result<Self, D::Error> {
17293                <Self as ::serde::Deserialize>::deserialize(d)
17294            }
17295        }
17296    };
17297    impl ::buffa::Enumeration for FieldPresence {
17298        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17299            match value {
17300                0i32 => ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
17301                1i32 => ::core::option::Option::Some(Self::EXPLICIT),
17302                2i32 => ::core::option::Option::Some(Self::IMPLICIT),
17303                3i32 => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
17304                _ => ::core::option::Option::None,
17305            }
17306        }
17307        fn to_i32(&self) -> i32 {
17308            *self as i32
17309        }
17310        fn proto_name(&self) -> &'static str {
17311            match self {
17312                Self::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN",
17313                Self::EXPLICIT => "EXPLICIT",
17314                Self::IMPLICIT => "IMPLICIT",
17315                Self::LEGACY_REQUIRED => "LEGACY_REQUIRED",
17316            }
17317        }
17318        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17319            match name {
17320                "FIELD_PRESENCE_UNKNOWN" => {
17321                    ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN)
17322                }
17323                "EXPLICIT" => ::core::option::Option::Some(Self::EXPLICIT),
17324                "IMPLICIT" => ::core::option::Option::Some(Self::IMPLICIT),
17325                "LEGACY_REQUIRED" => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
17326                _ => ::core::option::Option::None,
17327            }
17328        }
17329        fn values() -> &'static [Self] {
17330            &[
17331                Self::FIELD_PRESENCE_UNKNOWN,
17332                Self::EXPLICIT,
17333                Self::IMPLICIT,
17334                Self::LEGACY_REQUIRED,
17335            ]
17336        }
17337    }
17338    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17339    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17340    #[repr(i32)]
17341    pub enum EnumType {
17342        ENUM_TYPE_UNKNOWN = 0i32,
17343        OPEN = 1i32,
17344        CLOSED = 2i32,
17345    }
17346    impl EnumType {
17347        ///Idiomatic alias for [`Self::ENUM_TYPE_UNKNOWN`]; `Debug` prints the variant name.
17348        #[allow(non_upper_case_globals)]
17349        pub const EnumTypeUnknown: Self = Self::ENUM_TYPE_UNKNOWN;
17350        ///Idiomatic alias for [`Self::OPEN`]; `Debug` prints the variant name.
17351        #[allow(non_upper_case_globals)]
17352        pub const Open: Self = Self::OPEN;
17353        ///Idiomatic alias for [`Self::CLOSED`]; `Debug` prints the variant name.
17354        #[allow(non_upper_case_globals)]
17355        pub const Closed: Self = Self::CLOSED;
17356    }
17357    impl ::core::default::Default for EnumType {
17358        fn default() -> Self {
17359            Self::ENUM_TYPE_UNKNOWN
17360        }
17361    }
17362    #[cfg(feature = "json")]
17363    const _: () = {
17364        impl ::serde::Serialize for EnumType {
17365            fn serialize<S: ::serde::Serializer>(
17366                &self,
17367                s: S,
17368            ) -> ::core::result::Result<S::Ok, S::Error> {
17369                s.serialize_str(::buffa::Enumeration::proto_name(self))
17370            }
17371        }
17372        impl<'de> ::serde::Deserialize<'de> for EnumType {
17373            fn deserialize<D: ::serde::Deserializer<'de>>(
17374                d: D,
17375            ) -> ::core::result::Result<Self, D::Error> {
17376                struct _V;
17377                impl ::serde::de::Visitor<'_> for _V {
17378                    type Value = EnumType;
17379                    fn expecting(
17380                        &self,
17381                        f: &mut ::core::fmt::Formatter<'_>,
17382                    ) -> ::core::fmt::Result {
17383                        f.write_str(
17384                            concat!(
17385                                "a string, integer, or null for ", stringify!(EnumType)
17386                            ),
17387                        )
17388                    }
17389                    fn visit_str<E: ::serde::de::Error>(
17390                        self,
17391                        v: &str,
17392                    ) -> ::core::result::Result<EnumType, E> {
17393                        <EnumType as ::buffa::Enumeration>::from_proto_name(v)
17394                            .ok_or_else(|| {
17395                                ::serde::de::Error::unknown_variant(v, &[])
17396                            })
17397                    }
17398                    fn visit_i64<E: ::serde::de::Error>(
17399                        self,
17400                        v: i64,
17401                    ) -> ::core::result::Result<EnumType, E> {
17402                        let v32 = i32::try_from(v)
17403                            .map_err(|_| {
17404                                ::serde::de::Error::custom(
17405                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17406                                )
17407                            })?;
17408                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
17409                            .ok_or_else(|| {
17410                                ::serde::de::Error::custom(
17411                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17412                                )
17413                            })
17414                    }
17415                    fn visit_u64<E: ::serde::de::Error>(
17416                        self,
17417                        v: u64,
17418                    ) -> ::core::result::Result<EnumType, E> {
17419                        let v32 = i32::try_from(v)
17420                            .map_err(|_| {
17421                                ::serde::de::Error::custom(
17422                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17423                                )
17424                            })?;
17425                        <EnumType as ::buffa::Enumeration>::from_i32(v32)
17426                            .ok_or_else(|| {
17427                                ::serde::de::Error::custom(
17428                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17429                                )
17430                            })
17431                    }
17432                    fn visit_unit<E: ::serde::de::Error>(
17433                        self,
17434                    ) -> ::core::result::Result<EnumType, E> {
17435                        ::core::result::Result::Ok(::core::default::Default::default())
17436                    }
17437                }
17438                d.deserialize_any(_V)
17439            }
17440        }
17441        impl ::buffa::json_helpers::ProtoElemJson for EnumType {
17442            fn serialize_proto_json<S: ::serde::Serializer>(
17443                v: &Self,
17444                s: S,
17445            ) -> ::core::result::Result<S::Ok, S::Error> {
17446                ::serde::Serialize::serialize(v, s)
17447            }
17448            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17449                d: D,
17450            ) -> ::core::result::Result<Self, D::Error> {
17451                <Self as ::serde::Deserialize>::deserialize(d)
17452            }
17453        }
17454    };
17455    impl ::buffa::Enumeration for EnumType {
17456        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17457            match value {
17458                0i32 => ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
17459                1i32 => ::core::option::Option::Some(Self::OPEN),
17460                2i32 => ::core::option::Option::Some(Self::CLOSED),
17461                _ => ::core::option::Option::None,
17462            }
17463        }
17464        fn to_i32(&self) -> i32 {
17465            *self as i32
17466        }
17467        fn proto_name(&self) -> &'static str {
17468            match self {
17469                Self::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN",
17470                Self::OPEN => "OPEN",
17471                Self::CLOSED => "CLOSED",
17472            }
17473        }
17474        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17475            match name {
17476                "ENUM_TYPE_UNKNOWN" => {
17477                    ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN)
17478                }
17479                "OPEN" => ::core::option::Option::Some(Self::OPEN),
17480                "CLOSED" => ::core::option::Option::Some(Self::CLOSED),
17481                _ => ::core::option::Option::None,
17482            }
17483        }
17484        fn values() -> &'static [Self] {
17485            &[Self::ENUM_TYPE_UNKNOWN, Self::OPEN, Self::CLOSED]
17486        }
17487    }
17488    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17489    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17490    #[repr(i32)]
17491    pub enum RepeatedFieldEncoding {
17492        REPEATED_FIELD_ENCODING_UNKNOWN = 0i32,
17493        PACKED = 1i32,
17494        EXPANDED = 2i32,
17495    }
17496    impl RepeatedFieldEncoding {
17497        ///Idiomatic alias for [`Self::REPEATED_FIELD_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
17498        #[allow(non_upper_case_globals)]
17499        pub const RepeatedFieldEncodingUnknown: Self = Self::REPEATED_FIELD_ENCODING_UNKNOWN;
17500        ///Idiomatic alias for [`Self::PACKED`]; `Debug` prints the variant name.
17501        #[allow(non_upper_case_globals)]
17502        pub const Packed: Self = Self::PACKED;
17503        ///Idiomatic alias for [`Self::EXPANDED`]; `Debug` prints the variant name.
17504        #[allow(non_upper_case_globals)]
17505        pub const Expanded: Self = Self::EXPANDED;
17506    }
17507    impl ::core::default::Default for RepeatedFieldEncoding {
17508        fn default() -> Self {
17509            Self::REPEATED_FIELD_ENCODING_UNKNOWN
17510        }
17511    }
17512    #[cfg(feature = "json")]
17513    const _: () = {
17514        impl ::serde::Serialize for RepeatedFieldEncoding {
17515            fn serialize<S: ::serde::Serializer>(
17516                &self,
17517                s: S,
17518            ) -> ::core::result::Result<S::Ok, S::Error> {
17519                s.serialize_str(::buffa::Enumeration::proto_name(self))
17520            }
17521        }
17522        impl<'de> ::serde::Deserialize<'de> for RepeatedFieldEncoding {
17523            fn deserialize<D: ::serde::Deserializer<'de>>(
17524                d: D,
17525            ) -> ::core::result::Result<Self, D::Error> {
17526                struct _V;
17527                impl ::serde::de::Visitor<'_> for _V {
17528                    type Value = RepeatedFieldEncoding;
17529                    fn expecting(
17530                        &self,
17531                        f: &mut ::core::fmt::Formatter<'_>,
17532                    ) -> ::core::fmt::Result {
17533                        f.write_str(
17534                            concat!(
17535                                "a string, integer, or null for ",
17536                                stringify!(RepeatedFieldEncoding)
17537                            ),
17538                        )
17539                    }
17540                    fn visit_str<E: ::serde::de::Error>(
17541                        self,
17542                        v: &str,
17543                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
17544                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_proto_name(
17545                                v,
17546                            )
17547                            .ok_or_else(|| {
17548                                ::serde::de::Error::unknown_variant(v, &[])
17549                            })
17550                    }
17551                    fn visit_i64<E: ::serde::de::Error>(
17552                        self,
17553                        v: i64,
17554                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
17555                        let v32 = i32::try_from(v)
17556                            .map_err(|_| {
17557                                ::serde::de::Error::custom(
17558                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17559                                )
17560                            })?;
17561                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
17562                            .ok_or_else(|| {
17563                                ::serde::de::Error::custom(
17564                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17565                                )
17566                            })
17567                    }
17568                    fn visit_u64<E: ::serde::de::Error>(
17569                        self,
17570                        v: u64,
17571                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
17572                        let v32 = i32::try_from(v)
17573                            .map_err(|_| {
17574                                ::serde::de::Error::custom(
17575                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17576                                )
17577                            })?;
17578                        <RepeatedFieldEncoding as ::buffa::Enumeration>::from_i32(v32)
17579                            .ok_or_else(|| {
17580                                ::serde::de::Error::custom(
17581                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17582                                )
17583                            })
17584                    }
17585                    fn visit_unit<E: ::serde::de::Error>(
17586                        self,
17587                    ) -> ::core::result::Result<RepeatedFieldEncoding, E> {
17588                        ::core::result::Result::Ok(::core::default::Default::default())
17589                    }
17590                }
17591                d.deserialize_any(_V)
17592            }
17593        }
17594        impl ::buffa::json_helpers::ProtoElemJson for RepeatedFieldEncoding {
17595            fn serialize_proto_json<S: ::serde::Serializer>(
17596                v: &Self,
17597                s: S,
17598            ) -> ::core::result::Result<S::Ok, S::Error> {
17599                ::serde::Serialize::serialize(v, s)
17600            }
17601            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17602                d: D,
17603            ) -> ::core::result::Result<Self, D::Error> {
17604                <Self as ::serde::Deserialize>::deserialize(d)
17605            }
17606        }
17607    };
17608    impl ::buffa::Enumeration for RepeatedFieldEncoding {
17609        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17610            match value {
17611                0i32 => {
17612                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
17613                }
17614                1i32 => ::core::option::Option::Some(Self::PACKED),
17615                2i32 => ::core::option::Option::Some(Self::EXPANDED),
17616                _ => ::core::option::Option::None,
17617            }
17618        }
17619        fn to_i32(&self) -> i32 {
17620            *self as i32
17621        }
17622        fn proto_name(&self) -> &'static str {
17623            match self {
17624                Self::REPEATED_FIELD_ENCODING_UNKNOWN => {
17625                    "REPEATED_FIELD_ENCODING_UNKNOWN"
17626                }
17627                Self::PACKED => "PACKED",
17628                Self::EXPANDED => "EXPANDED",
17629            }
17630        }
17631        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17632            match name {
17633                "REPEATED_FIELD_ENCODING_UNKNOWN" => {
17634                    ::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
17635                }
17636                "PACKED" => ::core::option::Option::Some(Self::PACKED),
17637                "EXPANDED" => ::core::option::Option::Some(Self::EXPANDED),
17638                _ => ::core::option::Option::None,
17639            }
17640        }
17641        fn values() -> &'static [Self] {
17642            &[Self::REPEATED_FIELD_ENCODING_UNKNOWN, Self::PACKED, Self::EXPANDED]
17643        }
17644    }
17645    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17646    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17647    #[repr(i32)]
17648    pub enum Utf8Validation {
17649        UTF8_VALIDATION_UNKNOWN = 0i32,
17650        VERIFY = 2i32,
17651        NONE = 3i32,
17652    }
17653    impl Utf8Validation {
17654        ///Idiomatic alias for [`Self::UTF8_VALIDATION_UNKNOWN`]; `Debug` prints the variant name.
17655        #[allow(non_upper_case_globals)]
17656        pub const Utf8ValidationUnknown: Self = Self::UTF8_VALIDATION_UNKNOWN;
17657        ///Idiomatic alias for [`Self::VERIFY`]; `Debug` prints the variant name.
17658        #[allow(non_upper_case_globals)]
17659        pub const Verify: Self = Self::VERIFY;
17660        ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
17661        #[allow(non_upper_case_globals)]
17662        pub const None: Self = Self::NONE;
17663    }
17664    impl ::core::default::Default for Utf8Validation {
17665        fn default() -> Self {
17666            Self::UTF8_VALIDATION_UNKNOWN
17667        }
17668    }
17669    #[cfg(feature = "json")]
17670    const _: () = {
17671        impl ::serde::Serialize for Utf8Validation {
17672            fn serialize<S: ::serde::Serializer>(
17673                &self,
17674                s: S,
17675            ) -> ::core::result::Result<S::Ok, S::Error> {
17676                s.serialize_str(::buffa::Enumeration::proto_name(self))
17677            }
17678        }
17679        impl<'de> ::serde::Deserialize<'de> for Utf8Validation {
17680            fn deserialize<D: ::serde::Deserializer<'de>>(
17681                d: D,
17682            ) -> ::core::result::Result<Self, D::Error> {
17683                struct _V;
17684                impl ::serde::de::Visitor<'_> for _V {
17685                    type Value = Utf8Validation;
17686                    fn expecting(
17687                        &self,
17688                        f: &mut ::core::fmt::Formatter<'_>,
17689                    ) -> ::core::fmt::Result {
17690                        f.write_str(
17691                            concat!(
17692                                "a string, integer, or null for ",
17693                                stringify!(Utf8Validation)
17694                            ),
17695                        )
17696                    }
17697                    fn visit_str<E: ::serde::de::Error>(
17698                        self,
17699                        v: &str,
17700                    ) -> ::core::result::Result<Utf8Validation, E> {
17701                        <Utf8Validation as ::buffa::Enumeration>::from_proto_name(v)
17702                            .ok_or_else(|| {
17703                                ::serde::de::Error::unknown_variant(v, &[])
17704                            })
17705                    }
17706                    fn visit_i64<E: ::serde::de::Error>(
17707                        self,
17708                        v: i64,
17709                    ) -> ::core::result::Result<Utf8Validation, E> {
17710                        let v32 = i32::try_from(v)
17711                            .map_err(|_| {
17712                                ::serde::de::Error::custom(
17713                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17714                                )
17715                            })?;
17716                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17717                            .ok_or_else(|| {
17718                                ::serde::de::Error::custom(
17719                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17720                                )
17721                            })
17722                    }
17723                    fn visit_u64<E: ::serde::de::Error>(
17724                        self,
17725                        v: u64,
17726                    ) -> ::core::result::Result<Utf8Validation, E> {
17727                        let v32 = i32::try_from(v)
17728                            .map_err(|_| {
17729                                ::serde::de::Error::custom(
17730                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17731                                )
17732                            })?;
17733                        <Utf8Validation as ::buffa::Enumeration>::from_i32(v32)
17734                            .ok_or_else(|| {
17735                                ::serde::de::Error::custom(
17736                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17737                                )
17738                            })
17739                    }
17740                    fn visit_unit<E: ::serde::de::Error>(
17741                        self,
17742                    ) -> ::core::result::Result<Utf8Validation, E> {
17743                        ::core::result::Result::Ok(::core::default::Default::default())
17744                    }
17745                }
17746                d.deserialize_any(_V)
17747            }
17748        }
17749        impl ::buffa::json_helpers::ProtoElemJson for Utf8Validation {
17750            fn serialize_proto_json<S: ::serde::Serializer>(
17751                v: &Self,
17752                s: S,
17753            ) -> ::core::result::Result<S::Ok, S::Error> {
17754                ::serde::Serialize::serialize(v, s)
17755            }
17756            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17757                d: D,
17758            ) -> ::core::result::Result<Self, D::Error> {
17759                <Self as ::serde::Deserialize>::deserialize(d)
17760            }
17761        }
17762    };
17763    impl ::buffa::Enumeration for Utf8Validation {
17764        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17765            match value {
17766                0i32 => ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN),
17767                2i32 => ::core::option::Option::Some(Self::VERIFY),
17768                3i32 => ::core::option::Option::Some(Self::NONE),
17769                _ => ::core::option::Option::None,
17770            }
17771        }
17772        fn to_i32(&self) -> i32 {
17773            *self as i32
17774        }
17775        fn proto_name(&self) -> &'static str {
17776            match self {
17777                Self::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN",
17778                Self::VERIFY => "VERIFY",
17779                Self::NONE => "NONE",
17780            }
17781        }
17782        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17783            match name {
17784                "UTF8_VALIDATION_UNKNOWN" => {
17785                    ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
17786                }
17787                "VERIFY" => ::core::option::Option::Some(Self::VERIFY),
17788                "NONE" => ::core::option::Option::Some(Self::NONE),
17789                _ => ::core::option::Option::None,
17790            }
17791        }
17792        fn values() -> &'static [Self] {
17793            &[Self::UTF8_VALIDATION_UNKNOWN, Self::VERIFY, Self::NONE]
17794        }
17795    }
17796    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17797    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17798    #[repr(i32)]
17799    pub enum MessageEncoding {
17800        MESSAGE_ENCODING_UNKNOWN = 0i32,
17801        LENGTH_PREFIXED = 1i32,
17802        DELIMITED = 2i32,
17803    }
17804    impl MessageEncoding {
17805        ///Idiomatic alias for [`Self::MESSAGE_ENCODING_UNKNOWN`]; `Debug` prints the variant name.
17806        #[allow(non_upper_case_globals)]
17807        pub const MessageEncodingUnknown: Self = Self::MESSAGE_ENCODING_UNKNOWN;
17808        ///Idiomatic alias for [`Self::LENGTH_PREFIXED`]; `Debug` prints the variant name.
17809        #[allow(non_upper_case_globals)]
17810        pub const LengthPrefixed: Self = Self::LENGTH_PREFIXED;
17811        ///Idiomatic alias for [`Self::DELIMITED`]; `Debug` prints the variant name.
17812        #[allow(non_upper_case_globals)]
17813        pub const Delimited: Self = Self::DELIMITED;
17814    }
17815    impl ::core::default::Default for MessageEncoding {
17816        fn default() -> Self {
17817            Self::MESSAGE_ENCODING_UNKNOWN
17818        }
17819    }
17820    #[cfg(feature = "json")]
17821    const _: () = {
17822        impl ::serde::Serialize for MessageEncoding {
17823            fn serialize<S: ::serde::Serializer>(
17824                &self,
17825                s: S,
17826            ) -> ::core::result::Result<S::Ok, S::Error> {
17827                s.serialize_str(::buffa::Enumeration::proto_name(self))
17828            }
17829        }
17830        impl<'de> ::serde::Deserialize<'de> for MessageEncoding {
17831            fn deserialize<D: ::serde::Deserializer<'de>>(
17832                d: D,
17833            ) -> ::core::result::Result<Self, D::Error> {
17834                struct _V;
17835                impl ::serde::de::Visitor<'_> for _V {
17836                    type Value = MessageEncoding;
17837                    fn expecting(
17838                        &self,
17839                        f: &mut ::core::fmt::Formatter<'_>,
17840                    ) -> ::core::fmt::Result {
17841                        f.write_str(
17842                            concat!(
17843                                "a string, integer, or null for ",
17844                                stringify!(MessageEncoding)
17845                            ),
17846                        )
17847                    }
17848                    fn visit_str<E: ::serde::de::Error>(
17849                        self,
17850                        v: &str,
17851                    ) -> ::core::result::Result<MessageEncoding, E> {
17852                        <MessageEncoding as ::buffa::Enumeration>::from_proto_name(v)
17853                            .ok_or_else(|| {
17854                                ::serde::de::Error::unknown_variant(v, &[])
17855                            })
17856                    }
17857                    fn visit_i64<E: ::serde::de::Error>(
17858                        self,
17859                        v: i64,
17860                    ) -> ::core::result::Result<MessageEncoding, E> {
17861                        let v32 = i32::try_from(v)
17862                            .map_err(|_| {
17863                                ::serde::de::Error::custom(
17864                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17865                                )
17866                            })?;
17867                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17868                            .ok_or_else(|| {
17869                                ::serde::de::Error::custom(
17870                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17871                                )
17872                            })
17873                    }
17874                    fn visit_u64<E: ::serde::de::Error>(
17875                        self,
17876                        v: u64,
17877                    ) -> ::core::result::Result<MessageEncoding, E> {
17878                        let v32 = i32::try_from(v)
17879                            .map_err(|_| {
17880                                ::serde::de::Error::custom(
17881                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
17882                                )
17883                            })?;
17884                        <MessageEncoding as ::buffa::Enumeration>::from_i32(v32)
17885                            .ok_or_else(|| {
17886                                ::serde::de::Error::custom(
17887                                    ::buffa::alloc::format!("unknown enum value {v32}"),
17888                                )
17889                            })
17890                    }
17891                    fn visit_unit<E: ::serde::de::Error>(
17892                        self,
17893                    ) -> ::core::result::Result<MessageEncoding, E> {
17894                        ::core::result::Result::Ok(::core::default::Default::default())
17895                    }
17896                }
17897                d.deserialize_any(_V)
17898            }
17899        }
17900        impl ::buffa::json_helpers::ProtoElemJson for MessageEncoding {
17901            fn serialize_proto_json<S: ::serde::Serializer>(
17902                v: &Self,
17903                s: S,
17904            ) -> ::core::result::Result<S::Ok, S::Error> {
17905                ::serde::Serialize::serialize(v, s)
17906            }
17907            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
17908                d: D,
17909            ) -> ::core::result::Result<Self, D::Error> {
17910                <Self as ::serde::Deserialize>::deserialize(d)
17911            }
17912        }
17913    };
17914    impl ::buffa::Enumeration for MessageEncoding {
17915        fn from_i32(value: i32) -> ::core::option::Option<Self> {
17916            match value {
17917                0i32 => ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN),
17918                1i32 => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17919                2i32 => ::core::option::Option::Some(Self::DELIMITED),
17920                _ => ::core::option::Option::None,
17921            }
17922        }
17923        fn to_i32(&self) -> i32 {
17924            *self as i32
17925        }
17926        fn proto_name(&self) -> &'static str {
17927            match self {
17928                Self::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN",
17929                Self::LENGTH_PREFIXED => "LENGTH_PREFIXED",
17930                Self::DELIMITED => "DELIMITED",
17931            }
17932        }
17933        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
17934            match name {
17935                "MESSAGE_ENCODING_UNKNOWN" => {
17936                    ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
17937                }
17938                "LENGTH_PREFIXED" => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
17939                "DELIMITED" => ::core::option::Option::Some(Self::DELIMITED),
17940                _ => ::core::option::Option::None,
17941            }
17942        }
17943        fn values() -> &'static [Self] {
17944            &[Self::MESSAGE_ENCODING_UNKNOWN, Self::LENGTH_PREFIXED, Self::DELIMITED]
17945        }
17946    }
17947    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
17948    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
17949    #[repr(i32)]
17950    pub enum JsonFormat {
17951        JSON_FORMAT_UNKNOWN = 0i32,
17952        ALLOW = 1i32,
17953        LEGACY_BEST_EFFORT = 2i32,
17954    }
17955    impl JsonFormat {
17956        ///Idiomatic alias for [`Self::JSON_FORMAT_UNKNOWN`]; `Debug` prints the variant name.
17957        #[allow(non_upper_case_globals)]
17958        pub const JsonFormatUnknown: Self = Self::JSON_FORMAT_UNKNOWN;
17959        ///Idiomatic alias for [`Self::ALLOW`]; `Debug` prints the variant name.
17960        #[allow(non_upper_case_globals)]
17961        pub const Allow: Self = Self::ALLOW;
17962        ///Idiomatic alias for [`Self::LEGACY_BEST_EFFORT`]; `Debug` prints the variant name.
17963        #[allow(non_upper_case_globals)]
17964        pub const LegacyBestEffort: Self = Self::LEGACY_BEST_EFFORT;
17965    }
17966    impl ::core::default::Default for JsonFormat {
17967        fn default() -> Self {
17968            Self::JSON_FORMAT_UNKNOWN
17969        }
17970    }
17971    #[cfg(feature = "json")]
17972    const _: () = {
17973        impl ::serde::Serialize for JsonFormat {
17974            fn serialize<S: ::serde::Serializer>(
17975                &self,
17976                s: S,
17977            ) -> ::core::result::Result<S::Ok, S::Error> {
17978                s.serialize_str(::buffa::Enumeration::proto_name(self))
17979            }
17980        }
17981        impl<'de> ::serde::Deserialize<'de> for JsonFormat {
17982            fn deserialize<D: ::serde::Deserializer<'de>>(
17983                d: D,
17984            ) -> ::core::result::Result<Self, D::Error> {
17985                struct _V;
17986                impl ::serde::de::Visitor<'_> for _V {
17987                    type Value = JsonFormat;
17988                    fn expecting(
17989                        &self,
17990                        f: &mut ::core::fmt::Formatter<'_>,
17991                    ) -> ::core::fmt::Result {
17992                        f.write_str(
17993                            concat!(
17994                                "a string, integer, or null for ", stringify!(JsonFormat)
17995                            ),
17996                        )
17997                    }
17998                    fn visit_str<E: ::serde::de::Error>(
17999                        self,
18000                        v: &str,
18001                    ) -> ::core::result::Result<JsonFormat, E> {
18002                        <JsonFormat as ::buffa::Enumeration>::from_proto_name(v)
18003                            .ok_or_else(|| {
18004                                ::serde::de::Error::unknown_variant(v, &[])
18005                            })
18006                    }
18007                    fn visit_i64<E: ::serde::de::Error>(
18008                        self,
18009                        v: i64,
18010                    ) -> ::core::result::Result<JsonFormat, E> {
18011                        let v32 = i32::try_from(v)
18012                            .map_err(|_| {
18013                                ::serde::de::Error::custom(
18014                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
18015                                )
18016                            })?;
18017                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
18018                            .ok_or_else(|| {
18019                                ::serde::de::Error::custom(
18020                                    ::buffa::alloc::format!("unknown enum value {v32}"),
18021                                )
18022                            })
18023                    }
18024                    fn visit_u64<E: ::serde::de::Error>(
18025                        self,
18026                        v: u64,
18027                    ) -> ::core::result::Result<JsonFormat, E> {
18028                        let v32 = i32::try_from(v)
18029                            .map_err(|_| {
18030                                ::serde::de::Error::custom(
18031                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
18032                                )
18033                            })?;
18034                        <JsonFormat as ::buffa::Enumeration>::from_i32(v32)
18035                            .ok_or_else(|| {
18036                                ::serde::de::Error::custom(
18037                                    ::buffa::alloc::format!("unknown enum value {v32}"),
18038                                )
18039                            })
18040                    }
18041                    fn visit_unit<E: ::serde::de::Error>(
18042                        self,
18043                    ) -> ::core::result::Result<JsonFormat, E> {
18044                        ::core::result::Result::Ok(::core::default::Default::default())
18045                    }
18046                }
18047                d.deserialize_any(_V)
18048            }
18049        }
18050        impl ::buffa::json_helpers::ProtoElemJson for JsonFormat {
18051            fn serialize_proto_json<S: ::serde::Serializer>(
18052                v: &Self,
18053                s: S,
18054            ) -> ::core::result::Result<S::Ok, S::Error> {
18055                ::serde::Serialize::serialize(v, s)
18056            }
18057            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18058                d: D,
18059            ) -> ::core::result::Result<Self, D::Error> {
18060                <Self as ::serde::Deserialize>::deserialize(d)
18061            }
18062        }
18063    };
18064    impl ::buffa::Enumeration for JsonFormat {
18065        fn from_i32(value: i32) -> ::core::option::Option<Self> {
18066            match value {
18067                0i32 => ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
18068                1i32 => ::core::option::Option::Some(Self::ALLOW),
18069                2i32 => ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT),
18070                _ => ::core::option::Option::None,
18071            }
18072        }
18073        fn to_i32(&self) -> i32 {
18074            *self as i32
18075        }
18076        fn proto_name(&self) -> &'static str {
18077            match self {
18078                Self::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN",
18079                Self::ALLOW => "ALLOW",
18080                Self::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT",
18081            }
18082        }
18083        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
18084            match name {
18085                "JSON_FORMAT_UNKNOWN" => {
18086                    ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN)
18087                }
18088                "ALLOW" => ::core::option::Option::Some(Self::ALLOW),
18089                "LEGACY_BEST_EFFORT" => {
18090                    ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT)
18091                }
18092                _ => ::core::option::Option::None,
18093            }
18094        }
18095        fn values() -> &'static [Self] {
18096            &[Self::JSON_FORMAT_UNKNOWN, Self::ALLOW, Self::LEGACY_BEST_EFFORT]
18097        }
18098    }
18099    #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
18100    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18101    #[repr(i32)]
18102    pub enum EnforceNamingStyle {
18103        ENFORCE_NAMING_STYLE_UNKNOWN = 0i32,
18104        STYLE2024 = 1i32,
18105        STYLE_LEGACY = 2i32,
18106    }
18107    impl EnforceNamingStyle {
18108        ///Idiomatic alias for [`Self::ENFORCE_NAMING_STYLE_UNKNOWN`]; `Debug` prints the variant name.
18109        #[allow(non_upper_case_globals)]
18110        pub const EnforceNamingStyleUnknown: Self = Self::ENFORCE_NAMING_STYLE_UNKNOWN;
18111        ///Idiomatic alias for [`Self::STYLE2024`]; `Debug` prints the variant name.
18112        #[allow(non_upper_case_globals)]
18113        pub const Style2024: Self = Self::STYLE2024;
18114        ///Idiomatic alias for [`Self::STYLE_LEGACY`]; `Debug` prints the variant name.
18115        #[allow(non_upper_case_globals)]
18116        pub const StyleLegacy: Self = Self::STYLE_LEGACY;
18117    }
18118    impl ::core::default::Default for EnforceNamingStyle {
18119        fn default() -> Self {
18120            Self::ENFORCE_NAMING_STYLE_UNKNOWN
18121        }
18122    }
18123    #[cfg(feature = "json")]
18124    const _: () = {
18125        impl ::serde::Serialize for EnforceNamingStyle {
18126            fn serialize<S: ::serde::Serializer>(
18127                &self,
18128                s: S,
18129            ) -> ::core::result::Result<S::Ok, S::Error> {
18130                s.serialize_str(::buffa::Enumeration::proto_name(self))
18131            }
18132        }
18133        impl<'de> ::serde::Deserialize<'de> for EnforceNamingStyle {
18134            fn deserialize<D: ::serde::Deserializer<'de>>(
18135                d: D,
18136            ) -> ::core::result::Result<Self, D::Error> {
18137                struct _V;
18138                impl ::serde::de::Visitor<'_> for _V {
18139                    type Value = EnforceNamingStyle;
18140                    fn expecting(
18141                        &self,
18142                        f: &mut ::core::fmt::Formatter<'_>,
18143                    ) -> ::core::fmt::Result {
18144                        f.write_str(
18145                            concat!(
18146                                "a string, integer, or null for ",
18147                                stringify!(EnforceNamingStyle)
18148                            ),
18149                        )
18150                    }
18151                    fn visit_str<E: ::serde::de::Error>(
18152                        self,
18153                        v: &str,
18154                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
18155                        <EnforceNamingStyle as ::buffa::Enumeration>::from_proto_name(v)
18156                            .ok_or_else(|| {
18157                                ::serde::de::Error::unknown_variant(v, &[])
18158                            })
18159                    }
18160                    fn visit_i64<E: ::serde::de::Error>(
18161                        self,
18162                        v: i64,
18163                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
18164                        let v32 = i32::try_from(v)
18165                            .map_err(|_| {
18166                                ::serde::de::Error::custom(
18167                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
18168                                )
18169                            })?;
18170                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
18171                            .ok_or_else(|| {
18172                                ::serde::de::Error::custom(
18173                                    ::buffa::alloc::format!("unknown enum value {v32}"),
18174                                )
18175                            })
18176                    }
18177                    fn visit_u64<E: ::serde::de::Error>(
18178                        self,
18179                        v: u64,
18180                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
18181                        let v32 = i32::try_from(v)
18182                            .map_err(|_| {
18183                                ::serde::de::Error::custom(
18184                                    ::buffa::alloc::format!("enum value {v} out of i32 range"),
18185                                )
18186                            })?;
18187                        <EnforceNamingStyle as ::buffa::Enumeration>::from_i32(v32)
18188                            .ok_or_else(|| {
18189                                ::serde::de::Error::custom(
18190                                    ::buffa::alloc::format!("unknown enum value {v32}"),
18191                                )
18192                            })
18193                    }
18194                    fn visit_unit<E: ::serde::de::Error>(
18195                        self,
18196                    ) -> ::core::result::Result<EnforceNamingStyle, E> {
18197                        ::core::result::Result::Ok(::core::default::Default::default())
18198                    }
18199                }
18200                d.deserialize_any(_V)
18201            }
18202        }
18203        impl ::buffa::json_helpers::ProtoElemJson for EnforceNamingStyle {
18204            fn serialize_proto_json<S: ::serde::Serializer>(
18205                v: &Self,
18206                s: S,
18207            ) -> ::core::result::Result<S::Ok, S::Error> {
18208                ::serde::Serialize::serialize(v, s)
18209            }
18210            fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18211                d: D,
18212            ) -> ::core::result::Result<Self, D::Error> {
18213                <Self as ::serde::Deserialize>::deserialize(d)
18214            }
18215        }
18216    };
18217    impl ::buffa::Enumeration for EnforceNamingStyle {
18218        fn from_i32(value: i32) -> ::core::option::Option<Self> {
18219            match value {
18220                0i32 => ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN),
18221                1i32 => ::core::option::Option::Some(Self::STYLE2024),
18222                2i32 => ::core::option::Option::Some(Self::STYLE_LEGACY),
18223                _ => ::core::option::Option::None,
18224            }
18225        }
18226        fn to_i32(&self) -> i32 {
18227            *self as i32
18228        }
18229        fn proto_name(&self) -> &'static str {
18230            match self {
18231                Self::ENFORCE_NAMING_STYLE_UNKNOWN => "ENFORCE_NAMING_STYLE_UNKNOWN",
18232                Self::STYLE2024 => "STYLE2024",
18233                Self::STYLE_LEGACY => "STYLE_LEGACY",
18234            }
18235        }
18236        fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
18237            match name {
18238                "ENFORCE_NAMING_STYLE_UNKNOWN" => {
18239                    ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN)
18240                }
18241                "STYLE2024" => ::core::option::Option::Some(Self::STYLE2024),
18242                "STYLE_LEGACY" => ::core::option::Option::Some(Self::STYLE_LEGACY),
18243                _ => ::core::option::Option::None,
18244            }
18245        }
18246        fn values() -> &'static [Self] {
18247            &[Self::ENFORCE_NAMING_STYLE_UNKNOWN, Self::STYLE2024, Self::STYLE_LEGACY]
18248        }
18249    }
18250    #[derive(Clone, PartialEq, Default)]
18251    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18252    #[cfg_attr(feature = "json", serde(default))]
18253    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18254    pub struct VisibilityFeature {
18255        #[cfg_attr(feature = "json", serde(skip))]
18256        #[doc(hidden)]
18257        pub __buffa_unknown_fields: ::buffa::UnknownFields,
18258    }
18259    impl ::core::fmt::Debug for VisibilityFeature {
18260        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18261            f.debug_struct("VisibilityFeature").finish()
18262        }
18263    }
18264    impl VisibilityFeature {
18265        /// Protobuf type URL for this message, for use with `Any::pack` and
18266        /// `Any::unpack_if`.
18267        ///
18268        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18269        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
18270    }
18271    impl ::buffa::DefaultInstance for VisibilityFeature {
18272        fn default_instance() -> &'static Self {
18273            static VALUE: ::buffa::__private::OnceBox<VisibilityFeature> = ::buffa::__private::OnceBox::new();
18274            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
18275        }
18276    }
18277    impl ::buffa::MessageName for VisibilityFeature {
18278        const PACKAGE: &'static str = "google.protobuf";
18279        const NAME: &'static str = "FeatureSet.VisibilityFeature";
18280        const FULL_NAME: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
18281        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
18282    }
18283    impl ::buffa::Message for VisibilityFeature {
18284        /// Returns the total encoded size in bytes.
18285        ///
18286        /// The result is a `u32`; the protobuf specification requires all
18287        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
18288        /// compliant message will never overflow this type.
18289        #[allow(clippy::let_and_return)]
18290        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
18291            #[allow(unused_imports)]
18292            use ::buffa::Enumeration as _;
18293            let mut size = 0u32;
18294            size += self.__buffa_unknown_fields.encoded_len() as u32;
18295            size
18296        }
18297        fn write_to(
18298            &self,
18299            _cache: &mut ::buffa::SizeCache,
18300            buf: &mut impl ::buffa::bytes::BufMut,
18301        ) {
18302            #[allow(unused_imports)]
18303            use ::buffa::Enumeration as _;
18304            self.__buffa_unknown_fields.write_to(buf);
18305        }
18306        fn merge_field(
18307            &mut self,
18308            tag: ::buffa::encoding::Tag,
18309            buf: &mut impl ::buffa::bytes::Buf,
18310            depth: u32,
18311        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18312            #[allow(unused_imports)]
18313            use ::buffa::bytes::Buf as _;
18314            #[allow(unused_imports)]
18315            use ::buffa::Enumeration as _;
18316            match tag.field_number() {
18317                _ => {
18318                    self.__buffa_unknown_fields
18319                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
18320                }
18321            }
18322            ::core::result::Result::Ok(())
18323        }
18324        fn clear(&mut self) {
18325            self.__buffa_unknown_fields.clear();
18326        }
18327    }
18328    impl ::buffa::ExtensionSet for VisibilityFeature {
18329        const PROTO_FQN: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
18330        fn unknown_fields(&self) -> &::buffa::UnknownFields {
18331            &self.__buffa_unknown_fields
18332        }
18333        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18334            &mut self.__buffa_unknown_fields
18335        }
18336    }
18337    #[cfg(feature = "text")]
18338    impl ::buffa::text::TextFormat for VisibilityFeature {
18339        fn encode_text(
18340            &self,
18341            enc: &mut ::buffa::text::TextEncoder<'_>,
18342        ) -> ::core::fmt::Result {
18343            #[allow(unused_imports)]
18344            use ::buffa::Enumeration as _;
18345            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18346            ::core::result::Result::Ok(())
18347        }
18348        fn merge_text(
18349            &mut self,
18350            dec: &mut ::buffa::text::TextDecoder<'_>,
18351        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18352            #[allow(unused_imports)]
18353            use ::buffa::Enumeration as _;
18354            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18355                match __name {
18356                    _ => dec.skip_value()?,
18357                }
18358            }
18359            ::core::result::Result::Ok(())
18360        }
18361    }
18362    #[cfg(feature = "json")]
18363    impl ::buffa::json_helpers::ProtoElemJson for VisibilityFeature {
18364        fn serialize_proto_json<S: ::serde::Serializer>(
18365            v: &Self,
18366            s: S,
18367        ) -> ::core::result::Result<S::Ok, S::Error> {
18368            ::serde::Serialize::serialize(v, s)
18369        }
18370        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18371            d: D,
18372        ) -> ::core::result::Result<Self, D::Error> {
18373            <Self as ::serde::Deserialize>::deserialize(d)
18374        }
18375    }
18376    #[cfg(feature = "json")]
18377    #[doc(hidden)]
18378    pub const __VISIBILITY_FEATURE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18379        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
18380        to_json: ::buffa::type_registry::any_to_json::<VisibilityFeature>,
18381        from_json: ::buffa::type_registry::any_from_json::<VisibilityFeature>,
18382        is_wkt: false,
18383    };
18384    #[cfg(feature = "text")]
18385    #[doc(hidden)]
18386    pub const __VISIBILITY_FEATURE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18387        type_url: "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature",
18388        text_encode: ::buffa::type_registry::any_encode_text::<VisibilityFeature>,
18389        text_merge: ::buffa::type_registry::any_merge_text::<VisibilityFeature>,
18390    };
18391    pub mod visibility_feature {
18392        #[allow(unused_imports)]
18393        use super::*;
18394        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
18395        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18396        #[repr(i32)]
18397        pub enum DefaultSymbolVisibility {
18398            DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0i32,
18399            /// Default pre-EDITION_2024, all UNSET visibility are export.
18400            EXPORT_ALL = 1i32,
18401            /// All top-level symbols default to export, nested default to local.
18402            EXPORT_TOP_LEVEL = 2i32,
18403            /// All symbols default to local.
18404            LOCAL_ALL = 3i32,
18405            /// All symbols local by default. Nested types cannot be exported.
18406            /// With special case caveat for message { enum {} reserved 1 to max; }
18407            /// This is the recommended setting for new protos.
18408            STRICT = 4i32,
18409        }
18410        impl DefaultSymbolVisibility {
18411            ///Idiomatic alias for [`Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`]; `Debug` prints the variant name.
18412            #[allow(non_upper_case_globals)]
18413            pub const DefaultSymbolVisibilityUnknown: Self = Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN;
18414            ///Idiomatic alias for [`Self::EXPORT_ALL`]; `Debug` prints the variant name.
18415            #[allow(non_upper_case_globals)]
18416            pub const ExportAll: Self = Self::EXPORT_ALL;
18417            ///Idiomatic alias for [`Self::EXPORT_TOP_LEVEL`]; `Debug` prints the variant name.
18418            #[allow(non_upper_case_globals)]
18419            pub const ExportTopLevel: Self = Self::EXPORT_TOP_LEVEL;
18420            ///Idiomatic alias for [`Self::LOCAL_ALL`]; `Debug` prints the variant name.
18421            #[allow(non_upper_case_globals)]
18422            pub const LocalAll: Self = Self::LOCAL_ALL;
18423            ///Idiomatic alias for [`Self::STRICT`]; `Debug` prints the variant name.
18424            #[allow(non_upper_case_globals)]
18425            pub const Strict: Self = Self::STRICT;
18426        }
18427        impl ::core::default::Default for DefaultSymbolVisibility {
18428            fn default() -> Self {
18429                Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
18430            }
18431        }
18432        #[cfg(feature = "json")]
18433        const _: () = {
18434            impl ::serde::Serialize for DefaultSymbolVisibility {
18435                fn serialize<S: ::serde::Serializer>(
18436                    &self,
18437                    s: S,
18438                ) -> ::core::result::Result<S::Ok, S::Error> {
18439                    s.serialize_str(::buffa::Enumeration::proto_name(self))
18440                }
18441            }
18442            impl<'de> ::serde::Deserialize<'de> for DefaultSymbolVisibility {
18443                fn deserialize<D: ::serde::Deserializer<'de>>(
18444                    d: D,
18445                ) -> ::core::result::Result<Self, D::Error> {
18446                    struct _V;
18447                    impl ::serde::de::Visitor<'_> for _V {
18448                        type Value = DefaultSymbolVisibility;
18449                        fn expecting(
18450                            &self,
18451                            f: &mut ::core::fmt::Formatter<'_>,
18452                        ) -> ::core::fmt::Result {
18453                            f.write_str(
18454                                concat!(
18455                                    "a string, integer, or null for ",
18456                                    stringify!(DefaultSymbolVisibility)
18457                                ),
18458                            )
18459                        }
18460                        fn visit_str<E: ::serde::de::Error>(
18461                            self,
18462                            v: &str,
18463                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
18464                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_proto_name(
18465                                    v,
18466                                )
18467                                .ok_or_else(|| {
18468                                    ::serde::de::Error::unknown_variant(v, &[])
18469                                })
18470                        }
18471                        fn visit_i64<E: ::serde::de::Error>(
18472                            self,
18473                            v: i64,
18474                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
18475                            let v32 = i32::try_from(v)
18476                                .map_err(|_| {
18477                                    ::serde::de::Error::custom(
18478                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
18479                                    )
18480                                })?;
18481                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
18482                                    v32,
18483                                )
18484                                .ok_or_else(|| {
18485                                    ::serde::de::Error::custom(
18486                                        ::buffa::alloc::format!("unknown enum value {v32}"),
18487                                    )
18488                                })
18489                        }
18490                        fn visit_u64<E: ::serde::de::Error>(
18491                            self,
18492                            v: u64,
18493                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
18494                            let v32 = i32::try_from(v)
18495                                .map_err(|_| {
18496                                    ::serde::de::Error::custom(
18497                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
18498                                    )
18499                                })?;
18500                            <DefaultSymbolVisibility as ::buffa::Enumeration>::from_i32(
18501                                    v32,
18502                                )
18503                                .ok_or_else(|| {
18504                                    ::serde::de::Error::custom(
18505                                        ::buffa::alloc::format!("unknown enum value {v32}"),
18506                                    )
18507                                })
18508                        }
18509                        fn visit_unit<E: ::serde::de::Error>(
18510                            self,
18511                        ) -> ::core::result::Result<DefaultSymbolVisibility, E> {
18512                            ::core::result::Result::Ok(
18513                                ::core::default::Default::default(),
18514                            )
18515                        }
18516                    }
18517                    d.deserialize_any(_V)
18518                }
18519            }
18520            impl ::buffa::json_helpers::ProtoElemJson for DefaultSymbolVisibility {
18521                fn serialize_proto_json<S: ::serde::Serializer>(
18522                    v: &Self,
18523                    s: S,
18524                ) -> ::core::result::Result<S::Ok, S::Error> {
18525                    ::serde::Serialize::serialize(v, s)
18526                }
18527                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18528                    d: D,
18529                ) -> ::core::result::Result<Self, D::Error> {
18530                    <Self as ::serde::Deserialize>::deserialize(d)
18531                }
18532            }
18533        };
18534        impl ::buffa::Enumeration for DefaultSymbolVisibility {
18535            fn from_i32(value: i32) -> ::core::option::Option<Self> {
18536                match value {
18537                    0i32 => {
18538                        ::core::option::Option::Some(
18539                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
18540                        )
18541                    }
18542                    1i32 => ::core::option::Option::Some(Self::EXPORT_ALL),
18543                    2i32 => ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL),
18544                    3i32 => ::core::option::Option::Some(Self::LOCAL_ALL),
18545                    4i32 => ::core::option::Option::Some(Self::STRICT),
18546                    _ => ::core::option::Option::None,
18547                }
18548            }
18549            fn to_i32(&self) -> i32 {
18550                *self as i32
18551            }
18552            fn proto_name(&self) -> &'static str {
18553                match self {
18554                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => {
18555                        "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"
18556                    }
18557                    Self::EXPORT_ALL => "EXPORT_ALL",
18558                    Self::EXPORT_TOP_LEVEL => "EXPORT_TOP_LEVEL",
18559                    Self::LOCAL_ALL => "LOCAL_ALL",
18560                    Self::STRICT => "STRICT",
18561                }
18562            }
18563            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
18564                match name {
18565                    "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => {
18566                        ::core::option::Option::Some(
18567                            Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
18568                        )
18569                    }
18570                    "EXPORT_ALL" => ::core::option::Option::Some(Self::EXPORT_ALL),
18571                    "EXPORT_TOP_LEVEL" => {
18572                        ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL)
18573                    }
18574                    "LOCAL_ALL" => ::core::option::Option::Some(Self::LOCAL_ALL),
18575                    "STRICT" => ::core::option::Option::Some(Self::STRICT),
18576                    _ => ::core::option::Option::None,
18577                }
18578            }
18579            fn values() -> &'static [Self] {
18580                &[
18581                    Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
18582                    Self::EXPORT_ALL,
18583                    Self::EXPORT_TOP_LEVEL,
18584                    Self::LOCAL_ALL,
18585                    Self::STRICT,
18586                ]
18587            }
18588        }
18589    }
18590    #[cfg(feature = "views")]
18591    #[doc(inline)]
18592    pub use super::__buffa::view::feature_set::VisibilityFeatureView;
18593    #[cfg(feature = "views")]
18594    #[doc(inline)]
18595    pub use super::__buffa::view::feature_set::VisibilityFeatureOwnedView;
18596}
18597/// A compiled specification for the defaults of a set of features.  These
18598/// messages are generated from FeatureSet extensions and can be used to seed
18599/// feature resolution. The resolution with this object becomes a simple search
18600/// for the closest matching edition, followed by proto merges.
18601#[derive(Clone, PartialEq, Default)]
18602#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18603#[cfg_attr(feature = "json", serde(default))]
18604#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18605pub struct FeatureSetDefaults {
18606    /// Field 1: `defaults`
18607    #[cfg_attr(
18608        feature = "json",
18609        serde(
18610            rename = "defaults",
18611            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
18612            deserialize_with = "::buffa::json_helpers::null_as_default"
18613        )
18614    )]
18615    pub defaults: ::buffa::alloc::vec::Vec<
18616        feature_set_defaults::FeatureSetEditionDefault,
18617    >,
18618    /// The minimum supported edition (inclusive) when this was constructed.
18619    /// Editions before this will not have defaults.
18620    ///
18621    /// Field 4: `minimum_edition`
18622    #[cfg_attr(
18623        feature = "json",
18624        serde(
18625            rename = "minimumEdition",
18626            alias = "minimum_edition",
18627            with = "::buffa::json_helpers::opt_closed_enum",
18628            skip_serializing_if = "::core::option::Option::is_none"
18629        )
18630    )]
18631    pub minimum_edition: ::core::option::Option<Edition>,
18632    /// The maximum known edition (inclusive) when this was constructed. Editions
18633    /// after this will not have reliable defaults.
18634    ///
18635    /// Field 5: `maximum_edition`
18636    #[cfg_attr(
18637        feature = "json",
18638        serde(
18639            rename = "maximumEdition",
18640            alias = "maximum_edition",
18641            with = "::buffa::json_helpers::opt_closed_enum",
18642            skip_serializing_if = "::core::option::Option::is_none"
18643        )
18644    )]
18645    pub maximum_edition: ::core::option::Option<Edition>,
18646    #[cfg_attr(feature = "json", serde(skip))]
18647    #[doc(hidden)]
18648    pub __buffa_unknown_fields: ::buffa::UnknownFields,
18649}
18650impl ::core::fmt::Debug for FeatureSetDefaults {
18651    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18652        f.debug_struct("FeatureSetDefaults")
18653            .field("defaults", &self.defaults)
18654            .field("minimum_edition", &self.minimum_edition)
18655            .field("maximum_edition", &self.maximum_edition)
18656            .finish()
18657    }
18658}
18659impl FeatureSetDefaults {
18660    /// Protobuf type URL for this message, for use with `Any::pack` and
18661    /// `Any::unpack_if`.
18662    ///
18663    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18664    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
18665}
18666impl FeatureSetDefaults {
18667    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18668    #[inline]
18669    ///Sets [`Self::minimum_edition`] to `Some(value)`, consuming and returning `self`.
18670    pub fn with_minimum_edition(mut self, value: impl Into<Edition>) -> Self {
18671        self.minimum_edition = Some(value.into());
18672        self
18673    }
18674    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18675    #[inline]
18676    ///Sets [`Self::maximum_edition`] to `Some(value)`, consuming and returning `self`.
18677    pub fn with_maximum_edition(mut self, value: impl Into<Edition>) -> Self {
18678        self.maximum_edition = Some(value.into());
18679        self
18680    }
18681}
18682impl ::buffa::DefaultInstance for FeatureSetDefaults {
18683    fn default_instance() -> &'static Self {
18684        static VALUE: ::buffa::__private::OnceBox<FeatureSetDefaults> = ::buffa::__private::OnceBox::new();
18685        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
18686    }
18687}
18688impl ::buffa::MessageName for FeatureSetDefaults {
18689    const PACKAGE: &'static str = "google.protobuf";
18690    const NAME: &'static str = "FeatureSetDefaults";
18691    const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults";
18692    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
18693}
18694impl ::buffa::Message for FeatureSetDefaults {
18695    /// Returns the total encoded size in bytes.
18696    ///
18697    /// The result is a `u32`; the protobuf specification requires all
18698    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
18699    /// compliant message will never overflow this type.
18700    #[allow(clippy::let_and_return)]
18701    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
18702        #[allow(unused_imports)]
18703        use ::buffa::Enumeration as _;
18704        let mut size = 0u32;
18705        for v in &self.defaults {
18706            let __slot = __cache.reserve();
18707            let inner_size = v.compute_size(__cache);
18708            __cache.set(__slot, inner_size);
18709            size
18710                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
18711                    + inner_size;
18712        }
18713        if let Some(ref v) = self.minimum_edition {
18714            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
18715        }
18716        if let Some(ref v) = self.maximum_edition {
18717            size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
18718        }
18719        size += self.__buffa_unknown_fields.encoded_len() as u32;
18720        size
18721    }
18722    fn write_to(
18723        &self,
18724        __cache: &mut ::buffa::SizeCache,
18725        buf: &mut impl ::buffa::bytes::BufMut,
18726    ) {
18727        #[allow(unused_imports)]
18728        use ::buffa::Enumeration as _;
18729        for v in &self.defaults {
18730            ::buffa::encoding::Tag::new(
18731                    1u32,
18732                    ::buffa::encoding::WireType::LengthDelimited,
18733                )
18734                .encode(buf);
18735            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
18736            v.write_to(__cache, buf);
18737        }
18738        if let Some(ref v) = self.minimum_edition {
18739            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
18740                .encode(buf);
18741            ::buffa::types::encode_int32(v.to_i32(), buf);
18742        }
18743        if let Some(ref v) = self.maximum_edition {
18744            ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
18745                .encode(buf);
18746            ::buffa::types::encode_int32(v.to_i32(), buf);
18747        }
18748        self.__buffa_unknown_fields.write_to(buf);
18749    }
18750    fn merge_field(
18751        &mut self,
18752        tag: ::buffa::encoding::Tag,
18753        buf: &mut impl ::buffa::bytes::Buf,
18754        depth: u32,
18755    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
18756        #[allow(unused_imports)]
18757        use ::buffa::bytes::Buf as _;
18758        #[allow(unused_imports)]
18759        use ::buffa::Enumeration as _;
18760        match tag.field_number() {
18761            1u32 => {
18762                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
18763                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
18764                        field_number: 1u32,
18765                        expected: 2u8,
18766                        actual: tag.wire_type() as u8,
18767                    });
18768                }
18769                let mut elem = ::core::default::Default::default();
18770                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
18771                self.defaults.push(elem);
18772            }
18773            4u32 => {
18774                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
18775                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
18776                        field_number: 4u32,
18777                        expected: 0u8,
18778                        actual: tag.wire_type() as u8,
18779                    });
18780                }
18781                let __raw = ::buffa::types::decode_int32(buf)?;
18782                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18783                    __raw,
18784                ) {
18785                    self.minimum_edition = ::core::option::Option::Some(__v);
18786                } else {
18787                    self.__buffa_unknown_fields
18788                        .push(::buffa::UnknownField {
18789                            number: 4u32,
18790                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18791                        });
18792                }
18793            }
18794            5u32 => {
18795                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
18796                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
18797                        field_number: 5u32,
18798                        expected: 0u8,
18799                        actual: tag.wire_type() as u8,
18800                    });
18801                }
18802                let __raw = ::buffa::types::decode_int32(buf)?;
18803                if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
18804                    __raw,
18805                ) {
18806                    self.maximum_edition = ::core::option::Option::Some(__v);
18807                } else {
18808                    self.__buffa_unknown_fields
18809                        .push(::buffa::UnknownField {
18810                            number: 5u32,
18811                            data: ::buffa::UnknownFieldData::Varint(__raw as u64),
18812                        });
18813                }
18814            }
18815            _ => {
18816                self.__buffa_unknown_fields
18817                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
18818            }
18819        }
18820        ::core::result::Result::Ok(())
18821    }
18822    fn clear(&mut self) {
18823        self.defaults.clear();
18824        self.minimum_edition = ::core::option::Option::None;
18825        self.maximum_edition = ::core::option::Option::None;
18826        self.__buffa_unknown_fields.clear();
18827    }
18828}
18829impl ::buffa::ExtensionSet for FeatureSetDefaults {
18830    const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults";
18831    fn unknown_fields(&self) -> &::buffa::UnknownFields {
18832        &self.__buffa_unknown_fields
18833    }
18834    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
18835        &mut self.__buffa_unknown_fields
18836    }
18837}
18838#[cfg(feature = "text")]
18839impl ::buffa::text::TextFormat for FeatureSetDefaults {
18840    fn encode_text(
18841        &self,
18842        enc: &mut ::buffa::text::TextEncoder<'_>,
18843    ) -> ::core::fmt::Result {
18844        #[allow(unused_imports)]
18845        use ::buffa::Enumeration as _;
18846        if let ::core::option::Option::Some(ref __v) = self.minimum_edition {
18847            enc.write_field_name("minimum_edition")?;
18848            enc.write_enum_name(__v.proto_name())?;
18849        }
18850        if let ::core::option::Option::Some(ref __v) = self.maximum_edition {
18851            enc.write_field_name("maximum_edition")?;
18852            enc.write_enum_name(__v.proto_name())?;
18853        }
18854        for __v in &self.defaults {
18855            enc.write_field_name("defaults")?;
18856            enc.write_message(__v)?;
18857        }
18858        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
18859        ::core::result::Result::Ok(())
18860    }
18861    fn merge_text(
18862        &mut self,
18863        dec: &mut ::buffa::text::TextDecoder<'_>,
18864    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
18865        #[allow(unused_imports)]
18866        use ::buffa::Enumeration as _;
18867        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
18868            match __name {
18869                "minimum_edition" => {
18870                    self.minimum_edition = ::core::option::Option::Some(
18871                        dec.read_closed_enum_by_name::<Edition>()?,
18872                    );
18873                }
18874                "maximum_edition" => {
18875                    self.maximum_edition = ::core::option::Option::Some(
18876                        dec.read_closed_enum_by_name::<Edition>()?,
18877                    );
18878                }
18879                "defaults" => {
18880                    dec.read_repeated_into(
18881                        &mut self.defaults,
18882                        |__d| {
18883                            let mut __m = ::core::default::Default::default();
18884                            __d.merge_message(&mut __m)?;
18885                            ::core::result::Result::Ok(__m)
18886                        },
18887                    )?
18888                }
18889                _ => dec.skip_value()?,
18890            }
18891        }
18892        ::core::result::Result::Ok(())
18893    }
18894}
18895#[cfg(feature = "json")]
18896impl ::buffa::json_helpers::ProtoElemJson for FeatureSetDefaults {
18897    fn serialize_proto_json<S: ::serde::Serializer>(
18898        v: &Self,
18899        s: S,
18900    ) -> ::core::result::Result<S::Ok, S::Error> {
18901        ::serde::Serialize::serialize(v, s)
18902    }
18903    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
18904        d: D,
18905    ) -> ::core::result::Result<Self, D::Error> {
18906        <Self as ::serde::Deserialize>::deserialize(d)
18907    }
18908}
18909#[cfg(feature = "json")]
18910#[doc(hidden)]
18911pub const __FEATURE_SET_DEFAULTS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
18912    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18913    to_json: ::buffa::type_registry::any_to_json::<FeatureSetDefaults>,
18914    from_json: ::buffa::type_registry::any_from_json::<FeatureSetDefaults>,
18915    is_wkt: false,
18916};
18917#[cfg(feature = "text")]
18918#[doc(hidden)]
18919pub const __FEATURE_SET_DEFAULTS_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
18920    type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults",
18921    text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetDefaults>,
18922    text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetDefaults>,
18923};
18924pub mod feature_set_defaults {
18925    #[allow(unused_imports)]
18926    use super::*;
18927    /// A map from every known edition with a unique set of defaults to its
18928    /// defaults. Not all editions may be contained here.  For a given edition,
18929    /// the defaults at the closest matching edition ordered at or before it should
18930    /// be used.  This field must be in strict ascending order by edition.
18931    #[derive(Clone, PartialEq, Default)]
18932    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
18933    #[cfg_attr(feature = "json", serde(default))]
18934    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
18935    pub struct FeatureSetEditionDefault {
18936        /// Field 3: `edition`
18937        #[cfg_attr(
18938            feature = "json",
18939            serde(
18940                rename = "edition",
18941                with = "::buffa::json_helpers::opt_closed_enum",
18942                skip_serializing_if = "::core::option::Option::is_none"
18943            )
18944        )]
18945        pub edition: ::core::option::Option<super::Edition>,
18946        /// Defaults of features that can be overridden in this edition.
18947        ///
18948        /// Field 4: `overridable_features`
18949        #[cfg_attr(
18950            feature = "json",
18951            serde(
18952                rename = "overridableFeatures",
18953                alias = "overridable_features",
18954                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18955            )
18956        )]
18957        pub overridable_features: ::buffa::MessageField<super::FeatureSet>,
18958        /// Defaults of features that can't be overridden in this edition.
18959        ///
18960        /// Field 5: `fixed_features`
18961        #[cfg_attr(
18962            feature = "json",
18963            serde(
18964                rename = "fixedFeatures",
18965                alias = "fixed_features",
18966                skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
18967            )
18968        )]
18969        pub fixed_features: ::buffa::MessageField<super::FeatureSet>,
18970        #[cfg_attr(feature = "json", serde(skip))]
18971        #[doc(hidden)]
18972        pub __buffa_unknown_fields: ::buffa::UnknownFields,
18973    }
18974    impl ::core::fmt::Debug for FeatureSetEditionDefault {
18975        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18976            f.debug_struct("FeatureSetEditionDefault")
18977                .field("edition", &self.edition)
18978                .field("overridable_features", &self.overridable_features)
18979                .field("fixed_features", &self.fixed_features)
18980                .finish()
18981        }
18982    }
18983    impl FeatureSetEditionDefault {
18984        /// Protobuf type URL for this message, for use with `Any::pack` and
18985        /// `Any::unpack_if`.
18986        ///
18987        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
18988        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
18989    }
18990    impl FeatureSetEditionDefault {
18991        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
18992        #[inline]
18993        ///Sets [`Self::edition`] to `Some(value)`, consuming and returning `self`.
18994        pub fn with_edition(mut self, value: impl Into<super::Edition>) -> Self {
18995            self.edition = Some(value.into());
18996            self
18997        }
18998    }
18999    impl ::buffa::DefaultInstance for FeatureSetEditionDefault {
19000        fn default_instance() -> &'static Self {
19001            static VALUE: ::buffa::__private::OnceBox<FeatureSetEditionDefault> = ::buffa::__private::OnceBox::new();
19002            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
19003        }
19004    }
19005    impl ::buffa::MessageName for FeatureSetEditionDefault {
19006        const PACKAGE: &'static str = "google.protobuf";
19007        const NAME: &'static str = "FeatureSetDefaults.FeatureSetEditionDefault";
19008        const FULL_NAME: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
19009        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
19010    }
19011    impl ::buffa::Message for FeatureSetEditionDefault {
19012        /// Returns the total encoded size in bytes.
19013        ///
19014        /// The result is a `u32`; the protobuf specification requires all
19015        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
19016        /// compliant message will never overflow this type.
19017        #[allow(clippy::let_and_return)]
19018        fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19019            #[allow(unused_imports)]
19020            use ::buffa::Enumeration as _;
19021            let mut size = 0u32;
19022            if let Some(ref v) = self.edition {
19023                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
19024            }
19025            if self.overridable_features.is_set() {
19026                let __slot = __cache.reserve();
19027                let inner_size = self.overridable_features.compute_size(__cache);
19028                __cache.set(__slot, inner_size);
19029                size
19030                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19031                        + inner_size;
19032            }
19033            if self.fixed_features.is_set() {
19034                let __slot = __cache.reserve();
19035                let inner_size = self.fixed_features.compute_size(__cache);
19036                __cache.set(__slot, inner_size);
19037                size
19038                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19039                        + inner_size;
19040            }
19041            size += self.__buffa_unknown_fields.encoded_len() as u32;
19042            size
19043        }
19044        fn write_to(
19045            &self,
19046            __cache: &mut ::buffa::SizeCache,
19047            buf: &mut impl ::buffa::bytes::BufMut,
19048        ) {
19049            #[allow(unused_imports)]
19050            use ::buffa::Enumeration as _;
19051            if let Some(ref v) = self.edition {
19052                ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
19053                    .encode(buf);
19054                ::buffa::types::encode_int32(v.to_i32(), buf);
19055            }
19056            if self.overridable_features.is_set() {
19057                ::buffa::encoding::Tag::new(
19058                        4u32,
19059                        ::buffa::encoding::WireType::LengthDelimited,
19060                    )
19061                    .encode(buf);
19062                ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
19063                self.overridable_features.write_to(__cache, buf);
19064            }
19065            if self.fixed_features.is_set() {
19066                ::buffa::encoding::Tag::new(
19067                        5u32,
19068                        ::buffa::encoding::WireType::LengthDelimited,
19069                    )
19070                    .encode(buf);
19071                ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
19072                self.fixed_features.write_to(__cache, buf);
19073            }
19074            self.__buffa_unknown_fields.write_to(buf);
19075        }
19076        fn merge_field(
19077            &mut self,
19078            tag: ::buffa::encoding::Tag,
19079            buf: &mut impl ::buffa::bytes::Buf,
19080            depth: u32,
19081        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19082            #[allow(unused_imports)]
19083            use ::buffa::bytes::Buf as _;
19084            #[allow(unused_imports)]
19085            use ::buffa::Enumeration as _;
19086            match tag.field_number() {
19087                3u32 => {
19088                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
19089                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
19090                            field_number: 3u32,
19091                            expected: 0u8,
19092                            actual: tag.wire_type() as u8,
19093                        });
19094                    }
19095                    let __raw = ::buffa::types::decode_int32(buf)?;
19096                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
19097                        __raw,
19098                    ) {
19099                        self.edition = ::core::option::Option::Some(__v);
19100                    } else {
19101                        self.__buffa_unknown_fields
19102                            .push(::buffa::UnknownField {
19103                                number: 3u32,
19104                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
19105                            });
19106                    }
19107                }
19108                4u32 => {
19109                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
19110                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
19111                            field_number: 4u32,
19112                            expected: 2u8,
19113                            actual: tag.wire_type() as u8,
19114                        });
19115                    }
19116                    ::buffa::Message::merge_length_delimited(
19117                        self.overridable_features.get_or_insert_default(),
19118                        buf,
19119                        depth,
19120                    )?;
19121                }
19122                5u32 => {
19123                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
19124                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
19125                            field_number: 5u32,
19126                            expected: 2u8,
19127                            actual: tag.wire_type() as u8,
19128                        });
19129                    }
19130                    ::buffa::Message::merge_length_delimited(
19131                        self.fixed_features.get_or_insert_default(),
19132                        buf,
19133                        depth,
19134                    )?;
19135                }
19136                _ => {
19137                    self.__buffa_unknown_fields
19138                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
19139                }
19140            }
19141            ::core::result::Result::Ok(())
19142        }
19143        fn clear(&mut self) {
19144            self.edition = ::core::option::Option::None;
19145            self.overridable_features = ::buffa::MessageField::none();
19146            self.fixed_features = ::buffa::MessageField::none();
19147            self.__buffa_unknown_fields.clear();
19148        }
19149    }
19150    impl ::buffa::ExtensionSet for FeatureSetEditionDefault {
19151        const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
19152        fn unknown_fields(&self) -> &::buffa::UnknownFields {
19153            &self.__buffa_unknown_fields
19154        }
19155        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19156            &mut self.__buffa_unknown_fields
19157        }
19158    }
19159    #[cfg(feature = "text")]
19160    impl ::buffa::text::TextFormat for FeatureSetEditionDefault {
19161        fn encode_text(
19162            &self,
19163            enc: &mut ::buffa::text::TextEncoder<'_>,
19164        ) -> ::core::fmt::Result {
19165            #[allow(unused_imports)]
19166            use ::buffa::Enumeration as _;
19167            if let ::core::option::Option::Some(ref __v) = self.edition {
19168                enc.write_field_name("edition")?;
19169                enc.write_enum_name(__v.proto_name())?;
19170            }
19171            if self.overridable_features.is_set() {
19172                enc.write_field_name("overridable_features")?;
19173                enc.write_message(&*self.overridable_features)?;
19174            }
19175            if self.fixed_features.is_set() {
19176                enc.write_field_name("fixed_features")?;
19177                enc.write_message(&*self.fixed_features)?;
19178            }
19179            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19180            ::core::result::Result::Ok(())
19181        }
19182        fn merge_text(
19183            &mut self,
19184            dec: &mut ::buffa::text::TextDecoder<'_>,
19185        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19186            #[allow(unused_imports)]
19187            use ::buffa::Enumeration as _;
19188            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19189                match __name {
19190                    "edition" => {
19191                        self.edition = ::core::option::Option::Some(
19192                            dec.read_closed_enum_by_name::<super::Edition>()?,
19193                        );
19194                    }
19195                    "overridable_features" => {
19196                        dec.merge_message(
19197                            self.overridable_features.get_or_insert_default(),
19198                        )?
19199                    }
19200                    "fixed_features" => {
19201                        dec.merge_message(self.fixed_features.get_or_insert_default())?
19202                    }
19203                    _ => dec.skip_value()?,
19204                }
19205            }
19206            ::core::result::Result::Ok(())
19207        }
19208    }
19209    #[cfg(feature = "json")]
19210    impl ::buffa::json_helpers::ProtoElemJson for FeatureSetEditionDefault {
19211        fn serialize_proto_json<S: ::serde::Serializer>(
19212            v: &Self,
19213            s: S,
19214        ) -> ::core::result::Result<S::Ok, S::Error> {
19215            ::serde::Serialize::serialize(v, s)
19216        }
19217        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19218            d: D,
19219        ) -> ::core::result::Result<Self, D::Error> {
19220            <Self as ::serde::Deserialize>::deserialize(d)
19221        }
19222    }
19223    #[cfg(feature = "json")]
19224    #[doc(hidden)]
19225    pub const __FEATURE_SET_EDITION_DEFAULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19226        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
19227        to_json: ::buffa::type_registry::any_to_json::<FeatureSetEditionDefault>,
19228        from_json: ::buffa::type_registry::any_from_json::<FeatureSetEditionDefault>,
19229        is_wkt: false,
19230    };
19231    #[cfg(feature = "text")]
19232    #[doc(hidden)]
19233    pub const __FEATURE_SET_EDITION_DEFAULT_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19234        type_url: "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",
19235        text_encode: ::buffa::type_registry::any_encode_text::<FeatureSetEditionDefault>,
19236        text_merge: ::buffa::type_registry::any_merge_text::<FeatureSetEditionDefault>,
19237    };
19238    #[cfg(feature = "views")]
19239    #[doc(inline)]
19240    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultView;
19241    #[cfg(feature = "views")]
19242    #[doc(inline)]
19243    pub use super::__buffa::view::feature_set_defaults::FeatureSetEditionDefaultOwnedView;
19244}
19245/// ===================================================================
19246/// Optional source code info
19247///
19248/// Encapsulates information about the original source file from which a
19249/// FileDescriptorProto was generated.
19250#[derive(Clone, PartialEq, Default)]
19251#[cfg_attr(feature = "json", derive(::serde::Serialize))]
19252#[cfg_attr(feature = "json", serde(default))]
19253#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19254pub struct SourceCodeInfo {
19255    /// A Location identifies a piece of source code in a .proto file which
19256    /// corresponds to a particular definition.  This information is intended
19257    /// to be useful to IDEs, code indexers, documentation generators, and similar
19258    /// tools.
19259    ///
19260    /// For example, say we have a file like:
19261    ///   message Foo {
19262    /// ```text
19263    /// optional string foo = 1;
19264    /// ```
19265    ///   }
19266    /// Let's look at just the field definition:
19267    ///   optional string foo = 1;
19268    ///   ^       ^^     ^^  ^  ^^^
19269    ///   a       bc     de  f  ghi
19270    /// We have the following locations:
19271    ///   span   path               represents
19272    ///   \[a,i)  \[ 4, 0, 2, 0 \]     The whole field definition.
19273    ///   \[a,b)  \[ 4, 0, 2, 0, 4 \]  The label (optional).
19274    ///   \[c,d)  \[ 4, 0, 2, 0, 5 \]  The type (string).
19275    ///   \[e,f)  \[ 4, 0, 2, 0, 1 \]  The name (foo).
19276    ///   \[g,h)  \[ 4, 0, 2, 0, 3 \]  The number (1).
19277    ///
19278    /// Notes:
19279    /// - A location may refer to a repeated field itself (i.e. not to any
19280    ///   particular index within it).  This is used whenever a set of elements are
19281    ///   logically enclosed in a single code segment.  For example, an entire
19282    ///   extend block (possibly containing multiple extension definitions) will
19283    ///   have an outer location whose path refers to the "extensions" repeated
19284    ///   field without an index.
19285    /// - Multiple locations may have the same path.  This happens when a single
19286    ///   logical declaration is spread out across multiple places.  The most
19287    ///   obvious example is the "extend" block again -- there may be multiple
19288    ///   extend blocks in the same scope, each of which will have the same path.
19289    /// - A location's span is not always a subset of its parent's span.  For
19290    ///   example, the "extendee" of an extension declaration appears at the
19291    ///   beginning of the "extend" block and is shared by all extensions within
19292    ///   the block.
19293    /// - Just because a location's span is a subset of some other location's span
19294    ///   does not mean that it is a descendant.  For example, a "group" defines
19295    ///   both a type and a field in a single declaration.  Thus, the locations
19296    ///   corresponding to the type and field and their components will overlap.
19297    /// - Code which tries to interpret locations should probably be designed to
19298    ///   ignore those that it doesn't understand, as more types of locations could
19299    ///   be recorded in the future.
19300    ///
19301    /// Field 1: `location`
19302    #[cfg_attr(
19303        feature = "json",
19304        serde(
19305            rename = "location",
19306            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19307            deserialize_with = "::buffa::json_helpers::null_as_default"
19308        )
19309    )]
19310    pub location: ::buffa::alloc::vec::Vec<source_code_info::Location>,
19311    #[cfg_attr(feature = "json", serde(flatten))]
19312    #[doc(hidden)]
19313    pub __buffa_unknown_fields: __SourceCodeInfoExtJson,
19314}
19315impl ::core::fmt::Debug for SourceCodeInfo {
19316    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19317        f.debug_struct("SourceCodeInfo").field("location", &self.location).finish()
19318    }
19319}
19320impl SourceCodeInfo {
19321    /// Protobuf type URL for this message, for use with `Any::pack` and
19322    /// `Any::unpack_if`.
19323    ///
19324    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19325    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
19326}
19327impl ::buffa::DefaultInstance for SourceCodeInfo {
19328    fn default_instance() -> &'static Self {
19329        static VALUE: ::buffa::__private::OnceBox<SourceCodeInfo> = ::buffa::__private::OnceBox::new();
19330        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
19331    }
19332}
19333impl ::buffa::MessageName for SourceCodeInfo {
19334    const PACKAGE: &'static str = "google.protobuf";
19335    const NAME: &'static str = "SourceCodeInfo";
19336    const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo";
19337    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
19338}
19339impl ::buffa::Message for SourceCodeInfo {
19340    /// Returns the total encoded size in bytes.
19341    ///
19342    /// The result is a `u32`; the protobuf specification requires all
19343    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
19344    /// compliant message will never overflow this type.
19345    #[allow(clippy::let_and_return)]
19346    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19347        #[allow(unused_imports)]
19348        use ::buffa::Enumeration as _;
19349        let mut size = 0u32;
19350        for v in &self.location {
19351            let __slot = __cache.reserve();
19352            let inner_size = v.compute_size(__cache);
19353            __cache.set(__slot, inner_size);
19354            size
19355                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19356                    + inner_size;
19357        }
19358        size += self.__buffa_unknown_fields.encoded_len() as u32;
19359        size
19360    }
19361    fn write_to(
19362        &self,
19363        __cache: &mut ::buffa::SizeCache,
19364        buf: &mut impl ::buffa::bytes::BufMut,
19365    ) {
19366        #[allow(unused_imports)]
19367        use ::buffa::Enumeration as _;
19368        for v in &self.location {
19369            ::buffa::encoding::Tag::new(
19370                    1u32,
19371                    ::buffa::encoding::WireType::LengthDelimited,
19372                )
19373                .encode(buf);
19374            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
19375            v.write_to(__cache, buf);
19376        }
19377        self.__buffa_unknown_fields.write_to(buf);
19378    }
19379    fn merge_field(
19380        &mut self,
19381        tag: ::buffa::encoding::Tag,
19382        buf: &mut impl ::buffa::bytes::Buf,
19383        depth: u32,
19384    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19385        #[allow(unused_imports)]
19386        use ::buffa::bytes::Buf as _;
19387        #[allow(unused_imports)]
19388        use ::buffa::Enumeration as _;
19389        match tag.field_number() {
19390            1u32 => {
19391                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
19392                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
19393                        field_number: 1u32,
19394                        expected: 2u8,
19395                        actual: tag.wire_type() as u8,
19396                    });
19397                }
19398                let mut elem = ::core::default::Default::default();
19399                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
19400                self.location.push(elem);
19401            }
19402            _ => {
19403                self.__buffa_unknown_fields
19404                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
19405            }
19406        }
19407        ::core::result::Result::Ok(())
19408    }
19409    fn clear(&mut self) {
19410        self.location.clear();
19411        self.__buffa_unknown_fields.clear();
19412    }
19413}
19414impl ::buffa::ExtensionSet for SourceCodeInfo {
19415    const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo";
19416    fn unknown_fields(&self) -> &::buffa::UnknownFields {
19417        &self.__buffa_unknown_fields
19418    }
19419    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
19420        &mut self.__buffa_unknown_fields
19421    }
19422}
19423#[cfg(feature = "text")]
19424impl ::buffa::text::TextFormat for SourceCodeInfo {
19425    fn encode_text(
19426        &self,
19427        enc: &mut ::buffa::text::TextEncoder<'_>,
19428    ) -> ::core::fmt::Result {
19429        #[allow(unused_imports)]
19430        use ::buffa::Enumeration as _;
19431        for __v in &self.location {
19432            enc.write_field_name("location")?;
19433            enc.write_message(__v)?;
19434        }
19435        enc.write_extension_fields(
19436            "google.protobuf.SourceCodeInfo",
19437            &self.__buffa_unknown_fields,
19438        )?;
19439        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
19440        ::core::result::Result::Ok(())
19441    }
19442    fn merge_text(
19443        &mut self,
19444        dec: &mut ::buffa::text::TextDecoder<'_>,
19445    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
19446        #[allow(unused_imports)]
19447        use ::buffa::Enumeration as _;
19448        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
19449            match __name {
19450                "location" => {
19451                    dec.read_repeated_into(
19452                        &mut self.location,
19453                        |__d| {
19454                            let mut __m = ::core::default::Default::default();
19455                            __d.merge_message(&mut __m)?;
19456                            ::core::result::Result::Ok(__m)
19457                        },
19458                    )?
19459                }
19460                __name if __name.starts_with('[') => {
19461                    for __r in dec
19462                        .read_extension(__name, "google.protobuf.SourceCodeInfo")?
19463                    {
19464                        self.__buffa_unknown_fields.push(__r);
19465                    }
19466                }
19467                _ => dec.skip_value()?,
19468            }
19469        }
19470        ::core::result::Result::Ok(())
19471    }
19472}
19473#[cfg(feature = "json")]
19474impl<'de> serde::Deserialize<'de> for SourceCodeInfo {
19475    fn deserialize<D: serde::Deserializer<'de>>(
19476        d: D,
19477    ) -> ::core::result::Result<Self, D::Error> {
19478        struct _V;
19479        impl<'de> serde::de::Visitor<'de> for _V {
19480            type Value = SourceCodeInfo;
19481            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19482                f.write_str("struct SourceCodeInfo")
19483            }
19484            #[allow(clippy::field_reassign_with_default)]
19485            fn visit_map<A: serde::de::MapAccess<'de>>(
19486                self,
19487                mut map: A,
19488            ) -> ::core::result::Result<SourceCodeInfo, A::Error> {
19489                let mut __f_location: ::core::option::Option<
19490                    ::buffa::alloc::vec::Vec<source_code_info::Location>,
19491                > = None;
19492                let mut __ext_records: ::buffa::alloc::vec::Vec<::buffa::UnknownField> = ::buffa::alloc::vec::Vec::new();
19493                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
19494                    match key.as_str() {
19495                        "location" => {
19496                            __f_location = Some({
19497                                struct _S;
19498                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
19499                                    type Value = ::buffa::alloc::vec::Vec<
19500                                        source_code_info::Location,
19501                                    >;
19502                                    fn deserialize<D: serde::Deserializer<'de>>(
19503                                        self,
19504                                        d: D,
19505                                    ) -> ::core::result::Result<
19506                                        ::buffa::alloc::vec::Vec<source_code_info::Location>,
19507                                        D::Error,
19508                                    > {
19509                                        ::buffa::json_helpers::null_as_default(d)
19510                                    }
19511                                }
19512                                map.next_value_seed(_S)?
19513                            });
19514                        }
19515                        __k if __k.starts_with('[') => {
19516                            let __v: ::buffa::serde_json::Value = map.next_value()?;
19517                            match ::buffa::extension_registry::deserialize_extension_key(
19518                                "google.protobuf.SourceCodeInfo",
19519                                __k,
19520                                __v,
19521                            ) {
19522                                ::core::option::Option::Some(
19523                                    ::core::result::Result::Ok(__recs),
19524                                ) => {
19525                                    for __rec in __recs {
19526                                        __ext_records.push(__rec);
19527                                    }
19528                                }
19529                                ::core::option::Option::Some(
19530                                    ::core::result::Result::Err(__e),
19531                                ) => {
19532                                    return ::core::result::Result::Err(
19533                                        <A::Error as ::serde::de::Error>::custom(__e),
19534                                    );
19535                                }
19536                                ::core::option::Option::None => {}
19537                            }
19538                        }
19539                        _ => {
19540                            map.next_value::<serde::de::IgnoredAny>()?;
19541                        }
19542                    }
19543                }
19544                let mut __r = <SourceCodeInfo as ::core::default::Default>::default();
19545                if let ::core::option::Option::Some(v) = __f_location {
19546                    __r.location = v;
19547                }
19548                for __rec in __ext_records {
19549                    __r.__buffa_unknown_fields.push(__rec);
19550                }
19551                Ok(__r)
19552            }
19553        }
19554        d.deserialize_map(_V)
19555    }
19556}
19557#[cfg(feature = "json")]
19558impl ::buffa::json_helpers::ProtoElemJson for SourceCodeInfo {
19559    fn serialize_proto_json<S: ::serde::Serializer>(
19560        v: &Self,
19561        s: S,
19562    ) -> ::core::result::Result<S::Ok, S::Error> {
19563        ::serde::Serialize::serialize(v, s)
19564    }
19565    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
19566        d: D,
19567    ) -> ::core::result::Result<Self, D::Error> {
19568        <Self as ::serde::Deserialize>::deserialize(d)
19569    }
19570}
19571#[doc(hidden)]
19572#[derive(Clone, Debug, Default, PartialEq)]
19573#[repr(transparent)]
19574#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19575pub struct __SourceCodeInfoExtJson(pub ::buffa::UnknownFields);
19576impl ::core::ops::Deref for __SourceCodeInfoExtJson {
19577    type Target = ::buffa::UnknownFields;
19578    fn deref(&self) -> &::buffa::UnknownFields {
19579        &self.0
19580    }
19581}
19582impl ::core::ops::DerefMut for __SourceCodeInfoExtJson {
19583    fn deref_mut(&mut self) -> &mut ::buffa::UnknownFields {
19584        &mut self.0
19585    }
19586}
19587impl ::core::convert::From<::buffa::UnknownFields> for __SourceCodeInfoExtJson {
19588    fn from(u: ::buffa::UnknownFields) -> Self {
19589        Self(u)
19590    }
19591}
19592#[cfg(feature = "json")]
19593impl ::serde::Serialize for __SourceCodeInfoExtJson {
19594    fn serialize<S: ::serde::Serializer>(
19595        &self,
19596        s: S,
19597    ) -> ::core::result::Result<S::Ok, S::Error> {
19598        ::buffa::extension_registry::serialize_extensions(
19599            "google.protobuf.SourceCodeInfo",
19600            &self.0,
19601            s,
19602        )
19603    }
19604}
19605#[cfg(feature = "json")]
19606impl<'de> ::serde::Deserialize<'de> for __SourceCodeInfoExtJson {
19607    fn deserialize<D: ::serde::Deserializer<'de>>(
19608        d: D,
19609    ) -> ::core::result::Result<Self, D::Error> {
19610        ::buffa::extension_registry::deserialize_extensions(
19611                "google.protobuf.SourceCodeInfo",
19612                d,
19613            )
19614            .map(Self)
19615    }
19616}
19617#[cfg(feature = "json")]
19618#[doc(hidden)]
19619pub const __SOURCE_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
19620    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
19621    to_json: ::buffa::type_registry::any_to_json::<SourceCodeInfo>,
19622    from_json: ::buffa::type_registry::any_from_json::<SourceCodeInfo>,
19623    is_wkt: false,
19624};
19625#[cfg(feature = "text")]
19626#[doc(hidden)]
19627pub const __SOURCE_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
19628    type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo",
19629    text_encode: ::buffa::type_registry::any_encode_text::<SourceCodeInfo>,
19630    text_merge: ::buffa::type_registry::any_merge_text::<SourceCodeInfo>,
19631};
19632pub mod source_code_info {
19633    #[allow(unused_imports)]
19634    use super::*;
19635    #[derive(Clone, PartialEq, Default)]
19636    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
19637    #[cfg_attr(feature = "json", serde(default))]
19638    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
19639    pub struct Location {
19640        /// Identifies which part of the FileDescriptorProto was defined at this
19641        /// location.
19642        ///
19643        /// Each element is a field number or an index.  They form a path from
19644        /// the root FileDescriptorProto to the place where the definition appears.
19645        /// For example, this path:
19646        ///   \[ 4, 3, 2, 7, 1 \]
19647        /// refers to:
19648        ///   file.message_type(3)  // 4, 3
19649        /// ```text
19650        ///   .field(7)         // 2, 7
19651        ///   .name()           // 1
19652        /// ```
19653        /// This is because FileDescriptorProto.message_type has field number 4:
19654        ///   repeated DescriptorProto message_type = 4;
19655        /// and DescriptorProto.field has field number 2:
19656        ///   repeated FieldDescriptorProto field = 2;
19657        /// and FieldDescriptorProto.name has field number 1:
19658        ///   optional string name = 1;
19659        ///
19660        /// Thus, the above path gives the location of a field name.  If we removed
19661        /// the last element:
19662        ///   \[ 4, 3, 2, 7 \]
19663        /// this path refers to the whole field declaration (from the beginning
19664        /// of the label to the terminating semicolon).
19665        ///
19666        /// Field 1: `path`
19667        #[cfg_attr(
19668            feature = "json",
19669            serde(
19670                rename = "path",
19671                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19672                deserialize_with = "::buffa::json_helpers::null_as_default"
19673            )
19674        )]
19675        pub path: ::buffa::alloc::vec::Vec<i32>,
19676        /// Always has exactly three or four elements: start line, start column,
19677        /// end line (optional, otherwise assumed same as start line), end column.
19678        /// These are packed into a single field for efficiency.  Note that line
19679        /// and column numbers are zero-based -- typically you will want to add
19680        /// 1 to each before displaying to a user.
19681        ///
19682        /// Field 2: `span`
19683        #[cfg_attr(
19684            feature = "json",
19685            serde(
19686                rename = "span",
19687                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19688                deserialize_with = "::buffa::json_helpers::null_as_default"
19689            )
19690        )]
19691        pub span: ::buffa::alloc::vec::Vec<i32>,
19692        /// If this SourceCodeInfo represents a complete declaration, these are any
19693        /// comments appearing before and after the declaration which appear to be
19694        /// attached to the declaration.
19695        ///
19696        /// A series of line comments appearing on consecutive lines, with no other
19697        /// tokens appearing on those lines, will be treated as a single comment.
19698        ///
19699        /// leading_detached_comments will keep paragraphs of comments that appear
19700        /// before (but not connected to) the current element. Each paragraph,
19701        /// separated by empty lines, will be one comment element in the repeated
19702        /// field.
19703        ///
19704        /// Only the comment content is provided; comment markers (e.g. //) are
19705        /// stripped out.  For block comments, leading whitespace and an asterisk
19706        /// will be stripped from the beginning of each line other than the first.
19707        /// Newlines are included in the output.
19708        ///
19709        /// Examples:
19710        ///
19711        ///   optional int32 foo = 1;  // Comment attached to foo.
19712        ///   // Comment attached to bar.
19713        ///   optional int32 bar = 2;
19714        ///
19715        ///   optional string baz = 3;
19716        ///   // Comment attached to baz.
19717        ///   // Another line attached to baz.
19718        ///
19719        ///   // Comment attached to moo.
19720        ///   //
19721        ///   // Another line attached to moo.
19722        ///   optional double moo = 4;
19723        ///
19724        ///   // Detached comment for corge. This is not leading or trailing comments
19725        ///   // to moo or corge because there are blank lines separating it from
19726        ///   // both.
19727        ///
19728        ///   // Detached comment for corge paragraph 2.
19729        ///
19730        ///   optional string corge = 5;
19731        ///   /* Block comment attached
19732        /// ```text
19733        /// * to corge.  Leading asterisks
19734        /// * will be removed. */
19735        /// ```
19736        ///   /* Block comment attached to
19737        /// ```text
19738        /// * grault. */
19739        /// ```
19740        ///   optional int32 grault = 6;
19741        ///
19742        ///   // ignored detached comments.
19743        ///
19744        /// Field 3: `leading_comments`
19745        #[cfg_attr(
19746            feature = "json",
19747            serde(
19748                rename = "leadingComments",
19749                alias = "leading_comments",
19750                skip_serializing_if = "::core::option::Option::is_none"
19751            )
19752        )]
19753        pub leading_comments: ::core::option::Option<::buffa::alloc::string::String>,
19754        /// Field 4: `trailing_comments`
19755        #[cfg_attr(
19756            feature = "json",
19757            serde(
19758                rename = "trailingComments",
19759                alias = "trailing_comments",
19760                skip_serializing_if = "::core::option::Option::is_none"
19761            )
19762        )]
19763        pub trailing_comments: ::core::option::Option<::buffa::alloc::string::String>,
19764        /// Field 6: `leading_detached_comments`
19765        #[cfg_attr(
19766            feature = "json",
19767            serde(
19768                rename = "leadingDetachedComments",
19769                alias = "leading_detached_comments",
19770                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
19771                deserialize_with = "::buffa::json_helpers::null_as_default"
19772            )
19773        )]
19774        pub leading_detached_comments: ::buffa::alloc::vec::Vec<
19775            ::buffa::alloc::string::String,
19776        >,
19777        #[cfg_attr(feature = "json", serde(skip))]
19778        #[doc(hidden)]
19779        pub __buffa_unknown_fields: ::buffa::UnknownFields,
19780    }
19781    impl ::core::fmt::Debug for Location {
19782        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19783            f.debug_struct("Location")
19784                .field("path", &self.path)
19785                .field("span", &self.span)
19786                .field("leading_comments", &self.leading_comments)
19787                .field("trailing_comments", &self.trailing_comments)
19788                .field("leading_detached_comments", &self.leading_detached_comments)
19789                .finish()
19790        }
19791    }
19792    impl Location {
19793        /// Protobuf type URL for this message, for use with `Any::pack` and
19794        /// `Any::unpack_if`.
19795        ///
19796        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
19797        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19798    }
19799    impl Location {
19800        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19801        #[inline]
19802        ///Sets [`Self::leading_comments`] to `Some(value)`, consuming and returning `self`.
19803        pub fn with_leading_comments(
19804            mut self,
19805            value: impl Into<::buffa::alloc::string::String>,
19806        ) -> Self {
19807            self.leading_comments = Some(value.into());
19808            self
19809        }
19810        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
19811        #[inline]
19812        ///Sets [`Self::trailing_comments`] to `Some(value)`, consuming and returning `self`.
19813        pub fn with_trailing_comments(
19814            mut self,
19815            value: impl Into<::buffa::alloc::string::String>,
19816        ) -> Self {
19817            self.trailing_comments = Some(value.into());
19818            self
19819        }
19820    }
19821    impl ::buffa::DefaultInstance for Location {
19822        fn default_instance() -> &'static Self {
19823            static VALUE: ::buffa::__private::OnceBox<Location> = ::buffa::__private::OnceBox::new();
19824            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
19825        }
19826    }
19827    impl ::buffa::MessageName for Location {
19828        const PACKAGE: &'static str = "google.protobuf";
19829        const NAME: &'static str = "SourceCodeInfo.Location";
19830        const FULL_NAME: &'static str = "google.protobuf.SourceCodeInfo.Location";
19831        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
19832    }
19833    impl ::buffa::Message for Location {
19834        /// Returns the total encoded size in bytes.
19835        ///
19836        /// The result is a `u32`; the protobuf specification requires all
19837        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
19838        /// compliant message will never overflow this type.
19839        #[allow(clippy::let_and_return)]
19840        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
19841            #[allow(unused_imports)]
19842            use ::buffa::Enumeration as _;
19843            let mut size = 0u32;
19844            if !self.path.is_empty() {
19845                let payload: u32 = self
19846                    .path
19847                    .iter()
19848                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19849                    .sum::<u32>();
19850                size
19851                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
19852                        + payload;
19853            }
19854            if !self.span.is_empty() {
19855                let payload: u32 = self
19856                    .span
19857                    .iter()
19858                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19859                    .sum::<u32>();
19860                size
19861                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
19862                        + payload;
19863            }
19864            if let Some(ref v) = self.leading_comments {
19865                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
19866            }
19867            if let Some(ref v) = self.trailing_comments {
19868                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
19869            }
19870            for v in &self.leading_detached_comments {
19871                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
19872            }
19873            size += self.__buffa_unknown_fields.encoded_len() as u32;
19874            size
19875        }
19876        fn write_to(
19877            &self,
19878            _cache: &mut ::buffa::SizeCache,
19879            buf: &mut impl ::buffa::bytes::BufMut,
19880        ) {
19881            #[allow(unused_imports)]
19882            use ::buffa::Enumeration as _;
19883            if !self.path.is_empty() {
19884                let payload: u32 = self
19885                    .path
19886                    .iter()
19887                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19888                    .sum::<u32>();
19889                ::buffa::encoding::Tag::new(
19890                        1u32,
19891                        ::buffa::encoding::WireType::LengthDelimited,
19892                    )
19893                    .encode(buf);
19894                ::buffa::encoding::encode_varint(payload as u64, buf);
19895                for &v in &self.path {
19896                    ::buffa::types::encode_int32(v, buf);
19897                }
19898            }
19899            if !self.span.is_empty() {
19900                let payload: u32 = self
19901                    .span
19902                    .iter()
19903                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
19904                    .sum::<u32>();
19905                ::buffa::encoding::Tag::new(
19906                        2u32,
19907                        ::buffa::encoding::WireType::LengthDelimited,
19908                    )
19909                    .encode(buf);
19910                ::buffa::encoding::encode_varint(payload as u64, buf);
19911                for &v in &self.span {
19912                    ::buffa::types::encode_int32(v, buf);
19913                }
19914            }
19915            if let Some(ref v) = self.leading_comments {
19916                ::buffa::encoding::Tag::new(
19917                        3u32,
19918                        ::buffa::encoding::WireType::LengthDelimited,
19919                    )
19920                    .encode(buf);
19921                ::buffa::types::encode_string(v, buf);
19922            }
19923            if let Some(ref v) = self.trailing_comments {
19924                ::buffa::encoding::Tag::new(
19925                        4u32,
19926                        ::buffa::encoding::WireType::LengthDelimited,
19927                    )
19928                    .encode(buf);
19929                ::buffa::types::encode_string(v, buf);
19930            }
19931            for v in &self.leading_detached_comments {
19932                ::buffa::encoding::Tag::new(
19933                        6u32,
19934                        ::buffa::encoding::WireType::LengthDelimited,
19935                    )
19936                    .encode(buf);
19937                ::buffa::types::encode_string(v, buf);
19938            }
19939            self.__buffa_unknown_fields.write_to(buf);
19940        }
19941        fn merge_field(
19942            &mut self,
19943            tag: ::buffa::encoding::Tag,
19944            buf: &mut impl ::buffa::bytes::Buf,
19945            depth: u32,
19946        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
19947            #[allow(unused_imports)]
19948            use ::buffa::bytes::Buf as _;
19949            #[allow(unused_imports)]
19950            use ::buffa::Enumeration as _;
19951            match tag.field_number() {
19952                1u32 => {
19953                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19954                        let len = ::buffa::encoding::decode_varint(buf)?;
19955                        let len = usize::try_from(len)
19956                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19957                        if buf.remaining() < len {
19958                            return ::core::result::Result::Err(
19959                                ::buffa::DecodeError::UnexpectedEof,
19960                            );
19961                        }
19962                        self.path.reserve(len);
19963                        let mut limited = buf.take(len);
19964                        while limited.has_remaining() {
19965                            self.path.push(::buffa::types::decode_int32(&mut limited)?);
19966                        }
19967                        let leftover = limited.remaining();
19968                        if leftover > 0 {
19969                            limited.advance(leftover);
19970                        }
19971                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
19972                        self.path.push(::buffa::types::decode_int32(buf)?);
19973                    } else {
19974                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
19975                            field_number: 1u32,
19976                            expected: 2u8,
19977                            actual: tag.wire_type() as u8,
19978                        });
19979                    }
19980                }
19981                2u32 => {
19982                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
19983                        let len = ::buffa::encoding::decode_varint(buf)?;
19984                        let len = usize::try_from(len)
19985                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
19986                        if buf.remaining() < len {
19987                            return ::core::result::Result::Err(
19988                                ::buffa::DecodeError::UnexpectedEof,
19989                            );
19990                        }
19991                        self.span.reserve(len);
19992                        let mut limited = buf.take(len);
19993                        while limited.has_remaining() {
19994                            self.span.push(::buffa::types::decode_int32(&mut limited)?);
19995                        }
19996                        let leftover = limited.remaining();
19997                        if leftover > 0 {
19998                            limited.advance(leftover);
19999                        }
20000                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
20001                        self.span.push(::buffa::types::decode_int32(buf)?);
20002                    } else {
20003                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20004                            field_number: 2u32,
20005                            expected: 2u8,
20006                            actual: tag.wire_type() as u8,
20007                        });
20008                    }
20009                }
20010                3u32 => {
20011                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
20012                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20013                            field_number: 3u32,
20014                            expected: 2u8,
20015                            actual: tag.wire_type() as u8,
20016                        });
20017                    }
20018                    ::buffa::types::merge_string(
20019                        self
20020                            .leading_comments
20021                            .get_or_insert_with(::buffa::alloc::string::String::new),
20022                        buf,
20023                    )?;
20024                }
20025                4u32 => {
20026                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
20027                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20028                            field_number: 4u32,
20029                            expected: 2u8,
20030                            actual: tag.wire_type() as u8,
20031                        });
20032                    }
20033                    ::buffa::types::merge_string(
20034                        self
20035                            .trailing_comments
20036                            .get_or_insert_with(::buffa::alloc::string::String::new),
20037                        buf,
20038                    )?;
20039                }
20040                6u32 => {
20041                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
20042                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20043                            field_number: 6u32,
20044                            expected: 2u8,
20045                            actual: tag.wire_type() as u8,
20046                        });
20047                    }
20048                    self.leading_detached_comments
20049                        .push(::buffa::types::decode_string(buf)?);
20050                }
20051                _ => {
20052                    self.__buffa_unknown_fields
20053                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
20054                }
20055            }
20056            ::core::result::Result::Ok(())
20057        }
20058        fn clear(&mut self) {
20059            self.path.clear();
20060            self.span.clear();
20061            self.leading_comments = ::core::option::Option::None;
20062            self.trailing_comments = ::core::option::Option::None;
20063            self.leading_detached_comments.clear();
20064            self.__buffa_unknown_fields.clear();
20065        }
20066    }
20067    impl ::buffa::ExtensionSet for Location {
20068        const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo.Location";
20069        fn unknown_fields(&self) -> &::buffa::UnknownFields {
20070            &self.__buffa_unknown_fields
20071        }
20072        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
20073            &mut self.__buffa_unknown_fields
20074        }
20075    }
20076    #[cfg(feature = "text")]
20077    impl ::buffa::text::TextFormat for Location {
20078        fn encode_text(
20079            &self,
20080            enc: &mut ::buffa::text::TextEncoder<'_>,
20081        ) -> ::core::fmt::Result {
20082            #[allow(unused_imports)]
20083            use ::buffa::Enumeration as _;
20084            if let ::core::option::Option::Some(ref __v) = self.leading_comments {
20085                enc.write_field_name("leading_comments")?;
20086                enc.write_string(__v)?;
20087            }
20088            if let ::core::option::Option::Some(ref __v) = self.trailing_comments {
20089                enc.write_field_name("trailing_comments")?;
20090                enc.write_string(__v)?;
20091            }
20092            for __v in &self.path {
20093                enc.write_field_name("path")?;
20094                enc.write_i32(*__v)?;
20095            }
20096            for __v in &self.span {
20097                enc.write_field_name("span")?;
20098                enc.write_i32(*__v)?;
20099            }
20100            for __v in &self.leading_detached_comments {
20101                enc.write_field_name("leading_detached_comments")?;
20102                enc.write_string(__v)?;
20103            }
20104            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
20105            ::core::result::Result::Ok(())
20106        }
20107        fn merge_text(
20108            &mut self,
20109            dec: &mut ::buffa::text::TextDecoder<'_>,
20110        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
20111            #[allow(unused_imports)]
20112            use ::buffa::Enumeration as _;
20113            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
20114                match __name {
20115                    "leading_comments" => {
20116                        self.leading_comments = ::core::option::Option::Some(
20117                            dec.read_string()?.into_owned(),
20118                        );
20119                    }
20120                    "trailing_comments" => {
20121                        self.trailing_comments = ::core::option::Option::Some(
20122                            dec.read_string()?.into_owned(),
20123                        );
20124                    }
20125                    "path" => {
20126                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
20127                    }
20128                    "span" => {
20129                        dec.read_repeated_into(&mut self.span, |__d| __d.read_i32())?
20130                    }
20131                    "leading_detached_comments" => {
20132                        dec.read_repeated_into(
20133                            &mut self.leading_detached_comments,
20134                            |__d| ::core::result::Result::Ok(
20135                                __d.read_string()?.into_owned(),
20136                            ),
20137                        )?
20138                    }
20139                    _ => dec.skip_value()?,
20140                }
20141            }
20142            ::core::result::Result::Ok(())
20143        }
20144    }
20145    #[cfg(feature = "json")]
20146    impl ::buffa::json_helpers::ProtoElemJson for Location {
20147        fn serialize_proto_json<S: ::serde::Serializer>(
20148            v: &Self,
20149            s: S,
20150        ) -> ::core::result::Result<S::Ok, S::Error> {
20151            ::serde::Serialize::serialize(v, s)
20152        }
20153        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20154            d: D,
20155        ) -> ::core::result::Result<Self, D::Error> {
20156            <Self as ::serde::Deserialize>::deserialize(d)
20157        }
20158    }
20159    #[cfg(feature = "json")]
20160    #[doc(hidden)]
20161    pub const __LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
20162        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
20163        to_json: ::buffa::type_registry::any_to_json::<Location>,
20164        from_json: ::buffa::type_registry::any_from_json::<Location>,
20165        is_wkt: false,
20166    };
20167    #[cfg(feature = "text")]
20168    #[doc(hidden)]
20169    pub const __LOCATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
20170        type_url: "type.googleapis.com/google.protobuf.SourceCodeInfo.Location",
20171        text_encode: ::buffa::type_registry::any_encode_text::<Location>,
20172        text_merge: ::buffa::type_registry::any_merge_text::<Location>,
20173    };
20174    #[cfg(feature = "views")]
20175    #[doc(inline)]
20176    pub use super::__buffa::view::source_code_info::LocationView;
20177    #[cfg(feature = "views")]
20178    #[doc(inline)]
20179    pub use super::__buffa::view::source_code_info::LocationOwnedView;
20180}
20181/// Describes the relationship between generated code and its original source
20182/// file. A GeneratedCodeInfo message is associated with only one generated
20183/// source file, but may contain references to different source .proto files.
20184#[derive(Clone, PartialEq, Default)]
20185#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
20186#[cfg_attr(feature = "json", serde(default))]
20187#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
20188pub struct GeneratedCodeInfo {
20189    /// An Annotation connects some span of text in generated code to an element
20190    /// of its generating .proto file.
20191    ///
20192    /// Field 1: `annotation`
20193    #[cfg_attr(
20194        feature = "json",
20195        serde(
20196            rename = "annotation",
20197            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
20198            deserialize_with = "::buffa::json_helpers::null_as_default"
20199        )
20200    )]
20201    pub annotation: ::buffa::alloc::vec::Vec<generated_code_info::Annotation>,
20202    #[cfg_attr(feature = "json", serde(skip))]
20203    #[doc(hidden)]
20204    pub __buffa_unknown_fields: ::buffa::UnknownFields,
20205}
20206impl ::core::fmt::Debug for GeneratedCodeInfo {
20207    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
20208        f.debug_struct("GeneratedCodeInfo")
20209            .field("annotation", &self.annotation)
20210            .finish()
20211    }
20212}
20213impl GeneratedCodeInfo {
20214    /// Protobuf type URL for this message, for use with `Any::pack` and
20215    /// `Any::unpack_if`.
20216    ///
20217    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
20218    pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
20219}
20220impl ::buffa::DefaultInstance for GeneratedCodeInfo {
20221    fn default_instance() -> &'static Self {
20222        static VALUE: ::buffa::__private::OnceBox<GeneratedCodeInfo> = ::buffa::__private::OnceBox::new();
20223        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
20224    }
20225}
20226impl ::buffa::MessageName for GeneratedCodeInfo {
20227    const PACKAGE: &'static str = "google.protobuf";
20228    const NAME: &'static str = "GeneratedCodeInfo";
20229    const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo";
20230    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
20231}
20232impl ::buffa::Message for GeneratedCodeInfo {
20233    /// Returns the total encoded size in bytes.
20234    ///
20235    /// The result is a `u32`; the protobuf specification requires all
20236    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
20237    /// compliant message will never overflow this type.
20238    #[allow(clippy::let_and_return)]
20239    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
20240        #[allow(unused_imports)]
20241        use ::buffa::Enumeration as _;
20242        let mut size = 0u32;
20243        for v in &self.annotation {
20244            let __slot = __cache.reserve();
20245            let inner_size = v.compute_size(__cache);
20246            __cache.set(__slot, inner_size);
20247            size
20248                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
20249                    + inner_size;
20250        }
20251        size += self.__buffa_unknown_fields.encoded_len() as u32;
20252        size
20253    }
20254    fn write_to(
20255        &self,
20256        __cache: &mut ::buffa::SizeCache,
20257        buf: &mut impl ::buffa::bytes::BufMut,
20258    ) {
20259        #[allow(unused_imports)]
20260        use ::buffa::Enumeration as _;
20261        for v in &self.annotation {
20262            ::buffa::encoding::Tag::new(
20263                    1u32,
20264                    ::buffa::encoding::WireType::LengthDelimited,
20265                )
20266                .encode(buf);
20267            ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
20268            v.write_to(__cache, buf);
20269        }
20270        self.__buffa_unknown_fields.write_to(buf);
20271    }
20272    fn merge_field(
20273        &mut self,
20274        tag: ::buffa::encoding::Tag,
20275        buf: &mut impl ::buffa::bytes::Buf,
20276        depth: u32,
20277    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
20278        #[allow(unused_imports)]
20279        use ::buffa::bytes::Buf as _;
20280        #[allow(unused_imports)]
20281        use ::buffa::Enumeration as _;
20282        match tag.field_number() {
20283            1u32 => {
20284                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
20285                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20286                        field_number: 1u32,
20287                        expected: 2u8,
20288                        actual: tag.wire_type() as u8,
20289                    });
20290                }
20291                let mut elem = ::core::default::Default::default();
20292                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
20293                self.annotation.push(elem);
20294            }
20295            _ => {
20296                self.__buffa_unknown_fields
20297                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
20298            }
20299        }
20300        ::core::result::Result::Ok(())
20301    }
20302    fn clear(&mut self) {
20303        self.annotation.clear();
20304        self.__buffa_unknown_fields.clear();
20305    }
20306}
20307impl ::buffa::ExtensionSet for GeneratedCodeInfo {
20308    const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo";
20309    fn unknown_fields(&self) -> &::buffa::UnknownFields {
20310        &self.__buffa_unknown_fields
20311    }
20312    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
20313        &mut self.__buffa_unknown_fields
20314    }
20315}
20316#[cfg(feature = "text")]
20317impl ::buffa::text::TextFormat for GeneratedCodeInfo {
20318    fn encode_text(
20319        &self,
20320        enc: &mut ::buffa::text::TextEncoder<'_>,
20321    ) -> ::core::fmt::Result {
20322        #[allow(unused_imports)]
20323        use ::buffa::Enumeration as _;
20324        for __v in &self.annotation {
20325            enc.write_field_name("annotation")?;
20326            enc.write_message(__v)?;
20327        }
20328        enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
20329        ::core::result::Result::Ok(())
20330    }
20331    fn merge_text(
20332        &mut self,
20333        dec: &mut ::buffa::text::TextDecoder<'_>,
20334    ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
20335        #[allow(unused_imports)]
20336        use ::buffa::Enumeration as _;
20337        while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
20338            match __name {
20339                "annotation" => {
20340                    dec.read_repeated_into(
20341                        &mut self.annotation,
20342                        |__d| {
20343                            let mut __m = ::core::default::Default::default();
20344                            __d.merge_message(&mut __m)?;
20345                            ::core::result::Result::Ok(__m)
20346                        },
20347                    )?
20348                }
20349                _ => dec.skip_value()?,
20350            }
20351        }
20352        ::core::result::Result::Ok(())
20353    }
20354}
20355#[cfg(feature = "json")]
20356impl ::buffa::json_helpers::ProtoElemJson for GeneratedCodeInfo {
20357    fn serialize_proto_json<S: ::serde::Serializer>(
20358        v: &Self,
20359        s: S,
20360    ) -> ::core::result::Result<S::Ok, S::Error> {
20361        ::serde::Serialize::serialize(v, s)
20362    }
20363    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20364        d: D,
20365    ) -> ::core::result::Result<Self, D::Error> {
20366        <Self as ::serde::Deserialize>::deserialize(d)
20367    }
20368}
20369#[cfg(feature = "json")]
20370#[doc(hidden)]
20371pub const __GENERATED_CODE_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
20372    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
20373    to_json: ::buffa::type_registry::any_to_json::<GeneratedCodeInfo>,
20374    from_json: ::buffa::type_registry::any_from_json::<GeneratedCodeInfo>,
20375    is_wkt: false,
20376};
20377#[cfg(feature = "text")]
20378#[doc(hidden)]
20379pub const __GENERATED_CODE_INFO_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
20380    type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo",
20381    text_encode: ::buffa::type_registry::any_encode_text::<GeneratedCodeInfo>,
20382    text_merge: ::buffa::type_registry::any_merge_text::<GeneratedCodeInfo>,
20383};
20384pub mod generated_code_info {
20385    #[allow(unused_imports)]
20386    use super::*;
20387    #[derive(Clone, PartialEq, Default)]
20388    #[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
20389    #[cfg_attr(feature = "json", serde(default))]
20390    #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
20391    pub struct Annotation {
20392        /// Identifies the element in the original source .proto file. This field
20393        /// is formatted the same as SourceCodeInfo.Location.path.
20394        ///
20395        /// Field 1: `path`
20396        #[cfg_attr(
20397            feature = "json",
20398            serde(
20399                rename = "path",
20400                skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
20401                deserialize_with = "::buffa::json_helpers::null_as_default"
20402            )
20403        )]
20404        pub path: ::buffa::alloc::vec::Vec<i32>,
20405        /// Identifies the filesystem path to the original source .proto.
20406        ///
20407        /// Field 2: `source_file`
20408        #[cfg_attr(
20409            feature = "json",
20410            serde(
20411                rename = "sourceFile",
20412                alias = "source_file",
20413                skip_serializing_if = "::core::option::Option::is_none"
20414            )
20415        )]
20416        pub source_file: ::core::option::Option<::buffa::alloc::string::String>,
20417        /// Identifies the starting offset in bytes in the generated code
20418        /// that relates to the identified object.
20419        ///
20420        /// Field 3: `begin`
20421        #[cfg_attr(
20422            feature = "json",
20423            serde(
20424                rename = "begin",
20425                with = "::buffa::json_helpers::opt_int32",
20426                skip_serializing_if = "::core::option::Option::is_none"
20427            )
20428        )]
20429        pub begin: ::core::option::Option<i32>,
20430        /// Identifies the ending offset in bytes in the generated code that
20431        /// relates to the identified object. The end offset should be one past
20432        /// the last relevant byte (so the length of the text = end - begin).
20433        ///
20434        /// Field 4: `end`
20435        #[cfg_attr(
20436            feature = "json",
20437            serde(
20438                rename = "end",
20439                with = "::buffa::json_helpers::opt_int32",
20440                skip_serializing_if = "::core::option::Option::is_none"
20441            )
20442        )]
20443        pub end: ::core::option::Option<i32>,
20444        /// Field 5: `semantic`
20445        #[cfg_attr(
20446            feature = "json",
20447            serde(
20448                rename = "semantic",
20449                with = "::buffa::json_helpers::opt_closed_enum",
20450                skip_serializing_if = "::core::option::Option::is_none"
20451            )
20452        )]
20453        pub semantic: ::core::option::Option<
20454            super::generated_code_info::annotation::Semantic,
20455        >,
20456        #[cfg_attr(feature = "json", serde(skip))]
20457        #[doc(hidden)]
20458        pub __buffa_unknown_fields: ::buffa::UnknownFields,
20459    }
20460    impl ::core::fmt::Debug for Annotation {
20461        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
20462            f.debug_struct("Annotation")
20463                .field("path", &self.path)
20464                .field("source_file", &self.source_file)
20465                .field("begin", &self.begin)
20466                .field("end", &self.end)
20467                .field("semantic", &self.semantic)
20468                .finish()
20469        }
20470    }
20471    impl Annotation {
20472        /// Protobuf type URL for this message, for use with `Any::pack` and
20473        /// `Any::unpack_if`.
20474        ///
20475        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
20476        pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
20477    }
20478    impl Annotation {
20479        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
20480        #[inline]
20481        ///Sets [`Self::source_file`] to `Some(value)`, consuming and returning `self`.
20482        pub fn with_source_file(
20483            mut self,
20484            value: impl Into<::buffa::alloc::string::String>,
20485        ) -> Self {
20486            self.source_file = Some(value.into());
20487            self
20488        }
20489        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
20490        #[inline]
20491        ///Sets [`Self::begin`] to `Some(value)`, consuming and returning `self`.
20492        pub fn with_begin(mut self, value: i32) -> Self {
20493            self.begin = Some(value);
20494            self
20495        }
20496        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
20497        #[inline]
20498        ///Sets [`Self::end`] to `Some(value)`, consuming and returning `self`.
20499        pub fn with_end(mut self, value: i32) -> Self {
20500            self.end = Some(value);
20501            self
20502        }
20503        #[must_use = "with_* setters return `self` by value; assign or chain the result"]
20504        #[inline]
20505        ///Sets [`Self::semantic`] to `Some(value)`, consuming and returning `self`.
20506        pub fn with_semantic(
20507            mut self,
20508            value: impl Into<super::generated_code_info::annotation::Semantic>,
20509        ) -> Self {
20510            self.semantic = Some(value.into());
20511            self
20512        }
20513    }
20514    impl ::buffa::DefaultInstance for Annotation {
20515        fn default_instance() -> &'static Self {
20516            static VALUE: ::buffa::__private::OnceBox<Annotation> = ::buffa::__private::OnceBox::new();
20517            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
20518        }
20519    }
20520    impl ::buffa::MessageName for Annotation {
20521        const PACKAGE: &'static str = "google.protobuf";
20522        const NAME: &'static str = "GeneratedCodeInfo.Annotation";
20523        const FULL_NAME: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
20524        const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
20525    }
20526    impl ::buffa::Message for Annotation {
20527        /// Returns the total encoded size in bytes.
20528        ///
20529        /// The result is a `u32`; the protobuf specification requires all
20530        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
20531        /// compliant message will never overflow this type.
20532        #[allow(clippy::let_and_return)]
20533        fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
20534            #[allow(unused_imports)]
20535            use ::buffa::Enumeration as _;
20536            let mut size = 0u32;
20537            if !self.path.is_empty() {
20538                let payload: u32 = self
20539                    .path
20540                    .iter()
20541                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
20542                    .sum::<u32>();
20543                size
20544                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
20545                        + payload;
20546            }
20547            if let Some(ref v) = self.source_file {
20548                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
20549            }
20550            if let Some(v) = self.begin {
20551                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
20552            }
20553            if let Some(v) = self.end {
20554                size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
20555            }
20556            if let Some(ref v) = self.semantic {
20557                size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
20558            }
20559            size += self.__buffa_unknown_fields.encoded_len() as u32;
20560            size
20561        }
20562        fn write_to(
20563            &self,
20564            _cache: &mut ::buffa::SizeCache,
20565            buf: &mut impl ::buffa::bytes::BufMut,
20566        ) {
20567            #[allow(unused_imports)]
20568            use ::buffa::Enumeration as _;
20569            if !self.path.is_empty() {
20570                let payload: u32 = self
20571                    .path
20572                    .iter()
20573                    .map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
20574                    .sum::<u32>();
20575                ::buffa::encoding::Tag::new(
20576                        1u32,
20577                        ::buffa::encoding::WireType::LengthDelimited,
20578                    )
20579                    .encode(buf);
20580                ::buffa::encoding::encode_varint(payload as u64, buf);
20581                for &v in &self.path {
20582                    ::buffa::types::encode_int32(v, buf);
20583                }
20584            }
20585            if let Some(ref v) = self.source_file {
20586                ::buffa::encoding::Tag::new(
20587                        2u32,
20588                        ::buffa::encoding::WireType::LengthDelimited,
20589                    )
20590                    .encode(buf);
20591                ::buffa::types::encode_string(v, buf);
20592            }
20593            if let Some(v) = self.begin {
20594                ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
20595                    .encode(buf);
20596                ::buffa::types::encode_int32(v, buf);
20597            }
20598            if let Some(v) = self.end {
20599                ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
20600                    .encode(buf);
20601                ::buffa::types::encode_int32(v, buf);
20602            }
20603            if let Some(ref v) = self.semantic {
20604                ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
20605                    .encode(buf);
20606                ::buffa::types::encode_int32(v.to_i32(), buf);
20607            }
20608            self.__buffa_unknown_fields.write_to(buf);
20609        }
20610        fn merge_field(
20611            &mut self,
20612            tag: ::buffa::encoding::Tag,
20613            buf: &mut impl ::buffa::bytes::Buf,
20614            depth: u32,
20615        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
20616            #[allow(unused_imports)]
20617            use ::buffa::bytes::Buf as _;
20618            #[allow(unused_imports)]
20619            use ::buffa::Enumeration as _;
20620            match tag.field_number() {
20621                1u32 => {
20622                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
20623                        let len = ::buffa::encoding::decode_varint(buf)?;
20624                        let len = usize::try_from(len)
20625                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
20626                        if buf.remaining() < len {
20627                            return ::core::result::Result::Err(
20628                                ::buffa::DecodeError::UnexpectedEof,
20629                            );
20630                        }
20631                        self.path.reserve(len);
20632                        let mut limited = buf.take(len);
20633                        while limited.has_remaining() {
20634                            self.path.push(::buffa::types::decode_int32(&mut limited)?);
20635                        }
20636                        let leftover = limited.remaining();
20637                        if leftover > 0 {
20638                            limited.advance(leftover);
20639                        }
20640                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
20641                        self.path.push(::buffa::types::decode_int32(buf)?);
20642                    } else {
20643                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20644                            field_number: 1u32,
20645                            expected: 2u8,
20646                            actual: tag.wire_type() as u8,
20647                        });
20648                    }
20649                }
20650                2u32 => {
20651                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
20652                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20653                            field_number: 2u32,
20654                            expected: 2u8,
20655                            actual: tag.wire_type() as u8,
20656                        });
20657                    }
20658                    ::buffa::types::merge_string(
20659                        self
20660                            .source_file
20661                            .get_or_insert_with(::buffa::alloc::string::String::new),
20662                        buf,
20663                    )?;
20664                }
20665                3u32 => {
20666                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
20667                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20668                            field_number: 3u32,
20669                            expected: 0u8,
20670                            actual: tag.wire_type() as u8,
20671                        });
20672                    }
20673                    self.begin = ::core::option::Option::Some(
20674                        ::buffa::types::decode_int32(buf)?,
20675                    );
20676                }
20677                4u32 => {
20678                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
20679                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20680                            field_number: 4u32,
20681                            expected: 0u8,
20682                            actual: tag.wire_type() as u8,
20683                        });
20684                    }
20685                    self.end = ::core::option::Option::Some(
20686                        ::buffa::types::decode_int32(buf)?,
20687                    );
20688                }
20689                5u32 => {
20690                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
20691                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
20692                            field_number: 5u32,
20693                            expected: 0u8,
20694                            actual: tag.wire_type() as u8,
20695                        });
20696                    }
20697                    let __raw = ::buffa::types::decode_int32(buf)?;
20698                    if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
20699                        __raw,
20700                    ) {
20701                        self.semantic = ::core::option::Option::Some(__v);
20702                    } else {
20703                        self.__buffa_unknown_fields
20704                            .push(::buffa::UnknownField {
20705                                number: 5u32,
20706                                data: ::buffa::UnknownFieldData::Varint(__raw as u64),
20707                            });
20708                    }
20709                }
20710                _ => {
20711                    self.__buffa_unknown_fields
20712                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
20713                }
20714            }
20715            ::core::result::Result::Ok(())
20716        }
20717        fn clear(&mut self) {
20718            self.path.clear();
20719            self.source_file = ::core::option::Option::None;
20720            self.begin = ::core::option::Option::None;
20721            self.end = ::core::option::Option::None;
20722            self.semantic = ::core::option::Option::None;
20723            self.__buffa_unknown_fields.clear();
20724        }
20725    }
20726    impl ::buffa::ExtensionSet for Annotation {
20727        const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
20728        fn unknown_fields(&self) -> &::buffa::UnknownFields {
20729            &self.__buffa_unknown_fields
20730        }
20731        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
20732            &mut self.__buffa_unknown_fields
20733        }
20734    }
20735    #[cfg(feature = "text")]
20736    impl ::buffa::text::TextFormat for Annotation {
20737        fn encode_text(
20738            &self,
20739            enc: &mut ::buffa::text::TextEncoder<'_>,
20740        ) -> ::core::fmt::Result {
20741            #[allow(unused_imports)]
20742            use ::buffa::Enumeration as _;
20743            if let ::core::option::Option::Some(ref __v) = self.source_file {
20744                enc.write_field_name("source_file")?;
20745                enc.write_string(__v)?;
20746            }
20747            if let ::core::option::Option::Some(ref __v) = self.begin {
20748                enc.write_field_name("begin")?;
20749                enc.write_i32(*__v)?;
20750            }
20751            if let ::core::option::Option::Some(ref __v) = self.end {
20752                enc.write_field_name("end")?;
20753                enc.write_i32(*__v)?;
20754            }
20755            if let ::core::option::Option::Some(ref __v) = self.semantic {
20756                enc.write_field_name("semantic")?;
20757                enc.write_enum_name(__v.proto_name())?;
20758            }
20759            for __v in &self.path {
20760                enc.write_field_name("path")?;
20761                enc.write_i32(*__v)?;
20762            }
20763            enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
20764            ::core::result::Result::Ok(())
20765        }
20766        fn merge_text(
20767            &mut self,
20768            dec: &mut ::buffa::text::TextDecoder<'_>,
20769        ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
20770            #[allow(unused_imports)]
20771            use ::buffa::Enumeration as _;
20772            while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
20773                match __name {
20774                    "source_file" => {
20775                        self.source_file = ::core::option::Option::Some(
20776                            dec.read_string()?.into_owned(),
20777                        );
20778                    }
20779                    "begin" => self.begin = ::core::option::Option::Some(dec.read_i32()?),
20780                    "end" => self.end = ::core::option::Option::Some(dec.read_i32()?),
20781                    "semantic" => {
20782                        self.semantic = ::core::option::Option::Some(
20783                            dec
20784                                .read_closed_enum_by_name::<
20785                                    super::generated_code_info::annotation::Semantic,
20786                                >()?,
20787                        );
20788                    }
20789                    "path" => {
20790                        dec.read_repeated_into(&mut self.path, |__d| __d.read_i32())?
20791                    }
20792                    _ => dec.skip_value()?,
20793                }
20794            }
20795            ::core::result::Result::Ok(())
20796        }
20797    }
20798    #[cfg(feature = "json")]
20799    impl ::buffa::json_helpers::ProtoElemJson for Annotation {
20800        fn serialize_proto_json<S: ::serde::Serializer>(
20801            v: &Self,
20802            s: S,
20803        ) -> ::core::result::Result<S::Ok, S::Error> {
20804            ::serde::Serialize::serialize(v, s)
20805        }
20806        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20807            d: D,
20808        ) -> ::core::result::Result<Self, D::Error> {
20809            <Self as ::serde::Deserialize>::deserialize(d)
20810        }
20811    }
20812    #[cfg(feature = "json")]
20813    #[doc(hidden)]
20814    pub const __ANNOTATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
20815        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20816        to_json: ::buffa::type_registry::any_to_json::<Annotation>,
20817        from_json: ::buffa::type_registry::any_from_json::<Annotation>,
20818        is_wkt: false,
20819    };
20820    #[cfg(feature = "text")]
20821    #[doc(hidden)]
20822    pub const __ANNOTATION_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
20823        type_url: "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation",
20824        text_encode: ::buffa::type_registry::any_encode_text::<Annotation>,
20825        text_merge: ::buffa::type_registry::any_merge_text::<Annotation>,
20826    };
20827    pub mod annotation {
20828        #[allow(unused_imports)]
20829        use super::*;
20830        /// Represents the identified object's effect on the element in the original
20831        /// .proto file.
20832        #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
20833        #[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
20834        #[repr(i32)]
20835        pub enum Semantic {
20836            /// There is no effect or the effect is indescribable.
20837            NONE = 0i32,
20838            /// The element is set or otherwise mutated.
20839            SET = 1i32,
20840            /// An alias to the element is returned.
20841            ALIAS = 2i32,
20842        }
20843        impl Semantic {
20844            ///Idiomatic alias for [`Self::NONE`]; `Debug` prints the variant name.
20845            #[allow(non_upper_case_globals)]
20846            pub const None: Self = Self::NONE;
20847            ///Idiomatic alias for [`Self::SET`]; `Debug` prints the variant name.
20848            #[allow(non_upper_case_globals)]
20849            pub const Set: Self = Self::SET;
20850            ///Idiomatic alias for [`Self::ALIAS`]; `Debug` prints the variant name.
20851            #[allow(non_upper_case_globals)]
20852            pub const Alias: Self = Self::ALIAS;
20853        }
20854        impl ::core::default::Default for Semantic {
20855            fn default() -> Self {
20856                Self::NONE
20857            }
20858        }
20859        #[cfg(feature = "json")]
20860        const _: () = {
20861            impl ::serde::Serialize for Semantic {
20862                fn serialize<S: ::serde::Serializer>(
20863                    &self,
20864                    s: S,
20865                ) -> ::core::result::Result<S::Ok, S::Error> {
20866                    s.serialize_str(::buffa::Enumeration::proto_name(self))
20867                }
20868            }
20869            impl<'de> ::serde::Deserialize<'de> for Semantic {
20870                fn deserialize<D: ::serde::Deserializer<'de>>(
20871                    d: D,
20872                ) -> ::core::result::Result<Self, D::Error> {
20873                    struct _V;
20874                    impl ::serde::de::Visitor<'_> for _V {
20875                        type Value = Semantic;
20876                        fn expecting(
20877                            &self,
20878                            f: &mut ::core::fmt::Formatter<'_>,
20879                        ) -> ::core::fmt::Result {
20880                            f.write_str(
20881                                concat!(
20882                                    "a string, integer, or null for ", stringify!(Semantic)
20883                                ),
20884                            )
20885                        }
20886                        fn visit_str<E: ::serde::de::Error>(
20887                            self,
20888                            v: &str,
20889                        ) -> ::core::result::Result<Semantic, E> {
20890                            <Semantic as ::buffa::Enumeration>::from_proto_name(v)
20891                                .ok_or_else(|| {
20892                                    ::serde::de::Error::unknown_variant(v, &[])
20893                                })
20894                        }
20895                        fn visit_i64<E: ::serde::de::Error>(
20896                            self,
20897                            v: i64,
20898                        ) -> ::core::result::Result<Semantic, E> {
20899                            let v32 = i32::try_from(v)
20900                                .map_err(|_| {
20901                                    ::serde::de::Error::custom(
20902                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20903                                    )
20904                                })?;
20905                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20906                                .ok_or_else(|| {
20907                                    ::serde::de::Error::custom(
20908                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20909                                    )
20910                                })
20911                        }
20912                        fn visit_u64<E: ::serde::de::Error>(
20913                            self,
20914                            v: u64,
20915                        ) -> ::core::result::Result<Semantic, E> {
20916                            let v32 = i32::try_from(v)
20917                                .map_err(|_| {
20918                                    ::serde::de::Error::custom(
20919                                        ::buffa::alloc::format!("enum value {v} out of i32 range"),
20920                                    )
20921                                })?;
20922                            <Semantic as ::buffa::Enumeration>::from_i32(v32)
20923                                .ok_or_else(|| {
20924                                    ::serde::de::Error::custom(
20925                                        ::buffa::alloc::format!("unknown enum value {v32}"),
20926                                    )
20927                                })
20928                        }
20929                        fn visit_unit<E: ::serde::de::Error>(
20930                            self,
20931                        ) -> ::core::result::Result<Semantic, E> {
20932                            ::core::result::Result::Ok(
20933                                ::core::default::Default::default(),
20934                            )
20935                        }
20936                    }
20937                    d.deserialize_any(_V)
20938                }
20939            }
20940            impl ::buffa::json_helpers::ProtoElemJson for Semantic {
20941                fn serialize_proto_json<S: ::serde::Serializer>(
20942                    v: &Self,
20943                    s: S,
20944                ) -> ::core::result::Result<S::Ok, S::Error> {
20945                    ::serde::Serialize::serialize(v, s)
20946                }
20947                fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
20948                    d: D,
20949                ) -> ::core::result::Result<Self, D::Error> {
20950                    <Self as ::serde::Deserialize>::deserialize(d)
20951                }
20952            }
20953        };
20954        impl ::buffa::Enumeration for Semantic {
20955            fn from_i32(value: i32) -> ::core::option::Option<Self> {
20956                match value {
20957                    0i32 => ::core::option::Option::Some(Self::NONE),
20958                    1i32 => ::core::option::Option::Some(Self::SET),
20959                    2i32 => ::core::option::Option::Some(Self::ALIAS),
20960                    _ => ::core::option::Option::None,
20961                }
20962            }
20963            fn to_i32(&self) -> i32 {
20964                *self as i32
20965            }
20966            fn proto_name(&self) -> &'static str {
20967                match self {
20968                    Self::NONE => "NONE",
20969                    Self::SET => "SET",
20970                    Self::ALIAS => "ALIAS",
20971                }
20972            }
20973            fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
20974                match name {
20975                    "NONE" => ::core::option::Option::Some(Self::NONE),
20976                    "SET" => ::core::option::Option::Some(Self::SET),
20977                    "ALIAS" => ::core::option::Option::Some(Self::ALIAS),
20978                    _ => ::core::option::Option::None,
20979                }
20980            }
20981            fn values() -> &'static [Self] {
20982                &[Self::NONE, Self::SET, Self::ALIAS]
20983            }
20984        }
20985    }
20986    #[cfg(feature = "views")]
20987    #[doc(inline)]
20988    pub use super::__buffa::view::generated_code_info::AnnotationView;
20989    #[cfg(feature = "views")]
20990    #[doc(inline)]
20991    pub use super::__buffa::view::generated_code_info::AnnotationOwnedView;
20992}