]> git.lizzy.rs Git - connect-rs.git/blob - src/schema/message.rs
bump version to unused 0.1.2
[connect-rs.git] / src / schema / message.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 `message.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 ConnectionMessage {
28     // message fields
29     pub payload: ::protobuf::SingularPtrField<::protobuf::well_known_types::Any>,
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 ConnectionMessage {
36     fn default() -> &'a ConnectionMessage {
37         <ConnectionMessage as ::protobuf::Message>::default_instance()
38     }
39 }
40
41 impl ConnectionMessage {
42     pub fn new() -> ConnectionMessage {
43         ::std::default::Default::default()
44     }
45
46     // .google.protobuf.Any payload = 1;
47
48
49     pub fn get_payload(&self) -> &::protobuf::well_known_types::Any {
50         self.payload.as_ref().unwrap_or_else(|| <::protobuf::well_known_types::Any as ::protobuf::Message>::default_instance())
51     }
52     pub fn clear_payload(&mut self) {
53         self.payload.clear();
54     }
55
56     pub fn has_payload(&self) -> bool {
57         self.payload.is_some()
58     }
59
60     // Param is passed by value, moved
61     pub fn set_payload(&mut self, v: ::protobuf::well_known_types::Any) {
62         self.payload = ::protobuf::SingularPtrField::some(v);
63     }
64
65     // Mutable pointer to the field.
66     // If field is not initialized, it is initialized with default value first.
67     pub fn mut_payload(&mut self) -> &mut ::protobuf::well_known_types::Any {
68         if self.payload.is_none() {
69             self.payload.set_default();
70         }
71         self.payload.as_mut().unwrap()
72     }
73
74     // Take field
75     pub fn take_payload(&mut self) -> ::protobuf::well_known_types::Any {
76         self.payload.take().unwrap_or_else(|| ::protobuf::well_known_types::Any::new())
77     }
78 }
79
80 impl ::protobuf::Message for ConnectionMessage {
81     fn is_initialized(&self) -> bool {
82         for v in &self.payload {
83             if !v.is_initialized() {
84                 return false;
85             }
86         };
87         true
88     }
89
90     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
91         while !is.eof()? {
92             let (field_number, wire_type) = is.read_tag_unpack()?;
93             match field_number {
94                 1 => {
95                     ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.payload)?;
96                 },
97                 _ => {
98                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
99                 },
100             };
101         }
102         ::std::result::Result::Ok(())
103     }
104
105     // Compute sizes of nested messages
106     #[allow(unused_variables)]
107     fn compute_size(&self) -> u32 {
108         let mut my_size = 0;
109         if let Some(ref v) = self.payload.as_ref() {
110             let len = v.compute_size();
111             my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
112         }
113         my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
114         self.cached_size.set(my_size);
115         my_size
116     }
117
118     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
119         if let Some(ref v) = self.payload.as_ref() {
120             os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
121             os.write_raw_varint32(v.get_cached_size())?;
122             v.write_to_with_cached_sizes(os)?;
123         }
124         os.write_unknown_fields(self.get_unknown_fields())?;
125         ::std::result::Result::Ok(())
126     }
127
128     fn get_cached_size(&self) -> u32 {
129         self.cached_size.get()
130     }
131
132     fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
133         &self.unknown_fields
134     }
135
136     fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
137         &mut self.unknown_fields
138     }
139
140     fn as_any(&self) -> &dyn (::std::any::Any) {
141         self as &dyn (::std::any::Any)
142     }
143     fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
144         self as &mut dyn (::std::any::Any)
145     }
146     fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
147         self
148     }
149
150     fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
151         Self::descriptor_static()
152     }
153
154     fn new() -> ConnectionMessage {
155         ConnectionMessage::new()
156     }
157
158     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
159         static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
160         descriptor.get(|| {
161             let mut fields = ::std::vec::Vec::new();
162             fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Any>>(
163                 "payload",
164                 |m: &ConnectionMessage| { &m.payload },
165                 |m: &mut ConnectionMessage| { &mut m.payload },
166             ));
167             ::protobuf::reflect::MessageDescriptor::new_pb_name::<ConnectionMessage>(
168                 "ConnectionMessage",
169                 fields,
170                 file_descriptor_proto()
171             )
172         })
173     }
174
175     fn default_instance() -> &'static ConnectionMessage {
176         static instance: ::protobuf::rt::LazyV2<ConnectionMessage> = ::protobuf::rt::LazyV2::INIT;
177         instance.get(ConnectionMessage::new)
178     }
179 }
180
181 impl ::protobuf::Clear for ConnectionMessage {
182     fn clear(&mut self) {
183         self.payload.clear();
184         self.unknown_fields.clear();
185     }
186 }
187
188 impl ::std::fmt::Debug for ConnectionMessage {
189     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
190         ::protobuf::text_format::fmt(self, f)
191     }
192 }
193
194 impl ::protobuf::reflect::ProtobufValue for ConnectionMessage {
195     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
196         ::protobuf::reflect::ReflectValueRef::Message(self)
197     }
198 }
199
200 static file_descriptor_proto_data: &'static [u8] = b"\
201     \n\rmessage.proto\x12\x07message\x1a\x19google/protobuf/any.proto\"G\n\
202     \x11ConnectionMessage\x120\n\x07payload\x18\x01\x20\x01(\x0b2\x14.google\
203     .protobuf.AnyR\x07payloadB\0:\0B\0b\x06proto3\
204 ";
205
206 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
207
208 fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
209     ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
210 }
211
212 pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
213     file_descriptor_proto_lazy.get(|| {
214         parse_descriptor_proto()
215     })
216 }