1 // This file is generated by rust-protobuf 2.20.0. Do not edit
4 // https://github.com/rust-lang/rust-clippy/issues/702
5 #![allow(unknown_lints)]
8 #![allow(unused_attributes)]
11 #![allow(box_pointers)]
13 #![allow(missing_docs)]
14 #![allow(non_camel_case_types)]
15 #![allow(non_snake_case)]
16 #![allow(non_upper_case_globals)]
17 #![allow(trivial_casts)]
18 #![allow(unused_imports)]
19 #![allow(unused_results)]
20 //! Generated file from `hello_world.proto`
22 /// Generated files are compatible only with the same version
23 /// of protobuf runtime.
24 // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_20_0;
26 #[derive(PartialEq,Clone,Default)]
27 pub struct HelloWorld {
29 pub message: ::std::string::String,
31 pub unknown_fields: ::protobuf::UnknownFields,
32 pub cached_size: ::protobuf::CachedSize,
35 impl<'a> ::std::default::Default for &'a HelloWorld {
36 fn default() -> &'a HelloWorld {
37 <HelloWorld as ::protobuf::Message>::default_instance()
42 pub fn new() -> HelloWorld {
43 ::std::default::Default::default()
46 // string message = 1;
49 pub fn get_message(&self) -> &str {
52 pub fn clear_message(&mut self) {
56 // Param is passed by value, moved
57 pub fn set_message(&mut self, v: ::std::string::String) {
61 // Mutable pointer to the field.
62 // If field is not initialized, it is initialized with default value first.
63 pub fn mut_message(&mut self) -> &mut ::std::string::String {
68 pub fn take_message(&mut self) -> ::std::string::String {
69 ::std::mem::replace(&mut self.message, ::std::string::String::new())
73 impl ::protobuf::Message for HelloWorld {
74 fn is_initialized(&self) -> bool {
78 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
80 let (field_number, wire_type) = is.read_tag_unpack()?;
83 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.message)?;
86 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
90 ::std::result::Result::Ok(())
93 // Compute sizes of nested messages
94 #[allow(unused_variables)]
95 fn compute_size(&self) -> u32 {
97 if !self.message.is_empty() {
98 my_size += ::protobuf::rt::string_size(1, &self.message);
100 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
101 self.cached_size.set(my_size);
105 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
106 if !self.message.is_empty() {
107 os.write_string(1, &self.message)?;
109 os.write_unknown_fields(self.get_unknown_fields())?;
110 ::std::result::Result::Ok(())
113 fn get_cached_size(&self) -> u32 {
114 self.cached_size.get()
117 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
121 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
122 &mut self.unknown_fields
125 fn as_any(&self) -> &dyn (::std::any::Any) {
126 self as &dyn (::std::any::Any)
128 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
129 self as &mut dyn (::std::any::Any)
131 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
135 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
136 Self::descriptor_static()
139 fn new() -> HelloWorld {
143 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
144 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
146 let mut fields = ::std::vec::Vec::new();
147 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
149 |m: &HelloWorld| { &m.message },
150 |m: &mut HelloWorld| { &mut m.message },
152 ::protobuf::reflect::MessageDescriptor::new_pb_name::<HelloWorld>(
155 file_descriptor_proto()
160 fn default_instance() -> &'static HelloWorld {
161 static instance: ::protobuf::rt::LazyV2<HelloWorld> = ::protobuf::rt::LazyV2::INIT;
162 instance.get(HelloWorld::new)
166 impl ::protobuf::Clear for HelloWorld {
167 fn clear(&mut self) {
168 self.message.clear();
169 self.unknown_fields.clear();
173 impl ::std::fmt::Debug for HelloWorld {
174 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
175 ::protobuf::text_format::fmt(self, f)
179 impl ::protobuf::reflect::ProtobufValue for HelloWorld {
180 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
181 ::protobuf::reflect::ReflectValueRef::Message(self)
185 static file_descriptor_proto_data: &'static [u8] = b"\
186 \n\x11hello_world.proto\x12\x0bhello_world\"*\n\nHelloWorld\x12\x1a\n\
187 \x07message\x18\x01\x20\x01(\tR\x07messageB\0:\0B\0b\x06proto3\
190 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
192 fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
193 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
196 pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
197 file_descriptor_proto_lazy.get(|| {
198 parse_descriptor_proto()