Skip to main content

buffa_types/generated/
google.protobuf.wrappers.__view.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2// source: google/protobuf/wrappers.proto
3
4/// Wrapper message for `double`.
5///
6/// The JSON representation for `DoubleValue` is JSON number.
7#[derive(Clone, Debug, Default)]
8pub struct DoubleValueView<'a> {
9    /// The double value.
10    ///
11    /// Field 1: `value`
12    pub value: f64,
13    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14}
15impl<'a> ::buffa::MessageView<'a> for DoubleValueView<'a> {
16    type Owned = super::super::DoubleValue;
17    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
19        <Self as ::buffa::MessageView>::decode_view_ctx(
20            buf,
21            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
22        )
23    }
24    fn decode_view_with_ctx(
25        buf: &'a [u8],
26        ctx: ::buffa::DecodeContext<'_>,
27    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
28        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
29    }
30    fn merge_view_field(
31        &mut self,
32        tag: ::buffa::encoding::Tag,
33        cur: &'a [u8],
34        before_tag: &'a [u8],
35        ctx: ::buffa::DecodeContext<'_>,
36    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
37        let _ = ctx;
38        #[allow(unused_variables)]
39        let view = self;
40        let mut cur = cur;
41        match tag.field_number() {
42            1u32 => {
43                ::buffa::encoding::check_wire_type(
44                    tag,
45                    ::buffa::encoding::WireType::Fixed64,
46                )?;
47                view.value = ::buffa::types::decode_double(&mut cur)?;
48            }
49            _ => {
50                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
51                let span_len = before_tag.len() - cur.len();
52                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
53            }
54        }
55        ::core::result::Result::Ok(cur)
56    }
57    fn to_owned_message(
58        &self,
59    ) -> ::core::result::Result<super::super::DoubleValue, ::buffa::DecodeError> {
60        self.to_owned_from_source(None)
61    }
62    #[allow(clippy::useless_conversion, clippy::needless_update)]
63    fn to_owned_from_source(
64        &self,
65        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
66    ) -> ::core::result::Result<super::super::DoubleValue, ::buffa::DecodeError> {
67        #[allow(unused_imports)]
68        use ::buffa::alloc::string::ToString as _;
69        let _ = __buffa_src;
70        ::core::result::Result::Ok(super::super::DoubleValue {
71            value: self.value,
72            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
73            ..::core::default::Default::default()
74        })
75    }
76}
77impl<'a> ::buffa::ViewEncode<'a> for DoubleValueView<'a> {
78    #[allow(clippy::needless_borrow, clippy::let_and_return)]
79    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
80        #[allow(unused_imports)]
81        use ::buffa::Enumeration as _;
82        let mut size = 0u32;
83        if self.value.to_bits() != 0u64 {
84            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
85        }
86        size += self.__buffa_unknown_fields.encoded_len() as u32;
87        size
88    }
89    #[allow(clippy::needless_borrow)]
90    fn write_to(
91        &self,
92        _cache: &mut ::buffa::SizeCache,
93        buf: &mut impl ::buffa::bytes::BufMut,
94    ) {
95        #[allow(unused_imports)]
96        use ::buffa::Enumeration as _;
97        if self.value.to_bits() != 0u64 {
98            ::buffa::types::put_double_field(1u32, self.value, buf);
99        }
100        self.__buffa_unknown_fields.write_to(buf);
101    }
102}
103impl<'a> ::buffa::MessageName for DoubleValueView<'a> {
104    const PACKAGE: &'static str = "google.protobuf";
105    const NAME: &'static str = "DoubleValue";
106    const FULL_NAME: &'static str = "google.protobuf.DoubleValue";
107    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
108}
109::buffa::impl_default_view_instance!(DoubleValueView);
110::buffa::impl_view_reborrow!(DoubleValueView);
111/** Self-contained, `'static` owned view of a `DoubleValue` message.
112
113 Wraps [`::buffa::OwnedView`]`<`[`DoubleValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
114
115 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DoubleValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
116#[derive(Clone, Debug)]
117pub struct DoubleValueOwnedView(::buffa::OwnedView<DoubleValueView<'static>>);
118impl DoubleValueOwnedView {
119    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
120    ///
121    /// The view borrows directly from the buffer's data; the buffer is
122    /// retained inside the returned handle.
123    ///
124    /// # Errors
125    ///
126    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
127    /// protobuf data.
128    pub fn decode(
129        bytes: ::buffa::bytes::Bytes,
130    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
131        ::core::result::Result::Ok(
132            DoubleValueOwnedView(::buffa::OwnedView::decode(bytes)?),
133        )
134    }
135    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
136    /// max message size).
137    ///
138    /// # Errors
139    ///
140    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
141    /// exceeds the configured limits.
142    pub fn decode_with_options(
143        bytes: ::buffa::bytes::Bytes,
144        opts: &::buffa::DecodeOptions,
145    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
146        ::core::result::Result::Ok(
147            DoubleValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
148        )
149    }
150    /// Build from an owned message via an encode → decode round-trip.
151    ///
152    /// # Errors
153    ///
154    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
155    /// somehow invalid (should not happen for well-formed messages).
156    pub fn from_owned(
157        msg: &super::super::DoubleValue,
158    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
159        ::core::result::Result::Ok(
160            DoubleValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
161        )
162    }
163    /// Borrow the full [`DoubleValueView`] with its lifetime tied to `&self`.
164    #[must_use]
165    pub fn view(&self) -> &DoubleValueView<'_> {
166        self.0.reborrow()
167    }
168    /// Convert to the owned message type.
169    ///
170    /// # Errors
171    ///
172    /// Returns an error if re-materializing preserved unknown fields
173    /// fails (e.g. the unknown-field limit is exceeded).
174    pub fn to_owned_message(
175        &self,
176    ) -> ::core::result::Result<super::super::DoubleValue, ::buffa::DecodeError> {
177        self.0.to_owned_message()
178    }
179    /// The underlying bytes buffer.
180    #[must_use]
181    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
182        self.0.bytes()
183    }
184    /// Consume the handle, returning the underlying bytes buffer.
185    #[must_use]
186    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
187        self.0.into_bytes()
188    }
189    /// The double value.
190    ///
191    /// Field 1: `value`
192    #[must_use]
193    pub fn value(&self) -> f64 {
194        self.0.reborrow().value
195    }
196}
197impl ::core::convert::From<::buffa::OwnedView<DoubleValueView<'static>>>
198for DoubleValueOwnedView {
199    fn from(inner: ::buffa::OwnedView<DoubleValueView<'static>>) -> Self {
200        DoubleValueOwnedView(inner)
201    }
202}
203impl ::core::convert::From<DoubleValueOwnedView>
204for ::buffa::OwnedView<DoubleValueView<'static>> {
205    fn from(wrapper: DoubleValueOwnedView) -> Self {
206        wrapper.0
207    }
208}
209impl ::core::convert::AsRef<::buffa::OwnedView<DoubleValueView<'static>>>
210for DoubleValueOwnedView {
211    fn as_ref(&self) -> &::buffa::OwnedView<DoubleValueView<'static>> {
212        &self.0
213    }
214}
215impl ::buffa::HasMessageView for super::super::DoubleValue {
216    type View<'a> = DoubleValueView<'a>;
217    type ViewHandle = DoubleValueOwnedView;
218}
219#[cfg(feature = "reflect")]
220const _: () = {
221    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for DoubleValueView<'a> {
222        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
223            super::super::__buffa::reflect::descriptor_pool()
224                .message(Self::__buffa_reflect_message_index())
225        }
226        fn pool(
227            &self,
228        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
229            super::super::__buffa::reflect::descriptor_pool()
230        }
231        fn get(
232            &self,
233            field: &::buffa_descriptor::FieldDescriptor,
234        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
235            #[allow(unused_imports)]
236            use ::buffa::Enumeration as _;
237            match field.number() {
238                1u32 => ::buffa_descriptor::reflect::ValueRef::F64(self.value),
239                _ => {
240                    ::core::debug_assert!(
241                        false,
242                        "field number {} is not a member of this view's reflect get()",
243                        field.number(),
244                    );
245                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
246                }
247            }
248        }
249        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
250            match field.number() {
251                1u32 => self.value != 0.0,
252                _ => false,
253            }
254        }
255        fn for_each_set(
256            &self,
257            f: &mut dyn ::core::ops::FnMut(
258                &::buffa_descriptor::FieldDescriptor,
259                ::buffa_descriptor::reflect::ValueRef<'_>,
260            ),
261        ) {
262            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
263                self,
264            );
265            for fd in md.fields() {
266                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
267                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
268                }
269            }
270        }
271        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
272            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
273            ::buffa_descriptor::reflect::DynamicMessage::decode(
274                    ::buffa::alloc::sync::Arc::clone(
275                        super::super::__buffa::reflect::descriptor_pool(),
276                    ),
277                    Self::__buffa_reflect_message_index(),
278                    &bytes,
279                )
280                .expect("view re-encodes to bytes decodable against its own descriptor")
281        }
282    }
283    impl<'a> ::buffa_descriptor::reflect::ReflectElement for DoubleValueView<'a> {
284        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
285            ::buffa_descriptor::reflect::ValueRef::Message(
286                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
287            )
288        }
289    }
290    impl<'a> DoubleValueView<'a> {
291        /// Memoized `MessageIndex` for this view's message type, resolved
292        /// once against the package's embedded descriptor pool. An inherent
293        /// associated fn (not a free fn) so sibling views in the same module
294        /// do not collide.
295        #[doc(hidden)]
296        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
297            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
298            *IDX
299                .get_or_init(|| {
300                    super::super::__buffa::reflect::descriptor_pool()
301                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
302                        .expect(
303                            "generated view type is registered in the embedded descriptor pool",
304                        )
305                })
306        }
307    }
308};
309/// Wrapper message for `float`.
310///
311/// The JSON representation for `FloatValue` is JSON number.
312#[derive(Clone, Debug, Default)]
313pub struct FloatValueView<'a> {
314    /// The float value.
315    ///
316    /// Field 1: `value`
317    pub value: f32,
318    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
319}
320impl<'a> ::buffa::MessageView<'a> for FloatValueView<'a> {
321    type Owned = super::super::FloatValue;
322    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
323        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
324        <Self as ::buffa::MessageView>::decode_view_ctx(
325            buf,
326            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
327        )
328    }
329    fn decode_view_with_ctx(
330        buf: &'a [u8],
331        ctx: ::buffa::DecodeContext<'_>,
332    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
333        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
334    }
335    fn merge_view_field(
336        &mut self,
337        tag: ::buffa::encoding::Tag,
338        cur: &'a [u8],
339        before_tag: &'a [u8],
340        ctx: ::buffa::DecodeContext<'_>,
341    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
342        let _ = ctx;
343        #[allow(unused_variables)]
344        let view = self;
345        let mut cur = cur;
346        match tag.field_number() {
347            1u32 => {
348                ::buffa::encoding::check_wire_type(
349                    tag,
350                    ::buffa::encoding::WireType::Fixed32,
351                )?;
352                view.value = ::buffa::types::decode_float(&mut cur)?;
353            }
354            _ => {
355                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
356                let span_len = before_tag.len() - cur.len();
357                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
358            }
359        }
360        ::core::result::Result::Ok(cur)
361    }
362    fn to_owned_message(
363        &self,
364    ) -> ::core::result::Result<super::super::FloatValue, ::buffa::DecodeError> {
365        self.to_owned_from_source(None)
366    }
367    #[allow(clippy::useless_conversion, clippy::needless_update)]
368    fn to_owned_from_source(
369        &self,
370        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
371    ) -> ::core::result::Result<super::super::FloatValue, ::buffa::DecodeError> {
372        #[allow(unused_imports)]
373        use ::buffa::alloc::string::ToString as _;
374        let _ = __buffa_src;
375        ::core::result::Result::Ok(super::super::FloatValue {
376            value: self.value,
377            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
378            ..::core::default::Default::default()
379        })
380    }
381}
382impl<'a> ::buffa::ViewEncode<'a> for FloatValueView<'a> {
383    #[allow(clippy::needless_borrow, clippy::let_and_return)]
384    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
385        #[allow(unused_imports)]
386        use ::buffa::Enumeration as _;
387        let mut size = 0u32;
388        if self.value.to_bits() != 0u32 {
389            size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
390        }
391        size += self.__buffa_unknown_fields.encoded_len() as u32;
392        size
393    }
394    #[allow(clippy::needless_borrow)]
395    fn write_to(
396        &self,
397        _cache: &mut ::buffa::SizeCache,
398        buf: &mut impl ::buffa::bytes::BufMut,
399    ) {
400        #[allow(unused_imports)]
401        use ::buffa::Enumeration as _;
402        if self.value.to_bits() != 0u32 {
403            ::buffa::types::put_float_field(1u32, self.value, buf);
404        }
405        self.__buffa_unknown_fields.write_to(buf);
406    }
407}
408impl<'a> ::buffa::MessageName for FloatValueView<'a> {
409    const PACKAGE: &'static str = "google.protobuf";
410    const NAME: &'static str = "FloatValue";
411    const FULL_NAME: &'static str = "google.protobuf.FloatValue";
412    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
413}
414::buffa::impl_default_view_instance!(FloatValueView);
415::buffa::impl_view_reborrow!(FloatValueView);
416/** Self-contained, `'static` owned view of a `FloatValue` message.
417
418 Wraps [`::buffa::OwnedView`]`<`[`FloatValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
419
420 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`FloatValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
421#[derive(Clone, Debug)]
422pub struct FloatValueOwnedView(::buffa::OwnedView<FloatValueView<'static>>);
423impl FloatValueOwnedView {
424    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
425    ///
426    /// The view borrows directly from the buffer's data; the buffer is
427    /// retained inside the returned handle.
428    ///
429    /// # Errors
430    ///
431    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
432    /// protobuf data.
433    pub fn decode(
434        bytes: ::buffa::bytes::Bytes,
435    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
436        ::core::result::Result::Ok(
437            FloatValueOwnedView(::buffa::OwnedView::decode(bytes)?),
438        )
439    }
440    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
441    /// max message size).
442    ///
443    /// # Errors
444    ///
445    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
446    /// exceeds the configured limits.
447    pub fn decode_with_options(
448        bytes: ::buffa::bytes::Bytes,
449        opts: &::buffa::DecodeOptions,
450    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
451        ::core::result::Result::Ok(
452            FloatValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
453        )
454    }
455    /// Build from an owned message via an encode → decode round-trip.
456    ///
457    /// # Errors
458    ///
459    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
460    /// somehow invalid (should not happen for well-formed messages).
461    pub fn from_owned(
462        msg: &super::super::FloatValue,
463    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
464        ::core::result::Result::Ok(
465            FloatValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
466        )
467    }
468    /// Borrow the full [`FloatValueView`] with its lifetime tied to `&self`.
469    #[must_use]
470    pub fn view(&self) -> &FloatValueView<'_> {
471        self.0.reborrow()
472    }
473    /// Convert to the owned message type.
474    ///
475    /// # Errors
476    ///
477    /// Returns an error if re-materializing preserved unknown fields
478    /// fails (e.g. the unknown-field limit is exceeded).
479    pub fn to_owned_message(
480        &self,
481    ) -> ::core::result::Result<super::super::FloatValue, ::buffa::DecodeError> {
482        self.0.to_owned_message()
483    }
484    /// The underlying bytes buffer.
485    #[must_use]
486    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
487        self.0.bytes()
488    }
489    /// Consume the handle, returning the underlying bytes buffer.
490    #[must_use]
491    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
492        self.0.into_bytes()
493    }
494    /// The float value.
495    ///
496    /// Field 1: `value`
497    #[must_use]
498    pub fn value(&self) -> f32 {
499        self.0.reborrow().value
500    }
501}
502impl ::core::convert::From<::buffa::OwnedView<FloatValueView<'static>>>
503for FloatValueOwnedView {
504    fn from(inner: ::buffa::OwnedView<FloatValueView<'static>>) -> Self {
505        FloatValueOwnedView(inner)
506    }
507}
508impl ::core::convert::From<FloatValueOwnedView>
509for ::buffa::OwnedView<FloatValueView<'static>> {
510    fn from(wrapper: FloatValueOwnedView) -> Self {
511        wrapper.0
512    }
513}
514impl ::core::convert::AsRef<::buffa::OwnedView<FloatValueView<'static>>>
515for FloatValueOwnedView {
516    fn as_ref(&self) -> &::buffa::OwnedView<FloatValueView<'static>> {
517        &self.0
518    }
519}
520impl ::buffa::HasMessageView for super::super::FloatValue {
521    type View<'a> = FloatValueView<'a>;
522    type ViewHandle = FloatValueOwnedView;
523}
524#[cfg(feature = "reflect")]
525const _: () = {
526    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for FloatValueView<'a> {
527        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
528            super::super::__buffa::reflect::descriptor_pool()
529                .message(Self::__buffa_reflect_message_index())
530        }
531        fn pool(
532            &self,
533        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
534            super::super::__buffa::reflect::descriptor_pool()
535        }
536        fn get(
537            &self,
538            field: &::buffa_descriptor::FieldDescriptor,
539        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
540            #[allow(unused_imports)]
541            use ::buffa::Enumeration as _;
542            match field.number() {
543                1u32 => ::buffa_descriptor::reflect::ValueRef::F32(self.value),
544                _ => {
545                    ::core::debug_assert!(
546                        false,
547                        "field number {} is not a member of this view's reflect get()",
548                        field.number(),
549                    );
550                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
551                }
552            }
553        }
554        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
555            match field.number() {
556                1u32 => self.value != 0.0,
557                _ => false,
558            }
559        }
560        fn for_each_set(
561            &self,
562            f: &mut dyn ::core::ops::FnMut(
563                &::buffa_descriptor::FieldDescriptor,
564                ::buffa_descriptor::reflect::ValueRef<'_>,
565            ),
566        ) {
567            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
568                self,
569            );
570            for fd in md.fields() {
571                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
572                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
573                }
574            }
575        }
576        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
577            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
578            ::buffa_descriptor::reflect::DynamicMessage::decode(
579                    ::buffa::alloc::sync::Arc::clone(
580                        super::super::__buffa::reflect::descriptor_pool(),
581                    ),
582                    Self::__buffa_reflect_message_index(),
583                    &bytes,
584                )
585                .expect("view re-encodes to bytes decodable against its own descriptor")
586        }
587    }
588    impl<'a> ::buffa_descriptor::reflect::ReflectElement for FloatValueView<'a> {
589        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
590            ::buffa_descriptor::reflect::ValueRef::Message(
591                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
592            )
593        }
594    }
595    impl<'a> FloatValueView<'a> {
596        /// Memoized `MessageIndex` for this view's message type, resolved
597        /// once against the package's embedded descriptor pool. An inherent
598        /// associated fn (not a free fn) so sibling views in the same module
599        /// do not collide.
600        #[doc(hidden)]
601        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
602            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
603            *IDX
604                .get_or_init(|| {
605                    super::super::__buffa::reflect::descriptor_pool()
606                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
607                        .expect(
608                            "generated view type is registered in the embedded descriptor pool",
609                        )
610                })
611        }
612    }
613};
614/// Wrapper message for `int64`.
615///
616/// The JSON representation for `Int64Value` is JSON string.
617#[derive(Clone, Debug, Default)]
618pub struct Int64ValueView<'a> {
619    /// The int64 value.
620    ///
621    /// Field 1: `value`
622    pub value: i64,
623    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
624}
625impl<'a> ::buffa::MessageView<'a> for Int64ValueView<'a> {
626    type Owned = super::super::Int64Value;
627    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
628        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
629        <Self as ::buffa::MessageView>::decode_view_ctx(
630            buf,
631            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
632        )
633    }
634    fn decode_view_with_ctx(
635        buf: &'a [u8],
636        ctx: ::buffa::DecodeContext<'_>,
637    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
638        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
639    }
640    fn merge_view_field(
641        &mut self,
642        tag: ::buffa::encoding::Tag,
643        cur: &'a [u8],
644        before_tag: &'a [u8],
645        ctx: ::buffa::DecodeContext<'_>,
646    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
647        let _ = ctx;
648        #[allow(unused_variables)]
649        let view = self;
650        let mut cur = cur;
651        match tag.field_number() {
652            1u32 => {
653                ::buffa::encoding::check_wire_type(
654                    tag,
655                    ::buffa::encoding::WireType::Varint,
656                )?;
657                view.value = ::buffa::types::decode_int64(&mut cur)?;
658            }
659            _ => {
660                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
661                let span_len = before_tag.len() - cur.len();
662                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
663            }
664        }
665        ::core::result::Result::Ok(cur)
666    }
667    fn to_owned_message(
668        &self,
669    ) -> ::core::result::Result<super::super::Int64Value, ::buffa::DecodeError> {
670        self.to_owned_from_source(None)
671    }
672    #[allow(clippy::useless_conversion, clippy::needless_update)]
673    fn to_owned_from_source(
674        &self,
675        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
676    ) -> ::core::result::Result<super::super::Int64Value, ::buffa::DecodeError> {
677        #[allow(unused_imports)]
678        use ::buffa::alloc::string::ToString as _;
679        let _ = __buffa_src;
680        ::core::result::Result::Ok(super::super::Int64Value {
681            value: self.value,
682            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
683            ..::core::default::Default::default()
684        })
685    }
686}
687impl<'a> ::buffa::ViewEncode<'a> for Int64ValueView<'a> {
688    #[allow(clippy::needless_borrow, clippy::let_and_return)]
689    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
690        #[allow(unused_imports)]
691        use ::buffa::Enumeration as _;
692        let mut size = 0u32;
693        if self.value != 0i64 {
694            size += 1u32 + ::buffa::types::int64_encoded_len(self.value) as u32;
695        }
696        size += self.__buffa_unknown_fields.encoded_len() as u32;
697        size
698    }
699    #[allow(clippy::needless_borrow)]
700    fn write_to(
701        &self,
702        _cache: &mut ::buffa::SizeCache,
703        buf: &mut impl ::buffa::bytes::BufMut,
704    ) {
705        #[allow(unused_imports)]
706        use ::buffa::Enumeration as _;
707        if self.value != 0i64 {
708            ::buffa::types::put_int64_field(1u32, self.value, buf);
709        }
710        self.__buffa_unknown_fields.write_to(buf);
711    }
712}
713impl<'a> ::buffa::MessageName for Int64ValueView<'a> {
714    const PACKAGE: &'static str = "google.protobuf";
715    const NAME: &'static str = "Int64Value";
716    const FULL_NAME: &'static str = "google.protobuf.Int64Value";
717    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
718}
719::buffa::impl_default_view_instance!(Int64ValueView);
720::buffa::impl_view_reborrow!(Int64ValueView);
721/** Self-contained, `'static` owned view of a `Int64Value` message.
722
723 Wraps [`::buffa::OwnedView`]`<`[`Int64ValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
724
725 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`Int64ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
726#[derive(Clone, Debug)]
727pub struct Int64ValueOwnedView(::buffa::OwnedView<Int64ValueView<'static>>);
728impl Int64ValueOwnedView {
729    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
730    ///
731    /// The view borrows directly from the buffer's data; the buffer is
732    /// retained inside the returned handle.
733    ///
734    /// # Errors
735    ///
736    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
737    /// protobuf data.
738    pub fn decode(
739        bytes: ::buffa::bytes::Bytes,
740    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
741        ::core::result::Result::Ok(
742            Int64ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
743        )
744    }
745    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
746    /// max message size).
747    ///
748    /// # Errors
749    ///
750    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
751    /// exceeds the configured limits.
752    pub fn decode_with_options(
753        bytes: ::buffa::bytes::Bytes,
754        opts: &::buffa::DecodeOptions,
755    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
756        ::core::result::Result::Ok(
757            Int64ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
758        )
759    }
760    /// Build from an owned message via an encode → decode round-trip.
761    ///
762    /// # Errors
763    ///
764    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
765    /// somehow invalid (should not happen for well-formed messages).
766    pub fn from_owned(
767        msg: &super::super::Int64Value,
768    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
769        ::core::result::Result::Ok(
770            Int64ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
771        )
772    }
773    /// Borrow the full [`Int64ValueView`] with its lifetime tied to `&self`.
774    #[must_use]
775    pub fn view(&self) -> &Int64ValueView<'_> {
776        self.0.reborrow()
777    }
778    /// Convert to the owned message type.
779    ///
780    /// # Errors
781    ///
782    /// Returns an error if re-materializing preserved unknown fields
783    /// fails (e.g. the unknown-field limit is exceeded).
784    pub fn to_owned_message(
785        &self,
786    ) -> ::core::result::Result<super::super::Int64Value, ::buffa::DecodeError> {
787        self.0.to_owned_message()
788    }
789    /// The underlying bytes buffer.
790    #[must_use]
791    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
792        self.0.bytes()
793    }
794    /// Consume the handle, returning the underlying bytes buffer.
795    #[must_use]
796    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
797        self.0.into_bytes()
798    }
799    /// The int64 value.
800    ///
801    /// Field 1: `value`
802    #[must_use]
803    pub fn value(&self) -> i64 {
804        self.0.reborrow().value
805    }
806}
807impl ::core::convert::From<::buffa::OwnedView<Int64ValueView<'static>>>
808for Int64ValueOwnedView {
809    fn from(inner: ::buffa::OwnedView<Int64ValueView<'static>>) -> Self {
810        Int64ValueOwnedView(inner)
811    }
812}
813impl ::core::convert::From<Int64ValueOwnedView>
814for ::buffa::OwnedView<Int64ValueView<'static>> {
815    fn from(wrapper: Int64ValueOwnedView) -> Self {
816        wrapper.0
817    }
818}
819impl ::core::convert::AsRef<::buffa::OwnedView<Int64ValueView<'static>>>
820for Int64ValueOwnedView {
821    fn as_ref(&self) -> &::buffa::OwnedView<Int64ValueView<'static>> {
822        &self.0
823    }
824}
825impl ::buffa::HasMessageView for super::super::Int64Value {
826    type View<'a> = Int64ValueView<'a>;
827    type ViewHandle = Int64ValueOwnedView;
828}
829#[cfg(feature = "reflect")]
830const _: () = {
831    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for Int64ValueView<'a> {
832        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
833            super::super::__buffa::reflect::descriptor_pool()
834                .message(Self::__buffa_reflect_message_index())
835        }
836        fn pool(
837            &self,
838        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
839            super::super::__buffa::reflect::descriptor_pool()
840        }
841        fn get(
842            &self,
843            field: &::buffa_descriptor::FieldDescriptor,
844        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
845            #[allow(unused_imports)]
846            use ::buffa::Enumeration as _;
847            match field.number() {
848                1u32 => ::buffa_descriptor::reflect::ValueRef::I64(self.value),
849                _ => {
850                    ::core::debug_assert!(
851                        false,
852                        "field number {} is not a member of this view's reflect get()",
853                        field.number(),
854                    );
855                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
856                }
857            }
858        }
859        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
860            match field.number() {
861                1u32 => self.value != 0,
862                _ => false,
863            }
864        }
865        fn for_each_set(
866            &self,
867            f: &mut dyn ::core::ops::FnMut(
868                &::buffa_descriptor::FieldDescriptor,
869                ::buffa_descriptor::reflect::ValueRef<'_>,
870            ),
871        ) {
872            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
873                self,
874            );
875            for fd in md.fields() {
876                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
877                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
878                }
879            }
880        }
881        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
882            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
883            ::buffa_descriptor::reflect::DynamicMessage::decode(
884                    ::buffa::alloc::sync::Arc::clone(
885                        super::super::__buffa::reflect::descriptor_pool(),
886                    ),
887                    Self::__buffa_reflect_message_index(),
888                    &bytes,
889                )
890                .expect("view re-encodes to bytes decodable against its own descriptor")
891        }
892    }
893    impl<'a> ::buffa_descriptor::reflect::ReflectElement for Int64ValueView<'a> {
894        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
895            ::buffa_descriptor::reflect::ValueRef::Message(
896                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
897            )
898        }
899    }
900    impl<'a> Int64ValueView<'a> {
901        /// Memoized `MessageIndex` for this view's message type, resolved
902        /// once against the package's embedded descriptor pool. An inherent
903        /// associated fn (not a free fn) so sibling views in the same module
904        /// do not collide.
905        #[doc(hidden)]
906        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
907            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
908            *IDX
909                .get_or_init(|| {
910                    super::super::__buffa::reflect::descriptor_pool()
911                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
912                        .expect(
913                            "generated view type is registered in the embedded descriptor pool",
914                        )
915                })
916        }
917    }
918};
919/// Wrapper message for `uint64`.
920///
921/// The JSON representation for `UInt64Value` is JSON string.
922#[derive(Clone, Debug, Default)]
923pub struct UInt64ValueView<'a> {
924    /// The uint64 value.
925    ///
926    /// Field 1: `value`
927    pub value: u64,
928    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
929}
930impl<'a> ::buffa::MessageView<'a> for UInt64ValueView<'a> {
931    type Owned = super::super::UInt64Value;
932    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
933        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
934        <Self as ::buffa::MessageView>::decode_view_ctx(
935            buf,
936            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
937        )
938    }
939    fn decode_view_with_ctx(
940        buf: &'a [u8],
941        ctx: ::buffa::DecodeContext<'_>,
942    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
943        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
944    }
945    fn merge_view_field(
946        &mut self,
947        tag: ::buffa::encoding::Tag,
948        cur: &'a [u8],
949        before_tag: &'a [u8],
950        ctx: ::buffa::DecodeContext<'_>,
951    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
952        let _ = ctx;
953        #[allow(unused_variables)]
954        let view = self;
955        let mut cur = cur;
956        match tag.field_number() {
957            1u32 => {
958                ::buffa::encoding::check_wire_type(
959                    tag,
960                    ::buffa::encoding::WireType::Varint,
961                )?;
962                view.value = ::buffa::types::decode_uint64(&mut cur)?;
963            }
964            _ => {
965                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
966                let span_len = before_tag.len() - cur.len();
967                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
968            }
969        }
970        ::core::result::Result::Ok(cur)
971    }
972    fn to_owned_message(
973        &self,
974    ) -> ::core::result::Result<super::super::UInt64Value, ::buffa::DecodeError> {
975        self.to_owned_from_source(None)
976    }
977    #[allow(clippy::useless_conversion, clippy::needless_update)]
978    fn to_owned_from_source(
979        &self,
980        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
981    ) -> ::core::result::Result<super::super::UInt64Value, ::buffa::DecodeError> {
982        #[allow(unused_imports)]
983        use ::buffa::alloc::string::ToString as _;
984        let _ = __buffa_src;
985        ::core::result::Result::Ok(super::super::UInt64Value {
986            value: self.value,
987            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
988            ..::core::default::Default::default()
989        })
990    }
991}
992impl<'a> ::buffa::ViewEncode<'a> for UInt64ValueView<'a> {
993    #[allow(clippy::needless_borrow, clippy::let_and_return)]
994    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
995        #[allow(unused_imports)]
996        use ::buffa::Enumeration as _;
997        let mut size = 0u32;
998        if self.value != 0u64 {
999            size += 1u32 + ::buffa::types::uint64_encoded_len(self.value) as u32;
1000        }
1001        size += self.__buffa_unknown_fields.encoded_len() as u32;
1002        size
1003    }
1004    #[allow(clippy::needless_borrow)]
1005    fn write_to(
1006        &self,
1007        _cache: &mut ::buffa::SizeCache,
1008        buf: &mut impl ::buffa::bytes::BufMut,
1009    ) {
1010        #[allow(unused_imports)]
1011        use ::buffa::Enumeration as _;
1012        if self.value != 0u64 {
1013            ::buffa::types::put_uint64_field(1u32, self.value, buf);
1014        }
1015        self.__buffa_unknown_fields.write_to(buf);
1016    }
1017}
1018impl<'a> ::buffa::MessageName for UInt64ValueView<'a> {
1019    const PACKAGE: &'static str = "google.protobuf";
1020    const NAME: &'static str = "UInt64Value";
1021    const FULL_NAME: &'static str = "google.protobuf.UInt64Value";
1022    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
1023}
1024::buffa::impl_default_view_instance!(UInt64ValueView);
1025::buffa::impl_view_reborrow!(UInt64ValueView);
1026/** Self-contained, `'static` owned view of a `UInt64Value` message.
1027
1028 Wraps [`::buffa::OwnedView`]`<`[`UInt64ValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1029
1030 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UInt64ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1031#[derive(Clone, Debug)]
1032pub struct UInt64ValueOwnedView(::buffa::OwnedView<UInt64ValueView<'static>>);
1033impl UInt64ValueOwnedView {
1034    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1035    ///
1036    /// The view borrows directly from the buffer's data; the buffer is
1037    /// retained inside the returned handle.
1038    ///
1039    /// # Errors
1040    ///
1041    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1042    /// protobuf data.
1043    pub fn decode(
1044        bytes: ::buffa::bytes::Bytes,
1045    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1046        ::core::result::Result::Ok(
1047            UInt64ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
1048        )
1049    }
1050    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1051    /// max message size).
1052    ///
1053    /// # Errors
1054    ///
1055    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1056    /// exceeds the configured limits.
1057    pub fn decode_with_options(
1058        bytes: ::buffa::bytes::Bytes,
1059        opts: &::buffa::DecodeOptions,
1060    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1061        ::core::result::Result::Ok(
1062            UInt64ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
1063        )
1064    }
1065    /// Build from an owned message via an encode → decode round-trip.
1066    ///
1067    /// # Errors
1068    ///
1069    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1070    /// somehow invalid (should not happen for well-formed messages).
1071    pub fn from_owned(
1072        msg: &super::super::UInt64Value,
1073    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1074        ::core::result::Result::Ok(
1075            UInt64ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
1076        )
1077    }
1078    /// Borrow the full [`UInt64ValueView`] with its lifetime tied to `&self`.
1079    #[must_use]
1080    pub fn view(&self) -> &UInt64ValueView<'_> {
1081        self.0.reborrow()
1082    }
1083    /// Convert to the owned message type.
1084    ///
1085    /// # Errors
1086    ///
1087    /// Returns an error if re-materializing preserved unknown fields
1088    /// fails (e.g. the unknown-field limit is exceeded).
1089    pub fn to_owned_message(
1090        &self,
1091    ) -> ::core::result::Result<super::super::UInt64Value, ::buffa::DecodeError> {
1092        self.0.to_owned_message()
1093    }
1094    /// The underlying bytes buffer.
1095    #[must_use]
1096    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1097        self.0.bytes()
1098    }
1099    /// Consume the handle, returning the underlying bytes buffer.
1100    #[must_use]
1101    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1102        self.0.into_bytes()
1103    }
1104    /// The uint64 value.
1105    ///
1106    /// Field 1: `value`
1107    #[must_use]
1108    pub fn value(&self) -> u64 {
1109        self.0.reborrow().value
1110    }
1111}
1112impl ::core::convert::From<::buffa::OwnedView<UInt64ValueView<'static>>>
1113for UInt64ValueOwnedView {
1114    fn from(inner: ::buffa::OwnedView<UInt64ValueView<'static>>) -> Self {
1115        UInt64ValueOwnedView(inner)
1116    }
1117}
1118impl ::core::convert::From<UInt64ValueOwnedView>
1119for ::buffa::OwnedView<UInt64ValueView<'static>> {
1120    fn from(wrapper: UInt64ValueOwnedView) -> Self {
1121        wrapper.0
1122    }
1123}
1124impl ::core::convert::AsRef<::buffa::OwnedView<UInt64ValueView<'static>>>
1125for UInt64ValueOwnedView {
1126    fn as_ref(&self) -> &::buffa::OwnedView<UInt64ValueView<'static>> {
1127        &self.0
1128    }
1129}
1130impl ::buffa::HasMessageView for super::super::UInt64Value {
1131    type View<'a> = UInt64ValueView<'a>;
1132    type ViewHandle = UInt64ValueOwnedView;
1133}
1134#[cfg(feature = "reflect")]
1135const _: () = {
1136    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for UInt64ValueView<'a> {
1137        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1138            super::super::__buffa::reflect::descriptor_pool()
1139                .message(Self::__buffa_reflect_message_index())
1140        }
1141        fn pool(
1142            &self,
1143        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1144            super::super::__buffa::reflect::descriptor_pool()
1145        }
1146        fn get(
1147            &self,
1148            field: &::buffa_descriptor::FieldDescriptor,
1149        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1150            #[allow(unused_imports)]
1151            use ::buffa::Enumeration as _;
1152            match field.number() {
1153                1u32 => ::buffa_descriptor::reflect::ValueRef::U64(self.value),
1154                _ => {
1155                    ::core::debug_assert!(
1156                        false,
1157                        "field number {} is not a member of this view's reflect get()",
1158                        field.number(),
1159                    );
1160                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
1161                }
1162            }
1163        }
1164        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1165            match field.number() {
1166                1u32 => self.value != 0,
1167                _ => false,
1168            }
1169        }
1170        fn for_each_set(
1171            &self,
1172            f: &mut dyn ::core::ops::FnMut(
1173                &::buffa_descriptor::FieldDescriptor,
1174                ::buffa_descriptor::reflect::ValueRef<'_>,
1175            ),
1176        ) {
1177            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1178                self,
1179            );
1180            for fd in md.fields() {
1181                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1182                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1183                }
1184            }
1185        }
1186        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1187            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
1188            ::buffa_descriptor::reflect::DynamicMessage::decode(
1189                    ::buffa::alloc::sync::Arc::clone(
1190                        super::super::__buffa::reflect::descriptor_pool(),
1191                    ),
1192                    Self::__buffa_reflect_message_index(),
1193                    &bytes,
1194                )
1195                .expect("view re-encodes to bytes decodable against its own descriptor")
1196        }
1197    }
1198    impl<'a> ::buffa_descriptor::reflect::ReflectElement for UInt64ValueView<'a> {
1199        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1200            ::buffa_descriptor::reflect::ValueRef::Message(
1201                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1202            )
1203        }
1204    }
1205    impl<'a> UInt64ValueView<'a> {
1206        /// Memoized `MessageIndex` for this view's message type, resolved
1207        /// once against the package's embedded descriptor pool. An inherent
1208        /// associated fn (not a free fn) so sibling views in the same module
1209        /// do not collide.
1210        #[doc(hidden)]
1211        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1212            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1213            *IDX
1214                .get_or_init(|| {
1215                    super::super::__buffa::reflect::descriptor_pool()
1216                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1217                        .expect(
1218                            "generated view type is registered in the embedded descriptor pool",
1219                        )
1220                })
1221        }
1222    }
1223};
1224/// Wrapper message for `int32`.
1225///
1226/// The JSON representation for `Int32Value` is JSON number.
1227#[derive(Clone, Debug, Default)]
1228pub struct Int32ValueView<'a> {
1229    /// The int32 value.
1230    ///
1231    /// Field 1: `value`
1232    pub value: i32,
1233    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1234}
1235impl<'a> ::buffa::MessageView<'a> for Int32ValueView<'a> {
1236    type Owned = super::super::Int32Value;
1237    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1238        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
1239        <Self as ::buffa::MessageView>::decode_view_ctx(
1240            buf,
1241            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1242        )
1243    }
1244    fn decode_view_with_ctx(
1245        buf: &'a [u8],
1246        ctx: ::buffa::DecodeContext<'_>,
1247    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1248        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1249    }
1250    fn merge_view_field(
1251        &mut self,
1252        tag: ::buffa::encoding::Tag,
1253        cur: &'a [u8],
1254        before_tag: &'a [u8],
1255        ctx: ::buffa::DecodeContext<'_>,
1256    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1257        let _ = ctx;
1258        #[allow(unused_variables)]
1259        let view = self;
1260        let mut cur = cur;
1261        match tag.field_number() {
1262            1u32 => {
1263                ::buffa::encoding::check_wire_type(
1264                    tag,
1265                    ::buffa::encoding::WireType::Varint,
1266                )?;
1267                view.value = ::buffa::types::decode_int32(&mut cur)?;
1268            }
1269            _ => {
1270                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1271                let span_len = before_tag.len() - cur.len();
1272                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
1273            }
1274        }
1275        ::core::result::Result::Ok(cur)
1276    }
1277    fn to_owned_message(
1278        &self,
1279    ) -> ::core::result::Result<super::super::Int32Value, ::buffa::DecodeError> {
1280        self.to_owned_from_source(None)
1281    }
1282    #[allow(clippy::useless_conversion, clippy::needless_update)]
1283    fn to_owned_from_source(
1284        &self,
1285        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1286    ) -> ::core::result::Result<super::super::Int32Value, ::buffa::DecodeError> {
1287        #[allow(unused_imports)]
1288        use ::buffa::alloc::string::ToString as _;
1289        let _ = __buffa_src;
1290        ::core::result::Result::Ok(super::super::Int32Value {
1291            value: self.value,
1292            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
1293            ..::core::default::Default::default()
1294        })
1295    }
1296}
1297impl<'a> ::buffa::ViewEncode<'a> for Int32ValueView<'a> {
1298    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1299    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1300        #[allow(unused_imports)]
1301        use ::buffa::Enumeration as _;
1302        let mut size = 0u32;
1303        if self.value != 0i32 {
1304            size += 1u32 + ::buffa::types::int32_encoded_len(self.value) as u32;
1305        }
1306        size += self.__buffa_unknown_fields.encoded_len() as u32;
1307        size
1308    }
1309    #[allow(clippy::needless_borrow)]
1310    fn write_to(
1311        &self,
1312        _cache: &mut ::buffa::SizeCache,
1313        buf: &mut impl ::buffa::bytes::BufMut,
1314    ) {
1315        #[allow(unused_imports)]
1316        use ::buffa::Enumeration as _;
1317        if self.value != 0i32 {
1318            ::buffa::types::put_int32_field(1u32, self.value, buf);
1319        }
1320        self.__buffa_unknown_fields.write_to(buf);
1321    }
1322}
1323impl<'a> ::buffa::MessageName for Int32ValueView<'a> {
1324    const PACKAGE: &'static str = "google.protobuf";
1325    const NAME: &'static str = "Int32Value";
1326    const FULL_NAME: &'static str = "google.protobuf.Int32Value";
1327    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
1328}
1329::buffa::impl_default_view_instance!(Int32ValueView);
1330::buffa::impl_view_reborrow!(Int32ValueView);
1331/** Self-contained, `'static` owned view of a `Int32Value` message.
1332
1333 Wraps [`::buffa::OwnedView`]`<`[`Int32ValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1334
1335 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`Int32ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1336#[derive(Clone, Debug)]
1337pub struct Int32ValueOwnedView(::buffa::OwnedView<Int32ValueView<'static>>);
1338impl Int32ValueOwnedView {
1339    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1340    ///
1341    /// The view borrows directly from the buffer's data; the buffer is
1342    /// retained inside the returned handle.
1343    ///
1344    /// # Errors
1345    ///
1346    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1347    /// protobuf data.
1348    pub fn decode(
1349        bytes: ::buffa::bytes::Bytes,
1350    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1351        ::core::result::Result::Ok(
1352            Int32ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
1353        )
1354    }
1355    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1356    /// max message size).
1357    ///
1358    /// # Errors
1359    ///
1360    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1361    /// exceeds the configured limits.
1362    pub fn decode_with_options(
1363        bytes: ::buffa::bytes::Bytes,
1364        opts: &::buffa::DecodeOptions,
1365    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1366        ::core::result::Result::Ok(
1367            Int32ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
1368        )
1369    }
1370    /// Build from an owned message via an encode → decode round-trip.
1371    ///
1372    /// # Errors
1373    ///
1374    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1375    /// somehow invalid (should not happen for well-formed messages).
1376    pub fn from_owned(
1377        msg: &super::super::Int32Value,
1378    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1379        ::core::result::Result::Ok(
1380            Int32ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
1381        )
1382    }
1383    /// Borrow the full [`Int32ValueView`] with its lifetime tied to `&self`.
1384    #[must_use]
1385    pub fn view(&self) -> &Int32ValueView<'_> {
1386        self.0.reborrow()
1387    }
1388    /// Convert to the owned message type.
1389    ///
1390    /// # Errors
1391    ///
1392    /// Returns an error if re-materializing preserved unknown fields
1393    /// fails (e.g. the unknown-field limit is exceeded).
1394    pub fn to_owned_message(
1395        &self,
1396    ) -> ::core::result::Result<super::super::Int32Value, ::buffa::DecodeError> {
1397        self.0.to_owned_message()
1398    }
1399    /// The underlying bytes buffer.
1400    #[must_use]
1401    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1402        self.0.bytes()
1403    }
1404    /// Consume the handle, returning the underlying bytes buffer.
1405    #[must_use]
1406    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1407        self.0.into_bytes()
1408    }
1409    /// The int32 value.
1410    ///
1411    /// Field 1: `value`
1412    #[must_use]
1413    pub fn value(&self) -> i32 {
1414        self.0.reborrow().value
1415    }
1416}
1417impl ::core::convert::From<::buffa::OwnedView<Int32ValueView<'static>>>
1418for Int32ValueOwnedView {
1419    fn from(inner: ::buffa::OwnedView<Int32ValueView<'static>>) -> Self {
1420        Int32ValueOwnedView(inner)
1421    }
1422}
1423impl ::core::convert::From<Int32ValueOwnedView>
1424for ::buffa::OwnedView<Int32ValueView<'static>> {
1425    fn from(wrapper: Int32ValueOwnedView) -> Self {
1426        wrapper.0
1427    }
1428}
1429impl ::core::convert::AsRef<::buffa::OwnedView<Int32ValueView<'static>>>
1430for Int32ValueOwnedView {
1431    fn as_ref(&self) -> &::buffa::OwnedView<Int32ValueView<'static>> {
1432        &self.0
1433    }
1434}
1435impl ::buffa::HasMessageView for super::super::Int32Value {
1436    type View<'a> = Int32ValueView<'a>;
1437    type ViewHandle = Int32ValueOwnedView;
1438}
1439#[cfg(feature = "reflect")]
1440const _: () = {
1441    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for Int32ValueView<'a> {
1442        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1443            super::super::__buffa::reflect::descriptor_pool()
1444                .message(Self::__buffa_reflect_message_index())
1445        }
1446        fn pool(
1447            &self,
1448        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1449            super::super::__buffa::reflect::descriptor_pool()
1450        }
1451        fn get(
1452            &self,
1453            field: &::buffa_descriptor::FieldDescriptor,
1454        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1455            #[allow(unused_imports)]
1456            use ::buffa::Enumeration as _;
1457            match field.number() {
1458                1u32 => ::buffa_descriptor::reflect::ValueRef::I32(self.value),
1459                _ => {
1460                    ::core::debug_assert!(
1461                        false,
1462                        "field number {} is not a member of this view's reflect get()",
1463                        field.number(),
1464                    );
1465                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
1466                }
1467            }
1468        }
1469        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1470            match field.number() {
1471                1u32 => self.value != 0,
1472                _ => false,
1473            }
1474        }
1475        fn for_each_set(
1476            &self,
1477            f: &mut dyn ::core::ops::FnMut(
1478                &::buffa_descriptor::FieldDescriptor,
1479                ::buffa_descriptor::reflect::ValueRef<'_>,
1480            ),
1481        ) {
1482            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1483                self,
1484            );
1485            for fd in md.fields() {
1486                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1487                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1488                }
1489            }
1490        }
1491        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1492            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
1493            ::buffa_descriptor::reflect::DynamicMessage::decode(
1494                    ::buffa::alloc::sync::Arc::clone(
1495                        super::super::__buffa::reflect::descriptor_pool(),
1496                    ),
1497                    Self::__buffa_reflect_message_index(),
1498                    &bytes,
1499                )
1500                .expect("view re-encodes to bytes decodable against its own descriptor")
1501        }
1502    }
1503    impl<'a> ::buffa_descriptor::reflect::ReflectElement for Int32ValueView<'a> {
1504        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1505            ::buffa_descriptor::reflect::ValueRef::Message(
1506                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1507            )
1508        }
1509    }
1510    impl<'a> Int32ValueView<'a> {
1511        /// Memoized `MessageIndex` for this view's message type, resolved
1512        /// once against the package's embedded descriptor pool. An inherent
1513        /// associated fn (not a free fn) so sibling views in the same module
1514        /// do not collide.
1515        #[doc(hidden)]
1516        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1517            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1518            *IDX
1519                .get_or_init(|| {
1520                    super::super::__buffa::reflect::descriptor_pool()
1521                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1522                        .expect(
1523                            "generated view type is registered in the embedded descriptor pool",
1524                        )
1525                })
1526        }
1527    }
1528};
1529/// Wrapper message for `uint32`.
1530///
1531/// The JSON representation for `UInt32Value` is JSON number.
1532#[derive(Clone, Debug, Default)]
1533pub struct UInt32ValueView<'a> {
1534    /// The uint32 value.
1535    ///
1536    /// Field 1: `value`
1537    pub value: u32,
1538    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1539}
1540impl<'a> ::buffa::MessageView<'a> for UInt32ValueView<'a> {
1541    type Owned = super::super::UInt32Value;
1542    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1543        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
1544        <Self as ::buffa::MessageView>::decode_view_ctx(
1545            buf,
1546            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1547        )
1548    }
1549    fn decode_view_with_ctx(
1550        buf: &'a [u8],
1551        ctx: ::buffa::DecodeContext<'_>,
1552    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1553        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1554    }
1555    fn merge_view_field(
1556        &mut self,
1557        tag: ::buffa::encoding::Tag,
1558        cur: &'a [u8],
1559        before_tag: &'a [u8],
1560        ctx: ::buffa::DecodeContext<'_>,
1561    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1562        let _ = ctx;
1563        #[allow(unused_variables)]
1564        let view = self;
1565        let mut cur = cur;
1566        match tag.field_number() {
1567            1u32 => {
1568                ::buffa::encoding::check_wire_type(
1569                    tag,
1570                    ::buffa::encoding::WireType::Varint,
1571                )?;
1572                view.value = ::buffa::types::decode_uint32(&mut cur)?;
1573            }
1574            _ => {
1575                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1576                let span_len = before_tag.len() - cur.len();
1577                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
1578            }
1579        }
1580        ::core::result::Result::Ok(cur)
1581    }
1582    fn to_owned_message(
1583        &self,
1584    ) -> ::core::result::Result<super::super::UInt32Value, ::buffa::DecodeError> {
1585        self.to_owned_from_source(None)
1586    }
1587    #[allow(clippy::useless_conversion, clippy::needless_update)]
1588    fn to_owned_from_source(
1589        &self,
1590        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1591    ) -> ::core::result::Result<super::super::UInt32Value, ::buffa::DecodeError> {
1592        #[allow(unused_imports)]
1593        use ::buffa::alloc::string::ToString as _;
1594        let _ = __buffa_src;
1595        ::core::result::Result::Ok(super::super::UInt32Value {
1596            value: self.value,
1597            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
1598            ..::core::default::Default::default()
1599        })
1600    }
1601}
1602impl<'a> ::buffa::ViewEncode<'a> for UInt32ValueView<'a> {
1603    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1604    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1605        #[allow(unused_imports)]
1606        use ::buffa::Enumeration as _;
1607        let mut size = 0u32;
1608        if self.value != 0u32 {
1609            size += 1u32 + ::buffa::types::uint32_encoded_len(self.value) as u32;
1610        }
1611        size += self.__buffa_unknown_fields.encoded_len() as u32;
1612        size
1613    }
1614    #[allow(clippy::needless_borrow)]
1615    fn write_to(
1616        &self,
1617        _cache: &mut ::buffa::SizeCache,
1618        buf: &mut impl ::buffa::bytes::BufMut,
1619    ) {
1620        #[allow(unused_imports)]
1621        use ::buffa::Enumeration as _;
1622        if self.value != 0u32 {
1623            ::buffa::types::put_uint32_field(1u32, self.value, buf);
1624        }
1625        self.__buffa_unknown_fields.write_to(buf);
1626    }
1627}
1628impl<'a> ::buffa::MessageName for UInt32ValueView<'a> {
1629    const PACKAGE: &'static str = "google.protobuf";
1630    const NAME: &'static str = "UInt32Value";
1631    const FULL_NAME: &'static str = "google.protobuf.UInt32Value";
1632    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
1633}
1634::buffa::impl_default_view_instance!(UInt32ValueView);
1635::buffa::impl_view_reborrow!(UInt32ValueView);
1636/** Self-contained, `'static` owned view of a `UInt32Value` message.
1637
1638 Wraps [`::buffa::OwnedView`]`<`[`UInt32ValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1639
1640 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UInt32ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1641#[derive(Clone, Debug)]
1642pub struct UInt32ValueOwnedView(::buffa::OwnedView<UInt32ValueView<'static>>);
1643impl UInt32ValueOwnedView {
1644    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1645    ///
1646    /// The view borrows directly from the buffer's data; the buffer is
1647    /// retained inside the returned handle.
1648    ///
1649    /// # Errors
1650    ///
1651    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1652    /// protobuf data.
1653    pub fn decode(
1654        bytes: ::buffa::bytes::Bytes,
1655    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1656        ::core::result::Result::Ok(
1657            UInt32ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
1658        )
1659    }
1660    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1661    /// max message size).
1662    ///
1663    /// # Errors
1664    ///
1665    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1666    /// exceeds the configured limits.
1667    pub fn decode_with_options(
1668        bytes: ::buffa::bytes::Bytes,
1669        opts: &::buffa::DecodeOptions,
1670    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1671        ::core::result::Result::Ok(
1672            UInt32ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
1673        )
1674    }
1675    /// Build from an owned message via an encode → decode round-trip.
1676    ///
1677    /// # Errors
1678    ///
1679    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1680    /// somehow invalid (should not happen for well-formed messages).
1681    pub fn from_owned(
1682        msg: &super::super::UInt32Value,
1683    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1684        ::core::result::Result::Ok(
1685            UInt32ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
1686        )
1687    }
1688    /// Borrow the full [`UInt32ValueView`] with its lifetime tied to `&self`.
1689    #[must_use]
1690    pub fn view(&self) -> &UInt32ValueView<'_> {
1691        self.0.reborrow()
1692    }
1693    /// Convert to the owned message type.
1694    ///
1695    /// # Errors
1696    ///
1697    /// Returns an error if re-materializing preserved unknown fields
1698    /// fails (e.g. the unknown-field limit is exceeded).
1699    pub fn to_owned_message(
1700        &self,
1701    ) -> ::core::result::Result<super::super::UInt32Value, ::buffa::DecodeError> {
1702        self.0.to_owned_message()
1703    }
1704    /// The underlying bytes buffer.
1705    #[must_use]
1706    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1707        self.0.bytes()
1708    }
1709    /// Consume the handle, returning the underlying bytes buffer.
1710    #[must_use]
1711    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1712        self.0.into_bytes()
1713    }
1714    /// The uint32 value.
1715    ///
1716    /// Field 1: `value`
1717    #[must_use]
1718    pub fn value(&self) -> u32 {
1719        self.0.reborrow().value
1720    }
1721}
1722impl ::core::convert::From<::buffa::OwnedView<UInt32ValueView<'static>>>
1723for UInt32ValueOwnedView {
1724    fn from(inner: ::buffa::OwnedView<UInt32ValueView<'static>>) -> Self {
1725        UInt32ValueOwnedView(inner)
1726    }
1727}
1728impl ::core::convert::From<UInt32ValueOwnedView>
1729for ::buffa::OwnedView<UInt32ValueView<'static>> {
1730    fn from(wrapper: UInt32ValueOwnedView) -> Self {
1731        wrapper.0
1732    }
1733}
1734impl ::core::convert::AsRef<::buffa::OwnedView<UInt32ValueView<'static>>>
1735for UInt32ValueOwnedView {
1736    fn as_ref(&self) -> &::buffa::OwnedView<UInt32ValueView<'static>> {
1737        &self.0
1738    }
1739}
1740impl ::buffa::HasMessageView for super::super::UInt32Value {
1741    type View<'a> = UInt32ValueView<'a>;
1742    type ViewHandle = UInt32ValueOwnedView;
1743}
1744#[cfg(feature = "reflect")]
1745const _: () = {
1746    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for UInt32ValueView<'a> {
1747        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1748            super::super::__buffa::reflect::descriptor_pool()
1749                .message(Self::__buffa_reflect_message_index())
1750        }
1751        fn pool(
1752            &self,
1753        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1754            super::super::__buffa::reflect::descriptor_pool()
1755        }
1756        fn get(
1757            &self,
1758            field: &::buffa_descriptor::FieldDescriptor,
1759        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1760            #[allow(unused_imports)]
1761            use ::buffa::Enumeration as _;
1762            match field.number() {
1763                1u32 => ::buffa_descriptor::reflect::ValueRef::U32(self.value),
1764                _ => {
1765                    ::core::debug_assert!(
1766                        false,
1767                        "field number {} is not a member of this view's reflect get()",
1768                        field.number(),
1769                    );
1770                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
1771                }
1772            }
1773        }
1774        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1775            match field.number() {
1776                1u32 => self.value != 0,
1777                _ => false,
1778            }
1779        }
1780        fn for_each_set(
1781            &self,
1782            f: &mut dyn ::core::ops::FnMut(
1783                &::buffa_descriptor::FieldDescriptor,
1784                ::buffa_descriptor::reflect::ValueRef<'_>,
1785            ),
1786        ) {
1787            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1788                self,
1789            );
1790            for fd in md.fields() {
1791                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1792                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1793                }
1794            }
1795        }
1796        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1797            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
1798            ::buffa_descriptor::reflect::DynamicMessage::decode(
1799                    ::buffa::alloc::sync::Arc::clone(
1800                        super::super::__buffa::reflect::descriptor_pool(),
1801                    ),
1802                    Self::__buffa_reflect_message_index(),
1803                    &bytes,
1804                )
1805                .expect("view re-encodes to bytes decodable against its own descriptor")
1806        }
1807    }
1808    impl<'a> ::buffa_descriptor::reflect::ReflectElement for UInt32ValueView<'a> {
1809        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1810            ::buffa_descriptor::reflect::ValueRef::Message(
1811                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1812            )
1813        }
1814    }
1815    impl<'a> UInt32ValueView<'a> {
1816        /// Memoized `MessageIndex` for this view's message type, resolved
1817        /// once against the package's embedded descriptor pool. An inherent
1818        /// associated fn (not a free fn) so sibling views in the same module
1819        /// do not collide.
1820        #[doc(hidden)]
1821        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1822            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1823            *IDX
1824                .get_or_init(|| {
1825                    super::super::__buffa::reflect::descriptor_pool()
1826                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1827                        .expect(
1828                            "generated view type is registered in the embedded descriptor pool",
1829                        )
1830                })
1831        }
1832    }
1833};
1834/// Wrapper message for `bool`.
1835///
1836/// The JSON representation for `BoolValue` is JSON `true` and `false`.
1837#[derive(Clone, Debug, Default)]
1838pub struct BoolValueView<'a> {
1839    /// The bool value.
1840    ///
1841    /// Field 1: `value`
1842    pub value: bool,
1843    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1844}
1845impl<'a> ::buffa::MessageView<'a> for BoolValueView<'a> {
1846    type Owned = super::super::BoolValue;
1847    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1848        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
1849        <Self as ::buffa::MessageView>::decode_view_ctx(
1850            buf,
1851            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1852        )
1853    }
1854    fn decode_view_with_ctx(
1855        buf: &'a [u8],
1856        ctx: ::buffa::DecodeContext<'_>,
1857    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1858        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1859    }
1860    fn merge_view_field(
1861        &mut self,
1862        tag: ::buffa::encoding::Tag,
1863        cur: &'a [u8],
1864        before_tag: &'a [u8],
1865        ctx: ::buffa::DecodeContext<'_>,
1866    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1867        let _ = ctx;
1868        #[allow(unused_variables)]
1869        let view = self;
1870        let mut cur = cur;
1871        match tag.field_number() {
1872            1u32 => {
1873                ::buffa::encoding::check_wire_type(
1874                    tag,
1875                    ::buffa::encoding::WireType::Varint,
1876                )?;
1877                view.value = ::buffa::types::decode_bool(&mut cur)?;
1878            }
1879            _ => {
1880                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1881                let span_len = before_tag.len() - cur.len();
1882                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
1883            }
1884        }
1885        ::core::result::Result::Ok(cur)
1886    }
1887    fn to_owned_message(
1888        &self,
1889    ) -> ::core::result::Result<super::super::BoolValue, ::buffa::DecodeError> {
1890        self.to_owned_from_source(None)
1891    }
1892    #[allow(clippy::useless_conversion, clippy::needless_update)]
1893    fn to_owned_from_source(
1894        &self,
1895        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1896    ) -> ::core::result::Result<super::super::BoolValue, ::buffa::DecodeError> {
1897        #[allow(unused_imports)]
1898        use ::buffa::alloc::string::ToString as _;
1899        let _ = __buffa_src;
1900        ::core::result::Result::Ok(super::super::BoolValue {
1901            value: self.value,
1902            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
1903            ..::core::default::Default::default()
1904        })
1905    }
1906}
1907impl<'a> ::buffa::ViewEncode<'a> for BoolValueView<'a> {
1908    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1909    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1910        #[allow(unused_imports)]
1911        use ::buffa::Enumeration as _;
1912        let mut size = 0u32;
1913        if self.value {
1914            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1915        }
1916        size += self.__buffa_unknown_fields.encoded_len() as u32;
1917        size
1918    }
1919    #[allow(clippy::needless_borrow)]
1920    fn write_to(
1921        &self,
1922        _cache: &mut ::buffa::SizeCache,
1923        buf: &mut impl ::buffa::bytes::BufMut,
1924    ) {
1925        #[allow(unused_imports)]
1926        use ::buffa::Enumeration as _;
1927        if self.value {
1928            ::buffa::types::put_bool_field(1u32, self.value, buf);
1929        }
1930        self.__buffa_unknown_fields.write_to(buf);
1931    }
1932}
1933impl<'a> ::buffa::MessageName for BoolValueView<'a> {
1934    const PACKAGE: &'static str = "google.protobuf";
1935    const NAME: &'static str = "BoolValue";
1936    const FULL_NAME: &'static str = "google.protobuf.BoolValue";
1937    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
1938}
1939::buffa::impl_default_view_instance!(BoolValueView);
1940::buffa::impl_view_reborrow!(BoolValueView);
1941/** Self-contained, `'static` owned view of a `BoolValue` message.
1942
1943 Wraps [`::buffa::OwnedView`]`<`[`BoolValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1944
1945 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`BoolValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1946#[derive(Clone, Debug)]
1947pub struct BoolValueOwnedView(::buffa::OwnedView<BoolValueView<'static>>);
1948impl BoolValueOwnedView {
1949    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1950    ///
1951    /// The view borrows directly from the buffer's data; the buffer is
1952    /// retained inside the returned handle.
1953    ///
1954    /// # Errors
1955    ///
1956    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1957    /// protobuf data.
1958    pub fn decode(
1959        bytes: ::buffa::bytes::Bytes,
1960    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1961        ::core::result::Result::Ok(
1962            BoolValueOwnedView(::buffa::OwnedView::decode(bytes)?),
1963        )
1964    }
1965    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1966    /// max message size).
1967    ///
1968    /// # Errors
1969    ///
1970    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1971    /// exceeds the configured limits.
1972    pub fn decode_with_options(
1973        bytes: ::buffa::bytes::Bytes,
1974        opts: &::buffa::DecodeOptions,
1975    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1976        ::core::result::Result::Ok(
1977            BoolValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
1978        )
1979    }
1980    /// Build from an owned message via an encode → decode round-trip.
1981    ///
1982    /// # Errors
1983    ///
1984    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1985    /// somehow invalid (should not happen for well-formed messages).
1986    pub fn from_owned(
1987        msg: &super::super::BoolValue,
1988    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1989        ::core::result::Result::Ok(
1990            BoolValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
1991        )
1992    }
1993    /// Borrow the full [`BoolValueView`] with its lifetime tied to `&self`.
1994    #[must_use]
1995    pub fn view(&self) -> &BoolValueView<'_> {
1996        self.0.reborrow()
1997    }
1998    /// Convert to the owned message type.
1999    ///
2000    /// # Errors
2001    ///
2002    /// Returns an error if re-materializing preserved unknown fields
2003    /// fails (e.g. the unknown-field limit is exceeded).
2004    pub fn to_owned_message(
2005        &self,
2006    ) -> ::core::result::Result<super::super::BoolValue, ::buffa::DecodeError> {
2007        self.0.to_owned_message()
2008    }
2009    /// The underlying bytes buffer.
2010    #[must_use]
2011    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2012        self.0.bytes()
2013    }
2014    /// Consume the handle, returning the underlying bytes buffer.
2015    #[must_use]
2016    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2017        self.0.into_bytes()
2018    }
2019    /// The bool value.
2020    ///
2021    /// Field 1: `value`
2022    #[must_use]
2023    pub fn value(&self) -> bool {
2024        self.0.reborrow().value
2025    }
2026}
2027impl ::core::convert::From<::buffa::OwnedView<BoolValueView<'static>>>
2028for BoolValueOwnedView {
2029    fn from(inner: ::buffa::OwnedView<BoolValueView<'static>>) -> Self {
2030        BoolValueOwnedView(inner)
2031    }
2032}
2033impl ::core::convert::From<BoolValueOwnedView>
2034for ::buffa::OwnedView<BoolValueView<'static>> {
2035    fn from(wrapper: BoolValueOwnedView) -> Self {
2036        wrapper.0
2037    }
2038}
2039impl ::core::convert::AsRef<::buffa::OwnedView<BoolValueView<'static>>>
2040for BoolValueOwnedView {
2041    fn as_ref(&self) -> &::buffa::OwnedView<BoolValueView<'static>> {
2042        &self.0
2043    }
2044}
2045impl ::buffa::HasMessageView for super::super::BoolValue {
2046    type View<'a> = BoolValueView<'a>;
2047    type ViewHandle = BoolValueOwnedView;
2048}
2049#[cfg(feature = "reflect")]
2050const _: () = {
2051    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for BoolValueView<'a> {
2052        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
2053            super::super::__buffa::reflect::descriptor_pool()
2054                .message(Self::__buffa_reflect_message_index())
2055        }
2056        fn pool(
2057            &self,
2058        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
2059            super::super::__buffa::reflect::descriptor_pool()
2060        }
2061        fn get(
2062            &self,
2063            field: &::buffa_descriptor::FieldDescriptor,
2064        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2065            #[allow(unused_imports)]
2066            use ::buffa::Enumeration as _;
2067            match field.number() {
2068                1u32 => ::buffa_descriptor::reflect::ValueRef::Bool(self.value),
2069                _ => {
2070                    ::core::debug_assert!(
2071                        false,
2072                        "field number {} is not a member of this view's reflect get()",
2073                        field.number(),
2074                    );
2075                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
2076                }
2077            }
2078        }
2079        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
2080            match field.number() {
2081                1u32 => self.value,
2082                _ => false,
2083            }
2084        }
2085        fn for_each_set(
2086            &self,
2087            f: &mut dyn ::core::ops::FnMut(
2088                &::buffa_descriptor::FieldDescriptor,
2089                ::buffa_descriptor::reflect::ValueRef<'_>,
2090            ),
2091        ) {
2092            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
2093                self,
2094            );
2095            for fd in md.fields() {
2096                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
2097                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
2098                }
2099            }
2100        }
2101        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
2102            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
2103            ::buffa_descriptor::reflect::DynamicMessage::decode(
2104                    ::buffa::alloc::sync::Arc::clone(
2105                        super::super::__buffa::reflect::descriptor_pool(),
2106                    ),
2107                    Self::__buffa_reflect_message_index(),
2108                    &bytes,
2109                )
2110                .expect("view re-encodes to bytes decodable against its own descriptor")
2111        }
2112    }
2113    impl<'a> ::buffa_descriptor::reflect::ReflectElement for BoolValueView<'a> {
2114        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2115            ::buffa_descriptor::reflect::ValueRef::Message(
2116                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
2117            )
2118        }
2119    }
2120    impl<'a> BoolValueView<'a> {
2121        /// Memoized `MessageIndex` for this view's message type, resolved
2122        /// once against the package's embedded descriptor pool. An inherent
2123        /// associated fn (not a free fn) so sibling views in the same module
2124        /// do not collide.
2125        #[doc(hidden)]
2126        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
2127            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
2128            *IDX
2129                .get_or_init(|| {
2130                    super::super::__buffa::reflect::descriptor_pool()
2131                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
2132                        .expect(
2133                            "generated view type is registered in the embedded descriptor pool",
2134                        )
2135                })
2136        }
2137    }
2138};
2139/// Wrapper message for `string`.
2140///
2141/// The JSON representation for `StringValue` is JSON string.
2142#[derive(Clone, Debug, Default)]
2143pub struct StringValueView<'a> {
2144    /// The string value.
2145    ///
2146    /// Field 1: `value`
2147    pub value: &'a str,
2148    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2149}
2150impl<'a> ::buffa::MessageView<'a> for StringValueView<'a> {
2151    type Owned = super::super::StringValue;
2152    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2153        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
2154        <Self as ::buffa::MessageView>::decode_view_ctx(
2155            buf,
2156            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2157        )
2158    }
2159    fn decode_view_with_ctx(
2160        buf: &'a [u8],
2161        ctx: ::buffa::DecodeContext<'_>,
2162    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2163        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2164    }
2165    fn merge_view_field(
2166        &mut self,
2167        tag: ::buffa::encoding::Tag,
2168        cur: &'a [u8],
2169        before_tag: &'a [u8],
2170        ctx: ::buffa::DecodeContext<'_>,
2171    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2172        let _ = ctx;
2173        #[allow(unused_variables)]
2174        let view = self;
2175        let mut cur = cur;
2176        match tag.field_number() {
2177            1u32 => {
2178                ::buffa::encoding::check_wire_type(
2179                    tag,
2180                    ::buffa::encoding::WireType::LengthDelimited,
2181                )?;
2182                view.value = ::buffa::types::borrow_str(&mut cur)?;
2183            }
2184            _ => {
2185                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2186                let span_len = before_tag.len() - cur.len();
2187                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
2188            }
2189        }
2190        ::core::result::Result::Ok(cur)
2191    }
2192    fn to_owned_message(
2193        &self,
2194    ) -> ::core::result::Result<super::super::StringValue, ::buffa::DecodeError> {
2195        self.to_owned_from_source(None)
2196    }
2197    #[allow(clippy::useless_conversion, clippy::needless_update)]
2198    fn to_owned_from_source(
2199        &self,
2200        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2201    ) -> ::core::result::Result<super::super::StringValue, ::buffa::DecodeError> {
2202        #[allow(unused_imports)]
2203        use ::buffa::alloc::string::ToString as _;
2204        let _ = __buffa_src;
2205        ::core::result::Result::Ok(super::super::StringValue {
2206            value: self.value.to_string(),
2207            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
2208            ..::core::default::Default::default()
2209        })
2210    }
2211}
2212impl<'a> ::buffa::ViewEncode<'a> for StringValueView<'a> {
2213    #[allow(clippy::needless_borrow, clippy::let_and_return)]
2214    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2215        #[allow(unused_imports)]
2216        use ::buffa::Enumeration as _;
2217        let mut size = 0u32;
2218        if !self.value.is_empty() {
2219            size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
2220        }
2221        size += self.__buffa_unknown_fields.encoded_len() as u32;
2222        size
2223    }
2224    #[allow(clippy::needless_borrow)]
2225    fn write_to(
2226        &self,
2227        _cache: &mut ::buffa::SizeCache,
2228        buf: &mut impl ::buffa::bytes::BufMut,
2229    ) {
2230        #[allow(unused_imports)]
2231        use ::buffa::Enumeration as _;
2232        if !self.value.is_empty() {
2233            ::buffa::types::put_string_field(1u32, &self.value, buf);
2234        }
2235        self.__buffa_unknown_fields.write_to(buf);
2236    }
2237}
2238impl<'a> ::buffa::MessageName for StringValueView<'a> {
2239    const PACKAGE: &'static str = "google.protobuf";
2240    const NAME: &'static str = "StringValue";
2241    const FULL_NAME: &'static str = "google.protobuf.StringValue";
2242    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
2243}
2244::buffa::impl_default_view_instance!(StringValueView);
2245::buffa::impl_view_reborrow!(StringValueView);
2246/** Self-contained, `'static` owned view of a `StringValue` message.
2247
2248 Wraps [`::buffa::OwnedView`]`<`[`StringValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
2249
2250 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`StringValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2251#[derive(Clone, Debug)]
2252pub struct StringValueOwnedView(::buffa::OwnedView<StringValueView<'static>>);
2253impl StringValueOwnedView {
2254    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2255    ///
2256    /// The view borrows directly from the buffer's data; the buffer is
2257    /// retained inside the returned handle.
2258    ///
2259    /// # Errors
2260    ///
2261    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2262    /// protobuf data.
2263    pub fn decode(
2264        bytes: ::buffa::bytes::Bytes,
2265    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2266        ::core::result::Result::Ok(
2267            StringValueOwnedView(::buffa::OwnedView::decode(bytes)?),
2268        )
2269    }
2270    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2271    /// max message size).
2272    ///
2273    /// # Errors
2274    ///
2275    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2276    /// exceeds the configured limits.
2277    pub fn decode_with_options(
2278        bytes: ::buffa::bytes::Bytes,
2279        opts: &::buffa::DecodeOptions,
2280    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2281        ::core::result::Result::Ok(
2282            StringValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
2283        )
2284    }
2285    /// Build from an owned message via an encode → decode round-trip.
2286    ///
2287    /// # Errors
2288    ///
2289    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2290    /// somehow invalid (should not happen for well-formed messages).
2291    pub fn from_owned(
2292        msg: &super::super::StringValue,
2293    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2294        ::core::result::Result::Ok(
2295            StringValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
2296        )
2297    }
2298    /// Borrow the full [`StringValueView`] with its lifetime tied to `&self`.
2299    #[must_use]
2300    pub fn view(&self) -> &StringValueView<'_> {
2301        self.0.reborrow()
2302    }
2303    /// Convert to the owned message type.
2304    ///
2305    /// # Errors
2306    ///
2307    /// Returns an error if re-materializing preserved unknown fields
2308    /// fails (e.g. the unknown-field limit is exceeded).
2309    pub fn to_owned_message(
2310        &self,
2311    ) -> ::core::result::Result<super::super::StringValue, ::buffa::DecodeError> {
2312        self.0.to_owned_message()
2313    }
2314    /// The underlying bytes buffer.
2315    #[must_use]
2316    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2317        self.0.bytes()
2318    }
2319    /// Consume the handle, returning the underlying bytes buffer.
2320    #[must_use]
2321    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2322        self.0.into_bytes()
2323    }
2324    /// The string value.
2325    ///
2326    /// Field 1: `value`
2327    #[must_use]
2328    pub fn value(&self) -> &'_ str {
2329        self.0.reborrow().value
2330    }
2331}
2332impl ::core::convert::From<::buffa::OwnedView<StringValueView<'static>>>
2333for StringValueOwnedView {
2334    fn from(inner: ::buffa::OwnedView<StringValueView<'static>>) -> Self {
2335        StringValueOwnedView(inner)
2336    }
2337}
2338impl ::core::convert::From<StringValueOwnedView>
2339for ::buffa::OwnedView<StringValueView<'static>> {
2340    fn from(wrapper: StringValueOwnedView) -> Self {
2341        wrapper.0
2342    }
2343}
2344impl ::core::convert::AsRef<::buffa::OwnedView<StringValueView<'static>>>
2345for StringValueOwnedView {
2346    fn as_ref(&self) -> &::buffa::OwnedView<StringValueView<'static>> {
2347        &self.0
2348    }
2349}
2350impl ::buffa::HasMessageView for super::super::StringValue {
2351    type View<'a> = StringValueView<'a>;
2352    type ViewHandle = StringValueOwnedView;
2353}
2354#[cfg(feature = "reflect")]
2355const _: () = {
2356    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for StringValueView<'a> {
2357        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
2358            super::super::__buffa::reflect::descriptor_pool()
2359                .message(Self::__buffa_reflect_message_index())
2360        }
2361        fn pool(
2362            &self,
2363        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
2364            super::super::__buffa::reflect::descriptor_pool()
2365        }
2366        fn get(
2367            &self,
2368            field: &::buffa_descriptor::FieldDescriptor,
2369        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2370            #[allow(unused_imports)]
2371            use ::buffa::Enumeration as _;
2372            match field.number() {
2373                1u32 => ::buffa_descriptor::reflect::ValueRef::String(self.value),
2374                _ => {
2375                    ::core::debug_assert!(
2376                        false,
2377                        "field number {} is not a member of this view's reflect get()",
2378                        field.number(),
2379                    );
2380                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
2381                }
2382            }
2383        }
2384        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
2385            match field.number() {
2386                1u32 => !self.value.is_empty(),
2387                _ => false,
2388            }
2389        }
2390        fn for_each_set(
2391            &self,
2392            f: &mut dyn ::core::ops::FnMut(
2393                &::buffa_descriptor::FieldDescriptor,
2394                ::buffa_descriptor::reflect::ValueRef<'_>,
2395            ),
2396        ) {
2397            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
2398                self,
2399            );
2400            for fd in md.fields() {
2401                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
2402                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
2403                }
2404            }
2405        }
2406        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
2407            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
2408            ::buffa_descriptor::reflect::DynamicMessage::decode(
2409                    ::buffa::alloc::sync::Arc::clone(
2410                        super::super::__buffa::reflect::descriptor_pool(),
2411                    ),
2412                    Self::__buffa_reflect_message_index(),
2413                    &bytes,
2414                )
2415                .expect("view re-encodes to bytes decodable against its own descriptor")
2416        }
2417    }
2418    impl<'a> ::buffa_descriptor::reflect::ReflectElement for StringValueView<'a> {
2419        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2420            ::buffa_descriptor::reflect::ValueRef::Message(
2421                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
2422            )
2423        }
2424    }
2425    impl<'a> StringValueView<'a> {
2426        /// Memoized `MessageIndex` for this view's message type, resolved
2427        /// once against the package's embedded descriptor pool. An inherent
2428        /// associated fn (not a free fn) so sibling views in the same module
2429        /// do not collide.
2430        #[doc(hidden)]
2431        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
2432            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
2433            *IDX
2434                .get_or_init(|| {
2435                    super::super::__buffa::reflect::descriptor_pool()
2436                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
2437                        .expect(
2438                            "generated view type is registered in the embedded descriptor pool",
2439                        )
2440                })
2441        }
2442    }
2443};
2444/// Wrapper message for `bytes`.
2445///
2446/// The JSON representation for `BytesValue` is JSON string.
2447#[derive(Clone, Debug, Default)]
2448pub struct BytesValueView<'a> {
2449    /// The bytes value.
2450    ///
2451    /// Field 1: `value`
2452    pub value: &'a [u8],
2453    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2454}
2455impl<'a> ::buffa::MessageView<'a> for BytesValueView<'a> {
2456    type Owned = super::super::BytesValue;
2457    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2458        let __limit = ::core::cell::Cell::new(::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT);
2459        <Self as ::buffa::MessageView>::decode_view_ctx(
2460            buf,
2461            ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2462        )
2463    }
2464    fn decode_view_with_ctx(
2465        buf: &'a [u8],
2466        ctx: ::buffa::DecodeContext<'_>,
2467    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2468        <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2469    }
2470    fn merge_view_field(
2471        &mut self,
2472        tag: ::buffa::encoding::Tag,
2473        cur: &'a [u8],
2474        before_tag: &'a [u8],
2475        ctx: ::buffa::DecodeContext<'_>,
2476    ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2477        let _ = ctx;
2478        #[allow(unused_variables)]
2479        let view = self;
2480        let mut cur = cur;
2481        match tag.field_number() {
2482            1u32 => {
2483                ::buffa::encoding::check_wire_type(
2484                    tag,
2485                    ::buffa::encoding::WireType::LengthDelimited,
2486                )?;
2487                view.value = ::buffa::types::borrow_bytes(&mut cur)?;
2488            }
2489            _ => {
2490                ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2491                let span_len = before_tag.len() - cur.len();
2492                view.__buffa_unknown_fields.push_record(before_tag, span_len, ctx)?;
2493            }
2494        }
2495        ::core::result::Result::Ok(cur)
2496    }
2497    fn to_owned_message(
2498        &self,
2499    ) -> ::core::result::Result<super::super::BytesValue, ::buffa::DecodeError> {
2500        self.to_owned_from_source(None)
2501    }
2502    #[allow(clippy::useless_conversion, clippy::needless_update)]
2503    fn to_owned_from_source(
2504        &self,
2505        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2506    ) -> ::core::result::Result<super::super::BytesValue, ::buffa::DecodeError> {
2507        #[allow(unused_imports)]
2508        use ::buffa::alloc::string::ToString as _;
2509        let _ = __buffa_src;
2510        ::core::result::Result::Ok(super::super::BytesValue {
2511            value: (self.value).to_vec(),
2512            __buffa_unknown_fields: self.__buffa_unknown_fields.to_owned()?.into(),
2513            ..::core::default::Default::default()
2514        })
2515    }
2516}
2517impl<'a> ::buffa::ViewEncode<'a> for BytesValueView<'a> {
2518    #[allow(clippy::needless_borrow, clippy::let_and_return)]
2519    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2520        #[allow(unused_imports)]
2521        use ::buffa::Enumeration as _;
2522        let mut size = 0u32;
2523        if !self.value.is_empty() {
2524            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) as u32;
2525        }
2526        size += self.__buffa_unknown_fields.encoded_len() as u32;
2527        size
2528    }
2529    #[allow(clippy::needless_borrow)]
2530    fn write_to(
2531        &self,
2532        _cache: &mut ::buffa::SizeCache,
2533        buf: &mut impl ::buffa::bytes::BufMut,
2534    ) {
2535        #[allow(unused_imports)]
2536        use ::buffa::Enumeration as _;
2537        if !self.value.is_empty() {
2538            ::buffa::types::put_bytes_field(1u32, &self.value, buf);
2539        }
2540        self.__buffa_unknown_fields.write_to(buf);
2541    }
2542}
2543impl<'a> ::buffa::MessageName for BytesValueView<'a> {
2544    const PACKAGE: &'static str = "google.protobuf";
2545    const NAME: &'static str = "BytesValue";
2546    const FULL_NAME: &'static str = "google.protobuf.BytesValue";
2547    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
2548}
2549::buffa::impl_default_view_instance!(BytesValueView);
2550::buffa::impl_view_reborrow!(BytesValueView);
2551/** Self-contained, `'static` owned view of a `BytesValue` message.
2552
2553 Wraps [`::buffa::OwnedView`]`<`[`BytesValueView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
2554
2555 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`BytesValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2556#[derive(Clone, Debug)]
2557pub struct BytesValueOwnedView(::buffa::OwnedView<BytesValueView<'static>>);
2558impl BytesValueOwnedView {
2559    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2560    ///
2561    /// The view borrows directly from the buffer's data; the buffer is
2562    /// retained inside the returned handle.
2563    ///
2564    /// # Errors
2565    ///
2566    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2567    /// protobuf data.
2568    pub fn decode(
2569        bytes: ::buffa::bytes::Bytes,
2570    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2571        ::core::result::Result::Ok(
2572            BytesValueOwnedView(::buffa::OwnedView::decode(bytes)?),
2573        )
2574    }
2575    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2576    /// max message size).
2577    ///
2578    /// # Errors
2579    ///
2580    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2581    /// exceeds the configured limits.
2582    pub fn decode_with_options(
2583        bytes: ::buffa::bytes::Bytes,
2584        opts: &::buffa::DecodeOptions,
2585    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2586        ::core::result::Result::Ok(
2587            BytesValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
2588        )
2589    }
2590    /// Build from an owned message via an encode → decode round-trip.
2591    ///
2592    /// # Errors
2593    ///
2594    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2595    /// somehow invalid (should not happen for well-formed messages).
2596    pub fn from_owned(
2597        msg: &super::super::BytesValue,
2598    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2599        ::core::result::Result::Ok(
2600            BytesValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
2601        )
2602    }
2603    /// Borrow the full [`BytesValueView`] with its lifetime tied to `&self`.
2604    #[must_use]
2605    pub fn view(&self) -> &BytesValueView<'_> {
2606        self.0.reborrow()
2607    }
2608    /// Convert to the owned message type.
2609    ///
2610    /// # Errors
2611    ///
2612    /// Returns an error if re-materializing preserved unknown fields
2613    /// fails (e.g. the unknown-field limit is exceeded).
2614    pub fn to_owned_message(
2615        &self,
2616    ) -> ::core::result::Result<super::super::BytesValue, ::buffa::DecodeError> {
2617        self.0.to_owned_message()
2618    }
2619    /// The underlying bytes buffer.
2620    #[must_use]
2621    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2622        self.0.bytes()
2623    }
2624    /// Consume the handle, returning the underlying bytes buffer.
2625    #[must_use]
2626    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2627        self.0.into_bytes()
2628    }
2629    /// The bytes value.
2630    ///
2631    /// Field 1: `value`
2632    #[must_use]
2633    pub fn value(&self) -> &'_ [u8] {
2634        self.0.reborrow().value
2635    }
2636}
2637impl ::core::convert::From<::buffa::OwnedView<BytesValueView<'static>>>
2638for BytesValueOwnedView {
2639    fn from(inner: ::buffa::OwnedView<BytesValueView<'static>>) -> Self {
2640        BytesValueOwnedView(inner)
2641    }
2642}
2643impl ::core::convert::From<BytesValueOwnedView>
2644for ::buffa::OwnedView<BytesValueView<'static>> {
2645    fn from(wrapper: BytesValueOwnedView) -> Self {
2646        wrapper.0
2647    }
2648}
2649impl ::core::convert::AsRef<::buffa::OwnedView<BytesValueView<'static>>>
2650for BytesValueOwnedView {
2651    fn as_ref(&self) -> &::buffa::OwnedView<BytesValueView<'static>> {
2652        &self.0
2653    }
2654}
2655impl ::buffa::HasMessageView for super::super::BytesValue {
2656    type View<'a> = BytesValueView<'a>;
2657    type ViewHandle = BytesValueOwnedView;
2658}
2659#[cfg(feature = "reflect")]
2660const _: () = {
2661    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for BytesValueView<'a> {
2662        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
2663            super::super::__buffa::reflect::descriptor_pool()
2664                .message(Self::__buffa_reflect_message_index())
2665        }
2666        fn pool(
2667            &self,
2668        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
2669            super::super::__buffa::reflect::descriptor_pool()
2670        }
2671        fn get(
2672            &self,
2673            field: &::buffa_descriptor::FieldDescriptor,
2674        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2675            #[allow(unused_imports)]
2676            use ::buffa::Enumeration as _;
2677            match field.number() {
2678                1u32 => ::buffa_descriptor::reflect::ValueRef::Bytes(self.value),
2679                _ => {
2680                    ::core::debug_assert!(
2681                        false,
2682                        "field number {} is not a member of this view's reflect get()",
2683                        field.number(),
2684                    );
2685                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
2686                }
2687            }
2688        }
2689        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
2690            match field.number() {
2691                1u32 => !self.value.is_empty(),
2692                _ => false,
2693            }
2694        }
2695        fn for_each_set(
2696            &self,
2697            f: &mut dyn ::core::ops::FnMut(
2698                &::buffa_descriptor::FieldDescriptor,
2699                ::buffa_descriptor::reflect::ValueRef<'_>,
2700            ),
2701        ) {
2702            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
2703                self,
2704            );
2705            for fd in md.fields() {
2706                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
2707                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
2708                }
2709            }
2710        }
2711        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
2712            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
2713            ::buffa_descriptor::reflect::DynamicMessage::decode(
2714                    ::buffa::alloc::sync::Arc::clone(
2715                        super::super::__buffa::reflect::descriptor_pool(),
2716                    ),
2717                    Self::__buffa_reflect_message_index(),
2718                    &bytes,
2719                )
2720                .expect("view re-encodes to bytes decodable against its own descriptor")
2721        }
2722    }
2723    impl<'a> ::buffa_descriptor::reflect::ReflectElement for BytesValueView<'a> {
2724        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2725            ::buffa_descriptor::reflect::ValueRef::Message(
2726                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
2727            )
2728        }
2729    }
2730    impl<'a> BytesValueView<'a> {
2731        /// Memoized `MessageIndex` for this view's message type, resolved
2732        /// once against the package's embedded descriptor pool. An inherent
2733        /// associated fn (not a free fn) so sibling views in the same module
2734        /// do not collide.
2735        #[doc(hidden)]
2736        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
2737            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
2738            *IDX
2739                .get_or_init(|| {
2740                    super::super::__buffa::reflect::descriptor_pool()
2741                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
2742                        .expect(
2743                            "generated view type is registered in the embedded descriptor pool",
2744                        )
2745                })
2746        }
2747    }
2748};