gz_msgs/gz_msgs10/
boolean.rs

1// This file is generated by rust-protobuf 3.7.2. Do not edit
2// .proto file is parsed by protoc 3.21.12
3// @generated
4
5// https://github.com/rust-lang/rust-clippy/issues/702
6#![allow(unknown_lints)]
7#![allow(clippy::all)]
8
9#![allow(unused_attributes)]
10#![cfg_attr(rustfmt, rustfmt::skip)]
11
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_results)]
19#![allow(unused_mut)]
20
21//! Generated file from `gz/msgs/boolean.proto`
22
23/// Generated files are compatible only with the same version
24/// of protobuf runtime.
25const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
26
27#[derive(::gz_msgs_common::GzMessage)]
28// @@protoc_insertion_point(message:gz.msgs.Boolean)
29#[derive(PartialEq,Clone,Default,Debug)]
30pub struct Boolean {
31    // message fields
32    // @@protoc_insertion_point(field:gz.msgs.Boolean.header)
33    pub header: ::protobuf::MessageField<super::header::Header>,
34    // @@protoc_insertion_point(field:gz.msgs.Boolean.data)
35    pub data: bool,
36    // special fields
37    // @@protoc_insertion_point(special_field:gz.msgs.Boolean.special_fields)
38    pub special_fields: ::protobuf::SpecialFields,
39}
40
41impl<'a> ::std::default::Default for &'a Boolean {
42    fn default() -> &'a Boolean {
43        <Boolean as ::protobuf::Message>::default_instance()
44    }
45}
46
47impl Boolean {
48    pub fn new() -> Boolean {
49        ::std::default::Default::default()
50    }
51
52    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
53        let mut fields = ::std::vec::Vec::with_capacity(2);
54        let mut oneofs = ::std::vec::Vec::with_capacity(0);
55        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::header::Header>(
56            "header",
57            |m: &Boolean| { &m.header },
58            |m: &mut Boolean| { &mut m.header },
59        ));
60        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
61            "data",
62            |m: &Boolean| { &m.data },
63            |m: &mut Boolean| { &mut m.data },
64        ));
65        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Boolean>(
66            "Boolean",
67            fields,
68            oneofs,
69        )
70    }
71}
72
73impl ::protobuf::Message for Boolean {
74    const NAME: &'static str = "Boolean";
75
76    fn is_initialized(&self) -> bool {
77        true
78    }
79
80    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
81        while let Some(tag) = is.read_raw_tag_or_eof()? {
82            match tag {
83                10 => {
84                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
85                },
86                16 => {
87                    self.data = is.read_bool()?;
88                },
89                tag => {
90                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
91                },
92            };
93        }
94        ::std::result::Result::Ok(())
95    }
96
97    // Compute sizes of nested messages
98    #[allow(unused_variables)]
99    fn compute_size(&self) -> u64 {
100        let mut my_size = 0;
101        if let Some(v) = self.header.as_ref() {
102            let len = v.compute_size();
103            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
104        }
105        if self.data != false {
106            my_size += 1 + 1;
107        }
108        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
109        self.special_fields.cached_size().set(my_size as u32);
110        my_size
111    }
112
113    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
114        if let Some(v) = self.header.as_ref() {
115            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
116        }
117        if self.data != false {
118            os.write_bool(2, self.data)?;
119        }
120        os.write_unknown_fields(self.special_fields.unknown_fields())?;
121        ::std::result::Result::Ok(())
122    }
123
124    fn special_fields(&self) -> &::protobuf::SpecialFields {
125        &self.special_fields
126    }
127
128    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
129        &mut self.special_fields
130    }
131
132    fn new() -> Boolean {
133        Boolean::new()
134    }
135
136    fn clear(&mut self) {
137        self.header.clear();
138        self.data = false;
139        self.special_fields.clear();
140    }
141
142    fn default_instance() -> &'static Boolean {
143        static instance: Boolean = Boolean {
144            header: ::protobuf::MessageField::none(),
145            data: false,
146            special_fields: ::protobuf::SpecialFields::new(),
147        };
148        &instance
149    }
150}
151
152impl ::protobuf::MessageFull for Boolean {
153    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
154        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
155        descriptor.get(|| file_descriptor().message_by_package_relative_name("Boolean").unwrap()).clone()
156    }
157}
158
159impl ::std::fmt::Display for Boolean {
160    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
161        ::protobuf::text_format::fmt(self, f)
162    }
163}
164
165impl ::protobuf::reflect::ProtobufValue for Boolean {
166    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
167}
168
169static file_descriptor_proto_data: &'static [u8] = b"\
170    \n\x15gz/msgs/boolean.proto\x12\x07gz.msgs\x1a\x14gz/msgs/header.proto\"\
171    F\n\x07Boolean\x12'\n\x06header\x18\x01\x20\x01(\x0b2\x0f.gz.msgs.Header\
172    R\x06header\x12\x12\n\x04data\x18\x02\x20\x01(\x08R\x04dataB\x19\n\x0bco\
173    m.gz.msgsB\nBoolProtosb\x06proto3\
174";
175
176/// `FileDescriptorProto` object which was a source for this generated file
177fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
178    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
179    file_descriptor_proto_lazy.get(|| {
180        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
181    })
182}
183
184/// `FileDescriptor` object which allows dynamic access to files
185pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
186    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
187    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
188    file_descriptor.get(|| {
189        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
190            let mut deps = ::std::vec::Vec::with_capacity(1);
191            deps.push(super::header::file_descriptor().clone());
192            let mut messages = ::std::vec::Vec::with_capacity(1);
193            messages.push(Boolean::generated_message_descriptor_data());
194            let mut enums = ::std::vec::Vec::with_capacity(0);
195            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
196                file_descriptor_proto(),
197                deps,
198                messages,
199                enums,
200            )
201        });
202        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
203    })
204}