#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Edition {
EDITION_UNKNOWN = 0i32,
EDITION_LEGACY = 900i32,
EDITION_PROTO2 = 998i32,
EDITION_PROTO3 = 999i32,
EDITION_2023 = 1000i32,
EDITION_2024 = 1001i32,
EDITION_UNSTABLE = 9999i32,
EDITION_1_TEST_ONLY = 1i32,
EDITION_2_TEST_ONLY = 2i32,
EDITION_99997_TEST_ONLY = 99997i32,
EDITION_99998_TEST_ONLY = 99998i32,
EDITION_99999_TEST_ONLY = 99999i32,
EDITION_MAX = 2147483647i32,
}
impl ::core::default::Default for Edition {
fn default() -> Self {
Self::EDITION_UNKNOWN
}
}
impl ::buffa::Enumeration for Edition {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
900i32 => ::core::option::Option::Some(Self::EDITION_LEGACY),
998i32 => ::core::option::Option::Some(Self::EDITION_PROTO2),
999i32 => ::core::option::Option::Some(Self::EDITION_PROTO3),
1000i32 => ::core::option::Option::Some(Self::EDITION_2023),
1001i32 => ::core::option::Option::Some(Self::EDITION_2024),
9999i32 => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
1i32 => ::core::option::Option::Some(Self::EDITION_1_TEST_ONLY),
2i32 => ::core::option::Option::Some(Self::EDITION_2_TEST_ONLY),
99997i32 => ::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY),
99998i32 => ::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY),
99999i32 => ::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY),
2147483647i32 => ::core::option::Option::Some(Self::EDITION_MAX),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::EDITION_UNKNOWN => "EDITION_UNKNOWN",
Self::EDITION_LEGACY => "EDITION_LEGACY",
Self::EDITION_PROTO2 => "EDITION_PROTO2",
Self::EDITION_PROTO3 => "EDITION_PROTO3",
Self::EDITION_2023 => "EDITION_2023",
Self::EDITION_2024 => "EDITION_2024",
Self::EDITION_UNSTABLE => "EDITION_UNSTABLE",
Self::EDITION_1_TEST_ONLY => "EDITION_1_TEST_ONLY",
Self::EDITION_2_TEST_ONLY => "EDITION_2_TEST_ONLY",
Self::EDITION_99997_TEST_ONLY => "EDITION_99997_TEST_ONLY",
Self::EDITION_99998_TEST_ONLY => "EDITION_99998_TEST_ONLY",
Self::EDITION_99999_TEST_ONLY => "EDITION_99999_TEST_ONLY",
Self::EDITION_MAX => "EDITION_MAX",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"EDITION_UNKNOWN" => ::core::option::Option::Some(Self::EDITION_UNKNOWN),
"EDITION_LEGACY" => ::core::option::Option::Some(Self::EDITION_LEGACY),
"EDITION_PROTO2" => ::core::option::Option::Some(Self::EDITION_PROTO2),
"EDITION_PROTO3" => ::core::option::Option::Some(Self::EDITION_PROTO3),
"EDITION_2023" => ::core::option::Option::Some(Self::EDITION_2023),
"EDITION_2024" => ::core::option::Option::Some(Self::EDITION_2024),
"EDITION_UNSTABLE" => ::core::option::Option::Some(Self::EDITION_UNSTABLE),
"EDITION_1_TEST_ONLY" => {
::core::option::Option::Some(Self::EDITION_1_TEST_ONLY)
}
"EDITION_2_TEST_ONLY" => {
::core::option::Option::Some(Self::EDITION_2_TEST_ONLY)
}
"EDITION_99997_TEST_ONLY" => {
::core::option::Option::Some(Self::EDITION_99997_TEST_ONLY)
}
"EDITION_99998_TEST_ONLY" => {
::core::option::Option::Some(Self::EDITION_99998_TEST_ONLY)
}
"EDITION_99999_TEST_ONLY" => {
::core::option::Option::Some(Self::EDITION_99999_TEST_ONLY)
}
"EDITION_MAX" => ::core::option::Option::Some(Self::EDITION_MAX),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::EDITION_UNKNOWN,
Self::EDITION_LEGACY,
Self::EDITION_PROTO2,
Self::EDITION_PROTO3,
Self::EDITION_2023,
Self::EDITION_2024,
Self::EDITION_UNSTABLE,
Self::EDITION_1_TEST_ONLY,
Self::EDITION_2_TEST_ONLY,
Self::EDITION_99997_TEST_ONLY,
Self::EDITION_99998_TEST_ONLY,
Self::EDITION_99999_TEST_ONLY,
Self::EDITION_MAX,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum SymbolVisibility {
VISIBILITY_UNSET = 0i32,
VISIBILITY_LOCAL = 1i32,
VISIBILITY_EXPORT = 2i32,
}
impl ::core::default::Default for SymbolVisibility {
fn default() -> Self {
Self::VISIBILITY_UNSET
}
}
impl ::buffa::Enumeration for SymbolVisibility {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
1i32 => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
2i32 => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VISIBILITY_UNSET => "VISIBILITY_UNSET",
Self::VISIBILITY_LOCAL => "VISIBILITY_LOCAL",
Self::VISIBILITY_EXPORT => "VISIBILITY_EXPORT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VISIBILITY_UNSET" => ::core::option::Option::Some(Self::VISIBILITY_UNSET),
"VISIBILITY_LOCAL" => ::core::option::Option::Some(Self::VISIBILITY_LOCAL),
"VISIBILITY_EXPORT" => ::core::option::Option::Some(Self::VISIBILITY_EXPORT),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::VISIBILITY_UNSET, Self::VISIBILITY_LOCAL, Self::VISIBILITY_EXPORT]
}
}
#[derive(Clone, PartialEq, Default)]
pub struct FileDescriptorSet {
pub file: ::buffa::alloc::vec::Vec<FileDescriptorProto>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FileDescriptorSet {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FileDescriptorSet").field("file", &self.file).finish()
}
}
impl FileDescriptorSet {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorSet";
}
impl ::buffa::DefaultInstance for FileDescriptorSet {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FileDescriptorSet> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FileDescriptorSet {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.file {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.file {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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,
});
}
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 clear(&mut self) {
self.file.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FileDescriptorSet {
const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorSet";
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 FileDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub package: ::core::option::Option<::buffa::alloc::string::String>,
pub dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub public_dependency: ::buffa::alloc::vec::Vec<i32>,
pub weak_dependency: ::buffa::alloc::vec::Vec<i32>,
pub option_dependency: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub message_type: ::buffa::alloc::vec::Vec<DescriptorProto>,
pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
pub service: ::buffa::alloc::vec::Vec<ServiceDescriptorProto>,
pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
pub options: ::buffa::MessageField<FileOptions>,
pub source_code_info: ::buffa::MessageField<SourceCodeInfo>,
pub syntax: ::core::option::Option<::buffa::alloc::string::String>,
pub edition: ::core::option::Option<Edition>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FileDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FileDescriptorProto")
.field("name", &self.name)
.field("package", &self.package)
.field("dependency", &self.dependency)
.field("public_dependency", &self.public_dependency)
.field("weak_dependency", &self.weak_dependency)
.field("option_dependency", &self.option_dependency)
.field("message_type", &self.message_type)
.field("enum_type", &self.enum_type)
.field("service", &self.service)
.field("extension", &self.extension)
.field("options", &self.options)
.field("source_code_info", &self.source_code_info)
.field("syntax", &self.syntax)
.field("edition", &self.edition)
.finish()
}
}
impl FileDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileDescriptorProto";
}
impl ::buffa::DefaultInstance for FileDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FileDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FileDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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.package {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.dependency {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.message_type {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.enum_type {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.service {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.extension {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.source_code_info.is_set() {
let __slot = __cache.reserve();
let inner_size = self.source_code_info.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.public_dependency {
size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
}
for v in &self.weak_dependency {
size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
}
if let Some(ref v) = self.syntax {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
for v in &self.option_dependency {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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.package {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.dependency {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.message_type {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.enum_type {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.service {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.extension {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, buf);
}
if self.source_code_info.is_set() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.source_code_info.write_to(__cache, buf);
}
for v in &self.public_dependency {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(*v, buf);
}
for v in &self.weak_dependency {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(*v, buf);
}
if let Some(ref v) = self.syntax {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.edition {
::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
for v in &self.option_dependency {
::buffa::encoding::Tag::new(
15u32,
::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::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.package.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,
});
}
self.dependency.push(::buffa::types::decode_string(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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.message_type.push(elem);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
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.enum_type.push(elem);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
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.service.push(elem);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
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.extension.push(elem);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.options.get_or_insert_default(),
buf,
depth,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.source_code_info.get_or_insert_default(),
buf,
depth,
)?;
}
10u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.public_dependency.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.public_dependency
.push(::buffa::types::decode_int32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.public_dependency.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
11u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.weak_dependency.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.weak_dependency
.push(::buffa::types::decode_int32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.weak_dependency.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.syntax.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 14u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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,
});
}
self.option_dependency.push(::buffa::types::decode_string(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.package = ::core::option::Option::None;
self.dependency.clear();
self.message_type.clear();
self.enum_type.clear();
self.service.clear();
self.extension.clear();
self.options = ::buffa::MessageField::none();
self.source_code_info = ::buffa::MessageField::none();
self.public_dependency.clear();
self.weak_dependency.clear();
self.syntax = ::core::option::Option::None;
self.edition = ::core::option::Option::None;
self.option_dependency.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FileDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto";
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 DescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub field: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
pub extension: ::buffa::alloc::vec::Vec<FieldDescriptorProto>,
pub nested_type: ::buffa::alloc::vec::Vec<Self>,
pub enum_type: ::buffa::alloc::vec::Vec<EnumDescriptorProto>,
pub extension_range: ::buffa::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
pub oneof_decl: ::buffa::alloc::vec::Vec<OneofDescriptorProto>,
pub options: ::buffa::MessageField<MessageOptions>,
pub reserved_range: ::buffa::alloc::vec::Vec<descriptor_proto::ReservedRange>,
pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub visibility: ::core::option::Option<SymbolVisibility>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for DescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DescriptorProto")
.field("name", &self.name)
.field("field", &self.field)
.field("extension", &self.extension)
.field("nested_type", &self.nested_type)
.field("enum_type", &self.enum_type)
.field("extension_range", &self.extension_range)
.field("oneof_decl", &self.oneof_decl)
.field("options", &self.options)
.field("reserved_range", &self.reserved_range)
.field("reserved_name", &self.reserved_name)
.field("visibility", &self.visibility)
.finish()
}
}
impl DescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto";
}
impl ::buffa::DefaultInstance for DescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<DescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for DescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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;
}
for v in &self.field {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.nested_type {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.enum_type {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.extension_range {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.extension {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.oneof_decl {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.reserved_range {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.reserved_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.visibility {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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);
}
for v in &self.field {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.nested_type {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.enum_type {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.extension_range {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.extension {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, buf);
}
for v in &self.oneof_decl {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.reserved_range {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.reserved_name {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.visibility {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.field.push(elem);
}
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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.nested_type.push(elem);
}
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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.enum_type.push(elem);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
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.extension_range.push(elem);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
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.extension.push(elem);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.options.get_or_insert_default(),
buf,
depth,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
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.oneof_decl.push(elem);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
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.reserved_range.push(elem);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.reserved_name.push(::buffa::types::decode_string(buf)?);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.visibility = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 11u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.field.clear();
self.nested_type.clear();
self.enum_type.clear();
self.extension_range.clear();
self.extension.clear();
self.options = ::buffa::MessageField::none();
self.oneof_decl.clear();
self.reserved_range.clear();
self.reserved_name.clear();
self.visibility = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for DescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto";
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 descriptor_proto {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct ExtensionRange {
pub start: ::core::option::Option<i32>,
pub end: ::core::option::Option<i32>,
pub options: ::buffa::MessageField<super::ExtensionRangeOptions>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExtensionRange {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExtensionRange")
.field("start", &self.start)
.field("end", &self.end)
.field("options", &self.options)
.finish()
}
}
impl ExtensionRange {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange";
}
impl ::buffa::DefaultInstance for ExtensionRange {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ExtensionRange> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for ExtensionRange {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.start {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.end {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.start {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.end {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, 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.start = ::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.end = ::core::option::Option::Some(
::buffa::types::decode_int32(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.options.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start = ::core::option::Option::None;
self.end = ::core::option::Option::None;
self.options = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExtensionRange {
const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ExtensionRange";
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 ReservedRange {
pub start: ::core::option::Option<i32>,
pub end: ::core::option::Option<i32>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ReservedRange {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ReservedRange")
.field("start", &self.start)
.field("end", &self.end)
.finish()
}
}
impl ReservedRange {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange";
}
impl ::buffa::DefaultInstance for ReservedRange {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ReservedRange> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for ReservedRange {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.start {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.end {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.start {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.end {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(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.start = ::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.end = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start = ::core::option::Option::None;
self.end = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ReservedRange {
const PROTO_FQN: &'static str = "google.protobuf.DescriptorProto.ReservedRange";
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 ExtensionRangeOptions {
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
pub declaration: ::buffa::alloc::vec::Vec<extension_range_options::Declaration>,
pub features: ::buffa::MessageField<FeatureSet>,
pub verification: ::core::option::Option<extension_range_options::VerificationState>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExtensionRangeOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExtensionRangeOptions")
.field("uninterpreted_option", &self.uninterpreted_option)
.field("declaration", &self.declaration)
.field("features", &self.features)
.field("verification", &self.verification)
.finish()
}
}
impl ExtensionRangeOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions";
}
impl ::buffa::DefaultInstance for ExtensionRangeOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ExtensionRangeOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for ExtensionRangeOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.declaration {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.verification {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.declaration {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.verification {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
50u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.declaration.push(elem);
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.verification = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 3u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
50u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 50u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.declaration.clear();
self.verification = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExtensionRangeOptions {
const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions";
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 extension_range_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum VerificationState {
DECLARATION = 0i32,
UNVERIFIED = 1i32,
}
impl ::core::default::Default for VerificationState {
fn default() -> Self {
Self::DECLARATION
}
}
impl ::buffa::Enumeration for VerificationState {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::DECLARATION),
1i32 => ::core::option::Option::Some(Self::UNVERIFIED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::DECLARATION => "DECLARATION",
Self::UNVERIFIED => "UNVERIFIED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"DECLARATION" => ::core::option::Option::Some(Self::DECLARATION),
"UNVERIFIED" => ::core::option::Option::Some(Self::UNVERIFIED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::DECLARATION, Self::UNVERIFIED]
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Declaration {
pub number: ::core::option::Option<i32>,
pub full_name: ::core::option::Option<::buffa::alloc::string::String>,
pub r#type: ::core::option::Option<::buffa::alloc::string::String>,
pub reserved: ::core::option::Option<bool>,
pub repeated: ::core::option::Option<bool>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Declaration {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Declaration")
.field("number", &self.number)
.field("full_name", &self.full_name)
.field("r#type", &self.r#type)
.field("reserved", &self.reserved)
.field("repeated", &self.repeated)
.finish()
}
}
impl Declaration {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration";
}
impl ::buffa::DefaultInstance for Declaration {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Declaration> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for Declaration {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.number {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.full_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.r#type {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.reserved.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.repeated.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.number {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.full_name {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.r#type {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.reserved {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.repeated {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(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.number = ::core::option::Option::Some(
::buffa::types::decode_int32(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
.full_name
.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::types::merge_string(
self
.r#type
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.reserved = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.repeated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.number = ::core::option::Option::None;
self.full_name = ::core::option::Option::None;
self.r#type = ::core::option::Option::None;
self.reserved = ::core::option::Option::None;
self.repeated = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Declaration {
const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration";
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 FieldDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub number: ::core::option::Option<i32>,
pub label: ::core::option::Option<field_descriptor_proto::Label>,
pub r#type: ::core::option::Option<field_descriptor_proto::Type>,
pub type_name: ::core::option::Option<::buffa::alloc::string::String>,
pub extendee: ::core::option::Option<::buffa::alloc::string::String>,
pub default_value: ::core::option::Option<::buffa::alloc::string::String>,
pub oneof_index: ::core::option::Option<i32>,
pub json_name: ::core::option::Option<::buffa::alloc::string::String>,
pub options: ::buffa::MessageField<FieldOptions>,
pub proto3_optional: ::core::option::Option<bool>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FieldDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FieldDescriptorProto")
.field("name", &self.name)
.field("number", &self.number)
.field("label", &self.label)
.field("r#type", &self.r#type)
.field("type_name", &self.type_name)
.field("extendee", &self.extendee)
.field("default_value", &self.default_value)
.field("oneof_index", &self.oneof_index)
.field("json_name", &self.json_name)
.field("options", &self.options)
.field("proto3_optional", &self.proto3_optional)
.finish()
}
}
impl FieldDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldDescriptorProto";
}
impl ::buffa::DefaultInstance for FieldDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FieldDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FieldDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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.extendee {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.number {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.label {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.r#type {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.type_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.default_value {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(v) = self.oneof_index {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.json_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.proto3_optional.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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.extendee {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.number {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.label {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.r#type {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.type_name {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.default_value {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, buf);
}
if let Some(v) = self.oneof_index {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.json_name {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.proto3_optional {
::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(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::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
.extendee
.get_or_insert_with(::buffa::alloc::string::String::new),
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.number = ::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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.label = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 4u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.r#type = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 5u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.type_name
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.default_value
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.options.get_or_insert_default(),
buf,
depth,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.oneof_index = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.json_name
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.proto3_optional = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.extendee = ::core::option::Option::None;
self.number = ::core::option::Option::None;
self.label = ::core::option::Option::None;
self.r#type = ::core::option::Option::None;
self.type_name = ::core::option::Option::None;
self.default_value = ::core::option::Option::None;
self.options = ::buffa::MessageField::none();
self.oneof_index = ::core::option::Option::None;
self.json_name = ::core::option::Option::None;
self.proto3_optional = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FieldDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.FieldDescriptorProto";
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 field_descriptor_proto {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Type {
TYPE_DOUBLE = 1i32,
TYPE_FLOAT = 2i32,
TYPE_INT64 = 3i32,
TYPE_UINT64 = 4i32,
TYPE_INT32 = 5i32,
TYPE_FIXED64 = 6i32,
TYPE_FIXED32 = 7i32,
TYPE_BOOL = 8i32,
TYPE_STRING = 9i32,
TYPE_GROUP = 10i32,
TYPE_MESSAGE = 11i32,
TYPE_BYTES = 12i32,
TYPE_UINT32 = 13i32,
TYPE_ENUM = 14i32,
TYPE_SFIXED32 = 15i32,
TYPE_SFIXED64 = 16i32,
TYPE_SINT32 = 17i32,
TYPE_SINT64 = 18i32,
}
impl ::core::default::Default for Type {
fn default() -> Self {
Self::TYPE_DOUBLE
}
}
impl ::buffa::Enumeration for Type {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
1i32 => ::core::option::Option::Some(Self::TYPE_DOUBLE),
2i32 => ::core::option::Option::Some(Self::TYPE_FLOAT),
3i32 => ::core::option::Option::Some(Self::TYPE_INT64),
4i32 => ::core::option::Option::Some(Self::TYPE_UINT64),
5i32 => ::core::option::Option::Some(Self::TYPE_INT32),
6i32 => ::core::option::Option::Some(Self::TYPE_FIXED64),
7i32 => ::core::option::Option::Some(Self::TYPE_FIXED32),
8i32 => ::core::option::Option::Some(Self::TYPE_BOOL),
9i32 => ::core::option::Option::Some(Self::TYPE_STRING),
10i32 => ::core::option::Option::Some(Self::TYPE_GROUP),
11i32 => ::core::option::Option::Some(Self::TYPE_MESSAGE),
12i32 => ::core::option::Option::Some(Self::TYPE_BYTES),
13i32 => ::core::option::Option::Some(Self::TYPE_UINT32),
14i32 => ::core::option::Option::Some(Self::TYPE_ENUM),
15i32 => ::core::option::Option::Some(Self::TYPE_SFIXED32),
16i32 => ::core::option::Option::Some(Self::TYPE_SFIXED64),
17i32 => ::core::option::Option::Some(Self::TYPE_SINT32),
18i32 => ::core::option::Option::Some(Self::TYPE_SINT64),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::TYPE_DOUBLE => "TYPE_DOUBLE",
Self::TYPE_FLOAT => "TYPE_FLOAT",
Self::TYPE_INT64 => "TYPE_INT64",
Self::TYPE_UINT64 => "TYPE_UINT64",
Self::TYPE_INT32 => "TYPE_INT32",
Self::TYPE_FIXED64 => "TYPE_FIXED64",
Self::TYPE_FIXED32 => "TYPE_FIXED32",
Self::TYPE_BOOL => "TYPE_BOOL",
Self::TYPE_STRING => "TYPE_STRING",
Self::TYPE_GROUP => "TYPE_GROUP",
Self::TYPE_MESSAGE => "TYPE_MESSAGE",
Self::TYPE_BYTES => "TYPE_BYTES",
Self::TYPE_UINT32 => "TYPE_UINT32",
Self::TYPE_ENUM => "TYPE_ENUM",
Self::TYPE_SFIXED32 => "TYPE_SFIXED32",
Self::TYPE_SFIXED64 => "TYPE_SFIXED64",
Self::TYPE_SINT32 => "TYPE_SINT32",
Self::TYPE_SINT64 => "TYPE_SINT64",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"TYPE_DOUBLE" => ::core::option::Option::Some(Self::TYPE_DOUBLE),
"TYPE_FLOAT" => ::core::option::Option::Some(Self::TYPE_FLOAT),
"TYPE_INT64" => ::core::option::Option::Some(Self::TYPE_INT64),
"TYPE_UINT64" => ::core::option::Option::Some(Self::TYPE_UINT64),
"TYPE_INT32" => ::core::option::Option::Some(Self::TYPE_INT32),
"TYPE_FIXED64" => ::core::option::Option::Some(Self::TYPE_FIXED64),
"TYPE_FIXED32" => ::core::option::Option::Some(Self::TYPE_FIXED32),
"TYPE_BOOL" => ::core::option::Option::Some(Self::TYPE_BOOL),
"TYPE_STRING" => ::core::option::Option::Some(Self::TYPE_STRING),
"TYPE_GROUP" => ::core::option::Option::Some(Self::TYPE_GROUP),
"TYPE_MESSAGE" => ::core::option::Option::Some(Self::TYPE_MESSAGE),
"TYPE_BYTES" => ::core::option::Option::Some(Self::TYPE_BYTES),
"TYPE_UINT32" => ::core::option::Option::Some(Self::TYPE_UINT32),
"TYPE_ENUM" => ::core::option::Option::Some(Self::TYPE_ENUM),
"TYPE_SFIXED32" => ::core::option::Option::Some(Self::TYPE_SFIXED32),
"TYPE_SFIXED64" => ::core::option::Option::Some(Self::TYPE_SFIXED64),
"TYPE_SINT32" => ::core::option::Option::Some(Self::TYPE_SINT32),
"TYPE_SINT64" => ::core::option::Option::Some(Self::TYPE_SINT64),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::TYPE_DOUBLE,
Self::TYPE_FLOAT,
Self::TYPE_INT64,
Self::TYPE_UINT64,
Self::TYPE_INT32,
Self::TYPE_FIXED64,
Self::TYPE_FIXED32,
Self::TYPE_BOOL,
Self::TYPE_STRING,
Self::TYPE_GROUP,
Self::TYPE_MESSAGE,
Self::TYPE_BYTES,
Self::TYPE_UINT32,
Self::TYPE_ENUM,
Self::TYPE_SFIXED32,
Self::TYPE_SFIXED64,
Self::TYPE_SINT32,
Self::TYPE_SINT64,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Label {
LABEL_OPTIONAL = 1i32,
LABEL_REPEATED = 3i32,
LABEL_REQUIRED = 2i32,
}
impl ::core::default::Default for Label {
fn default() -> Self {
Self::LABEL_OPTIONAL
}
}
impl ::buffa::Enumeration for Label {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
1i32 => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
3i32 => ::core::option::Option::Some(Self::LABEL_REPEATED),
2i32 => ::core::option::Option::Some(Self::LABEL_REQUIRED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::LABEL_OPTIONAL => "LABEL_OPTIONAL",
Self::LABEL_REPEATED => "LABEL_REPEATED",
Self::LABEL_REQUIRED => "LABEL_REQUIRED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"LABEL_OPTIONAL" => ::core::option::Option::Some(Self::LABEL_OPTIONAL),
"LABEL_REPEATED" => ::core::option::Option::Some(Self::LABEL_REPEATED),
"LABEL_REQUIRED" => ::core::option::Option::Some(Self::LABEL_REQUIRED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::LABEL_OPTIONAL, Self::LABEL_REPEATED, Self::LABEL_REQUIRED]
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct OneofDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub options: ::buffa::MessageField<OneofOptions>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for OneofDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("OneofDescriptorProto")
.field("name", &self.name)
.field("options", &self.options)
.finish()
}
}
impl OneofDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofDescriptorProto";
}
impl ::buffa::DefaultInstance for OneofDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<OneofDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for OneofDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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 self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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 self.options.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, 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::Message::merge_length_delimited(
self.options.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.options = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for OneofDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.OneofDescriptorProto";
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 EnumDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub value: ::buffa::alloc::vec::Vec<EnumValueDescriptorProto>,
pub options: ::buffa::MessageField<EnumOptions>,
pub reserved_range: ::buffa::alloc::vec::Vec<
enum_descriptor_proto::EnumReservedRange,
>,
pub reserved_name: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub visibility: ::core::option::Option<SymbolVisibility>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EnumDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EnumDescriptorProto")
.field("name", &self.name)
.field("value", &self.value)
.field("options", &self.options)
.field("reserved_range", &self.reserved_range)
.field("reserved_name", &self.reserved_name)
.field("visibility", &self.visibility)
.finish()
}
}
impl EnumDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto";
}
impl ::buffa::DefaultInstance for EnumDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EnumDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EnumDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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;
}
for v in &self.value {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.reserved_range {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.reserved_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.visibility {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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);
}
for v in &self.value {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, buf);
}
for v in &self.reserved_range {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.reserved_name {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.visibility {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.value.push(elem);
}
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.options.get_or_insert_default(),
buf,
depth,
)?;
}
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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.reserved_range.push(elem);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.reserved_name.push(::buffa::types::decode_string(buf)?);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.visibility = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 6u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.value.clear();
self.options = ::buffa::MessageField::none();
self.reserved_range.clear();
self.reserved_name.clear();
self.visibility = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EnumDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto";
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 enum_descriptor_proto {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct EnumReservedRange {
pub start: ::core::option::Option<i32>,
pub end: ::core::option::Option<i32>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EnumReservedRange {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EnumReservedRange")
.field("start", &self.start)
.field("end", &self.end)
.finish()
}
}
impl EnumReservedRange {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange";
}
impl ::buffa::DefaultInstance for EnumReservedRange {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EnumReservedRange> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EnumReservedRange {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.start {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.end {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.start {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.end {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(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.start = ::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.end = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start = ::core::option::Option::None;
self.end = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EnumReservedRange {
const PROTO_FQN: &'static str = "google.protobuf.EnumDescriptorProto.EnumReservedRange";
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 EnumValueDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub number: ::core::option::Option<i32>,
pub options: ::buffa::MessageField<EnumValueOptions>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EnumValueDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EnumValueDescriptorProto")
.field("name", &self.name)
.field("number", &self.number)
.field("options", &self.options)
.finish()
}
}
impl EnumValueDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueDescriptorProto";
}
impl ::buffa::DefaultInstance for EnumValueDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EnumValueDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EnumValueDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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(v) = self.number {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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(v) = self.number {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, 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::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.number = ::core::option::Option::Some(
::buffa::types::decode_int32(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.options.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.number = ::core::option::Option::None;
self.options = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EnumValueDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.EnumValueDescriptorProto";
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 ServiceDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub method: ::buffa::alloc::vec::Vec<MethodDescriptorProto>,
pub options: ::buffa::MessageField<ServiceOptions>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ServiceDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ServiceDescriptorProto")
.field("name", &self.name)
.field("method", &self.method)
.field("options", &self.options)
.finish()
}
}
impl ServiceDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceDescriptorProto";
}
impl ::buffa::DefaultInstance for ServiceDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ServiceDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for ServiceDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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;
}
for v in &self.method {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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);
}
for v in &self.method {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.method.push(elem);
}
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.options.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.method.clear();
self.options = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ServiceDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.ServiceDescriptorProto";
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 MethodDescriptorProto {
pub name: ::core::option::Option<::buffa::alloc::string::String>,
pub input_type: ::core::option::Option<::buffa::alloc::string::String>,
pub output_type: ::core::option::Option<::buffa::alloc::string::String>,
pub options: ::buffa::MessageField<MethodOptions>,
pub client_streaming: ::core::option::Option<bool>,
pub server_streaming: ::core::option::Option<bool>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MethodDescriptorProto {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MethodDescriptorProto")
.field("name", &self.name)
.field("input_type", &self.input_type)
.field("output_type", &self.output_type)
.field("options", &self.options)
.field("client_streaming", &self.client_streaming)
.field("server_streaming", &self.server_streaming)
.finish()
}
}
impl MethodDescriptorProto {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodDescriptorProto";
}
impl ::buffa::DefaultInstance for MethodDescriptorProto {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MethodDescriptorProto> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for MethodDescriptorProto {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> 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.input_type {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.output_type {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.options.is_set() {
let __slot = __cache.reserve();
let inner_size = self.options.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.client_streaming.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.server_streaming.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
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.input_type {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.output_type {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.options.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.options.write_to(__cache, buf);
}
if let Some(v) = self.client_streaming {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.server_streaming {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(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::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
.input_type
.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::types::merge_string(
self
.output_type
.get_or_insert_with(::buffa::alloc::string::String::new),
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::Message::merge_length_delimited(
self.options.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.client_streaming = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.server_streaming = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::option::Option::None;
self.input_type = ::core::option::Option::None;
self.output_type = ::core::option::Option::None;
self.options = ::buffa::MessageField::none();
self.client_streaming = ::core::option::Option::None;
self.server_streaming = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MethodDescriptorProto {
const PROTO_FQN: &'static str = "google.protobuf.MethodDescriptorProto";
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 FileOptions {
pub java_package: ::core::option::Option<::buffa::alloc::string::String>,
pub java_outer_classname: ::core::option::Option<::buffa::alloc::string::String>,
pub java_multiple_files: ::core::option::Option<bool>,
pub java_generate_equals_and_hash: ::core::option::Option<bool>,
pub java_string_check_utf8: ::core::option::Option<bool>,
pub optimize_for: ::core::option::Option<file_options::OptimizeMode>,
pub go_package: ::core::option::Option<::buffa::alloc::string::String>,
pub cc_generic_services: ::core::option::Option<bool>,
pub java_generic_services: ::core::option::Option<bool>,
pub py_generic_services: ::core::option::Option<bool>,
pub deprecated: ::core::option::Option<bool>,
pub cc_enable_arenas: ::core::option::Option<bool>,
pub objc_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
pub csharp_namespace: ::core::option::Option<::buffa::alloc::string::String>,
pub swift_prefix: ::core::option::Option<::buffa::alloc::string::String>,
pub php_class_prefix: ::core::option::Option<::buffa::alloc::string::String>,
pub php_namespace: ::core::option::Option<::buffa::alloc::string::String>,
pub php_metadata_namespace: ::core::option::Option<::buffa::alloc::string::String>,
pub ruby_package: ::core::option::Option<::buffa::alloc::string::String>,
pub features: ::buffa::MessageField<FeatureSet>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FileOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FileOptions")
.field("java_package", &self.java_package)
.field("java_outer_classname", &self.java_outer_classname)
.field("java_multiple_files", &self.java_multiple_files)
.field("java_generate_equals_and_hash", &self.java_generate_equals_and_hash)
.field("java_string_check_utf8", &self.java_string_check_utf8)
.field("optimize_for", &self.optimize_for)
.field("go_package", &self.go_package)
.field("cc_generic_services", &self.cc_generic_services)
.field("java_generic_services", &self.java_generic_services)
.field("py_generic_services", &self.py_generic_services)
.field("deprecated", &self.deprecated)
.field("cc_enable_arenas", &self.cc_enable_arenas)
.field("objc_class_prefix", &self.objc_class_prefix)
.field("csharp_namespace", &self.csharp_namespace)
.field("swift_prefix", &self.swift_prefix)
.field("php_class_prefix", &self.php_class_prefix)
.field("php_namespace", &self.php_namespace)
.field("php_metadata_namespace", &self.php_metadata_namespace)
.field("ruby_package", &self.ruby_package)
.field("features", &self.features)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl FileOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FileOptions";
}
impl ::buffa::DefaultInstance for FileOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FileOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FileOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.java_package {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.java_outer_classname {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.optimize_for {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.java_multiple_files.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.go_package {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.cc_generic_services.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.java_generic_services.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.py_generic_services.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.java_generate_equals_and_hash.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.java_string_check_utf8.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.cc_enable_arenas.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.objc_class_prefix {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.csharp_namespace {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.swift_prefix {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.php_class_prefix {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.php_namespace {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.php_metadata_namespace {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.ruby_package {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.java_package {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.java_outer_classname {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.optimize_for {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(v) = self.java_multiple_files {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.go_package {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.cc_generic_services {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.java_generic_services {
::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.py_generic_services {
::buffa::encoding::Tag::new(18u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.java_generate_equals_and_hash {
::buffa::encoding::Tag::new(20u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(23u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.java_string_check_utf8 {
::buffa::encoding::Tag::new(27u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.cc_enable_arenas {
::buffa::encoding::Tag::new(31u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.objc_class_prefix {
::buffa::encoding::Tag::new(
36u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.csharp_namespace {
::buffa::encoding::Tag::new(
37u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.swift_prefix {
::buffa::encoding::Tag::new(
39u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.php_class_prefix {
::buffa::encoding::Tag::new(
40u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.php_namespace {
::buffa::encoding::Tag::new(
41u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.php_metadata_namespace {
::buffa::encoding::Tag::new(
44u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.ruby_package {
::buffa::encoding::Tag::new(
45u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
50u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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
.java_package
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.java_outer_classname
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.optimize_for = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 9u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.java_multiple_files = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.go_package
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.cc_generic_services = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.java_generic_services = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
18u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 18u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.py_generic_services = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.java_generate_equals_and_hash = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
23u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 23u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
27u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 27u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.java_string_check_utf8 = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
31u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 31u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.cc_enable_arenas = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
36u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 36u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.objc_class_prefix
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
37u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 37u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.csharp_namespace
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
39u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 39u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.swift_prefix
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
40u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 40u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.php_class_prefix
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
41u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 41u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.php_namespace
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
44u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 44u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.php_metadata_namespace
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
45u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 45u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.ruby_package
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
50u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 50u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.java_package = ::core::option::Option::None;
self.java_outer_classname = ::core::option::Option::None;
self.optimize_for = ::core::option::Option::None;
self.java_multiple_files = ::core::option::Option::None;
self.go_package = ::core::option::Option::None;
self.cc_generic_services = ::core::option::Option::None;
self.java_generic_services = ::core::option::Option::None;
self.py_generic_services = ::core::option::Option::None;
self.java_generate_equals_and_hash = ::core::option::Option::None;
self.deprecated = ::core::option::Option::None;
self.java_string_check_utf8 = ::core::option::Option::None;
self.cc_enable_arenas = ::core::option::Option::None;
self.objc_class_prefix = ::core::option::Option::None;
self.csharp_namespace = ::core::option::Option::None;
self.swift_prefix = ::core::option::Option::None;
self.php_class_prefix = ::core::option::Option::None;
self.php_namespace = ::core::option::Option::None;
self.php_metadata_namespace = ::core::option::Option::None;
self.ruby_package = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FileOptions {
const PROTO_FQN: &'static str = "google.protobuf.FileOptions";
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 file_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum OptimizeMode {
SPEED = 1i32,
CODE_SIZE = 2i32,
LITE_RUNTIME = 3i32,
}
impl ::core::default::Default for OptimizeMode {
fn default() -> Self {
Self::SPEED
}
}
impl ::buffa::Enumeration for OptimizeMode {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
1i32 => ::core::option::Option::Some(Self::SPEED),
2i32 => ::core::option::Option::Some(Self::CODE_SIZE),
3i32 => ::core::option::Option::Some(Self::LITE_RUNTIME),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::SPEED => "SPEED",
Self::CODE_SIZE => "CODE_SIZE",
Self::LITE_RUNTIME => "LITE_RUNTIME",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"SPEED" => ::core::option::Option::Some(Self::SPEED),
"CODE_SIZE" => ::core::option::Option::Some(Self::CODE_SIZE),
"LITE_RUNTIME" => ::core::option::Option::Some(Self::LITE_RUNTIME),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::SPEED, Self::CODE_SIZE, Self::LITE_RUNTIME]
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct MessageOptions {
pub message_set_wire_format: ::core::option::Option<bool>,
pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
pub deprecated: ::core::option::Option<bool>,
pub map_entry: ::core::option::Option<bool>,
pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
pub features: ::buffa::MessageField<FeatureSet>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MessageOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MessageOptions")
.field("message_set_wire_format", &self.message_set_wire_format)
.field(
"no_standard_descriptor_accessor",
&self.no_standard_descriptor_accessor,
)
.field("deprecated", &self.deprecated)
.field("map_entry", &self.map_entry)
.field(
"deprecated_legacy_json_field_conflicts",
&self.deprecated_legacy_json_field_conflicts,
)
.field("features", &self.features)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl MessageOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MessageOptions";
}
impl ::buffa::DefaultInstance for MessageOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MessageOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for MessageOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.message_set_wire_format.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.no_standard_descriptor_accessor.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.map_entry.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated_legacy_json_field_conflicts.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.message_set_wire_format {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.no_standard_descriptor_accessor {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.map_entry {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated_legacy_json_field_conflicts {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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.message_set_wire_format = ::core::option::Option::Some(
::buffa::types::decode_bool(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.no_standard_descriptor_accessor = ::core::option::Option::Some(
::buffa::types::decode_bool(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.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.map_entry = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.message_set_wire_format = ::core::option::Option::None;
self.no_standard_descriptor_accessor = ::core::option::Option::None;
self.deprecated = ::core::option::Option::None;
self.map_entry = ::core::option::Option::None;
self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MessageOptions {
const PROTO_FQN: &'static str = "google.protobuf.MessageOptions";
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 FieldOptions {
pub ctype: ::core::option::Option<field_options::CType>,
pub packed: ::core::option::Option<bool>,
pub jstype: ::core::option::Option<field_options::JSType>,
pub lazy: ::core::option::Option<bool>,
pub unverified_lazy: ::core::option::Option<bool>,
pub deprecated: ::core::option::Option<bool>,
pub weak: ::core::option::Option<bool>,
pub debug_redact: ::core::option::Option<bool>,
pub retention: ::core::option::Option<field_options::OptionRetention>,
pub targets: ::buffa::alloc::vec::Vec<field_options::OptionTargetType>,
pub edition_defaults: ::buffa::alloc::vec::Vec<field_options::EditionDefault>,
pub features: ::buffa::MessageField<FeatureSet>,
pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FieldOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FieldOptions")
.field("ctype", &self.ctype)
.field("packed", &self.packed)
.field("jstype", &self.jstype)
.field("lazy", &self.lazy)
.field("unverified_lazy", &self.unverified_lazy)
.field("deprecated", &self.deprecated)
.field("weak", &self.weak)
.field("debug_redact", &self.debug_redact)
.field("retention", &self.retention)
.field("targets", &self.targets)
.field("edition_defaults", &self.edition_defaults)
.field("features", &self.features)
.field("feature_support", &self.feature_support)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl FieldOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions";
}
impl ::buffa::DefaultInstance for FieldOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FieldOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FieldOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.ctype {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.packed.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.lazy.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.jstype {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.weak.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.unverified_lazy.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.debug_redact.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.retention {
size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
for v in &self.targets {
size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
for v in &self.edition_defaults {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.feature_support.is_set() {
let __slot = __cache.reserve();
let inner_size = self.feature_support.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.ctype {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(v) = self.packed {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.lazy {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.jstype {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(v) = self.weak {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.unverified_lazy {
::buffa::encoding::Tag::new(15u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.debug_redact {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.retention {
::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
for v in &self.targets {
::buffa::encoding::Tag::new(19u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
for v in &self.edition_defaults {
::buffa::encoding::Tag::new(
20u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
21u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
if self.feature_support.is_set() {
::buffa::encoding::Tag::new(
22u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.feature_support.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.ctype = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 1u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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.packed = ::core::option::Option::Some(
::buffa::types::decode_bool(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.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.lazy = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.jstype = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 6u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.weak = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.unverified_lazy = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.debug_redact = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.retention = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 17u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
19u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.targets.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
let __raw = ::buffa::types::decode_int32(&mut limited)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.targets.push(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 19u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.targets.push(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 19u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 19u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
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.edition_defaults.push(elem);
}
21u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 21u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
22u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 22u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.feature_support.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.ctype = ::core::option::Option::None;
self.packed = ::core::option::Option::None;
self.deprecated = ::core::option::Option::None;
self.lazy = ::core::option::Option::None;
self.jstype = ::core::option::Option::None;
self.weak = ::core::option::Option::None;
self.unverified_lazy = ::core::option::Option::None;
self.debug_redact = ::core::option::Option::None;
self.retention = ::core::option::Option::None;
self.targets.clear();
self.edition_defaults.clear();
self.features = ::buffa::MessageField::none();
self.feature_support = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FieldOptions {
const PROTO_FQN: &'static str = "google.protobuf.FieldOptions";
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 field_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum CType {
STRING = 0i32,
CORD = 1i32,
STRING_PIECE = 2i32,
}
impl ::core::default::Default for CType {
fn default() -> Self {
Self::STRING
}
}
impl ::buffa::Enumeration for CType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::STRING),
1i32 => ::core::option::Option::Some(Self::CORD),
2i32 => ::core::option::Option::Some(Self::STRING_PIECE),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::STRING => "STRING",
Self::CORD => "CORD",
Self::STRING_PIECE => "STRING_PIECE",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"STRING" => ::core::option::Option::Some(Self::STRING),
"CORD" => ::core::option::Option::Some(Self::CORD),
"STRING_PIECE" => ::core::option::Option::Some(Self::STRING_PIECE),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::STRING, Self::CORD, Self::STRING_PIECE]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum JSType {
JS_NORMAL = 0i32,
JS_STRING = 1i32,
JS_NUMBER = 2i32,
}
impl ::core::default::Default for JSType {
fn default() -> Self {
Self::JS_NORMAL
}
}
impl ::buffa::Enumeration for JSType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::JS_NORMAL),
1i32 => ::core::option::Option::Some(Self::JS_STRING),
2i32 => ::core::option::Option::Some(Self::JS_NUMBER),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::JS_NORMAL => "JS_NORMAL",
Self::JS_STRING => "JS_STRING",
Self::JS_NUMBER => "JS_NUMBER",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"JS_NORMAL" => ::core::option::Option::Some(Self::JS_NORMAL),
"JS_STRING" => ::core::option::Option::Some(Self::JS_STRING),
"JS_NUMBER" => ::core::option::Option::Some(Self::JS_NUMBER),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::JS_NORMAL, Self::JS_STRING, Self::JS_NUMBER]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum OptionRetention {
RETENTION_UNKNOWN = 0i32,
RETENTION_RUNTIME = 1i32,
RETENTION_SOURCE = 2i32,
}
impl ::core::default::Default for OptionRetention {
fn default() -> Self {
Self::RETENTION_UNKNOWN
}
}
impl ::buffa::Enumeration for OptionRetention {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::RETENTION_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::RETENTION_RUNTIME),
2i32 => ::core::option::Option::Some(Self::RETENTION_SOURCE),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::RETENTION_UNKNOWN => "RETENTION_UNKNOWN",
Self::RETENTION_RUNTIME => "RETENTION_RUNTIME",
Self::RETENTION_SOURCE => "RETENTION_SOURCE",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"RETENTION_UNKNOWN" => {
::core::option::Option::Some(Self::RETENTION_UNKNOWN)
}
"RETENTION_RUNTIME" => {
::core::option::Option::Some(Self::RETENTION_RUNTIME)
}
"RETENTION_SOURCE" => {
::core::option::Option::Some(Self::RETENTION_SOURCE)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::RETENTION_UNKNOWN, Self::RETENTION_RUNTIME, Self::RETENTION_SOURCE]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum OptionTargetType {
TARGET_TYPE_UNKNOWN = 0i32,
TARGET_TYPE_FILE = 1i32,
TARGET_TYPE_EXTENSION_RANGE = 2i32,
TARGET_TYPE_MESSAGE = 3i32,
TARGET_TYPE_FIELD = 4i32,
TARGET_TYPE_ONEOF = 5i32,
TARGET_TYPE_ENUM = 6i32,
TARGET_TYPE_ENUM_ENTRY = 7i32,
TARGET_TYPE_SERVICE = 8i32,
TARGET_TYPE_METHOD = 9i32,
}
impl ::core::default::Default for OptionTargetType {
fn default() -> Self {
Self::TARGET_TYPE_UNKNOWN
}
}
impl ::buffa::Enumeration for OptionTargetType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FILE),
2i32 => ::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE),
3i32 => ::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
4i32 => ::core::option::Option::Some(Self::TARGET_TYPE_FIELD),
5i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ONEOF),
6i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM),
7i32 => ::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
8i32 => ::core::option::Option::Some(Self::TARGET_TYPE_SERVICE),
9i32 => ::core::option::Option::Some(Self::TARGET_TYPE_METHOD),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::TARGET_TYPE_UNKNOWN => "TARGET_TYPE_UNKNOWN",
Self::TARGET_TYPE_FILE => "TARGET_TYPE_FILE",
Self::TARGET_TYPE_EXTENSION_RANGE => "TARGET_TYPE_EXTENSION_RANGE",
Self::TARGET_TYPE_MESSAGE => "TARGET_TYPE_MESSAGE",
Self::TARGET_TYPE_FIELD => "TARGET_TYPE_FIELD",
Self::TARGET_TYPE_ONEOF => "TARGET_TYPE_ONEOF",
Self::TARGET_TYPE_ENUM => "TARGET_TYPE_ENUM",
Self::TARGET_TYPE_ENUM_ENTRY => "TARGET_TYPE_ENUM_ENTRY",
Self::TARGET_TYPE_SERVICE => "TARGET_TYPE_SERVICE",
Self::TARGET_TYPE_METHOD => "TARGET_TYPE_METHOD",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"TARGET_TYPE_UNKNOWN" => {
::core::option::Option::Some(Self::TARGET_TYPE_UNKNOWN)
}
"TARGET_TYPE_FILE" => {
::core::option::Option::Some(Self::TARGET_TYPE_FILE)
}
"TARGET_TYPE_EXTENSION_RANGE" => {
::core::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
}
"TARGET_TYPE_MESSAGE" => {
::core::option::Option::Some(Self::TARGET_TYPE_MESSAGE)
}
"TARGET_TYPE_FIELD" => {
::core::option::Option::Some(Self::TARGET_TYPE_FIELD)
}
"TARGET_TYPE_ONEOF" => {
::core::option::Option::Some(Self::TARGET_TYPE_ONEOF)
}
"TARGET_TYPE_ENUM" => {
::core::option::Option::Some(Self::TARGET_TYPE_ENUM)
}
"TARGET_TYPE_ENUM_ENTRY" => {
::core::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY)
}
"TARGET_TYPE_SERVICE" => {
::core::option::Option::Some(Self::TARGET_TYPE_SERVICE)
}
"TARGET_TYPE_METHOD" => {
::core::option::Option::Some(Self::TARGET_TYPE_METHOD)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::TARGET_TYPE_UNKNOWN,
Self::TARGET_TYPE_FILE,
Self::TARGET_TYPE_EXTENSION_RANGE,
Self::TARGET_TYPE_MESSAGE,
Self::TARGET_TYPE_FIELD,
Self::TARGET_TYPE_ONEOF,
Self::TARGET_TYPE_ENUM,
Self::TARGET_TYPE_ENUM_ENTRY,
Self::TARGET_TYPE_SERVICE,
Self::TARGET_TYPE_METHOD,
]
}
}
#[derive(Clone, PartialEq, Default)]
pub struct EditionDefault {
pub edition: ::core::option::Option<super::Edition>,
pub value: ::core::option::Option<::buffa::alloc::string::String>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EditionDefault {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EditionDefault")
.field("edition", &self.edition)
.field("value", &self.value)
.finish()
}
}
impl EditionDefault {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault";
}
impl ::buffa::DefaultInstance for EditionDefault {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EditionDefault> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EditionDefault {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.value {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.value {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.edition {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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
.value
.get_or_insert_with(::buffa::alloc::string::String::new),
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 3u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.value = ::core::option::Option::None;
self.edition = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EditionDefault {
const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.EditionDefault";
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 FeatureSupport {
pub edition_introduced: ::core::option::Option<super::Edition>,
pub edition_deprecated: ::core::option::Option<super::Edition>,
pub deprecation_warning: ::core::option::Option<::buffa::alloc::string::String>,
pub edition_removed: ::core::option::Option<super::Edition>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FeatureSupport {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FeatureSupport")
.field("edition_introduced", &self.edition_introduced)
.field("edition_deprecated", &self.edition_deprecated)
.field("deprecation_warning", &self.deprecation_warning)
.field("edition_removed", &self.edition_removed)
.finish()
}
}
impl FeatureSupport {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport";
}
impl ::buffa::DefaultInstance for FeatureSupport {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FeatureSupport> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FeatureSupport {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.edition_introduced {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.edition_deprecated {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.deprecation_warning {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.edition_removed {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.edition_introduced {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.edition_deprecated {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.deprecation_warning {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.edition_removed {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition_introduced = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 1u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition_deprecated = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 2u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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::types::merge_string(
self
.deprecation_warning
.get_or_insert_with(::buffa::alloc::string::String::new),
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition_removed = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 4u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.edition_introduced = ::core::option::Option::None;
self.edition_deprecated = ::core::option::Option::None;
self.deprecation_warning = ::core::option::Option::None;
self.edition_removed = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FeatureSupport {
const PROTO_FQN: &'static str = "google.protobuf.FieldOptions.FeatureSupport";
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 OneofOptions {
pub features: ::buffa::MessageField<FeatureSet>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for OneofOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("OneofOptions")
.field("features", &self.features)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl OneofOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.OneofOptions";
}
impl ::buffa::DefaultInstance for OneofOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<OneofOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for OneofOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.features.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for OneofOptions {
const PROTO_FQN: &'static str = "google.protobuf.OneofOptions";
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 EnumOptions {
pub allow_alias: ::core::option::Option<bool>,
pub deprecated: ::core::option::Option<bool>,
pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
pub features: ::buffa::MessageField<FeatureSet>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EnumOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EnumOptions")
.field("allow_alias", &self.allow_alias)
.field("deprecated", &self.deprecated)
.field(
"deprecated_legacy_json_field_conflicts",
&self.deprecated_legacy_json_field_conflicts,
)
.field("features", &self.features)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl EnumOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumOptions";
}
impl ::buffa::DefaultInstance for EnumOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EnumOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EnumOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.allow_alias.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.deprecated_legacy_json_field_conflicts.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.allow_alias {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.deprecated_legacy_json_field_conflicts {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.allow_alias = ::core::option::Option::Some(
::buffa::types::decode_bool(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.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deprecated_legacy_json_field_conflicts = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.allow_alias = ::core::option::Option::None;
self.deprecated = ::core::option::Option::None;
self.deprecated_legacy_json_field_conflicts = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EnumOptions {
const PROTO_FQN: &'static str = "google.protobuf.EnumOptions";
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 EnumValueOptions {
pub deprecated: ::core::option::Option<bool>,
pub features: ::buffa::MessageField<FeatureSet>,
pub debug_redact: ::core::option::Option<bool>,
pub feature_support: ::buffa::MessageField<field_options::FeatureSupport>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EnumValueOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EnumValueOptions")
.field("deprecated", &self.deprecated)
.field("features", &self.features)
.field("debug_redact", &self.debug_redact)
.field("feature_support", &self.feature_support)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl EnumValueOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.EnumValueOptions";
}
impl ::buffa::DefaultInstance for EnumValueOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EnumValueOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for EnumValueOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.deprecated.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.debug_redact.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.feature_support.is_set() {
let __slot = __cache.reserve();
let inner_size = self.feature_support.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
if let Some(v) = self.debug_redact {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if self.feature_support.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.feature_support.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(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::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
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.debug_redact = ::core::option::Option::Some(
::buffa::types::decode_bool(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::Message::merge_length_delimited(
self.feature_support.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.deprecated = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.debug_redact = ::core::option::Option::None;
self.feature_support = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EnumValueOptions {
const PROTO_FQN: &'static str = "google.protobuf.EnumValueOptions";
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 ServiceOptions {
pub features: ::buffa::MessageField<FeatureSet>,
pub deprecated: ::core::option::Option<bool>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ServiceOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ServiceOptions")
.field("features", &self.features)
.field("deprecated", &self.deprecated)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl ServiceOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.ServiceOptions";
}
impl ::buffa::DefaultInstance for ServiceOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ServiceOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for ServiceOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.deprecated.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(33u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
34u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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() {
33u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 33u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
34u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 34u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.deprecated = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ServiceOptions {
const PROTO_FQN: &'static str = "google.protobuf.ServiceOptions";
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 MethodOptions {
pub deprecated: ::core::option::Option<bool>,
pub idempotency_level: ::core::option::Option<method_options::IdempotencyLevel>,
pub features: ::buffa::MessageField<FeatureSet>,
pub uninterpreted_option: ::buffa::alloc::vec::Vec<UninterpretedOption>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MethodOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MethodOptions")
.field("deprecated", &self.deprecated)
.field("idempotency_level", &self.idempotency_level)
.field("features", &self.features)
.field("uninterpreted_option", &self.uninterpreted_option)
.finish()
}
}
impl MethodOptions {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.MethodOptions";
}
impl ::buffa::DefaultInstance for MethodOptions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MethodOptions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for MethodOptions {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.deprecated.is_some() {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.idempotency_level {
size += 2u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.uninterpreted_option {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.deprecated {
::buffa::encoding::Tag::new(33u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.idempotency_level {
::buffa::encoding::Tag::new(34u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if self.features.is_set() {
::buffa::encoding::Tag::new(
35u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.features.write_to(__cache, buf);
}
for v in &self.uninterpreted_option {
::buffa::encoding::Tag::new(
999u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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() {
33u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 33u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deprecated = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
34u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 34u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.idempotency_level = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 34u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
35u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 35u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.features.get_or_insert_default(),
buf,
depth,
)?;
}
999u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 999u32,
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.uninterpreted_option.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.deprecated = ::core::option::Option::None;
self.idempotency_level = ::core::option::Option::None;
self.features = ::buffa::MessageField::none();
self.uninterpreted_option.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MethodOptions {
const PROTO_FQN: &'static str = "google.protobuf.MethodOptions";
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 method_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum IdempotencyLevel {
IDEMPOTENCY_UNKNOWN = 0i32,
NO_SIDE_EFFECTS = 1i32,
IDEMPOTENT = 2i32,
}
impl ::core::default::Default for IdempotencyLevel {
fn default() -> Self {
Self::IDEMPOTENCY_UNKNOWN
}
}
impl ::buffa::Enumeration for IdempotencyLevel {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
2i32 => ::core::option::Option::Some(Self::IDEMPOTENT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::IDEMPOTENCY_UNKNOWN => "IDEMPOTENCY_UNKNOWN",
Self::NO_SIDE_EFFECTS => "NO_SIDE_EFFECTS",
Self::IDEMPOTENT => "IDEMPOTENT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"IDEMPOTENCY_UNKNOWN" => {
::core::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN)
}
"NO_SIDE_EFFECTS" => ::core::option::Option::Some(Self::NO_SIDE_EFFECTS),
"IDEMPOTENT" => ::core::option::Option::Some(Self::IDEMPOTENT),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::IDEMPOTENCY_UNKNOWN, Self::NO_SIDE_EFFECTS, Self::IDEMPOTENT]
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct UninterpretedOption {
pub name: ::buffa::alloc::vec::Vec<uninterpreted_option::NamePart>,
pub identifier_value: ::core::option::Option<::buffa::alloc::string::String>,
pub positive_int_value: ::core::option::Option<u64>,
pub negative_int_value: ::core::option::Option<i64>,
pub double_value: ::core::option::Option<f64>,
pub string_value: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
pub aggregate_value: ::core::option::Option<::buffa::alloc::string::String>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for UninterpretedOption {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("UninterpretedOption")
.field("name", &self.name)
.field("identifier_value", &self.identifier_value)
.field("positive_int_value", &self.positive_int_value)
.field("negative_int_value", &self.negative_int_value)
.field("double_value", &self.double_value)
.field("string_value", &self.string_value)
.field("aggregate_value", &self.aggregate_value)
.finish()
}
}
impl UninterpretedOption {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption";
}
impl ::buffa::DefaultInstance for UninterpretedOption {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<UninterpretedOption> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for UninterpretedOption {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.name {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.identifier_value {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.positive_int_value {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
if let Some(v) = self.negative_int_value {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if self.double_value.is_some() {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
if let Some(ref v) = self.string_value {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if let Some(ref v) = self.aggregate_value {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.name {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.identifier_value {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.positive_int_value {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
if let Some(v) = self.negative_int_value {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if let Some(v) = self.double_value {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(v, buf);
}
if let Some(ref v) = self.string_value {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if let Some(ref v) = self.aggregate_value {
::buffa::encoding::Tag::new(
8u32,
::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() {
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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.name.push(elem);
}
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::types::merge_string(
self
.identifier_value
.get_or_insert_with(::buffa::alloc::string::String::new),
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.positive_int_value = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.negative_int_value = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.double_value = ::core::option::Option::Some(
::buffa::types::decode_double(buf)?,
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_bytes(
self.string_value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
buf,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.aggregate_value
.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 clear(&mut self) {
self.name.clear();
self.identifier_value = ::core::option::Option::None;
self.positive_int_value = ::core::option::Option::None;
self.negative_int_value = ::core::option::Option::None;
self.double_value = ::core::option::Option::None;
self.string_value = ::core::option::Option::None;
self.aggregate_value = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for UninterpretedOption {
const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption";
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 uninterpreted_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct NamePart {
pub name_part: ::buffa::alloc::string::String,
pub is_extension: bool,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for NamePart {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("NamePart")
.field("name_part", &self.name_part)
.field("is_extension", &self.is_extension)
.finish()
}
}
impl NamePart {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart";
}
impl ::buffa::DefaultInstance for NamePart {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<NamePart> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for NamePart {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
size += 1u32 + ::buffa::types::string_encoded_len(&self.name_part) as u32;
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name_part, buf);
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.is_extension, 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(&mut self.name_part, 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.is_extension = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name_part.clear();
self.is_extension = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for NamePart {
const PROTO_FQN: &'static str = "google.protobuf.UninterpretedOption.NamePart";
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 FeatureSet {
pub field_presence: ::core::option::Option<feature_set::FieldPresence>,
pub enum_type: ::core::option::Option<feature_set::EnumType>,
pub repeated_field_encoding: ::core::option::Option<
feature_set::RepeatedFieldEncoding,
>,
pub utf8_validation: ::core::option::Option<feature_set::Utf8Validation>,
pub message_encoding: ::core::option::Option<feature_set::MessageEncoding>,
pub json_format: ::core::option::Option<feature_set::JsonFormat>,
pub enforce_naming_style: ::core::option::Option<feature_set::EnforceNamingStyle>,
pub default_symbol_visibility: ::core::option::Option<
feature_set::visibility_feature::DefaultSymbolVisibility,
>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FeatureSet {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FeatureSet")
.field("field_presence", &self.field_presence)
.field("enum_type", &self.enum_type)
.field("repeated_field_encoding", &self.repeated_field_encoding)
.field("utf8_validation", &self.utf8_validation)
.field("message_encoding", &self.message_encoding)
.field("json_format", &self.json_format)
.field("enforce_naming_style", &self.enforce_naming_style)
.field("default_symbol_visibility", &self.default_symbol_visibility)
.finish()
}
}
impl FeatureSet {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet";
}
impl ::buffa::DefaultInstance for FeatureSet {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FeatureSet> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FeatureSet {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.field_presence {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.enum_type {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.repeated_field_encoding {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.utf8_validation {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.message_encoding {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.json_format {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.enforce_naming_style {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.default_symbol_visibility {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.field_presence {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.enum_type {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.repeated_field_encoding {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.utf8_validation {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.message_encoding {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.json_format {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.enforce_naming_style {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.default_symbol_visibility {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.field_presence = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 1u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.enum_type = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 2u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.repeated_field_encoding = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 3u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.utf8_validation = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 4u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.message_encoding = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 5u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.json_format = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 6u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.enforce_naming_style = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 7u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.default_symbol_visibility = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 8u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.field_presence = ::core::option::Option::None;
self.enum_type = ::core::option::Option::None;
self.repeated_field_encoding = ::core::option::Option::None;
self.utf8_validation = ::core::option::Option::None;
self.message_encoding = ::core::option::Option::None;
self.json_format = ::core::option::Option::None;
self.enforce_naming_style = ::core::option::Option::None;
self.default_symbol_visibility = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FeatureSet {
const PROTO_FQN: &'static str = "google.protobuf.FeatureSet";
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 feature_set {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum FieldPresence {
FIELD_PRESENCE_UNKNOWN = 0i32,
EXPLICIT = 1i32,
IMPLICIT = 2i32,
LEGACY_REQUIRED = 3i32,
}
impl ::core::default::Default for FieldPresence {
fn default() -> Self {
Self::FIELD_PRESENCE_UNKNOWN
}
}
impl ::buffa::Enumeration for FieldPresence {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::EXPLICIT),
2i32 => ::core::option::Option::Some(Self::IMPLICIT),
3i32 => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::FIELD_PRESENCE_UNKNOWN => "FIELD_PRESENCE_UNKNOWN",
Self::EXPLICIT => "EXPLICIT",
Self::IMPLICIT => "IMPLICIT",
Self::LEGACY_REQUIRED => "LEGACY_REQUIRED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"FIELD_PRESENCE_UNKNOWN" => {
::core::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN)
}
"EXPLICIT" => ::core::option::Option::Some(Self::EXPLICIT),
"IMPLICIT" => ::core::option::Option::Some(Self::IMPLICIT),
"LEGACY_REQUIRED" => ::core::option::Option::Some(Self::LEGACY_REQUIRED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::FIELD_PRESENCE_UNKNOWN,
Self::EXPLICIT,
Self::IMPLICIT,
Self::LEGACY_REQUIRED,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum EnumType {
ENUM_TYPE_UNKNOWN = 0i32,
OPEN = 1i32,
CLOSED = 2i32,
}
impl ::core::default::Default for EnumType {
fn default() -> Self {
Self::ENUM_TYPE_UNKNOWN
}
}
impl ::buffa::Enumeration for EnumType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::OPEN),
2i32 => ::core::option::Option::Some(Self::CLOSED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::ENUM_TYPE_UNKNOWN => "ENUM_TYPE_UNKNOWN",
Self::OPEN => "OPEN",
Self::CLOSED => "CLOSED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"ENUM_TYPE_UNKNOWN" => {
::core::option::Option::Some(Self::ENUM_TYPE_UNKNOWN)
}
"OPEN" => ::core::option::Option::Some(Self::OPEN),
"CLOSED" => ::core::option::Option::Some(Self::CLOSED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::ENUM_TYPE_UNKNOWN, Self::OPEN, Self::CLOSED]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum RepeatedFieldEncoding {
REPEATED_FIELD_ENCODING_UNKNOWN = 0i32,
PACKED = 1i32,
EXPANDED = 2i32,
}
impl ::core::default::Default for RepeatedFieldEncoding {
fn default() -> Self {
Self::REPEATED_FIELD_ENCODING_UNKNOWN
}
}
impl ::buffa::Enumeration for RepeatedFieldEncoding {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
}
1i32 => ::core::option::Option::Some(Self::PACKED),
2i32 => ::core::option::Option::Some(Self::EXPANDED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::REPEATED_FIELD_ENCODING_UNKNOWN => {
"REPEATED_FIELD_ENCODING_UNKNOWN"
}
Self::PACKED => "PACKED",
Self::EXPANDED => "EXPANDED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"REPEATED_FIELD_ENCODING_UNKNOWN" => {
::core::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
}
"PACKED" => ::core::option::Option::Some(Self::PACKED),
"EXPANDED" => ::core::option::Option::Some(Self::EXPANDED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::REPEATED_FIELD_ENCODING_UNKNOWN, Self::PACKED, Self::EXPANDED]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Utf8Validation {
UTF8_VALIDATION_UNKNOWN = 0i32,
VERIFY = 2i32,
NONE = 3i32,
}
impl ::core::default::Default for Utf8Validation {
fn default() -> Self {
Self::UTF8_VALIDATION_UNKNOWN
}
}
impl ::buffa::Enumeration for Utf8Validation {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN),
2i32 => ::core::option::Option::Some(Self::VERIFY),
3i32 => ::core::option::Option::Some(Self::NONE),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::UTF8_VALIDATION_UNKNOWN => "UTF8_VALIDATION_UNKNOWN",
Self::VERIFY => "VERIFY",
Self::NONE => "NONE",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"UTF8_VALIDATION_UNKNOWN" => {
::core::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
}
"VERIFY" => ::core::option::Option::Some(Self::VERIFY),
"NONE" => ::core::option::Option::Some(Self::NONE),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::UTF8_VALIDATION_UNKNOWN, Self::VERIFY, Self::NONE]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum MessageEncoding {
MESSAGE_ENCODING_UNKNOWN = 0i32,
LENGTH_PREFIXED = 1i32,
DELIMITED = 2i32,
}
impl ::core::default::Default for MessageEncoding {
fn default() -> Self {
Self::MESSAGE_ENCODING_UNKNOWN
}
}
impl ::buffa::Enumeration for MessageEncoding {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
2i32 => ::core::option::Option::Some(Self::DELIMITED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::MESSAGE_ENCODING_UNKNOWN => "MESSAGE_ENCODING_UNKNOWN",
Self::LENGTH_PREFIXED => "LENGTH_PREFIXED",
Self::DELIMITED => "DELIMITED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"MESSAGE_ENCODING_UNKNOWN" => {
::core::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
}
"LENGTH_PREFIXED" => ::core::option::Option::Some(Self::LENGTH_PREFIXED),
"DELIMITED" => ::core::option::Option::Some(Self::DELIMITED),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::MESSAGE_ENCODING_UNKNOWN, Self::LENGTH_PREFIXED, Self::DELIMITED]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum JsonFormat {
JSON_FORMAT_UNKNOWN = 0i32,
ALLOW = 1i32,
LEGACY_BEST_EFFORT = 2i32,
}
impl ::core::default::Default for JsonFormat {
fn default() -> Self {
Self::JSON_FORMAT_UNKNOWN
}
}
impl ::buffa::Enumeration for JsonFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::ALLOW),
2i32 => ::core::option::Option::Some(Self::LEGACY_BEST_EFFORT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::JSON_FORMAT_UNKNOWN => "JSON_FORMAT_UNKNOWN",
Self::ALLOW => "ALLOW",
Self::LEGACY_BEST_EFFORT => "LEGACY_BEST_EFFORT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"JSON_FORMAT_UNKNOWN" => {
::core::option::Option::Some(Self::JSON_FORMAT_UNKNOWN)
}
"ALLOW" => ::core::option::Option::Some(Self::ALLOW),
"LEGACY_BEST_EFFORT" => {
::core::option::Option::Some(Self::LEGACY_BEST_EFFORT)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::JSON_FORMAT_UNKNOWN, Self::ALLOW, Self::LEGACY_BEST_EFFORT]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum EnforceNamingStyle {
ENFORCE_NAMING_STYLE_UNKNOWN = 0i32,
STYLE2024 = 1i32,
STYLE_LEGACY = 2i32,
}
impl ::core::default::Default for EnforceNamingStyle {
fn default() -> Self {
Self::ENFORCE_NAMING_STYLE_UNKNOWN
}
}
impl ::buffa::Enumeration for EnforceNamingStyle {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN),
1i32 => ::core::option::Option::Some(Self::STYLE2024),
2i32 => ::core::option::Option::Some(Self::STYLE_LEGACY),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::ENFORCE_NAMING_STYLE_UNKNOWN => "ENFORCE_NAMING_STYLE_UNKNOWN",
Self::STYLE2024 => "STYLE2024",
Self::STYLE_LEGACY => "STYLE_LEGACY",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"ENFORCE_NAMING_STYLE_UNKNOWN" => {
::core::option::Option::Some(Self::ENFORCE_NAMING_STYLE_UNKNOWN)
}
"STYLE2024" => ::core::option::Option::Some(Self::STYLE2024),
"STYLE_LEGACY" => ::core::option::Option::Some(Self::STYLE_LEGACY),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::ENFORCE_NAMING_STYLE_UNKNOWN, Self::STYLE2024, Self::STYLE_LEGACY]
}
}
#[derive(Clone, PartialEq, Default)]
pub struct VisibilityFeature {
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VisibilityFeature {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VisibilityFeature").finish()
}
}
impl VisibilityFeature {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature";
}
impl ::buffa::DefaultInstance for VisibilityFeature {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VisibilityFeature> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for VisibilityFeature {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
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() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VisibilityFeature {
const PROTO_FQN: &'static str = "google.protobuf.FeatureSet.VisibilityFeature";
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 visibility_feature {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum DefaultSymbolVisibility {
DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0i32,
EXPORT_ALL = 1i32,
EXPORT_TOP_LEVEL = 2i32,
LOCAL_ALL = 3i32,
STRICT = 4i32,
}
impl ::core::default::Default for DefaultSymbolVisibility {
fn default() -> Self {
Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN
}
}
impl ::buffa::Enumeration for DefaultSymbolVisibility {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(
Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
)
}
1i32 => ::core::option::Option::Some(Self::EXPORT_ALL),
2i32 => ::core::option::Option::Some(Self::EXPORT_TOP_LEVEL),
3i32 => ::core::option::Option::Some(Self::LOCAL_ALL),
4i32 => ::core::option::Option::Some(Self::STRICT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => {
"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"
}
Self::EXPORT_ALL => "EXPORT_ALL",
Self::EXPORT_TOP_LEVEL => "EXPORT_TOP_LEVEL",
Self::LOCAL_ALL => "LOCAL_ALL",
Self::STRICT => "STRICT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => {
::core::option::Option::Some(
Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
)
}
"EXPORT_ALL" => ::core::option::Option::Some(Self::EXPORT_ALL),
"EXPORT_TOP_LEVEL" => {
::core::option::Option::Some(Self::EXPORT_TOP_LEVEL)
}
"LOCAL_ALL" => ::core::option::Option::Some(Self::LOCAL_ALL),
"STRICT" => ::core::option::Option::Some(Self::STRICT),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN,
Self::EXPORT_ALL,
Self::EXPORT_TOP_LEVEL,
Self::LOCAL_ALL,
Self::STRICT,
]
}
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct FeatureSetDefaults {
pub defaults: ::buffa::alloc::vec::Vec<
feature_set_defaults::FeatureSetEditionDefault,
>,
pub minimum_edition: ::core::option::Option<Edition>,
pub maximum_edition: ::core::option::Option<Edition>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FeatureSetDefaults {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FeatureSetDefaults")
.field("defaults", &self.defaults)
.field("minimum_edition", &self.minimum_edition)
.field("maximum_edition", &self.maximum_edition)
.finish()
}
}
impl FeatureSetDefaults {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults";
}
impl ::buffa::DefaultInstance for FeatureSetDefaults {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FeatureSetDefaults> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FeatureSetDefaults {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.defaults {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.minimum_edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if let Some(ref v) = self.maximum_edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.defaults {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.minimum_edition {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(ref v) = self.maximum_edition {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.defaults.push(elem);
}
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.minimum_edition = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 4u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.maximum_edition = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 5u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.defaults.clear();
self.minimum_edition = ::core::option::Option::None;
self.maximum_edition = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FeatureSetDefaults {
const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults";
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 feature_set_defaults {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct FeatureSetEditionDefault {
pub edition: ::core::option::Option<super::Edition>,
pub overridable_features: ::buffa::MessageField<super::FeatureSet>,
pub fixed_features: ::buffa::MessageField<super::FeatureSet>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FeatureSetEditionDefault {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FeatureSetEditionDefault")
.field("edition", &self.edition)
.field("overridable_features", &self.overridable_features)
.field("fixed_features", &self.fixed_features)
.finish()
}
}
impl FeatureSetEditionDefault {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
}
impl ::buffa::DefaultInstance for FeatureSetEditionDefault {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FeatureSetEditionDefault> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for FeatureSetEditionDefault {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(ref v) = self.edition {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.overridable_features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.overridable_features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.fixed_features.is_set() {
let __slot = __cache.reserve();
let inner_size = self.fixed_features.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(ref v) = self.edition {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if self.overridable_features.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.overridable_features.write_to(__cache, buf);
}
if self.fixed_features.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.fixed_features.write_to(__cache, 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() {
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,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.edition = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 3u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
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::Message::merge_length_delimited(
self.overridable_features.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.fixed_features.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.edition = ::core::option::Option::None;
self.overridable_features = ::buffa::MessageField::none();
self.fixed_features = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FeatureSetEditionDefault {
const PROTO_FQN: &'static str = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
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 SourceCodeInfo {
pub location: ::buffa::alloc::vec::Vec<source_code_info::Location>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SourceCodeInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SourceCodeInfo").field("location", &self.location).finish()
}
}
impl SourceCodeInfo {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo";
}
impl ::buffa::DefaultInstance for SourceCodeInfo {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SourceCodeInfo> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for SourceCodeInfo {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.location {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.location {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.location.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SourceCodeInfo {
const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo";
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 source_code_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct Location {
pub path: ::buffa::alloc::vec::Vec<i32>,
pub span: ::buffa::alloc::vec::Vec<i32>,
pub leading_comments: ::core::option::Option<::buffa::alloc::string::String>,
pub trailing_comments: ::core::option::Option<::buffa::alloc::string::String>,
pub leading_detached_comments: ::buffa::alloc::vec::Vec<
::buffa::alloc::string::String,
>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Location {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Location")
.field("path", &self.path)
.field("span", &self.span)
.field("leading_comments", &self.leading_comments)
.field("trailing_comments", &self.trailing_comments)
.field("leading_detached_comments", &self.leading_detached_comments)
.finish()
}
}
impl Location {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.SourceCodeInfo.Location";
}
impl ::buffa::DefaultInstance for Location {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Location> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for Location {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.path.is_empty() {
let payload: u32 = self
.path
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
+ payload;
}
if !self.span.is_empty() {
let payload: u32 = self
.span
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
+ payload;
}
if let Some(ref v) = self.leading_comments {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.trailing_comments {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.leading_detached_comments {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.path.is_empty() {
let payload: u32 = self
.path
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.path {
::buffa::types::encode_int32(v, buf);
}
}
if !self.span.is_empty() {
let payload: u32 = self
.span
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.span {
::buffa::types::encode_int32(v, buf);
}
}
if let Some(ref v) = self.leading_comments {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.trailing_comments {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.leading_detached_comments {
::buffa::encoding::Tag::new(
6u32,
::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::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.path.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.path.push(::buffa::types::decode_int32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.path.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
2u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.span.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.span.push(::buffa::types::decode_int32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.span.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
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::types::merge_string(
self
.leading_comments
.get_or_insert_with(::buffa::alloc::string::String::new),
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
.trailing_comments
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.leading_detached_comments
.push(::buffa::types::decode_string(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.path.clear();
self.span.clear();
self.leading_comments = ::core::option::Option::None;
self.trailing_comments = ::core::option::Option::None;
self.leading_detached_comments.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Location {
const PROTO_FQN: &'static str = "google.protobuf.SourceCodeInfo.Location";
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 GeneratedCodeInfo {
pub annotation: ::buffa::alloc::vec::Vec<generated_code_info::Annotation>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GeneratedCodeInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GeneratedCodeInfo")
.field("annotation", &self.annotation)
.finish()
}
}
impl GeneratedCodeInfo {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo";
}
impl ::buffa::DefaultInstance for GeneratedCodeInfo {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GeneratedCodeInfo> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for GeneratedCodeInfo {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.annotation {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.annotation {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, 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,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.annotation.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.annotation.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GeneratedCodeInfo {
const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo";
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 generated_code_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct Annotation {
pub path: ::buffa::alloc::vec::Vec<i32>,
pub source_file: ::core::option::Option<::buffa::alloc::string::String>,
pub begin: ::core::option::Option<i32>,
pub end: ::core::option::Option<i32>,
pub semantic: ::core::option::Option<
super::generated_code_info::annotation::Semantic,
>,
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Annotation {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Annotation")
.field("path", &self.path)
.field("source_file", &self.source_file)
.field("begin", &self.begin)
.field("end", &self.end)
.field("semantic", &self.semantic)
.finish()
}
}
impl Annotation {
pub const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation";
}
impl ::buffa::DefaultInstance for Annotation {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Annotation> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::Message for Annotation {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.path.is_empty() {
let payload: u32 = self
.path
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
+ payload;
}
if let Some(ref v) = self.source_file {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.begin {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(v) = self.end {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.semantic {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.path.is_empty() {
let payload: u32 = self
.path
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.path {
::buffa::types::encode_int32(v, buf);
}
}
if let Some(ref v) = self.source_file {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.begin {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(v) = self.end {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.semantic {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), 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 {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.path.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.path.push(::buffa::types::decode_int32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.path.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
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
.source_file
.get_or_insert_with(::buffa::alloc::string::String::new),
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.begin = ::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.end = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.semantic = ::core::option::Option::Some(__v);
} else {
self.__buffa_unknown_fields
.push(::buffa::UnknownField {
number: 5u32,
data: ::buffa::UnknownFieldData::Varint(__raw as u64),
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.path.clear();
self.source_file = ::core::option::Option::None;
self.begin = ::core::option::Option::None;
self.end = ::core::option::Option::None;
self.semantic = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Annotation {
const PROTO_FQN: &'static str = "google.protobuf.GeneratedCodeInfo.Annotation";
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 annotation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Semantic {
NONE = 0i32,
SET = 1i32,
ALIAS = 2i32,
}
impl ::core::default::Default for Semantic {
fn default() -> Self {
Self::NONE
}
}
impl ::buffa::Enumeration for Semantic {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::NONE),
1i32 => ::core::option::Option::Some(Self::SET),
2i32 => ::core::option::Option::Some(Self::ALIAS),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::NONE => "NONE",
Self::SET => "SET",
Self::ALIAS => "ALIAS",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"NONE" => ::core::option::Option::Some(Self::NONE),
"SET" => ::core::option::Option::Some(Self::SET),
"ALIAS" => ::core::option::Option::Some(Self::ALIAS),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::NONE, Self::SET, Self::ALIAS]
}
}
}
}