Skip to main content

digitalis_protobuf/msgs/
ModelPrimitive.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 `foxglove/ModelPrimitive.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// @@protoc_insertion_point(message:foxglove.ModelPrimitive)
28#[derive(PartialEq,Clone,Default,Debug)]
29pub struct ModelPrimitive {
30    // message fields
31    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.pose)
32    pub pose: ::protobuf::MessageField<super::Pose::Pose>,
33    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.scale)
34    pub scale: ::protobuf::MessageField<super::Vector3::Vector3>,
35    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.color)
36    pub color: ::protobuf::MessageField<super::Color::Color>,
37    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.override_color)
38    pub override_color: bool,
39    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.url)
40    pub url: ::std::string::String,
41    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.media_type)
42    pub media_type: ::std::string::String,
43    // @@protoc_insertion_point(field:foxglove.ModelPrimitive.data)
44    pub data: ::std::vec::Vec<u8>,
45    // special fields
46    // @@protoc_insertion_point(special_field:foxglove.ModelPrimitive.special_fields)
47    pub special_fields: ::protobuf::SpecialFields,
48}
49
50impl<'a> ::std::default::Default for &'a ModelPrimitive {
51    fn default() -> &'a ModelPrimitive {
52        <ModelPrimitive as ::protobuf::Message>::default_instance()
53    }
54}
55
56impl ModelPrimitive {
57    pub fn new() -> ModelPrimitive {
58        ::std::default::Default::default()
59    }
60
61    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
62        let mut fields = ::std::vec::Vec::with_capacity(7);
63        let mut oneofs = ::std::vec::Vec::with_capacity(0);
64        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::Pose::Pose>(
65            "pose",
66            |m: &ModelPrimitive| { &m.pose },
67            |m: &mut ModelPrimitive| { &mut m.pose },
68        ));
69        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::Vector3::Vector3>(
70            "scale",
71            |m: &ModelPrimitive| { &m.scale },
72            |m: &mut ModelPrimitive| { &mut m.scale },
73        ));
74        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::Color::Color>(
75            "color",
76            |m: &ModelPrimitive| { &m.color },
77            |m: &mut ModelPrimitive| { &mut m.color },
78        ));
79        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
80            "override_color",
81            |m: &ModelPrimitive| { &m.override_color },
82            |m: &mut ModelPrimitive| { &mut m.override_color },
83        ));
84        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
85            "url",
86            |m: &ModelPrimitive| { &m.url },
87            |m: &mut ModelPrimitive| { &mut m.url },
88        ));
89        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
90            "media_type",
91            |m: &ModelPrimitive| { &m.media_type },
92            |m: &mut ModelPrimitive| { &mut m.media_type },
93        ));
94        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
95            "data",
96            |m: &ModelPrimitive| { &m.data },
97            |m: &mut ModelPrimitive| { &mut m.data },
98        ));
99        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ModelPrimitive>(
100            "ModelPrimitive",
101            fields,
102            oneofs,
103        )
104    }
105}
106
107impl ::protobuf::Message for ModelPrimitive {
108    const NAME: &'static str = "ModelPrimitive";
109
110    fn is_initialized(&self) -> bool {
111        true
112    }
113
114    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
115        while let Some(tag) = is.read_raw_tag_or_eof()? {
116            match tag {
117                10 => {
118                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.pose)?;
119                },
120                18 => {
121                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.scale)?;
122                },
123                26 => {
124                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.color)?;
125                },
126                32 => {
127                    self.override_color = is.read_bool()?;
128                },
129                42 => {
130                    self.url = is.read_string()?;
131                },
132                50 => {
133                    self.media_type = is.read_string()?;
134                },
135                58 => {
136                    self.data = is.read_bytes()?;
137                },
138                tag => {
139                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
140                },
141            };
142        }
143        ::std::result::Result::Ok(())
144    }
145
146    // Compute sizes of nested messages
147    #[allow(unused_variables)]
148    fn compute_size(&self) -> u64 {
149        let mut my_size = 0;
150        if let Some(v) = self.pose.as_ref() {
151            let len = v.compute_size();
152            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
153        }
154        if let Some(v) = self.scale.as_ref() {
155            let len = v.compute_size();
156            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
157        }
158        if let Some(v) = self.color.as_ref() {
159            let len = v.compute_size();
160            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
161        }
162        if self.override_color != false {
163            my_size += 1 + 1;
164        }
165        if !self.url.is_empty() {
166            my_size += ::protobuf::rt::string_size(5, &self.url);
167        }
168        if !self.media_type.is_empty() {
169            my_size += ::protobuf::rt::string_size(6, &self.media_type);
170        }
171        if !self.data.is_empty() {
172            my_size += ::protobuf::rt::bytes_size(7, &self.data);
173        }
174        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
175        self.special_fields.cached_size().set(my_size as u32);
176        my_size
177    }
178
179    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
180        if let Some(v) = self.pose.as_ref() {
181            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
182        }
183        if let Some(v) = self.scale.as_ref() {
184            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
185        }
186        if let Some(v) = self.color.as_ref() {
187            ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
188        }
189        if self.override_color != false {
190            os.write_bool(4, self.override_color)?;
191        }
192        if !self.url.is_empty() {
193            os.write_string(5, &self.url)?;
194        }
195        if !self.media_type.is_empty() {
196            os.write_string(6, &self.media_type)?;
197        }
198        if !self.data.is_empty() {
199            os.write_bytes(7, &self.data)?;
200        }
201        os.write_unknown_fields(self.special_fields.unknown_fields())?;
202        ::std::result::Result::Ok(())
203    }
204
205    fn special_fields(&self) -> &::protobuf::SpecialFields {
206        &self.special_fields
207    }
208
209    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
210        &mut self.special_fields
211    }
212
213    fn new() -> ModelPrimitive {
214        ModelPrimitive::new()
215    }
216
217    fn clear(&mut self) {
218        self.pose.clear();
219        self.scale.clear();
220        self.color.clear();
221        self.override_color = false;
222        self.url.clear();
223        self.media_type.clear();
224        self.data.clear();
225        self.special_fields.clear();
226    }
227
228    fn default_instance() -> &'static ModelPrimitive {
229        static instance: ModelPrimitive = ModelPrimitive {
230            pose: ::protobuf::MessageField::none(),
231            scale: ::protobuf::MessageField::none(),
232            color: ::protobuf::MessageField::none(),
233            override_color: false,
234            url: ::std::string::String::new(),
235            media_type: ::std::string::String::new(),
236            data: ::std::vec::Vec::new(),
237            special_fields: ::protobuf::SpecialFields::new(),
238        };
239        &instance
240    }
241}
242
243impl ::protobuf::MessageFull for ModelPrimitive {
244    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
245        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
246        descriptor.get(|| file_descriptor().message_by_package_relative_name("ModelPrimitive").unwrap()).clone()
247    }
248}
249
250impl ::std::fmt::Display for ModelPrimitive {
251    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
252        ::protobuf::text_format::fmt(self, f)
253    }
254}
255
256impl ::protobuf::reflect::ProtobufValue for ModelPrimitive {
257    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
258}
259
260static file_descriptor_proto_data: &'static [u8] = b"\
261    \n\x1dfoxglove/ModelPrimitive.proto\x12\x08foxglove\x1a\x14foxglove/Colo\
262    r.proto\x1a\x13foxglove/Pose.proto\x1a\x16foxglove/Vector3.proto\"\xf0\
263    \x01\n\x0eModelPrimitive\x12\"\n\x04pose\x18\x01\x20\x01(\x0b2\x0e.foxgl\
264    ove.PoseR\x04pose\x12'\n\x05scale\x18\x02\x20\x01(\x0b2\x11.foxglove.Vec\
265    tor3R\x05scale\x12%\n\x05color\x18\x03\x20\x01(\x0b2\x0f.foxglove.ColorR\
266    \x05color\x12%\n\x0eoverride_color\x18\x04\x20\x01(\x08R\roverrideColor\
267    \x12\x10\n\x03url\x18\x05\x20\x01(\tR\x03url\x12\x1d\n\nmedia_type\x18\
268    \x06\x20\x01(\tR\tmediaType\x12\x12\n\x04data\x18\x07\x20\x01(\x0cR\x04d\
269    atab\x06proto3\
270";
271
272/// `FileDescriptorProto` object which was a source for this generated file
273fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
274    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
275    file_descriptor_proto_lazy.get(|| {
276        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
277    })
278}
279
280/// `FileDescriptor` object which allows dynamic access to files
281pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
282    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
283    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
284    file_descriptor.get(|| {
285        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
286            let mut deps = ::std::vec::Vec::with_capacity(3);
287            deps.push(super::Color::file_descriptor().clone());
288            deps.push(super::Pose::file_descriptor().clone());
289            deps.push(super::Vector3::file_descriptor().clone());
290            let mut messages = ::std::vec::Vec::with_capacity(1);
291            messages.push(ModelPrimitive::generated_message_descriptor_data());
292            let mut enums = ::std::vec::Vec::with_capacity(0);
293            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
294                file_descriptor_proto(),
295                deps,
296                messages,
297                enums,
298            )
299        });
300        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
301    })
302}