tensorflow_serving_client/
status.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/util/status.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 StatusProto {
31    // message fields
32    pub error_code: super::error_codes::Code,
33    pub error_message: ::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 StatusProto {
40    fn default() -> &'a StatusProto {
41        <StatusProto as ::protobuf::Message>::default_instance()
42    }
43}
44
45impl StatusProto {
46    pub fn new() -> StatusProto {
47        ::std::default::Default::default()
48    }
49
50    // .tensorflow.error.Code error_code = 1;
51
52
53    pub fn get_error_code(&self) -> super::error_codes::Code {
54        self.error_code
55    }
56    pub fn clear_error_code(&mut self) {
57        self.error_code = super::error_codes::Code::OK;
58    }
59
60    // Param is passed by value, moved
61    pub fn set_error_code(&mut self, v: super::error_codes::Code) {
62        self.error_code = v;
63    }
64
65    // string error_message = 2;
66
67
68    pub fn get_error_message(&self) -> &str {
69        &self.error_message
70    }
71    pub fn clear_error_message(&mut self) {
72        self.error_message.clear();
73    }
74
75    // Param is passed by value, moved
76    pub fn set_error_message(&mut self, v: ::std::string::String) {
77        self.error_message = v;
78    }
79
80    // Mutable pointer to the field.
81    // If field is not initialized, it is initialized with default value first.
82    pub fn mut_error_message(&mut self) -> &mut ::std::string::String {
83        &mut self.error_message
84    }
85
86    // Take field
87    pub fn take_error_message(&mut self) -> ::std::string::String {
88        ::std::mem::replace(&mut self.error_message, ::std::string::String::new())
89    }
90}
91
92impl ::protobuf::Message for StatusProto {
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_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.error_code, 1, &mut self.unknown_fields)?
103                },
104                2 => {
105                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.error_message)?;
106                },
107                _ => {
108                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
109                },
110            };
111        }
112        ::std::result::Result::Ok(())
113    }
114
115    // Compute sizes of nested messages
116    #[allow(unused_variables)]
117    fn compute_size(&self) -> u32 {
118        let mut my_size = 0;
119        if self.error_code != super::error_codes::Code::OK {
120            my_size += ::protobuf::rt::enum_size(1, self.error_code);
121        }
122        if !self.error_message.is_empty() {
123            my_size += ::protobuf::rt::string_size(2, &self.error_message);
124        }
125        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
126        self.cached_size.set(my_size);
127        my_size
128    }
129
130    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
131        if self.error_code != super::error_codes::Code::OK {
132            os.write_enum(1, self.error_code.value())?;
133        }
134        if !self.error_message.is_empty() {
135            os.write_string(2, &self.error_message)?;
136        }
137        os.write_unknown_fields(self.get_unknown_fields())?;
138        ::std::result::Result::Ok(())
139    }
140
141    fn get_cached_size(&self) -> u32 {
142        self.cached_size.get()
143    }
144
145    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
146        &self.unknown_fields
147    }
148
149    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
150        &mut self.unknown_fields
151    }
152
153    fn as_any(&self) -> &dyn (::std::any::Any) {
154        self as &dyn (::std::any::Any)
155    }
156    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
157        self as &mut dyn (::std::any::Any)
158    }
159    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
160        self
161    }
162
163    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
164        Self::descriptor_static()
165    }
166
167    fn new() -> StatusProto {
168        StatusProto::new()
169    }
170
171    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
172        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
173        unsafe {
174            descriptor.get(|| {
175                let mut fields = ::std::vec::Vec::new();
176                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::error_codes::Code>>(
177                    "error_code",
178                    |m: &StatusProto| { &m.error_code },
179                    |m: &mut StatusProto| { &mut m.error_code },
180                ));
181                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
182                    "error_message",
183                    |m: &StatusProto| { &m.error_message },
184                    |m: &mut StatusProto| { &mut m.error_message },
185                ));
186                ::protobuf::reflect::MessageDescriptor::new_pb_name::<StatusProto>(
187                    "StatusProto",
188                    fields,
189                    file_descriptor_proto()
190                )
191            })
192        }
193    }
194
195    fn default_instance() -> &'static StatusProto {
196        static mut instance: ::protobuf::lazy::Lazy<StatusProto> = ::protobuf::lazy::Lazy::INIT;
197        unsafe {
198            instance.get(StatusProto::new)
199        }
200    }
201}
202
203impl ::protobuf::Clear for StatusProto {
204    fn clear(&mut self) {
205        self.error_code = super::error_codes::Code::OK;
206        self.error_message.clear();
207        self.unknown_fields.clear();
208    }
209}
210
211impl ::std::fmt::Debug for StatusProto {
212    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
213        ::protobuf::text_format::fmt(self, f)
214    }
215}
216
217impl ::protobuf::reflect::ProtobufValue for StatusProto {
218    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
219        ::protobuf::reflect::ReflectValueRef::Message(self)
220    }
221}
222
223static file_descriptor_proto_data: &'static [u8] = b"\
224    \n$tensorflow_serving/util/status.proto\x12\x12tensorflow.serving\x1a*te\
225    nsorflow/core/protobuf/error_codes.proto\"k\n\x0bStatusProto\x126\n\nerr\
226    or_code\x18\x01\x20\x01(\x0e2\x16.tensorflow.error.CodeR\nerror_code\x12\
227    $\n\rerror_message\x18\x02\x20\x01(\tR\rerror_messageB\x03\xf8\x01\x01J\
228    \xbd\x03\n\x06\x12\x04\0\0\x10\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\
229    \n\x01\x02\x12\x03\x02\0\x1b\n\t\n\x02\x03\0\x12\x03\x04\04\n\x08\n\x01\
230    \x08\x12\x03\x06\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x06\0\x1f\nb\n\x02\x04\
231    \0\x12\x04\n\0\x10\x01\x1aV\x20Status\x20that\x20corresponds\x20to\x20St\
232    atus\x20in\n\x20third_party/tensorflow/core/lib/core/status.h.\n\n\n\n\
233    \x03\x04\0\x01\x12\x03\n\x08\x13\n\x1a\n\x04\x04\0\x02\0\x12\x03\x0c\x02\
234    7\x1a\r\x20Error\x20code.\n\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0c\x02\
235    \x0c\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x0c\r\x17\n\x0c\n\x05\x04\0\x02\
236    \0\x03\x12\x03\x0c\x1a\x1b\n\x0c\n\x05\x04\0\x02\0\x08\x12\x03\x0c\x1c6\
237    \n\x0c\n\x05\x04\0\x02\0\n\x12\x03\x0c\x1d5\n\x0c\n\x05\x04\0\x02\0\n\
238    \x12\x03\x0c)5\nK\n\x04\x04\0\x02\x01\x12\x03\x0f\x029\x1a>\x20Error\x20\
239    message.\x20Will\x20only\x20be\x20set\x20if\x20an\x20error\x20was\x20enc\
240    ountered.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x0f\x02\x08\n\x0c\n\
241    \x05\x04\0\x02\x01\x01\x12\x03\x0f\t\x16\n\x0c\n\x05\x04\0\x02\x01\x03\
242    \x12\x03\x0f\x19\x1a\n\x0c\n\x05\x04\0\x02\x01\x08\x12\x03\x0f\x1b8\n\
243    \x0c\n\x05\x04\0\x02\x01\n\x12\x03\x0f\x1c7\n\x0c\n\x05\x04\0\x02\x01\n\
244    \x12\x03\x0f(7b\x06proto3\
245";
246
247static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
248
249fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
250    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
251}
252
253pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
254    unsafe {
255        file_descriptor_proto_lazy.get(|| {
256            parse_descriptor_proto()
257        })
258    }
259}