matrix_protos_rust/protos/
vision_service.rs

1// This file is generated by rust-protobuf 2.25.1. 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#![cfg_attr(rustfmt, 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 `matrix_io/vision/v1/vision_service.proto`
21
22/// Generated files are compatible only with the same version
23/// of protobuf runtime.
24// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1;
25
26#[derive(PartialEq,Clone,Default)]
27pub struct VisionRequest {
28    // message fields
29    pub image: ::std::vec::Vec<u8>,
30    pub detection: ::std::vec::Vec<super::vision::EnumDetectionTag>,
31    pub recognition: ::std::vec::Vec<super::vision::EnumFacialRecognitionTag>,
32    pub vehicle_recognition: ::std::vec::Vec<super::vision::EnumVehicleRecognitionTag>,
33    pub image_list: ::protobuf::SingularPtrField<super::vision::ImageList>,
34    pub video: ::protobuf::SingularPtrField<super::vision::Video>,
35    // special fields
36    pub unknown_fields: ::protobuf::UnknownFields,
37    pub cached_size: ::protobuf::CachedSize,
38}
39
40impl<'a> ::std::default::Default for &'a VisionRequest {
41    fn default() -> &'a VisionRequest {
42        <VisionRequest as ::protobuf::Message>::default_instance()
43    }
44}
45
46impl VisionRequest {
47    pub fn new() -> VisionRequest {
48        ::std::default::Default::default()
49    }
50
51    // bytes image = 1;
52
53
54    pub fn get_image(&self) -> &[u8] {
55        &self.image
56    }
57    pub fn clear_image(&mut self) {
58        self.image.clear();
59    }
60
61    // Param is passed by value, moved
62    pub fn set_image(&mut self, v: ::std::vec::Vec<u8>) {
63        self.image = v;
64    }
65
66    // Mutable pointer to the field.
67    // If field is not initialized, it is initialized with default value first.
68    pub fn mut_image(&mut self) -> &mut ::std::vec::Vec<u8> {
69        &mut self.image
70    }
71
72    // Take field
73    pub fn take_image(&mut self) -> ::std::vec::Vec<u8> {
74        ::std::mem::replace(&mut self.image, ::std::vec::Vec::new())
75    }
76
77    // repeated .matrix_io.vision.v1.EnumDetectionTag detection = 2;
78
79
80    pub fn get_detection(&self) -> &[super::vision::EnumDetectionTag] {
81        &self.detection
82    }
83    pub fn clear_detection(&mut self) {
84        self.detection.clear();
85    }
86
87    // Param is passed by value, moved
88    pub fn set_detection(&mut self, v: ::std::vec::Vec<super::vision::EnumDetectionTag>) {
89        self.detection = v;
90    }
91
92    // Mutable pointer to the field.
93    pub fn mut_detection(&mut self) -> &mut ::std::vec::Vec<super::vision::EnumDetectionTag> {
94        &mut self.detection
95    }
96
97    // Take field
98    pub fn take_detection(&mut self) -> ::std::vec::Vec<super::vision::EnumDetectionTag> {
99        ::std::mem::replace(&mut self.detection, ::std::vec::Vec::new())
100    }
101
102    // repeated .matrix_io.vision.v1.EnumFacialRecognitionTag recognition = 3;
103
104
105    pub fn get_recognition(&self) -> &[super::vision::EnumFacialRecognitionTag] {
106        &self.recognition
107    }
108    pub fn clear_recognition(&mut self) {
109        self.recognition.clear();
110    }
111
112    // Param is passed by value, moved
113    pub fn set_recognition(&mut self, v: ::std::vec::Vec<super::vision::EnumFacialRecognitionTag>) {
114        self.recognition = v;
115    }
116
117    // Mutable pointer to the field.
118    pub fn mut_recognition(&mut self) -> &mut ::std::vec::Vec<super::vision::EnumFacialRecognitionTag> {
119        &mut self.recognition
120    }
121
122    // Take field
123    pub fn take_recognition(&mut self) -> ::std::vec::Vec<super::vision::EnumFacialRecognitionTag> {
124        ::std::mem::replace(&mut self.recognition, ::std::vec::Vec::new())
125    }
126
127    // repeated .matrix_io.vision.v1.EnumVehicleRecognitionTag vehicle_recognition = 6;
128
129
130    pub fn get_vehicle_recognition(&self) -> &[super::vision::EnumVehicleRecognitionTag] {
131        &self.vehicle_recognition
132    }
133    pub fn clear_vehicle_recognition(&mut self) {
134        self.vehicle_recognition.clear();
135    }
136
137    // Param is passed by value, moved
138    pub fn set_vehicle_recognition(&mut self, v: ::std::vec::Vec<super::vision::EnumVehicleRecognitionTag>) {
139        self.vehicle_recognition = v;
140    }
141
142    // Mutable pointer to the field.
143    pub fn mut_vehicle_recognition(&mut self) -> &mut ::std::vec::Vec<super::vision::EnumVehicleRecognitionTag> {
144        &mut self.vehicle_recognition
145    }
146
147    // Take field
148    pub fn take_vehicle_recognition(&mut self) -> ::std::vec::Vec<super::vision::EnumVehicleRecognitionTag> {
149        ::std::mem::replace(&mut self.vehicle_recognition, ::std::vec::Vec::new())
150    }
151
152    // .matrix_io.vision.v1.ImageList image_list = 4;
153
154
155    pub fn get_image_list(&self) -> &super::vision::ImageList {
156        self.image_list.as_ref().unwrap_or_else(|| <super::vision::ImageList as ::protobuf::Message>::default_instance())
157    }
158    pub fn clear_image_list(&mut self) {
159        self.image_list.clear();
160    }
161
162    pub fn has_image_list(&self) -> bool {
163        self.image_list.is_some()
164    }
165
166    // Param is passed by value, moved
167    pub fn set_image_list(&mut self, v: super::vision::ImageList) {
168        self.image_list = ::protobuf::SingularPtrField::some(v);
169    }
170
171    // Mutable pointer to the field.
172    // If field is not initialized, it is initialized with default value first.
173    pub fn mut_image_list(&mut self) -> &mut super::vision::ImageList {
174        if self.image_list.is_none() {
175            self.image_list.set_default();
176        }
177        self.image_list.as_mut().unwrap()
178    }
179
180    // Take field
181    pub fn take_image_list(&mut self) -> super::vision::ImageList {
182        self.image_list.take().unwrap_or_else(|| super::vision::ImageList::new())
183    }
184
185    // .matrix_io.vision.v1.Video video = 5;
186
187
188    pub fn get_video(&self) -> &super::vision::Video {
189        self.video.as_ref().unwrap_or_else(|| <super::vision::Video as ::protobuf::Message>::default_instance())
190    }
191    pub fn clear_video(&mut self) {
192        self.video.clear();
193    }
194
195    pub fn has_video(&self) -> bool {
196        self.video.is_some()
197    }
198
199    // Param is passed by value, moved
200    pub fn set_video(&mut self, v: super::vision::Video) {
201        self.video = ::protobuf::SingularPtrField::some(v);
202    }
203
204    // Mutable pointer to the field.
205    // If field is not initialized, it is initialized with default value first.
206    pub fn mut_video(&mut self) -> &mut super::vision::Video {
207        if self.video.is_none() {
208            self.video.set_default();
209        }
210        self.video.as_mut().unwrap()
211    }
212
213    // Take field
214    pub fn take_video(&mut self) -> super::vision::Video {
215        self.video.take().unwrap_or_else(|| super::vision::Video::new())
216    }
217}
218
219impl ::protobuf::Message for VisionRequest {
220    fn is_initialized(&self) -> bool {
221        for v in &self.image_list {
222            if !v.is_initialized() {
223                return false;
224            }
225        };
226        for v in &self.video {
227            if !v.is_initialized() {
228                return false;
229            }
230        };
231        true
232    }
233
234    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
235        while !is.eof()? {
236            let (field_number, wire_type) = is.read_tag_unpack()?;
237            match field_number {
238                1 => {
239                    ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.image)?;
240                },
241                2 => {
242                    ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.detection, 2, &mut self.unknown_fields)?
243                },
244                3 => {
245                    ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.recognition, 3, &mut self.unknown_fields)?
246                },
247                6 => {
248                    ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.vehicle_recognition, 6, &mut self.unknown_fields)?
249                },
250                4 => {
251                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.image_list)?;
252                },
253                5 => {
254                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.video)?;
255                },
256                _ => {
257                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
258                },
259            };
260        }
261        ::std::result::Result::Ok(())
262    }
263
264    // Compute sizes of nested messages
265    #[allow(unused_variables)]
266    fn compute_size(&self) -> u32 {
267        let mut my_size = 0;
268        if !self.image.is_empty() {
269            my_size += ::protobuf::rt::bytes_size(1, &self.image);
270        }
271        for value in &self.detection {
272            my_size += ::protobuf::rt::enum_size(2, *value);
273        };
274        for value in &self.recognition {
275            my_size += ::protobuf::rt::enum_size(3, *value);
276        };
277        for value in &self.vehicle_recognition {
278            my_size += ::protobuf::rt::enum_size(6, *value);
279        };
280        if let Some(ref v) = self.image_list.as_ref() {
281            let len = v.compute_size();
282            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
283        }
284        if let Some(ref v) = self.video.as_ref() {
285            let len = v.compute_size();
286            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
287        }
288        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
289        self.cached_size.set(my_size);
290        my_size
291    }
292
293    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
294        if !self.image.is_empty() {
295            os.write_bytes(1, &self.image)?;
296        }
297        for v in &self.detection {
298            os.write_enum(2, ::protobuf::ProtobufEnum::value(v))?;
299        };
300        for v in &self.recognition {
301            os.write_enum(3, ::protobuf::ProtobufEnum::value(v))?;
302        };
303        for v in &self.vehicle_recognition {
304            os.write_enum(6, ::protobuf::ProtobufEnum::value(v))?;
305        };
306        if let Some(ref v) = self.image_list.as_ref() {
307            os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
308            os.write_raw_varint32(v.get_cached_size())?;
309            v.write_to_with_cached_sizes(os)?;
310        }
311        if let Some(ref v) = self.video.as_ref() {
312            os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?;
313            os.write_raw_varint32(v.get_cached_size())?;
314            v.write_to_with_cached_sizes(os)?;
315        }
316        os.write_unknown_fields(self.get_unknown_fields())?;
317        ::std::result::Result::Ok(())
318    }
319
320    fn get_cached_size(&self) -> u32 {
321        self.cached_size.get()
322    }
323
324    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
325        &self.unknown_fields
326    }
327
328    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
329        &mut self.unknown_fields
330    }
331
332    fn as_any(&self) -> &dyn (::std::any::Any) {
333        self as &dyn (::std::any::Any)
334    }
335    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
336        self as &mut dyn (::std::any::Any)
337    }
338    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
339        self
340    }
341
342    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
343        Self::descriptor_static()
344    }
345
346    fn new() -> VisionRequest {
347        VisionRequest::new()
348    }
349
350    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
351        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
352        descriptor.get(|| {
353            let mut fields = ::std::vec::Vec::new();
354            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
355                "image",
356                |m: &VisionRequest| { &m.image },
357                |m: &mut VisionRequest| { &mut m.image },
358            ));
359            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::vision::EnumDetectionTag>>(
360                "detection",
361                |m: &VisionRequest| { &m.detection },
362                |m: &mut VisionRequest| { &mut m.detection },
363            ));
364            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::vision::EnumFacialRecognitionTag>>(
365                "recognition",
366                |m: &VisionRequest| { &m.recognition },
367                |m: &mut VisionRequest| { &mut m.recognition },
368            ));
369            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::vision::EnumVehicleRecognitionTag>>(
370                "vehicle_recognition",
371                |m: &VisionRequest| { &m.vehicle_recognition },
372                |m: &mut VisionRequest| { &mut m.vehicle_recognition },
373            ));
374            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::vision::ImageList>>(
375                "image_list",
376                |m: &VisionRequest| { &m.image_list },
377                |m: &mut VisionRequest| { &mut m.image_list },
378            ));
379            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::vision::Video>>(
380                "video",
381                |m: &VisionRequest| { &m.video },
382                |m: &mut VisionRequest| { &mut m.video },
383            ));
384            ::protobuf::reflect::MessageDescriptor::new_pb_name::<VisionRequest>(
385                "VisionRequest",
386                fields,
387                file_descriptor_proto()
388            )
389        })
390    }
391
392    fn default_instance() -> &'static VisionRequest {
393        static instance: ::protobuf::rt::LazyV2<VisionRequest> = ::protobuf::rt::LazyV2::INIT;
394        instance.get(VisionRequest::new)
395    }
396}
397
398impl ::protobuf::Clear for VisionRequest {
399    fn clear(&mut self) {
400        self.image.clear();
401        self.detection.clear();
402        self.recognition.clear();
403        self.vehicle_recognition.clear();
404        self.image_list.clear();
405        self.video.clear();
406        self.unknown_fields.clear();
407    }
408}
409
410impl ::std::fmt::Debug for VisionRequest {
411    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
412        ::protobuf::text_format::fmt(self, f)
413    }
414}
415
416impl ::protobuf::reflect::ProtobufValue for VisionRequest {
417    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
418        ::protobuf::reflect::ReflectValueRef::Message(self)
419    }
420}
421
422static file_descriptor_proto_data: &'static [u8] = b"\
423    \n(matrix_io/vision/v1/vision_service.proto\x12\x13matrix_io.vision.v1\
424    \x1a\x20matrix_io/vision/v1/vision.proto\"\x9b\x03\n\rVisionRequest\x12\
425    \x16\n\x05image\x18\x01\x20\x01(\x0cR\x05imageB\0\x12E\n\tdetection\x18\
426    \x02\x20\x03(\x0e2%.matrix_io.vision.v1.EnumDetectionTagR\tdetectionB\0\
427    \x12Q\n\x0brecognition\x18\x03\x20\x03(\x0e2-.matrix_io.vision.v1.EnumFa\
428    cialRecognitionTagR\x0brecognitionB\0\x12a\n\x13vehicle_recognition\x18\
429    \x06\x20\x03(\x0e2..matrix_io.vision.v1.EnumVehicleRecognitionTagR\x12ve\
430    hicleRecognitionB\0\x12?\n\nimage_list\x18\x04\x20\x01(\x0b2\x1e.matrix_\
431    io.vision.v1.ImageListR\timageListB\0\x122\n\x05video\x18\x05\x20\x01(\
432    \x0b2\x1a.matrix_io.vision.v1.VideoR\x05videoB\0:\0B\0b\x06proto3\
433";
434
435static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
436
437fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
438    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
439}
440
441pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
442    file_descriptor_proto_lazy.get(|| {
443        parse_descriptor_proto()
444    })
445}