1#[derive(Clone, PartialEq, Default)]
6pub struct Version {
7 pub major: ::core::option::Option<i32>,
9 pub minor: ::core::option::Option<i32>,
11 pub patch: ::core::option::Option<i32>,
13 pub suffix: ::core::option::Option<::buffa::alloc::string::String>,
18 #[doc(hidden)]
19 pub __buffa_unknown_fields: ::buffa::UnknownFields,
20}
21impl ::core::fmt::Debug for Version {
22 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23 f.debug_struct("Version")
24 .field("major", &self.major)
25 .field("minor", &self.minor)
26 .field("patch", &self.patch)
27 .field("suffix", &self.suffix)
28 .finish()
29 }
30}
31impl Version {
32 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.Version";
37}
38impl ::buffa::DefaultInstance for Version {
39 fn default_instance() -> &'static Self {
40 static VALUE: ::buffa::__private::OnceBox<Version> = ::buffa::__private::OnceBox::new();
41 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
42 }
43}
44impl ::buffa::Message for Version {
45 #[allow(clippy::let_and_return)]
51 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
52 #[allow(unused_imports)]
53 use ::buffa::Enumeration as _;
54 let mut size = 0u32;
55 if let Some(v) = self.major {
56 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
57 }
58 if let Some(v) = self.minor {
59 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
60 }
61 if let Some(v) = self.patch {
62 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
63 }
64 if let Some(ref v) = self.suffix {
65 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
66 }
67 size += self.__buffa_unknown_fields.encoded_len() as u32;
68 size
69 }
70 fn write_to(
71 &self,
72 _cache: &mut ::buffa::SizeCache,
73 buf: &mut impl ::buffa::bytes::BufMut,
74 ) {
75 #[allow(unused_imports)]
76 use ::buffa::Enumeration as _;
77 if let Some(v) = self.major {
78 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
79 .encode(buf);
80 ::buffa::types::encode_int32(v, buf);
81 }
82 if let Some(v) = self.minor {
83 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
84 .encode(buf);
85 ::buffa::types::encode_int32(v, buf);
86 }
87 if let Some(v) = self.patch {
88 ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
89 .encode(buf);
90 ::buffa::types::encode_int32(v, buf);
91 }
92 if let Some(ref v) = self.suffix {
93 ::buffa::encoding::Tag::new(
94 4u32,
95 ::buffa::encoding::WireType::LengthDelimited,
96 )
97 .encode(buf);
98 ::buffa::types::encode_string(v, buf);
99 }
100 self.__buffa_unknown_fields.write_to(buf);
101 }
102 fn merge_field(
103 &mut self,
104 tag: ::buffa::encoding::Tag,
105 buf: &mut impl ::buffa::bytes::Buf,
106 depth: u32,
107 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
108 #[allow(unused_imports)]
109 use ::buffa::bytes::Buf as _;
110 #[allow(unused_imports)]
111 use ::buffa::Enumeration as _;
112 match tag.field_number() {
113 1u32 => {
114 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
115 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
116 field_number: 1u32,
117 expected: 0u8,
118 actual: tag.wire_type() as u8,
119 });
120 }
121 self.major = ::core::option::Option::Some(
122 ::buffa::types::decode_int32(buf)?,
123 );
124 }
125 2u32 => {
126 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
127 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
128 field_number: 2u32,
129 expected: 0u8,
130 actual: tag.wire_type() as u8,
131 });
132 }
133 self.minor = ::core::option::Option::Some(
134 ::buffa::types::decode_int32(buf)?,
135 );
136 }
137 3u32 => {
138 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
139 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
140 field_number: 3u32,
141 expected: 0u8,
142 actual: tag.wire_type() as u8,
143 });
144 }
145 self.patch = ::core::option::Option::Some(
146 ::buffa::types::decode_int32(buf)?,
147 );
148 }
149 4u32 => {
150 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
151 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
152 field_number: 4u32,
153 expected: 2u8,
154 actual: tag.wire_type() as u8,
155 });
156 }
157 ::buffa::types::merge_string(
158 self.suffix.get_or_insert_with(::buffa::alloc::string::String::new),
159 buf,
160 )?;
161 }
162 _ => {
163 self.__buffa_unknown_fields
164 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
165 }
166 }
167 ::core::result::Result::Ok(())
168 }
169 fn clear(&mut self) {
170 self.major = ::core::option::Option::None;
171 self.minor = ::core::option::Option::None;
172 self.patch = ::core::option::Option::None;
173 self.suffix = ::core::option::Option::None;
174 self.__buffa_unknown_fields.clear();
175 }
176}
177impl ::buffa::ExtensionSet for Version {
178 const PROTO_FQN: &'static str = "google.protobuf.compiler.Version";
179 fn unknown_fields(&self) -> &::buffa::UnknownFields {
180 &self.__buffa_unknown_fields
181 }
182 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
183 &mut self.__buffa_unknown_fields
184 }
185}
186#[derive(Clone, PartialEq, Default)]
188pub struct CodeGeneratorRequest {
189 pub file_to_generate: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
195 pub parameter: ::core::option::Option<::buffa::alloc::string::String>,
199 pub proto_file: ::buffa::alloc::vec::Vec<super::FileDescriptorProto>,
221 pub source_file_descriptors: ::buffa::alloc::vec::Vec<super::FileDescriptorProto>,
227 pub compiler_version: ::buffa::MessageField<Version>,
231 #[doc(hidden)]
232 pub __buffa_unknown_fields: ::buffa::UnknownFields,
233}
234impl ::core::fmt::Debug for CodeGeneratorRequest {
235 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
236 f.debug_struct("CodeGeneratorRequest")
237 .field("file_to_generate", &self.file_to_generate)
238 .field("parameter", &self.parameter)
239 .field("proto_file", &self.proto_file)
240 .field("source_file_descriptors", &self.source_file_descriptors)
241 .field("compiler_version", &self.compiler_version)
242 .finish()
243 }
244}
245impl CodeGeneratorRequest {
246 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorRequest";
251}
252impl ::buffa::DefaultInstance for CodeGeneratorRequest {
253 fn default_instance() -> &'static Self {
254 static VALUE: ::buffa::__private::OnceBox<CodeGeneratorRequest> = ::buffa::__private::OnceBox::new();
255 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
256 }
257}
258impl ::buffa::Message for CodeGeneratorRequest {
259 #[allow(clippy::let_and_return)]
265 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
266 #[allow(unused_imports)]
267 use ::buffa::Enumeration as _;
268 let mut size = 0u32;
269 for v in &self.file_to_generate {
270 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
271 }
272 if let Some(ref v) = self.parameter {
273 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
274 }
275 if self.compiler_version.is_set() {
276 let __slot = __cache.reserve();
277 let inner_size = self.compiler_version.compute_size(__cache);
278 __cache.set(__slot, inner_size);
279 size
280 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
281 + inner_size;
282 }
283 for v in &self.proto_file {
284 let __slot = __cache.reserve();
285 let inner_size = v.compute_size(__cache);
286 __cache.set(__slot, inner_size);
287 size
288 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
289 + inner_size;
290 }
291 for v in &self.source_file_descriptors {
292 let __slot = __cache.reserve();
293 let inner_size = v.compute_size(__cache);
294 __cache.set(__slot, inner_size);
295 size
296 += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
297 + inner_size;
298 }
299 size += self.__buffa_unknown_fields.encoded_len() as u32;
300 size
301 }
302 fn write_to(
303 &self,
304 __cache: &mut ::buffa::SizeCache,
305 buf: &mut impl ::buffa::bytes::BufMut,
306 ) {
307 #[allow(unused_imports)]
308 use ::buffa::Enumeration as _;
309 for v in &self.file_to_generate {
310 ::buffa::encoding::Tag::new(
311 1u32,
312 ::buffa::encoding::WireType::LengthDelimited,
313 )
314 .encode(buf);
315 ::buffa::types::encode_string(v, buf);
316 }
317 if let Some(ref v) = self.parameter {
318 ::buffa::encoding::Tag::new(
319 2u32,
320 ::buffa::encoding::WireType::LengthDelimited,
321 )
322 .encode(buf);
323 ::buffa::types::encode_string(v, buf);
324 }
325 if self.compiler_version.is_set() {
326 ::buffa::encoding::Tag::new(
327 3u32,
328 ::buffa::encoding::WireType::LengthDelimited,
329 )
330 .encode(buf);
331 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
332 self.compiler_version.write_to(__cache, buf);
333 }
334 for v in &self.proto_file {
335 ::buffa::encoding::Tag::new(
336 15u32,
337 ::buffa::encoding::WireType::LengthDelimited,
338 )
339 .encode(buf);
340 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
341 v.write_to(__cache, buf);
342 }
343 for v in &self.source_file_descriptors {
344 ::buffa::encoding::Tag::new(
345 17u32,
346 ::buffa::encoding::WireType::LengthDelimited,
347 )
348 .encode(buf);
349 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
350 v.write_to(__cache, buf);
351 }
352 self.__buffa_unknown_fields.write_to(buf);
353 }
354 fn merge_field(
355 &mut self,
356 tag: ::buffa::encoding::Tag,
357 buf: &mut impl ::buffa::bytes::Buf,
358 depth: u32,
359 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
360 #[allow(unused_imports)]
361 use ::buffa::bytes::Buf as _;
362 #[allow(unused_imports)]
363 use ::buffa::Enumeration as _;
364 match tag.field_number() {
365 1u32 => {
366 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
367 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
368 field_number: 1u32,
369 expected: 2u8,
370 actual: tag.wire_type() as u8,
371 });
372 }
373 self.file_to_generate.push(::buffa::types::decode_string(buf)?);
374 }
375 2u32 => {
376 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
377 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
378 field_number: 2u32,
379 expected: 2u8,
380 actual: tag.wire_type() as u8,
381 });
382 }
383 ::buffa::types::merge_string(
384 self
385 .parameter
386 .get_or_insert_with(::buffa::alloc::string::String::new),
387 buf,
388 )?;
389 }
390 3u32 => {
391 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
392 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
393 field_number: 3u32,
394 expected: 2u8,
395 actual: tag.wire_type() as u8,
396 });
397 }
398 ::buffa::Message::merge_length_delimited(
399 self.compiler_version.get_or_insert_default(),
400 buf,
401 depth,
402 )?;
403 }
404 15u32 => {
405 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
406 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
407 field_number: 15u32,
408 expected: 2u8,
409 actual: tag.wire_type() as u8,
410 });
411 }
412 let mut elem = ::core::default::Default::default();
413 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
414 self.proto_file.push(elem);
415 }
416 17u32 => {
417 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
418 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
419 field_number: 17u32,
420 expected: 2u8,
421 actual: tag.wire_type() as u8,
422 });
423 }
424 let mut elem = ::core::default::Default::default();
425 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
426 self.source_file_descriptors.push(elem);
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.file_to_generate.clear();
437 self.parameter = ::core::option::Option::None;
438 self.compiler_version = ::buffa::MessageField::none();
439 self.proto_file.clear();
440 self.source_file_descriptors.clear();
441 self.__buffa_unknown_fields.clear();
442 }
443}
444impl ::buffa::ExtensionSet for CodeGeneratorRequest {
445 const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorRequest";
446 fn unknown_fields(&self) -> &::buffa::UnknownFields {
447 &self.__buffa_unknown_fields
448 }
449 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
450 &mut self.__buffa_unknown_fields
451 }
452}
453#[derive(Clone, PartialEq, Default)]
455pub struct CodeGeneratorResponse {
456 pub error: ::core::option::Option<::buffa::alloc::string::String>,
467 pub supported_features: ::core::option::Option<u64>,
472 pub minimum_edition: ::core::option::Option<i32>,
479 pub maximum_edition: ::core::option::Option<i32>,
486 pub file: ::buffa::alloc::vec::Vec<code_generator_response::File>,
488 #[doc(hidden)]
489 pub __buffa_unknown_fields: ::buffa::UnknownFields,
490}
491impl ::core::fmt::Debug for CodeGeneratorResponse {
492 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
493 f.debug_struct("CodeGeneratorResponse")
494 .field("error", &self.error)
495 .field("supported_features", &self.supported_features)
496 .field("minimum_edition", &self.minimum_edition)
497 .field("maximum_edition", &self.maximum_edition)
498 .field("file", &self.file)
499 .finish()
500 }
501}
502impl CodeGeneratorResponse {
503 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorResponse";
508}
509impl ::buffa::DefaultInstance for CodeGeneratorResponse {
510 fn default_instance() -> &'static Self {
511 static VALUE: ::buffa::__private::OnceBox<CodeGeneratorResponse> = ::buffa::__private::OnceBox::new();
512 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
513 }
514}
515impl ::buffa::Message for CodeGeneratorResponse {
516 #[allow(clippy::let_and_return)]
522 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
523 #[allow(unused_imports)]
524 use ::buffa::Enumeration as _;
525 let mut size = 0u32;
526 if let Some(ref v) = self.error {
527 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
528 }
529 if let Some(v) = self.supported_features {
530 size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
531 }
532 if let Some(v) = self.minimum_edition {
533 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
534 }
535 if let Some(v) = self.maximum_edition {
536 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
537 }
538 for v in &self.file {
539 let __slot = __cache.reserve();
540 let inner_size = v.compute_size(__cache);
541 __cache.set(__slot, inner_size);
542 size
543 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
544 + inner_size;
545 }
546 size += self.__buffa_unknown_fields.encoded_len() as u32;
547 size
548 }
549 fn write_to(
550 &self,
551 __cache: &mut ::buffa::SizeCache,
552 buf: &mut impl ::buffa::bytes::BufMut,
553 ) {
554 #[allow(unused_imports)]
555 use ::buffa::Enumeration as _;
556 if let Some(ref v) = self.error {
557 ::buffa::encoding::Tag::new(
558 1u32,
559 ::buffa::encoding::WireType::LengthDelimited,
560 )
561 .encode(buf);
562 ::buffa::types::encode_string(v, buf);
563 }
564 if let Some(v) = self.supported_features {
565 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
566 .encode(buf);
567 ::buffa::types::encode_uint64(v, buf);
568 }
569 if let Some(v) = self.minimum_edition {
570 ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
571 .encode(buf);
572 ::buffa::types::encode_int32(v, buf);
573 }
574 if let Some(v) = self.maximum_edition {
575 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
576 .encode(buf);
577 ::buffa::types::encode_int32(v, buf);
578 }
579 for v in &self.file {
580 ::buffa::encoding::Tag::new(
581 15u32,
582 ::buffa::encoding::WireType::LengthDelimited,
583 )
584 .encode(buf);
585 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
586 v.write_to(__cache, buf);
587 }
588 self.__buffa_unknown_fields.write_to(buf);
589 }
590 fn merge_field(
591 &mut self,
592 tag: ::buffa::encoding::Tag,
593 buf: &mut impl ::buffa::bytes::Buf,
594 depth: u32,
595 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
596 #[allow(unused_imports)]
597 use ::buffa::bytes::Buf as _;
598 #[allow(unused_imports)]
599 use ::buffa::Enumeration as _;
600 match tag.field_number() {
601 1u32 => {
602 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
603 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
604 field_number: 1u32,
605 expected: 2u8,
606 actual: tag.wire_type() as u8,
607 });
608 }
609 ::buffa::types::merge_string(
610 self.error.get_or_insert_with(::buffa::alloc::string::String::new),
611 buf,
612 )?;
613 }
614 2u32 => {
615 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
616 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
617 field_number: 2u32,
618 expected: 0u8,
619 actual: tag.wire_type() as u8,
620 });
621 }
622 self.supported_features = ::core::option::Option::Some(
623 ::buffa::types::decode_uint64(buf)?,
624 );
625 }
626 3u32 => {
627 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
628 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
629 field_number: 3u32,
630 expected: 0u8,
631 actual: tag.wire_type() as u8,
632 });
633 }
634 self.minimum_edition = ::core::option::Option::Some(
635 ::buffa::types::decode_int32(buf)?,
636 );
637 }
638 4u32 => {
639 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
640 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
641 field_number: 4u32,
642 expected: 0u8,
643 actual: tag.wire_type() as u8,
644 });
645 }
646 self.maximum_edition = ::core::option::Option::Some(
647 ::buffa::types::decode_int32(buf)?,
648 );
649 }
650 15u32 => {
651 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
652 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
653 field_number: 15u32,
654 expected: 2u8,
655 actual: tag.wire_type() as u8,
656 });
657 }
658 let mut elem = ::core::default::Default::default();
659 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
660 self.file.push(elem);
661 }
662 _ => {
663 self.__buffa_unknown_fields
664 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
665 }
666 }
667 ::core::result::Result::Ok(())
668 }
669 fn clear(&mut self) {
670 self.error = ::core::option::Option::None;
671 self.supported_features = ::core::option::Option::None;
672 self.minimum_edition = ::core::option::Option::None;
673 self.maximum_edition = ::core::option::Option::None;
674 self.file.clear();
675 self.__buffa_unknown_fields.clear();
676 }
677}
678impl ::buffa::ExtensionSet for CodeGeneratorResponse {
679 const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse";
680 fn unknown_fields(&self) -> &::buffa::UnknownFields {
681 &self.__buffa_unknown_fields
682 }
683 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
684 &mut self.__buffa_unknown_fields
685 }
686}
687pub mod code_generator_response {
688 #[allow(unused_imports)]
689 use super::*;
690 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
692 #[repr(i32)]
693 pub enum Feature {
694 FEATURE_NONE = 0i32,
695 FEATURE_PROTO3_OPTIONAL = 1i32,
696 FEATURE_SUPPORTS_EDITIONS = 2i32,
697 }
698 impl ::core::default::Default for Feature {
699 fn default() -> Self {
700 Self::FEATURE_NONE
701 }
702 }
703 impl ::buffa::Enumeration for Feature {
704 fn from_i32(value: i32) -> ::core::option::Option<Self> {
705 match value {
706 0i32 => ::core::option::Option::Some(Self::FEATURE_NONE),
707 1i32 => ::core::option::Option::Some(Self::FEATURE_PROTO3_OPTIONAL),
708 2i32 => ::core::option::Option::Some(Self::FEATURE_SUPPORTS_EDITIONS),
709 _ => ::core::option::Option::None,
710 }
711 }
712 fn to_i32(&self) -> i32 {
713 *self as i32
714 }
715 fn proto_name(&self) -> &'static str {
716 match self {
717 Self::FEATURE_NONE => "FEATURE_NONE",
718 Self::FEATURE_PROTO3_OPTIONAL => "FEATURE_PROTO3_OPTIONAL",
719 Self::FEATURE_SUPPORTS_EDITIONS => "FEATURE_SUPPORTS_EDITIONS",
720 }
721 }
722 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
723 match name {
724 "FEATURE_NONE" => ::core::option::Option::Some(Self::FEATURE_NONE),
725 "FEATURE_PROTO3_OPTIONAL" => {
726 ::core::option::Option::Some(Self::FEATURE_PROTO3_OPTIONAL)
727 }
728 "FEATURE_SUPPORTS_EDITIONS" => {
729 ::core::option::Option::Some(Self::FEATURE_SUPPORTS_EDITIONS)
730 }
731 _ => ::core::option::Option::None,
732 }
733 }
734 fn values() -> &'static [Self] {
735 &[
736 Self::FEATURE_NONE,
737 Self::FEATURE_PROTO3_OPTIONAL,
738 Self::FEATURE_SUPPORTS_EDITIONS,
739 ]
740 }
741 }
742 #[derive(Clone, PartialEq, Default)]
744 pub struct File {
745 pub name: ::core::option::Option<::buffa::alloc::string::String>,
759 pub insertion_point: ::core::option::Option<::buffa::alloc::string::String>,
799 pub content: ::core::option::Option<::buffa::alloc::string::String>,
803 pub generated_code_info: ::buffa::MessageField<super::super::GeneratedCodeInfo>,
809 #[doc(hidden)]
810 pub __buffa_unknown_fields: ::buffa::UnknownFields,
811 }
812 impl ::core::fmt::Debug for File {
813 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
814 f.debug_struct("File")
815 .field("name", &self.name)
816 .field("insertion_point", &self.insertion_point)
817 .field("content", &self.content)
818 .field("generated_code_info", &self.generated_code_info)
819 .finish()
820 }
821 }
822 impl File {
823 pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorResponse.File";
828 }
829 impl ::buffa::DefaultInstance for File {
830 fn default_instance() -> &'static Self {
831 static VALUE: ::buffa::__private::OnceBox<File> = ::buffa::__private::OnceBox::new();
832 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
833 }
834 }
835 impl ::buffa::Message for File {
836 #[allow(clippy::let_and_return)]
842 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
843 #[allow(unused_imports)]
844 use ::buffa::Enumeration as _;
845 let mut size = 0u32;
846 if let Some(ref v) = self.name {
847 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
848 }
849 if let Some(ref v) = self.insertion_point {
850 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
851 }
852 if let Some(ref v) = self.content {
853 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
854 }
855 if self.generated_code_info.is_set() {
856 let __slot = __cache.reserve();
857 let inner_size = self.generated_code_info.compute_size(__cache);
858 __cache.set(__slot, inner_size);
859 size
860 += 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
861 + inner_size;
862 }
863 size += self.__buffa_unknown_fields.encoded_len() as u32;
864 size
865 }
866 fn write_to(
867 &self,
868 __cache: &mut ::buffa::SizeCache,
869 buf: &mut impl ::buffa::bytes::BufMut,
870 ) {
871 #[allow(unused_imports)]
872 use ::buffa::Enumeration as _;
873 if let Some(ref v) = self.name {
874 ::buffa::encoding::Tag::new(
875 1u32,
876 ::buffa::encoding::WireType::LengthDelimited,
877 )
878 .encode(buf);
879 ::buffa::types::encode_string(v, buf);
880 }
881 if let Some(ref v) = self.insertion_point {
882 ::buffa::encoding::Tag::new(
883 2u32,
884 ::buffa::encoding::WireType::LengthDelimited,
885 )
886 .encode(buf);
887 ::buffa::types::encode_string(v, buf);
888 }
889 if let Some(ref v) = self.content {
890 ::buffa::encoding::Tag::new(
891 15u32,
892 ::buffa::encoding::WireType::LengthDelimited,
893 )
894 .encode(buf);
895 ::buffa::types::encode_string(v, buf);
896 }
897 if self.generated_code_info.is_set() {
898 ::buffa::encoding::Tag::new(
899 16u32,
900 ::buffa::encoding::WireType::LengthDelimited,
901 )
902 .encode(buf);
903 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
904 self.generated_code_info.write_to(__cache, buf);
905 }
906 self.__buffa_unknown_fields.write_to(buf);
907 }
908 fn merge_field(
909 &mut self,
910 tag: ::buffa::encoding::Tag,
911 buf: &mut impl ::buffa::bytes::Buf,
912 depth: u32,
913 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
914 #[allow(unused_imports)]
915 use ::buffa::bytes::Buf as _;
916 #[allow(unused_imports)]
917 use ::buffa::Enumeration as _;
918 match tag.field_number() {
919 1u32 => {
920 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
921 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
922 field_number: 1u32,
923 expected: 2u8,
924 actual: tag.wire_type() as u8,
925 });
926 }
927 ::buffa::types::merge_string(
928 self
929 .name
930 .get_or_insert_with(::buffa::alloc::string::String::new),
931 buf,
932 )?;
933 }
934 2u32 => {
935 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
936 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
937 field_number: 2u32,
938 expected: 2u8,
939 actual: tag.wire_type() as u8,
940 });
941 }
942 ::buffa::types::merge_string(
943 self
944 .insertion_point
945 .get_or_insert_with(::buffa::alloc::string::String::new),
946 buf,
947 )?;
948 }
949 15u32 => {
950 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
951 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
952 field_number: 15u32,
953 expected: 2u8,
954 actual: tag.wire_type() as u8,
955 });
956 }
957 ::buffa::types::merge_string(
958 self
959 .content
960 .get_or_insert_with(::buffa::alloc::string::String::new),
961 buf,
962 )?;
963 }
964 16u32 => {
965 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
966 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
967 field_number: 16u32,
968 expected: 2u8,
969 actual: tag.wire_type() as u8,
970 });
971 }
972 ::buffa::Message::merge_length_delimited(
973 self.generated_code_info.get_or_insert_default(),
974 buf,
975 depth,
976 )?;
977 }
978 _ => {
979 self.__buffa_unknown_fields
980 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
981 }
982 }
983 ::core::result::Result::Ok(())
984 }
985 fn clear(&mut self) {
986 self.name = ::core::option::Option::None;
987 self.insertion_point = ::core::option::Option::None;
988 self.content = ::core::option::Option::None;
989 self.generated_code_info = ::buffa::MessageField::none();
990 self.__buffa_unknown_fields.clear();
991 }
992 }
993 impl ::buffa::ExtensionSet for File {
994 const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse.File";
995 fn unknown_fields(&self) -> &::buffa::UnknownFields {
996 &self.__buffa_unknown_fields
997 }
998 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
999 &mut self.__buffa_unknown_fields
1000 }
1001 }
1002}