1#[derive(Clone, PartialEq, Default)]
8#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
9pub struct DoubleValue {
10 pub value: f64,
14 #[doc(hidden)]
15 pub __buffa_unknown_fields: ::buffa::UnknownFields,
16}
17impl ::core::fmt::Debug for DoubleValue {
18 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19 f.debug_struct("DoubleValue").field("value", &self.value).finish()
20 }
21}
22impl DoubleValue {
23 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
28}
29impl ::buffa::DefaultInstance for DoubleValue {
30 fn default_instance() -> &'static Self {
31 static VALUE: ::buffa::__private::OnceBox<DoubleValue> = ::buffa::__private::OnceBox::new();
32 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
33 }
34}
35#[cfg(feature = "reflect")]
36const _: () = {
37 impl ::buffa_descriptor::reflect::ReflectMessage for DoubleValue {
38 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
39 __buffa::reflect::descriptor_pool()
40 .message(Self::__buffa_reflect_message_index())
41 }
42 fn pool(
43 &self,
44 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
45 __buffa::reflect::descriptor_pool()
46 }
47 fn unknown_fields(&self) -> &::buffa::UnknownFields {
48 &self.__buffa_unknown_fields
49 }
50 fn get(
51 &self,
52 field: &::buffa_descriptor::FieldDescriptor,
53 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
54 #[allow(unused_imports)]
55 use ::buffa::Enumeration as _;
56 match field.number() {
57 1u32 => ::buffa_descriptor::reflect::ValueRef::F64(self.value),
58 _ => {
59 ::core::debug_assert!(
60 false,
61 "field number {} is not a member of this message's reflect get()",
62 field.number(),
63 );
64 ::buffa_descriptor::reflect::ValueRef::Bool(false)
65 }
66 }
67 }
68 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
69 match field.number() {
70 1u32 => self.value != 0.0,
71 _ => false,
72 }
73 }
74 fn for_each_set(
75 &self,
76 f: &mut dyn ::core::ops::FnMut(
77 &::buffa_descriptor::FieldDescriptor,
78 ::buffa_descriptor::reflect::ValueRef<'_>,
79 ),
80 ) {
81 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
82 self,
83 );
84 for fd in md.fields() {
85 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
86 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
87 }
88 }
89 }
90 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
91 ::buffa_descriptor::reflect::DynamicMessage::from_message(
92 self,
93 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
94 Self::__buffa_reflect_message_index(),
95 )
96 }
97 }
98 impl ::buffa_descriptor::reflect::ReflectElement for DoubleValue {
99 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
100 ::buffa_descriptor::reflect::ValueRef::Message(
101 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
102 )
103 }
104 }
105 impl DoubleValue {
106 #[doc(hidden)]
109 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
110 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
111 *IDX
112 .get_or_init(|| {
113 __buffa::reflect::descriptor_pool()
114 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
115 .expect(
116 "generated message is registered in the embedded descriptor pool",
117 )
118 })
119 }
120 }
121 impl ::buffa_descriptor::reflect::Reflectable for DoubleValue {
122 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
126 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
127 }
128 }
129};
130impl ::buffa::MessageName for DoubleValue {
131 const PACKAGE: &'static str = "google.protobuf";
132 const NAME: &'static str = "DoubleValue";
133 const FULL_NAME: &'static str = "google.protobuf.DoubleValue";
134 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
135}
136impl ::buffa::Message for DoubleValue {
137 #[allow(clippy::let_and_return)]
143 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
144 #[allow(unused_imports)]
145 use ::buffa::Enumeration as _;
146 let mut size = 0u32;
147 if self.value.to_bits() != 0u64 {
148 size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
149 }
150 size += self.__buffa_unknown_fields.encoded_len() as u32;
151 size
152 }
153 fn write_to(
154 &self,
155 _cache: &mut ::buffa::SizeCache,
156 buf: &mut impl ::buffa::bytes::BufMut,
157 ) {
158 #[allow(unused_imports)]
159 use ::buffa::Enumeration as _;
160 if self.value.to_bits() != 0u64 {
161 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
162 .encode(buf);
163 ::buffa::types::encode_double(self.value, buf);
164 }
165 self.__buffa_unknown_fields.write_to(buf);
166 }
167 fn merge_field(
168 &mut self,
169 tag: ::buffa::encoding::Tag,
170 buf: &mut impl ::buffa::bytes::Buf,
171 depth: u32,
172 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
173 #[allow(unused_imports)]
174 use ::buffa::bytes::Buf as _;
175 #[allow(unused_imports)]
176 use ::buffa::Enumeration as _;
177 match tag.field_number() {
178 1u32 => {
179 if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
180 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
181 field_number: 1u32,
182 expected: 1u8,
183 actual: tag.wire_type() as u8,
184 });
185 }
186 self.value = ::buffa::types::decode_double(buf)?;
187 }
188 _ => {
189 self.__buffa_unknown_fields
190 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
191 }
192 }
193 ::core::result::Result::Ok(())
194 }
195 fn clear(&mut self) {
196 self.value = 0f64;
197 self.__buffa_unknown_fields.clear();
198 }
199}
200impl ::buffa::ExtensionSet for DoubleValue {
201 const PROTO_FQN: &'static str = "google.protobuf.DoubleValue";
202 fn unknown_fields(&self) -> &::buffa::UnknownFields {
203 &self.__buffa_unknown_fields
204 }
205 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
206 &mut self.__buffa_unknown_fields
207 }
208}
209impl ::buffa::text::TextFormat for DoubleValue {
210 fn encode_text(
211 &self,
212 enc: &mut ::buffa::text::TextEncoder<'_>,
213 ) -> ::core::fmt::Result {
214 #[allow(unused_imports)]
215 use ::buffa::Enumeration as _;
216 if self.value.to_bits() != 0u64 {
217 enc.write_field_name("value")?;
218 enc.write_f64(self.value)?;
219 }
220 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
221 ::core::result::Result::Ok(())
222 }
223 fn merge_text(
224 &mut self,
225 dec: &mut ::buffa::text::TextDecoder<'_>,
226 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
227 #[allow(unused_imports)]
228 use ::buffa::Enumeration as _;
229 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
230 match __name {
231 "value" => self.value = dec.read_f64()?,
232 _ => dec.skip_value()?,
233 }
234 }
235 ::core::result::Result::Ok(())
236 }
237}
238#[doc(hidden)]
239pub const __DOUBLE_VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
240 type_url: "type.googleapis.com/google.protobuf.DoubleValue",
241 text_encode: ::buffa::type_registry::any_encode_text::<DoubleValue>,
242 text_merge: ::buffa::type_registry::any_merge_text::<DoubleValue>,
243};
244#[derive(Clone, PartialEq, Default)]
248#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
249pub struct FloatValue {
250 pub value: f32,
254 #[doc(hidden)]
255 pub __buffa_unknown_fields: ::buffa::UnknownFields,
256}
257impl ::core::fmt::Debug for FloatValue {
258 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
259 f.debug_struct("FloatValue").field("value", &self.value).finish()
260 }
261}
262impl FloatValue {
263 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
268}
269impl ::buffa::DefaultInstance for FloatValue {
270 fn default_instance() -> &'static Self {
271 static VALUE: ::buffa::__private::OnceBox<FloatValue> = ::buffa::__private::OnceBox::new();
272 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
273 }
274}
275#[cfg(feature = "reflect")]
276const _: () = {
277 impl ::buffa_descriptor::reflect::ReflectMessage for FloatValue {
278 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
279 __buffa::reflect::descriptor_pool()
280 .message(Self::__buffa_reflect_message_index())
281 }
282 fn pool(
283 &self,
284 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
285 __buffa::reflect::descriptor_pool()
286 }
287 fn unknown_fields(&self) -> &::buffa::UnknownFields {
288 &self.__buffa_unknown_fields
289 }
290 fn get(
291 &self,
292 field: &::buffa_descriptor::FieldDescriptor,
293 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
294 #[allow(unused_imports)]
295 use ::buffa::Enumeration as _;
296 match field.number() {
297 1u32 => ::buffa_descriptor::reflect::ValueRef::F32(self.value),
298 _ => {
299 ::core::debug_assert!(
300 false,
301 "field number {} is not a member of this message's reflect get()",
302 field.number(),
303 );
304 ::buffa_descriptor::reflect::ValueRef::Bool(false)
305 }
306 }
307 }
308 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
309 match field.number() {
310 1u32 => self.value != 0.0,
311 _ => false,
312 }
313 }
314 fn for_each_set(
315 &self,
316 f: &mut dyn ::core::ops::FnMut(
317 &::buffa_descriptor::FieldDescriptor,
318 ::buffa_descriptor::reflect::ValueRef<'_>,
319 ),
320 ) {
321 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
322 self,
323 );
324 for fd in md.fields() {
325 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
326 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
327 }
328 }
329 }
330 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
331 ::buffa_descriptor::reflect::DynamicMessage::from_message(
332 self,
333 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
334 Self::__buffa_reflect_message_index(),
335 )
336 }
337 }
338 impl ::buffa_descriptor::reflect::ReflectElement for FloatValue {
339 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
340 ::buffa_descriptor::reflect::ValueRef::Message(
341 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
342 )
343 }
344 }
345 impl FloatValue {
346 #[doc(hidden)]
349 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
350 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
351 *IDX
352 .get_or_init(|| {
353 __buffa::reflect::descriptor_pool()
354 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
355 .expect(
356 "generated message is registered in the embedded descriptor pool",
357 )
358 })
359 }
360 }
361 impl ::buffa_descriptor::reflect::Reflectable for FloatValue {
362 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
366 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
367 }
368 }
369};
370impl ::buffa::MessageName for FloatValue {
371 const PACKAGE: &'static str = "google.protobuf";
372 const NAME: &'static str = "FloatValue";
373 const FULL_NAME: &'static str = "google.protobuf.FloatValue";
374 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
375}
376impl ::buffa::Message for FloatValue {
377 #[allow(clippy::let_and_return)]
383 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
384 #[allow(unused_imports)]
385 use ::buffa::Enumeration as _;
386 let mut size = 0u32;
387 if self.value.to_bits() != 0u32 {
388 size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
389 }
390 size += self.__buffa_unknown_fields.encoded_len() as u32;
391 size
392 }
393 fn write_to(
394 &self,
395 _cache: &mut ::buffa::SizeCache,
396 buf: &mut impl ::buffa::bytes::BufMut,
397 ) {
398 #[allow(unused_imports)]
399 use ::buffa::Enumeration as _;
400 if self.value.to_bits() != 0u32 {
401 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
402 .encode(buf);
403 ::buffa::types::encode_float(self.value, buf);
404 }
405 self.__buffa_unknown_fields.write_to(buf);
406 }
407 fn merge_field(
408 &mut self,
409 tag: ::buffa::encoding::Tag,
410 buf: &mut impl ::buffa::bytes::Buf,
411 depth: u32,
412 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
413 #[allow(unused_imports)]
414 use ::buffa::bytes::Buf as _;
415 #[allow(unused_imports)]
416 use ::buffa::Enumeration as _;
417 match tag.field_number() {
418 1u32 => {
419 if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
420 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
421 field_number: 1u32,
422 expected: 5u8,
423 actual: tag.wire_type() as u8,
424 });
425 }
426 self.value = ::buffa::types::decode_float(buf)?;
427 }
428 _ => {
429 self.__buffa_unknown_fields
430 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
431 }
432 }
433 ::core::result::Result::Ok(())
434 }
435 fn clear(&mut self) {
436 self.value = 0f32;
437 self.__buffa_unknown_fields.clear();
438 }
439}
440impl ::buffa::ExtensionSet for FloatValue {
441 const PROTO_FQN: &'static str = "google.protobuf.FloatValue";
442 fn unknown_fields(&self) -> &::buffa::UnknownFields {
443 &self.__buffa_unknown_fields
444 }
445 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
446 &mut self.__buffa_unknown_fields
447 }
448}
449impl ::buffa::text::TextFormat for FloatValue {
450 fn encode_text(
451 &self,
452 enc: &mut ::buffa::text::TextEncoder<'_>,
453 ) -> ::core::fmt::Result {
454 #[allow(unused_imports)]
455 use ::buffa::Enumeration as _;
456 if self.value.to_bits() != 0u32 {
457 enc.write_field_name("value")?;
458 enc.write_f32(self.value)?;
459 }
460 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
461 ::core::result::Result::Ok(())
462 }
463 fn merge_text(
464 &mut self,
465 dec: &mut ::buffa::text::TextDecoder<'_>,
466 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
467 #[allow(unused_imports)]
468 use ::buffa::Enumeration as _;
469 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
470 match __name {
471 "value" => self.value = dec.read_f32()?,
472 _ => dec.skip_value()?,
473 }
474 }
475 ::core::result::Result::Ok(())
476 }
477}
478#[doc(hidden)]
479pub const __FLOAT_VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
480 type_url: "type.googleapis.com/google.protobuf.FloatValue",
481 text_encode: ::buffa::type_registry::any_encode_text::<FloatValue>,
482 text_merge: ::buffa::type_registry::any_merge_text::<FloatValue>,
483};
484#[derive(Clone, PartialEq, Default)]
488#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
489pub struct Int64Value {
490 pub value: i64,
494 #[doc(hidden)]
495 pub __buffa_unknown_fields: ::buffa::UnknownFields,
496}
497impl ::core::fmt::Debug for Int64Value {
498 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
499 f.debug_struct("Int64Value").field("value", &self.value).finish()
500 }
501}
502impl Int64Value {
503 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
508}
509impl ::buffa::DefaultInstance for Int64Value {
510 fn default_instance() -> &'static Self {
511 static VALUE: ::buffa::__private::OnceBox<Int64Value> = ::buffa::__private::OnceBox::new();
512 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
513 }
514}
515#[cfg(feature = "reflect")]
516const _: () = {
517 impl ::buffa_descriptor::reflect::ReflectMessage for Int64Value {
518 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
519 __buffa::reflect::descriptor_pool()
520 .message(Self::__buffa_reflect_message_index())
521 }
522 fn pool(
523 &self,
524 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
525 __buffa::reflect::descriptor_pool()
526 }
527 fn unknown_fields(&self) -> &::buffa::UnknownFields {
528 &self.__buffa_unknown_fields
529 }
530 fn get(
531 &self,
532 field: &::buffa_descriptor::FieldDescriptor,
533 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
534 #[allow(unused_imports)]
535 use ::buffa::Enumeration as _;
536 match field.number() {
537 1u32 => ::buffa_descriptor::reflect::ValueRef::I64(self.value),
538 _ => {
539 ::core::debug_assert!(
540 false,
541 "field number {} is not a member of this message's reflect get()",
542 field.number(),
543 );
544 ::buffa_descriptor::reflect::ValueRef::Bool(false)
545 }
546 }
547 }
548 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
549 match field.number() {
550 1u32 => self.value != 0,
551 _ => false,
552 }
553 }
554 fn for_each_set(
555 &self,
556 f: &mut dyn ::core::ops::FnMut(
557 &::buffa_descriptor::FieldDescriptor,
558 ::buffa_descriptor::reflect::ValueRef<'_>,
559 ),
560 ) {
561 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
562 self,
563 );
564 for fd in md.fields() {
565 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
566 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
567 }
568 }
569 }
570 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
571 ::buffa_descriptor::reflect::DynamicMessage::from_message(
572 self,
573 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
574 Self::__buffa_reflect_message_index(),
575 )
576 }
577 }
578 impl ::buffa_descriptor::reflect::ReflectElement for Int64Value {
579 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
580 ::buffa_descriptor::reflect::ValueRef::Message(
581 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
582 )
583 }
584 }
585 impl Int64Value {
586 #[doc(hidden)]
589 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
590 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
591 *IDX
592 .get_or_init(|| {
593 __buffa::reflect::descriptor_pool()
594 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
595 .expect(
596 "generated message is registered in the embedded descriptor pool",
597 )
598 })
599 }
600 }
601 impl ::buffa_descriptor::reflect::Reflectable for Int64Value {
602 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
606 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
607 }
608 }
609};
610impl ::buffa::MessageName for Int64Value {
611 const PACKAGE: &'static str = "google.protobuf";
612 const NAME: &'static str = "Int64Value";
613 const FULL_NAME: &'static str = "google.protobuf.Int64Value";
614 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
615}
616impl ::buffa::Message for Int64Value {
617 #[allow(clippy::let_and_return)]
623 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
624 #[allow(unused_imports)]
625 use ::buffa::Enumeration as _;
626 let mut size = 0u32;
627 if self.value != 0i64 {
628 size += 1u32 + ::buffa::types::int64_encoded_len(self.value) as u32;
629 }
630 size += self.__buffa_unknown_fields.encoded_len() as u32;
631 size
632 }
633 fn write_to(
634 &self,
635 _cache: &mut ::buffa::SizeCache,
636 buf: &mut impl ::buffa::bytes::BufMut,
637 ) {
638 #[allow(unused_imports)]
639 use ::buffa::Enumeration as _;
640 if self.value != 0i64 {
641 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
642 .encode(buf);
643 ::buffa::types::encode_int64(self.value, buf);
644 }
645 self.__buffa_unknown_fields.write_to(buf);
646 }
647 fn merge_field(
648 &mut self,
649 tag: ::buffa::encoding::Tag,
650 buf: &mut impl ::buffa::bytes::Buf,
651 depth: u32,
652 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
653 #[allow(unused_imports)]
654 use ::buffa::bytes::Buf as _;
655 #[allow(unused_imports)]
656 use ::buffa::Enumeration as _;
657 match tag.field_number() {
658 1u32 => {
659 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
660 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
661 field_number: 1u32,
662 expected: 0u8,
663 actual: tag.wire_type() as u8,
664 });
665 }
666 self.value = ::buffa::types::decode_int64(buf)?;
667 }
668 _ => {
669 self.__buffa_unknown_fields
670 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
671 }
672 }
673 ::core::result::Result::Ok(())
674 }
675 fn clear(&mut self) {
676 self.value = 0i64;
677 self.__buffa_unknown_fields.clear();
678 }
679}
680impl ::buffa::ExtensionSet for Int64Value {
681 const PROTO_FQN: &'static str = "google.protobuf.Int64Value";
682 fn unknown_fields(&self) -> &::buffa::UnknownFields {
683 &self.__buffa_unknown_fields
684 }
685 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
686 &mut self.__buffa_unknown_fields
687 }
688}
689impl ::buffa::text::TextFormat for Int64Value {
690 fn encode_text(
691 &self,
692 enc: &mut ::buffa::text::TextEncoder<'_>,
693 ) -> ::core::fmt::Result {
694 #[allow(unused_imports)]
695 use ::buffa::Enumeration as _;
696 if self.value != 0i64 {
697 enc.write_field_name("value")?;
698 enc.write_i64(self.value)?;
699 }
700 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
701 ::core::result::Result::Ok(())
702 }
703 fn merge_text(
704 &mut self,
705 dec: &mut ::buffa::text::TextDecoder<'_>,
706 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
707 #[allow(unused_imports)]
708 use ::buffa::Enumeration as _;
709 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
710 match __name {
711 "value" => self.value = dec.read_i64()?,
712 _ => dec.skip_value()?,
713 }
714 }
715 ::core::result::Result::Ok(())
716 }
717}
718#[doc(hidden)]
719pub const __INT64VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
720 type_url: "type.googleapis.com/google.protobuf.Int64Value",
721 text_encode: ::buffa::type_registry::any_encode_text::<Int64Value>,
722 text_merge: ::buffa::type_registry::any_merge_text::<Int64Value>,
723};
724#[derive(Clone, PartialEq, Default)]
728#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
729pub struct UInt64Value {
730 pub value: u64,
734 #[doc(hidden)]
735 pub __buffa_unknown_fields: ::buffa::UnknownFields,
736}
737impl ::core::fmt::Debug for UInt64Value {
738 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
739 f.debug_struct("UInt64Value").field("value", &self.value).finish()
740 }
741}
742impl UInt64Value {
743 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
748}
749impl ::buffa::DefaultInstance for UInt64Value {
750 fn default_instance() -> &'static Self {
751 static VALUE: ::buffa::__private::OnceBox<UInt64Value> = ::buffa::__private::OnceBox::new();
752 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
753 }
754}
755#[cfg(feature = "reflect")]
756const _: () = {
757 impl ::buffa_descriptor::reflect::ReflectMessage for UInt64Value {
758 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
759 __buffa::reflect::descriptor_pool()
760 .message(Self::__buffa_reflect_message_index())
761 }
762 fn pool(
763 &self,
764 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
765 __buffa::reflect::descriptor_pool()
766 }
767 fn unknown_fields(&self) -> &::buffa::UnknownFields {
768 &self.__buffa_unknown_fields
769 }
770 fn get(
771 &self,
772 field: &::buffa_descriptor::FieldDescriptor,
773 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
774 #[allow(unused_imports)]
775 use ::buffa::Enumeration as _;
776 match field.number() {
777 1u32 => ::buffa_descriptor::reflect::ValueRef::U64(self.value),
778 _ => {
779 ::core::debug_assert!(
780 false,
781 "field number {} is not a member of this message's reflect get()",
782 field.number(),
783 );
784 ::buffa_descriptor::reflect::ValueRef::Bool(false)
785 }
786 }
787 }
788 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
789 match field.number() {
790 1u32 => self.value != 0,
791 _ => false,
792 }
793 }
794 fn for_each_set(
795 &self,
796 f: &mut dyn ::core::ops::FnMut(
797 &::buffa_descriptor::FieldDescriptor,
798 ::buffa_descriptor::reflect::ValueRef<'_>,
799 ),
800 ) {
801 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
802 self,
803 );
804 for fd in md.fields() {
805 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
806 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
807 }
808 }
809 }
810 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
811 ::buffa_descriptor::reflect::DynamicMessage::from_message(
812 self,
813 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
814 Self::__buffa_reflect_message_index(),
815 )
816 }
817 }
818 impl ::buffa_descriptor::reflect::ReflectElement for UInt64Value {
819 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
820 ::buffa_descriptor::reflect::ValueRef::Message(
821 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
822 )
823 }
824 }
825 impl UInt64Value {
826 #[doc(hidden)]
829 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
830 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
831 *IDX
832 .get_or_init(|| {
833 __buffa::reflect::descriptor_pool()
834 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
835 .expect(
836 "generated message is registered in the embedded descriptor pool",
837 )
838 })
839 }
840 }
841 impl ::buffa_descriptor::reflect::Reflectable for UInt64Value {
842 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
846 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
847 }
848 }
849};
850impl ::buffa::MessageName for UInt64Value {
851 const PACKAGE: &'static str = "google.protobuf";
852 const NAME: &'static str = "UInt64Value";
853 const FULL_NAME: &'static str = "google.protobuf.UInt64Value";
854 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
855}
856impl ::buffa::Message for UInt64Value {
857 #[allow(clippy::let_and_return)]
863 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
864 #[allow(unused_imports)]
865 use ::buffa::Enumeration as _;
866 let mut size = 0u32;
867 if self.value != 0u64 {
868 size += 1u32 + ::buffa::types::uint64_encoded_len(self.value) as u32;
869 }
870 size += self.__buffa_unknown_fields.encoded_len() as u32;
871 size
872 }
873 fn write_to(
874 &self,
875 _cache: &mut ::buffa::SizeCache,
876 buf: &mut impl ::buffa::bytes::BufMut,
877 ) {
878 #[allow(unused_imports)]
879 use ::buffa::Enumeration as _;
880 if self.value != 0u64 {
881 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
882 .encode(buf);
883 ::buffa::types::encode_uint64(self.value, buf);
884 }
885 self.__buffa_unknown_fields.write_to(buf);
886 }
887 fn merge_field(
888 &mut self,
889 tag: ::buffa::encoding::Tag,
890 buf: &mut impl ::buffa::bytes::Buf,
891 depth: u32,
892 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
893 #[allow(unused_imports)]
894 use ::buffa::bytes::Buf as _;
895 #[allow(unused_imports)]
896 use ::buffa::Enumeration as _;
897 match tag.field_number() {
898 1u32 => {
899 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
900 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
901 field_number: 1u32,
902 expected: 0u8,
903 actual: tag.wire_type() as u8,
904 });
905 }
906 self.value = ::buffa::types::decode_uint64(buf)?;
907 }
908 _ => {
909 self.__buffa_unknown_fields
910 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
911 }
912 }
913 ::core::result::Result::Ok(())
914 }
915 fn clear(&mut self) {
916 self.value = 0u64;
917 self.__buffa_unknown_fields.clear();
918 }
919}
920impl ::buffa::ExtensionSet for UInt64Value {
921 const PROTO_FQN: &'static str = "google.protobuf.UInt64Value";
922 fn unknown_fields(&self) -> &::buffa::UnknownFields {
923 &self.__buffa_unknown_fields
924 }
925 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
926 &mut self.__buffa_unknown_fields
927 }
928}
929impl ::buffa::text::TextFormat for UInt64Value {
930 fn encode_text(
931 &self,
932 enc: &mut ::buffa::text::TextEncoder<'_>,
933 ) -> ::core::fmt::Result {
934 #[allow(unused_imports)]
935 use ::buffa::Enumeration as _;
936 if self.value != 0u64 {
937 enc.write_field_name("value")?;
938 enc.write_u64(self.value)?;
939 }
940 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
941 ::core::result::Result::Ok(())
942 }
943 fn merge_text(
944 &mut self,
945 dec: &mut ::buffa::text::TextDecoder<'_>,
946 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
947 #[allow(unused_imports)]
948 use ::buffa::Enumeration as _;
949 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
950 match __name {
951 "value" => self.value = dec.read_u64()?,
952 _ => dec.skip_value()?,
953 }
954 }
955 ::core::result::Result::Ok(())
956 }
957}
958#[doc(hidden)]
959pub const __U_INT64VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
960 type_url: "type.googleapis.com/google.protobuf.UInt64Value",
961 text_encode: ::buffa::type_registry::any_encode_text::<UInt64Value>,
962 text_merge: ::buffa::type_registry::any_merge_text::<UInt64Value>,
963};
964#[derive(Clone, PartialEq, Default)]
968#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
969pub struct Int32Value {
970 pub value: i32,
974 #[doc(hidden)]
975 pub __buffa_unknown_fields: ::buffa::UnknownFields,
976}
977impl ::core::fmt::Debug for Int32Value {
978 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
979 f.debug_struct("Int32Value").field("value", &self.value).finish()
980 }
981}
982impl Int32Value {
983 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
988}
989impl ::buffa::DefaultInstance for Int32Value {
990 fn default_instance() -> &'static Self {
991 static VALUE: ::buffa::__private::OnceBox<Int32Value> = ::buffa::__private::OnceBox::new();
992 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
993 }
994}
995#[cfg(feature = "reflect")]
996const _: () = {
997 impl ::buffa_descriptor::reflect::ReflectMessage for Int32Value {
998 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
999 __buffa::reflect::descriptor_pool()
1000 .message(Self::__buffa_reflect_message_index())
1001 }
1002 fn pool(
1003 &self,
1004 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1005 __buffa::reflect::descriptor_pool()
1006 }
1007 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1008 &self.__buffa_unknown_fields
1009 }
1010 fn get(
1011 &self,
1012 field: &::buffa_descriptor::FieldDescriptor,
1013 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1014 #[allow(unused_imports)]
1015 use ::buffa::Enumeration as _;
1016 match field.number() {
1017 1u32 => ::buffa_descriptor::reflect::ValueRef::I32(self.value),
1018 _ => {
1019 ::core::debug_assert!(
1020 false,
1021 "field number {} is not a member of this message's reflect get()",
1022 field.number(),
1023 );
1024 ::buffa_descriptor::reflect::ValueRef::Bool(false)
1025 }
1026 }
1027 }
1028 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1029 match field.number() {
1030 1u32 => self.value != 0,
1031 _ => false,
1032 }
1033 }
1034 fn for_each_set(
1035 &self,
1036 f: &mut dyn ::core::ops::FnMut(
1037 &::buffa_descriptor::FieldDescriptor,
1038 ::buffa_descriptor::reflect::ValueRef<'_>,
1039 ),
1040 ) {
1041 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1042 self,
1043 );
1044 for fd in md.fields() {
1045 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1046 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1047 }
1048 }
1049 }
1050 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1051 ::buffa_descriptor::reflect::DynamicMessage::from_message(
1052 self,
1053 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
1054 Self::__buffa_reflect_message_index(),
1055 )
1056 }
1057 }
1058 impl ::buffa_descriptor::reflect::ReflectElement for Int32Value {
1059 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1060 ::buffa_descriptor::reflect::ValueRef::Message(
1061 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1062 )
1063 }
1064 }
1065 impl Int32Value {
1066 #[doc(hidden)]
1069 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1070 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1071 *IDX
1072 .get_or_init(|| {
1073 __buffa::reflect::descriptor_pool()
1074 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1075 .expect(
1076 "generated message is registered in the embedded descriptor pool",
1077 )
1078 })
1079 }
1080 }
1081 impl ::buffa_descriptor::reflect::Reflectable for Int32Value {
1082 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
1086 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
1087 }
1088 }
1089};
1090impl ::buffa::MessageName for Int32Value {
1091 const PACKAGE: &'static str = "google.protobuf";
1092 const NAME: &'static str = "Int32Value";
1093 const FULL_NAME: &'static str = "google.protobuf.Int32Value";
1094 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
1095}
1096impl ::buffa::Message for Int32Value {
1097 #[allow(clippy::let_and_return)]
1103 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1104 #[allow(unused_imports)]
1105 use ::buffa::Enumeration as _;
1106 let mut size = 0u32;
1107 if self.value != 0i32 {
1108 size += 1u32 + ::buffa::types::int32_encoded_len(self.value) as u32;
1109 }
1110 size += self.__buffa_unknown_fields.encoded_len() as u32;
1111 size
1112 }
1113 fn write_to(
1114 &self,
1115 _cache: &mut ::buffa::SizeCache,
1116 buf: &mut impl ::buffa::bytes::BufMut,
1117 ) {
1118 #[allow(unused_imports)]
1119 use ::buffa::Enumeration as _;
1120 if self.value != 0i32 {
1121 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1122 .encode(buf);
1123 ::buffa::types::encode_int32(self.value, buf);
1124 }
1125 self.__buffa_unknown_fields.write_to(buf);
1126 }
1127 fn merge_field(
1128 &mut self,
1129 tag: ::buffa::encoding::Tag,
1130 buf: &mut impl ::buffa::bytes::Buf,
1131 depth: u32,
1132 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1133 #[allow(unused_imports)]
1134 use ::buffa::bytes::Buf as _;
1135 #[allow(unused_imports)]
1136 use ::buffa::Enumeration as _;
1137 match tag.field_number() {
1138 1u32 => {
1139 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1140 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1141 field_number: 1u32,
1142 expected: 0u8,
1143 actual: tag.wire_type() as u8,
1144 });
1145 }
1146 self.value = ::buffa::types::decode_int32(buf)?;
1147 }
1148 _ => {
1149 self.__buffa_unknown_fields
1150 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1151 }
1152 }
1153 ::core::result::Result::Ok(())
1154 }
1155 fn clear(&mut self) {
1156 self.value = 0i32;
1157 self.__buffa_unknown_fields.clear();
1158 }
1159}
1160impl ::buffa::ExtensionSet for Int32Value {
1161 const PROTO_FQN: &'static str = "google.protobuf.Int32Value";
1162 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1163 &self.__buffa_unknown_fields
1164 }
1165 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1166 &mut self.__buffa_unknown_fields
1167 }
1168}
1169impl ::buffa::text::TextFormat for Int32Value {
1170 fn encode_text(
1171 &self,
1172 enc: &mut ::buffa::text::TextEncoder<'_>,
1173 ) -> ::core::fmt::Result {
1174 #[allow(unused_imports)]
1175 use ::buffa::Enumeration as _;
1176 if self.value != 0i32 {
1177 enc.write_field_name("value")?;
1178 enc.write_i32(self.value)?;
1179 }
1180 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1181 ::core::result::Result::Ok(())
1182 }
1183 fn merge_text(
1184 &mut self,
1185 dec: &mut ::buffa::text::TextDecoder<'_>,
1186 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1187 #[allow(unused_imports)]
1188 use ::buffa::Enumeration as _;
1189 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1190 match __name {
1191 "value" => self.value = dec.read_i32()?,
1192 _ => dec.skip_value()?,
1193 }
1194 }
1195 ::core::result::Result::Ok(())
1196 }
1197}
1198#[doc(hidden)]
1199pub const __INT32VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1200 type_url: "type.googleapis.com/google.protobuf.Int32Value",
1201 text_encode: ::buffa::type_registry::any_encode_text::<Int32Value>,
1202 text_merge: ::buffa::type_registry::any_merge_text::<Int32Value>,
1203};
1204#[derive(Clone, PartialEq, Default)]
1208#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1209pub struct UInt32Value {
1210 pub value: u32,
1214 #[doc(hidden)]
1215 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1216}
1217impl ::core::fmt::Debug for UInt32Value {
1218 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1219 f.debug_struct("UInt32Value").field("value", &self.value).finish()
1220 }
1221}
1222impl UInt32Value {
1223 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
1228}
1229impl ::buffa::DefaultInstance for UInt32Value {
1230 fn default_instance() -> &'static Self {
1231 static VALUE: ::buffa::__private::OnceBox<UInt32Value> = ::buffa::__private::OnceBox::new();
1232 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1233 }
1234}
1235#[cfg(feature = "reflect")]
1236const _: () = {
1237 impl ::buffa_descriptor::reflect::ReflectMessage for UInt32Value {
1238 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1239 __buffa::reflect::descriptor_pool()
1240 .message(Self::__buffa_reflect_message_index())
1241 }
1242 fn pool(
1243 &self,
1244 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1245 __buffa::reflect::descriptor_pool()
1246 }
1247 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1248 &self.__buffa_unknown_fields
1249 }
1250 fn get(
1251 &self,
1252 field: &::buffa_descriptor::FieldDescriptor,
1253 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1254 #[allow(unused_imports)]
1255 use ::buffa::Enumeration as _;
1256 match field.number() {
1257 1u32 => ::buffa_descriptor::reflect::ValueRef::U32(self.value),
1258 _ => {
1259 ::core::debug_assert!(
1260 false,
1261 "field number {} is not a member of this message's reflect get()",
1262 field.number(),
1263 );
1264 ::buffa_descriptor::reflect::ValueRef::Bool(false)
1265 }
1266 }
1267 }
1268 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1269 match field.number() {
1270 1u32 => self.value != 0,
1271 _ => false,
1272 }
1273 }
1274 fn for_each_set(
1275 &self,
1276 f: &mut dyn ::core::ops::FnMut(
1277 &::buffa_descriptor::FieldDescriptor,
1278 ::buffa_descriptor::reflect::ValueRef<'_>,
1279 ),
1280 ) {
1281 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1282 self,
1283 );
1284 for fd in md.fields() {
1285 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1286 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1287 }
1288 }
1289 }
1290 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1291 ::buffa_descriptor::reflect::DynamicMessage::from_message(
1292 self,
1293 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
1294 Self::__buffa_reflect_message_index(),
1295 )
1296 }
1297 }
1298 impl ::buffa_descriptor::reflect::ReflectElement for UInt32Value {
1299 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1300 ::buffa_descriptor::reflect::ValueRef::Message(
1301 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1302 )
1303 }
1304 }
1305 impl UInt32Value {
1306 #[doc(hidden)]
1309 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1310 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1311 *IDX
1312 .get_or_init(|| {
1313 __buffa::reflect::descriptor_pool()
1314 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1315 .expect(
1316 "generated message is registered in the embedded descriptor pool",
1317 )
1318 })
1319 }
1320 }
1321 impl ::buffa_descriptor::reflect::Reflectable for UInt32Value {
1322 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
1326 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
1327 }
1328 }
1329};
1330impl ::buffa::MessageName for UInt32Value {
1331 const PACKAGE: &'static str = "google.protobuf";
1332 const NAME: &'static str = "UInt32Value";
1333 const FULL_NAME: &'static str = "google.protobuf.UInt32Value";
1334 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
1335}
1336impl ::buffa::Message for UInt32Value {
1337 #[allow(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 != 0u32 {
1348 size += 1u32 + ::buffa::types::uint32_encoded_len(self.value) as u32;
1349 }
1350 size += self.__buffa_unknown_fields.encoded_len() as u32;
1351 size
1352 }
1353 fn write_to(
1354 &self,
1355 _cache: &mut ::buffa::SizeCache,
1356 buf: &mut impl ::buffa::bytes::BufMut,
1357 ) {
1358 #[allow(unused_imports)]
1359 use ::buffa::Enumeration as _;
1360 if self.value != 0u32 {
1361 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1362 .encode(buf);
1363 ::buffa::types::encode_uint32(self.value, buf);
1364 }
1365 self.__buffa_unknown_fields.write_to(buf);
1366 }
1367 fn merge_field(
1368 &mut self,
1369 tag: ::buffa::encoding::Tag,
1370 buf: &mut impl ::buffa::bytes::Buf,
1371 depth: u32,
1372 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1373 #[allow(unused_imports)]
1374 use ::buffa::bytes::Buf as _;
1375 #[allow(unused_imports)]
1376 use ::buffa::Enumeration as _;
1377 match tag.field_number() {
1378 1u32 => {
1379 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1380 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1381 field_number: 1u32,
1382 expected: 0u8,
1383 actual: tag.wire_type() as u8,
1384 });
1385 }
1386 self.value = ::buffa::types::decode_uint32(buf)?;
1387 }
1388 _ => {
1389 self.__buffa_unknown_fields
1390 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1391 }
1392 }
1393 ::core::result::Result::Ok(())
1394 }
1395 fn clear(&mut self) {
1396 self.value = 0u32;
1397 self.__buffa_unknown_fields.clear();
1398 }
1399}
1400impl ::buffa::ExtensionSet for UInt32Value {
1401 const PROTO_FQN: &'static str = "google.protobuf.UInt32Value";
1402 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1403 &self.__buffa_unknown_fields
1404 }
1405 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1406 &mut self.__buffa_unknown_fields
1407 }
1408}
1409impl ::buffa::text::TextFormat for UInt32Value {
1410 fn encode_text(
1411 &self,
1412 enc: &mut ::buffa::text::TextEncoder<'_>,
1413 ) -> ::core::fmt::Result {
1414 #[allow(unused_imports)]
1415 use ::buffa::Enumeration as _;
1416 if self.value != 0u32 {
1417 enc.write_field_name("value")?;
1418 enc.write_u32(self.value)?;
1419 }
1420 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1421 ::core::result::Result::Ok(())
1422 }
1423 fn merge_text(
1424 &mut self,
1425 dec: &mut ::buffa::text::TextDecoder<'_>,
1426 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1427 #[allow(unused_imports)]
1428 use ::buffa::Enumeration as _;
1429 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1430 match __name {
1431 "value" => self.value = dec.read_u32()?,
1432 _ => dec.skip_value()?,
1433 }
1434 }
1435 ::core::result::Result::Ok(())
1436 }
1437}
1438#[doc(hidden)]
1439pub const __U_INT32VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1440 type_url: "type.googleapis.com/google.protobuf.UInt32Value",
1441 text_encode: ::buffa::type_registry::any_encode_text::<UInt32Value>,
1442 text_merge: ::buffa::type_registry::any_merge_text::<UInt32Value>,
1443};
1444#[derive(Clone, PartialEq, Default)]
1448#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1449pub struct BoolValue {
1450 pub value: bool,
1454 #[doc(hidden)]
1455 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1456}
1457impl ::core::fmt::Debug for BoolValue {
1458 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1459 f.debug_struct("BoolValue").field("value", &self.value).finish()
1460 }
1461}
1462impl BoolValue {
1463 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
1468}
1469impl ::buffa::DefaultInstance for BoolValue {
1470 fn default_instance() -> &'static Self {
1471 static VALUE: ::buffa::__private::OnceBox<BoolValue> = ::buffa::__private::OnceBox::new();
1472 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1473 }
1474}
1475#[cfg(feature = "reflect")]
1476const _: () = {
1477 impl ::buffa_descriptor::reflect::ReflectMessage for BoolValue {
1478 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1479 __buffa::reflect::descriptor_pool()
1480 .message(Self::__buffa_reflect_message_index())
1481 }
1482 fn pool(
1483 &self,
1484 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1485 __buffa::reflect::descriptor_pool()
1486 }
1487 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1488 &self.__buffa_unknown_fields
1489 }
1490 fn get(
1491 &self,
1492 field: &::buffa_descriptor::FieldDescriptor,
1493 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1494 #[allow(unused_imports)]
1495 use ::buffa::Enumeration as _;
1496 match field.number() {
1497 1u32 => ::buffa_descriptor::reflect::ValueRef::Bool(self.value),
1498 _ => {
1499 ::core::debug_assert!(
1500 false,
1501 "field number {} is not a member of this message's reflect get()",
1502 field.number(),
1503 );
1504 ::buffa_descriptor::reflect::ValueRef::Bool(false)
1505 }
1506 }
1507 }
1508 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1509 match field.number() {
1510 1u32 => self.value,
1511 _ => false,
1512 }
1513 }
1514 fn for_each_set(
1515 &self,
1516 f: &mut dyn ::core::ops::FnMut(
1517 &::buffa_descriptor::FieldDescriptor,
1518 ::buffa_descriptor::reflect::ValueRef<'_>,
1519 ),
1520 ) {
1521 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1522 self,
1523 );
1524 for fd in md.fields() {
1525 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1526 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1527 }
1528 }
1529 }
1530 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1531 ::buffa_descriptor::reflect::DynamicMessage::from_message(
1532 self,
1533 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
1534 Self::__buffa_reflect_message_index(),
1535 )
1536 }
1537 }
1538 impl ::buffa_descriptor::reflect::ReflectElement for BoolValue {
1539 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1540 ::buffa_descriptor::reflect::ValueRef::Message(
1541 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1542 )
1543 }
1544 }
1545 impl BoolValue {
1546 #[doc(hidden)]
1549 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1550 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1551 *IDX
1552 .get_or_init(|| {
1553 __buffa::reflect::descriptor_pool()
1554 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1555 .expect(
1556 "generated message is registered in the embedded descriptor pool",
1557 )
1558 })
1559 }
1560 }
1561 impl ::buffa_descriptor::reflect::Reflectable for BoolValue {
1562 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
1566 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
1567 }
1568 }
1569};
1570impl ::buffa::MessageName for BoolValue {
1571 const PACKAGE: &'static str = "google.protobuf";
1572 const NAME: &'static str = "BoolValue";
1573 const FULL_NAME: &'static str = "google.protobuf.BoolValue";
1574 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
1575}
1576impl ::buffa::Message for BoolValue {
1577 #[allow(clippy::let_and_return)]
1583 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1584 #[allow(unused_imports)]
1585 use ::buffa::Enumeration as _;
1586 let mut size = 0u32;
1587 if self.value {
1588 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1589 }
1590 size += self.__buffa_unknown_fields.encoded_len() as u32;
1591 size
1592 }
1593 fn write_to(
1594 &self,
1595 _cache: &mut ::buffa::SizeCache,
1596 buf: &mut impl ::buffa::bytes::BufMut,
1597 ) {
1598 #[allow(unused_imports)]
1599 use ::buffa::Enumeration as _;
1600 if self.value {
1601 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1602 .encode(buf);
1603 ::buffa::types::encode_bool(self.value, buf);
1604 }
1605 self.__buffa_unknown_fields.write_to(buf);
1606 }
1607 fn merge_field(
1608 &mut self,
1609 tag: ::buffa::encoding::Tag,
1610 buf: &mut impl ::buffa::bytes::Buf,
1611 depth: u32,
1612 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1613 #[allow(unused_imports)]
1614 use ::buffa::bytes::Buf as _;
1615 #[allow(unused_imports)]
1616 use ::buffa::Enumeration as _;
1617 match tag.field_number() {
1618 1u32 => {
1619 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1620 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1621 field_number: 1u32,
1622 expected: 0u8,
1623 actual: tag.wire_type() as u8,
1624 });
1625 }
1626 self.value = ::buffa::types::decode_bool(buf)?;
1627 }
1628 _ => {
1629 self.__buffa_unknown_fields
1630 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1631 }
1632 }
1633 ::core::result::Result::Ok(())
1634 }
1635 fn clear(&mut self) {
1636 self.value = false;
1637 self.__buffa_unknown_fields.clear();
1638 }
1639}
1640impl ::buffa::ExtensionSet for BoolValue {
1641 const PROTO_FQN: &'static str = "google.protobuf.BoolValue";
1642 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1643 &self.__buffa_unknown_fields
1644 }
1645 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1646 &mut self.__buffa_unknown_fields
1647 }
1648}
1649impl ::buffa::text::TextFormat for BoolValue {
1650 fn encode_text(
1651 &self,
1652 enc: &mut ::buffa::text::TextEncoder<'_>,
1653 ) -> ::core::fmt::Result {
1654 #[allow(unused_imports)]
1655 use ::buffa::Enumeration as _;
1656 if self.value {
1657 enc.write_field_name("value")?;
1658 enc.write_bool(self.value)?;
1659 }
1660 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1661 ::core::result::Result::Ok(())
1662 }
1663 fn merge_text(
1664 &mut self,
1665 dec: &mut ::buffa::text::TextDecoder<'_>,
1666 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1667 #[allow(unused_imports)]
1668 use ::buffa::Enumeration as _;
1669 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1670 match __name {
1671 "value" => self.value = dec.read_bool()?,
1672 _ => dec.skip_value()?,
1673 }
1674 }
1675 ::core::result::Result::Ok(())
1676 }
1677}
1678#[doc(hidden)]
1679pub const __BOOL_VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1680 type_url: "type.googleapis.com/google.protobuf.BoolValue",
1681 text_encode: ::buffa::type_registry::any_encode_text::<BoolValue>,
1682 text_merge: ::buffa::type_registry::any_merge_text::<BoolValue>,
1683};
1684#[derive(Clone, PartialEq, Default)]
1688#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1689pub struct StringValue {
1690 pub value: ::buffa::alloc::string::String,
1694 #[doc(hidden)]
1695 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1696}
1697impl ::core::fmt::Debug for StringValue {
1698 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1699 f.debug_struct("StringValue").field("value", &self.value).finish()
1700 }
1701}
1702impl StringValue {
1703 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
1708}
1709impl ::buffa::DefaultInstance for StringValue {
1710 fn default_instance() -> &'static Self {
1711 static VALUE: ::buffa::__private::OnceBox<StringValue> = ::buffa::__private::OnceBox::new();
1712 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1713 }
1714}
1715#[cfg(feature = "reflect")]
1716const _: () = {
1717 impl ::buffa_descriptor::reflect::ReflectMessage for StringValue {
1718 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1719 __buffa::reflect::descriptor_pool()
1720 .message(Self::__buffa_reflect_message_index())
1721 }
1722 fn pool(
1723 &self,
1724 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1725 __buffa::reflect::descriptor_pool()
1726 }
1727 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1728 &self.__buffa_unknown_fields
1729 }
1730 fn get(
1731 &self,
1732 field: &::buffa_descriptor::FieldDescriptor,
1733 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1734 #[allow(unused_imports)]
1735 use ::buffa::Enumeration as _;
1736 match field.number() {
1737 1u32 => ::buffa_descriptor::reflect::ValueRef::String(&self.value),
1738 _ => {
1739 ::core::debug_assert!(
1740 false,
1741 "field number {} is not a member of this message's reflect get()",
1742 field.number(),
1743 );
1744 ::buffa_descriptor::reflect::ValueRef::Bool(false)
1745 }
1746 }
1747 }
1748 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1749 match field.number() {
1750 1u32 => !self.value.is_empty(),
1751 _ => false,
1752 }
1753 }
1754 fn for_each_set(
1755 &self,
1756 f: &mut dyn ::core::ops::FnMut(
1757 &::buffa_descriptor::FieldDescriptor,
1758 ::buffa_descriptor::reflect::ValueRef<'_>,
1759 ),
1760 ) {
1761 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
1762 self,
1763 );
1764 for fd in md.fields() {
1765 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
1766 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
1767 }
1768 }
1769 }
1770 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
1771 ::buffa_descriptor::reflect::DynamicMessage::from_message(
1772 self,
1773 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
1774 Self::__buffa_reflect_message_index(),
1775 )
1776 }
1777 }
1778 impl ::buffa_descriptor::reflect::ReflectElement for StringValue {
1779 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1780 ::buffa_descriptor::reflect::ValueRef::Message(
1781 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
1782 )
1783 }
1784 }
1785 impl StringValue {
1786 #[doc(hidden)]
1789 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
1790 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
1791 *IDX
1792 .get_or_init(|| {
1793 __buffa::reflect::descriptor_pool()
1794 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
1795 .expect(
1796 "generated message is registered in the embedded descriptor pool",
1797 )
1798 })
1799 }
1800 }
1801 impl ::buffa_descriptor::reflect::Reflectable for StringValue {
1802 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
1806 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
1807 }
1808 }
1809};
1810impl ::buffa::MessageName for StringValue {
1811 const PACKAGE: &'static str = "google.protobuf";
1812 const NAME: &'static str = "StringValue";
1813 const FULL_NAME: &'static str = "google.protobuf.StringValue";
1814 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
1815}
1816impl ::buffa::Message for StringValue {
1817 #[allow(clippy::let_and_return)]
1823 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1824 #[allow(unused_imports)]
1825 use ::buffa::Enumeration as _;
1826 let mut size = 0u32;
1827 if !self.value.is_empty() {
1828 size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
1829 }
1830 size += self.__buffa_unknown_fields.encoded_len() as u32;
1831 size
1832 }
1833 fn write_to(
1834 &self,
1835 _cache: &mut ::buffa::SizeCache,
1836 buf: &mut impl ::buffa::bytes::BufMut,
1837 ) {
1838 #[allow(unused_imports)]
1839 use ::buffa::Enumeration as _;
1840 if !self.value.is_empty() {
1841 ::buffa::encoding::Tag::new(
1842 1u32,
1843 ::buffa::encoding::WireType::LengthDelimited,
1844 )
1845 .encode(buf);
1846 ::buffa::types::encode_string(&self.value, buf);
1847 }
1848 self.__buffa_unknown_fields.write_to(buf);
1849 }
1850 fn merge_field(
1851 &mut self,
1852 tag: ::buffa::encoding::Tag,
1853 buf: &mut impl ::buffa::bytes::Buf,
1854 depth: u32,
1855 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1856 #[allow(unused_imports)]
1857 use ::buffa::bytes::Buf as _;
1858 #[allow(unused_imports)]
1859 use ::buffa::Enumeration as _;
1860 match tag.field_number() {
1861 1u32 => {
1862 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1863 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1864 field_number: 1u32,
1865 expected: 2u8,
1866 actual: tag.wire_type() as u8,
1867 });
1868 }
1869 ::buffa::types::merge_string(&mut self.value, buf)?;
1870 }
1871 _ => {
1872 self.__buffa_unknown_fields
1873 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1874 }
1875 }
1876 ::core::result::Result::Ok(())
1877 }
1878 fn clear(&mut self) {
1879 self.value.clear();
1880 self.__buffa_unknown_fields.clear();
1881 }
1882}
1883impl ::buffa::ExtensionSet for StringValue {
1884 const PROTO_FQN: &'static str = "google.protobuf.StringValue";
1885 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1886 &self.__buffa_unknown_fields
1887 }
1888 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1889 &mut self.__buffa_unknown_fields
1890 }
1891}
1892impl ::buffa::text::TextFormat for StringValue {
1893 fn encode_text(
1894 &self,
1895 enc: &mut ::buffa::text::TextEncoder<'_>,
1896 ) -> ::core::fmt::Result {
1897 #[allow(unused_imports)]
1898 use ::buffa::Enumeration as _;
1899 if !self.value.is_empty() {
1900 enc.write_field_name("value")?;
1901 enc.write_string(&self.value)?;
1902 }
1903 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
1904 ::core::result::Result::Ok(())
1905 }
1906 fn merge_text(
1907 &mut self,
1908 dec: &mut ::buffa::text::TextDecoder<'_>,
1909 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
1910 #[allow(unused_imports)]
1911 use ::buffa::Enumeration as _;
1912 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
1913 match __name {
1914 "value" => self.value = dec.read_string()?.into_owned(),
1915 _ => dec.skip_value()?,
1916 }
1917 }
1918 ::core::result::Result::Ok(())
1919 }
1920}
1921#[doc(hidden)]
1922pub const __STRING_VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
1923 type_url: "type.googleapis.com/google.protobuf.StringValue",
1924 text_encode: ::buffa::type_registry::any_encode_text::<StringValue>,
1925 text_merge: ::buffa::type_registry::any_merge_text::<StringValue>,
1926};
1927#[derive(Clone, PartialEq, Default)]
1931#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
1932pub struct BytesValue {
1933 pub value: ::buffa::alloc::vec::Vec<u8>,
1937 #[doc(hidden)]
1938 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1939}
1940impl ::core::fmt::Debug for BytesValue {
1941 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1942 f.debug_struct("BytesValue").field("value", &self.value).finish()
1943 }
1944}
1945impl BytesValue {
1946 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
1951}
1952impl ::buffa::DefaultInstance for BytesValue {
1953 fn default_instance() -> &'static Self {
1954 static VALUE: ::buffa::__private::OnceBox<BytesValue> = ::buffa::__private::OnceBox::new();
1955 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1956 }
1957}
1958#[cfg(feature = "reflect")]
1959const _: () = {
1960 impl ::buffa_descriptor::reflect::ReflectMessage for BytesValue {
1961 fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
1962 __buffa::reflect::descriptor_pool()
1963 .message(Self::__buffa_reflect_message_index())
1964 }
1965 fn pool(
1966 &self,
1967 ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
1968 __buffa::reflect::descriptor_pool()
1969 }
1970 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1971 &self.__buffa_unknown_fields
1972 }
1973 fn get(
1974 &self,
1975 field: &::buffa_descriptor::FieldDescriptor,
1976 ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
1977 #[allow(unused_imports)]
1978 use ::buffa::Enumeration as _;
1979 match field.number() {
1980 1u32 => ::buffa_descriptor::reflect::ValueRef::Bytes(&self.value[..]),
1981 _ => {
1982 ::core::debug_assert!(
1983 false,
1984 "field number {} is not a member of this message's reflect get()",
1985 field.number(),
1986 );
1987 ::buffa_descriptor::reflect::ValueRef::Bool(false)
1988 }
1989 }
1990 }
1991 fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
1992 match field.number() {
1993 1u32 => !self.value.is_empty(),
1994 _ => false,
1995 }
1996 }
1997 fn for_each_set(
1998 &self,
1999 f: &mut dyn ::core::ops::FnMut(
2000 &::buffa_descriptor::FieldDescriptor,
2001 ::buffa_descriptor::reflect::ValueRef<'_>,
2002 ),
2003 ) {
2004 let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
2005 self,
2006 );
2007 for fd in md.fields() {
2008 if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
2009 f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
2010 }
2011 }
2012 }
2013 fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
2014 ::buffa_descriptor::reflect::DynamicMessage::from_message(
2015 self,
2016 ::buffa::alloc::sync::Arc::clone(__buffa::reflect::descriptor_pool()),
2017 Self::__buffa_reflect_message_index(),
2018 )
2019 }
2020 }
2021 impl ::buffa_descriptor::reflect::ReflectElement for BytesValue {
2022 fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
2023 ::buffa_descriptor::reflect::ValueRef::Message(
2024 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
2025 )
2026 }
2027 }
2028 impl BytesValue {
2029 #[doc(hidden)]
2032 fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
2033 static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
2034 *IDX
2035 .get_or_init(|| {
2036 __buffa::reflect::descriptor_pool()
2037 .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
2038 .expect(
2039 "generated message is registered in the embedded descriptor pool",
2040 )
2041 })
2042 }
2043 }
2044 impl ::buffa_descriptor::reflect::Reflectable for BytesValue {
2045 fn reflect(&self) -> ::buffa_descriptor::reflect::ReflectCow<'_> {
2049 ::buffa_descriptor::reflect::ReflectCow::Borrowed(self)
2050 }
2051 }
2052};
2053impl ::buffa::MessageName for BytesValue {
2054 const PACKAGE: &'static str = "google.protobuf";
2055 const NAME: &'static str = "BytesValue";
2056 const FULL_NAME: &'static str = "google.protobuf.BytesValue";
2057 const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
2058}
2059impl ::buffa::Message for BytesValue {
2060 #[allow(clippy::let_and_return)]
2066 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2067 #[allow(unused_imports)]
2068 use ::buffa::Enumeration as _;
2069 let mut size = 0u32;
2070 if !self.value.is_empty() {
2071 size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) as u32;
2072 }
2073 size += self.__buffa_unknown_fields.encoded_len() as u32;
2074 size
2075 }
2076 fn write_to(
2077 &self,
2078 _cache: &mut ::buffa::SizeCache,
2079 buf: &mut impl ::buffa::bytes::BufMut,
2080 ) {
2081 #[allow(unused_imports)]
2082 use ::buffa::Enumeration as _;
2083 if !self.value.is_empty() {
2084 ::buffa::encoding::Tag::new(
2085 1u32,
2086 ::buffa::encoding::WireType::LengthDelimited,
2087 )
2088 .encode(buf);
2089 ::buffa::types::encode_bytes(&self.value, buf);
2090 }
2091 self.__buffa_unknown_fields.write_to(buf);
2092 }
2093 fn merge_field(
2094 &mut self,
2095 tag: ::buffa::encoding::Tag,
2096 buf: &mut impl ::buffa::bytes::Buf,
2097 depth: u32,
2098 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2099 #[allow(unused_imports)]
2100 use ::buffa::bytes::Buf as _;
2101 #[allow(unused_imports)]
2102 use ::buffa::Enumeration as _;
2103 match tag.field_number() {
2104 1u32 => {
2105 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2106 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2107 field_number: 1u32,
2108 expected: 2u8,
2109 actual: tag.wire_type() as u8,
2110 });
2111 }
2112 ::buffa::types::merge_bytes(&mut self.value, buf)?;
2113 }
2114 _ => {
2115 self.__buffa_unknown_fields
2116 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2117 }
2118 }
2119 ::core::result::Result::Ok(())
2120 }
2121 fn clear(&mut self) {
2122 self.value.clear();
2123 self.__buffa_unknown_fields.clear();
2124 }
2125}
2126impl ::buffa::ExtensionSet for BytesValue {
2127 const PROTO_FQN: &'static str = "google.protobuf.BytesValue";
2128 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2129 &self.__buffa_unknown_fields
2130 }
2131 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2132 &mut self.__buffa_unknown_fields
2133 }
2134}
2135impl ::buffa::text::TextFormat for BytesValue {
2136 fn encode_text(
2137 &self,
2138 enc: &mut ::buffa::text::TextEncoder<'_>,
2139 ) -> ::core::fmt::Result {
2140 #[allow(unused_imports)]
2141 use ::buffa::Enumeration as _;
2142 if !self.value.is_empty() {
2143 enc.write_field_name("value")?;
2144 enc.write_bytes(&self.value)?;
2145 }
2146 enc.write_unknown_fields(&self.__buffa_unknown_fields)?;
2147 ::core::result::Result::Ok(())
2148 }
2149 fn merge_text(
2150 &mut self,
2151 dec: &mut ::buffa::text::TextDecoder<'_>,
2152 ) -> ::core::result::Result<(), ::buffa::text::ParseError> {
2153 #[allow(unused_imports)]
2154 use ::buffa::Enumeration as _;
2155 while let ::core::option::Option::Some(__name) = dec.read_field_name()? {
2156 match __name {
2157 "value" => self.value = dec.read_bytes()?,
2158 _ => dec.skip_value()?,
2159 }
2160 }
2161 ::core::result::Result::Ok(())
2162 }
2163}
2164#[doc(hidden)]
2165pub const __BYTES_VALUE_TEXT_ANY: ::buffa::type_registry::TextAnyEntry = ::buffa::type_registry::TextAnyEntry {
2166 type_url: "type.googleapis.com/google.protobuf.BytesValue",
2167 text_encode: ::buffa::type_registry::any_encode_text::<BytesValue>,
2168 text_merge: ::buffa::type_registry::any_merge_text::<BytesValue>,
2169};