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