tensorboard_proto/
resource_handle.rs1#![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#[derive(PartialEq,Clone,Default)]
27pub struct ResourceHandleProto {
28 pub device: ::std::string::String,
30 pub container: ::std::string::String,
31 pub name: ::std::string::String,
32 pub hash_code: u64,
33 pub maybe_type_name: ::std::string::String,
34 pub unknown_fields: ::protobuf::UnknownFields,
36 pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a ResourceHandleProto {
40 fn default() -> &'a ResourceHandleProto {
41 <ResourceHandleProto as ::protobuf::Message>::default_instance()
42 }
43}
44
45impl ResourceHandleProto {
46 pub fn new() -> ResourceHandleProto {
47 ::std::default::Default::default()
48 }
49
50 pub fn get_device(&self) -> &str {
54 &self.device
55 }
56 pub fn clear_device(&mut self) {
57 self.device.clear();
58 }
59
60 pub fn set_device(&mut self, v: ::std::string::String) {
62 self.device = v;
63 }
64
65 pub fn mut_device(&mut self) -> &mut ::std::string::String {
68 &mut self.device
69 }
70
71 pub fn take_device(&mut self) -> ::std::string::String {
73 ::std::mem::replace(&mut self.device, ::std::string::String::new())
74 }
75
76 pub fn get_container(&self) -> &str {
80 &self.container
81 }
82 pub fn clear_container(&mut self) {
83 self.container.clear();
84 }
85
86 pub fn set_container(&mut self, v: ::std::string::String) {
88 self.container = v;
89 }
90
91 pub fn mut_container(&mut self) -> &mut ::std::string::String {
94 &mut self.container
95 }
96
97 pub fn take_container(&mut self) -> ::std::string::String {
99 ::std::mem::replace(&mut self.container, ::std::string::String::new())
100 }
101
102 pub fn get_name(&self) -> &str {
106 &self.name
107 }
108 pub fn clear_name(&mut self) {
109 self.name.clear();
110 }
111
112 pub fn set_name(&mut self, v: ::std::string::String) {
114 self.name = v;
115 }
116
117 pub fn mut_name(&mut self) -> &mut ::std::string::String {
120 &mut self.name
121 }
122
123 pub fn take_name(&mut self) -> ::std::string::String {
125 ::std::mem::replace(&mut self.name, ::std::string::String::new())
126 }
127
128 pub fn get_hash_code(&self) -> u64 {
132 self.hash_code
133 }
134 pub fn clear_hash_code(&mut self) {
135 self.hash_code = 0;
136 }
137
138 pub fn set_hash_code(&mut self, v: u64) {
140 self.hash_code = v;
141 }
142
143 pub fn get_maybe_type_name(&self) -> &str {
147 &self.maybe_type_name
148 }
149 pub fn clear_maybe_type_name(&mut self) {
150 self.maybe_type_name.clear();
151 }
152
153 pub fn set_maybe_type_name(&mut self, v: ::std::string::String) {
155 self.maybe_type_name = v;
156 }
157
158 pub fn mut_maybe_type_name(&mut self) -> &mut ::std::string::String {
161 &mut self.maybe_type_name
162 }
163
164 pub fn take_maybe_type_name(&mut self) -> ::std::string::String {
166 ::std::mem::replace(&mut self.maybe_type_name, ::std::string::String::new())
167 }
168}
169
170impl ::protobuf::Message for ResourceHandleProto {
171 fn is_initialized(&self) -> bool {
172 true
173 }
174
175 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
176 while !is.eof()? {
177 let (field_number, wire_type) = is.read_tag_unpack()?;
178 match field_number {
179 1 => {
180 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.device)?;
181 },
182 2 => {
183 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.container)?;
184 },
185 3 => {
186 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
187 },
188 4 => {
189 if wire_type != ::protobuf::wire_format::WireTypeVarint {
190 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
191 }
192 let tmp = is.read_uint64()?;
193 self.hash_code = tmp;
194 },
195 5 => {
196 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.maybe_type_name)?;
197 },
198 _ => {
199 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
200 },
201 };
202 }
203 ::std::result::Result::Ok(())
204 }
205
206 #[allow(unused_variables)]
208 fn compute_size(&self) -> u32 {
209 let mut my_size = 0;
210 if !self.device.is_empty() {
211 my_size += ::protobuf::rt::string_size(1, &self.device);
212 }
213 if !self.container.is_empty() {
214 my_size += ::protobuf::rt::string_size(2, &self.container);
215 }
216 if !self.name.is_empty() {
217 my_size += ::protobuf::rt::string_size(3, &self.name);
218 }
219 if self.hash_code != 0 {
220 my_size += ::protobuf::rt::value_size(4, self.hash_code, ::protobuf::wire_format::WireTypeVarint);
221 }
222 if !self.maybe_type_name.is_empty() {
223 my_size += ::protobuf::rt::string_size(5, &self.maybe_type_name);
224 }
225 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
226 self.cached_size.set(my_size);
227 my_size
228 }
229
230 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
231 if !self.device.is_empty() {
232 os.write_string(1, &self.device)?;
233 }
234 if !self.container.is_empty() {
235 os.write_string(2, &self.container)?;
236 }
237 if !self.name.is_empty() {
238 os.write_string(3, &self.name)?;
239 }
240 if self.hash_code != 0 {
241 os.write_uint64(4, self.hash_code)?;
242 }
243 if !self.maybe_type_name.is_empty() {
244 os.write_string(5, &self.maybe_type_name)?;
245 }
246 os.write_unknown_fields(self.get_unknown_fields())?;
247 ::std::result::Result::Ok(())
248 }
249
250 fn get_cached_size(&self) -> u32 {
251 self.cached_size.get()
252 }
253
254 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
255 &self.unknown_fields
256 }
257
258 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
259 &mut self.unknown_fields
260 }
261
262 fn as_any(&self) -> &dyn (::std::any::Any) {
263 self as &dyn (::std::any::Any)
264 }
265 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
266 self as &mut dyn (::std::any::Any)
267 }
268 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
269 self
270 }
271
272 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
273 Self::descriptor_static()
274 }
275
276 fn new() -> ResourceHandleProto {
277 ResourceHandleProto::new()
278 }
279
280 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
281 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
282 descriptor.get(|| {
283 let mut fields = ::std::vec::Vec::new();
284 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
285 "device",
286 |m: &ResourceHandleProto| { &m.device },
287 |m: &mut ResourceHandleProto| { &mut m.device },
288 ));
289 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
290 "container",
291 |m: &ResourceHandleProto| { &m.container },
292 |m: &mut ResourceHandleProto| { &mut m.container },
293 ));
294 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
295 "name",
296 |m: &ResourceHandleProto| { &m.name },
297 |m: &mut ResourceHandleProto| { &mut m.name },
298 ));
299 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
300 "hash_code",
301 |m: &ResourceHandleProto| { &m.hash_code },
302 |m: &mut ResourceHandleProto| { &mut m.hash_code },
303 ));
304 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
305 "maybe_type_name",
306 |m: &ResourceHandleProto| { &m.maybe_type_name },
307 |m: &mut ResourceHandleProto| { &mut m.maybe_type_name },
308 ));
309 ::protobuf::reflect::MessageDescriptor::new_pb_name::<ResourceHandleProto>(
310 "ResourceHandleProto",
311 fields,
312 file_descriptor_proto()
313 )
314 })
315 }
316
317 fn default_instance() -> &'static ResourceHandleProto {
318 static instance: ::protobuf::rt::LazyV2<ResourceHandleProto> = ::protobuf::rt::LazyV2::INIT;
319 instance.get(ResourceHandleProto::new)
320 }
321}
322
323impl ::protobuf::Clear for ResourceHandleProto {
324 fn clear(&mut self) {
325 self.device.clear();
326 self.container.clear();
327 self.name.clear();
328 self.hash_code = 0;
329 self.maybe_type_name.clear();
330 self.unknown_fields.clear();
331 }
332}
333
334impl ::std::fmt::Debug for ResourceHandleProto {
335 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
336 ::protobuf::text_format::fmt(self, f)
337 }
338}
339
340impl ::protobuf::reflect::ProtobufValue for ResourceHandleProto {
341 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
342 ::protobuf::reflect::ReflectValueRef::Message(self)
343 }
344}
345
346static file_descriptor_proto_data: &'static [u8] = b"\
347 \n\x19src/resource_handle.proto\x12\rtensorboardrs\"\xa4\x01\n\x13Resour\
348 ceHandleProto\x12\x16\n\x06device\x18\x01\x20\x01(\tR\x06device\x12\x1c\
349 \n\tcontainer\x18\x02\x20\x01(\tR\tcontainer\x12\x12\n\x04name\x18\x03\
350 \x20\x01(\tR\x04name\x12\x1b\n\thash_code\x18\x04\x20\x01(\x04R\x08hashC\
351 ode\x12&\n\x0fmaybe_type_name\x18\x05\x20\x01(\tR\rmaybeTypeNameB/\n\x18\
352 org.tensorflow.frameworkB\x0eResourceHandleP\x01\xf8\x01\x01J\x8b\x07\n\
353 \x06\x12\x04\0\0\x1c\x02\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\
354 \x12\x03\x02\0\x16\n\x08\n\x01\x08\x12\x03\x03\0\x1f\n\t\n\x02\x08\x1f\
355 \x12\x03\x03\0\x1f\n\x08\n\x01\x08\x12\x03\x04\0/\n\t\n\x02\x08\x08\x12\
356 \x03\x04\0/\n\x08\n\x01\x08\x12\x03\x05\0\"\n\t\n\x02\x08\n\x12\x03\x05\
357 \0\"\n\x08\n\x01\x08\x12\x03\x06\01\n\t\n\x02\x08\x01\x12\x03\x06\01\n\
358 \xb8\x01\n\x02\x04\0\x12\x04\x0b\0\x1c\x01\x1a\xab\x01\x20Protocol\x20bu\
359 ffer\x20representing\x20a\x20handle\x20to\x20a\x20tensorflow\x20resource\
360 .\x20Handles\x20are\n\x20not\x20valid\x20across\x20executions,\x20but\
361 \x20can\x20be\x20serialized\x20back\x20and\x20forth\x20from\x20within\n\
362 \x20a\x20single\x20run.\n\n\n\n\x03\x04\0\x01\x12\x03\x0b\x08\x1b\nB\n\
363 \x04\x04\0\x02\0\x12\x03\r\x02\x14\x1a5\x20Unique\x20name\x20for\x20the\
364 \x20device\x20containing\x20the\x20resource.\n\n\x0c\n\x05\x04\0\x02\0\
365 \x05\x12\x03\r\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\r\t\x0f\n\x0c\
366 \n\x05\x04\0\x02\0\x03\x12\x03\r\x12\x13\n:\n\x04\x04\0\x02\x01\x12\x03\
367 \x10\x02\x17\x1a-\x20Container\x20in\x20which\x20this\x20resource\x20is\
368 \x20placed.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x10\x02\x08\n\x0c\n\
369 \x05\x04\0\x02\x01\x01\x12\x03\x10\t\x12\n\x0c\n\x05\x04\0\x02\x01\x03\
370 \x12\x03\x10\x15\x16\n,\n\x04\x04\0\x02\x02\x12\x03\x13\x02\x12\x1a\x1f\
371 \x20Unique\x20name\x20of\x20this\x20resource.\n\n\x0c\n\x05\x04\0\x02\
372 \x02\x05\x12\x03\x13\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x13\t\
373 \r\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x13\x10\x11\ns\n\x04\x04\0\x02\
374 \x03\x12\x03\x17\x02\x17\x1af\x20Hash\x20code\x20for\x20the\x20type\x20o\
375 f\x20the\x20resource.\x20Is\x20only\x20valid\x20in\x20the\x20same\x20dev\
376 ice\n\x20and\x20in\x20the\x20same\x20execution.\n\n\x0c\n\x05\x04\0\x02\
377 \x03\x05\x12\x03\x17\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x17\t\
378 \x12\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x17\x15\x16\n]\n\x04\x04\0\
379 \x02\x04\x12\x03\x1b\x02\x1d\x1aP\x20For\x20debug-only,\x20the\x20name\
380 \x20of\x20the\x20type\x20pointed\x20to\x20by\x20this\x20handle,\x20if\n\
381 \x20available.\n\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x1b\x02\x08\n\x0c\
382 \n\x05\x04\0\x02\x04\x01\x12\x03\x1b\t\x18\n\x0c\n\x05\x04\0\x02\x04\x03\
383 \x12\x03\x1b\x1b\x1cb\x06proto3\
384";
385
386static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
387
388fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
389 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
390}
391
392pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
393 file_descriptor_proto_lazy.get(|| {
394 parse_descriptor_proto()
395 })
396}