tensorflow_serving_client/
logging_config.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/config/logging_config.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 SamplingConfig {
31    // message fields
32    pub sampling_rate: f64,
33    // special fields
34    pub unknown_fields: ::protobuf::UnknownFields,
35    pub cached_size: ::protobuf::CachedSize,
36}
37
38impl<'a> ::std::default::Default for &'a SamplingConfig {
39    fn default() -> &'a SamplingConfig {
40        <SamplingConfig as ::protobuf::Message>::default_instance()
41    }
42}
43
44impl SamplingConfig {
45    pub fn new() -> SamplingConfig {
46        ::std::default::Default::default()
47    }
48
49    // double sampling_rate = 1;
50
51
52    pub fn get_sampling_rate(&self) -> f64 {
53        self.sampling_rate
54    }
55    pub fn clear_sampling_rate(&mut self) {
56        self.sampling_rate = 0.;
57    }
58
59    // Param is passed by value, moved
60    pub fn set_sampling_rate(&mut self, v: f64) {
61        self.sampling_rate = v;
62    }
63}
64
65impl ::protobuf::Message for SamplingConfig {
66    fn is_initialized(&self) -> bool {
67        true
68    }
69
70    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
71        while !is.eof()? {
72            let (field_number, wire_type) = is.read_tag_unpack()?;
73            match field_number {
74                1 => {
75                    if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
76                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
77                    }
78                    let tmp = is.read_double()?;
79                    self.sampling_rate = tmp;
80                },
81                _ => {
82                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
83                },
84            };
85        }
86        ::std::result::Result::Ok(())
87    }
88
89    // Compute sizes of nested messages
90    #[allow(unused_variables)]
91    fn compute_size(&self) -> u32 {
92        let mut my_size = 0;
93        if self.sampling_rate != 0. {
94            my_size += 9;
95        }
96        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
97        self.cached_size.set(my_size);
98        my_size
99    }
100
101    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
102        if self.sampling_rate != 0. {
103            os.write_double(1, self.sampling_rate)?;
104        }
105        os.write_unknown_fields(self.get_unknown_fields())?;
106        ::std::result::Result::Ok(())
107    }
108
109    fn get_cached_size(&self) -> u32 {
110        self.cached_size.get()
111    }
112
113    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
114        &self.unknown_fields
115    }
116
117    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
118        &mut self.unknown_fields
119    }
120
121    fn as_any(&self) -> &dyn (::std::any::Any) {
122        self as &dyn (::std::any::Any)
123    }
124    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
125        self as &mut dyn (::std::any::Any)
126    }
127    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
128        self
129    }
130
131    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
132        Self::descriptor_static()
133    }
134
135    fn new() -> SamplingConfig {
136        SamplingConfig::new()
137    }
138
139    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
140        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
141        unsafe {
142            descriptor.get(|| {
143                let mut fields = ::std::vec::Vec::new();
144                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
145                    "sampling_rate",
146                    |m: &SamplingConfig| { &m.sampling_rate },
147                    |m: &mut SamplingConfig| { &mut m.sampling_rate },
148                ));
149                ::protobuf::reflect::MessageDescriptor::new_pb_name::<SamplingConfig>(
150                    "SamplingConfig",
151                    fields,
152                    file_descriptor_proto()
153                )
154            })
155        }
156    }
157
158    fn default_instance() -> &'static SamplingConfig {
159        static mut instance: ::protobuf::lazy::Lazy<SamplingConfig> = ::protobuf::lazy::Lazy::INIT;
160        unsafe {
161            instance.get(SamplingConfig::new)
162        }
163    }
164}
165
166impl ::protobuf::Clear for SamplingConfig {
167    fn clear(&mut self) {
168        self.sampling_rate = 0.;
169        self.unknown_fields.clear();
170    }
171}
172
173impl ::std::fmt::Debug for SamplingConfig {
174    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
175        ::protobuf::text_format::fmt(self, f)
176    }
177}
178
179impl ::protobuf::reflect::ProtobufValue for SamplingConfig {
180    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
181        ::protobuf::reflect::ReflectValueRef::Message(self)
182    }
183}
184
185#[derive(PartialEq,Clone,Default)]
186pub struct LoggingConfig {
187    // message fields
188    pub log_collector_config: ::protobuf::SingularPtrField<super::log_collector_config::LogCollectorConfig>,
189    pub sampling_config: ::protobuf::SingularPtrField<SamplingConfig>,
190    // special fields
191    pub unknown_fields: ::protobuf::UnknownFields,
192    pub cached_size: ::protobuf::CachedSize,
193}
194
195impl<'a> ::std::default::Default for &'a LoggingConfig {
196    fn default() -> &'a LoggingConfig {
197        <LoggingConfig as ::protobuf::Message>::default_instance()
198    }
199}
200
201impl LoggingConfig {
202    pub fn new() -> LoggingConfig {
203        ::std::default::Default::default()
204    }
205
206    // .tensorflow.serving.LogCollectorConfig log_collector_config = 1;
207
208
209    pub fn get_log_collector_config(&self) -> &super::log_collector_config::LogCollectorConfig {
210        self.log_collector_config.as_ref().unwrap_or_else(|| super::log_collector_config::LogCollectorConfig::default_instance())
211    }
212    pub fn clear_log_collector_config(&mut self) {
213        self.log_collector_config.clear();
214    }
215
216    pub fn has_log_collector_config(&self) -> bool {
217        self.log_collector_config.is_some()
218    }
219
220    // Param is passed by value, moved
221    pub fn set_log_collector_config(&mut self, v: super::log_collector_config::LogCollectorConfig) {
222        self.log_collector_config = ::protobuf::SingularPtrField::some(v);
223    }
224
225    // Mutable pointer to the field.
226    // If field is not initialized, it is initialized with default value first.
227    pub fn mut_log_collector_config(&mut self) -> &mut super::log_collector_config::LogCollectorConfig {
228        if self.log_collector_config.is_none() {
229            self.log_collector_config.set_default();
230        }
231        self.log_collector_config.as_mut().unwrap()
232    }
233
234    // Take field
235    pub fn take_log_collector_config(&mut self) -> super::log_collector_config::LogCollectorConfig {
236        self.log_collector_config.take().unwrap_or_else(|| super::log_collector_config::LogCollectorConfig::new())
237    }
238
239    // .tensorflow.serving.SamplingConfig sampling_config = 2;
240
241
242    pub fn get_sampling_config(&self) -> &SamplingConfig {
243        self.sampling_config.as_ref().unwrap_or_else(|| SamplingConfig::default_instance())
244    }
245    pub fn clear_sampling_config(&mut self) {
246        self.sampling_config.clear();
247    }
248
249    pub fn has_sampling_config(&self) -> bool {
250        self.sampling_config.is_some()
251    }
252
253    // Param is passed by value, moved
254    pub fn set_sampling_config(&mut self, v: SamplingConfig) {
255        self.sampling_config = ::protobuf::SingularPtrField::some(v);
256    }
257
258    // Mutable pointer to the field.
259    // If field is not initialized, it is initialized with default value first.
260    pub fn mut_sampling_config(&mut self) -> &mut SamplingConfig {
261        if self.sampling_config.is_none() {
262            self.sampling_config.set_default();
263        }
264        self.sampling_config.as_mut().unwrap()
265    }
266
267    // Take field
268    pub fn take_sampling_config(&mut self) -> SamplingConfig {
269        self.sampling_config.take().unwrap_or_else(|| SamplingConfig::new())
270    }
271}
272
273impl ::protobuf::Message for LoggingConfig {
274    fn is_initialized(&self) -> bool {
275        for v in &self.log_collector_config {
276            if !v.is_initialized() {
277                return false;
278            }
279        };
280        for v in &self.sampling_config {
281            if !v.is_initialized() {
282                return false;
283            }
284        };
285        true
286    }
287
288    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
289        while !is.eof()? {
290            let (field_number, wire_type) = is.read_tag_unpack()?;
291            match field_number {
292                1 => {
293                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.log_collector_config)?;
294                },
295                2 => {
296                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.sampling_config)?;
297                },
298                _ => {
299                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
300                },
301            };
302        }
303        ::std::result::Result::Ok(())
304    }
305
306    // Compute sizes of nested messages
307    #[allow(unused_variables)]
308    fn compute_size(&self) -> u32 {
309        let mut my_size = 0;
310        if let Some(ref v) = self.log_collector_config.as_ref() {
311            let len = v.compute_size();
312            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
313        }
314        if let Some(ref v) = self.sampling_config.as_ref() {
315            let len = v.compute_size();
316            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
317        }
318        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
319        self.cached_size.set(my_size);
320        my_size
321    }
322
323    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
324        if let Some(ref v) = self.log_collector_config.as_ref() {
325            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
326            os.write_raw_varint32(v.get_cached_size())?;
327            v.write_to_with_cached_sizes(os)?;
328        }
329        if let Some(ref v) = self.sampling_config.as_ref() {
330            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
331            os.write_raw_varint32(v.get_cached_size())?;
332            v.write_to_with_cached_sizes(os)?;
333        }
334        os.write_unknown_fields(self.get_unknown_fields())?;
335        ::std::result::Result::Ok(())
336    }
337
338    fn get_cached_size(&self) -> u32 {
339        self.cached_size.get()
340    }
341
342    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
343        &self.unknown_fields
344    }
345
346    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
347        &mut self.unknown_fields
348    }
349
350    fn as_any(&self) -> &dyn (::std::any::Any) {
351        self as &dyn (::std::any::Any)
352    }
353    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
354        self as &mut dyn (::std::any::Any)
355    }
356    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
357        self
358    }
359
360    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
361        Self::descriptor_static()
362    }
363
364    fn new() -> LoggingConfig {
365        LoggingConfig::new()
366    }
367
368    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
369        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
370        unsafe {
371            descriptor.get(|| {
372                let mut fields = ::std::vec::Vec::new();
373                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::log_collector_config::LogCollectorConfig>>(
374                    "log_collector_config",
375                    |m: &LoggingConfig| { &m.log_collector_config },
376                    |m: &mut LoggingConfig| { &mut m.log_collector_config },
377                ));
378                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<SamplingConfig>>(
379                    "sampling_config",
380                    |m: &LoggingConfig| { &m.sampling_config },
381                    |m: &mut LoggingConfig| { &mut m.sampling_config },
382                ));
383                ::protobuf::reflect::MessageDescriptor::new_pb_name::<LoggingConfig>(
384                    "LoggingConfig",
385                    fields,
386                    file_descriptor_proto()
387                )
388            })
389        }
390    }
391
392    fn default_instance() -> &'static LoggingConfig {
393        static mut instance: ::protobuf::lazy::Lazy<LoggingConfig> = ::protobuf::lazy::Lazy::INIT;
394        unsafe {
395            instance.get(LoggingConfig::new)
396        }
397    }
398}
399
400impl ::protobuf::Clear for LoggingConfig {
401    fn clear(&mut self) {
402        self.log_collector_config.clear();
403        self.sampling_config.clear();
404        self.unknown_fields.clear();
405    }
406}
407
408impl ::std::fmt::Debug for LoggingConfig {
409    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
410        ::protobuf::text_format::fmt(self, f)
411    }
412}
413
414impl ::protobuf::reflect::ProtobufValue for LoggingConfig {
415    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
416        ::protobuf::reflect::ReflectValueRef::Message(self)
417    }
418}
419
420static file_descriptor_proto_data: &'static [u8] = b"\
421    \n.tensorflow_serving/config/logging_config.proto\x12\x12tensorflow.serv\
422    ing\x1a4tensorflow_serving/config/log_collector_config.proto\"5\n\x0eSam\
423    plingConfig\x12#\n\rsampling_rate\x18\x01\x20\x01(\x01R\x0csamplingRate\
424    \"\xb6\x01\n\rLoggingConfig\x12X\n\x14log_collector_config\x18\x01\x20\
425    \x01(\x0b2&.tensorflow.serving.LogCollectorConfigR\x12logCollectorConfig\
426    \x12K\n\x0fsampling_config\x18\x02\x20\x01(\x0b2\".tensorflow.serving.Sa\
427    mplingConfigR\x0esamplingConfigB\x03\xf8\x01\x01J\x9d\x03\n\x06\x12\x04\
428    \0\0\x11\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\
429    \0\x1b\n\x08\n\x01\x08\x12\x03\x03\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x03\0\
430    \x1f\n\t\n\x02\x03\0\x12\x03\x05\0>\n\n\n\x02\x04\0\x12\x04\x07\0\x0b\
431    \x01\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x16\ni\n\x04\x04\0\x02\0\x12\
432    \x03\n\x02\x1b\x1a\\\x20Requests\x20will\x20be\x20logged\x20uniformly\
433    \x20at\x20random\x20with\x20this\x20probability.\x20Valid\n\x20range:\
434    \x20[0,\x201.0].\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\n\x02\x08\n\x0c\n\
435    \x05\x04\0\x02\0\x01\x12\x03\n\t\x16\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\
436    \n\x19\x1a\n8\n\x02\x04\x01\x12\x04\x0e\0\x11\x01\x1a,\x20Configuration\
437    \x20for\x20logging\x20query/responses.\n\n\n\n\x03\x04\x01\x01\x12\x03\
438    \x0e\x08\x15\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x0f\x02.\n\x0c\n\x05\x04\
439    \x01\x02\0\x06\x12\x03\x0f\x02\x14\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\
440    \x0f\x15)\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0f,-\n\x0b\n\x04\x04\
441    \x01\x02\x01\x12\x03\x10\x02%\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03\
442    \x10\x02\x10\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x10\x11\x20\n\x0c\n\
443    \x05\x04\x01\x02\x01\x03\x12\x03\x10#$b\x06proto3\
444";
445
446static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
447
448fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
449    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
450}
451
452pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
453    unsafe {
454        file_descriptor_proto_lazy.get(|| {
455            parse_descriptor_proto()
456        })
457    }
458}