protobuf/well_known_types/
empty.rs
1#![allow(unknown_lints)]
7#![allow(clippy::all)]
8
9#![allow(unused_attributes)]
10#![cfg_attr(rustfmt, rustfmt::skip)]
11
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_results)]
19#![allow(unused_mut)]
20
21#[derive(PartialEq,Clone,Default,Debug)]
25pub struct Empty {
26 pub special_fields: crate::SpecialFields,
29}
30
31impl<'a> ::std::default::Default for &'a Empty {
32 fn default() -> &'a Empty {
33 <Empty as crate::Message>::default_instance()
34 }
35}
36
37impl Empty {
38 pub fn new() -> Empty {
39 ::std::default::Default::default()
40 }
41
42 fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData {
43 let mut fields = ::std::vec::Vec::with_capacity(0);
44 let mut oneofs = ::std::vec::Vec::with_capacity(0);
45 crate::reflect::GeneratedMessageDescriptorData::new_2::<Empty>(
46 "Empty",
47 fields,
48 oneofs,
49 )
50 }
51}
52
53impl crate::Message for Empty {
54 const NAME: &'static str = "Empty";
55
56 fn is_initialized(&self) -> bool {
57 true
58 }
59
60 fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> {
61 while let Some(tag) = is.read_raw_tag_or_eof()? {
62 match tag {
63 tag => {
64 crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
65 },
66 };
67 }
68 ::std::result::Result::Ok(())
69 }
70
71 #[allow(unused_variables)]
73 fn compute_size(&self) -> u64 {
74 let mut my_size = 0;
75 my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields());
76 self.special_fields.cached_size().set(my_size as u32);
77 my_size
78 }
79
80 fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> {
81 os.write_unknown_fields(self.special_fields.unknown_fields())?;
82 ::std::result::Result::Ok(())
83 }
84
85 fn special_fields(&self) -> &crate::SpecialFields {
86 &self.special_fields
87 }
88
89 fn mut_special_fields(&mut self) -> &mut crate::SpecialFields {
90 &mut self.special_fields
91 }
92
93 fn new() -> Empty {
94 Empty::new()
95 }
96
97 fn clear(&mut self) {
98 self.special_fields.clear();
99 }
100
101 fn default_instance() -> &'static Empty {
102 static instance: Empty = Empty {
103 special_fields: crate::SpecialFields::new(),
104 };
105 &instance
106 }
107}
108
109impl crate::MessageFull for Empty {
110 fn descriptor() -> crate::reflect::MessageDescriptor {
111 static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new();
112 descriptor.get(|| file_descriptor().message_by_package_relative_name("Empty").unwrap()).clone()
113 }
114}
115
116impl ::std::fmt::Display for Empty {
117 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
118 crate::text_format::fmt(self, f)
119 }
120}
121
122impl crate::reflect::ProtobufValue for Empty {
123 type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>;
124}
125
126static file_descriptor_proto_data: &'static [u8] = b"\
127 \n\x1bgoogle/protobuf/empty.proto\x12\x0fgoogle.protobuf\"\x07\n\x05Empt\
128 yB}\n\x13com.google.protobufB\nEmptyProtoP\x01Z.google.golang.org/protob\
129 uf/types/known/emptypb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Prot\
130 obuf.WellKnownTypesJ\xfe\x10\n\x06\x12\x04\x1e\03\x10\n\xcc\x0c\n\x01\
131 \x0c\x12\x03\x1e\0\x122\xc1\x0c\x20Protocol\x20Buffers\x20-\x20Google's\
132 \x20data\x20interchange\x20format\n\x20Copyright\x202008\x20Google\x20In\
133 c.\x20\x20All\x20rights\x20reserved.\n\x20https://developers.google.com/\
134 protocol-buffers/\n\n\x20Redistribution\x20and\x20use\x20in\x20source\
135 \x20and\x20binary\x20forms,\x20with\x20or\x20without\n\x20modification,\
136 \x20are\x20permitted\x20provided\x20that\x20the\x20following\x20conditio\
137 ns\x20are\n\x20met:\n\n\x20\x20\x20\x20\x20*\x20Redistributions\x20of\
138 \x20source\x20code\x20must\x20retain\x20the\x20above\x20copyright\n\x20n\
139 otice,\x20this\x20list\x20of\x20conditions\x20and\x20the\x20following\
140 \x20disclaimer.\n\x20\x20\x20\x20\x20*\x20Redistributions\x20in\x20binar\
141 y\x20form\x20must\x20reproduce\x20the\x20above\n\x20copyright\x20notice,\
142 \x20this\x20list\x20of\x20conditions\x20and\x20the\x20following\x20discl\
143 aimer\n\x20in\x20the\x20documentation\x20and/or\x20other\x20materials\
144 \x20provided\x20with\x20the\n\x20distribution.\n\x20\x20\x20\x20\x20*\
145 \x20Neither\x20the\x20name\x20of\x20Google\x20Inc.\x20nor\x20the\x20name\
146 s\x20of\x20its\n\x20contributors\x20may\x20be\x20used\x20to\x20endorse\
147 \x20or\x20promote\x20products\x20derived\x20from\n\x20this\x20software\
148 \x20without\x20specific\x20prior\x20written\x20permission.\n\n\x20THIS\
149 \x20SOFTWARE\x20IS\x20PROVIDED\x20BY\x20THE\x20COPYRIGHT\x20HOLDERS\x20A\
150 ND\x20CONTRIBUTORS\n\x20\"AS\x20IS\"\x20AND\x20ANY\x20EXPRESS\x20OR\x20I\
151 MPLIED\x20WARRANTIES,\x20INCLUDING,\x20BUT\x20NOT\n\x20LIMITED\x20TO,\
152 \x20THE\x20IMPLIED\x20WARRANTIES\x20OF\x20MERCHANTABILITY\x20AND\x20FITN\
153 ESS\x20FOR\n\x20A\x20PARTICULAR\x20PURPOSE\x20ARE\x20DISCLAIMED.\x20IN\
154 \x20NO\x20EVENT\x20SHALL\x20THE\x20COPYRIGHT\n\x20OWNER\x20OR\x20CONTRIB\
155 UTORS\x20BE\x20LIABLE\x20FOR\x20ANY\x20DIRECT,\x20INDIRECT,\x20INCIDENTA\
156 L,\n\x20SPECIAL,\x20EXEMPLARY,\x20OR\x20CONSEQUENTIAL\x20DAMAGES\x20(INC\
157 LUDING,\x20BUT\x20NOT\n\x20LIMITED\x20TO,\x20PROCUREMENT\x20OF\x20SUBSTI\
158 TUTE\x20GOODS\x20OR\x20SERVICES;\x20LOSS\x20OF\x20USE,\n\x20DATA,\x20OR\
159 \x20PROFITS;\x20OR\x20BUSINESS\x20INTERRUPTION)\x20HOWEVER\x20CAUSED\x20\
160 AND\x20ON\x20ANY\n\x20THEORY\x20OF\x20LIABILITY,\x20WHETHER\x20IN\x20CON\
161 TRACT,\x20STRICT\x20LIABILITY,\x20OR\x20TORT\n\x20(INCLUDING\x20NEGLIGEN\
162 CE\x20OR\x20OTHERWISE)\x20ARISING\x20IN\x20ANY\x20WAY\x20OUT\x20OF\x20TH\
163 E\x20USE\n\x20OF\x20THIS\x20SOFTWARE,\x20EVEN\x20IF\x20ADVISED\x20OF\x20\
164 THE\x20POSSIBILITY\x20OF\x20SUCH\x20DAMAGE.\n\n\x08\n\x01\x02\x12\x03\
165 \x20\0\x18\n\x08\n\x01\x08\x12\x03\"\0;\n\t\n\x02\x08%\x12\x03\"\0;\n\
166 \x08\n\x01\x08\x12\x03#\0E\n\t\n\x02\x08\x0b\x12\x03#\0E\n\x08\n\x01\x08\
167 \x12\x03$\0,\n\t\n\x02\x08\x01\x12\x03$\0,\n\x08\n\x01\x08\x12\x03%\0+\n\
168 \t\n\x02\x08\x08\x12\x03%\0+\n\x08\n\x01\x08\x12\x03&\0\"\n\t\n\x02\x08\
169 \n\x12\x03&\0\"\n\x08\n\x01\x08\x12\x03'\0!\n\t\n\x02\x08$\x12\x03'\0!\n\
170 \x08\n\x01\x08\x12\x03(\0\x1f\n\t\n\x02\x08\x1f\x12\x03(\0\x1f\n\xfb\x02\
171 \n\x02\x04\0\x12\x033\0\x10\x1a\xef\x02\x20A\x20generic\x20empty\x20mess\
172 age\x20that\x20you\x20can\x20re-use\x20to\x20avoid\x20defining\x20duplic\
173 ated\n\x20empty\x20messages\x20in\x20your\x20APIs.\x20A\x20typical\x20ex\
174 ample\x20is\x20to\x20use\x20it\x20as\x20the\x20request\n\x20or\x20the\
175 \x20response\x20type\x20of\x20an\x20API\x20method.\x20For\x20instance:\n\
176 \n\x20\x20\x20\x20\x20service\x20Foo\x20{\n\x20\x20\x20\x20\x20\x20\x20r\
177 pc\x20Bar(google.protobuf.Empty)\x20returns\x20(google.protobuf.Empty);\
178 \n\x20\x20\x20\x20\x20}\n\n\x20The\x20JSON\x20representation\x20for\x20`\
179 Empty`\x20is\x20empty\x20JSON\x20object\x20`{}`.\n\n\n\n\x03\x04\0\x01\
180 \x12\x033\x08\rb\x06proto3\
181";
182
183fn file_descriptor_proto() -> &'static crate::descriptor::FileDescriptorProto {
185 static file_descriptor_proto_lazy: crate::rt::Lazy<crate::descriptor::FileDescriptorProto> = crate::rt::Lazy::new();
186 file_descriptor_proto_lazy.get(|| {
187 crate::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
188 })
189}
190
191pub fn file_descriptor() -> &'static crate::reflect::FileDescriptor {
193 static generated_file_descriptor_lazy: crate::rt::Lazy<crate::reflect::GeneratedFileDescriptor> = crate::rt::Lazy::new();
194 static file_descriptor: crate::rt::Lazy<crate::reflect::FileDescriptor> = crate::rt::Lazy::new();
195 file_descriptor.get(|| {
196 let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
197 let mut deps = ::std::vec::Vec::with_capacity(0);
198 let mut messages = ::std::vec::Vec::with_capacity(1);
199 messages.push(Empty::generated_message_descriptor_data());
200 let mut enums = ::std::vec::Vec::with_capacity(0);
201 crate::reflect::GeneratedFileDescriptor::new_generated(
202 file_descriptor_proto(),
203 deps,
204 messages,
205 enums,
206 )
207 });
208 crate::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
209 })
210}