tensorflow/protos/
versions.rs

1// This file is generated by rust-protobuf 2.27.1. 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#![allow(unused_attributes)]
9#![cfg_attr(rustfmt, rustfmt::skip)]
10
11#![allow(box_pointers)]
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20//! Generated file from `tensorflow/core/framework/versions.proto`
21
22/// Generated files are compatible only with the same version
23/// of protobuf runtime.
24// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_27_1;
25
26#[derive(PartialEq,Clone,Default)]
27pub struct VersionDef {
28    // message fields
29    pub producer: i32,
30    pub min_consumer: i32,
31    pub bad_consumers: ::std::vec::Vec<i32>,
32    // special fields
33    pub unknown_fields: ::protobuf::UnknownFields,
34    pub cached_size: ::protobuf::CachedSize,
35}
36
37impl<'a> ::std::default::Default for &'a VersionDef {
38    fn default() -> &'a VersionDef {
39        <VersionDef as ::protobuf::Message>::default_instance()
40    }
41}
42
43impl VersionDef {
44    pub fn new() -> VersionDef {
45        ::std::default::Default::default()
46    }
47
48    // int32 producer = 1;
49
50
51    pub fn get_producer(&self) -> i32 {
52        self.producer
53    }
54    pub fn clear_producer(&mut self) {
55        self.producer = 0;
56    }
57
58    // Param is passed by value, moved
59    pub fn set_producer(&mut self, v: i32) {
60        self.producer = v;
61    }
62
63    // int32 min_consumer = 2;
64
65
66    pub fn get_min_consumer(&self) -> i32 {
67        self.min_consumer
68    }
69    pub fn clear_min_consumer(&mut self) {
70        self.min_consumer = 0;
71    }
72
73    // Param is passed by value, moved
74    pub fn set_min_consumer(&mut self, v: i32) {
75        self.min_consumer = v;
76    }
77
78    // repeated int32 bad_consumers = 3;
79
80
81    pub fn get_bad_consumers(&self) -> &[i32] {
82        &self.bad_consumers
83    }
84    pub fn clear_bad_consumers(&mut self) {
85        self.bad_consumers.clear();
86    }
87
88    // Param is passed by value, moved
89    pub fn set_bad_consumers(&mut self, v: ::std::vec::Vec<i32>) {
90        self.bad_consumers = v;
91    }
92
93    // Mutable pointer to the field.
94    pub fn mut_bad_consumers(&mut self) -> &mut ::std::vec::Vec<i32> {
95        &mut self.bad_consumers
96    }
97
98    // Take field
99    pub fn take_bad_consumers(&mut self) -> ::std::vec::Vec<i32> {
100        ::std::mem::replace(&mut self.bad_consumers, ::std::vec::Vec::new())
101    }
102}
103
104impl ::protobuf::Message for VersionDef {
105    fn is_initialized(&self) -> bool {
106        true
107    }
108
109    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
110        while !is.eof()? {
111            let (field_number, wire_type) = is.read_tag_unpack()?;
112            match field_number {
113                1 => {
114                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
115                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
116                    }
117                    let tmp = is.read_int32()?;
118                    self.producer = tmp;
119                },
120                2 => {
121                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
122                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
123                    }
124                    let tmp = is.read_int32()?;
125                    self.min_consumer = tmp;
126                },
127                3 => {
128                    ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.bad_consumers)?;
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 self.producer != 0 {
143            my_size += ::protobuf::rt::value_size(1, self.producer, ::protobuf::wire_format::WireTypeVarint);
144        }
145        if self.min_consumer != 0 {
146            my_size += ::protobuf::rt::value_size(2, self.min_consumer, ::protobuf::wire_format::WireTypeVarint);
147        }
148        for value in &self.bad_consumers {
149            my_size += ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint);
150        };
151        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
152        self.cached_size.set(my_size);
153        my_size
154    }
155
156    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
157        if self.producer != 0 {
158            os.write_int32(1, self.producer)?;
159        }
160        if self.min_consumer != 0 {
161            os.write_int32(2, self.min_consumer)?;
162        }
163        for v in &self.bad_consumers {
164            os.write_int32(3, *v)?;
165        };
166        os.write_unknown_fields(self.get_unknown_fields())?;
167        ::std::result::Result::Ok(())
168    }
169
170    fn get_cached_size(&self) -> u32 {
171        self.cached_size.get()
172    }
173
174    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
175        &self.unknown_fields
176    }
177
178    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
179        &mut self.unknown_fields
180    }
181
182    fn as_any(&self) -> &dyn (::std::any::Any) {
183        self as &dyn (::std::any::Any)
184    }
185    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
186        self as &mut dyn (::std::any::Any)
187    }
188    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
189        self
190    }
191
192    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
193        Self::descriptor_static()
194    }
195
196    fn new() -> VersionDef {
197        VersionDef::new()
198    }
199
200    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
201        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
202        descriptor.get(|| {
203            let mut fields = ::std::vec::Vec::new();
204            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
205                "producer",
206                |m: &VersionDef| { &m.producer },
207                |m: &mut VersionDef| { &mut m.producer },
208            ));
209            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
210                "min_consumer",
211                |m: &VersionDef| { &m.min_consumer },
212                |m: &mut VersionDef| { &mut m.min_consumer },
213            ));
214            fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
215                "bad_consumers",
216                |m: &VersionDef| { &m.bad_consumers },
217                |m: &mut VersionDef| { &mut m.bad_consumers },
218            ));
219            ::protobuf::reflect::MessageDescriptor::new_pb_name::<VersionDef>(
220                "VersionDef",
221                fields,
222                file_descriptor_proto()
223            )
224        })
225    }
226
227    fn default_instance() -> &'static VersionDef {
228        static instance: ::protobuf::rt::LazyV2<VersionDef> = ::protobuf::rt::LazyV2::INIT;
229        instance.get(VersionDef::new)
230    }
231}
232
233impl ::protobuf::Clear for VersionDef {
234    fn clear(&mut self) {
235        self.producer = 0;
236        self.min_consumer = 0;
237        self.bad_consumers.clear();
238        self.unknown_fields.clear();
239    }
240}
241
242impl ::std::fmt::Debug for VersionDef {
243    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
244        ::protobuf::text_format::fmt(self, f)
245    }
246}
247
248impl ::protobuf::reflect::ProtobufValue for VersionDef {
249    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
250        ::protobuf::reflect::ReflectValueRef::Message(self)
251    }
252}
253
254static file_descriptor_proto_data: &'static [u8] = b"\
255    \n(tensorflow/core/framework/versions.proto\x12\ntensorflow\"p\n\nVersio\
256    nDef\x12\x1a\n\x08producer\x18\x01\x20\x01(\x05R\x08producer\x12!\n\x0cm\
257    in_consumer\x18\x02\x20\x01(\x05R\x0bminConsumer\x12#\n\rbad_consumers\
258    \x18\x03\x20\x03(\x05R\x0cbadConsumersB\x80\x01\n\x18org.tensorflow.fram\
259    eworkB\x0eVersionsProtosP\x01ZOgithub.com/tensorflow/tensorflow/tensorfl\
260    ow/go/core/framework/versions_go_proto\xf8\x01\x01b\x06proto3\
261";
262
263static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
264
265fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
266    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
267}
268
269pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
270    file_descriptor_proto_lazy.get(|| {
271        parse_descriptor_proto()
272    })
273}