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 `message.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 ConnectionMessage {
29 pub payload: ::protobuf::SingularPtrField<::protobuf::well_known_types::Any>,
31 pub unknown_fields: ::protobuf::UnknownFields,
32 pub cached_size: ::protobuf::CachedSize,
35 impl<'a> ::std::default::Default for &'a ConnectionMessage {
36 fn default() -> &'a ConnectionMessage {
37 <ConnectionMessage as ::protobuf::Message>::default_instance()
41 impl ConnectionMessage {
42 pub fn new() -> ConnectionMessage {
43 ::std::default::Default::default()
46 // .google.protobuf.Any payload = 1;
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())
52 pub fn clear_payload(&mut self) {
56 pub fn has_payload(&self) -> bool {
57 self.payload.is_some()
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);
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();
71 self.payload.as_mut().unwrap()
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())
80 impl ::protobuf::Message for ConnectionMessage {
81 fn is_initialized(&self) -> bool {
82 for v in &self.payload {
83 if !v.is_initialized() {
90 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
92 let (field_number, wire_type) = is.read_tag_unpack()?;
95 ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.payload)?;
98 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
102 ::std::result::Result::Ok(())
105 // Compute sizes of nested messages
106 #[allow(unused_variables)]
107 fn compute_size(&self) -> u32 {
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;
113 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
114 self.cached_size.set(my_size);
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)?;
124 os.write_unknown_fields(self.get_unknown_fields())?;
125 ::std::result::Result::Ok(())
128 fn get_cached_size(&self) -> u32 {
129 self.cached_size.get()
132 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
136 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
137 &mut self.unknown_fields
140 fn as_any(&self) -> &dyn (::std::any::Any) {
141 self as &dyn (::std::any::Any)
143 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
144 self as &mut dyn (::std::any::Any)
146 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
150 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
151 Self::descriptor_static()
154 fn new() -> ConnectionMessage {
155 ConnectionMessage::new()
158 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
159 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
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>>(
164 |m: &ConnectionMessage| { &m.payload },
165 |m: &mut ConnectionMessage| { &mut m.payload },
167 ::protobuf::reflect::MessageDescriptor::new_pb_name::<ConnectionMessage>(
170 file_descriptor_proto()
175 fn default_instance() -> &'static ConnectionMessage {
176 static instance: ::protobuf::rt::LazyV2<ConnectionMessage> = ::protobuf::rt::LazyV2::INIT;
177 instance.get(ConnectionMessage::new)
181 impl ::protobuf::Clear for ConnectionMessage {
182 fn clear(&mut self) {
183 self.payload.clear();
184 self.unknown_fields.clear();
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)
194 impl ::protobuf::reflect::ProtobufValue for ConnectionMessage {
195 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
196 ::protobuf::reflect::ReflectValueRef::Message(self)
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\
206 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
208 fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
209 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
212 pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
213 file_descriptor_proto_lazy.get(|| {
214 parse_descriptor_proto()