#[derive(Clone, PartialEq, Default)]
pub struct Version {
pub major: Option<i32>,
pub minor: Option<i32>,
pub patch: Option<i32>,
pub suffix: Option<::buffa::alloc::string::String>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
#[doc(hidden)]
pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for Version {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Version")
.field("major", &self.major)
.field("minor", &self.minor)
.field("patch", &self.patch)
.field("suffix", &self.suffix)
.finish()
}
}
impl Version {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.Version";
}
unsafe impl ::buffa::DefaultInstance for Version {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Version> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for Version {
fn compute_size(&self) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.major {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.minor {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.patch {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.suffix {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
self.__buffa_cached_size.set(size);
size
}
fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.major {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.minor {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.patch {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.suffix {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.major = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.minor = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.patch = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.suffix.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn cached_size(&self) -> u32 {
self.__buffa_cached_size.get()
}
fn clear(&mut self) {
self.major = ::core::option::Option::None;
self.minor = ::core::option::Option::None;
self.patch = ::core::option::Option::None;
self.suffix = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
self.__buffa_cached_size.set(0);
}
}
impl ::buffa::ExtensionSet for Version {
const PROTO_FQN: &'static str = "google.protobuf.compiler.Version";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[derive(Clone, PartialEq, Default)]
pub struct CodeGeneratorRequest {
pub file_to_generate: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub parameter: Option<::buffa::alloc::string::String>,
pub proto_file: ::buffa::alloc::vec::Vec<super::FileDescriptorProto>,
pub source_file_descriptors: ::buffa::alloc::vec::Vec<super::FileDescriptorProto>,
pub compiler_version: ::buffa::MessageField<Version>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
#[doc(hidden)]
pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for CodeGeneratorRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodeGeneratorRequest")
.field("file_to_generate", &self.file_to_generate)
.field("parameter", &self.parameter)
.field("proto_file", &self.proto_file)
.field("source_file_descriptors", &self.source_file_descriptors)
.field("compiler_version", &self.compiler_version)
.finish()
}
}
impl CodeGeneratorRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorRequest";
}
unsafe impl ::buffa::DefaultInstance for CodeGeneratorRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<CodeGeneratorRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for CodeGeneratorRequest {
fn compute_size(&self) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.parameter {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.compiler_version.is_set() {
let inner_size = self.compiler_version.compute_size();
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.file_to_generate {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.proto_file {
let inner_size = v.compute_size();
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.source_file_descriptors {
let inner_size = v.compute_size();
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
self.__buffa_cached_size.set(size);
size
}
fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.parameter {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.compiler_version.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(
self.compiler_version.cached_size() as u64,
buf,
);
self.compiler_version.write_to(buf);
}
for v in &self.file_to_generate {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.proto_file {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
v.write_to(buf);
}
for v in &self.source_file_descriptors {
::buffa::encoding::Tag::new(
17u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
v.write_to(buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.parameter
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.compiler_version.get_or_insert_default(),
buf,
depth,
)?;
}
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.file_to_generate.push(::buffa::types::decode_string(buf)?);
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.proto_file.push(elem);
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.source_file_descriptors.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn cached_size(&self) -> u32 {
self.__buffa_cached_size.get()
}
fn clear(&mut self) {
self.parameter = ::core::option::Option::None;
self.compiler_version = ::buffa::MessageField::none();
self.file_to_generate.clear();
self.proto_file.clear();
self.source_file_descriptors.clear();
self.__buffa_unknown_fields.clear();
self.__buffa_cached_size.set(0);
}
}
impl ::buffa::ExtensionSet for CodeGeneratorRequest {
const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[derive(Clone, PartialEq, Default)]
pub struct CodeGeneratorResponse {
pub error: Option<::buffa::alloc::string::String>,
pub supported_features: Option<u64>,
pub minimum_edition: Option<i32>,
pub maximum_edition: Option<i32>,
pub file: ::buffa::alloc::vec::Vec<code_generator_response::File>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
#[doc(hidden)]
pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for CodeGeneratorResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodeGeneratorResponse")
.field("error", &self.error)
.field("supported_features", &self.supported_features)
.field("minimum_edition", &self.minimum_edition)
.field("maximum_edition", &self.maximum_edition)
.field("file", &self.file)
.finish()
}
}
impl CodeGeneratorResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorResponse";
}
unsafe impl ::buffa::DefaultInstance for CodeGeneratorResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<CodeGeneratorResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for CodeGeneratorResponse {
fn compute_size(&self) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.error {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.supported_features {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
if let Some(v) = self.minimum_edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.maximum_edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
for v in &self.file {
let inner_size = v.compute_size();
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
self.__buffa_cached_size.set(size);
size
}
fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.error {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.supported_features {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
if let Some(v) = self.minimum_edition {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.maximum_edition {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
for v in &self.file {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
v.write_to(buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.error.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.supported_features = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.minimum_edition = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.maximum_edition = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.file.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn cached_size(&self) -> u32 {
self.__buffa_cached_size.get()
}
fn clear(&mut self) {
self.error = ::core::option::Option::None;
self.supported_features = ::core::option::Option::None;
self.minimum_edition = ::core::option::Option::None;
self.maximum_edition = ::core::option::Option::None;
self.file.clear();
self.__buffa_unknown_fields.clear();
self.__buffa_cached_size.set(0);
}
}
impl ::buffa::ExtensionSet for CodeGeneratorResponse {
const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
pub mod code_generator_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Feature {
FEATURE_NONE = 0i32,
FEATURE_PROTO3_OPTIONAL = 1i32,
FEATURE_SUPPORTS_EDITIONS = 2i32,
}
impl ::core::default::Default for Feature {
fn default() -> Self {
Self::FEATURE_NONE
}
}
impl ::buffa::Enumeration for Feature {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::FEATURE_NONE),
1i32 => ::core::option::Option::Some(Self::FEATURE_PROTO3_OPTIONAL),
2i32 => ::core::option::Option::Some(Self::FEATURE_SUPPORTS_EDITIONS),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::FEATURE_NONE => "FEATURE_NONE",
Self::FEATURE_PROTO3_OPTIONAL => "FEATURE_PROTO3_OPTIONAL",
Self::FEATURE_SUPPORTS_EDITIONS => "FEATURE_SUPPORTS_EDITIONS",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"FEATURE_NONE" => ::core::option::Option::Some(Self::FEATURE_NONE),
"FEATURE_PROTO3_OPTIONAL" => {
::core::option::Option::Some(Self::FEATURE_PROTO3_OPTIONAL)
}
"FEATURE_SUPPORTS_EDITIONS" => {
::core::option::Option::Some(Self::FEATURE_SUPPORTS_EDITIONS)
}
_ => ::core::option::Option::None,
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct File {
pub name: Option<::buffa::alloc::string::String>,
pub insertion_point: Option<::buffa::alloc::string::String>,
pub content: Option<::buffa::alloc::string::String>,
pub generated_code_info: ::buffa::MessageField<super::GeneratedCodeInfo>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
#[doc(hidden)]
pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for File {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("File")
.field("name", &self.name)
.field("insertion_point", &self.insertion_point)
.field("content", &self.content)
.field("generated_code_info", &self.generated_code_info)
.finish()
}
}
impl File {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.compiler.CodeGeneratorResponse.File";
}
unsafe impl ::buffa::DefaultInstance for File {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<File> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for File {
fn compute_size(&self) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.insertion_point {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.content {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.generated_code_info.is_set() {
let inner_size = self.generated_code_info.compute_size();
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
self.__buffa_cached_size.set(size);
size
}
fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.name {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.insertion_point {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.content {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.generated_code_info.is_set() {
::buffa::encoding::Tag::new(
16u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(
self.generated_code_info.cached_size() as u64,
buf,
);
self.generated_code_info.write_to(buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.name
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.insertion_point
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.content
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.generated_code_info.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn cached_size(&self) -> u32 {
self.__buffa_cached_size.get()
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.insertion_point = ::core::option::Option::None;
self.content = ::core::option::Option::None;
self.generated_code_info = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
self.__buffa_cached_size.set(0);
}
}
impl ::buffa::ExtensionSet for File {
const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse.File";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
}