tensorflow_serving_client/
model.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/model.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 ModelSpec {
31    // message fields
32    pub name: ::std::string::String,
33    pub signature_name: ::std::string::String,
34    // message oneof groups
35    pub version_choice: ::std::option::Option<ModelSpec_oneof_version_choice>,
36    // special fields
37    pub unknown_fields: ::protobuf::UnknownFields,
38    pub cached_size: ::protobuf::CachedSize,
39}
40
41impl<'a> ::std::default::Default for &'a ModelSpec {
42    fn default() -> &'a ModelSpec {
43        <ModelSpec as ::protobuf::Message>::default_instance()
44    }
45}
46
47#[derive(Clone,PartialEq,Debug)]
48pub enum ModelSpec_oneof_version_choice {
49    version(::protobuf::well_known_types::Int64Value),
50    version_label(::std::string::String),
51}
52
53impl ModelSpec {
54    pub fn new() -> ModelSpec {
55        ::std::default::Default::default()
56    }
57
58    // string name = 1;
59
60
61    pub fn get_name(&self) -> &str {
62        &self.name
63    }
64    pub fn clear_name(&mut self) {
65        self.name.clear();
66    }
67
68    // Param is passed by value, moved
69    pub fn set_name(&mut self, v: ::std::string::String) {
70        self.name = v;
71    }
72
73    // Mutable pointer to the field.
74    // If field is not initialized, it is initialized with default value first.
75    pub fn mut_name(&mut self) -> &mut ::std::string::String {
76        &mut self.name
77    }
78
79    // Take field
80    pub fn take_name(&mut self) -> ::std::string::String {
81        ::std::mem::replace(&mut self.name, ::std::string::String::new())
82    }
83
84    // .google.protobuf.Int64Value version = 2;
85
86
87    pub fn get_version(&self) -> &::protobuf::well_known_types::Int64Value {
88        match self.version_choice {
89            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(ref v)) => v,
90            _ => ::protobuf::well_known_types::Int64Value::default_instance(),
91        }
92    }
93    pub fn clear_version(&mut self) {
94        self.version_choice = ::std::option::Option::None;
95    }
96
97    pub fn has_version(&self) -> bool {
98        match self.version_choice {
99            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(..)) => true,
100            _ => false,
101        }
102    }
103
104    // Param is passed by value, moved
105    pub fn set_version(&mut self, v: ::protobuf::well_known_types::Int64Value) {
106        self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(v))
107    }
108
109    // Mutable pointer to the field.
110    pub fn mut_version(&mut self) -> &mut ::protobuf::well_known_types::Int64Value {
111        if let ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(_)) = self.version_choice {
112        } else {
113            self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(::protobuf::well_known_types::Int64Value::new()));
114        }
115        match self.version_choice {
116            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(ref mut v)) => v,
117            _ => panic!(),
118        }
119    }
120
121    // Take field
122    pub fn take_version(&mut self) -> ::protobuf::well_known_types::Int64Value {
123        if self.has_version() {
124            match self.version_choice.take() {
125                ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(v)) => v,
126                _ => panic!(),
127            }
128        } else {
129            ::protobuf::well_known_types::Int64Value::new()
130        }
131    }
132
133    // string version_label = 4;
134
135
136    pub fn get_version_label(&self) -> &str {
137        match self.version_choice {
138            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(ref v)) => v,
139            _ => "",
140        }
141    }
142    pub fn clear_version_label(&mut self) {
143        self.version_choice = ::std::option::Option::None;
144    }
145
146    pub fn has_version_label(&self) -> bool {
147        match self.version_choice {
148            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(..)) => true,
149            _ => false,
150        }
151    }
152
153    // Param is passed by value, moved
154    pub fn set_version_label(&mut self, v: ::std::string::String) {
155        self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(v))
156    }
157
158    // Mutable pointer to the field.
159    pub fn mut_version_label(&mut self) -> &mut ::std::string::String {
160        if let ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(_)) = self.version_choice {
161        } else {
162            self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(::std::string::String::new()));
163        }
164        match self.version_choice {
165            ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(ref mut v)) => v,
166            _ => panic!(),
167        }
168    }
169
170    // Take field
171    pub fn take_version_label(&mut self) -> ::std::string::String {
172        if self.has_version_label() {
173            match self.version_choice.take() {
174                ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(v)) => v,
175                _ => panic!(),
176            }
177        } else {
178            ::std::string::String::new()
179        }
180    }
181
182    // string signature_name = 3;
183
184
185    pub fn get_signature_name(&self) -> &str {
186        &self.signature_name
187    }
188    pub fn clear_signature_name(&mut self) {
189        self.signature_name.clear();
190    }
191
192    // Param is passed by value, moved
193    pub fn set_signature_name(&mut self, v: ::std::string::String) {
194        self.signature_name = v;
195    }
196
197    // Mutable pointer to the field.
198    // If field is not initialized, it is initialized with default value first.
199    pub fn mut_signature_name(&mut self) -> &mut ::std::string::String {
200        &mut self.signature_name
201    }
202
203    // Take field
204    pub fn take_signature_name(&mut self) -> ::std::string::String {
205        ::std::mem::replace(&mut self.signature_name, ::std::string::String::new())
206    }
207}
208
209impl ::protobuf::Message for ModelSpec {
210    fn is_initialized(&self) -> bool {
211        if let Some(ModelSpec_oneof_version_choice::version(ref v)) = self.version_choice {
212            if !v.is_initialized() {
213                return false;
214            }
215        }
216        true
217    }
218
219    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
220        while !is.eof()? {
221            let (field_number, wire_type) = is.read_tag_unpack()?;
222            match field_number {
223                1 => {
224                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
225                },
226                2 => {
227                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
228                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
229                    }
230                    self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version(is.read_message()?));
231                },
232                4 => {
233                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
234                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
235                    }
236                    self.version_choice = ::std::option::Option::Some(ModelSpec_oneof_version_choice::version_label(is.read_string()?));
237                },
238                3 => {
239                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.signature_name)?;
240                },
241                _ => {
242                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
243                },
244            };
245        }
246        ::std::result::Result::Ok(())
247    }
248
249    // Compute sizes of nested messages
250    #[allow(unused_variables)]
251    fn compute_size(&self) -> u32 {
252        let mut my_size = 0;
253        if !self.name.is_empty() {
254            my_size += ::protobuf::rt::string_size(1, &self.name);
255        }
256        if !self.signature_name.is_empty() {
257            my_size += ::protobuf::rt::string_size(3, &self.signature_name);
258        }
259        if let ::std::option::Option::Some(ref v) = self.version_choice {
260            match v {
261                &ModelSpec_oneof_version_choice::version(ref v) => {
262                    let len = v.compute_size();
263                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
264                },
265                &ModelSpec_oneof_version_choice::version_label(ref v) => {
266                    my_size += ::protobuf::rt::string_size(4, &v);
267                },
268            };
269        }
270        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
271        self.cached_size.set(my_size);
272        my_size
273    }
274
275    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
276        if !self.name.is_empty() {
277            os.write_string(1, &self.name)?;
278        }
279        if !self.signature_name.is_empty() {
280            os.write_string(3, &self.signature_name)?;
281        }
282        if let ::std::option::Option::Some(ref v) = self.version_choice {
283            match v {
284                &ModelSpec_oneof_version_choice::version(ref v) => {
285                    os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
286                    os.write_raw_varint32(v.get_cached_size())?;
287                    v.write_to_with_cached_sizes(os)?;
288                },
289                &ModelSpec_oneof_version_choice::version_label(ref v) => {
290                    os.write_string(4, v)?;
291                },
292            };
293        }
294        os.write_unknown_fields(self.get_unknown_fields())?;
295        ::std::result::Result::Ok(())
296    }
297
298    fn get_cached_size(&self) -> u32 {
299        self.cached_size.get()
300    }
301
302    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
303        &self.unknown_fields
304    }
305
306    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
307        &mut self.unknown_fields
308    }
309
310    fn as_any(&self) -> &dyn (::std::any::Any) {
311        self as &dyn (::std::any::Any)
312    }
313    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
314        self as &mut dyn (::std::any::Any)
315    }
316    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
317        self
318    }
319
320    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
321        Self::descriptor_static()
322    }
323
324    fn new() -> ModelSpec {
325        ModelSpec::new()
326    }
327
328    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
329        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
330        unsafe {
331            descriptor.get(|| {
332                let mut fields = ::std::vec::Vec::new();
333                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
334                    "name",
335                    |m: &ModelSpec| { &m.name },
336                    |m: &mut ModelSpec| { &mut m.name },
337                ));
338                fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ::protobuf::well_known_types::Int64Value>(
339                    "version",
340                    ModelSpec::has_version,
341                    ModelSpec::get_version,
342                ));
343                fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
344                    "version_label",
345                    ModelSpec::has_version_label,
346                    ModelSpec::get_version_label,
347                ));
348                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
349                    "signature_name",
350                    |m: &ModelSpec| { &m.signature_name },
351                    |m: &mut ModelSpec| { &mut m.signature_name },
352                ));
353                ::protobuf::reflect::MessageDescriptor::new_pb_name::<ModelSpec>(
354                    "ModelSpec",
355                    fields,
356                    file_descriptor_proto()
357                )
358            })
359        }
360    }
361
362    fn default_instance() -> &'static ModelSpec {
363        static mut instance: ::protobuf::lazy::Lazy<ModelSpec> = ::protobuf::lazy::Lazy::INIT;
364        unsafe {
365            instance.get(ModelSpec::new)
366        }
367    }
368}
369
370impl ::protobuf::Clear for ModelSpec {
371    fn clear(&mut self) {
372        self.name.clear();
373        self.version_choice = ::std::option::Option::None;
374        self.version_choice = ::std::option::Option::None;
375        self.signature_name.clear();
376        self.unknown_fields.clear();
377    }
378}
379
380impl ::std::fmt::Debug for ModelSpec {
381    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
382        ::protobuf::text_format::fmt(self, f)
383    }
384}
385
386impl ::protobuf::reflect::ProtobufValue for ModelSpec {
387    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
388        ::protobuf::reflect::ReflectValueRef::Message(self)
389    }
390}
391
392static file_descriptor_proto_data: &'static [u8] = b"\
393    \n#tensorflow_serving/apis/model.proto\x12\x12tensorflow.serving\x1a\x1e\
394    google/protobuf/wrappers.proto\"\xb8\x01\n\tModelSpec\x12\x12\n\x04name\
395    \x18\x01\x20\x01(\tR\x04name\x127\n\x07version\x18\x02\x20\x01(\x0b2\x1b\
396    .google.protobuf.Int64ValueH\0R\x07version\x12%\n\rversion_label\x18\x04\
397    \x20\x01(\tH\0R\x0cversionLabel\x12%\n\x0esignature_name\x18\x03\x20\x01\
398    (\tR\rsignatureNameB\x10\n\x0eversion_choiceB\x03\xf8\x01\x01J\x90\x08\n\
399    \x06\x12\x04\0\0\x20\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\
400    \x12\x03\x02\0\x1b\n\x08\n\x01\x08\x12\x03\x03\0\x1f\n\t\n\x02\x08\x1f\
401    \x12\x03\x03\0\x1f\n\t\n\x02\x03\0\x12\x03\x05\0(\nS\n\x02\x04\0\x12\x04\
402    \x08\0\x20\x01\x1aG\x20Metadata\x20for\x20an\x20inference\x20request\x20\
403    such\x20as\x20the\x20model\x20name\x20and\x20version.\n\n\n\n\x03\x04\0\
404    \x01\x12\x03\x08\x08\x11\n&\n\x04\x04\0\x02\0\x12\x03\n\x02\x12\x1a\x19\
405    \x20Required\x20servable\x20name.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\
406    \n\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\t\r\n\x0c\n\x05\x04\0\
407    \x02\0\x03\x12\x03\n\x10\x11\n\xbb\x03\n\x04\x04\0\x08\0\x12\x04\x15\x02\
408    \x1b\x03\x1a\xac\x03\x20Optional\x20choice\x20of\x20which\x20version\x20\
409    of\x20the\x20model\x20to\x20use.\n\n\x20Recommended\x20to\x20be\x20left\
410    \x20unset\x20in\x20the\x20common\x20case.\x20Should\x20be\x20specified\
411    \x20only\n\x20when\x20there\x20is\x20a\x20strong\x20version\x20consisten\
412    cy\x20requirement.\n\n\x20When\x20left\x20unspecified,\x20the\x20system\
413    \x20will\x20serve\x20the\x20best\x20available\x20version.\n\x20This\x20i\
414    s\x20typically\x20the\x20latest\x20version,\x20though\x20during\x20versi\
415    on\x20transitions,\n\x20notably\x20when\x20serving\x20on\x20a\x20fleet\
416    \x20of\x20instances,\x20may\x20be\x20either\x20the\x20previous\x20or\n\
417    \x20new\x20version.\n\n\x0c\n\x05\x04\0\x08\0\x01\x12\x03\x15\x08\x16\n0\
418    \n\x04\x04\0\x02\x01\x12\x03\x17\x04+\x1a#\x20Use\x20this\x20specific\
419    \x20version\x20number.\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x17\x04\
420    \x1e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x17\x1f&\n\x0c\n\x05\x04\0\
421    \x02\x01\x03\x12\x03\x17)*\n?\n\x04\x04\0\x02\x02\x12\x03\x1a\x04\x1d\
422    \x1a2\x20Use\x20the\x20version\x20associated\x20with\x20the\x20given\x20\
423    label.\n\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x1a\x04\n\n\x0c\n\x05\x04\
424    \0\x02\x02\x01\x12\x03\x1a\x0b\x18\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\
425    \x1a\x1b\x1c\nb\n\x04\x04\0\x02\x03\x12\x03\x1f\x02\x1c\x1aU\x20A\x20nam\
426    ed\x20signature\x20to\x20evaluate.\x20If\x20unspecified,\x20the\x20defau\
427    lt\x20signature\x20will\n\x20be\x20used.\n\n\x0c\n\x05\x04\0\x02\x03\x05\
428    \x12\x03\x1f\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x1f\t\x17\n\
429    \x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x1f\x1a\x1bb\x06proto3\
430";
431
432static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
433
434fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
435    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
436}
437
438pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
439    unsafe {
440        file_descriptor_proto_lazy.get(|| {
441            parse_descriptor_proto()
442        })
443    }
444}