tensorflow_serving_client/
inference.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/inference.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 InferenceTask {
31    // message fields
32    pub model_spec: ::protobuf::SingularPtrField<super::model::ModelSpec>,
33    pub method_name: ::std::string::String,
34    // special fields
35    pub unknown_fields: ::protobuf::UnknownFields,
36    pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a InferenceTask {
40    fn default() -> &'a InferenceTask {
41        <InferenceTask as ::protobuf::Message>::default_instance()
42    }
43}
44
45impl InferenceTask {
46    pub fn new() -> InferenceTask {
47        ::std::default::Default::default()
48    }
49
50    // .tensorflow.serving.ModelSpec model_spec = 1;
51
52
53    pub fn get_model_spec(&self) -> &super::model::ModelSpec {
54        self.model_spec.as_ref().unwrap_or_else(|| super::model::ModelSpec::default_instance())
55    }
56    pub fn clear_model_spec(&mut self) {
57        self.model_spec.clear();
58    }
59
60    pub fn has_model_spec(&self) -> bool {
61        self.model_spec.is_some()
62    }
63
64    // Param is passed by value, moved
65    pub fn set_model_spec(&mut self, v: super::model::ModelSpec) {
66        self.model_spec = ::protobuf::SingularPtrField::some(v);
67    }
68
69    // Mutable pointer to the field.
70    // If field is not initialized, it is initialized with default value first.
71    pub fn mut_model_spec(&mut self) -> &mut super::model::ModelSpec {
72        if self.model_spec.is_none() {
73            self.model_spec.set_default();
74        }
75        self.model_spec.as_mut().unwrap()
76    }
77
78    // Take field
79    pub fn take_model_spec(&mut self) -> super::model::ModelSpec {
80        self.model_spec.take().unwrap_or_else(|| super::model::ModelSpec::new())
81    }
82
83    // string method_name = 2;
84
85
86    pub fn get_method_name(&self) -> &str {
87        &self.method_name
88    }
89    pub fn clear_method_name(&mut self) {
90        self.method_name.clear();
91    }
92
93    // Param is passed by value, moved
94    pub fn set_method_name(&mut self, v: ::std::string::String) {
95        self.method_name = v;
96    }
97
98    // Mutable pointer to the field.
99    // If field is not initialized, it is initialized with default value first.
100    pub fn mut_method_name(&mut self) -> &mut ::std::string::String {
101        &mut self.method_name
102    }
103
104    // Take field
105    pub fn take_method_name(&mut self) -> ::std::string::String {
106        ::std::mem::replace(&mut self.method_name, ::std::string::String::new())
107    }
108}
109
110impl ::protobuf::Message for InferenceTask {
111    fn is_initialized(&self) -> bool {
112        for v in &self.model_spec {
113            if !v.is_initialized() {
114                return false;
115            }
116        };
117        true
118    }
119
120    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
121        while !is.eof()? {
122            let (field_number, wire_type) = is.read_tag_unpack()?;
123            match field_number {
124                1 => {
125                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.model_spec)?;
126                },
127                2 => {
128                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.method_name)?;
129                },
130                _ => {
131                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
132                },
133            };
134        }
135        ::std::result::Result::Ok(())
136    }
137
138    // Compute sizes of nested messages
139    #[allow(unused_variables)]
140    fn compute_size(&self) -> u32 {
141        let mut my_size = 0;
142        if let Some(ref v) = self.model_spec.as_ref() {
143            let len = v.compute_size();
144            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
145        }
146        if !self.method_name.is_empty() {
147            my_size += ::protobuf::rt::string_size(2, &self.method_name);
148        }
149        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
150        self.cached_size.set(my_size);
151        my_size
152    }
153
154    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
155        if let Some(ref v) = self.model_spec.as_ref() {
156            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
157            os.write_raw_varint32(v.get_cached_size())?;
158            v.write_to_with_cached_sizes(os)?;
159        }
160        if !self.method_name.is_empty() {
161            os.write_string(2, &self.method_name)?;
162        }
163        os.write_unknown_fields(self.get_unknown_fields())?;
164        ::std::result::Result::Ok(())
165    }
166
167    fn get_cached_size(&self) -> u32 {
168        self.cached_size.get()
169    }
170
171    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
172        &self.unknown_fields
173    }
174
175    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
176        &mut self.unknown_fields
177    }
178
179    fn as_any(&self) -> &dyn (::std::any::Any) {
180        self as &dyn (::std::any::Any)
181    }
182    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
183        self as &mut dyn (::std::any::Any)
184    }
185    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
186        self
187    }
188
189    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
190        Self::descriptor_static()
191    }
192
193    fn new() -> InferenceTask {
194        InferenceTask::new()
195    }
196
197    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
198        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
199        unsafe {
200            descriptor.get(|| {
201                let mut fields = ::std::vec::Vec::new();
202                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::model::ModelSpec>>(
203                    "model_spec",
204                    |m: &InferenceTask| { &m.model_spec },
205                    |m: &mut InferenceTask| { &mut m.model_spec },
206                ));
207                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
208                    "method_name",
209                    |m: &InferenceTask| { &m.method_name },
210                    |m: &mut InferenceTask| { &mut m.method_name },
211                ));
212                ::protobuf::reflect::MessageDescriptor::new_pb_name::<InferenceTask>(
213                    "InferenceTask",
214                    fields,
215                    file_descriptor_proto()
216                )
217            })
218        }
219    }
220
221    fn default_instance() -> &'static InferenceTask {
222        static mut instance: ::protobuf::lazy::Lazy<InferenceTask> = ::protobuf::lazy::Lazy::INIT;
223        unsafe {
224            instance.get(InferenceTask::new)
225        }
226    }
227}
228
229impl ::protobuf::Clear for InferenceTask {
230    fn clear(&mut self) {
231        self.model_spec.clear();
232        self.method_name.clear();
233        self.unknown_fields.clear();
234    }
235}
236
237impl ::std::fmt::Debug for InferenceTask {
238    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
239        ::protobuf::text_format::fmt(self, f)
240    }
241}
242
243impl ::protobuf::reflect::ProtobufValue for InferenceTask {
244    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
245        ::protobuf::reflect::ReflectValueRef::Message(self)
246    }
247}
248
249#[derive(PartialEq,Clone,Default)]
250pub struct InferenceResult {
251    // message fields
252    pub model_spec: ::protobuf::SingularPtrField<super::model::ModelSpec>,
253    // message oneof groups
254    pub result: ::std::option::Option<InferenceResult_oneof_result>,
255    // special fields
256    pub unknown_fields: ::protobuf::UnknownFields,
257    pub cached_size: ::protobuf::CachedSize,
258}
259
260impl<'a> ::std::default::Default for &'a InferenceResult {
261    fn default() -> &'a InferenceResult {
262        <InferenceResult as ::protobuf::Message>::default_instance()
263    }
264}
265
266#[derive(Clone,PartialEq,Debug)]
267pub enum InferenceResult_oneof_result {
268    classification_result(super::classification::ClassificationResult),
269    regression_result(super::regression::RegressionResult),
270}
271
272impl InferenceResult {
273    pub fn new() -> InferenceResult {
274        ::std::default::Default::default()
275    }
276
277    // .tensorflow.serving.ModelSpec model_spec = 1;
278
279
280    pub fn get_model_spec(&self) -> &super::model::ModelSpec {
281        self.model_spec.as_ref().unwrap_or_else(|| super::model::ModelSpec::default_instance())
282    }
283    pub fn clear_model_spec(&mut self) {
284        self.model_spec.clear();
285    }
286
287    pub fn has_model_spec(&self) -> bool {
288        self.model_spec.is_some()
289    }
290
291    // Param is passed by value, moved
292    pub fn set_model_spec(&mut self, v: super::model::ModelSpec) {
293        self.model_spec = ::protobuf::SingularPtrField::some(v);
294    }
295
296    // Mutable pointer to the field.
297    // If field is not initialized, it is initialized with default value first.
298    pub fn mut_model_spec(&mut self) -> &mut super::model::ModelSpec {
299        if self.model_spec.is_none() {
300            self.model_spec.set_default();
301        }
302        self.model_spec.as_mut().unwrap()
303    }
304
305    // Take field
306    pub fn take_model_spec(&mut self) -> super::model::ModelSpec {
307        self.model_spec.take().unwrap_or_else(|| super::model::ModelSpec::new())
308    }
309
310    // .tensorflow.serving.ClassificationResult classification_result = 2;
311
312
313    pub fn get_classification_result(&self) -> &super::classification::ClassificationResult {
314        match self.result {
315            ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(ref v)) => v,
316            _ => super::classification::ClassificationResult::default_instance(),
317        }
318    }
319    pub fn clear_classification_result(&mut self) {
320        self.result = ::std::option::Option::None;
321    }
322
323    pub fn has_classification_result(&self) -> bool {
324        match self.result {
325            ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(..)) => true,
326            _ => false,
327        }
328    }
329
330    // Param is passed by value, moved
331    pub fn set_classification_result(&mut self, v: super::classification::ClassificationResult) {
332        self.result = ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(v))
333    }
334
335    // Mutable pointer to the field.
336    pub fn mut_classification_result(&mut self) -> &mut super::classification::ClassificationResult {
337        if let ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(_)) = self.result {
338        } else {
339            self.result = ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(super::classification::ClassificationResult::new()));
340        }
341        match self.result {
342            ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(ref mut v)) => v,
343            _ => panic!(),
344        }
345    }
346
347    // Take field
348    pub fn take_classification_result(&mut self) -> super::classification::ClassificationResult {
349        if self.has_classification_result() {
350            match self.result.take() {
351                ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(v)) => v,
352                _ => panic!(),
353            }
354        } else {
355            super::classification::ClassificationResult::new()
356        }
357    }
358
359    // .tensorflow.serving.RegressionResult regression_result = 3;
360
361
362    pub fn get_regression_result(&self) -> &super::regression::RegressionResult {
363        match self.result {
364            ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(ref v)) => v,
365            _ => super::regression::RegressionResult::default_instance(),
366        }
367    }
368    pub fn clear_regression_result(&mut self) {
369        self.result = ::std::option::Option::None;
370    }
371
372    pub fn has_regression_result(&self) -> bool {
373        match self.result {
374            ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(..)) => true,
375            _ => false,
376        }
377    }
378
379    // Param is passed by value, moved
380    pub fn set_regression_result(&mut self, v: super::regression::RegressionResult) {
381        self.result = ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(v))
382    }
383
384    // Mutable pointer to the field.
385    pub fn mut_regression_result(&mut self) -> &mut super::regression::RegressionResult {
386        if let ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(_)) = self.result {
387        } else {
388            self.result = ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(super::regression::RegressionResult::new()));
389        }
390        match self.result {
391            ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(ref mut v)) => v,
392            _ => panic!(),
393        }
394    }
395
396    // Take field
397    pub fn take_regression_result(&mut self) -> super::regression::RegressionResult {
398        if self.has_regression_result() {
399            match self.result.take() {
400                ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(v)) => v,
401                _ => panic!(),
402            }
403        } else {
404            super::regression::RegressionResult::new()
405        }
406    }
407}
408
409impl ::protobuf::Message for InferenceResult {
410    fn is_initialized(&self) -> bool {
411        for v in &self.model_spec {
412            if !v.is_initialized() {
413                return false;
414            }
415        };
416        if let Some(InferenceResult_oneof_result::classification_result(ref v)) = self.result {
417            if !v.is_initialized() {
418                return false;
419            }
420        }
421        if let Some(InferenceResult_oneof_result::regression_result(ref v)) = self.result {
422            if !v.is_initialized() {
423                return false;
424            }
425        }
426        true
427    }
428
429    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
430        while !is.eof()? {
431            let (field_number, wire_type) = is.read_tag_unpack()?;
432            match field_number {
433                1 => {
434                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.model_spec)?;
435                },
436                2 => {
437                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
438                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
439                    }
440                    self.result = ::std::option::Option::Some(InferenceResult_oneof_result::classification_result(is.read_message()?));
441                },
442                3 => {
443                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
444                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
445                    }
446                    self.result = ::std::option::Option::Some(InferenceResult_oneof_result::regression_result(is.read_message()?));
447                },
448                _ => {
449                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
450                },
451            };
452        }
453        ::std::result::Result::Ok(())
454    }
455
456    // Compute sizes of nested messages
457    #[allow(unused_variables)]
458    fn compute_size(&self) -> u32 {
459        let mut my_size = 0;
460        if let Some(ref v) = self.model_spec.as_ref() {
461            let len = v.compute_size();
462            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
463        }
464        if let ::std::option::Option::Some(ref v) = self.result {
465            match v {
466                &InferenceResult_oneof_result::classification_result(ref v) => {
467                    let len = v.compute_size();
468                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
469                },
470                &InferenceResult_oneof_result::regression_result(ref v) => {
471                    let len = v.compute_size();
472                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
473                },
474            };
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        if let Some(ref v) = self.model_spec.as_ref() {
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        if let ::std::option::Option::Some(ref v) = self.result {
488            match v {
489                &InferenceResult_oneof_result::classification_result(ref v) => {
490                    os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
491                    os.write_raw_varint32(v.get_cached_size())?;
492                    v.write_to_with_cached_sizes(os)?;
493                },
494                &InferenceResult_oneof_result::regression_result(ref v) => {
495                    os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
496                    os.write_raw_varint32(v.get_cached_size())?;
497                    v.write_to_with_cached_sizes(os)?;
498                },
499            };
500        }
501        os.write_unknown_fields(self.get_unknown_fields())?;
502        ::std::result::Result::Ok(())
503    }
504
505    fn get_cached_size(&self) -> u32 {
506        self.cached_size.get()
507    }
508
509    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
510        &self.unknown_fields
511    }
512
513    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
514        &mut self.unknown_fields
515    }
516
517    fn as_any(&self) -> &dyn (::std::any::Any) {
518        self as &dyn (::std::any::Any)
519    }
520    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
521        self as &mut dyn (::std::any::Any)
522    }
523    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
524        self
525    }
526
527    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
528        Self::descriptor_static()
529    }
530
531    fn new() -> InferenceResult {
532        InferenceResult::new()
533    }
534
535    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
536        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
537        unsafe {
538            descriptor.get(|| {
539                let mut fields = ::std::vec::Vec::new();
540                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::model::ModelSpec>>(
541                    "model_spec",
542                    |m: &InferenceResult| { &m.model_spec },
543                    |m: &mut InferenceResult| { &mut m.model_spec },
544                ));
545                fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::classification::ClassificationResult>(
546                    "classification_result",
547                    InferenceResult::has_classification_result,
548                    InferenceResult::get_classification_result,
549                ));
550                fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::regression::RegressionResult>(
551                    "regression_result",
552                    InferenceResult::has_regression_result,
553                    InferenceResult::get_regression_result,
554                ));
555                ::protobuf::reflect::MessageDescriptor::new_pb_name::<InferenceResult>(
556                    "InferenceResult",
557                    fields,
558                    file_descriptor_proto()
559                )
560            })
561        }
562    }
563
564    fn default_instance() -> &'static InferenceResult {
565        static mut instance: ::protobuf::lazy::Lazy<InferenceResult> = ::protobuf::lazy::Lazy::INIT;
566        unsafe {
567            instance.get(InferenceResult::new)
568        }
569    }
570}
571
572impl ::protobuf::Clear for InferenceResult {
573    fn clear(&mut self) {
574        self.model_spec.clear();
575        self.result = ::std::option::Option::None;
576        self.result = ::std::option::Option::None;
577        self.unknown_fields.clear();
578    }
579}
580
581impl ::std::fmt::Debug for InferenceResult {
582    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
583        ::protobuf::text_format::fmt(self, f)
584    }
585}
586
587impl ::protobuf::reflect::ProtobufValue for InferenceResult {
588    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
589        ::protobuf::reflect::ReflectValueRef::Message(self)
590    }
591}
592
593#[derive(PartialEq,Clone,Default)]
594pub struct MultiInferenceRequest {
595    // message fields
596    pub tasks: ::protobuf::RepeatedField<InferenceTask>,
597    pub input: ::protobuf::SingularPtrField<super::input::Input>,
598    // special fields
599    pub unknown_fields: ::protobuf::UnknownFields,
600    pub cached_size: ::protobuf::CachedSize,
601}
602
603impl<'a> ::std::default::Default for &'a MultiInferenceRequest {
604    fn default() -> &'a MultiInferenceRequest {
605        <MultiInferenceRequest as ::protobuf::Message>::default_instance()
606    }
607}
608
609impl MultiInferenceRequest {
610    pub fn new() -> MultiInferenceRequest {
611        ::std::default::Default::default()
612    }
613
614    // repeated .tensorflow.serving.InferenceTask tasks = 1;
615
616
617    pub fn get_tasks(&self) -> &[InferenceTask] {
618        &self.tasks
619    }
620    pub fn clear_tasks(&mut self) {
621        self.tasks.clear();
622    }
623
624    // Param is passed by value, moved
625    pub fn set_tasks(&mut self, v: ::protobuf::RepeatedField<InferenceTask>) {
626        self.tasks = v;
627    }
628
629    // Mutable pointer to the field.
630    pub fn mut_tasks(&mut self) -> &mut ::protobuf::RepeatedField<InferenceTask> {
631        &mut self.tasks
632    }
633
634    // Take field
635    pub fn take_tasks(&mut self) -> ::protobuf::RepeatedField<InferenceTask> {
636        ::std::mem::replace(&mut self.tasks, ::protobuf::RepeatedField::new())
637    }
638
639    // .tensorflow.serving.Input input = 2;
640
641
642    pub fn get_input(&self) -> &super::input::Input {
643        self.input.as_ref().unwrap_or_else(|| super::input::Input::default_instance())
644    }
645    pub fn clear_input(&mut self) {
646        self.input.clear();
647    }
648
649    pub fn has_input(&self) -> bool {
650        self.input.is_some()
651    }
652
653    // Param is passed by value, moved
654    pub fn set_input(&mut self, v: super::input::Input) {
655        self.input = ::protobuf::SingularPtrField::some(v);
656    }
657
658    // Mutable pointer to the field.
659    // If field is not initialized, it is initialized with default value first.
660    pub fn mut_input(&mut self) -> &mut super::input::Input {
661        if self.input.is_none() {
662            self.input.set_default();
663        }
664        self.input.as_mut().unwrap()
665    }
666
667    // Take field
668    pub fn take_input(&mut self) -> super::input::Input {
669        self.input.take().unwrap_or_else(|| super::input::Input::new())
670    }
671}
672
673impl ::protobuf::Message for MultiInferenceRequest {
674    fn is_initialized(&self) -> bool {
675        for v in &self.tasks {
676            if !v.is_initialized() {
677                return false;
678            }
679        };
680        for v in &self.input {
681            if !v.is_initialized() {
682                return false;
683            }
684        };
685        true
686    }
687
688    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
689        while !is.eof()? {
690            let (field_number, wire_type) = is.read_tag_unpack()?;
691            match field_number {
692                1 => {
693                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tasks)?;
694                },
695                2 => {
696                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.input)?;
697                },
698                _ => {
699                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
700                },
701            };
702        }
703        ::std::result::Result::Ok(())
704    }
705
706    // Compute sizes of nested messages
707    #[allow(unused_variables)]
708    fn compute_size(&self) -> u32 {
709        let mut my_size = 0;
710        for value in &self.tasks {
711            let len = value.compute_size();
712            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
713        };
714        if let Some(ref v) = self.input.as_ref() {
715            let len = v.compute_size();
716            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
717        }
718        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
719        self.cached_size.set(my_size);
720        my_size
721    }
722
723    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
724        for v in &self.tasks {
725            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
726            os.write_raw_varint32(v.get_cached_size())?;
727            v.write_to_with_cached_sizes(os)?;
728        };
729        if let Some(ref v) = self.input.as_ref() {
730            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
731            os.write_raw_varint32(v.get_cached_size())?;
732            v.write_to_with_cached_sizes(os)?;
733        }
734        os.write_unknown_fields(self.get_unknown_fields())?;
735        ::std::result::Result::Ok(())
736    }
737
738    fn get_cached_size(&self) -> u32 {
739        self.cached_size.get()
740    }
741
742    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
743        &self.unknown_fields
744    }
745
746    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
747        &mut self.unknown_fields
748    }
749
750    fn as_any(&self) -> &dyn (::std::any::Any) {
751        self as &dyn (::std::any::Any)
752    }
753    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
754        self as &mut dyn (::std::any::Any)
755    }
756    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
757        self
758    }
759
760    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
761        Self::descriptor_static()
762    }
763
764    fn new() -> MultiInferenceRequest {
765        MultiInferenceRequest::new()
766    }
767
768    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
769        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
770        unsafe {
771            descriptor.get(|| {
772                let mut fields = ::std::vec::Vec::new();
773                fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<InferenceTask>>(
774                    "tasks",
775                    |m: &MultiInferenceRequest| { &m.tasks },
776                    |m: &mut MultiInferenceRequest| { &mut m.tasks },
777                ));
778                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::input::Input>>(
779                    "input",
780                    |m: &MultiInferenceRequest| { &m.input },
781                    |m: &mut MultiInferenceRequest| { &mut m.input },
782                ));
783                ::protobuf::reflect::MessageDescriptor::new_pb_name::<MultiInferenceRequest>(
784                    "MultiInferenceRequest",
785                    fields,
786                    file_descriptor_proto()
787                )
788            })
789        }
790    }
791
792    fn default_instance() -> &'static MultiInferenceRequest {
793        static mut instance: ::protobuf::lazy::Lazy<MultiInferenceRequest> = ::protobuf::lazy::Lazy::INIT;
794        unsafe {
795            instance.get(MultiInferenceRequest::new)
796        }
797    }
798}
799
800impl ::protobuf::Clear for MultiInferenceRequest {
801    fn clear(&mut self) {
802        self.tasks.clear();
803        self.input.clear();
804        self.unknown_fields.clear();
805    }
806}
807
808impl ::std::fmt::Debug for MultiInferenceRequest {
809    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
810        ::protobuf::text_format::fmt(self, f)
811    }
812}
813
814impl ::protobuf::reflect::ProtobufValue for MultiInferenceRequest {
815    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
816        ::protobuf::reflect::ReflectValueRef::Message(self)
817    }
818}
819
820#[derive(PartialEq,Clone,Default)]
821pub struct MultiInferenceResponse {
822    // message fields
823    pub results: ::protobuf::RepeatedField<InferenceResult>,
824    // special fields
825    pub unknown_fields: ::protobuf::UnknownFields,
826    pub cached_size: ::protobuf::CachedSize,
827}
828
829impl<'a> ::std::default::Default for &'a MultiInferenceResponse {
830    fn default() -> &'a MultiInferenceResponse {
831        <MultiInferenceResponse as ::protobuf::Message>::default_instance()
832    }
833}
834
835impl MultiInferenceResponse {
836    pub fn new() -> MultiInferenceResponse {
837        ::std::default::Default::default()
838    }
839
840    // repeated .tensorflow.serving.InferenceResult results = 1;
841
842
843    pub fn get_results(&self) -> &[InferenceResult] {
844        &self.results
845    }
846    pub fn clear_results(&mut self) {
847        self.results.clear();
848    }
849
850    // Param is passed by value, moved
851    pub fn set_results(&mut self, v: ::protobuf::RepeatedField<InferenceResult>) {
852        self.results = v;
853    }
854
855    // Mutable pointer to the field.
856    pub fn mut_results(&mut self) -> &mut ::protobuf::RepeatedField<InferenceResult> {
857        &mut self.results
858    }
859
860    // Take field
861    pub fn take_results(&mut self) -> ::protobuf::RepeatedField<InferenceResult> {
862        ::std::mem::replace(&mut self.results, ::protobuf::RepeatedField::new())
863    }
864}
865
866impl ::protobuf::Message for MultiInferenceResponse {
867    fn is_initialized(&self) -> bool {
868        for v in &self.results {
869            if !v.is_initialized() {
870                return false;
871            }
872        };
873        true
874    }
875
876    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
877        while !is.eof()? {
878            let (field_number, wire_type) = is.read_tag_unpack()?;
879            match field_number {
880                1 => {
881                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.results)?;
882                },
883                _ => {
884                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
885                },
886            };
887        }
888        ::std::result::Result::Ok(())
889    }
890
891    // Compute sizes of nested messages
892    #[allow(unused_variables)]
893    fn compute_size(&self) -> u32 {
894        let mut my_size = 0;
895        for value in &self.results {
896            let len = value.compute_size();
897            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
898        };
899        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
900        self.cached_size.set(my_size);
901        my_size
902    }
903
904    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
905        for v in &self.results {
906            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
907            os.write_raw_varint32(v.get_cached_size())?;
908            v.write_to_with_cached_sizes(os)?;
909        };
910        os.write_unknown_fields(self.get_unknown_fields())?;
911        ::std::result::Result::Ok(())
912    }
913
914    fn get_cached_size(&self) -> u32 {
915        self.cached_size.get()
916    }
917
918    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
919        &self.unknown_fields
920    }
921
922    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
923        &mut self.unknown_fields
924    }
925
926    fn as_any(&self) -> &dyn (::std::any::Any) {
927        self as &dyn (::std::any::Any)
928    }
929    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
930        self as &mut dyn (::std::any::Any)
931    }
932    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
933        self
934    }
935
936    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
937        Self::descriptor_static()
938    }
939
940    fn new() -> MultiInferenceResponse {
941        MultiInferenceResponse::new()
942    }
943
944    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
945        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
946        unsafe {
947            descriptor.get(|| {
948                let mut fields = ::std::vec::Vec::new();
949                fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<InferenceResult>>(
950                    "results",
951                    |m: &MultiInferenceResponse| { &m.results },
952                    |m: &mut MultiInferenceResponse| { &mut m.results },
953                ));
954                ::protobuf::reflect::MessageDescriptor::new_pb_name::<MultiInferenceResponse>(
955                    "MultiInferenceResponse",
956                    fields,
957                    file_descriptor_proto()
958                )
959            })
960        }
961    }
962
963    fn default_instance() -> &'static MultiInferenceResponse {
964        static mut instance: ::protobuf::lazy::Lazy<MultiInferenceResponse> = ::protobuf::lazy::Lazy::INIT;
965        unsafe {
966            instance.get(MultiInferenceResponse::new)
967        }
968    }
969}
970
971impl ::protobuf::Clear for MultiInferenceResponse {
972    fn clear(&mut self) {
973        self.results.clear();
974        self.unknown_fields.clear();
975    }
976}
977
978impl ::std::fmt::Debug for MultiInferenceResponse {
979    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
980        ::protobuf::text_format::fmt(self, f)
981    }
982}
983
984impl ::protobuf::reflect::ProtobufValue for MultiInferenceResponse {
985    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
986        ::protobuf::reflect::ReflectValueRef::Message(self)
987    }
988}
989
990static file_descriptor_proto_data: &'static [u8] = b"\
991    \n'tensorflow_serving/apis/inference.proto\x12\x12tensorflow.serving\x1a\
992    ,tensorflow_serving/apis/classification.proto\x1a#tensorflow_serving/api\
993    s/input.proto\x1a#tensorflow_serving/apis/model.proto\x1a(tensorflow_ser\
994    ving/apis/regression.proto\"n\n\rInferenceTask\x12<\n\nmodel_spec\x18\
995    \x01\x20\x01(\x0b2\x1d.tensorflow.serving.ModelSpecR\tmodelSpec\x12\x1f\
996    \n\x0bmethod_name\x18\x02\x20\x01(\tR\nmethodName\"\x8f\x02\n\x0fInferen\
997    ceResult\x12<\n\nmodel_spec\x18\x01\x20\x01(\x0b2\x1d.tensorflow.serving\
998    .ModelSpecR\tmodelSpec\x12_\n\x15classification_result\x18\x02\x20\x01(\
999    \x0b2(.tensorflow.serving.ClassificationResultH\0R\x14classificationResu\
1000    lt\x12S\n\x11regression_result\x18\x03\x20\x01(\x0b2$.tensorflow.serving\
1001    .RegressionResultH\0R\x10regressionResultB\x08\n\x06result\"\x81\x01\n\
1002    \x15MultiInferenceRequest\x127\n\x05tasks\x18\x01\x20\x03(\x0b2!.tensorf\
1003    low.serving.InferenceTaskR\x05tasks\x12/\n\x05input\x18\x02\x20\x01(\x0b\
1004    2\x19.tensorflow.serving.InputR\x05input\"W\n\x16MultiInferenceResponse\
1005    \x12=\n\x07results\x18\x01\x20\x03(\x0b2#.tensorflow.serving.InferenceRe\
1006    sultR\x07resultsB\x03\xf8\x01\x01J\xa2\x0f\n\x06\x12\x04\n\0:\x01\n\xa0\
1007    \x04\n\x01\x0c\x12\x03\n\0\x122\x95\x04\x20This\x20file\x20contains\x20m\
1008    essages\x20for\x20various\x20machine\x20learning\x20inferences\n\x20such\
1009    \x20as\x20regression\x20and\x20classification.\n\n\x20In\x20many\x20appl\
1010    ications\x20more\x20than\x20one\x20type\x20of\x20inference\x20is\x20desi\
1011    red\x20for\x20a\x20single\n\x20input.\x20\x20For\x20example,\x20given\
1012    \x20meteorologic\x20data\x20an\x20application\x20may\x20want\x20to\n\x20\
1013    perform\x20a\x20classification\x20to\x20determine\x20if\x20we\x20should\
1014    \x20expect\x20rain,\x20snow\x20or\x20sun\n\x20and\x20also\x20perform\x20\
1015    a\x20regression\x20to\x20predict\x20the\x20temperature.\n\x20Sharing\x20\
1016    the\x20single\x20input\x20data\x20between\x20two\x20inference\x20tasks\
1017    \x20can\x20be\x20accomplished\n\x20using\x20MultiInferenceRequest\x20and\
1018    \x20MultiInferenceResponse.\n\n\x08\n\x01\x08\x12\x03\x0c\0\x1f\n\t\n\
1019    \x02\x08\x1f\x12\x03\x0c\0\x1f\n\t\n\x02\x03\0\x12\x03\x0e\06\n\t\n\x02\
1020    \x03\x01\x12\x03\x0f\0-\n\t\n\x02\x03\x02\x12\x03\x10\0-\n\t\n\x02\x03\
1021    \x03\x12\x03\x11\02\n\x08\n\x01\x02\x12\x03\x13\0\x1b\nJ\n\x02\x04\0\x12\
1022    \x04\x16\0\x20\x01\x1a>\x20Inference\x20request\x20such\x20as\x20classif\
1023    ication,\x20regression,\x20etc...\n\n\n\n\x03\x04\0\x01\x12\x03\x16\x08\
1024    \x15\n\xb7\x01\n\x04\x04\0\x02\0\x12\x03\x1a\x02\x1b\x1a\xa9\x01\x20Mode\
1025    l\x20Specification.\x20If\x20version\x20is\x20not\x20specified,\x20will\
1026    \x20use\x20the\x20latest\n\x20(numerical)\x20version.\n\x20All\x20ModelS\
1027    pecs\x20in\x20a\x20MultiInferenceRequest\x20must\x20access\x20the\x20sam\
1028    e\x20model\x20name.\n\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x1a\x02\x0b\n\
1029    \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x1a\x0c\x16\n\x0c\n\x05\x04\0\x02\0\
1030    \x03\x12\x03\x1a\x19\x1a\n\xbd\x01\n\x04\x04\0\x02\x01\x12\x03\x1f\x02\
1031    \x19\x1a\xaf\x01\x20Signature's\x20method_name.\x20Should\x20be\x20one\
1032    \x20of\x20the\x20method\x20names\x20defined\x20in\n\x20third_party/tenso\
1033    rflow/python/saved_model/signature_constants.py.\n\x20e.g.\x20\"tensorfl\
1034    ow/serving/classify\".\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x1f\x02\
1035    \x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x1f\t\x14\n\x0c\n\x05\x04\0\
1036    \x02\x01\x03\x12\x03\x1f\x17\x18\nK\n\x02\x04\x01\x12\x04#\0*\x01\x1a?\
1037    \x20Inference\x20result,\x20matches\x20the\x20type\x20of\x20request\x20o\
1038    r\x20is\x20an\x20error.\n\n\n\n\x03\x04\x01\x01\x12\x03#\x08\x17\n\x0b\n\
1039    \x04\x04\x01\x02\0\x12\x03$\x02\x1b\n\x0c\n\x05\x04\x01\x02\0\x06\x12\
1040    \x03$\x02\x0b\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03$\x0c\x16\n\x0c\n\x05\
1041    \x04\x01\x02\0\x03\x12\x03$\x19\x1a\n\x0c\n\x04\x04\x01\x08\0\x12\x04&\
1042    \x02)\x03\n\x0c\n\x05\x04\x01\x08\0\x01\x12\x03&\x08\x0e\n\x0b\n\x04\x04\
1043    \x01\x02\x01\x12\x03'\x043\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03'\x04\
1044    \x18\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03'\x19.\n\x0c\n\x05\x04\x01\
1045    \x02\x01\x03\x12\x03'12\n\x0b\n\x04\x04\x01\x02\x02\x12\x03(\x04+\n\x0c\
1046    \n\x05\x04\x01\x02\x02\x06\x12\x03(\x04\x14\n\x0c\n\x05\x04\x01\x02\x02\
1047    \x01\x12\x03(\x15&\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03()*\n@\n\x02\
1048    \x04\x02\x12\x04-\03\x01\x1a4\x20Inference\x20request\x20containing\x20o\
1049    ne\x20or\x20more\x20requests.\n\n\n\n\x03\x04\x02\x01\x12\x03-\x08\x1d\n\
1050    \x1f\n\x04\x04\x02\x02\0\x12\x03/\x02#\x1a\x12\x20Inference\x20tasks.\n\
1051    \n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03/\x02\n\n\x0c\n\x05\x04\x02\x02\0\
1052    \x06\x12\x03/\x0b\x18\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03/\x19\x1e\n\
1053    \x0c\n\x05\x04\x02\x02\0\x03\x12\x03/!\"\n\x1a\n\x04\x04\x02\x02\x01\x12\
1054    \x032\x02\x12\x1a\r\x20Input\x20data.\n\n\x0c\n\x05\x04\x02\x02\x01\x06\
1055    \x12\x032\x02\x07\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x032\x08\r\n\x0c\n\
1056    \x05\x04\x02\x02\x01\x03\x12\x032\x10\x11\nA\n\x02\x04\x03\x12\x046\0:\
1057    \x01\x1a5\x20Inference\x20request\x20containing\x20one\x20or\x20more\x20\
1058    responses.\n\n\n\n\x03\x04\x03\x01\x12\x036\x08\x1e\nv\n\x04\x04\x03\x02\
1059    \0\x12\x039\x02'\x1ai\x20List\x20of\x20results;\x20one\x20for\x20each\
1060    \x20InferenceTask\x20in\x20the\x20request,\x20returned\x20in\x20the\n\
1061    \x20same\x20order\x20as\x20the\x20request.\n\n\x0c\n\x05\x04\x03\x02\0\
1062    \x04\x12\x039\x02\n\n\x0c\n\x05\x04\x03\x02\0\x06\x12\x039\x0b\x1a\n\x0c\
1063    \n\x05\x04\x03\x02\0\x01\x12\x039\x1b\"\n\x0c\n\x05\x04\x03\x02\0\x03\
1064    \x12\x039%&b\x06proto3\
1065";
1066
1067static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
1068
1069fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
1070    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
1071}
1072
1073pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
1074    unsafe {
1075        file_descriptor_proto_lazy.get(|| {
1076            parse_descriptor_proto()
1077        })
1078    }
1079}