tensorflow_serving_client/
classification.rs

1// This file is generated by rust-protobuf 2.14.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#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20//! Generated file from `tensorflow_serving/apis/classification.proto`
21
22use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25/// Generated files are compatible only with the same version
26/// of protobuf runtime.
27// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0;
28
29#[derive(PartialEq,Clone,Default)]
30pub struct Class {
31    // message fields
32    pub label: ::std::string::String,
33    pub score: f32,
34    // special fields
35    pub unknown_fields: ::protobuf::UnknownFields,
36    pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a Class {
40    fn default() -> &'a Class {
41        <Class as ::protobuf::Message>::default_instance()
42    }
43}
44
45impl Class {
46    pub fn new() -> Class {
47        ::std::default::Default::default()
48    }
49
50    // string label = 1;
51
52
53    pub fn get_label(&self) -> &str {
54        &self.label
55    }
56    pub fn clear_label(&mut self) {
57        self.label.clear();
58    }
59
60    // Param is passed by value, moved
61    pub fn set_label(&mut self, v: ::std::string::String) {
62        self.label = 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_label(&mut self) -> &mut ::std::string::String {
68        &mut self.label
69    }
70
71    // Take field
72    pub fn take_label(&mut self) -> ::std::string::String {
73        ::std::mem::replace(&mut self.label, ::std::string::String::new())
74    }
75
76    // float score = 2;
77
78
79    pub fn get_score(&self) -> f32 {
80        self.score
81    }
82    pub fn clear_score(&mut self) {
83        self.score = 0.;
84    }
85
86    // Param is passed by value, moved
87    pub fn set_score(&mut self, v: f32) {
88        self.score = v;
89    }
90}
91
92impl ::protobuf::Message for Class {
93    fn is_initialized(&self) -> bool {
94        true
95    }
96
97    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
98        while !is.eof()? {
99            let (field_number, wire_type) = is.read_tag_unpack()?;
100            match field_number {
101                1 => {
102                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.label)?;
103                },
104                2 => {
105                    if wire_type != ::protobuf::wire_format::WireTypeFixed32 {
106                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
107                    }
108                    let tmp = is.read_float()?;
109                    self.score = tmp;
110                },
111                _ => {
112                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
113                },
114            };
115        }
116        ::std::result::Result::Ok(())
117    }
118
119    // Compute sizes of nested messages
120    #[allow(unused_variables)]
121    fn compute_size(&self) -> u32 {
122        let mut my_size = 0;
123        if !self.label.is_empty() {
124            my_size += ::protobuf::rt::string_size(1, &self.label);
125        }
126        if self.score != 0. {
127            my_size += 5;
128        }
129        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
130        self.cached_size.set(my_size);
131        my_size
132    }
133
134    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
135        if !self.label.is_empty() {
136            os.write_string(1, &self.label)?;
137        }
138        if self.score != 0. {
139            os.write_float(2, self.score)?;
140        }
141        os.write_unknown_fields(self.get_unknown_fields())?;
142        ::std::result::Result::Ok(())
143    }
144
145    fn get_cached_size(&self) -> u32 {
146        self.cached_size.get()
147    }
148
149    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
150        &self.unknown_fields
151    }
152
153    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
154        &mut self.unknown_fields
155    }
156
157    fn as_any(&self) -> &dyn (::std::any::Any) {
158        self as &dyn (::std::any::Any)
159    }
160    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
161        self as &mut dyn (::std::any::Any)
162    }
163    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
164        self
165    }
166
167    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
168        Self::descriptor_static()
169    }
170
171    fn new() -> Class {
172        Class::new()
173    }
174
175    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
176        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
177        unsafe {
178            descriptor.get(|| {
179                let mut fields = ::std::vec::Vec::new();
180                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
181                    "label",
182                    |m: &Class| { &m.label },
183                    |m: &mut Class| { &mut m.label },
184                ));
185                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeFloat>(
186                    "score",
187                    |m: &Class| { &m.score },
188                    |m: &mut Class| { &mut m.score },
189                ));
190                ::protobuf::reflect::MessageDescriptor::new_pb_name::<Class>(
191                    "Class",
192                    fields,
193                    file_descriptor_proto()
194                )
195            })
196        }
197    }
198
199    fn default_instance() -> &'static Class {
200        static mut instance: ::protobuf::lazy::Lazy<Class> = ::protobuf::lazy::Lazy::INIT;
201        unsafe {
202            instance.get(Class::new)
203        }
204    }
205}
206
207impl ::protobuf::Clear for Class {
208    fn clear(&mut self) {
209        self.label.clear();
210        self.score = 0.;
211        self.unknown_fields.clear();
212    }
213}
214
215impl ::std::fmt::Debug for Class {
216    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
217        ::protobuf::text_format::fmt(self, f)
218    }
219}
220
221impl ::protobuf::reflect::ProtobufValue for Class {
222    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
223        ::protobuf::reflect::ReflectValueRef::Message(self)
224    }
225}
226
227#[derive(PartialEq,Clone,Default)]
228pub struct Classifications {
229    // message fields
230    pub classes: ::protobuf::RepeatedField<Class>,
231    // special fields
232    pub unknown_fields: ::protobuf::UnknownFields,
233    pub cached_size: ::protobuf::CachedSize,
234}
235
236impl<'a> ::std::default::Default for &'a Classifications {
237    fn default() -> &'a Classifications {
238        <Classifications as ::protobuf::Message>::default_instance()
239    }
240}
241
242impl Classifications {
243    pub fn new() -> Classifications {
244        ::std::default::Default::default()
245    }
246
247    // repeated .tensorflow.serving.Class classes = 1;
248
249
250    pub fn get_classes(&self) -> &[Class] {
251        &self.classes
252    }
253    pub fn clear_classes(&mut self) {
254        self.classes.clear();
255    }
256
257    // Param is passed by value, moved
258    pub fn set_classes(&mut self, v: ::protobuf::RepeatedField<Class>) {
259        self.classes = v;
260    }
261
262    // Mutable pointer to the field.
263    pub fn mut_classes(&mut self) -> &mut ::protobuf::RepeatedField<Class> {
264        &mut self.classes
265    }
266
267    // Take field
268    pub fn take_classes(&mut self) -> ::protobuf::RepeatedField<Class> {
269        ::std::mem::replace(&mut self.classes, ::protobuf::RepeatedField::new())
270    }
271}
272
273impl ::protobuf::Message for Classifications {
274    fn is_initialized(&self) -> bool {
275        for v in &self.classes {
276            if !v.is_initialized() {
277                return false;
278            }
279        };
280        true
281    }
282
283    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
284        while !is.eof()? {
285            let (field_number, wire_type) = is.read_tag_unpack()?;
286            match field_number {
287                1 => {
288                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.classes)?;
289                },
290                _ => {
291                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
292                },
293            };
294        }
295        ::std::result::Result::Ok(())
296    }
297
298    // Compute sizes of nested messages
299    #[allow(unused_variables)]
300    fn compute_size(&self) -> u32 {
301        let mut my_size = 0;
302        for value in &self.classes {
303            let len = value.compute_size();
304            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
305        };
306        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
307        self.cached_size.set(my_size);
308        my_size
309    }
310
311    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
312        for v in &self.classes {
313            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
314            os.write_raw_varint32(v.get_cached_size())?;
315            v.write_to_with_cached_sizes(os)?;
316        };
317        os.write_unknown_fields(self.get_unknown_fields())?;
318        ::std::result::Result::Ok(())
319    }
320
321    fn get_cached_size(&self) -> u32 {
322        self.cached_size.get()
323    }
324
325    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
326        &self.unknown_fields
327    }
328
329    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
330        &mut self.unknown_fields
331    }
332
333    fn as_any(&self) -> &dyn (::std::any::Any) {
334        self as &dyn (::std::any::Any)
335    }
336    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
337        self as &mut dyn (::std::any::Any)
338    }
339    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
340        self
341    }
342
343    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
344        Self::descriptor_static()
345    }
346
347    fn new() -> Classifications {
348        Classifications::new()
349    }
350
351    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
352        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
353        unsafe {
354            descriptor.get(|| {
355                let mut fields = ::std::vec::Vec::new();
356                fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Class>>(
357                    "classes",
358                    |m: &Classifications| { &m.classes },
359                    |m: &mut Classifications| { &mut m.classes },
360                ));
361                ::protobuf::reflect::MessageDescriptor::new_pb_name::<Classifications>(
362                    "Classifications",
363                    fields,
364                    file_descriptor_proto()
365                )
366            })
367        }
368    }
369
370    fn default_instance() -> &'static Classifications {
371        static mut instance: ::protobuf::lazy::Lazy<Classifications> = ::protobuf::lazy::Lazy::INIT;
372        unsafe {
373            instance.get(Classifications::new)
374        }
375    }
376}
377
378impl ::protobuf::Clear for Classifications {
379    fn clear(&mut self) {
380        self.classes.clear();
381        self.unknown_fields.clear();
382    }
383}
384
385impl ::std::fmt::Debug for Classifications {
386    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
387        ::protobuf::text_format::fmt(self, f)
388    }
389}
390
391impl ::protobuf::reflect::ProtobufValue for Classifications {
392    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
393        ::protobuf::reflect::ReflectValueRef::Message(self)
394    }
395}
396
397#[derive(PartialEq,Clone,Default)]
398pub struct ClassificationResult {
399    // message fields
400    pub classifications: ::protobuf::RepeatedField<Classifications>,
401    // special fields
402    pub unknown_fields: ::protobuf::UnknownFields,
403    pub cached_size: ::protobuf::CachedSize,
404}
405
406impl<'a> ::std::default::Default for &'a ClassificationResult {
407    fn default() -> &'a ClassificationResult {
408        <ClassificationResult as ::protobuf::Message>::default_instance()
409    }
410}
411
412impl ClassificationResult {
413    pub fn new() -> ClassificationResult {
414        ::std::default::Default::default()
415    }
416
417    // repeated .tensorflow.serving.Classifications classifications = 1;
418
419
420    pub fn get_classifications(&self) -> &[Classifications] {
421        &self.classifications
422    }
423    pub fn clear_classifications(&mut self) {
424        self.classifications.clear();
425    }
426
427    // Param is passed by value, moved
428    pub fn set_classifications(&mut self, v: ::protobuf::RepeatedField<Classifications>) {
429        self.classifications = v;
430    }
431
432    // Mutable pointer to the field.
433    pub fn mut_classifications(&mut self) -> &mut ::protobuf::RepeatedField<Classifications> {
434        &mut self.classifications
435    }
436
437    // Take field
438    pub fn take_classifications(&mut self) -> ::protobuf::RepeatedField<Classifications> {
439        ::std::mem::replace(&mut self.classifications, ::protobuf::RepeatedField::new())
440    }
441}
442
443impl ::protobuf::Message for ClassificationResult {
444    fn is_initialized(&self) -> bool {
445        for v in &self.classifications {
446            if !v.is_initialized() {
447                return false;
448            }
449        };
450        true
451    }
452
453    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
454        while !is.eof()? {
455            let (field_number, wire_type) = is.read_tag_unpack()?;
456            match field_number {
457                1 => {
458                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.classifications)?;
459                },
460                _ => {
461                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
462                },
463            };
464        }
465        ::std::result::Result::Ok(())
466    }
467
468    // Compute sizes of nested messages
469    #[allow(unused_variables)]
470    fn compute_size(&self) -> u32 {
471        let mut my_size = 0;
472        for value in &self.classifications {
473            let len = value.compute_size();
474            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
475        };
476        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
477        self.cached_size.set(my_size);
478        my_size
479    }
480
481    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
482        for v in &self.classifications {
483            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
484            os.write_raw_varint32(v.get_cached_size())?;
485            v.write_to_with_cached_sizes(os)?;
486        };
487        os.write_unknown_fields(self.get_unknown_fields())?;
488        ::std::result::Result::Ok(())
489    }
490
491    fn get_cached_size(&self) -> u32 {
492        self.cached_size.get()
493    }
494
495    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
496        &self.unknown_fields
497    }
498
499    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
500        &mut self.unknown_fields
501    }
502
503    fn as_any(&self) -> &dyn (::std::any::Any) {
504        self as &dyn (::std::any::Any)
505    }
506    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
507        self as &mut dyn (::std::any::Any)
508    }
509    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
510        self
511    }
512
513    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
514        Self::descriptor_static()
515    }
516
517    fn new() -> ClassificationResult {
518        ClassificationResult::new()
519    }
520
521    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
522        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
523        unsafe {
524            descriptor.get(|| {
525                let mut fields = ::std::vec::Vec::new();
526                fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Classifications>>(
527                    "classifications",
528                    |m: &ClassificationResult| { &m.classifications },
529                    |m: &mut ClassificationResult| { &mut m.classifications },
530                ));
531                ::protobuf::reflect::MessageDescriptor::new_pb_name::<ClassificationResult>(
532                    "ClassificationResult",
533                    fields,
534                    file_descriptor_proto()
535                )
536            })
537        }
538    }
539
540    fn default_instance() -> &'static ClassificationResult {
541        static mut instance: ::protobuf::lazy::Lazy<ClassificationResult> = ::protobuf::lazy::Lazy::INIT;
542        unsafe {
543            instance.get(ClassificationResult::new)
544        }
545    }
546}
547
548impl ::protobuf::Clear for ClassificationResult {
549    fn clear(&mut self) {
550        self.classifications.clear();
551        self.unknown_fields.clear();
552    }
553}
554
555impl ::std::fmt::Debug for ClassificationResult {
556    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
557        ::protobuf::text_format::fmt(self, f)
558    }
559}
560
561impl ::protobuf::reflect::ProtobufValue for ClassificationResult {
562    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
563        ::protobuf::reflect::ReflectValueRef::Message(self)
564    }
565}
566
567#[derive(PartialEq,Clone,Default)]
568pub struct ClassificationRequest {
569    // message fields
570    pub model_spec: ::protobuf::SingularPtrField<super::model::ModelSpec>,
571    pub input: ::protobuf::SingularPtrField<super::input::Input>,
572    // special fields
573    pub unknown_fields: ::protobuf::UnknownFields,
574    pub cached_size: ::protobuf::CachedSize,
575}
576
577impl<'a> ::std::default::Default for &'a ClassificationRequest {
578    fn default() -> &'a ClassificationRequest {
579        <ClassificationRequest as ::protobuf::Message>::default_instance()
580    }
581}
582
583impl ClassificationRequest {
584    pub fn new() -> ClassificationRequest {
585        ::std::default::Default::default()
586    }
587
588    // .tensorflow.serving.ModelSpec model_spec = 1;
589
590
591    pub fn get_model_spec(&self) -> &super::model::ModelSpec {
592        self.model_spec.as_ref().unwrap_or_else(|| super::model::ModelSpec::default_instance())
593    }
594    pub fn clear_model_spec(&mut self) {
595        self.model_spec.clear();
596    }
597
598    pub fn has_model_spec(&self) -> bool {
599        self.model_spec.is_some()
600    }
601
602    // Param is passed by value, moved
603    pub fn set_model_spec(&mut self, v: super::model::ModelSpec) {
604        self.model_spec = ::protobuf::SingularPtrField::some(v);
605    }
606
607    // Mutable pointer to the field.
608    // If field is not initialized, it is initialized with default value first.
609    pub fn mut_model_spec(&mut self) -> &mut super::model::ModelSpec {
610        if self.model_spec.is_none() {
611            self.model_spec.set_default();
612        }
613        self.model_spec.as_mut().unwrap()
614    }
615
616    // Take field
617    pub fn take_model_spec(&mut self) -> super::model::ModelSpec {
618        self.model_spec.take().unwrap_or_else(|| super::model::ModelSpec::new())
619    }
620
621    // .tensorflow.serving.Input input = 2;
622
623
624    pub fn get_input(&self) -> &super::input::Input {
625        self.input.as_ref().unwrap_or_else(|| super::input::Input::default_instance())
626    }
627    pub fn clear_input(&mut self) {
628        self.input.clear();
629    }
630
631    pub fn has_input(&self) -> bool {
632        self.input.is_some()
633    }
634
635    // Param is passed by value, moved
636    pub fn set_input(&mut self, v: super::input::Input) {
637        self.input = ::protobuf::SingularPtrField::some(v);
638    }
639
640    // Mutable pointer to the field.
641    // If field is not initialized, it is initialized with default value first.
642    pub fn mut_input(&mut self) -> &mut super::input::Input {
643        if self.input.is_none() {
644            self.input.set_default();
645        }
646        self.input.as_mut().unwrap()
647    }
648
649    // Take field
650    pub fn take_input(&mut self) -> super::input::Input {
651        self.input.take().unwrap_or_else(|| super::input::Input::new())
652    }
653}
654
655impl ::protobuf::Message for ClassificationRequest {
656    fn is_initialized(&self) -> bool {
657        for v in &self.model_spec {
658            if !v.is_initialized() {
659                return false;
660            }
661        };
662        for v in &self.input {
663            if !v.is_initialized() {
664                return false;
665            }
666        };
667        true
668    }
669
670    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
671        while !is.eof()? {
672            let (field_number, wire_type) = is.read_tag_unpack()?;
673            match field_number {
674                1 => {
675                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.model_spec)?;
676                },
677                2 => {
678                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.input)?;
679                },
680                _ => {
681                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
682                },
683            };
684        }
685        ::std::result::Result::Ok(())
686    }
687
688    // Compute sizes of nested messages
689    #[allow(unused_variables)]
690    fn compute_size(&self) -> u32 {
691        let mut my_size = 0;
692        if let Some(ref v) = self.model_spec.as_ref() {
693            let len = v.compute_size();
694            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
695        }
696        if let Some(ref v) = self.input.as_ref() {
697            let len = v.compute_size();
698            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
699        }
700        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
701        self.cached_size.set(my_size);
702        my_size
703    }
704
705    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
706        if let Some(ref v) = self.model_spec.as_ref() {
707            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
708            os.write_raw_varint32(v.get_cached_size())?;
709            v.write_to_with_cached_sizes(os)?;
710        }
711        if let Some(ref v) = self.input.as_ref() {
712            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
713            os.write_raw_varint32(v.get_cached_size())?;
714            v.write_to_with_cached_sizes(os)?;
715        }
716        os.write_unknown_fields(self.get_unknown_fields())?;
717        ::std::result::Result::Ok(())
718    }
719
720    fn get_cached_size(&self) -> u32 {
721        self.cached_size.get()
722    }
723
724    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
725        &self.unknown_fields
726    }
727
728    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
729        &mut self.unknown_fields
730    }
731
732    fn as_any(&self) -> &dyn (::std::any::Any) {
733        self as &dyn (::std::any::Any)
734    }
735    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
736        self as &mut dyn (::std::any::Any)
737    }
738    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
739        self
740    }
741
742    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
743        Self::descriptor_static()
744    }
745
746    fn new() -> ClassificationRequest {
747        ClassificationRequest::new()
748    }
749
750    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
751        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
752        unsafe {
753            descriptor.get(|| {
754                let mut fields = ::std::vec::Vec::new();
755                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::model::ModelSpec>>(
756                    "model_spec",
757                    |m: &ClassificationRequest| { &m.model_spec },
758                    |m: &mut ClassificationRequest| { &mut m.model_spec },
759                ));
760                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::input::Input>>(
761                    "input",
762                    |m: &ClassificationRequest| { &m.input },
763                    |m: &mut ClassificationRequest| { &mut m.input },
764                ));
765                ::protobuf::reflect::MessageDescriptor::new_pb_name::<ClassificationRequest>(
766                    "ClassificationRequest",
767                    fields,
768                    file_descriptor_proto()
769                )
770            })
771        }
772    }
773
774    fn default_instance() -> &'static ClassificationRequest {
775        static mut instance: ::protobuf::lazy::Lazy<ClassificationRequest> = ::protobuf::lazy::Lazy::INIT;
776        unsafe {
777            instance.get(ClassificationRequest::new)
778        }
779    }
780}
781
782impl ::protobuf::Clear for ClassificationRequest {
783    fn clear(&mut self) {
784        self.model_spec.clear();
785        self.input.clear();
786        self.unknown_fields.clear();
787    }
788}
789
790impl ::std::fmt::Debug for ClassificationRequest {
791    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
792        ::protobuf::text_format::fmt(self, f)
793    }
794}
795
796impl ::protobuf::reflect::ProtobufValue for ClassificationRequest {
797    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
798        ::protobuf::reflect::ReflectValueRef::Message(self)
799    }
800}
801
802#[derive(PartialEq,Clone,Default)]
803pub struct ClassificationResponse {
804    // message fields
805    pub model_spec: ::protobuf::SingularPtrField<super::model::ModelSpec>,
806    pub result: ::protobuf::SingularPtrField<ClassificationResult>,
807    // special fields
808    pub unknown_fields: ::protobuf::UnknownFields,
809    pub cached_size: ::protobuf::CachedSize,
810}
811
812impl<'a> ::std::default::Default for &'a ClassificationResponse {
813    fn default() -> &'a ClassificationResponse {
814        <ClassificationResponse as ::protobuf::Message>::default_instance()
815    }
816}
817
818impl ClassificationResponse {
819    pub fn new() -> ClassificationResponse {
820        ::std::default::Default::default()
821    }
822
823    // .tensorflow.serving.ModelSpec model_spec = 2;
824
825
826    pub fn get_model_spec(&self) -> &super::model::ModelSpec {
827        self.model_spec.as_ref().unwrap_or_else(|| super::model::ModelSpec::default_instance())
828    }
829    pub fn clear_model_spec(&mut self) {
830        self.model_spec.clear();
831    }
832
833    pub fn has_model_spec(&self) -> bool {
834        self.model_spec.is_some()
835    }
836
837    // Param is passed by value, moved
838    pub fn set_model_spec(&mut self, v: super::model::ModelSpec) {
839        self.model_spec = ::protobuf::SingularPtrField::some(v);
840    }
841
842    // Mutable pointer to the field.
843    // If field is not initialized, it is initialized with default value first.
844    pub fn mut_model_spec(&mut self) -> &mut super::model::ModelSpec {
845        if self.model_spec.is_none() {
846            self.model_spec.set_default();
847        }
848        self.model_spec.as_mut().unwrap()
849    }
850
851    // Take field
852    pub fn take_model_spec(&mut self) -> super::model::ModelSpec {
853        self.model_spec.take().unwrap_or_else(|| super::model::ModelSpec::new())
854    }
855
856    // .tensorflow.serving.ClassificationResult result = 1;
857
858
859    pub fn get_result(&self) -> &ClassificationResult {
860        self.result.as_ref().unwrap_or_else(|| ClassificationResult::default_instance())
861    }
862    pub fn clear_result(&mut self) {
863        self.result.clear();
864    }
865
866    pub fn has_result(&self) -> bool {
867        self.result.is_some()
868    }
869
870    // Param is passed by value, moved
871    pub fn set_result(&mut self, v: ClassificationResult) {
872        self.result = ::protobuf::SingularPtrField::some(v);
873    }
874
875    // Mutable pointer to the field.
876    // If field is not initialized, it is initialized with default value first.
877    pub fn mut_result(&mut self) -> &mut ClassificationResult {
878        if self.result.is_none() {
879            self.result.set_default();
880        }
881        self.result.as_mut().unwrap()
882    }
883
884    // Take field
885    pub fn take_result(&mut self) -> ClassificationResult {
886        self.result.take().unwrap_or_else(|| ClassificationResult::new())
887    }
888}
889
890impl ::protobuf::Message for ClassificationResponse {
891    fn is_initialized(&self) -> bool {
892        for v in &self.model_spec {
893            if !v.is_initialized() {
894                return false;
895            }
896        };
897        for v in &self.result {
898            if !v.is_initialized() {
899                return false;
900            }
901        };
902        true
903    }
904
905    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
906        while !is.eof()? {
907            let (field_number, wire_type) = is.read_tag_unpack()?;
908            match field_number {
909                2 => {
910                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.model_spec)?;
911                },
912                1 => {
913                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.result)?;
914                },
915                _ => {
916                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
917                },
918            };
919        }
920        ::std::result::Result::Ok(())
921    }
922
923    // Compute sizes of nested messages
924    #[allow(unused_variables)]
925    fn compute_size(&self) -> u32 {
926        let mut my_size = 0;
927        if let Some(ref v) = self.model_spec.as_ref() {
928            let len = v.compute_size();
929            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
930        }
931        if let Some(ref v) = self.result.as_ref() {
932            let len = v.compute_size();
933            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
934        }
935        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
936        self.cached_size.set(my_size);
937        my_size
938    }
939
940    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
941        if let Some(ref v) = self.model_spec.as_ref() {
942            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
943            os.write_raw_varint32(v.get_cached_size())?;
944            v.write_to_with_cached_sizes(os)?;
945        }
946        if let Some(ref v) = self.result.as_ref() {
947            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
948            os.write_raw_varint32(v.get_cached_size())?;
949            v.write_to_with_cached_sizes(os)?;
950        }
951        os.write_unknown_fields(self.get_unknown_fields())?;
952        ::std::result::Result::Ok(())
953    }
954
955    fn get_cached_size(&self) -> u32 {
956        self.cached_size.get()
957    }
958
959    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
960        &self.unknown_fields
961    }
962
963    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
964        &mut self.unknown_fields
965    }
966
967    fn as_any(&self) -> &dyn (::std::any::Any) {
968        self as &dyn (::std::any::Any)
969    }
970    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
971        self as &mut dyn (::std::any::Any)
972    }
973    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
974        self
975    }
976
977    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
978        Self::descriptor_static()
979    }
980
981    fn new() -> ClassificationResponse {
982        ClassificationResponse::new()
983    }
984
985    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
986        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
987        unsafe {
988            descriptor.get(|| {
989                let mut fields = ::std::vec::Vec::new();
990                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::model::ModelSpec>>(
991                    "model_spec",
992                    |m: &ClassificationResponse| { &m.model_spec },
993                    |m: &mut ClassificationResponse| { &mut m.model_spec },
994                ));
995                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<ClassificationResult>>(
996                    "result",
997                    |m: &ClassificationResponse| { &m.result },
998                    |m: &mut ClassificationResponse| { &mut m.result },
999                ));
1000                ::protobuf::reflect::MessageDescriptor::new_pb_name::<ClassificationResponse>(
1001                    "ClassificationResponse",
1002                    fields,
1003                    file_descriptor_proto()
1004                )
1005            })
1006        }
1007    }
1008
1009    fn default_instance() -> &'static ClassificationResponse {
1010        static mut instance: ::protobuf::lazy::Lazy<ClassificationResponse> = ::protobuf::lazy::Lazy::INIT;
1011        unsafe {
1012            instance.get(ClassificationResponse::new)
1013        }
1014    }
1015}
1016
1017impl ::protobuf::Clear for ClassificationResponse {
1018    fn clear(&mut self) {
1019        self.model_spec.clear();
1020        self.result.clear();
1021        self.unknown_fields.clear();
1022    }
1023}
1024
1025impl ::std::fmt::Debug for ClassificationResponse {
1026    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1027        ::protobuf::text_format::fmt(self, f)
1028    }
1029}
1030
1031impl ::protobuf::reflect::ProtobufValue for ClassificationResponse {
1032    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
1033        ::protobuf::reflect::ReflectValueRef::Message(self)
1034    }
1035}
1036
1037static file_descriptor_proto_data: &'static [u8] = b"\
1038    \n,tensorflow_serving/apis/classification.proto\x12\x12tensorflow.servin\
1039    g\x1a#tensorflow_serving/apis/input.proto\x1a#tensorflow_serving/apis/mo\
1040    del.proto\"3\n\x05Class\x12\x14\n\x05label\x18\x01\x20\x01(\tR\x05label\
1041    \x12\x14\n\x05score\x18\x02\x20\x01(\x02R\x05score\"F\n\x0fClassificatio\
1042    ns\x123\n\x07classes\x18\x01\x20\x03(\x0b2\x19.tensorflow.serving.ClassR\
1043    \x07classes\"e\n\x14ClassificationResult\x12M\n\x0fclassifications\x18\
1044    \x01\x20\x03(\x0b2#.tensorflow.serving.ClassificationsR\x0fclassificatio\
1045    ns\"\x86\x01\n\x15ClassificationRequest\x12<\n\nmodel_spec\x18\x01\x20\
1046    \x01(\x0b2\x1d.tensorflow.serving.ModelSpecR\tmodelSpec\x12/\n\x05input\
1047    \x18\x02\x20\x01(\x0b2\x19.tensorflow.serving.InputR\x05input\"\x98\x01\
1048    \n\x16ClassificationResponse\x12<\n\nmodel_spec\x18\x02\x20\x01(\x0b2\
1049    \x1d.tensorflow.serving.ModelSpecR\tmodelSpec\x12@\n\x06result\x18\x01\
1050    \x20\x01(\x0b2(.tensorflow.serving.ClassificationResultR\x06resultB\x03\
1051    \xf8\x01\x01J\xf2\t\n\x06\x12\x04\0\0/\x01\n\x08\n\x01\x0c\x12\x03\0\0\
1052    \x12\n\x08\n\x01\x08\x12\x03\x02\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x02\0\
1053    \x1f\n\t\n\x02\x03\0\x12\x03\x04\0-\n\t\n\x02\x03\x01\x12\x03\x05\0-\n\
1054    \x08\n\x01\x02\x12\x03\x07\0\x1b\n\x1d\n\x02\x04\0\x12\x04\n\0\x11\x01\
1055    \x1a\x11\x20A\x20single\x20class.\n\n\n\n\x03\x04\0\x01\x12\x03\n\x08\r\
1056    \n*\n\x04\x04\0\x02\0\x12\x03\x0c\x02\x13\x1a\x1d\x20Label\x20or\x20name\
1057    \x20of\x20the\x20class.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x0c\x02\
1058    \x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x0c\t\x0e\n\x0c\n\x05\x04\0\x02\
1059    \0\x03\x12\x03\x0c\x11\x12\n\xbd\x01\n\x04\x04\0\x02\x01\x12\x03\x10\x02\
1060    \x12\x1a\xaf\x01\x20Score\x20for\x20this\x20class\x20(e.g.,\x20the\x20pr\
1061    obability\x20the\x20item\x20belongs\x20to\x20this\n\x20class).\x20As\x20\
1062    per\x20the\x20proto3\x20default-value\x20semantics,\x20if\x20the\x20scor\
1063    e\x20is\x20missing,\n\x20it\x20should\x20be\x20treated\x20as\x200.\n\n\
1064    \x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x10\x02\x07\n\x0c\n\x05\x04\0\x02\
1065    \x01\x01\x12\x03\x10\x08\r\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x10\x10\
1066    \x11\nE\n\x02\x04\x01\x12\x04\x14\0\x16\x01\x1a9\x20List\x20of\x20classe\
1067    s\x20for\x20a\x20single\x20item\x20(tensorflow.Example).\n\n\n\n\x03\x04\
1068    \x01\x01\x12\x03\x14\x08\x17\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x15\x02\
1069    \x1d\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x15\x02\n\n\x0c\n\x05\x04\x01\
1070    \x02\0\x06\x12\x03\x15\x0b\x10\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x15\
1071    \x11\x18\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x15\x1b\x1c\nn\n\x02\x04\
1072    \x02\x12\x04\x1a\0\x1c\x01\x1ab\x20Contains\x20one\x20result\x20per\x20i\
1073    nput\x20example,\x20in\x20the\x20same\x20order\x20as\x20the\x20input\x20\
1074    in\n\x20ClassificationRequest.\n\n\n\n\x03\x04\x02\x01\x12\x03\x1a\x08\
1075    \x1c\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x1b\x02/\n\x0c\n\x05\x04\x02\x02\
1076    \0\x04\x12\x03\x1b\x02\n\n\x0c\n\x05\x04\x02\x02\0\x06\x12\x03\x1b\x0b\
1077    \x1a\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x1b\x1b*\n\x0c\n\x05\x04\x02\
1078    \x02\0\x03\x12\x03\x1b-.\n\x1c\n\x02\x04\x03\x12\x04\x20\0'\x012\x10\x20\
1079    RPC\x20Interfaces\n\n\n\n\x03\x04\x03\x01\x12\x03\x20\x08\x1d\nj\n\x04\
1080    \x04\x03\x02\0\x12\x03#\x02\x1b\x1a]\x20Model\x20Specification.\x20If\
1081    \x20version\x20is\x20not\x20specified,\x20will\x20use\x20the\x20latest\n\
1082    \x20(numerical)\x20version.\n\n\x0c\n\x05\x04\x03\x02\0\x06\x12\x03#\x02\
1083    \x0b\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03#\x0c\x16\n\x0c\n\x05\x04\x03\
1084    \x02\0\x03\x12\x03#\x19\x1a\n\x1a\n\x04\x04\x03\x02\x01\x12\x03&\x02%\
1085    \x1a\r\x20Input\x20data.\n\n\x0c\n\x05\x04\x03\x02\x01\x06\x12\x03&\x02\
1086    \x1a\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x03&\x1b\x20\n\x0c\n\x05\x04\
1087    \x03\x02\x01\x03\x12\x03&#$\n\n\n\x02\x04\x04\x12\x04)\0/\x01\n\n\n\x03\
1088    \x04\x04\x01\x12\x03)\x08\x1e\nE\n\x04\x04\x04\x02\0\x12\x03+\x02\x1b\
1089    \x1a8\x20Effective\x20Model\x20Specification\x20used\x20for\x20classific\
1090    ation.\n\n\x0c\n\x05\x04\x04\x02\0\x06\x12\x03+\x02\x0b\n\x0c\n\x05\x04\
1091    \x04\x02\0\x01\x12\x03+\x0c\x16\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03+\
1092    \x19\x1a\n,\n\x04\x04\x04\x02\x01\x12\x03.\x02\"\x1a\x1f\x20Result\x20of\
1093    \x20the\x20classification.\n\n\x0c\n\x05\x04\x04\x02\x01\x06\x12\x03.\
1094    \x02\x16\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03.\x17\x1d\n\x0c\n\x05\
1095    \x04\x04\x02\x01\x03\x12\x03.\x20!b\x06proto3\
1096";
1097
1098static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
1099
1100fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
1101    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
1102}
1103
1104pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
1105    unsafe {
1106        file_descriptor_proto_lazy.get(|| {
1107            parse_descriptor_proto()
1108        })
1109    }
1110}