1#[derive(Clone, PartialEq, Default)]
5#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
6pub struct DoubleValue {
7 pub value: f64,
9 #[doc(hidden)]
10 pub __buffa_unknown_fields: ::buffa::UnknownFields,
11 #[doc(hidden)]
12 pub __buffa_cached_size: ::buffa::__private::CachedSize,
13}
14impl ::core::fmt::Debug for DoubleValue {
15 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16 f.debug_struct("DoubleValue").field("value", &self.value).finish()
17 }
18}
19impl DoubleValue {
20 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
25}
26unsafe impl ::buffa::DefaultInstance for DoubleValue {
27 fn default_instance() -> &'static Self {
28 static VALUE: ::buffa::__private::OnceBox<DoubleValue> = ::buffa::__private::OnceBox::new();
29 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(DoubleValue::default()))
30 }
31}
32impl ::buffa::Message for DoubleValue {
33 fn compute_size(&self) -> u32 {
39 #[allow(unused_imports)]
40 use ::buffa::Enumeration as _;
41 let mut size = 0u32;
42 if self.value != 0f64 {
43 size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
44 }
45 size += self.__buffa_unknown_fields.encoded_len() as u32;
46 self.__buffa_cached_size.set(size);
47 size
48 }
49 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
50 #[allow(unused_imports)]
51 use ::buffa::Enumeration as _;
52 if self.value != 0f64 {
53 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
54 .encode(buf);
55 ::buffa::types::encode_double(self.value, buf);
56 }
57 self.__buffa_unknown_fields.write_to(buf);
58 }
59 fn merge_field(
60 &mut self,
61 tag: ::buffa::encoding::Tag,
62 buf: &mut impl ::buffa::bytes::Buf,
63 depth: u32,
64 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
65 #[allow(unused_imports)]
66 use ::buffa::bytes::Buf as _;
67 #[allow(unused_imports)]
68 use ::buffa::Enumeration as _;
69 match tag.field_number() {
70 1u32 => {
71 if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
72 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
73 field_number: 1u32,
74 expected: 1u8,
75 actual: tag.wire_type() as u8,
76 });
77 }
78 self.value = ::buffa::types::decode_double(buf)?;
79 }
80 _ => {
81 self.__buffa_unknown_fields
82 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
83 }
84 }
85 ::core::result::Result::Ok(())
86 }
87 fn cached_size(&self) -> u32 {
88 self.__buffa_cached_size.get()
89 }
90 fn clear(&mut self) {
91 self.value = 0f64;
92 self.__buffa_unknown_fields.clear();
93 self.__buffa_cached_size.set(0);
94 }
95}
96#[derive(Clone, Debug, Default)]
97pub struct DoubleValueView<'a> {
98 pub value: f64,
100 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
101}
102impl<'a> DoubleValueView<'a> {
103 #[doc(hidden)]
111 pub fn _decode_depth(
112 buf: &'a [u8],
113 depth: u32,
114 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
115 let mut view = Self::default();
116 view._merge_into_view(buf, depth)?;
117 ::core::result::Result::Ok(view)
118 }
119 #[doc(hidden)]
127 pub fn _merge_into_view(
128 &mut self,
129 buf: &'a [u8],
130 depth: u32,
131 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
132 let _ = depth;
133 #[allow(unused_variables)]
134 let view = self;
135 let mut cur: &'a [u8] = buf;
136 while !cur.is_empty() {
137 let before_tag = cur;
138 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
139 match tag.field_number() {
140 1u32 => {
141 if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
142 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
143 field_number: 1u32,
144 expected: 1u8,
145 actual: tag.wire_type() as u8,
146 });
147 }
148 view.value = ::buffa::types::decode_double(&mut cur)?;
149 }
150 _ => {
151 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
152 let span_len = before_tag.len() - cur.len();
153 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
154 }
155 }
156 }
157 ::core::result::Result::Ok(())
158 }
159}
160impl<'a> ::buffa::MessageView<'a> for DoubleValueView<'a> {
161 type Owned = DoubleValue;
162 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
163 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
164 }
165 fn decode_view_with_limit(
166 buf: &'a [u8],
167 depth: u32,
168 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
169 Self::_decode_depth(buf, depth)
170 }
171 #[allow(clippy::redundant_closure)]
173 fn to_owned_message(&self) -> DoubleValue {
174 #[allow(unused_imports)]
175 use ::buffa::alloc::string::ToString as _;
176 DoubleValue {
177 value: self.value,
178 __buffa_unknown_fields: self
179 .__buffa_unknown_fields
180 .to_owned()
181 .unwrap_or_default(),
182 ..::core::default::Default::default()
183 }
184 }
185}
186unsafe impl ::buffa::DefaultViewInstance for DoubleValueView<'static> {
187 fn default_view_instance() -> &'static Self {
188 static VALUE: ::buffa::__private::OnceBox<DoubleValueView<'static>> = ::buffa::__private::OnceBox::new();
189 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(DoubleValueView::default()))
190 }
191}
192unsafe impl<'a> ::buffa::HasDefaultViewInstance for DoubleValueView<'a> {
193 type Static = DoubleValueView<'static>;
194}
195#[derive(Clone, PartialEq, Default)]
196#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
197pub struct FloatValue {
198 pub value: f32,
200 #[doc(hidden)]
201 pub __buffa_unknown_fields: ::buffa::UnknownFields,
202 #[doc(hidden)]
203 pub __buffa_cached_size: ::buffa::__private::CachedSize,
204}
205impl ::core::fmt::Debug for FloatValue {
206 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
207 f.debug_struct("FloatValue").field("value", &self.value).finish()
208 }
209}
210impl FloatValue {
211 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
216}
217unsafe impl ::buffa::DefaultInstance for FloatValue {
218 fn default_instance() -> &'static Self {
219 static VALUE: ::buffa::__private::OnceBox<FloatValue> = ::buffa::__private::OnceBox::new();
220 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(FloatValue::default()))
221 }
222}
223impl ::buffa::Message for FloatValue {
224 fn compute_size(&self) -> u32 {
230 #[allow(unused_imports)]
231 use ::buffa::Enumeration as _;
232 let mut size = 0u32;
233 if self.value != 0f32 {
234 size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
235 }
236 size += self.__buffa_unknown_fields.encoded_len() as u32;
237 self.__buffa_cached_size.set(size);
238 size
239 }
240 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
241 #[allow(unused_imports)]
242 use ::buffa::Enumeration as _;
243 if self.value != 0f32 {
244 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
245 .encode(buf);
246 ::buffa::types::encode_float(self.value, buf);
247 }
248 self.__buffa_unknown_fields.write_to(buf);
249 }
250 fn merge_field(
251 &mut self,
252 tag: ::buffa::encoding::Tag,
253 buf: &mut impl ::buffa::bytes::Buf,
254 depth: u32,
255 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
256 #[allow(unused_imports)]
257 use ::buffa::bytes::Buf as _;
258 #[allow(unused_imports)]
259 use ::buffa::Enumeration as _;
260 match tag.field_number() {
261 1u32 => {
262 if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
263 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
264 field_number: 1u32,
265 expected: 5u8,
266 actual: tag.wire_type() as u8,
267 });
268 }
269 self.value = ::buffa::types::decode_float(buf)?;
270 }
271 _ => {
272 self.__buffa_unknown_fields
273 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
274 }
275 }
276 ::core::result::Result::Ok(())
277 }
278 fn cached_size(&self) -> u32 {
279 self.__buffa_cached_size.get()
280 }
281 fn clear(&mut self) {
282 self.value = 0f32;
283 self.__buffa_unknown_fields.clear();
284 self.__buffa_cached_size.set(0);
285 }
286}
287#[derive(Clone, Debug, Default)]
288pub struct FloatValueView<'a> {
289 pub value: f32,
291 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
292}
293impl<'a> FloatValueView<'a> {
294 #[doc(hidden)]
302 pub fn _decode_depth(
303 buf: &'a [u8],
304 depth: u32,
305 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
306 let mut view = Self::default();
307 view._merge_into_view(buf, depth)?;
308 ::core::result::Result::Ok(view)
309 }
310 #[doc(hidden)]
318 pub fn _merge_into_view(
319 &mut self,
320 buf: &'a [u8],
321 depth: u32,
322 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
323 let _ = depth;
324 #[allow(unused_variables)]
325 let view = self;
326 let mut cur: &'a [u8] = buf;
327 while !cur.is_empty() {
328 let before_tag = cur;
329 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
330 match tag.field_number() {
331 1u32 => {
332 if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
333 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
334 field_number: 1u32,
335 expected: 5u8,
336 actual: tag.wire_type() as u8,
337 });
338 }
339 view.value = ::buffa::types::decode_float(&mut cur)?;
340 }
341 _ => {
342 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
343 let span_len = before_tag.len() - cur.len();
344 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
345 }
346 }
347 }
348 ::core::result::Result::Ok(())
349 }
350}
351impl<'a> ::buffa::MessageView<'a> for FloatValueView<'a> {
352 type Owned = FloatValue;
353 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
354 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
355 }
356 fn decode_view_with_limit(
357 buf: &'a [u8],
358 depth: u32,
359 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
360 Self::_decode_depth(buf, depth)
361 }
362 #[allow(clippy::redundant_closure)]
364 fn to_owned_message(&self) -> FloatValue {
365 #[allow(unused_imports)]
366 use ::buffa::alloc::string::ToString as _;
367 FloatValue {
368 value: self.value,
369 __buffa_unknown_fields: self
370 .__buffa_unknown_fields
371 .to_owned()
372 .unwrap_or_default(),
373 ..::core::default::Default::default()
374 }
375 }
376}
377unsafe impl ::buffa::DefaultViewInstance for FloatValueView<'static> {
378 fn default_view_instance() -> &'static Self {
379 static VALUE: ::buffa::__private::OnceBox<FloatValueView<'static>> = ::buffa::__private::OnceBox::new();
380 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(FloatValueView::default()))
381 }
382}
383unsafe impl<'a> ::buffa::HasDefaultViewInstance for FloatValueView<'a> {
384 type Static = FloatValueView<'static>;
385}
386#[derive(Clone, PartialEq, Default)]
387#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
388pub struct Int64Value {
389 pub value: i64,
391 #[doc(hidden)]
392 pub __buffa_unknown_fields: ::buffa::UnknownFields,
393 #[doc(hidden)]
394 pub __buffa_cached_size: ::buffa::__private::CachedSize,
395}
396impl ::core::fmt::Debug for Int64Value {
397 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
398 f.debug_struct("Int64Value").field("value", &self.value).finish()
399 }
400}
401impl Int64Value {
402 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
407}
408unsafe impl ::buffa::DefaultInstance for Int64Value {
409 fn default_instance() -> &'static Self {
410 static VALUE: ::buffa::__private::OnceBox<Int64Value> = ::buffa::__private::OnceBox::new();
411 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Int64Value::default()))
412 }
413}
414impl ::buffa::Message for Int64Value {
415 fn compute_size(&self) -> u32 {
421 #[allow(unused_imports)]
422 use ::buffa::Enumeration as _;
423 let mut size = 0u32;
424 if self.value != 0i64 {
425 size += 1u32 + ::buffa::types::int64_encoded_len(self.value) as u32;
426 }
427 size += self.__buffa_unknown_fields.encoded_len() as u32;
428 self.__buffa_cached_size.set(size);
429 size
430 }
431 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
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 fn merge_field(
442 &mut self,
443 tag: ::buffa::encoding::Tag,
444 buf: &mut impl ::buffa::bytes::Buf,
445 depth: u32,
446 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
447 #[allow(unused_imports)]
448 use ::buffa::bytes::Buf as _;
449 #[allow(unused_imports)]
450 use ::buffa::Enumeration as _;
451 match tag.field_number() {
452 1u32 => {
453 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
454 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
455 field_number: 1u32,
456 expected: 0u8,
457 actual: tag.wire_type() as u8,
458 });
459 }
460 self.value = ::buffa::types::decode_int64(buf)?;
461 }
462 _ => {
463 self.__buffa_unknown_fields
464 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
465 }
466 }
467 ::core::result::Result::Ok(())
468 }
469 fn cached_size(&self) -> u32 {
470 self.__buffa_cached_size.get()
471 }
472 fn clear(&mut self) {
473 self.value = 0i64;
474 self.__buffa_unknown_fields.clear();
475 self.__buffa_cached_size.set(0);
476 }
477}
478#[derive(Clone, Debug, Default)]
479pub struct Int64ValueView<'a> {
480 pub value: i64,
482 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
483}
484impl<'a> Int64ValueView<'a> {
485 #[doc(hidden)]
493 pub fn _decode_depth(
494 buf: &'a [u8],
495 depth: u32,
496 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
497 let mut view = Self::default();
498 view._merge_into_view(buf, depth)?;
499 ::core::result::Result::Ok(view)
500 }
501 #[doc(hidden)]
509 pub fn _merge_into_view(
510 &mut self,
511 buf: &'a [u8],
512 depth: u32,
513 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
514 let _ = depth;
515 #[allow(unused_variables)]
516 let view = self;
517 let mut cur: &'a [u8] = buf;
518 while !cur.is_empty() {
519 let before_tag = cur;
520 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
521 match tag.field_number() {
522 1u32 => {
523 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
524 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
525 field_number: 1u32,
526 expected: 0u8,
527 actual: tag.wire_type() as u8,
528 });
529 }
530 view.value = ::buffa::types::decode_int64(&mut cur)?;
531 }
532 _ => {
533 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
534 let span_len = before_tag.len() - cur.len();
535 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
536 }
537 }
538 }
539 ::core::result::Result::Ok(())
540 }
541}
542impl<'a> ::buffa::MessageView<'a> for Int64ValueView<'a> {
543 type Owned = Int64Value;
544 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
545 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
546 }
547 fn decode_view_with_limit(
548 buf: &'a [u8],
549 depth: u32,
550 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
551 Self::_decode_depth(buf, depth)
552 }
553 #[allow(clippy::redundant_closure)]
555 fn to_owned_message(&self) -> Int64Value {
556 #[allow(unused_imports)]
557 use ::buffa::alloc::string::ToString as _;
558 Int64Value {
559 value: self.value,
560 __buffa_unknown_fields: self
561 .__buffa_unknown_fields
562 .to_owned()
563 .unwrap_or_default(),
564 ..::core::default::Default::default()
565 }
566 }
567}
568unsafe impl ::buffa::DefaultViewInstance for Int64ValueView<'static> {
569 fn default_view_instance() -> &'static Self {
570 static VALUE: ::buffa::__private::OnceBox<Int64ValueView<'static>> = ::buffa::__private::OnceBox::new();
571 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Int64ValueView::default()))
572 }
573}
574unsafe impl<'a> ::buffa::HasDefaultViewInstance for Int64ValueView<'a> {
575 type Static = Int64ValueView<'static>;
576}
577#[derive(Clone, PartialEq, Default)]
578#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
579pub struct UInt64Value {
580 pub value: u64,
582 #[doc(hidden)]
583 pub __buffa_unknown_fields: ::buffa::UnknownFields,
584 #[doc(hidden)]
585 pub __buffa_cached_size: ::buffa::__private::CachedSize,
586}
587impl ::core::fmt::Debug for UInt64Value {
588 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
589 f.debug_struct("UInt64Value").field("value", &self.value).finish()
590 }
591}
592impl UInt64Value {
593 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
598}
599unsafe impl ::buffa::DefaultInstance for UInt64Value {
600 fn default_instance() -> &'static Self {
601 static VALUE: ::buffa::__private::OnceBox<UInt64Value> = ::buffa::__private::OnceBox::new();
602 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(UInt64Value::default()))
603 }
604}
605impl ::buffa::Message for UInt64Value {
606 fn compute_size(&self) -> u32 {
612 #[allow(unused_imports)]
613 use ::buffa::Enumeration as _;
614 let mut size = 0u32;
615 if self.value != 0u64 {
616 size += 1u32 + ::buffa::types::uint64_encoded_len(self.value) as u32;
617 }
618 size += self.__buffa_unknown_fields.encoded_len() as u32;
619 self.__buffa_cached_size.set(size);
620 size
621 }
622 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
623 #[allow(unused_imports)]
624 use ::buffa::Enumeration as _;
625 if self.value != 0u64 {
626 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
627 .encode(buf);
628 ::buffa::types::encode_uint64(self.value, buf);
629 }
630 self.__buffa_unknown_fields.write_to(buf);
631 }
632 fn merge_field(
633 &mut self,
634 tag: ::buffa::encoding::Tag,
635 buf: &mut impl ::buffa::bytes::Buf,
636 depth: u32,
637 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
638 #[allow(unused_imports)]
639 use ::buffa::bytes::Buf as _;
640 #[allow(unused_imports)]
641 use ::buffa::Enumeration as _;
642 match tag.field_number() {
643 1u32 => {
644 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
645 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
646 field_number: 1u32,
647 expected: 0u8,
648 actual: tag.wire_type() as u8,
649 });
650 }
651 self.value = ::buffa::types::decode_uint64(buf)?;
652 }
653 _ => {
654 self.__buffa_unknown_fields
655 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
656 }
657 }
658 ::core::result::Result::Ok(())
659 }
660 fn cached_size(&self) -> u32 {
661 self.__buffa_cached_size.get()
662 }
663 fn clear(&mut self) {
664 self.value = 0u64;
665 self.__buffa_unknown_fields.clear();
666 self.__buffa_cached_size.set(0);
667 }
668}
669#[derive(Clone, Debug, Default)]
670pub struct UInt64ValueView<'a> {
671 pub value: u64,
673 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
674}
675impl<'a> UInt64ValueView<'a> {
676 #[doc(hidden)]
684 pub fn _decode_depth(
685 buf: &'a [u8],
686 depth: u32,
687 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
688 let mut view = Self::default();
689 view._merge_into_view(buf, depth)?;
690 ::core::result::Result::Ok(view)
691 }
692 #[doc(hidden)]
700 pub fn _merge_into_view(
701 &mut self,
702 buf: &'a [u8],
703 depth: u32,
704 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
705 let _ = depth;
706 #[allow(unused_variables)]
707 let view = self;
708 let mut cur: &'a [u8] = buf;
709 while !cur.is_empty() {
710 let before_tag = cur;
711 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
712 match tag.field_number() {
713 1u32 => {
714 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
715 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
716 field_number: 1u32,
717 expected: 0u8,
718 actual: tag.wire_type() as u8,
719 });
720 }
721 view.value = ::buffa::types::decode_uint64(&mut cur)?;
722 }
723 _ => {
724 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
725 let span_len = before_tag.len() - cur.len();
726 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
727 }
728 }
729 }
730 ::core::result::Result::Ok(())
731 }
732}
733impl<'a> ::buffa::MessageView<'a> for UInt64ValueView<'a> {
734 type Owned = UInt64Value;
735 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
736 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
737 }
738 fn decode_view_with_limit(
739 buf: &'a [u8],
740 depth: u32,
741 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
742 Self::_decode_depth(buf, depth)
743 }
744 #[allow(clippy::redundant_closure)]
746 fn to_owned_message(&self) -> UInt64Value {
747 #[allow(unused_imports)]
748 use ::buffa::alloc::string::ToString as _;
749 UInt64Value {
750 value: self.value,
751 __buffa_unknown_fields: self
752 .__buffa_unknown_fields
753 .to_owned()
754 .unwrap_or_default(),
755 ..::core::default::Default::default()
756 }
757 }
758}
759unsafe impl ::buffa::DefaultViewInstance for UInt64ValueView<'static> {
760 fn default_view_instance() -> &'static Self {
761 static VALUE: ::buffa::__private::OnceBox<UInt64ValueView<'static>> = ::buffa::__private::OnceBox::new();
762 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(UInt64ValueView::default()))
763 }
764}
765unsafe impl<'a> ::buffa::HasDefaultViewInstance for UInt64ValueView<'a> {
766 type Static = UInt64ValueView<'static>;
767}
768#[derive(Clone, PartialEq, Default)]
769#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
770pub struct Int32Value {
771 pub value: i32,
773 #[doc(hidden)]
774 pub __buffa_unknown_fields: ::buffa::UnknownFields,
775 #[doc(hidden)]
776 pub __buffa_cached_size: ::buffa::__private::CachedSize,
777}
778impl ::core::fmt::Debug for Int32Value {
779 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
780 f.debug_struct("Int32Value").field("value", &self.value).finish()
781 }
782}
783impl Int32Value {
784 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
789}
790unsafe impl ::buffa::DefaultInstance for Int32Value {
791 fn default_instance() -> &'static Self {
792 static VALUE: ::buffa::__private::OnceBox<Int32Value> = ::buffa::__private::OnceBox::new();
793 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Int32Value::default()))
794 }
795}
796impl ::buffa::Message for Int32Value {
797 fn compute_size(&self) -> u32 {
803 #[allow(unused_imports)]
804 use ::buffa::Enumeration as _;
805 let mut size = 0u32;
806 if self.value != 0i32 {
807 size += 1u32 + ::buffa::types::int32_encoded_len(self.value) as u32;
808 }
809 size += self.__buffa_unknown_fields.encoded_len() as u32;
810 self.__buffa_cached_size.set(size);
811 size
812 }
813 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
814 #[allow(unused_imports)]
815 use ::buffa::Enumeration as _;
816 if self.value != 0i32 {
817 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
818 .encode(buf);
819 ::buffa::types::encode_int32(self.value, buf);
820 }
821 self.__buffa_unknown_fields.write_to(buf);
822 }
823 fn merge_field(
824 &mut self,
825 tag: ::buffa::encoding::Tag,
826 buf: &mut impl ::buffa::bytes::Buf,
827 depth: u32,
828 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
829 #[allow(unused_imports)]
830 use ::buffa::bytes::Buf as _;
831 #[allow(unused_imports)]
832 use ::buffa::Enumeration as _;
833 match tag.field_number() {
834 1u32 => {
835 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
836 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
837 field_number: 1u32,
838 expected: 0u8,
839 actual: tag.wire_type() as u8,
840 });
841 }
842 self.value = ::buffa::types::decode_int32(buf)?;
843 }
844 _ => {
845 self.__buffa_unknown_fields
846 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
847 }
848 }
849 ::core::result::Result::Ok(())
850 }
851 fn cached_size(&self) -> u32 {
852 self.__buffa_cached_size.get()
853 }
854 fn clear(&mut self) {
855 self.value = 0i32;
856 self.__buffa_unknown_fields.clear();
857 self.__buffa_cached_size.set(0);
858 }
859}
860#[derive(Clone, Debug, Default)]
861pub struct Int32ValueView<'a> {
862 pub value: i32,
864 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
865}
866impl<'a> Int32ValueView<'a> {
867 #[doc(hidden)]
875 pub fn _decode_depth(
876 buf: &'a [u8],
877 depth: u32,
878 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
879 let mut view = Self::default();
880 view._merge_into_view(buf, depth)?;
881 ::core::result::Result::Ok(view)
882 }
883 #[doc(hidden)]
891 pub fn _merge_into_view(
892 &mut self,
893 buf: &'a [u8],
894 depth: u32,
895 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
896 let _ = depth;
897 #[allow(unused_variables)]
898 let view = self;
899 let mut cur: &'a [u8] = buf;
900 while !cur.is_empty() {
901 let before_tag = cur;
902 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
903 match tag.field_number() {
904 1u32 => {
905 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
906 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
907 field_number: 1u32,
908 expected: 0u8,
909 actual: tag.wire_type() as u8,
910 });
911 }
912 view.value = ::buffa::types::decode_int32(&mut cur)?;
913 }
914 _ => {
915 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
916 let span_len = before_tag.len() - cur.len();
917 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
918 }
919 }
920 }
921 ::core::result::Result::Ok(())
922 }
923}
924impl<'a> ::buffa::MessageView<'a> for Int32ValueView<'a> {
925 type Owned = Int32Value;
926 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
927 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
928 }
929 fn decode_view_with_limit(
930 buf: &'a [u8],
931 depth: u32,
932 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
933 Self::_decode_depth(buf, depth)
934 }
935 #[allow(clippy::redundant_closure)]
937 fn to_owned_message(&self) -> Int32Value {
938 #[allow(unused_imports)]
939 use ::buffa::alloc::string::ToString as _;
940 Int32Value {
941 value: self.value,
942 __buffa_unknown_fields: self
943 .__buffa_unknown_fields
944 .to_owned()
945 .unwrap_or_default(),
946 ..::core::default::Default::default()
947 }
948 }
949}
950unsafe impl ::buffa::DefaultViewInstance for Int32ValueView<'static> {
951 fn default_view_instance() -> &'static Self {
952 static VALUE: ::buffa::__private::OnceBox<Int32ValueView<'static>> = ::buffa::__private::OnceBox::new();
953 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Int32ValueView::default()))
954 }
955}
956unsafe impl<'a> ::buffa::HasDefaultViewInstance for Int32ValueView<'a> {
957 type Static = Int32ValueView<'static>;
958}
959#[derive(Clone, PartialEq, Default)]
960#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
961pub struct UInt32Value {
962 pub value: u32,
964 #[doc(hidden)]
965 pub __buffa_unknown_fields: ::buffa::UnknownFields,
966 #[doc(hidden)]
967 pub __buffa_cached_size: ::buffa::__private::CachedSize,
968}
969impl ::core::fmt::Debug for UInt32Value {
970 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
971 f.debug_struct("UInt32Value").field("value", &self.value).finish()
972 }
973}
974impl UInt32Value {
975 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
980}
981unsafe impl ::buffa::DefaultInstance for UInt32Value {
982 fn default_instance() -> &'static Self {
983 static VALUE: ::buffa::__private::OnceBox<UInt32Value> = ::buffa::__private::OnceBox::new();
984 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(UInt32Value::default()))
985 }
986}
987impl ::buffa::Message for UInt32Value {
988 fn compute_size(&self) -> u32 {
994 #[allow(unused_imports)]
995 use ::buffa::Enumeration as _;
996 let mut size = 0u32;
997 if self.value != 0u32 {
998 size += 1u32 + ::buffa::types::uint32_encoded_len(self.value) as u32;
999 }
1000 size += self.__buffa_unknown_fields.encoded_len() as u32;
1001 self.__buffa_cached_size.set(size);
1002 size
1003 }
1004 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1005 #[allow(unused_imports)]
1006 use ::buffa::Enumeration as _;
1007 if self.value != 0u32 {
1008 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1009 .encode(buf);
1010 ::buffa::types::encode_uint32(self.value, buf);
1011 }
1012 self.__buffa_unknown_fields.write_to(buf);
1013 }
1014 fn merge_field(
1015 &mut self,
1016 tag: ::buffa::encoding::Tag,
1017 buf: &mut impl ::buffa::bytes::Buf,
1018 depth: u32,
1019 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1020 #[allow(unused_imports)]
1021 use ::buffa::bytes::Buf as _;
1022 #[allow(unused_imports)]
1023 use ::buffa::Enumeration as _;
1024 match tag.field_number() {
1025 1u32 => {
1026 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1027 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1028 field_number: 1u32,
1029 expected: 0u8,
1030 actual: tag.wire_type() as u8,
1031 });
1032 }
1033 self.value = ::buffa::types::decode_uint32(buf)?;
1034 }
1035 _ => {
1036 self.__buffa_unknown_fields
1037 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1038 }
1039 }
1040 ::core::result::Result::Ok(())
1041 }
1042 fn cached_size(&self) -> u32 {
1043 self.__buffa_cached_size.get()
1044 }
1045 fn clear(&mut self) {
1046 self.value = 0u32;
1047 self.__buffa_unknown_fields.clear();
1048 self.__buffa_cached_size.set(0);
1049 }
1050}
1051#[derive(Clone, Debug, Default)]
1052pub struct UInt32ValueView<'a> {
1053 pub value: u32,
1055 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1056}
1057impl<'a> UInt32ValueView<'a> {
1058 #[doc(hidden)]
1066 pub fn _decode_depth(
1067 buf: &'a [u8],
1068 depth: u32,
1069 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1070 let mut view = Self::default();
1071 view._merge_into_view(buf, depth)?;
1072 ::core::result::Result::Ok(view)
1073 }
1074 #[doc(hidden)]
1082 pub fn _merge_into_view(
1083 &mut self,
1084 buf: &'a [u8],
1085 depth: u32,
1086 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1087 let _ = depth;
1088 #[allow(unused_variables)]
1089 let view = self;
1090 let mut cur: &'a [u8] = buf;
1091 while !cur.is_empty() {
1092 let before_tag = cur;
1093 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1094 match tag.field_number() {
1095 1u32 => {
1096 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1097 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1098 field_number: 1u32,
1099 expected: 0u8,
1100 actual: tag.wire_type() as u8,
1101 });
1102 }
1103 view.value = ::buffa::types::decode_uint32(&mut cur)?;
1104 }
1105 _ => {
1106 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1107 let span_len = before_tag.len() - cur.len();
1108 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1109 }
1110 }
1111 }
1112 ::core::result::Result::Ok(())
1113 }
1114}
1115impl<'a> ::buffa::MessageView<'a> for UInt32ValueView<'a> {
1116 type Owned = UInt32Value;
1117 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1118 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1119 }
1120 fn decode_view_with_limit(
1121 buf: &'a [u8],
1122 depth: u32,
1123 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1124 Self::_decode_depth(buf, depth)
1125 }
1126 #[allow(clippy::redundant_closure)]
1128 fn to_owned_message(&self) -> UInt32Value {
1129 #[allow(unused_imports)]
1130 use ::buffa::alloc::string::ToString as _;
1131 UInt32Value {
1132 value: self.value,
1133 __buffa_unknown_fields: self
1134 .__buffa_unknown_fields
1135 .to_owned()
1136 .unwrap_or_default(),
1137 ..::core::default::Default::default()
1138 }
1139 }
1140}
1141unsafe impl ::buffa::DefaultViewInstance for UInt32ValueView<'static> {
1142 fn default_view_instance() -> &'static Self {
1143 static VALUE: ::buffa::__private::OnceBox<UInt32ValueView<'static>> = ::buffa::__private::OnceBox::new();
1144 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(UInt32ValueView::default()))
1145 }
1146}
1147unsafe impl<'a> ::buffa::HasDefaultViewInstance for UInt32ValueView<'a> {
1148 type Static = UInt32ValueView<'static>;
1149}
1150#[derive(Clone, PartialEq, Default)]
1151#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1152pub struct BoolValue {
1153 pub value: bool,
1155 #[doc(hidden)]
1156 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1157 #[doc(hidden)]
1158 pub __buffa_cached_size: ::buffa::__private::CachedSize,
1159}
1160impl ::core::fmt::Debug for BoolValue {
1161 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1162 f.debug_struct("BoolValue").field("value", &self.value).finish()
1163 }
1164}
1165impl BoolValue {
1166 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
1171}
1172unsafe impl ::buffa::DefaultInstance for BoolValue {
1173 fn default_instance() -> &'static Self {
1174 static VALUE: ::buffa::__private::OnceBox<BoolValue> = ::buffa::__private::OnceBox::new();
1175 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(BoolValue::default()))
1176 }
1177}
1178impl ::buffa::Message for BoolValue {
1179 fn compute_size(&self) -> u32 {
1185 #[allow(unused_imports)]
1186 use ::buffa::Enumeration as _;
1187 let mut size = 0u32;
1188 if self.value {
1189 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1190 }
1191 size += self.__buffa_unknown_fields.encoded_len() as u32;
1192 self.__buffa_cached_size.set(size);
1193 size
1194 }
1195 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1196 #[allow(unused_imports)]
1197 use ::buffa::Enumeration as _;
1198 if self.value {
1199 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1200 .encode(buf);
1201 ::buffa::types::encode_bool(self.value, buf);
1202 }
1203 self.__buffa_unknown_fields.write_to(buf);
1204 }
1205 fn merge_field(
1206 &mut self,
1207 tag: ::buffa::encoding::Tag,
1208 buf: &mut impl ::buffa::bytes::Buf,
1209 depth: u32,
1210 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1211 #[allow(unused_imports)]
1212 use ::buffa::bytes::Buf as _;
1213 #[allow(unused_imports)]
1214 use ::buffa::Enumeration as _;
1215 match tag.field_number() {
1216 1u32 => {
1217 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1218 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1219 field_number: 1u32,
1220 expected: 0u8,
1221 actual: tag.wire_type() as u8,
1222 });
1223 }
1224 self.value = ::buffa::types::decode_bool(buf)?;
1225 }
1226 _ => {
1227 self.__buffa_unknown_fields
1228 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1229 }
1230 }
1231 ::core::result::Result::Ok(())
1232 }
1233 fn cached_size(&self) -> u32 {
1234 self.__buffa_cached_size.get()
1235 }
1236 fn clear(&mut self) {
1237 self.value = false;
1238 self.__buffa_unknown_fields.clear();
1239 self.__buffa_cached_size.set(0);
1240 }
1241}
1242#[derive(Clone, Debug, Default)]
1243pub struct BoolValueView<'a> {
1244 pub value: bool,
1246 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1247}
1248impl<'a> BoolValueView<'a> {
1249 #[doc(hidden)]
1257 pub fn _decode_depth(
1258 buf: &'a [u8],
1259 depth: u32,
1260 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1261 let mut view = Self::default();
1262 view._merge_into_view(buf, depth)?;
1263 ::core::result::Result::Ok(view)
1264 }
1265 #[doc(hidden)]
1273 pub fn _merge_into_view(
1274 &mut self,
1275 buf: &'a [u8],
1276 depth: u32,
1277 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1278 let _ = depth;
1279 #[allow(unused_variables)]
1280 let view = self;
1281 let mut cur: &'a [u8] = buf;
1282 while !cur.is_empty() {
1283 let before_tag = cur;
1284 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1285 match tag.field_number() {
1286 1u32 => {
1287 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1288 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1289 field_number: 1u32,
1290 expected: 0u8,
1291 actual: tag.wire_type() as u8,
1292 });
1293 }
1294 view.value = ::buffa::types::decode_bool(&mut cur)?;
1295 }
1296 _ => {
1297 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1298 let span_len = before_tag.len() - cur.len();
1299 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1300 }
1301 }
1302 }
1303 ::core::result::Result::Ok(())
1304 }
1305}
1306impl<'a> ::buffa::MessageView<'a> for BoolValueView<'a> {
1307 type Owned = BoolValue;
1308 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1309 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1310 }
1311 fn decode_view_with_limit(
1312 buf: &'a [u8],
1313 depth: u32,
1314 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1315 Self::_decode_depth(buf, depth)
1316 }
1317 #[allow(clippy::redundant_closure)]
1319 fn to_owned_message(&self) -> BoolValue {
1320 #[allow(unused_imports)]
1321 use ::buffa::alloc::string::ToString as _;
1322 BoolValue {
1323 value: self.value,
1324 __buffa_unknown_fields: self
1325 .__buffa_unknown_fields
1326 .to_owned()
1327 .unwrap_or_default(),
1328 ..::core::default::Default::default()
1329 }
1330 }
1331}
1332unsafe impl ::buffa::DefaultViewInstance for BoolValueView<'static> {
1333 fn default_view_instance() -> &'static Self {
1334 static VALUE: ::buffa::__private::OnceBox<BoolValueView<'static>> = ::buffa::__private::OnceBox::new();
1335 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(BoolValueView::default()))
1336 }
1337}
1338unsafe impl<'a> ::buffa::HasDefaultViewInstance for BoolValueView<'a> {
1339 type Static = BoolValueView<'static>;
1340}
1341#[derive(Clone, PartialEq, Default)]
1342#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1343pub struct StringValue {
1344 pub value: ::buffa::alloc::string::String,
1346 #[doc(hidden)]
1347 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1348 #[doc(hidden)]
1349 pub __buffa_cached_size: ::buffa::__private::CachedSize,
1350}
1351impl ::core::fmt::Debug for StringValue {
1352 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1353 f.debug_struct("StringValue").field("value", &self.value).finish()
1354 }
1355}
1356impl StringValue {
1357 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
1362}
1363unsafe impl ::buffa::DefaultInstance for StringValue {
1364 fn default_instance() -> &'static Self {
1365 static VALUE: ::buffa::__private::OnceBox<StringValue> = ::buffa::__private::OnceBox::new();
1366 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(StringValue::default()))
1367 }
1368}
1369impl ::buffa::Message for StringValue {
1370 fn compute_size(&self) -> u32 {
1376 #[allow(unused_imports)]
1377 use ::buffa::Enumeration as _;
1378 let mut size = 0u32;
1379 if !self.value.is_empty() {
1380 size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
1381 }
1382 size += self.__buffa_unknown_fields.encoded_len() as u32;
1383 self.__buffa_cached_size.set(size);
1384 size
1385 }
1386 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1387 #[allow(unused_imports)]
1388 use ::buffa::Enumeration as _;
1389 if !self.value.is_empty() {
1390 ::buffa::encoding::Tag::new(
1391 1u32,
1392 ::buffa::encoding::WireType::LengthDelimited,
1393 )
1394 .encode(buf);
1395 ::buffa::types::encode_string(&self.value, buf);
1396 }
1397 self.__buffa_unknown_fields.write_to(buf);
1398 }
1399 fn merge_field(
1400 &mut self,
1401 tag: ::buffa::encoding::Tag,
1402 buf: &mut impl ::buffa::bytes::Buf,
1403 depth: u32,
1404 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1405 #[allow(unused_imports)]
1406 use ::buffa::bytes::Buf as _;
1407 #[allow(unused_imports)]
1408 use ::buffa::Enumeration as _;
1409 match tag.field_number() {
1410 1u32 => {
1411 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1412 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1413 field_number: 1u32,
1414 expected: 2u8,
1415 actual: tag.wire_type() as u8,
1416 });
1417 }
1418 ::buffa::types::merge_string(&mut self.value, buf)?;
1419 }
1420 _ => {
1421 self.__buffa_unknown_fields
1422 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1423 }
1424 }
1425 ::core::result::Result::Ok(())
1426 }
1427 fn cached_size(&self) -> u32 {
1428 self.__buffa_cached_size.get()
1429 }
1430 fn clear(&mut self) {
1431 self.value.clear();
1432 self.__buffa_unknown_fields.clear();
1433 self.__buffa_cached_size.set(0);
1434 }
1435}
1436#[derive(Clone, Debug, Default)]
1437pub struct StringValueView<'a> {
1438 pub value: &'a str,
1440 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1441}
1442impl<'a> StringValueView<'a> {
1443 #[doc(hidden)]
1451 pub fn _decode_depth(
1452 buf: &'a [u8],
1453 depth: u32,
1454 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1455 let mut view = Self::default();
1456 view._merge_into_view(buf, depth)?;
1457 ::core::result::Result::Ok(view)
1458 }
1459 #[doc(hidden)]
1467 pub fn _merge_into_view(
1468 &mut self,
1469 buf: &'a [u8],
1470 depth: u32,
1471 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1472 let _ = depth;
1473 #[allow(unused_variables)]
1474 let view = self;
1475 let mut cur: &'a [u8] = buf;
1476 while !cur.is_empty() {
1477 let before_tag = cur;
1478 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1479 match tag.field_number() {
1480 1u32 => {
1481 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1482 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1483 field_number: 1u32,
1484 expected: 2u8,
1485 actual: tag.wire_type() as u8,
1486 });
1487 }
1488 view.value = ::buffa::types::borrow_str(&mut cur)?;
1489 }
1490 _ => {
1491 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1492 let span_len = before_tag.len() - cur.len();
1493 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1494 }
1495 }
1496 }
1497 ::core::result::Result::Ok(())
1498 }
1499}
1500impl<'a> ::buffa::MessageView<'a> for StringValueView<'a> {
1501 type Owned = StringValue;
1502 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1503 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1504 }
1505 fn decode_view_with_limit(
1506 buf: &'a [u8],
1507 depth: u32,
1508 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1509 Self::_decode_depth(buf, depth)
1510 }
1511 #[allow(clippy::redundant_closure)]
1513 fn to_owned_message(&self) -> StringValue {
1514 #[allow(unused_imports)]
1515 use ::buffa::alloc::string::ToString as _;
1516 StringValue {
1517 value: self.value.to_string(),
1518 __buffa_unknown_fields: self
1519 .__buffa_unknown_fields
1520 .to_owned()
1521 .unwrap_or_default(),
1522 ..::core::default::Default::default()
1523 }
1524 }
1525}
1526unsafe impl ::buffa::DefaultViewInstance for StringValueView<'static> {
1527 fn default_view_instance() -> &'static Self {
1528 static VALUE: ::buffa::__private::OnceBox<StringValueView<'static>> = ::buffa::__private::OnceBox::new();
1529 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(StringValueView::default()))
1530 }
1531}
1532unsafe impl<'a> ::buffa::HasDefaultViewInstance for StringValueView<'a> {
1533 type Static = StringValueView<'static>;
1534}
1535#[derive(Clone, PartialEq, Default)]
1536#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1537pub struct BytesValue {
1538 pub value: ::buffa::alloc::vec::Vec<u8>,
1540 #[doc(hidden)]
1541 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1542 #[doc(hidden)]
1543 pub __buffa_cached_size: ::buffa::__private::CachedSize,
1544}
1545impl ::core::fmt::Debug for BytesValue {
1546 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1547 f.debug_struct("BytesValue").field("value", &self.value).finish()
1548 }
1549}
1550impl BytesValue {
1551 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
1556}
1557unsafe impl ::buffa::DefaultInstance for BytesValue {
1558 fn default_instance() -> &'static Self {
1559 static VALUE: ::buffa::__private::OnceBox<BytesValue> = ::buffa::__private::OnceBox::new();
1560 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(BytesValue::default()))
1561 }
1562}
1563impl ::buffa::Message for BytesValue {
1564 fn compute_size(&self) -> u32 {
1570 #[allow(unused_imports)]
1571 use ::buffa::Enumeration as _;
1572 let mut size = 0u32;
1573 if !self.value.is_empty() {
1574 size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) as u32;
1575 }
1576 size += self.__buffa_unknown_fields.encoded_len() as u32;
1577 self.__buffa_cached_size.set(size);
1578 size
1579 }
1580 fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1581 #[allow(unused_imports)]
1582 use ::buffa::Enumeration as _;
1583 if !self.value.is_empty() {
1584 ::buffa::encoding::Tag::new(
1585 1u32,
1586 ::buffa::encoding::WireType::LengthDelimited,
1587 )
1588 .encode(buf);
1589 ::buffa::types::encode_bytes(&self.value, buf);
1590 }
1591 self.__buffa_unknown_fields.write_to(buf);
1592 }
1593 fn merge_field(
1594 &mut self,
1595 tag: ::buffa::encoding::Tag,
1596 buf: &mut impl ::buffa::bytes::Buf,
1597 depth: u32,
1598 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1599 #[allow(unused_imports)]
1600 use ::buffa::bytes::Buf as _;
1601 #[allow(unused_imports)]
1602 use ::buffa::Enumeration as _;
1603 match tag.field_number() {
1604 1u32 => {
1605 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1606 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1607 field_number: 1u32,
1608 expected: 2u8,
1609 actual: tag.wire_type() as u8,
1610 });
1611 }
1612 ::buffa::types::merge_bytes(&mut self.value, buf)?;
1613 }
1614 _ => {
1615 self.__buffa_unknown_fields
1616 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1617 }
1618 }
1619 ::core::result::Result::Ok(())
1620 }
1621 fn cached_size(&self) -> u32 {
1622 self.__buffa_cached_size.get()
1623 }
1624 fn clear(&mut self) {
1625 self.value.clear();
1626 self.__buffa_unknown_fields.clear();
1627 self.__buffa_cached_size.set(0);
1628 }
1629}
1630#[derive(Clone, Debug, Default)]
1631pub struct BytesValueView<'a> {
1632 pub value: &'a [u8],
1634 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1635}
1636impl<'a> BytesValueView<'a> {
1637 #[doc(hidden)]
1645 pub fn _decode_depth(
1646 buf: &'a [u8],
1647 depth: u32,
1648 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1649 let mut view = Self::default();
1650 view._merge_into_view(buf, depth)?;
1651 ::core::result::Result::Ok(view)
1652 }
1653 #[doc(hidden)]
1661 pub fn _merge_into_view(
1662 &mut self,
1663 buf: &'a [u8],
1664 depth: u32,
1665 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1666 let _ = depth;
1667 #[allow(unused_variables)]
1668 let view = self;
1669 let mut cur: &'a [u8] = buf;
1670 while !cur.is_empty() {
1671 let before_tag = cur;
1672 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1673 match tag.field_number() {
1674 1u32 => {
1675 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1676 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1677 field_number: 1u32,
1678 expected: 2u8,
1679 actual: tag.wire_type() as u8,
1680 });
1681 }
1682 view.value = ::buffa::types::borrow_bytes(&mut cur)?;
1683 }
1684 _ => {
1685 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1686 let span_len = before_tag.len() - cur.len();
1687 view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1688 }
1689 }
1690 }
1691 ::core::result::Result::Ok(())
1692 }
1693}
1694impl<'a> ::buffa::MessageView<'a> for BytesValueView<'a> {
1695 type Owned = BytesValue;
1696 fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1697 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1698 }
1699 fn decode_view_with_limit(
1700 buf: &'a [u8],
1701 depth: u32,
1702 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1703 Self::_decode_depth(buf, depth)
1704 }
1705 #[allow(clippy::redundant_closure)]
1707 fn to_owned_message(&self) -> BytesValue {
1708 #[allow(unused_imports)]
1709 use ::buffa::alloc::string::ToString as _;
1710 BytesValue {
1711 value: (self.value).to_vec(),
1712 __buffa_unknown_fields: self
1713 .__buffa_unknown_fields
1714 .to_owned()
1715 .unwrap_or_default(),
1716 ..::core::default::Default::default()
1717 }
1718 }
1719}
1720unsafe impl ::buffa::DefaultViewInstance for BytesValueView<'static> {
1721 fn default_view_instance() -> &'static Self {
1722 static VALUE: ::buffa::__private::OnceBox<BytesValueView<'static>> = ::buffa::__private::OnceBox::new();
1723 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(BytesValueView::default()))
1724 }
1725}
1726unsafe impl<'a> ::buffa::HasDefaultViewInstance for BytesValueView<'a> {
1727 type Static = BytesValueView<'static>;
1728}