grpcio_proto/proto/protobuf/testing/
empty.rs

1// This file is generated by rust-protobuf 2.8.2. Do not edit
2// @generated
3
4// https://github.com/Manishearth/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 `grpc/testing/empty.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
28#[derive(PartialEq,Clone,Default)]
29pub struct Empty {
30    // special fields
31    pub unknown_fields: ::protobuf::UnknownFields,
32    pub cached_size: ::protobuf::CachedSize,
33}
34
35impl<'a> ::std::default::Default for &'a Empty {
36    fn default() -> &'a Empty {
37        <Empty as ::protobuf::Message>::default_instance()
38    }
39}
40
41impl Empty {
42    pub fn new() -> Empty {
43        ::std::default::Default::default()
44    }
45}
46
47impl ::protobuf::Message for Empty {
48    fn is_initialized(&self) -> bool {
49        true
50    }
51
52    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
53        while !is.eof()? {
54            let (field_number, wire_type) = is.read_tag_unpack()?;
55            match field_number {
56                _ => {
57                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
58                },
59            };
60        }
61        ::std::result::Result::Ok(())
62    }
63
64    // Compute sizes of nested messages
65    #[allow(unused_variables)]
66    fn compute_size(&self) -> u32 {
67        let mut my_size = 0;
68        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
69        self.cached_size.set(my_size);
70        my_size
71    }
72
73    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
74        os.write_unknown_fields(self.get_unknown_fields())?;
75        ::std::result::Result::Ok(())
76    }
77
78    fn get_cached_size(&self) -> u32 {
79        self.cached_size.get()
80    }
81
82    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
83        &self.unknown_fields
84    }
85
86    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
87        &mut self.unknown_fields
88    }
89
90    fn as_any(&self) -> &dyn (::std::any::Any) {
91        self as &dyn (::std::any::Any)
92    }
93    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
94        self as &mut dyn (::std::any::Any)
95    }
96    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
97        self
98    }
99
100    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
101        Self::descriptor_static()
102    }
103
104    fn new() -> Empty {
105        Empty::new()
106    }
107
108    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
109        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
110            lock: ::protobuf::lazy::ONCE_INIT,
111            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
112        };
113        unsafe {
114            descriptor.get(|| {
115                let fields = ::std::vec::Vec::new();
116                ::protobuf::reflect::MessageDescriptor::new::<Empty>(
117                    "Empty",
118                    fields,
119                    file_descriptor_proto()
120                )
121            })
122        }
123    }
124
125    fn default_instance() -> &'static Empty {
126        static mut instance: ::protobuf::lazy::Lazy<Empty> = ::protobuf::lazy::Lazy {
127            lock: ::protobuf::lazy::ONCE_INIT,
128            ptr: 0 as *const Empty,
129        };
130        unsafe {
131            instance.get(Empty::new)
132        }
133    }
134}
135
136impl ::protobuf::Clear for Empty {
137    fn clear(&mut self) {
138        self.unknown_fields.clear();
139    }
140}
141
142impl ::std::fmt::Debug for Empty {
143    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
144        ::protobuf::text_format::fmt(self, f)
145    }
146}
147
148impl ::protobuf::reflect::ProtobufValue for Empty {
149    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
150        ::protobuf::reflect::ProtobufValueRef::Message(self)
151    }
152}
153
154static file_descriptor_proto_data: &'static [u8] = b"\
155    \n\x18grpc/testing/empty.proto\x12\x0cgrpc.testing\"\x07\n\x05Emptyb\x06\
156    proto3\
157";
158
159static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
160    lock: ::protobuf::lazy::ONCE_INIT,
161    ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
162};
163
164fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
165    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
166}
167
168pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
169    unsafe {
170        file_descriptor_proto_lazy.get(|| {
171            parse_descriptor_proto()
172        })
173    }
174}