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> DoubleValueView<'a> {
16    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
17    ///
18    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
19    /// and by generated sub-message decode arms with `depth - 1`.
20    ///
21    /// **Not part of the public API.** Named with a leading underscore to
22    /// signal that it is for generated-code use only.
23    #[doc(hidden)]
24    pub fn _decode_depth(
25        buf: &'a [u8],
26        depth: u32,
27    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
28        let mut view = Self::default();
29        view._merge_into_view(buf, depth)?;
30        ::core::result::Result::Ok(view)
31    }
32    /// Merge fields from `buf` into this view (proto merge semantics).
33    ///
34    /// Repeated fields append; singular fields last-wins; singular
35    /// MESSAGE fields merge recursively. Used by sub-message decode
36    /// arms when the same field appears multiple times on the wire.
37    ///
38    /// **Not part of the public API.**
39    #[doc(hidden)]
40    pub fn _merge_into_view(
41        &mut self,
42        buf: &'a [u8],
43        depth: u32,
44    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
45        let _ = depth;
46        #[allow(unused_variables)]
47        let view = self;
48        let mut cur: &'a [u8] = buf;
49        while !cur.is_empty() {
50            let before_tag = cur;
51            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
52            match tag.field_number() {
53                1u32 => {
54                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
55                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
56                            field_number: 1u32,
57                            expected: 1u8,
58                            actual: tag.wire_type() as u8,
59                        });
60                    }
61                    view.value = ::buffa::types::decode_double(&mut cur)?;
62                }
63                _ => {
64                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
65                    let span_len = before_tag.len() - cur.len();
66                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
67                }
68            }
69        }
70        ::core::result::Result::Ok(())
71    }
72}
73impl<'a> ::buffa::MessageView<'a> for DoubleValueView<'a> {
74    type Owned = super::super::DoubleValue;
75    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
76        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
77    }
78    fn decode_view_with_limit(
79        buf: &'a [u8],
80        depth: u32,
81    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
82        Self::_decode_depth(buf, depth)
83    }
84    fn to_owned_message(&self) -> super::super::DoubleValue {
85        self.to_owned_from_source(None)
86    }
87    #[allow(clippy::useless_conversion, clippy::needless_update)]
88    fn to_owned_from_source(
89        &self,
90        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
91    ) -> super::super::DoubleValue {
92        #[allow(unused_imports)]
93        use ::buffa::alloc::string::ToString as _;
94        let _ = __buffa_src;
95        super::super::DoubleValue {
96            value: self.value,
97            __buffa_unknown_fields: self
98                .__buffa_unknown_fields
99                .to_owned()
100                .unwrap_or_default()
101                .into(),
102            ..::core::default::Default::default()
103        }
104    }
105}
106impl<'a> ::buffa::ViewEncode<'a> for DoubleValueView<'a> {
107    #[allow(clippy::needless_borrow, clippy::let_and_return)]
108    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
109        #[allow(unused_imports)]
110        use ::buffa::Enumeration as _;
111        let mut size = 0u32;
112        if self.value.to_bits() != 0u64 {
113            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
114        }
115        size += self.__buffa_unknown_fields.encoded_len() as u32;
116        size
117    }
118    #[allow(clippy::needless_borrow)]
119    fn write_to(
120        &self,
121        _cache: &mut ::buffa::SizeCache,
122        buf: &mut impl ::buffa::bytes::BufMut,
123    ) {
124        #[allow(unused_imports)]
125        use ::buffa::Enumeration as _;
126        if self.value.to_bits() != 0u64 {
127            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
128                .encode(buf);
129            ::buffa::types::encode_double(self.value, buf);
130        }
131        self.__buffa_unknown_fields.write_to(buf);
132    }
133}
134impl<'a> ::buffa::MessageName for DoubleValueView<'a> {
135    const PACKAGE: &'static str = "google.protobuf";
136    const NAME: &'static str = "DoubleValue";
137    const FULL_NAME: &'static str = "google.protobuf.DoubleValue";
138    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
139}
140impl<'v> ::buffa::DefaultViewInstance for DoubleValueView<'v> {
141    fn default_view_instance<'a>() -> &'a Self
142    where
143        Self: 'a,
144    {
145        static VALUE: ::buffa::__private::OnceBox<DoubleValueView<'static>> = ::buffa::__private::OnceBox::new();
146        VALUE
147            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
148                <DoubleValueView<'static>>::default(),
149            ))
150    }
151}
152impl ::buffa::ViewReborrow for DoubleValueView<'static> {
153    type Reborrowed<'b> = DoubleValueView<'b>;
154    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
155        this
156    }
157}
158/// Wrapper message for `float`.
159///
160/// The JSON representation for `FloatValue` is JSON number.
161#[derive(Clone, Debug, Default)]
162pub struct FloatValueView<'a> {
163    /// The float value.
164    ///
165    /// Field 1: `value`
166    pub value: f32,
167    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
168}
169impl<'a> FloatValueView<'a> {
170    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
171    ///
172    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
173    /// and by generated sub-message decode arms with `depth - 1`.
174    ///
175    /// **Not part of the public API.** Named with a leading underscore to
176    /// signal that it is for generated-code use only.
177    #[doc(hidden)]
178    pub fn _decode_depth(
179        buf: &'a [u8],
180        depth: u32,
181    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
182        let mut view = Self::default();
183        view._merge_into_view(buf, depth)?;
184        ::core::result::Result::Ok(view)
185    }
186    /// Merge fields from `buf` into this view (proto merge semantics).
187    ///
188    /// Repeated fields append; singular fields last-wins; singular
189    /// MESSAGE fields merge recursively. Used by sub-message decode
190    /// arms when the same field appears multiple times on the wire.
191    ///
192    /// **Not part of the public API.**
193    #[doc(hidden)]
194    pub fn _merge_into_view(
195        &mut self,
196        buf: &'a [u8],
197        depth: u32,
198    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
199        let _ = depth;
200        #[allow(unused_variables)]
201        let view = self;
202        let mut cur: &'a [u8] = buf;
203        while !cur.is_empty() {
204            let before_tag = cur;
205            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
206            match tag.field_number() {
207                1u32 => {
208                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
209                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
210                            field_number: 1u32,
211                            expected: 5u8,
212                            actual: tag.wire_type() as u8,
213                        });
214                    }
215                    view.value = ::buffa::types::decode_float(&mut cur)?;
216                }
217                _ => {
218                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
219                    let span_len = before_tag.len() - cur.len();
220                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
221                }
222            }
223        }
224        ::core::result::Result::Ok(())
225    }
226}
227impl<'a> ::buffa::MessageView<'a> for FloatValueView<'a> {
228    type Owned = super::super::FloatValue;
229    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
230        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
231    }
232    fn decode_view_with_limit(
233        buf: &'a [u8],
234        depth: u32,
235    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
236        Self::_decode_depth(buf, depth)
237    }
238    fn to_owned_message(&self) -> super::super::FloatValue {
239        self.to_owned_from_source(None)
240    }
241    #[allow(clippy::useless_conversion, clippy::needless_update)]
242    fn to_owned_from_source(
243        &self,
244        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
245    ) -> super::super::FloatValue {
246        #[allow(unused_imports)]
247        use ::buffa::alloc::string::ToString as _;
248        let _ = __buffa_src;
249        super::super::FloatValue {
250            value: self.value,
251            __buffa_unknown_fields: self
252                .__buffa_unknown_fields
253                .to_owned()
254                .unwrap_or_default()
255                .into(),
256            ..::core::default::Default::default()
257        }
258    }
259}
260impl<'a> ::buffa::ViewEncode<'a> for FloatValueView<'a> {
261    #[allow(clippy::needless_borrow, clippy::let_and_return)]
262    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
263        #[allow(unused_imports)]
264        use ::buffa::Enumeration as _;
265        let mut size = 0u32;
266        if self.value.to_bits() != 0u32 {
267            size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
268        }
269        size += self.__buffa_unknown_fields.encoded_len() as u32;
270        size
271    }
272    #[allow(clippy::needless_borrow)]
273    fn write_to(
274        &self,
275        _cache: &mut ::buffa::SizeCache,
276        buf: &mut impl ::buffa::bytes::BufMut,
277    ) {
278        #[allow(unused_imports)]
279        use ::buffa::Enumeration as _;
280        if self.value.to_bits() != 0u32 {
281            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
282                .encode(buf);
283            ::buffa::types::encode_float(self.value, buf);
284        }
285        self.__buffa_unknown_fields.write_to(buf);
286    }
287}
288impl<'a> ::buffa::MessageName for FloatValueView<'a> {
289    const PACKAGE: &'static str = "google.protobuf";
290    const NAME: &'static str = "FloatValue";
291    const FULL_NAME: &'static str = "google.protobuf.FloatValue";
292    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
293}
294impl<'v> ::buffa::DefaultViewInstance for FloatValueView<'v> {
295    fn default_view_instance<'a>() -> &'a Self
296    where
297        Self: 'a,
298    {
299        static VALUE: ::buffa::__private::OnceBox<FloatValueView<'static>> = ::buffa::__private::OnceBox::new();
300        VALUE
301            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
302                <FloatValueView<'static>>::default(),
303            ))
304    }
305}
306impl ::buffa::ViewReborrow for FloatValueView<'static> {
307    type Reborrowed<'b> = FloatValueView<'b>;
308    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
309        this
310    }
311}
312/// Wrapper message for `int64`.
313///
314/// The JSON representation for `Int64Value` is JSON string.
315#[derive(Clone, Debug, Default)]
316pub struct Int64ValueView<'a> {
317    /// The int64 value.
318    ///
319    /// Field 1: `value`
320    pub value: i64,
321    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
322}
323impl<'a> Int64ValueView<'a> {
324    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
325    ///
326    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
327    /// and by generated sub-message decode arms with `depth - 1`.
328    ///
329    /// **Not part of the public API.** Named with a leading underscore to
330    /// signal that it is for generated-code use only.
331    #[doc(hidden)]
332    pub fn _decode_depth(
333        buf: &'a [u8],
334        depth: u32,
335    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
336        let mut view = Self::default();
337        view._merge_into_view(buf, depth)?;
338        ::core::result::Result::Ok(view)
339    }
340    /// Merge fields from `buf` into this view (proto merge semantics).
341    ///
342    /// Repeated fields append; singular fields last-wins; singular
343    /// MESSAGE fields merge recursively. Used by sub-message decode
344    /// arms when the same field appears multiple times on the wire.
345    ///
346    /// **Not part of the public API.**
347    #[doc(hidden)]
348    pub fn _merge_into_view(
349        &mut self,
350        buf: &'a [u8],
351        depth: u32,
352    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
353        let _ = depth;
354        #[allow(unused_variables)]
355        let view = self;
356        let mut cur: &'a [u8] = buf;
357        while !cur.is_empty() {
358            let before_tag = cur;
359            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
360            match tag.field_number() {
361                1u32 => {
362                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
363                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
364                            field_number: 1u32,
365                            expected: 0u8,
366                            actual: tag.wire_type() as u8,
367                        });
368                    }
369                    view.value = ::buffa::types::decode_int64(&mut cur)?;
370                }
371                _ => {
372                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
373                    let span_len = before_tag.len() - cur.len();
374                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
375                }
376            }
377        }
378        ::core::result::Result::Ok(())
379    }
380}
381impl<'a> ::buffa::MessageView<'a> for Int64ValueView<'a> {
382    type Owned = super::super::Int64Value;
383    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
384        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
385    }
386    fn decode_view_with_limit(
387        buf: &'a [u8],
388        depth: u32,
389    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
390        Self::_decode_depth(buf, depth)
391    }
392    fn to_owned_message(&self) -> super::super::Int64Value {
393        self.to_owned_from_source(None)
394    }
395    #[allow(clippy::useless_conversion, clippy::needless_update)]
396    fn to_owned_from_source(
397        &self,
398        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
399    ) -> super::super::Int64Value {
400        #[allow(unused_imports)]
401        use ::buffa::alloc::string::ToString as _;
402        let _ = __buffa_src;
403        super::super::Int64Value {
404            value: self.value,
405            __buffa_unknown_fields: self
406                .__buffa_unknown_fields
407                .to_owned()
408                .unwrap_or_default()
409                .into(),
410            ..::core::default::Default::default()
411        }
412    }
413}
414impl<'a> ::buffa::ViewEncode<'a> for Int64ValueView<'a> {
415    #[allow(clippy::needless_borrow, clippy::let_and_return)]
416    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
417        #[allow(unused_imports)]
418        use ::buffa::Enumeration as _;
419        let mut size = 0u32;
420        if self.value != 0i64 {
421            size += 1u32 + ::buffa::types::int64_encoded_len(self.value) as u32;
422        }
423        size += self.__buffa_unknown_fields.encoded_len() as u32;
424        size
425    }
426    #[allow(clippy::needless_borrow)]
427    fn write_to(
428        &self,
429        _cache: &mut ::buffa::SizeCache,
430        buf: &mut impl ::buffa::bytes::BufMut,
431    ) {
432        #[allow(unused_imports)]
433        use ::buffa::Enumeration as _;
434        if self.value != 0i64 {
435            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
436                .encode(buf);
437            ::buffa::types::encode_int64(self.value, buf);
438        }
439        self.__buffa_unknown_fields.write_to(buf);
440    }
441}
442impl<'a> ::buffa::MessageName for Int64ValueView<'a> {
443    const PACKAGE: &'static str = "google.protobuf";
444    const NAME: &'static str = "Int64Value";
445    const FULL_NAME: &'static str = "google.protobuf.Int64Value";
446    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
447}
448impl<'v> ::buffa::DefaultViewInstance for Int64ValueView<'v> {
449    fn default_view_instance<'a>() -> &'a Self
450    where
451        Self: 'a,
452    {
453        static VALUE: ::buffa::__private::OnceBox<Int64ValueView<'static>> = ::buffa::__private::OnceBox::new();
454        VALUE
455            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
456                <Int64ValueView<'static>>::default(),
457            ))
458    }
459}
460impl ::buffa::ViewReborrow for Int64ValueView<'static> {
461    type Reborrowed<'b> = Int64ValueView<'b>;
462    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
463        this
464    }
465}
466/// Wrapper message for `uint64`.
467///
468/// The JSON representation for `UInt64Value` is JSON string.
469#[derive(Clone, Debug, Default)]
470pub struct UInt64ValueView<'a> {
471    /// The uint64 value.
472    ///
473    /// Field 1: `value`
474    pub value: u64,
475    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
476}
477impl<'a> UInt64ValueView<'a> {
478    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
479    ///
480    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
481    /// and by generated sub-message decode arms with `depth - 1`.
482    ///
483    /// **Not part of the public API.** Named with a leading underscore to
484    /// signal that it is for generated-code use only.
485    #[doc(hidden)]
486    pub fn _decode_depth(
487        buf: &'a [u8],
488        depth: u32,
489    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
490        let mut view = Self::default();
491        view._merge_into_view(buf, depth)?;
492        ::core::result::Result::Ok(view)
493    }
494    /// Merge fields from `buf` into this view (proto merge semantics).
495    ///
496    /// Repeated fields append; singular fields last-wins; singular
497    /// MESSAGE fields merge recursively. Used by sub-message decode
498    /// arms when the same field appears multiple times on the wire.
499    ///
500    /// **Not part of the public API.**
501    #[doc(hidden)]
502    pub fn _merge_into_view(
503        &mut self,
504        buf: &'a [u8],
505        depth: u32,
506    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
507        let _ = depth;
508        #[allow(unused_variables)]
509        let view = self;
510        let mut cur: &'a [u8] = buf;
511        while !cur.is_empty() {
512            let before_tag = cur;
513            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
514            match tag.field_number() {
515                1u32 => {
516                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
517                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
518                            field_number: 1u32,
519                            expected: 0u8,
520                            actual: tag.wire_type() as u8,
521                        });
522                    }
523                    view.value = ::buffa::types::decode_uint64(&mut cur)?;
524                }
525                _ => {
526                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
527                    let span_len = before_tag.len() - cur.len();
528                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
529                }
530            }
531        }
532        ::core::result::Result::Ok(())
533    }
534}
535impl<'a> ::buffa::MessageView<'a> for UInt64ValueView<'a> {
536    type Owned = super::super::UInt64Value;
537    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
538        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
539    }
540    fn decode_view_with_limit(
541        buf: &'a [u8],
542        depth: u32,
543    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
544        Self::_decode_depth(buf, depth)
545    }
546    fn to_owned_message(&self) -> super::super::UInt64Value {
547        self.to_owned_from_source(None)
548    }
549    #[allow(clippy::useless_conversion, clippy::needless_update)]
550    fn to_owned_from_source(
551        &self,
552        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
553    ) -> super::super::UInt64Value {
554        #[allow(unused_imports)]
555        use ::buffa::alloc::string::ToString as _;
556        let _ = __buffa_src;
557        super::super::UInt64Value {
558            value: self.value,
559            __buffa_unknown_fields: self
560                .__buffa_unknown_fields
561                .to_owned()
562                .unwrap_or_default()
563                .into(),
564            ..::core::default::Default::default()
565        }
566    }
567}
568impl<'a> ::buffa::ViewEncode<'a> for UInt64ValueView<'a> {
569    #[allow(clippy::needless_borrow, clippy::let_and_return)]
570    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
571        #[allow(unused_imports)]
572        use ::buffa::Enumeration as _;
573        let mut size = 0u32;
574        if self.value != 0u64 {
575            size += 1u32 + ::buffa::types::uint64_encoded_len(self.value) as u32;
576        }
577        size += self.__buffa_unknown_fields.encoded_len() as u32;
578        size
579    }
580    #[allow(clippy::needless_borrow)]
581    fn write_to(
582        &self,
583        _cache: &mut ::buffa::SizeCache,
584        buf: &mut impl ::buffa::bytes::BufMut,
585    ) {
586        #[allow(unused_imports)]
587        use ::buffa::Enumeration as _;
588        if self.value != 0u64 {
589            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
590                .encode(buf);
591            ::buffa::types::encode_uint64(self.value, buf);
592        }
593        self.__buffa_unknown_fields.write_to(buf);
594    }
595}
596impl<'a> ::buffa::MessageName for UInt64ValueView<'a> {
597    const PACKAGE: &'static str = "google.protobuf";
598    const NAME: &'static str = "UInt64Value";
599    const FULL_NAME: &'static str = "google.protobuf.UInt64Value";
600    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
601}
602impl<'v> ::buffa::DefaultViewInstance for UInt64ValueView<'v> {
603    fn default_view_instance<'a>() -> &'a Self
604    where
605        Self: 'a,
606    {
607        static VALUE: ::buffa::__private::OnceBox<UInt64ValueView<'static>> = ::buffa::__private::OnceBox::new();
608        VALUE
609            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
610                <UInt64ValueView<'static>>::default(),
611            ))
612    }
613}
614impl ::buffa::ViewReborrow for UInt64ValueView<'static> {
615    type Reborrowed<'b> = UInt64ValueView<'b>;
616    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
617        this
618    }
619}
620/// Wrapper message for `int32`.
621///
622/// The JSON representation for `Int32Value` is JSON number.
623#[derive(Clone, Debug, Default)]
624pub struct Int32ValueView<'a> {
625    /// The int32 value.
626    ///
627    /// Field 1: `value`
628    pub value: i32,
629    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
630}
631impl<'a> Int32ValueView<'a> {
632    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
633    ///
634    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
635    /// and by generated sub-message decode arms with `depth - 1`.
636    ///
637    /// **Not part of the public API.** Named with a leading underscore to
638    /// signal that it is for generated-code use only.
639    #[doc(hidden)]
640    pub fn _decode_depth(
641        buf: &'a [u8],
642        depth: u32,
643    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
644        let mut view = Self::default();
645        view._merge_into_view(buf, depth)?;
646        ::core::result::Result::Ok(view)
647    }
648    /// Merge fields from `buf` into this view (proto merge semantics).
649    ///
650    /// Repeated fields append; singular fields last-wins; singular
651    /// MESSAGE fields merge recursively. Used by sub-message decode
652    /// arms when the same field appears multiple times on the wire.
653    ///
654    /// **Not part of the public API.**
655    #[doc(hidden)]
656    pub fn _merge_into_view(
657        &mut self,
658        buf: &'a [u8],
659        depth: u32,
660    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
661        let _ = depth;
662        #[allow(unused_variables)]
663        let view = self;
664        let mut cur: &'a [u8] = buf;
665        while !cur.is_empty() {
666            let before_tag = cur;
667            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
668            match tag.field_number() {
669                1u32 => {
670                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
671                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
672                            field_number: 1u32,
673                            expected: 0u8,
674                            actual: tag.wire_type() as u8,
675                        });
676                    }
677                    view.value = ::buffa::types::decode_int32(&mut cur)?;
678                }
679                _ => {
680                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
681                    let span_len = before_tag.len() - cur.len();
682                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
683                }
684            }
685        }
686        ::core::result::Result::Ok(())
687    }
688}
689impl<'a> ::buffa::MessageView<'a> for Int32ValueView<'a> {
690    type Owned = super::super::Int32Value;
691    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
692        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
693    }
694    fn decode_view_with_limit(
695        buf: &'a [u8],
696        depth: u32,
697    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
698        Self::_decode_depth(buf, depth)
699    }
700    fn to_owned_message(&self) -> super::super::Int32Value {
701        self.to_owned_from_source(None)
702    }
703    #[allow(clippy::useless_conversion, clippy::needless_update)]
704    fn to_owned_from_source(
705        &self,
706        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
707    ) -> super::super::Int32Value {
708        #[allow(unused_imports)]
709        use ::buffa::alloc::string::ToString as _;
710        let _ = __buffa_src;
711        super::super::Int32Value {
712            value: self.value,
713            __buffa_unknown_fields: self
714                .__buffa_unknown_fields
715                .to_owned()
716                .unwrap_or_default()
717                .into(),
718            ..::core::default::Default::default()
719        }
720    }
721}
722impl<'a> ::buffa::ViewEncode<'a> for Int32ValueView<'a> {
723    #[allow(clippy::needless_borrow, clippy::let_and_return)]
724    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
725        #[allow(unused_imports)]
726        use ::buffa::Enumeration as _;
727        let mut size = 0u32;
728        if self.value != 0i32 {
729            size += 1u32 + ::buffa::types::int32_encoded_len(self.value) as u32;
730        }
731        size += self.__buffa_unknown_fields.encoded_len() as u32;
732        size
733    }
734    #[allow(clippy::needless_borrow)]
735    fn write_to(
736        &self,
737        _cache: &mut ::buffa::SizeCache,
738        buf: &mut impl ::buffa::bytes::BufMut,
739    ) {
740        #[allow(unused_imports)]
741        use ::buffa::Enumeration as _;
742        if self.value != 0i32 {
743            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
744                .encode(buf);
745            ::buffa::types::encode_int32(self.value, buf);
746        }
747        self.__buffa_unknown_fields.write_to(buf);
748    }
749}
750impl<'a> ::buffa::MessageName for Int32ValueView<'a> {
751    const PACKAGE: &'static str = "google.protobuf";
752    const NAME: &'static str = "Int32Value";
753    const FULL_NAME: &'static str = "google.protobuf.Int32Value";
754    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
755}
756impl<'v> ::buffa::DefaultViewInstance for Int32ValueView<'v> {
757    fn default_view_instance<'a>() -> &'a Self
758    where
759        Self: 'a,
760    {
761        static VALUE: ::buffa::__private::OnceBox<Int32ValueView<'static>> = ::buffa::__private::OnceBox::new();
762        VALUE
763            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
764                <Int32ValueView<'static>>::default(),
765            ))
766    }
767}
768impl ::buffa::ViewReborrow for Int32ValueView<'static> {
769    type Reborrowed<'b> = Int32ValueView<'b>;
770    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
771        this
772    }
773}
774/// Wrapper message for `uint32`.
775///
776/// The JSON representation for `UInt32Value` is JSON number.
777#[derive(Clone, Debug, Default)]
778pub struct UInt32ValueView<'a> {
779    /// The uint32 value.
780    ///
781    /// Field 1: `value`
782    pub value: u32,
783    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
784}
785impl<'a> UInt32ValueView<'a> {
786    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
787    ///
788    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
789    /// and by generated sub-message decode arms with `depth - 1`.
790    ///
791    /// **Not part of the public API.** Named with a leading underscore to
792    /// signal that it is for generated-code use only.
793    #[doc(hidden)]
794    pub fn _decode_depth(
795        buf: &'a [u8],
796        depth: u32,
797    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
798        let mut view = Self::default();
799        view._merge_into_view(buf, depth)?;
800        ::core::result::Result::Ok(view)
801    }
802    /// Merge fields from `buf` into this view (proto merge semantics).
803    ///
804    /// Repeated fields append; singular fields last-wins; singular
805    /// MESSAGE fields merge recursively. Used by sub-message decode
806    /// arms when the same field appears multiple times on the wire.
807    ///
808    /// **Not part of the public API.**
809    #[doc(hidden)]
810    pub fn _merge_into_view(
811        &mut self,
812        buf: &'a [u8],
813        depth: u32,
814    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
815        let _ = depth;
816        #[allow(unused_variables)]
817        let view = self;
818        let mut cur: &'a [u8] = buf;
819        while !cur.is_empty() {
820            let before_tag = cur;
821            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
822            match tag.field_number() {
823                1u32 => {
824                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
825                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
826                            field_number: 1u32,
827                            expected: 0u8,
828                            actual: tag.wire_type() as u8,
829                        });
830                    }
831                    view.value = ::buffa::types::decode_uint32(&mut cur)?;
832                }
833                _ => {
834                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
835                    let span_len = before_tag.len() - cur.len();
836                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
837                }
838            }
839        }
840        ::core::result::Result::Ok(())
841    }
842}
843impl<'a> ::buffa::MessageView<'a> for UInt32ValueView<'a> {
844    type Owned = super::super::UInt32Value;
845    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
846        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
847    }
848    fn decode_view_with_limit(
849        buf: &'a [u8],
850        depth: u32,
851    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
852        Self::_decode_depth(buf, depth)
853    }
854    fn to_owned_message(&self) -> super::super::UInt32Value {
855        self.to_owned_from_source(None)
856    }
857    #[allow(clippy::useless_conversion, clippy::needless_update)]
858    fn to_owned_from_source(
859        &self,
860        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
861    ) -> super::super::UInt32Value {
862        #[allow(unused_imports)]
863        use ::buffa::alloc::string::ToString as _;
864        let _ = __buffa_src;
865        super::super::UInt32Value {
866            value: self.value,
867            __buffa_unknown_fields: self
868                .__buffa_unknown_fields
869                .to_owned()
870                .unwrap_or_default()
871                .into(),
872            ..::core::default::Default::default()
873        }
874    }
875}
876impl<'a> ::buffa::ViewEncode<'a> for UInt32ValueView<'a> {
877    #[allow(clippy::needless_borrow, clippy::let_and_return)]
878    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
879        #[allow(unused_imports)]
880        use ::buffa::Enumeration as _;
881        let mut size = 0u32;
882        if self.value != 0u32 {
883            size += 1u32 + ::buffa::types::uint32_encoded_len(self.value) as u32;
884        }
885        size += self.__buffa_unknown_fields.encoded_len() as u32;
886        size
887    }
888    #[allow(clippy::needless_borrow)]
889    fn write_to(
890        &self,
891        _cache: &mut ::buffa::SizeCache,
892        buf: &mut impl ::buffa::bytes::BufMut,
893    ) {
894        #[allow(unused_imports)]
895        use ::buffa::Enumeration as _;
896        if self.value != 0u32 {
897            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
898                .encode(buf);
899            ::buffa::types::encode_uint32(self.value, buf);
900        }
901        self.__buffa_unknown_fields.write_to(buf);
902    }
903}
904impl<'a> ::buffa::MessageName for UInt32ValueView<'a> {
905    const PACKAGE: &'static str = "google.protobuf";
906    const NAME: &'static str = "UInt32Value";
907    const FULL_NAME: &'static str = "google.protobuf.UInt32Value";
908    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
909}
910impl<'v> ::buffa::DefaultViewInstance for UInt32ValueView<'v> {
911    fn default_view_instance<'a>() -> &'a Self
912    where
913        Self: 'a,
914    {
915        static VALUE: ::buffa::__private::OnceBox<UInt32ValueView<'static>> = ::buffa::__private::OnceBox::new();
916        VALUE
917            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
918                <UInt32ValueView<'static>>::default(),
919            ))
920    }
921}
922impl ::buffa::ViewReborrow for UInt32ValueView<'static> {
923    type Reborrowed<'b> = UInt32ValueView<'b>;
924    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
925        this
926    }
927}
928/// Wrapper message for `bool`.
929///
930/// The JSON representation for `BoolValue` is JSON `true` and `false`.
931#[derive(Clone, Debug, Default)]
932pub struct BoolValueView<'a> {
933    /// The bool value.
934    ///
935    /// Field 1: `value`
936    pub value: bool,
937    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
938}
939impl<'a> BoolValueView<'a> {
940    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
941    ///
942    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
943    /// and by generated sub-message decode arms with `depth - 1`.
944    ///
945    /// **Not part of the public API.** Named with a leading underscore to
946    /// signal that it is for generated-code use only.
947    #[doc(hidden)]
948    pub fn _decode_depth(
949        buf: &'a [u8],
950        depth: u32,
951    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
952        let mut view = Self::default();
953        view._merge_into_view(buf, depth)?;
954        ::core::result::Result::Ok(view)
955    }
956    /// Merge fields from `buf` into this view (proto merge semantics).
957    ///
958    /// Repeated fields append; singular fields last-wins; singular
959    /// MESSAGE fields merge recursively. Used by sub-message decode
960    /// arms when the same field appears multiple times on the wire.
961    ///
962    /// **Not part of the public API.**
963    #[doc(hidden)]
964    pub fn _merge_into_view(
965        &mut self,
966        buf: &'a [u8],
967        depth: u32,
968    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
969        let _ = depth;
970        #[allow(unused_variables)]
971        let view = self;
972        let mut cur: &'a [u8] = buf;
973        while !cur.is_empty() {
974            let before_tag = cur;
975            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
976            match tag.field_number() {
977                1u32 => {
978                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
979                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
980                            field_number: 1u32,
981                            expected: 0u8,
982                            actual: tag.wire_type() as u8,
983                        });
984                    }
985                    view.value = ::buffa::types::decode_bool(&mut cur)?;
986                }
987                _ => {
988                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
989                    let span_len = before_tag.len() - cur.len();
990                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
991                }
992            }
993        }
994        ::core::result::Result::Ok(())
995    }
996}
997impl<'a> ::buffa::MessageView<'a> for BoolValueView<'a> {
998    type Owned = super::super::BoolValue;
999    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1000        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1001    }
1002    fn decode_view_with_limit(
1003        buf: &'a [u8],
1004        depth: u32,
1005    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1006        Self::_decode_depth(buf, depth)
1007    }
1008    fn to_owned_message(&self) -> super::super::BoolValue {
1009        self.to_owned_from_source(None)
1010    }
1011    #[allow(clippy::useless_conversion, clippy::needless_update)]
1012    fn to_owned_from_source(
1013        &self,
1014        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1015    ) -> super::super::BoolValue {
1016        #[allow(unused_imports)]
1017        use ::buffa::alloc::string::ToString as _;
1018        let _ = __buffa_src;
1019        super::super::BoolValue {
1020            value: self.value,
1021            __buffa_unknown_fields: self
1022                .__buffa_unknown_fields
1023                .to_owned()
1024                .unwrap_or_default()
1025                .into(),
1026            ..::core::default::Default::default()
1027        }
1028    }
1029}
1030impl<'a> ::buffa::ViewEncode<'a> for BoolValueView<'a> {
1031    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1032    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1033        #[allow(unused_imports)]
1034        use ::buffa::Enumeration as _;
1035        let mut size = 0u32;
1036        if self.value {
1037            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1038        }
1039        size += self.__buffa_unknown_fields.encoded_len() as u32;
1040        size
1041    }
1042    #[allow(clippy::needless_borrow)]
1043    fn write_to(
1044        &self,
1045        _cache: &mut ::buffa::SizeCache,
1046        buf: &mut impl ::buffa::bytes::BufMut,
1047    ) {
1048        #[allow(unused_imports)]
1049        use ::buffa::Enumeration as _;
1050        if self.value {
1051            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1052                .encode(buf);
1053            ::buffa::types::encode_bool(self.value, buf);
1054        }
1055        self.__buffa_unknown_fields.write_to(buf);
1056    }
1057}
1058impl<'a> ::buffa::MessageName for BoolValueView<'a> {
1059    const PACKAGE: &'static str = "google.protobuf";
1060    const NAME: &'static str = "BoolValue";
1061    const FULL_NAME: &'static str = "google.protobuf.BoolValue";
1062    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
1063}
1064impl<'v> ::buffa::DefaultViewInstance for BoolValueView<'v> {
1065    fn default_view_instance<'a>() -> &'a Self
1066    where
1067        Self: 'a,
1068    {
1069        static VALUE: ::buffa::__private::OnceBox<BoolValueView<'static>> = ::buffa::__private::OnceBox::new();
1070        VALUE
1071            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
1072                <BoolValueView<'static>>::default(),
1073            ))
1074    }
1075}
1076impl ::buffa::ViewReborrow for BoolValueView<'static> {
1077    type Reborrowed<'b> = BoolValueView<'b>;
1078    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
1079        this
1080    }
1081}
1082/// Wrapper message for `string`.
1083///
1084/// The JSON representation for `StringValue` is JSON string.
1085#[derive(Clone, Debug, Default)]
1086pub struct StringValueView<'a> {
1087    /// The string value.
1088    ///
1089    /// Field 1: `value`
1090    pub value: &'a str,
1091    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1092}
1093impl<'a> StringValueView<'a> {
1094    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
1095    ///
1096    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
1097    /// and by generated sub-message decode arms with `depth - 1`.
1098    ///
1099    /// **Not part of the public API.** Named with a leading underscore to
1100    /// signal that it is for generated-code use only.
1101    #[doc(hidden)]
1102    pub fn _decode_depth(
1103        buf: &'a [u8],
1104        depth: u32,
1105    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1106        let mut view = Self::default();
1107        view._merge_into_view(buf, depth)?;
1108        ::core::result::Result::Ok(view)
1109    }
1110    /// Merge fields from `buf` into this view (proto merge semantics).
1111    ///
1112    /// Repeated fields append; singular fields last-wins; singular
1113    /// MESSAGE fields merge recursively. Used by sub-message decode
1114    /// arms when the same field appears multiple times on the wire.
1115    ///
1116    /// **Not part of the public API.**
1117    #[doc(hidden)]
1118    pub fn _merge_into_view(
1119        &mut self,
1120        buf: &'a [u8],
1121        depth: u32,
1122    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1123        let _ = depth;
1124        #[allow(unused_variables)]
1125        let view = self;
1126        let mut cur: &'a [u8] = buf;
1127        while !cur.is_empty() {
1128            let before_tag = cur;
1129            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1130            match tag.field_number() {
1131                1u32 => {
1132                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1133                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1134                            field_number: 1u32,
1135                            expected: 2u8,
1136                            actual: tag.wire_type() as u8,
1137                        });
1138                    }
1139                    view.value = ::buffa::types::borrow_str(&mut cur)?;
1140                }
1141                _ => {
1142                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1143                    let span_len = before_tag.len() - cur.len();
1144                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1145                }
1146            }
1147        }
1148        ::core::result::Result::Ok(())
1149    }
1150}
1151impl<'a> ::buffa::MessageView<'a> for StringValueView<'a> {
1152    type Owned = super::super::StringValue;
1153    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1154        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1155    }
1156    fn decode_view_with_limit(
1157        buf: &'a [u8],
1158        depth: u32,
1159    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1160        Self::_decode_depth(buf, depth)
1161    }
1162    fn to_owned_message(&self) -> super::super::StringValue {
1163        self.to_owned_from_source(None)
1164    }
1165    #[allow(clippy::useless_conversion, clippy::needless_update)]
1166    fn to_owned_from_source(
1167        &self,
1168        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1169    ) -> super::super::StringValue {
1170        #[allow(unused_imports)]
1171        use ::buffa::alloc::string::ToString as _;
1172        let _ = __buffa_src;
1173        super::super::StringValue {
1174            value: self.value.to_string(),
1175            __buffa_unknown_fields: self
1176                .__buffa_unknown_fields
1177                .to_owned()
1178                .unwrap_or_default()
1179                .into(),
1180            ..::core::default::Default::default()
1181        }
1182    }
1183}
1184impl<'a> ::buffa::ViewEncode<'a> for StringValueView<'a> {
1185    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1186    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1187        #[allow(unused_imports)]
1188        use ::buffa::Enumeration as _;
1189        let mut size = 0u32;
1190        if !self.value.is_empty() {
1191            size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
1192        }
1193        size += self.__buffa_unknown_fields.encoded_len() as u32;
1194        size
1195    }
1196    #[allow(clippy::needless_borrow)]
1197    fn write_to(
1198        &self,
1199        _cache: &mut ::buffa::SizeCache,
1200        buf: &mut impl ::buffa::bytes::BufMut,
1201    ) {
1202        #[allow(unused_imports)]
1203        use ::buffa::Enumeration as _;
1204        if !self.value.is_empty() {
1205            ::buffa::encoding::Tag::new(
1206                    1u32,
1207                    ::buffa::encoding::WireType::LengthDelimited,
1208                )
1209                .encode(buf);
1210            ::buffa::types::encode_string(&self.value, buf);
1211        }
1212        self.__buffa_unknown_fields.write_to(buf);
1213    }
1214}
1215impl<'a> ::buffa::MessageName for StringValueView<'a> {
1216    const PACKAGE: &'static str = "google.protobuf";
1217    const NAME: &'static str = "StringValue";
1218    const FULL_NAME: &'static str = "google.protobuf.StringValue";
1219    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
1220}
1221impl<'v> ::buffa::DefaultViewInstance for StringValueView<'v> {
1222    fn default_view_instance<'a>() -> &'a Self
1223    where
1224        Self: 'a,
1225    {
1226        static VALUE: ::buffa::__private::OnceBox<StringValueView<'static>> = ::buffa::__private::OnceBox::new();
1227        VALUE
1228            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
1229                <StringValueView<'static>>::default(),
1230            ))
1231    }
1232}
1233impl ::buffa::ViewReborrow for StringValueView<'static> {
1234    type Reborrowed<'b> = StringValueView<'b>;
1235    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
1236        this
1237    }
1238}
1239/// Wrapper message for `bytes`.
1240///
1241/// The JSON representation for `BytesValue` is JSON string.
1242#[derive(Clone, Debug, Default)]
1243pub struct BytesValueView<'a> {
1244    /// The bytes value.
1245    ///
1246    /// Field 1: `value`
1247    pub value: &'a [u8],
1248    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1249}
1250impl<'a> BytesValueView<'a> {
1251    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
1252    ///
1253    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
1254    /// and by generated sub-message decode arms with `depth - 1`.
1255    ///
1256    /// **Not part of the public API.** Named with a leading underscore to
1257    /// signal that it is for generated-code use only.
1258    #[doc(hidden)]
1259    pub fn _decode_depth(
1260        buf: &'a [u8],
1261        depth: u32,
1262    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1263        let mut view = Self::default();
1264        view._merge_into_view(buf, depth)?;
1265        ::core::result::Result::Ok(view)
1266    }
1267    /// Merge fields from `buf` into this view (proto merge semantics).
1268    ///
1269    /// Repeated fields append; singular fields last-wins; singular
1270    /// MESSAGE fields merge recursively. Used by sub-message decode
1271    /// arms when the same field appears multiple times on the wire.
1272    ///
1273    /// **Not part of the public API.**
1274    #[doc(hidden)]
1275    pub fn _merge_into_view(
1276        &mut self,
1277        buf: &'a [u8],
1278        depth: u32,
1279    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1280        let _ = depth;
1281        #[allow(unused_variables)]
1282        let view = self;
1283        let mut cur: &'a [u8] = buf;
1284        while !cur.is_empty() {
1285            let before_tag = cur;
1286            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1287            match tag.field_number() {
1288                1u32 => {
1289                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1290                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1291                            field_number: 1u32,
1292                            expected: 2u8,
1293                            actual: tag.wire_type() as u8,
1294                        });
1295                    }
1296                    view.value = ::buffa::types::borrow_bytes(&mut cur)?;
1297                }
1298                _ => {
1299                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1300                    let span_len = before_tag.len() - cur.len();
1301                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1302                }
1303            }
1304        }
1305        ::core::result::Result::Ok(())
1306    }
1307}
1308impl<'a> ::buffa::MessageView<'a> for BytesValueView<'a> {
1309    type Owned = super::super::BytesValue;
1310    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1311        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1312    }
1313    fn decode_view_with_limit(
1314        buf: &'a [u8],
1315        depth: u32,
1316    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1317        Self::_decode_depth(buf, depth)
1318    }
1319    fn to_owned_message(&self) -> super::super::BytesValue {
1320        self.to_owned_from_source(None)
1321    }
1322    #[allow(clippy::useless_conversion, clippy::needless_update)]
1323    fn to_owned_from_source(
1324        &self,
1325        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1326    ) -> super::super::BytesValue {
1327        #[allow(unused_imports)]
1328        use ::buffa::alloc::string::ToString as _;
1329        let _ = __buffa_src;
1330        super::super::BytesValue {
1331            value: (self.value).to_vec(),
1332            __buffa_unknown_fields: self
1333                .__buffa_unknown_fields
1334                .to_owned()
1335                .unwrap_or_default()
1336                .into(),
1337            ..::core::default::Default::default()
1338        }
1339    }
1340}
1341impl<'a> ::buffa::ViewEncode<'a> for BytesValueView<'a> {
1342    #[allow(clippy::needless_borrow, clippy::let_and_return)]
1343    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1344        #[allow(unused_imports)]
1345        use ::buffa::Enumeration as _;
1346        let mut size = 0u32;
1347        if !self.value.is_empty() {
1348            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) as u32;
1349        }
1350        size += self.__buffa_unknown_fields.encoded_len() as u32;
1351        size
1352    }
1353    #[allow(clippy::needless_borrow)]
1354    fn write_to(
1355        &self,
1356        _cache: &mut ::buffa::SizeCache,
1357        buf: &mut impl ::buffa::bytes::BufMut,
1358    ) {
1359        #[allow(unused_imports)]
1360        use ::buffa::Enumeration as _;
1361        if !self.value.is_empty() {
1362            ::buffa::encoding::Tag::new(
1363                    1u32,
1364                    ::buffa::encoding::WireType::LengthDelimited,
1365                )
1366                .encode(buf);
1367            ::buffa::types::encode_bytes(&self.value, buf);
1368        }
1369        self.__buffa_unknown_fields.write_to(buf);
1370    }
1371}
1372impl<'a> ::buffa::MessageName for BytesValueView<'a> {
1373    const PACKAGE: &'static str = "google.protobuf";
1374    const NAME: &'static str = "BytesValue";
1375    const FULL_NAME: &'static str = "google.protobuf.BytesValue";
1376    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
1377}
1378impl<'v> ::buffa::DefaultViewInstance for BytesValueView<'v> {
1379    fn default_view_instance<'a>() -> &'a Self
1380    where
1381        Self: 'a,
1382    {
1383        static VALUE: ::buffa::__private::OnceBox<BytesValueView<'static>> = ::buffa::__private::OnceBox::new();
1384        VALUE
1385            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
1386                <BytesValueView<'static>>::default(),
1387            ))
1388    }
1389}
1390impl ::buffa::ViewReborrow for BytesValueView<'static> {
1391    type Reborrowed<'b> = BytesValueView<'b>;
1392    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
1393        this
1394    }
1395}