tensorflow_serving_client/
allocation_description.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/core/framework/allocation_description.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 AllocationDescription {
31    // message fields
32    pub requested_bytes: i64,
33    pub allocated_bytes: i64,
34    pub allocator_name: ::std::string::String,
35    pub allocation_id: i64,
36    pub has_single_reference: bool,
37    pub ptr: u64,
38    // special fields
39    pub unknown_fields: ::protobuf::UnknownFields,
40    pub cached_size: ::protobuf::CachedSize,
41}
42
43impl<'a> ::std::default::Default for &'a AllocationDescription {
44    fn default() -> &'a AllocationDescription {
45        <AllocationDescription as ::protobuf::Message>::default_instance()
46    }
47}
48
49impl AllocationDescription {
50    pub fn new() -> AllocationDescription {
51        ::std::default::Default::default()
52    }
53
54    // int64 requested_bytes = 1;
55
56
57    pub fn get_requested_bytes(&self) -> i64 {
58        self.requested_bytes
59    }
60    pub fn clear_requested_bytes(&mut self) {
61        self.requested_bytes = 0;
62    }
63
64    // Param is passed by value, moved
65    pub fn set_requested_bytes(&mut self, v: i64) {
66        self.requested_bytes = v;
67    }
68
69    // int64 allocated_bytes = 2;
70
71
72    pub fn get_allocated_bytes(&self) -> i64 {
73        self.allocated_bytes
74    }
75    pub fn clear_allocated_bytes(&mut self) {
76        self.allocated_bytes = 0;
77    }
78
79    // Param is passed by value, moved
80    pub fn set_allocated_bytes(&mut self, v: i64) {
81        self.allocated_bytes = v;
82    }
83
84    // string allocator_name = 3;
85
86
87    pub fn get_allocator_name(&self) -> &str {
88        &self.allocator_name
89    }
90    pub fn clear_allocator_name(&mut self) {
91        self.allocator_name.clear();
92    }
93
94    // Param is passed by value, moved
95    pub fn set_allocator_name(&mut self, v: ::std::string::String) {
96        self.allocator_name = v;
97    }
98
99    // Mutable pointer to the field.
100    // If field is not initialized, it is initialized with default value first.
101    pub fn mut_allocator_name(&mut self) -> &mut ::std::string::String {
102        &mut self.allocator_name
103    }
104
105    // Take field
106    pub fn take_allocator_name(&mut self) -> ::std::string::String {
107        ::std::mem::replace(&mut self.allocator_name, ::std::string::String::new())
108    }
109
110    // int64 allocation_id = 4;
111
112
113    pub fn get_allocation_id(&self) -> i64 {
114        self.allocation_id
115    }
116    pub fn clear_allocation_id(&mut self) {
117        self.allocation_id = 0;
118    }
119
120    // Param is passed by value, moved
121    pub fn set_allocation_id(&mut self, v: i64) {
122        self.allocation_id = v;
123    }
124
125    // bool has_single_reference = 5;
126
127
128    pub fn get_has_single_reference(&self) -> bool {
129        self.has_single_reference
130    }
131    pub fn clear_has_single_reference(&mut self) {
132        self.has_single_reference = false;
133    }
134
135    // Param is passed by value, moved
136    pub fn set_has_single_reference(&mut self, v: bool) {
137        self.has_single_reference = v;
138    }
139
140    // uint64 ptr = 6;
141
142
143    pub fn get_ptr(&self) -> u64 {
144        self.ptr
145    }
146    pub fn clear_ptr(&mut self) {
147        self.ptr = 0;
148    }
149
150    // Param is passed by value, moved
151    pub fn set_ptr(&mut self, v: u64) {
152        self.ptr = v;
153    }
154}
155
156impl ::protobuf::Message for AllocationDescription {
157    fn is_initialized(&self) -> bool {
158        true
159    }
160
161    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
162        while !is.eof()? {
163            let (field_number, wire_type) = is.read_tag_unpack()?;
164            match field_number {
165                1 => {
166                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
167                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
168                    }
169                    let tmp = is.read_int64()?;
170                    self.requested_bytes = tmp;
171                },
172                2 => {
173                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
174                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
175                    }
176                    let tmp = is.read_int64()?;
177                    self.allocated_bytes = tmp;
178                },
179                3 => {
180                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.allocator_name)?;
181                },
182                4 => {
183                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
184                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
185                    }
186                    let tmp = is.read_int64()?;
187                    self.allocation_id = tmp;
188                },
189                5 => {
190                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
191                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
192                    }
193                    let tmp = is.read_bool()?;
194                    self.has_single_reference = tmp;
195                },
196                6 => {
197                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
198                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
199                    }
200                    let tmp = is.read_uint64()?;
201                    self.ptr = tmp;
202                },
203                _ => {
204                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
205                },
206            };
207        }
208        ::std::result::Result::Ok(())
209    }
210
211    // Compute sizes of nested messages
212    #[allow(unused_variables)]
213    fn compute_size(&self) -> u32 {
214        let mut my_size = 0;
215        if self.requested_bytes != 0 {
216            my_size += ::protobuf::rt::value_size(1, self.requested_bytes, ::protobuf::wire_format::WireTypeVarint);
217        }
218        if self.allocated_bytes != 0 {
219            my_size += ::protobuf::rt::value_size(2, self.allocated_bytes, ::protobuf::wire_format::WireTypeVarint);
220        }
221        if !self.allocator_name.is_empty() {
222            my_size += ::protobuf::rt::string_size(3, &self.allocator_name);
223        }
224        if self.allocation_id != 0 {
225            my_size += ::protobuf::rt::value_size(4, self.allocation_id, ::protobuf::wire_format::WireTypeVarint);
226        }
227        if self.has_single_reference != false {
228            my_size += 2;
229        }
230        if self.ptr != 0 {
231            my_size += ::protobuf::rt::value_size(6, self.ptr, ::protobuf::wire_format::WireTypeVarint);
232        }
233        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
234        self.cached_size.set(my_size);
235        my_size
236    }
237
238    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
239        if self.requested_bytes != 0 {
240            os.write_int64(1, self.requested_bytes)?;
241        }
242        if self.allocated_bytes != 0 {
243            os.write_int64(2, self.allocated_bytes)?;
244        }
245        if !self.allocator_name.is_empty() {
246            os.write_string(3, &self.allocator_name)?;
247        }
248        if self.allocation_id != 0 {
249            os.write_int64(4, self.allocation_id)?;
250        }
251        if self.has_single_reference != false {
252            os.write_bool(5, self.has_single_reference)?;
253        }
254        if self.ptr != 0 {
255            os.write_uint64(6, self.ptr)?;
256        }
257        os.write_unknown_fields(self.get_unknown_fields())?;
258        ::std::result::Result::Ok(())
259    }
260
261    fn get_cached_size(&self) -> u32 {
262        self.cached_size.get()
263    }
264
265    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
266        &self.unknown_fields
267    }
268
269    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
270        &mut self.unknown_fields
271    }
272
273    fn as_any(&self) -> &dyn (::std::any::Any) {
274        self as &dyn (::std::any::Any)
275    }
276    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
277        self as &mut dyn (::std::any::Any)
278    }
279    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
280        self
281    }
282
283    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
284        Self::descriptor_static()
285    }
286
287    fn new() -> AllocationDescription {
288        AllocationDescription::new()
289    }
290
291    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
292        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
293        unsafe {
294            descriptor.get(|| {
295                let mut fields = ::std::vec::Vec::new();
296                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
297                    "requested_bytes",
298                    |m: &AllocationDescription| { &m.requested_bytes },
299                    |m: &mut AllocationDescription| { &mut m.requested_bytes },
300                ));
301                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
302                    "allocated_bytes",
303                    |m: &AllocationDescription| { &m.allocated_bytes },
304                    |m: &mut AllocationDescription| { &mut m.allocated_bytes },
305                ));
306                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
307                    "allocator_name",
308                    |m: &AllocationDescription| { &m.allocator_name },
309                    |m: &mut AllocationDescription| { &mut m.allocator_name },
310                ));
311                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
312                    "allocation_id",
313                    |m: &AllocationDescription| { &m.allocation_id },
314                    |m: &mut AllocationDescription| { &mut m.allocation_id },
315                ));
316                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
317                    "has_single_reference",
318                    |m: &AllocationDescription| { &m.has_single_reference },
319                    |m: &mut AllocationDescription| { &mut m.has_single_reference },
320                ));
321                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
322                    "ptr",
323                    |m: &AllocationDescription| { &m.ptr },
324                    |m: &mut AllocationDescription| { &mut m.ptr },
325                ));
326                ::protobuf::reflect::MessageDescriptor::new_pb_name::<AllocationDescription>(
327                    "AllocationDescription",
328                    fields,
329                    file_descriptor_proto()
330                )
331            })
332        }
333    }
334
335    fn default_instance() -> &'static AllocationDescription {
336        static mut instance: ::protobuf::lazy::Lazy<AllocationDescription> = ::protobuf::lazy::Lazy::INIT;
337        unsafe {
338            instance.get(AllocationDescription::new)
339        }
340    }
341}
342
343impl ::protobuf::Clear for AllocationDescription {
344    fn clear(&mut self) {
345        self.requested_bytes = 0;
346        self.allocated_bytes = 0;
347        self.allocator_name.clear();
348        self.allocation_id = 0;
349        self.has_single_reference = false;
350        self.ptr = 0;
351        self.unknown_fields.clear();
352    }
353}
354
355impl ::std::fmt::Debug for AllocationDescription {
356    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
357        ::protobuf::text_format::fmt(self, f)
358    }
359}
360
361impl ::protobuf::reflect::ProtobufValue for AllocationDescription {
362    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
363        ::protobuf::reflect::ReflectValueRef::Message(self)
364    }
365}
366
367static file_descriptor_proto_data: &'static [u8] = b"\
368    \n6tensorflow/core/framework/allocation_description.proto\x12\ntensorflo\
369    w\"\xf9\x01\n\x15AllocationDescription\x12'\n\x0frequested_bytes\x18\x01\
370    \x20\x01(\x03R\x0erequestedBytes\x12'\n\x0fallocated_bytes\x18\x02\x20\
371    \x01(\x03R\x0eallocatedBytes\x12%\n\x0eallocator_name\x18\x03\x20\x01(\t\
372    R\rallocatorName\x12#\n\rallocation_id\x18\x04\x20\x01(\x03R\x0callocati\
373    onId\x120\n\x14has_single_reference\x18\x05\x20\x01(\x08R\x12hasSingleRe\
374    ference\x12\x10\n\x03ptr\x18\x06\x20\x01(\x04R\x03ptrB\x9b\x01\n\x18org.\
375    tensorflow.frameworkB\x1bAllocationDescriptionProtosP\x01Z]github.com/te\
376    nsorflow/tensorflow/tensorflow/go/core/framework/allocation_description_\
377    go_proto\xf8\x01\x01J\xd8\x05\n\x06\x12\x04\0\0\x1c\x01\n\x08\n\x01\x0c\
378    \x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\0\x13\n\x08\n\x01\x08\x12\
379    \x03\x04\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x04\0\x1f\n\x08\n\x01\x08\x12\
380    \x03\x05\0<\n\t\n\x02\x08\x08\x12\x03\x05\0<\n\x08\n\x01\x08\x12\x03\x06\
381    \0\"\n\t\n\x02\x08\n\x12\x03\x06\0\"\n\x08\n\x01\x08\x12\x03\x07\01\n\t\
382    \n\x02\x08\x01\x12\x03\x07\01\n\x08\n\x01\x08\x12\x03\x08\0t\n\t\n\x02\
383    \x08\x0b\x12\x03\x08\0t\n\n\n\x02\x04\0\x12\x04\n\0\x1c\x01\n\n\n\x03\
384    \x04\0\x01\x12\x03\n\x08\x1d\n.\n\x04\x04\0\x02\0\x12\x03\x0c\x02\x1c\
385    \x1a!\x20Total\x20number\x20of\x20bytes\x20requested\n\n\x0c\n\x05\x04\0\
386    \x02\0\x05\x12\x03\x0c\x02\x07\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x0c\
387    \x08\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x0c\x1a\x1b\n7\n\x04\x04\0\
388    \x02\x01\x12\x03\x0f\x02\x1c\x1a*\x20Total\x20number\x20of\x20bytes\x20a\
389    llocated\x20if\x20known\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x0f\x02\
390    \x07\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x0f\x08\x17\n\x0c\n\x05\x04\0\
391    \x02\x01\x03\x12\x03\x0f\x1a\x1b\n)\n\x04\x04\0\x02\x02\x12\x03\x12\x02\
392    \x1c\x1a\x1c\x20Name\x20of\x20the\x20allocator\x20used\n\n\x0c\n\x05\x04\
393    \0\x02\x02\x05\x12\x03\x12\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\
394    \x12\t\x17\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x12\x1a\x1b\n:\n\x04\
395    \x04\0\x02\x03\x12\x03\x15\x02\x1a\x1a-\x20Identifier\x20of\x20the\x20al\
396    located\x20buffer\x20if\x20known\n\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\
397    \x15\x02\x07\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x15\x08\x15\n\x0c\n\
398    \x05\x04\0\x02\x03\x03\x12\x03\x15\x18\x19\nB\n\x04\x04\0\x02\x04\x12\
399    \x03\x18\x02\x20\x1a5\x20Set\x20if\x20this\x20tensor\x20only\x20has\x20o\
400    ne\x20remaining\x20reference\n\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x18\
401    \x02\x06\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x18\x07\x1b\n\x0c\n\x05\
402    \x04\0\x02\x04\x03\x12\x03\x18\x1e\x1f\n)\n\x04\x04\0\x02\x05\x12\x03\
403    \x1b\x02\x11\x1a\x1c\x20Address\x20of\x20the\x20allocation.\n\n\x0c\n\
404    \x05\x04\0\x02\x05\x05\x12\x03\x1b\x02\x08\n\x0c\n\x05\x04\0\x02\x05\x01\
405    \x12\x03\x1b\t\x0c\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x1b\x0f\x10b\
406    \x06proto3\
407";
408
409static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
410
411fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
412    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
413}
414
415pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
416    unsafe {
417        file_descriptor_proto_lazy.get(|| {
418            parse_descriptor_proto()
419        })
420    }
421}