]> git.lizzy.rs Git - connect-rs.git/blob - examples/tcp-client/src/schema/hello_world.rs
don't block in poll_x fns, fixes conn closing issues
[connect-rs.git] / examples / tcp-client / src / schema / hello_world.rs
1 // This file is generated by rust-protobuf 2.20.0. Do not edit
2 // @generated
3
4 // https://github.com/rust-lang/rust-clippy/issues/702
5 #![allow(unknown_lints)]
6 #![allow(clippy::all)]
7
8 #![allow(unused_attributes)]
9 #![rustfmt::skip]
10
11 #![allow(box_pointers)]
12 #![allow(dead_code)]
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`
21
22 /// Generated files are compatible only with the same version
23 /// of protobuf runtime.
24 // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_20_0;
25
26 #[derive(PartialEq,Clone,Default)]
27 pub struct HelloWorld {
28     // message fields
29     pub message: ::std::string::String,
30     // special fields
31     pub unknown_fields: ::protobuf::UnknownFields,
32     pub cached_size: ::protobuf::CachedSize,
33 }
34
35 impl<'a> ::std::default::Default for &'a HelloWorld {
36     fn default() -> &'a HelloWorld {
37         <HelloWorld as ::protobuf::Message>::default_instance()
38     }
39 }
40
41 impl HelloWorld {
42     pub fn new() -> HelloWorld {
43         ::std::default::Default::default()
44     }
45
46     // string message = 1;
47
48
49     pub fn get_message(&self) -> &str {
50         &self.message
51     }
52     pub fn clear_message(&mut self) {
53         self.message.clear();
54     }
55
56     // Param is passed by value, moved
57     pub fn set_message(&mut self, v: ::std::string::String) {
58         self.message = v;
59     }
60
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 {
64         &mut self.message
65     }
66
67     // Take field
68     pub fn take_message(&mut self) -> ::std::string::String {
69         ::std::mem::replace(&mut self.message, ::std::string::String::new())
70     }
71 }
72
73 impl ::protobuf::Message for HelloWorld {
74     fn is_initialized(&self) -> bool {
75         true
76     }
77
78     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
79         while !is.eof()? {
80             let (field_number, wire_type) = is.read_tag_unpack()?;
81             match field_number {
82                 1 => {
83                     ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.message)?;
84                 },
85                 _ => {
86                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
87                 },
88             };
89         }
90         ::std::result::Result::Ok(())
91     }
92
93     // Compute sizes of nested messages
94     #[allow(unused_variables)]
95     fn compute_size(&self) -> u32 {
96         let mut my_size = 0;
97         if !self.message.is_empty() {
98             my_size += ::protobuf::rt::string_size(1, &self.message);
99         }
100         my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
101         self.cached_size.set(my_size);
102         my_size
103     }
104
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)?;
108         }
109         os.write_unknown_fields(self.get_unknown_fields())?;
110         ::std::result::Result::Ok(())
111     }
112
113     fn get_cached_size(&self) -> u32 {
114         self.cached_size.get()
115     }
116
117     fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
118         &self.unknown_fields
119     }
120
121     fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
122         &mut self.unknown_fields
123     }
124
125     fn as_any(&self) -> &dyn (::std::any::Any) {
126         self as &dyn (::std::any::Any)
127     }
128     fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
129         self as &mut dyn (::std::any::Any)
130     }
131     fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
132         self
133     }
134
135     fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
136         Self::descriptor_static()
137     }
138
139     fn new() -> HelloWorld {
140         HelloWorld::new()
141     }
142
143     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
144         static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
145         descriptor.get(|| {
146             let mut fields = ::std::vec::Vec::new();
147             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
148                 "message",
149                 |m: &HelloWorld| { &m.message },
150                 |m: &mut HelloWorld| { &mut m.message },
151             ));
152             ::protobuf::reflect::MessageDescriptor::new_pb_name::<HelloWorld>(
153                 "HelloWorld",
154                 fields,
155                 file_descriptor_proto()
156             )
157         })
158     }
159
160     fn default_instance() -> &'static HelloWorld {
161         static instance: ::protobuf::rt::LazyV2<HelloWorld> = ::protobuf::rt::LazyV2::INIT;
162         instance.get(HelloWorld::new)
163     }
164 }
165
166 impl ::protobuf::Clear for HelloWorld {
167     fn clear(&mut self) {
168         self.message.clear();
169         self.unknown_fields.clear();
170     }
171 }
172
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)
176     }
177 }
178
179 impl ::protobuf::reflect::ProtobufValue for HelloWorld {
180     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
181         ::protobuf::reflect::ReflectValueRef::Message(self)
182     }
183 }
184
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\
188 ";
189
190 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
191
192 fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
193     ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
194 }
195
196 pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
197     file_descriptor_proto_lazy.get(|| {
198         parse_descriptor_proto()
199     })
200 }