aboutsummaryrefslogtreecommitdiff
path: root/src/well_known_types/api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/well_known_types/api.rs')
-rw-r--r--src/well_known_types/api.rs1138
1 files changed, 388 insertions, 750 deletions
diff --git a/src/well_known_types/api.rs b/src/well_known_types/api.rs
index ef97015..afd19d3 100644
--- a/src/well_known_types/api.rs
+++ b/src/well_known_types/api.rs
@@ -1,4 +1,5 @@
-// This file is generated by rust-protobuf 2.26.0. Do not edit
+// This file is generated by rust-protobuf 3.0.0-pre. Do not edit
+// .proto file is parsed by protoc --rust-out=...
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
@@ -15,26 +16,70 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
-#![allow(unused_imports)]
#![allow(unused_results)]
+#![allow(unused_mut)]
+
//! Generated file from `google/protobuf/api.proto`
-#[derive(PartialEq,Clone,Default)]
-#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
+/// Api is a light-weight descriptor for an API Interface.
+///
+/// Interfaces are also described as "protocol buffer services" in some contexts,
+/// such as by the "service" keyword in a .proto file, but they are different
+/// from API Services, which represent a concrete implementation of an interface
+/// as opposed to simply a description of methods and bindings. They are also
+/// sometimes simply referred to as "APIs" in other contexts, such as the name of
+/// this message itself. See https://cloud.google.com/apis/design/glossary for
+/// detailed terminology.
+#[derive(PartialEq,Clone,Default,Debug)]
+// @@protoc_insertion_point(message:google.protobuf.Api)
pub struct Api {
// message fields
+ /// The fully qualified name of this interface, including package name
+ /// followed by the interface's simple name.
+ // @@protoc_insertion_point(field:google.protobuf.Api.name)
pub name: ::std::string::String,
- pub methods: crate::RepeatedField<Method>,
- pub options: crate::RepeatedField<crate::well_known_types::Option>,
+ /// The methods of this interface, in unspecified order.
+ // @@protoc_insertion_point(field:google.protobuf.Api.methods)
+ pub methods: ::std::vec::Vec<Method>,
+ /// Any metadata attached to the interface.
+ // @@protoc_insertion_point(field:google.protobuf.Api.options)
+ pub options: ::std::vec::Vec<crate::well_known_types::type_::Option>,
+ /// A version string for this interface. If specified, must have the form
+ /// `major-version.minor-version`, as in `1.10`. If the minor version is
+ /// omitted, it defaults to zero. If the entire version field is empty, the
+ /// major version is derived from the package name, as outlined below. If the
+ /// field is not empty, the version in the package name will be verified to be
+ /// consistent with what is provided here.
+ ///
+ /// The versioning schema uses [semantic
+ /// versioning](http://semver.org) where the major version number
+ /// indicates a breaking change and the minor version an additive,
+ /// non-breaking change. Both version numbers are signals to users
+ /// what to expect from different versions, and should be carefully
+ /// chosen based on the product plan.
+ ///
+ /// The major version is also reflected in the package name of the
+ /// interface, which must end in `v<major-version>`, as in
+ /// `google.feature.v1`. For major versions 0 and 1, the suffix can
+ /// be omitted. Zero major versions must only be used for
+ /// experimental, non-GA interfaces.
+ ///
+ ///
+ // @@protoc_insertion_point(field:google.protobuf.Api.version)
pub version: ::std::string::String,
- pub source_context: crate::SingularPtrField<crate::well_known_types::SourceContext>,
- pub mixins: crate::RepeatedField<Mixin>,
- pub syntax: crate::well_known_types::Syntax,
+ /// Source context for the protocol buffer service represented by this
+ /// message.
+ // @@protoc_insertion_point(field:google.protobuf.Api.source_context)
+ pub source_context: crate::MessageField<crate::well_known_types::source_context::SourceContext>,
+ /// Included interfaces. See [Mixin][].
+ // @@protoc_insertion_point(field:google.protobuf.Api.mixins)
+ pub mixins: ::std::vec::Vec<Mixin>,
+ /// The source syntax of the service.
+ // @@protoc_insertion_point(field:google.protobuf.Api.syntax)
+ pub syntax: crate::EnumOrUnknown<crate::well_known_types::type_::Syntax>,
// special fields
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub unknown_fields: crate::UnknownFields,
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub cached_size: crate::CachedSize,
+ // @@protoc_insertion_point(special_field:google.protobuf.Api.special_fields)
+ pub special_fields: crate::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Api {
@@ -48,234 +93,85 @@ impl Api {
::std::default::Default::default()
}
- // string name = 1;
-
-
- pub fn get_name(&self) -> &str {
- &self.name
- }
- pub fn clear_name(&mut self) {
- self.name.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_name(&mut self, v: ::std::string::String) {
- self.name = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_name(&mut self) -> &mut ::std::string::String {
- &mut self.name
- }
-
- // Take field
- pub fn take_name(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.name, ::std::string::String::new())
- }
-
- // repeated .google.protobuf.Method methods = 2;
-
-
- pub fn get_methods(&self) -> &[Method] {
- &self.methods
- }
- pub fn clear_methods(&mut self) {
- self.methods.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_methods(&mut self, v: crate::RepeatedField<Method>) {
- self.methods = v;
- }
-
- // Mutable pointer to the field.
- pub fn mut_methods(&mut self) -> &mut crate::RepeatedField<Method> {
- &mut self.methods
- }
-
- // Take field
- pub fn take_methods(&mut self) -> crate::RepeatedField<Method> {
- ::std::mem::replace(&mut self.methods, crate::RepeatedField::new())
- }
-
- // repeated .google.protobuf.Option options = 3;
-
-
- pub fn get_options(&self) -> &[crate::well_known_types::Option] {
- &self.options
- }
- pub fn clear_options(&mut self) {
- self.options.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_options(&mut self, v: crate::RepeatedField<crate::well_known_types::Option>) {
- self.options = v;
- }
-
- // Mutable pointer to the field.
- pub fn mut_options(&mut self) -> &mut crate::RepeatedField<crate::well_known_types::Option> {
- &mut self.options
- }
-
- // Take field
- pub fn take_options(&mut self) -> crate::RepeatedField<crate::well_known_types::Option> {
- ::std::mem::replace(&mut self.options, crate::RepeatedField::new())
- }
-
- // string version = 4;
-
-
- pub fn get_version(&self) -> &str {
- &self.version
- }
- pub fn clear_version(&mut self) {
- self.version.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_version(&mut self, v: ::std::string::String) {
- self.version = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_version(&mut self) -> &mut ::std::string::String {
- &mut self.version
- }
-
- // Take field
- pub fn take_version(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.version, ::std::string::String::new())
- }
-
- // .google.protobuf.SourceContext source_context = 5;
-
-
- pub fn get_source_context(&self) -> &crate::well_known_types::SourceContext {
- self.source_context.as_ref().unwrap_or_else(|| <crate::well_known_types::SourceContext as crate::Message>::default_instance())
- }
- pub fn clear_source_context(&mut self) {
- self.source_context.clear();
- }
-
- pub fn has_source_context(&self) -> bool {
- self.source_context.is_some()
- }
-
- // Param is passed by value, moved
- pub fn set_source_context(&mut self, v: crate::well_known_types::SourceContext) {
- self.source_context = crate::SingularPtrField::some(v);
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_source_context(&mut self) -> &mut crate::well_known_types::SourceContext {
- if self.source_context.is_none() {
- self.source_context.set_default();
- }
- self.source_context.as_mut().unwrap()
- }
-
- // Take field
- pub fn take_source_context(&mut self) -> crate::well_known_types::SourceContext {
- self.source_context.take().unwrap_or_else(|| crate::well_known_types::SourceContext::new())
- }
-
- // repeated .google.protobuf.Mixin mixins = 6;
-
-
- pub fn get_mixins(&self) -> &[Mixin] {
- &self.mixins
- }
- pub fn clear_mixins(&mut self) {
- self.mixins.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_mixins(&mut self, v: crate::RepeatedField<Mixin>) {
- self.mixins = v;
- }
-
- // Mutable pointer to the field.
- pub fn mut_mixins(&mut self) -> &mut crate::RepeatedField<Mixin> {
- &mut self.mixins
- }
-
- // Take field
- pub fn take_mixins(&mut self) -> crate::RepeatedField<Mixin> {
- ::std::mem::replace(&mut self.mixins, crate::RepeatedField::new())
- }
-
- // .google.protobuf.Syntax syntax = 7;
-
-
- pub fn get_syntax(&self) -> crate::well_known_types::Syntax {
- self.syntax
- }
- pub fn clear_syntax(&mut self) {
- self.syntax = crate::well_known_types::Syntax::SYNTAX_PROTO2;
- }
-
- // Param is passed by value, moved
- pub fn set_syntax(&mut self, v: crate::well_known_types::Syntax) {
- self.syntax = v;
+ fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(7);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "name",
+ |m: &Api| { &m.name },
+ |m: &mut Api| { &mut m.name },
+ ));
+ fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "methods",
+ |m: &Api| { &m.methods },
+ |m: &mut Api| { &mut m.methods },
+ ));
+ fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "options",
+ |m: &Api| { &m.options },
+ |m: &mut Api| { &mut m.options },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "version",
+ |m: &Api| { &m.version },
+ |m: &mut Api| { &mut m.version },
+ ));
+ fields.push(crate::reflect::rt::v2::make_message_field_accessor::<_, crate::well_known_types::source_context::SourceContext>(
+ "source_context",
+ |m: &Api| { &m.source_context },
+ |m: &mut Api| { &mut m.source_context },
+ ));
+ fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "mixins",
+ |m: &Api| { &m.mixins },
+ |m: &mut Api| { &mut m.mixins },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "syntax",
+ |m: &Api| { &m.syntax },
+ |m: &mut Api| { &mut m.syntax },
+ ));
+ crate::reflect::GeneratedMessageDescriptorData::new_2::<Api>(
+ "Api",
+ fields,
+ oneofs,
+ )
}
}
impl crate::Message for Api {
+ const NAME: &'static str = "Api";
+
fn is_initialized(&self) -> bool {
- for v in &self.methods {
- if !v.is_initialized() {
- return false;
- }
- };
- for v in &self.options {
- if !v.is_initialized() {
- return false;
- }
- };
- for v in &self.source_context {
- if !v.is_initialized() {
- return false;
- }
- };
- for v in &self.mixins {
- if !v.is_initialized() {
- return false;
- }
- };
true
}
- fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
+ fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.name = is.read_string()?;
},
- 2 => {
- crate::rt::read_repeated_message_into(wire_type, is, &mut self.methods)?;
+ 18 => {
+ self.methods.push(is.read_message()?);
},
- 3 => {
- crate::rt::read_repeated_message_into(wire_type, is, &mut self.options)?;
+ 26 => {
+ self.options.push(is.read_message()?);
},
- 4 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.version)?;
+ 34 => {
+ self.version = is.read_string()?;
},
- 5 => {
- crate::rt::read_singular_message_into(wire_type, is, &mut self.source_context)?;
+ 42 => {
+ crate::rt::read_singular_message_into_field(is, &mut self.source_context)?;
},
- 6 => {
- crate::rt::read_repeated_message_into(wire_type, is, &mut self.mixins)?;
+ 50 => {
+ self.mixins.push(is.read_message()?);
},
- 7 => {
- crate::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.syntax, 7, &mut self.unknown_fields)?
+ 56 => {
+ self.syntax = is.read_enum_or_unknown()?;
},
- _ => {
- crate::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ tag => {
+ crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
@@ -284,156 +180,76 @@ impl crate::Message for Api {
// Compute sizes of nested messages
#[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
+ fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.name.is_empty() {
my_size += crate::rt::string_size(1, &self.name);
}
for value in &self.methods {
let len = value.compute_size();
- my_size += 1 + crate::rt::compute_raw_varint32_size(len) + len;
+ my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.options {
let len = value.compute_size();
- my_size += 1 + crate::rt::compute_raw_varint32_size(len) + len;
+ my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len;
};
if !self.version.is_empty() {
my_size += crate::rt::string_size(4, &self.version);
}
- if let Some(ref v) = self.source_context.as_ref() {
+ if let Some(v) = self.source_context.as_ref() {
let len = v.compute_size();
- my_size += 1 + crate::rt::compute_raw_varint32_size(len) + len;
+ my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len;
}
for value in &self.mixins {
let len = value.compute_size();
- my_size += 1 + crate::rt::compute_raw_varint32_size(len) + len;
+ my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len;
};
- if self.syntax != crate::well_known_types::Syntax::SYNTAX_PROTO2 {
- my_size += crate::rt::enum_size(7, self.syntax);
+ if self.syntax != crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2) {
+ my_size += crate::rt::int32_size(7, self.syntax.value());
}
- my_size += crate::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
+ my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
my_size
}
- fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::ProtobufResult<()> {
+ fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> {
if !self.name.is_empty() {
os.write_string(1, &self.name)?;
}
for v in &self.methods {
- os.write_tag(2, crate::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
+ crate::rt::write_message_field_with_cached_size(2, v, os)?;
};
for v in &self.options {
- os.write_tag(3, crate::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
+ crate::rt::write_message_field_with_cached_size(3, v, os)?;
};
if !self.version.is_empty() {
os.write_string(4, &self.version)?;
}
- if let Some(ref v) = self.source_context.as_ref() {
- os.write_tag(5, crate::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
+ if let Some(v) = self.source_context.as_ref() {
+ crate::rt::write_message_field_with_cached_size(5, v, os)?;
}
for v in &self.mixins {
- os.write_tag(6, crate::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
+ crate::rt::write_message_field_with_cached_size(6, v, os)?;
};
- if self.syntax != crate::well_known_types::Syntax::SYNTAX_PROTO2 {
- os.write_enum(7, crate::ProtobufEnum::value(&self.syntax))?;
+ if self.syntax != crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2) {
+ os.write_enum(7, crate::EnumOrUnknown::value(&self.syntax))?;
}
- os.write_unknown_fields(self.get_unknown_fields())?;
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
-
- fn get_unknown_fields(&self) -> &crate::UnknownFields {
- &self.unknown_fields
+ fn special_fields(&self) -> &crate::SpecialFields {
+ &self.special_fields
}
- fn mut_unknown_fields(&mut self) -> &mut crate::UnknownFields {
- &mut self.unknown_fields
- }
-
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
-
- fn descriptor(&self) -> &'static crate::reflect::MessageDescriptor {
- Self::descriptor_static()
+ fn mut_special_fields(&mut self) -> &mut crate::SpecialFields {
+ &mut self.special_fields
}
fn new() -> Api {
Api::new()
}
- fn descriptor_static() -> &'static crate::reflect::MessageDescriptor {
- static descriptor: crate::rt::LazyV2<crate::reflect::MessageDescriptor> = crate::rt::LazyV2::INIT;
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "name",
- |m: &Api| { &m.name },
- |m: &mut Api| { &mut m.name },
- ));
- fields.push(crate::reflect::accessor::make_repeated_field_accessor::<_, crate::types::ProtobufTypeMessage<Method>>(
- "methods",
- |m: &Api| { &m.methods },
- |m: &mut Api| { &mut m.methods },
- ));
- fields.push(crate::reflect::accessor::make_repeated_field_accessor::<_, crate::types::ProtobufTypeMessage<crate::well_known_types::Option>>(
- "options",
- |m: &Api| { &m.options },
- |m: &mut Api| { &mut m.options },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "version",
- |m: &Api| { &m.version },
- |m: &mut Api| { &mut m.version },
- ));
- fields.push(crate::reflect::accessor::make_singular_ptr_field_accessor::<_, crate::types::ProtobufTypeMessage<crate::well_known_types::SourceContext>>(
- "source_context",
- |m: &Api| { &m.source_context },
- |m: &mut Api| { &mut m.source_context },
- ));
- fields.push(crate::reflect::accessor::make_repeated_field_accessor::<_, crate::types::ProtobufTypeMessage<Mixin>>(
- "mixins",
- |m: &Api| { &m.mixins },
- |m: &mut Api| { &mut m.mixins },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeEnum<crate::well_known_types::Syntax>>(
- "syntax",
- |m: &Api| { &m.syntax },
- |m: &mut Api| { &mut m.syntax },
- ));
- crate::reflect::MessageDescriptor::new_pb_name::<Api>(
- "Api",
- fields,
- file_descriptor_proto()
- )
- })
- }
-
- fn default_instance() -> &'static Api {
- static instance: crate::rt::LazyV2<Api> = crate::rt::LazyV2::INIT;
- instance.get(Api::new)
- }
-}
-
-impl crate::Clear for Api {
fn clear(&mut self) {
self.name.clear();
self.methods.clear();
@@ -441,39 +257,71 @@ impl crate::Clear for Api {
self.version.clear();
self.source_context.clear();
self.mixins.clear();
- self.syntax = crate::well_known_types::Syntax::SYNTAX_PROTO2;
- self.unknown_fields.clear();
+ self.syntax = crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2);
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static Api {
+ static instance: Api = Api {
+ name: ::std::string::String::new(),
+ methods: ::std::vec::Vec::new(),
+ options: ::std::vec::Vec::new(),
+ version: ::std::string::String::new(),
+ source_context: crate::MessageField::none(),
+ mixins: ::std::vec::Vec::new(),
+ syntax: crate::EnumOrUnknown::from_i32(0),
+ special_fields: crate::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl crate::MessageFull for Api {
+ fn descriptor() -> crate::reflect::MessageDescriptor {
+ static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("Api").unwrap()).clone()
}
}
-impl ::std::fmt::Debug for Api {
+impl ::std::fmt::Display for Api {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
crate::text_format::fmt(self, f)
}
}
impl crate::reflect::ProtobufValue for Api {
- fn as_ref(&self) -> crate::reflect::ReflectValueRef {
- crate::reflect::ReflectValueRef::Message(self)
- }
+ type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>;
}
-#[derive(PartialEq,Clone,Default)]
-#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
+/// Method represents a method of an API interface.
+#[derive(PartialEq,Clone,Default,Debug)]
+// @@protoc_insertion_point(message:google.protobuf.Method)
pub struct Method {
// message fields
+ /// The simple name of this method.
+ // @@protoc_insertion_point(field:google.protobuf.Method.name)
pub name: ::std::string::String,
+ /// A URL of the input message type.
+ // @@protoc_insertion_point(field:google.protobuf.Method.request_type_url)
pub request_type_url: ::std::string::String,
+ /// If true, the request is streamed.
+ // @@protoc_insertion_point(field:google.protobuf.Method.request_streaming)
pub request_streaming: bool,
+ /// The URL of the output message type.
+ // @@protoc_insertion_point(field:google.protobuf.Method.response_type_url)
pub response_type_url: ::std::string::String,
+ /// If true, the response is streamed.
+ // @@protoc_insertion_point(field:google.protobuf.Method.response_streaming)
pub response_streaming: bool,
- pub options: crate::RepeatedField<crate::well_known_types::Option>,
- pub syntax: crate::well_known_types::Syntax,
+ /// Any metadata attached to the method.
+ // @@protoc_insertion_point(field:google.protobuf.Method.options)
+ pub options: ::std::vec::Vec<crate::well_known_types::type_::Option>,
+ /// The source syntax of this method.
+ // @@protoc_insertion_point(field:google.protobuf.Method.syntax)
+ pub syntax: crate::EnumOrUnknown<crate::well_known_types::type_::Syntax>,
// special fields
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub unknown_fields: crate::UnknownFields,
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub cached_size: crate::CachedSize,
+ // @@protoc_insertion_point(special_field:google.protobuf.Method.special_fields)
+ pub special_fields: crate::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Method {
@@ -487,200 +335,85 @@ impl Method {
::std::default::Default::default()
}
- // string name = 1;
-
-
- pub fn get_name(&self) -> &str {
- &self.name
- }
- pub fn clear_name(&mut self) {
- self.name.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_name(&mut self, v: ::std::string::String) {
- self.name = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_name(&mut self) -> &mut ::std::string::String {
- &mut self.name
- }
-
- // Take field
- pub fn take_name(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.name, ::std::string::String::new())
- }
-
- // string request_type_url = 2;
-
-
- pub fn get_request_type_url(&self) -> &str {
- &self.request_type_url
- }
- pub fn clear_request_type_url(&mut self) {
- self.request_type_url.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_request_type_url(&mut self, v: ::std::string::String) {
- self.request_type_url = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_request_type_url(&mut self) -> &mut ::std::string::String {
- &mut self.request_type_url
- }
-
- // Take field
- pub fn take_request_type_url(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.request_type_url, ::std::string::String::new())
- }
-
- // bool request_streaming = 3;
-
-
- pub fn get_request_streaming(&self) -> bool {
- self.request_streaming
- }
- pub fn clear_request_streaming(&mut self) {
- self.request_streaming = false;
- }
-
- // Param is passed by value, moved
- pub fn set_request_streaming(&mut self, v: bool) {
- self.request_streaming = v;
- }
-
- // string response_type_url = 4;
-
-
- pub fn get_response_type_url(&self) -> &str {
- &self.response_type_url
- }
- pub fn clear_response_type_url(&mut self) {
- self.response_type_url.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_response_type_url(&mut self, v: ::std::string::String) {
- self.response_type_url = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_response_type_url(&mut self) -> &mut ::std::string::String {
- &mut self.response_type_url
- }
-
- // Take field
- pub fn take_response_type_url(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.response_type_url, ::std::string::String::new())
- }
-
- // bool response_streaming = 5;
-
-
- pub fn get_response_streaming(&self) -> bool {
- self.response_streaming
- }
- pub fn clear_response_streaming(&mut self) {
- self.response_streaming = false;
- }
-
- // Param is passed by value, moved
- pub fn set_response_streaming(&mut self, v: bool) {
- self.response_streaming = v;
- }
-
- // repeated .google.protobuf.Option options = 6;
-
-
- pub fn get_options(&self) -> &[crate::well_known_types::Option] {
- &self.options
- }
- pub fn clear_options(&mut self) {
- self.options.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_options(&mut self, v: crate::RepeatedField<crate::well_known_types::Option>) {
- self.options = v;
- }
-
- // Mutable pointer to the field.
- pub fn mut_options(&mut self) -> &mut crate::RepeatedField<crate::well_known_types::Option> {
- &mut self.options
- }
-
- // Take field
- pub fn take_options(&mut self) -> crate::RepeatedField<crate::well_known_types::Option> {
- ::std::mem::replace(&mut self.options, crate::RepeatedField::new())
- }
-
- // .google.protobuf.Syntax syntax = 7;
-
-
- pub fn get_syntax(&self) -> crate::well_known_types::Syntax {
- self.syntax
- }
- pub fn clear_syntax(&mut self) {
- self.syntax = crate::well_known_types::Syntax::SYNTAX_PROTO2;
- }
-
- // Param is passed by value, moved
- pub fn set_syntax(&mut self, v: crate::well_known_types::Syntax) {
- self.syntax = v;
+ fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(7);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "name",
+ |m: &Method| { &m.name },
+ |m: &mut Method| { &mut m.name },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "request_type_url",
+ |m: &Method| { &m.request_type_url },
+ |m: &mut Method| { &mut m.request_type_url },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "request_streaming",
+ |m: &Method| { &m.request_streaming },
+ |m: &mut Method| { &mut m.request_streaming },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "response_type_url",
+ |m: &Method| { &m.response_type_url },
+ |m: &mut Method| { &mut m.response_type_url },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "response_streaming",
+ |m: &Method| { &m.response_streaming },
+ |m: &mut Method| { &mut m.response_streaming },
+ ));
+ fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "options",
+ |m: &Method| { &m.options },
+ |m: &mut Method| { &mut m.options },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "syntax",
+ |m: &Method| { &m.syntax },
+ |m: &mut Method| { &mut m.syntax },
+ ));
+ crate::reflect::GeneratedMessageDescriptorData::new_2::<Method>(
+ "Method",
+ fields,
+ oneofs,
+ )
}
}
impl crate::Message for Method {
+ const NAME: &'static str = "Method";
+
fn is_initialized(&self) -> bool {
- for v in &self.options {
- if !v.is_initialized() {
- return false;
- }
- };
true
}
- fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
+ fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.name = is.read_string()?;
},
- 2 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.request_type_url)?;
+ 18 => {
+ self.request_type_url = is.read_string()?;
},
- 3 => {
- if wire_type != crate::wire_format::WireTypeVarint {
- return ::std::result::Result::Err(crate::rt::unexpected_wire_type(wire_type));
- }
- let tmp = is.read_bool()?;
- self.request_streaming = tmp;
+ 24 => {
+ self.request_streaming = is.read_bool()?;
},
- 4 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.response_type_url)?;
+ 34 => {
+ self.response_type_url = is.read_string()?;
},
- 5 => {
- if wire_type != crate::wire_format::WireTypeVarint {
- return ::std::result::Result::Err(crate::rt::unexpected_wire_type(wire_type));
- }
- let tmp = is.read_bool()?;
- self.response_streaming = tmp;
+ 40 => {
+ self.response_streaming = is.read_bool()?;
},
- 6 => {
- crate::rt::read_repeated_message_into(wire_type, is, &mut self.options)?;
+ 50 => {
+ self.options.push(is.read_message()?);
},
- 7 => {
- crate::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.syntax, 7, &mut self.unknown_fields)?
+ 56 => {
+ self.syntax = is.read_enum_or_unknown()?;
},
- _ => {
- crate::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ tag => {
+ crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
@@ -689,7 +422,7 @@ impl crate::Message for Method {
// Compute sizes of nested messages
#[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
+ fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.name.is_empty() {
my_size += crate::rt::string_size(1, &self.name);
@@ -698,27 +431,27 @@ impl crate::Message for Method {
my_size += crate::rt::string_size(2, &self.request_type_url);
}
if self.request_streaming != false {
- my_size += 2;
+ my_size += 1 + 1;
}
if !self.response_type_url.is_empty() {
my_size += crate::rt::string_size(4, &self.response_type_url);
}
if self.response_streaming != false {
- my_size += 2;
+ my_size += 1 + 1;
}
for value in &self.options {
let len = value.compute_size();
- my_size += 1 + crate::rt::compute_raw_varint32_size(len) + len;
+ my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len;
};
- if self.syntax != crate::well_known_types::Syntax::SYNTAX_PROTO2 {
- my_size += crate::rt::enum_size(7, self.syntax);
+ if self.syntax != crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2) {
+ my_size += crate::rt::int32_size(7, self.syntax.value());
}
- my_size += crate::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
+ my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
my_size
}
- fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::ProtobufResult<()> {
+ fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> {
if !self.name.is_empty() {
os.write_string(1, &self.name)?;
}
@@ -735,101 +468,27 @@ impl crate::Message for Method {
os.write_bool(5, self.response_streaming)?;
}
for v in &self.options {
- os.write_tag(6, crate::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
+ crate::rt::write_message_field_with_cached_size(6, v, os)?;
};
- if self.syntax != crate::well_known_types::Syntax::SYNTAX_PROTO2 {
- os.write_enum(7, crate::ProtobufEnum::value(&self.syntax))?;
+ if self.syntax != crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2) {
+ os.write_enum(7, crate::EnumOrUnknown::value(&self.syntax))?;
}
- os.write_unknown_fields(self.get_unknown_fields())?;
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
-
- fn get_unknown_fields(&self) -> &crate::UnknownFields {
- &self.unknown_fields
- }
-
- fn mut_unknown_fields(&mut self) -> &mut crate::UnknownFields {
- &mut self.unknown_fields
- }
-
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
+ fn special_fields(&self) -> &crate::SpecialFields {
+ &self.special_fields
}
- fn descriptor(&self) -> &'static crate::reflect::MessageDescriptor {
- Self::descriptor_static()
+ fn mut_special_fields(&mut self) -> &mut crate::SpecialFields {
+ &mut self.special_fields
}
fn new() -> Method {
Method::new()
}
- fn descriptor_static() -> &'static crate::reflect::MessageDescriptor {
- static descriptor: crate::rt::LazyV2<crate::reflect::MessageDescriptor> = crate::rt::LazyV2::INIT;
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "name",
- |m: &Method| { &m.name },
- |m: &mut Method| { &mut m.name },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "request_type_url",
- |m: &Method| { &m.request_type_url },
- |m: &mut Method| { &mut m.request_type_url },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeBool>(
- "request_streaming",
- |m: &Method| { &m.request_streaming },
- |m: &mut Method| { &mut m.request_streaming },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "response_type_url",
- |m: &Method| { &m.response_type_url },
- |m: &mut Method| { &mut m.response_type_url },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeBool>(
- "response_streaming",
- |m: &Method| { &m.response_streaming },
- |m: &mut Method| { &mut m.response_streaming },
- ));
- fields.push(crate::reflect::accessor::make_repeated_field_accessor::<_, crate::types::ProtobufTypeMessage<crate::well_known_types::Option>>(
- "options",
- |m: &Method| { &m.options },
- |m: &mut Method| { &mut m.options },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeEnum<crate::well_known_types::Syntax>>(
- "syntax",
- |m: &Method| { &m.syntax },
- |m: &mut Method| { &mut m.syntax },
- ));
- crate::reflect::MessageDescriptor::new_pb_name::<Method>(
- "Method",
- fields,
- file_descriptor_proto()
- )
- })
- }
-
- fn default_instance() -> &'static Method {
- static instance: crate::rt::LazyV2<Method> = crate::rt::LazyV2::INIT;
- instance.get(Method::new)
- }
-}
-
-impl crate::Clear for Method {
fn clear(&mut self) {
self.name.clear();
self.request_type_url.clear();
@@ -837,34 +496,56 @@ impl crate::Clear for Method {
self.response_type_url.clear();
self.response_streaming = false;
self.options.clear();
- self.syntax = crate::well_known_types::Syntax::SYNTAX_PROTO2;
- self.unknown_fields.clear();
+ self.syntax = crate::EnumOrUnknown::new(crate::well_known_types::type_::Syntax::SYNTAX_PROTO2);
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static Method {
+ static instance: Method = Method {
+ name: ::std::string::String::new(),
+ request_type_url: ::std::string::String::new(),
+ request_streaming: false,
+ response_type_url: ::std::string::String::new(),
+ response_streaming: false,
+ options: ::std::vec::Vec::new(),
+ syntax: crate::EnumOrUnknown::from_i32(0),
+ special_fields: crate::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl crate::MessageFull for Method {
+ fn descriptor() -> crate::reflect::MessageDescriptor {
+ static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("Method").unwrap()).clone()
}
}
-impl ::std::fmt::Debug for Method {
+impl ::std::fmt::Display for Method {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
crate::text_format::fmt(self, f)
}
}
impl crate::reflect::ProtobufValue for Method {
- fn as_ref(&self) -> crate::reflect::ReflectValueRef {
- crate::reflect::ReflectValueRef::Message(self)
- }
+ type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>;
}
-#[derive(PartialEq,Clone,Default)]
-#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
+#[derive(PartialEq,Clone,Default,Debug)]
+// @@protoc_insertion_point(message:google.protobuf.Mixin)
pub struct Mixin {
// message fields
+ /// The fully qualified name of the interface which is included.
+ // @@protoc_insertion_point(field:google.protobuf.Mixin.name)
pub name: ::std::string::String,
+ /// If non-empty specifies a path under which inherited HTTP paths
+ /// are rooted.
+ // @@protoc_insertion_point(field:google.protobuf.Mixin.root)
pub root: ::std::string::String,
// special fields
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub unknown_fields: crate::UnknownFields,
- #[cfg_attr(feature = "with-serde", serde(skip))]
- pub cached_size: crate::CachedSize,
+ // @@protoc_insertion_point(special_field:google.protobuf.Mixin.special_fields)
+ pub special_fields: crate::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Mixin {
@@ -878,76 +559,45 @@ impl Mixin {
::std::default::Default::default()
}
- // string name = 1;
-
-
- pub fn get_name(&self) -> &str {
- &self.name
- }
- pub fn clear_name(&mut self) {
- self.name.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_name(&mut self, v: ::std::string::String) {
- self.name = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_name(&mut self) -> &mut ::std::string::String {
- &mut self.name
- }
-
- // Take field
- pub fn take_name(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.name, ::std::string::String::new())
- }
-
- // string root = 2;
-
-
- pub fn get_root(&self) -> &str {
- &self.root
- }
- pub fn clear_root(&mut self) {
- self.root.clear();
- }
-
- // Param is passed by value, moved
- pub fn set_root(&mut self, v: ::std::string::String) {
- self.root = v;
- }
-
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_root(&mut self) -> &mut ::std::string::String {
- &mut self.root
- }
-
- // Take field
- pub fn take_root(&mut self) -> ::std::string::String {
- ::std::mem::replace(&mut self.root, ::std::string::String::new())
+ fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "name",
+ |m: &Mixin| { &m.name },
+ |m: &mut Mixin| { &mut m.name },
+ ));
+ fields.push(crate::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
+ "root",
+ |m: &Mixin| { &m.root },
+ |m: &mut Mixin| { &mut m.root },
+ ));
+ crate::reflect::GeneratedMessageDescriptorData::new_2::<Mixin>(
+ "Mixin",
+ fields,
+ oneofs,
+ )
}
}
impl crate::Message for Mixin {
+ const NAME: &'static str = "Mixin";
+
fn is_initialized(&self) -> bool {
true
}
- fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
+ fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.name = is.read_string()?;
},
- 2 => {
- crate::rt::read_singular_proto3_string_into(wire_type, is, &mut self.root)?;
+ 18 => {
+ self.root = is.read_string()?;
},
- _ => {
- crate::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ tag => {
+ crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
@@ -956,7 +606,7 @@ impl crate::Message for Mixin {
// Compute sizes of nested messages
#[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
+ fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.name.is_empty() {
my_size += crate::rt::string_size(1, &self.name);
@@ -964,98 +614,65 @@ impl crate::Message for Mixin {
if !self.root.is_empty() {
my_size += crate::rt::string_size(2, &self.root);
}
- my_size += crate::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
+ my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
my_size
}
- fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::ProtobufResult<()> {
+ fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> {
if !self.name.is_empty() {
os.write_string(1, &self.name)?;
}
if !self.root.is_empty() {
os.write_string(2, &self.root)?;
}
- os.write_unknown_fields(self.get_unknown_fields())?;
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
-
- fn get_unknown_fields(&self) -> &crate::UnknownFields {
- &self.unknown_fields
- }
-
- fn mut_unknown_fields(&mut self) -> &mut crate::UnknownFields {
- &mut self.unknown_fields
+ fn special_fields(&self) -> &crate::SpecialFields {
+ &self.special_fields
}
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
-
- fn descriptor(&self) -> &'static crate::reflect::MessageDescriptor {
- Self::descriptor_static()
+ fn mut_special_fields(&mut self) -> &mut crate::SpecialFields {
+ &mut self.special_fields
}
fn new() -> Mixin {
Mixin::new()
}
- fn descriptor_static() -> &'static crate::reflect::MessageDescriptor {
- static descriptor: crate::rt::LazyV2<crate::reflect::MessageDescriptor> = crate::rt::LazyV2::INIT;
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "name",
- |m: &Mixin| { &m.name },
- |m: &mut Mixin| { &mut m.name },
- ));
- fields.push(crate::reflect::accessor::make_simple_field_accessor::<_, crate::types::ProtobufTypeString>(
- "root",
- |m: &Mixin| { &m.root },
- |m: &mut Mixin| { &mut m.root },
- ));
- crate::reflect::MessageDescriptor::new_pb_name::<Mixin>(
- "Mixin",
- fields,
- file_descriptor_proto()
- )
- })
+ fn clear(&mut self) {
+ self.name.clear();
+ self.root.clear();
+ self.special_fields.clear();
}
fn default_instance() -> &'static Mixin {
- static instance: crate::rt::LazyV2<Mixin> = crate::rt::LazyV2::INIT;
- instance.get(Mixin::new)
+ static instance: Mixin = Mixin {
+ name: ::std::string::String::new(),
+ root: ::std::string::String::new(),
+ special_fields: crate::SpecialFields::new(),
+ };
+ &instance
}
}
-impl crate::Clear for Mixin {
- fn clear(&mut self) {
- self.name.clear();
- self.root.clear();
- self.unknown_fields.clear();
+impl crate::MessageFull for Mixin {
+ fn descriptor() -> crate::reflect::MessageDescriptor {
+ static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("Mixin").unwrap()).clone()
}
}
-impl ::std::fmt::Debug for Mixin {
+impl ::std::fmt::Display for Mixin {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
crate::text_format::fmt(self, f)
}
}
impl crate::reflect::ProtobufValue for Mixin {
- fn as_ref(&self) -> crate::reflect::ReflectValueRef {
- crate::reflect::ReflectValueRef::Message(self)
- }
+ type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>;
}
static file_descriptor_proto_data: &'static [u8] = b"\
@@ -1279,14 +896,35 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\xce\x01\x10\x11b\x06proto3\
";
-static file_descriptor_proto_lazy: crate::rt::LazyV2<crate::descriptor::FileDescriptorProto> = crate::rt::LazyV2::INIT;
-
-fn parse_descriptor_proto() -> crate::descriptor::FileDescriptorProto {
- crate::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
+/// `FileDescriptorProto` object which was a source for this generated file
+fn file_descriptor_proto() -> &'static crate::descriptor::FileDescriptorProto {
+ static file_descriptor_proto_lazy: crate::rt::Lazy<crate::descriptor::FileDescriptorProto> = crate::rt::Lazy::new();
+ file_descriptor_proto_lazy.get(|| {
+ crate::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
+ })
}
-pub fn file_descriptor_proto() -> &'static crate::descriptor::FileDescriptorProto {
- file_descriptor_proto_lazy.get(|| {
- parse_descriptor_proto()
+/// `FileDescriptor` object which allows dynamic access to files
+pub fn file_descriptor() -> &'static crate::reflect::FileDescriptor {
+ static generated_file_descriptor_lazy: crate::rt::Lazy<crate::reflect::GeneratedFileDescriptor> = crate::rt::Lazy::new();
+ static file_descriptor: crate::rt::Lazy<crate::reflect::FileDescriptor> = crate::rt::Lazy::new();
+ file_descriptor.get(|| {
+ let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
+ let mut deps = ::std::vec::Vec::with_capacity(2);
+ deps.push(crate::well_known_types::source_context::file_descriptor().clone());
+ deps.push(crate::well_known_types::type_::file_descriptor().clone());
+ let mut messages = ::std::vec::Vec::with_capacity(3);
+ messages.push(Api::generated_message_descriptor_data());
+ messages.push(Method::generated_message_descriptor_data());
+ messages.push(Mixin::generated_message_descriptor_data());
+ let mut enums = ::std::vec::Vec::with_capacity(0);
+ crate::reflect::GeneratedFileDescriptor::new_generated(
+ file_descriptor_proto(),
+ deps,
+ messages,
+ enums,
+ )
+ });
+ crate::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
})
}