/rust/registry/src/index.crates.io-1949cf8c6b5b557f/protobuf-3.2.0/src/plugin.rs
Line | Count | Source |
1 | | // This file is generated by rust-protobuf 3.0.0-pre. Do not edit |
2 | | // .proto file is parsed by protoc --rust-out=... |
3 | | // @generated |
4 | | |
5 | | // https://github.com/rust-lang/rust-clippy/issues/702 |
6 | | #![allow(unknown_lints)] |
7 | | #![allow(clippy::all)] |
8 | | |
9 | | #![allow(unused_attributes)] |
10 | | #![cfg_attr(rustfmt, rustfmt::skip)] |
11 | | |
12 | | #![allow(box_pointers)] |
13 | | #![allow(dead_code)] |
14 | | #![allow(missing_docs)] |
15 | | #![allow(non_camel_case_types)] |
16 | | #![allow(non_snake_case)] |
17 | | #![allow(non_upper_case_globals)] |
18 | | #![allow(trivial_casts)] |
19 | | #![allow(unused_results)] |
20 | | #![allow(unused_mut)] |
21 | | |
22 | | //! Generated file from `google/protobuf/compiler/plugin.proto` |
23 | | |
24 | | /// The version number of protocol compiler. |
25 | | #[derive(PartialEq,Clone,Default,Debug)] |
26 | | // @@protoc_insertion_point(message:google.protobuf.compiler.Version) |
27 | | pub struct Version { |
28 | | // message fields |
29 | | // @@protoc_insertion_point(field:google.protobuf.compiler.Version.major) |
30 | | pub major: ::std::option::Option<i32>, |
31 | | // @@protoc_insertion_point(field:google.protobuf.compiler.Version.minor) |
32 | | pub minor: ::std::option::Option<i32>, |
33 | | // @@protoc_insertion_point(field:google.protobuf.compiler.Version.patch) |
34 | | pub patch: ::std::option::Option<i32>, |
35 | | /// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should |
36 | | /// be empty for mainline stable releases. |
37 | | // @@protoc_insertion_point(field:google.protobuf.compiler.Version.suffix) |
38 | | pub suffix: ::std::option::Option<::std::string::String>, |
39 | | // special fields |
40 | | // @@protoc_insertion_point(special_field:google.protobuf.compiler.Version.special_fields) |
41 | | pub special_fields: crate::SpecialFields, |
42 | | } |
43 | | |
44 | | impl<'a> ::std::default::Default for &'a Version { |
45 | 0 | fn default() -> &'a Version { |
46 | 0 | <Version as crate::Message>::default_instance() |
47 | 0 | } |
48 | | } |
49 | | |
50 | | impl Version { |
51 | 0 | pub fn new() -> Version { |
52 | 0 | ::std::default::Default::default() |
53 | 0 | } |
54 | | |
55 | | // optional int32 major = 1; |
56 | | |
57 | 0 | pub fn major(&self) -> i32 { |
58 | 0 | self.major.unwrap_or(0) |
59 | 0 | } |
60 | | |
61 | 0 | pub fn clear_major(&mut self) { |
62 | 0 | self.major = ::std::option::Option::None; |
63 | 0 | } |
64 | | |
65 | 0 | pub fn has_major(&self) -> bool { |
66 | 0 | self.major.is_some() |
67 | 0 | } |
68 | | |
69 | | // Param is passed by value, moved |
70 | 0 | pub fn set_major(&mut self, v: i32) { |
71 | 0 | self.major = ::std::option::Option::Some(v); |
72 | 0 | } |
73 | | |
74 | | // optional int32 minor = 2; |
75 | | |
76 | 0 | pub fn minor(&self) -> i32 { |
77 | 0 | self.minor.unwrap_or(0) |
78 | 0 | } |
79 | | |
80 | 0 | pub fn clear_minor(&mut self) { |
81 | 0 | self.minor = ::std::option::Option::None; |
82 | 0 | } |
83 | | |
84 | 0 | pub fn has_minor(&self) -> bool { |
85 | 0 | self.minor.is_some() |
86 | 0 | } |
87 | | |
88 | | // Param is passed by value, moved |
89 | 0 | pub fn set_minor(&mut self, v: i32) { |
90 | 0 | self.minor = ::std::option::Option::Some(v); |
91 | 0 | } |
92 | | |
93 | | // optional int32 patch = 3; |
94 | | |
95 | 0 | pub fn patch(&self) -> i32 { |
96 | 0 | self.patch.unwrap_or(0) |
97 | 0 | } |
98 | | |
99 | 0 | pub fn clear_patch(&mut self) { |
100 | 0 | self.patch = ::std::option::Option::None; |
101 | 0 | } |
102 | | |
103 | 0 | pub fn has_patch(&self) -> bool { |
104 | 0 | self.patch.is_some() |
105 | 0 | } |
106 | | |
107 | | // Param is passed by value, moved |
108 | 0 | pub fn set_patch(&mut self, v: i32) { |
109 | 0 | self.patch = ::std::option::Option::Some(v); |
110 | 0 | } |
111 | | |
112 | | // optional string suffix = 4; |
113 | | |
114 | 0 | pub fn suffix(&self) -> &str { |
115 | 0 | match self.suffix.as_ref() { |
116 | 0 | Some(v) => v, |
117 | 0 | None => "", |
118 | | } |
119 | 0 | } |
120 | | |
121 | 0 | pub fn clear_suffix(&mut self) { |
122 | 0 | self.suffix = ::std::option::Option::None; |
123 | 0 | } |
124 | | |
125 | 0 | pub fn has_suffix(&self) -> bool { |
126 | 0 | self.suffix.is_some() |
127 | 0 | } |
128 | | |
129 | | // Param is passed by value, moved |
130 | 0 | pub fn set_suffix(&mut self, v: ::std::string::String) { |
131 | 0 | self.suffix = ::std::option::Option::Some(v); |
132 | 0 | } |
133 | | |
134 | | // Mutable pointer to the field. |
135 | | // If field is not initialized, it is initialized with default value first. |
136 | 0 | pub fn mut_suffix(&mut self) -> &mut ::std::string::String { |
137 | 0 | if self.suffix.is_none() { |
138 | 0 | self.suffix = ::std::option::Option::Some(::std::string::String::new()); |
139 | 0 | } |
140 | 0 | self.suffix.as_mut().unwrap() |
141 | 0 | } |
142 | | |
143 | | // Take field |
144 | 0 | pub fn take_suffix(&mut self) -> ::std::string::String { |
145 | 0 | self.suffix.take().unwrap_or_else(|| ::std::string::String::new()) |
146 | 0 | } |
147 | | |
148 | 0 | fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData { |
149 | 0 | let mut fields = ::std::vec::Vec::with_capacity(4); |
150 | 0 | let mut oneofs = ::std::vec::Vec::with_capacity(0); |
151 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
152 | | "major", |
153 | 0 | |m: &Version| { &m.major }, |
154 | 0 | |m: &mut Version| { &mut m.major }, |
155 | | )); |
156 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
157 | | "minor", |
158 | 0 | |m: &Version| { &m.minor }, |
159 | 0 | |m: &mut Version| { &mut m.minor }, |
160 | | )); |
161 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
162 | | "patch", |
163 | 0 | |m: &Version| { &m.patch }, |
164 | 0 | |m: &mut Version| { &mut m.patch }, |
165 | | )); |
166 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
167 | | "suffix", |
168 | 0 | |m: &Version| { &m.suffix }, |
169 | 0 | |m: &mut Version| { &mut m.suffix }, |
170 | | )); |
171 | 0 | crate::reflect::GeneratedMessageDescriptorData::new_2::<Version>( |
172 | | "Version", |
173 | 0 | fields, |
174 | 0 | oneofs, |
175 | | ) |
176 | 0 | } |
177 | | } |
178 | | |
179 | | impl crate::Message for Version { |
180 | | const NAME: &'static str = "Version"; |
181 | | |
182 | 0 | fn is_initialized(&self) -> bool { |
183 | 0 | true |
184 | 0 | } |
185 | | |
186 | 0 | fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> { |
187 | 0 | while let Some(tag) = is.read_raw_tag_or_eof()? { |
188 | 0 | match tag { |
189 | | 8 => { |
190 | 0 | self.major = ::std::option::Option::Some(is.read_int32()?); |
191 | | }, |
192 | | 16 => { |
193 | 0 | self.minor = ::std::option::Option::Some(is.read_int32()?); |
194 | | }, |
195 | | 24 => { |
196 | 0 | self.patch = ::std::option::Option::Some(is.read_int32()?); |
197 | | }, |
198 | | 34 => { |
199 | 0 | self.suffix = ::std::option::Option::Some(is.read_string()?); |
200 | | }, |
201 | 0 | tag => { |
202 | 0 | crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; |
203 | | }, |
204 | | }; |
205 | | } |
206 | 0 | ::std::result::Result::Ok(()) |
207 | 0 | } |
208 | | |
209 | | // Compute sizes of nested messages |
210 | | #[allow(unused_variables)] |
211 | 0 | fn compute_size(&self) -> u64 { |
212 | 0 | let mut my_size = 0; |
213 | 0 | if let Some(v) = self.major { |
214 | 0 | my_size += crate::rt::int32_size(1, v); |
215 | 0 | } |
216 | 0 | if let Some(v) = self.minor { |
217 | 0 | my_size += crate::rt::int32_size(2, v); |
218 | 0 | } |
219 | 0 | if let Some(v) = self.patch { |
220 | 0 | my_size += crate::rt::int32_size(3, v); |
221 | 0 | } |
222 | 0 | if let Some(v) = self.suffix.as_ref() { |
223 | 0 | my_size += crate::rt::string_size(4, &v); |
224 | 0 | } |
225 | 0 | my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields()); |
226 | 0 | self.special_fields.cached_size().set(my_size as u32); |
227 | 0 | my_size |
228 | 0 | } |
229 | | |
230 | 0 | fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> { |
231 | 0 | if let Some(v) = self.major { |
232 | 0 | os.write_int32(1, v)?; |
233 | 0 | } |
234 | 0 | if let Some(v) = self.minor { |
235 | 0 | os.write_int32(2, v)?; |
236 | 0 | } |
237 | 0 | if let Some(v) = self.patch { |
238 | 0 | os.write_int32(3, v)?; |
239 | 0 | } |
240 | 0 | if let Some(v) = self.suffix.as_ref() { |
241 | 0 | os.write_string(4, v)?; |
242 | 0 | } |
243 | 0 | os.write_unknown_fields(self.special_fields.unknown_fields())?; |
244 | 0 | ::std::result::Result::Ok(()) |
245 | 0 | } |
246 | | |
247 | 0 | fn special_fields(&self) -> &crate::SpecialFields { |
248 | 0 | &self.special_fields |
249 | 0 | } |
250 | | |
251 | 0 | fn mut_special_fields(&mut self) -> &mut crate::SpecialFields { |
252 | 0 | &mut self.special_fields |
253 | 0 | } |
254 | | |
255 | 0 | fn new() -> Version { |
256 | 0 | Version::new() |
257 | 0 | } |
258 | | |
259 | 0 | fn clear(&mut self) { |
260 | 0 | self.major = ::std::option::Option::None; |
261 | 0 | self.minor = ::std::option::Option::None; |
262 | 0 | self.patch = ::std::option::Option::None; |
263 | 0 | self.suffix = ::std::option::Option::None; |
264 | 0 | self.special_fields.clear(); |
265 | 0 | } |
266 | | |
267 | 0 | fn default_instance() -> &'static Version { |
268 | | static instance: Version = Version { |
269 | | major: ::std::option::Option::None, |
270 | | minor: ::std::option::Option::None, |
271 | | patch: ::std::option::Option::None, |
272 | | suffix: ::std::option::Option::None, |
273 | | special_fields: crate::SpecialFields::new(), |
274 | | }; |
275 | 0 | &instance |
276 | 0 | } |
277 | | } |
278 | | |
279 | | impl crate::MessageFull for Version { |
280 | 0 | fn descriptor() -> crate::reflect::MessageDescriptor { |
281 | | static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new(); |
282 | 0 | descriptor.get(|| file_descriptor().message_by_package_relative_name("Version").unwrap()).clone() |
283 | 0 | } |
284 | | } |
285 | | |
286 | | impl ::std::fmt::Display for Version { |
287 | 0 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
288 | 0 | crate::text_format::fmt(self, f) |
289 | 0 | } |
290 | | } |
291 | | |
292 | | impl crate::reflect::ProtobufValue for Version { |
293 | | type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>; |
294 | | } |
295 | | |
296 | | /// An encoded CodeGeneratorRequest is written to the plugin's stdin. |
297 | | #[derive(PartialEq,Clone,Default,Debug)] |
298 | | // @@protoc_insertion_point(message:google.protobuf.compiler.CodeGeneratorRequest) |
299 | | pub struct CodeGeneratorRequest { |
300 | | // message fields |
301 | | /// The .proto files that were explicitly listed on the command-line. The |
302 | | /// code generator should generate code only for these files. Each file's |
303 | | /// descriptor will be included in proto_file, below. |
304 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) |
305 | | pub file_to_generate: ::std::vec::Vec<::std::string::String>, |
306 | | /// The generator parameter passed on the command-line. |
307 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorRequest.parameter) |
308 | | pub parameter: ::std::option::Option<::std::string::String>, |
309 | | /// FileDescriptorProtos for all files in files_to_generate and everything |
310 | | /// they import. The files will appear in topological order, so each file |
311 | | /// appears before any file that imports it. |
312 | | /// |
313 | | /// protoc guarantees that all proto_files will be written after |
314 | | /// the fields above, even though this is not technically guaranteed by the |
315 | | /// protobuf wire format. This theoretically could allow a plugin to stream |
316 | | /// in the FileDescriptorProtos and handle them one by one rather than read |
317 | | /// the entire set into memory at once. However, as of this writing, this |
318 | | /// is not similarly optimized on protoc's end -- it will store all fields in |
319 | | /// memory at once before sending them to the plugin. |
320 | | /// |
321 | | /// Type names of fields and extensions in the FileDescriptorProto are always |
322 | | /// fully qualified. |
323 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorRequest.proto_file) |
324 | | pub proto_file: ::std::vec::Vec<crate::descriptor::FileDescriptorProto>, |
325 | | /// The version number of protocol compiler. |
326 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) |
327 | | pub compiler_version: crate::MessageField<Version>, |
328 | | // special fields |
329 | | // @@protoc_insertion_point(special_field:google.protobuf.compiler.CodeGeneratorRequest.special_fields) |
330 | | pub special_fields: crate::SpecialFields, |
331 | | } |
332 | | |
333 | | impl<'a> ::std::default::Default for &'a CodeGeneratorRequest { |
334 | 0 | fn default() -> &'a CodeGeneratorRequest { |
335 | 0 | <CodeGeneratorRequest as crate::Message>::default_instance() |
336 | 0 | } |
337 | | } |
338 | | |
339 | | impl CodeGeneratorRequest { |
340 | 0 | pub fn new() -> CodeGeneratorRequest { |
341 | 0 | ::std::default::Default::default() |
342 | 0 | } |
343 | | |
344 | | // optional string parameter = 2; |
345 | | |
346 | 0 | pub fn parameter(&self) -> &str { |
347 | 0 | match self.parameter.as_ref() { |
348 | 0 | Some(v) => v, |
349 | 0 | None => "", |
350 | | } |
351 | 0 | } |
352 | | |
353 | 0 | pub fn clear_parameter(&mut self) { |
354 | 0 | self.parameter = ::std::option::Option::None; |
355 | 0 | } |
356 | | |
357 | 0 | pub fn has_parameter(&self) -> bool { |
358 | 0 | self.parameter.is_some() |
359 | 0 | } |
360 | | |
361 | | // Param is passed by value, moved |
362 | 0 | pub fn set_parameter(&mut self, v: ::std::string::String) { |
363 | 0 | self.parameter = ::std::option::Option::Some(v); |
364 | 0 | } |
365 | | |
366 | | // Mutable pointer to the field. |
367 | | // If field is not initialized, it is initialized with default value first. |
368 | 0 | pub fn mut_parameter(&mut self) -> &mut ::std::string::String { |
369 | 0 | if self.parameter.is_none() { |
370 | 0 | self.parameter = ::std::option::Option::Some(::std::string::String::new()); |
371 | 0 | } |
372 | 0 | self.parameter.as_mut().unwrap() |
373 | 0 | } |
374 | | |
375 | | // Take field |
376 | 0 | pub fn take_parameter(&mut self) -> ::std::string::String { |
377 | 0 | self.parameter.take().unwrap_or_else(|| ::std::string::String::new()) |
378 | 0 | } |
379 | | |
380 | 0 | fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData { |
381 | 0 | let mut fields = ::std::vec::Vec::with_capacity(4); |
382 | 0 | let mut oneofs = ::std::vec::Vec::with_capacity(0); |
383 | 0 | fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( |
384 | | "file_to_generate", |
385 | 0 | |m: &CodeGeneratorRequest| { &m.file_to_generate }, |
386 | 0 | |m: &mut CodeGeneratorRequest| { &mut m.file_to_generate }, |
387 | | )); |
388 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
389 | | "parameter", |
390 | 0 | |m: &CodeGeneratorRequest| { &m.parameter }, |
391 | 0 | |m: &mut CodeGeneratorRequest| { &mut m.parameter }, |
392 | | )); |
393 | 0 | fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( |
394 | | "proto_file", |
395 | 0 | |m: &CodeGeneratorRequest| { &m.proto_file }, |
396 | 0 | |m: &mut CodeGeneratorRequest| { &mut m.proto_file }, |
397 | | )); |
398 | 0 | fields.push(crate::reflect::rt::v2::make_message_field_accessor::<_, Version>( |
399 | | "compiler_version", |
400 | 0 | |m: &CodeGeneratorRequest| { &m.compiler_version }, |
401 | 0 | |m: &mut CodeGeneratorRequest| { &mut m.compiler_version }, |
402 | | )); |
403 | 0 | crate::reflect::GeneratedMessageDescriptorData::new_2::<CodeGeneratorRequest>( |
404 | | "CodeGeneratorRequest", |
405 | 0 | fields, |
406 | 0 | oneofs, |
407 | | ) |
408 | 0 | } |
409 | | } |
410 | | |
411 | | impl crate::Message for CodeGeneratorRequest { |
412 | | const NAME: &'static str = "CodeGeneratorRequest"; |
413 | | |
414 | 0 | fn is_initialized(&self) -> bool { |
415 | 0 | for v in &self.proto_file { |
416 | 0 | if !v.is_initialized() { |
417 | 0 | return false; |
418 | 0 | } |
419 | | }; |
420 | 0 | for v in &self.compiler_version { |
421 | 0 | if !v.is_initialized() { |
422 | 0 | return false; |
423 | 0 | } |
424 | | }; |
425 | 0 | true |
426 | 0 | } |
427 | | |
428 | 0 | fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> { |
429 | 0 | while let Some(tag) = is.read_raw_tag_or_eof()? { |
430 | 0 | match tag { |
431 | | 10 => { |
432 | 0 | self.file_to_generate.push(is.read_string()?); |
433 | | }, |
434 | | 18 => { |
435 | 0 | self.parameter = ::std::option::Option::Some(is.read_string()?); |
436 | | }, |
437 | | 122 => { |
438 | 0 | self.proto_file.push(is.read_message()?); |
439 | | }, |
440 | | 26 => { |
441 | 0 | crate::rt::read_singular_message_into_field(is, &mut self.compiler_version)?; |
442 | | }, |
443 | 0 | tag => { |
444 | 0 | crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; |
445 | | }, |
446 | | }; |
447 | | } |
448 | 0 | ::std::result::Result::Ok(()) |
449 | 0 | } |
450 | | |
451 | | // Compute sizes of nested messages |
452 | | #[allow(unused_variables)] |
453 | 0 | fn compute_size(&self) -> u64 { |
454 | 0 | let mut my_size = 0; |
455 | 0 | for value in &self.file_to_generate { |
456 | 0 | my_size += crate::rt::string_size(1, &value); |
457 | 0 | }; |
458 | 0 | if let Some(v) = self.parameter.as_ref() { |
459 | 0 | my_size += crate::rt::string_size(2, &v); |
460 | 0 | } |
461 | 0 | for value in &self.proto_file { |
462 | 0 | let len = value.compute_size(); |
463 | 0 | my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len; |
464 | 0 | }; |
465 | 0 | if let Some(v) = self.compiler_version.as_ref() { |
466 | 0 | let len = v.compute_size(); |
467 | 0 | my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len; |
468 | 0 | } |
469 | 0 | my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields()); |
470 | 0 | self.special_fields.cached_size().set(my_size as u32); |
471 | 0 | my_size |
472 | 0 | } |
473 | | |
474 | 0 | fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> { |
475 | 0 | for v in &self.file_to_generate { |
476 | 0 | os.write_string(1, &v)?; |
477 | | }; |
478 | 0 | if let Some(v) = self.parameter.as_ref() { |
479 | 0 | os.write_string(2, v)?; |
480 | 0 | } |
481 | 0 | for v in &self.proto_file { |
482 | 0 | crate::rt::write_message_field_with_cached_size(15, v, os)?; |
483 | | }; |
484 | 0 | if let Some(v) = self.compiler_version.as_ref() { |
485 | 0 | crate::rt::write_message_field_with_cached_size(3, v, os)?; |
486 | 0 | } |
487 | 0 | os.write_unknown_fields(self.special_fields.unknown_fields())?; |
488 | 0 | ::std::result::Result::Ok(()) |
489 | 0 | } |
490 | | |
491 | 0 | fn special_fields(&self) -> &crate::SpecialFields { |
492 | 0 | &self.special_fields |
493 | 0 | } |
494 | | |
495 | 0 | fn mut_special_fields(&mut self) -> &mut crate::SpecialFields { |
496 | 0 | &mut self.special_fields |
497 | 0 | } |
498 | | |
499 | 0 | fn new() -> CodeGeneratorRequest { |
500 | 0 | CodeGeneratorRequest::new() |
501 | 0 | } |
502 | | |
503 | 0 | fn clear(&mut self) { |
504 | 0 | self.file_to_generate.clear(); |
505 | 0 | self.parameter = ::std::option::Option::None; |
506 | 0 | self.proto_file.clear(); |
507 | 0 | self.compiler_version.clear(); |
508 | 0 | self.special_fields.clear(); |
509 | 0 | } |
510 | | |
511 | 0 | fn default_instance() -> &'static CodeGeneratorRequest { |
512 | | static instance: CodeGeneratorRequest = CodeGeneratorRequest { |
513 | | file_to_generate: ::std::vec::Vec::new(), |
514 | | parameter: ::std::option::Option::None, |
515 | | proto_file: ::std::vec::Vec::new(), |
516 | | compiler_version: crate::MessageField::none(), |
517 | | special_fields: crate::SpecialFields::new(), |
518 | | }; |
519 | 0 | &instance |
520 | 0 | } |
521 | | } |
522 | | |
523 | | impl crate::MessageFull for CodeGeneratorRequest { |
524 | 0 | fn descriptor() -> crate::reflect::MessageDescriptor { |
525 | | static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new(); |
526 | 0 | descriptor.get(|| file_descriptor().message_by_package_relative_name("CodeGeneratorRequest").unwrap()).clone() |
527 | 0 | } |
528 | | } |
529 | | |
530 | | impl ::std::fmt::Display for CodeGeneratorRequest { |
531 | 0 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
532 | 0 | crate::text_format::fmt(self, f) |
533 | 0 | } |
534 | | } |
535 | | |
536 | | impl crate::reflect::ProtobufValue for CodeGeneratorRequest { |
537 | | type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>; |
538 | | } |
539 | | |
540 | | /// The plugin writes an encoded CodeGeneratorResponse to stdout. |
541 | | #[derive(PartialEq,Clone,Default,Debug)] |
542 | | // @@protoc_insertion_point(message:google.protobuf.compiler.CodeGeneratorResponse) |
543 | | pub struct CodeGeneratorResponse { |
544 | | // message fields |
545 | | /// Error message. If non-empty, code generation failed. The plugin process |
546 | | /// should exit with status code zero even if it reports an error in this way. |
547 | | /// |
548 | | /// This should be used to indicate errors in .proto files which prevent the |
549 | | /// code generator from generating correct code. Errors which indicate a |
550 | | /// problem in protoc itself -- such as the input CodeGeneratorRequest being |
551 | | /// unparseable -- should be reported by writing a message to stderr and |
552 | | /// exiting with a non-zero status code. |
553 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.error) |
554 | | pub error: ::std::option::Option<::std::string::String>, |
555 | | /// A bitmask of supported features that the code generator supports. |
556 | | /// This is a bitwise "or" of values from the Feature enum. |
557 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.supported_features) |
558 | | pub supported_features: ::std::option::Option<u64>, |
559 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.file) |
560 | | pub file: ::std::vec::Vec<code_generator_response::File>, |
561 | | // special fields |
562 | | // @@protoc_insertion_point(special_field:google.protobuf.compiler.CodeGeneratorResponse.special_fields) |
563 | | pub special_fields: crate::SpecialFields, |
564 | | } |
565 | | |
566 | | impl<'a> ::std::default::Default for &'a CodeGeneratorResponse { |
567 | 0 | fn default() -> &'a CodeGeneratorResponse { |
568 | 0 | <CodeGeneratorResponse as crate::Message>::default_instance() |
569 | 0 | } |
570 | | } |
571 | | |
572 | | impl CodeGeneratorResponse { |
573 | 0 | pub fn new() -> CodeGeneratorResponse { |
574 | 0 | ::std::default::Default::default() |
575 | 0 | } |
576 | | |
577 | | // optional string error = 1; |
578 | | |
579 | 0 | pub fn error(&self) -> &str { |
580 | 0 | match self.error.as_ref() { |
581 | 0 | Some(v) => v, |
582 | 0 | None => "", |
583 | | } |
584 | 0 | } |
585 | | |
586 | 0 | pub fn clear_error(&mut self) { |
587 | 0 | self.error = ::std::option::Option::None; |
588 | 0 | } |
589 | | |
590 | 0 | pub fn has_error(&self) -> bool { |
591 | 0 | self.error.is_some() |
592 | 0 | } |
593 | | |
594 | | // Param is passed by value, moved |
595 | 0 | pub fn set_error(&mut self, v: ::std::string::String) { |
596 | 0 | self.error = ::std::option::Option::Some(v); |
597 | 0 | } |
598 | | |
599 | | // Mutable pointer to the field. |
600 | | // If field is not initialized, it is initialized with default value first. |
601 | 0 | pub fn mut_error(&mut self) -> &mut ::std::string::String { |
602 | 0 | if self.error.is_none() { |
603 | 0 | self.error = ::std::option::Option::Some(::std::string::String::new()); |
604 | 0 | } |
605 | 0 | self.error.as_mut().unwrap() |
606 | 0 | } |
607 | | |
608 | | // Take field |
609 | 0 | pub fn take_error(&mut self) -> ::std::string::String { |
610 | 0 | self.error.take().unwrap_or_else(|| ::std::string::String::new()) |
611 | 0 | } |
612 | | |
613 | | // optional uint64 supported_features = 2; |
614 | | |
615 | 0 | pub fn supported_features(&self) -> u64 { |
616 | 0 | self.supported_features.unwrap_or(0) |
617 | 0 | } |
618 | | |
619 | 0 | pub fn clear_supported_features(&mut self) { |
620 | 0 | self.supported_features = ::std::option::Option::None; |
621 | 0 | } |
622 | | |
623 | 0 | pub fn has_supported_features(&self) -> bool { |
624 | 0 | self.supported_features.is_some() |
625 | 0 | } |
626 | | |
627 | | // Param is passed by value, moved |
628 | 0 | pub fn set_supported_features(&mut self, v: u64) { |
629 | 0 | self.supported_features = ::std::option::Option::Some(v); |
630 | 0 | } |
631 | | |
632 | 0 | fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData { |
633 | 0 | let mut fields = ::std::vec::Vec::with_capacity(3); |
634 | 0 | let mut oneofs = ::std::vec::Vec::with_capacity(0); |
635 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
636 | | "error", |
637 | 0 | |m: &CodeGeneratorResponse| { &m.error }, |
638 | 0 | |m: &mut CodeGeneratorResponse| { &mut m.error }, |
639 | | )); |
640 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
641 | | "supported_features", |
642 | 0 | |m: &CodeGeneratorResponse| { &m.supported_features }, |
643 | 0 | |m: &mut CodeGeneratorResponse| { &mut m.supported_features }, |
644 | | )); |
645 | 0 | fields.push(crate::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( |
646 | | "file", |
647 | 0 | |m: &CodeGeneratorResponse| { &m.file }, |
648 | 0 | |m: &mut CodeGeneratorResponse| { &mut m.file }, |
649 | | )); |
650 | 0 | crate::reflect::GeneratedMessageDescriptorData::new_2::<CodeGeneratorResponse>( |
651 | | "CodeGeneratorResponse", |
652 | 0 | fields, |
653 | 0 | oneofs, |
654 | | ) |
655 | 0 | } |
656 | | } |
657 | | |
658 | | impl crate::Message for CodeGeneratorResponse { |
659 | | const NAME: &'static str = "CodeGeneratorResponse"; |
660 | | |
661 | 0 | fn is_initialized(&self) -> bool { |
662 | 0 | true |
663 | 0 | } |
664 | | |
665 | 0 | fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> { |
666 | 0 | while let Some(tag) = is.read_raw_tag_or_eof()? { |
667 | 0 | match tag { |
668 | | 10 => { |
669 | 0 | self.error = ::std::option::Option::Some(is.read_string()?); |
670 | | }, |
671 | | 16 => { |
672 | 0 | self.supported_features = ::std::option::Option::Some(is.read_uint64()?); |
673 | | }, |
674 | | 122 => { |
675 | 0 | self.file.push(is.read_message()?); |
676 | | }, |
677 | 0 | tag => { |
678 | 0 | crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; |
679 | | }, |
680 | | }; |
681 | | } |
682 | 0 | ::std::result::Result::Ok(()) |
683 | 0 | } |
684 | | |
685 | | // Compute sizes of nested messages |
686 | | #[allow(unused_variables)] |
687 | 0 | fn compute_size(&self) -> u64 { |
688 | 0 | let mut my_size = 0; |
689 | 0 | if let Some(v) = self.error.as_ref() { |
690 | 0 | my_size += crate::rt::string_size(1, &v); |
691 | 0 | } |
692 | 0 | if let Some(v) = self.supported_features { |
693 | 0 | my_size += crate::rt::uint64_size(2, v); |
694 | 0 | } |
695 | 0 | for value in &self.file { |
696 | 0 | let len = value.compute_size(); |
697 | 0 | my_size += 1 + crate::rt::compute_raw_varint64_size(len) + len; |
698 | 0 | }; |
699 | 0 | my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields()); |
700 | 0 | self.special_fields.cached_size().set(my_size as u32); |
701 | 0 | my_size |
702 | 0 | } |
703 | | |
704 | 0 | fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> { |
705 | 0 | if let Some(v) = self.error.as_ref() { |
706 | 0 | os.write_string(1, v)?; |
707 | 0 | } |
708 | 0 | if let Some(v) = self.supported_features { |
709 | 0 | os.write_uint64(2, v)?; |
710 | 0 | } |
711 | 0 | for v in &self.file { |
712 | 0 | crate::rt::write_message_field_with_cached_size(15, v, os)?; |
713 | | }; |
714 | 0 | os.write_unknown_fields(self.special_fields.unknown_fields())?; |
715 | 0 | ::std::result::Result::Ok(()) |
716 | 0 | } |
717 | | |
718 | 0 | fn special_fields(&self) -> &crate::SpecialFields { |
719 | 0 | &self.special_fields |
720 | 0 | } |
721 | | |
722 | 0 | fn mut_special_fields(&mut self) -> &mut crate::SpecialFields { |
723 | 0 | &mut self.special_fields |
724 | 0 | } |
725 | | |
726 | 0 | fn new() -> CodeGeneratorResponse { |
727 | 0 | CodeGeneratorResponse::new() |
728 | 0 | } |
729 | | |
730 | 0 | fn clear(&mut self) { |
731 | 0 | self.error = ::std::option::Option::None; |
732 | 0 | self.supported_features = ::std::option::Option::None; |
733 | 0 | self.file.clear(); |
734 | 0 | self.special_fields.clear(); |
735 | 0 | } |
736 | | |
737 | 0 | fn default_instance() -> &'static CodeGeneratorResponse { |
738 | | static instance: CodeGeneratorResponse = CodeGeneratorResponse { |
739 | | error: ::std::option::Option::None, |
740 | | supported_features: ::std::option::Option::None, |
741 | | file: ::std::vec::Vec::new(), |
742 | | special_fields: crate::SpecialFields::new(), |
743 | | }; |
744 | 0 | &instance |
745 | 0 | } |
746 | | } |
747 | | |
748 | | impl crate::MessageFull for CodeGeneratorResponse { |
749 | 0 | fn descriptor() -> crate::reflect::MessageDescriptor { |
750 | | static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new(); |
751 | 0 | descriptor.get(|| file_descriptor().message_by_package_relative_name("CodeGeneratorResponse").unwrap()).clone() |
752 | 0 | } |
753 | | } |
754 | | |
755 | | impl ::std::fmt::Display for CodeGeneratorResponse { |
756 | 0 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
757 | 0 | crate::text_format::fmt(self, f) |
758 | 0 | } |
759 | | } |
760 | | |
761 | | impl crate::reflect::ProtobufValue for CodeGeneratorResponse { |
762 | | type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>; |
763 | | } |
764 | | |
765 | | /// Nested message and enums of message `CodeGeneratorResponse` |
766 | | pub mod code_generator_response { |
767 | | /// Represents a single generated file. |
768 | | #[derive(PartialEq,Clone,Default,Debug)] |
769 | | // @@protoc_insertion_point(message:google.protobuf.compiler.CodeGeneratorResponse.File) |
770 | | pub struct File { |
771 | | // message fields |
772 | | /// The file name, relative to the output directory. The name must not |
773 | | /// contain "." or ".." components and must be relative, not be absolute (so, |
774 | | /// the file cannot lie outside the output directory). "/" must be used as |
775 | | /// the path separator, not "\". |
776 | | /// |
777 | | /// If the name is omitted, the content will be appended to the previous |
778 | | /// file. This allows the generator to break large files into small chunks, |
779 | | /// and allows the generated text to be streamed back to protoc so that large |
780 | | /// files need not reside completely in memory at one time. Note that as of |
781 | | /// this writing protoc does not optimize for this -- it will read the entire |
782 | | /// CodeGeneratorResponse before writing files to disk. |
783 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.File.name) |
784 | | pub name: ::std::option::Option<::std::string::String>, |
785 | | /// If non-empty, indicates that the named file should already exist, and the |
786 | | /// content here is to be inserted into that file at a defined insertion |
787 | | /// point. This feature allows a code generator to extend the output |
788 | | /// produced by another code generator. The original generator may provide |
789 | | /// insertion points by placing special annotations in the file that look |
790 | | /// like: |
791 | | /// @@protoc_insertion_point(NAME) |
792 | | /// The annotation can have arbitrary text before and after it on the line, |
793 | | /// which allows it to be placed in a comment. NAME should be replaced with |
794 | | /// an identifier naming the point -- this is what other generators will use |
795 | | /// as the insertion_point. Code inserted at this point will be placed |
796 | | /// immediately above the line containing the insertion point (thus multiple |
797 | | /// insertions to the same point will come out in the order they were added). |
798 | | /// The double-@ is intended to make it unlikely that the generated code |
799 | | /// could contain things that look like insertion points by accident. |
800 | | /// |
801 | | /// For example, the C++ code generator places the following line in the |
802 | | /// .pb.h files that it generates: |
803 | | /// // @@protoc_insertion_point(namespace_scope) |
804 | | /// This line appears within the scope of the file's package namespace, but |
805 | | /// outside of any particular class. Another plugin can then specify the |
806 | | /// insertion_point "namespace_scope" to generate additional classes or |
807 | | /// other declarations that should be placed in this scope. |
808 | | /// |
809 | | /// Note that if the line containing the insertion point begins with |
810 | | /// whitespace, the same whitespace will be added to every line of the |
811 | | /// inserted text. This is useful for languages like Python, where |
812 | | /// indentation matters. In these languages, the insertion point comment |
813 | | /// should be indented the same amount as any inserted code will need to be |
814 | | /// in order to work correctly in that context. |
815 | | /// |
816 | | /// The code generator that generates the initial file and the one which |
817 | | /// inserts into it must both run as part of a single invocation of protoc. |
818 | | /// Code generators are executed in the order in which they appear on the |
819 | | /// command line. |
820 | | /// |
821 | | /// If |insertion_point| is present, |name| must also be present. |
822 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) |
823 | | pub insertion_point: ::std::option::Option<::std::string::String>, |
824 | | /// The file contents. |
825 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.File.content) |
826 | | pub content: ::std::option::Option<::std::string::String>, |
827 | | /// Information describing the file content being inserted. If an insertion |
828 | | /// point is used, this information will be appropriately offset and inserted |
829 | | /// into the code generation metadata for the generated files. |
830 | | // @@protoc_insertion_point(field:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) |
831 | | pub generated_code_info: crate::MessageField<crate::descriptor::GeneratedCodeInfo>, |
832 | | // special fields |
833 | | // @@protoc_insertion_point(special_field:google.protobuf.compiler.CodeGeneratorResponse.File.special_fields) |
834 | | pub special_fields: crate::SpecialFields, |
835 | | } |
836 | | |
837 | | impl<'a> ::std::default::Default for &'a File { |
838 | 0 | fn default() -> &'a File { |
839 | 0 | <File as crate::Message>::default_instance() |
840 | 0 | } |
841 | | } |
842 | | |
843 | | impl File { |
844 | 0 | pub fn new() -> File { |
845 | 0 | ::std::default::Default::default() |
846 | 0 | } |
847 | | |
848 | | // optional string name = 1; |
849 | | |
850 | 0 | pub fn name(&self) -> &str { |
851 | 0 | match self.name.as_ref() { |
852 | 0 | Some(v) => v, |
853 | 0 | None => "", |
854 | | } |
855 | 0 | } |
856 | | |
857 | 0 | pub fn clear_name(&mut self) { |
858 | 0 | self.name = ::std::option::Option::None; |
859 | 0 | } |
860 | | |
861 | 0 | pub fn has_name(&self) -> bool { |
862 | 0 | self.name.is_some() |
863 | 0 | } |
864 | | |
865 | | // Param is passed by value, moved |
866 | 0 | pub fn set_name(&mut self, v: ::std::string::String) { |
867 | 0 | self.name = ::std::option::Option::Some(v); |
868 | 0 | } |
869 | | |
870 | | // Mutable pointer to the field. |
871 | | // If field is not initialized, it is initialized with default value first. |
872 | 0 | pub fn mut_name(&mut self) -> &mut ::std::string::String { |
873 | 0 | if self.name.is_none() { |
874 | 0 | self.name = ::std::option::Option::Some(::std::string::String::new()); |
875 | 0 | } |
876 | 0 | self.name.as_mut().unwrap() |
877 | 0 | } |
878 | | |
879 | | // Take field |
880 | 0 | pub fn take_name(&mut self) -> ::std::string::String { |
881 | 0 | self.name.take().unwrap_or_else(|| ::std::string::String::new()) |
882 | 0 | } |
883 | | |
884 | | // optional string insertion_point = 2; |
885 | | |
886 | 0 | pub fn insertion_point(&self) -> &str { |
887 | 0 | match self.insertion_point.as_ref() { |
888 | 0 | Some(v) => v, |
889 | 0 | None => "", |
890 | | } |
891 | 0 | } |
892 | | |
893 | 0 | pub fn clear_insertion_point(&mut self) { |
894 | 0 | self.insertion_point = ::std::option::Option::None; |
895 | 0 | } |
896 | | |
897 | 0 | pub fn has_insertion_point(&self) -> bool { |
898 | 0 | self.insertion_point.is_some() |
899 | 0 | } |
900 | | |
901 | | // Param is passed by value, moved |
902 | 0 | pub fn set_insertion_point(&mut self, v: ::std::string::String) { |
903 | 0 | self.insertion_point = ::std::option::Option::Some(v); |
904 | 0 | } |
905 | | |
906 | | // Mutable pointer to the field. |
907 | | // If field is not initialized, it is initialized with default value first. |
908 | 0 | pub fn mut_insertion_point(&mut self) -> &mut ::std::string::String { |
909 | 0 | if self.insertion_point.is_none() { |
910 | 0 | self.insertion_point = ::std::option::Option::Some(::std::string::String::new()); |
911 | 0 | } |
912 | 0 | self.insertion_point.as_mut().unwrap() |
913 | 0 | } |
914 | | |
915 | | // Take field |
916 | 0 | pub fn take_insertion_point(&mut self) -> ::std::string::String { |
917 | 0 | self.insertion_point.take().unwrap_or_else(|| ::std::string::String::new()) |
918 | 0 | } |
919 | | |
920 | | // optional string content = 15; |
921 | | |
922 | 0 | pub fn content(&self) -> &str { |
923 | 0 | match self.content.as_ref() { |
924 | 0 | Some(v) => v, |
925 | 0 | None => "", |
926 | | } |
927 | 0 | } |
928 | | |
929 | 0 | pub fn clear_content(&mut self) { |
930 | 0 | self.content = ::std::option::Option::None; |
931 | 0 | } |
932 | | |
933 | 0 | pub fn has_content(&self) -> bool { |
934 | 0 | self.content.is_some() |
935 | 0 | } |
936 | | |
937 | | // Param is passed by value, moved |
938 | 0 | pub fn set_content(&mut self, v: ::std::string::String) { |
939 | 0 | self.content = ::std::option::Option::Some(v); |
940 | 0 | } |
941 | | |
942 | | // Mutable pointer to the field. |
943 | | // If field is not initialized, it is initialized with default value first. |
944 | 0 | pub fn mut_content(&mut self) -> &mut ::std::string::String { |
945 | 0 | if self.content.is_none() { |
946 | 0 | self.content = ::std::option::Option::Some(::std::string::String::new()); |
947 | 0 | } |
948 | 0 | self.content.as_mut().unwrap() |
949 | 0 | } |
950 | | |
951 | | // Take field |
952 | 0 | pub fn take_content(&mut self) -> ::std::string::String { |
953 | 0 | self.content.take().unwrap_or_else(|| ::std::string::String::new()) |
954 | 0 | } |
955 | | |
956 | 0 | pub(in super) fn generated_message_descriptor_data() -> crate::reflect::GeneratedMessageDescriptorData { |
957 | 0 | let mut fields = ::std::vec::Vec::with_capacity(4); |
958 | 0 | let mut oneofs = ::std::vec::Vec::with_capacity(0); |
959 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
960 | | "name", |
961 | 0 | |m: &File| { &m.name }, |
962 | 0 | |m: &mut File| { &mut m.name }, |
963 | | )); |
964 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
965 | | "insertion_point", |
966 | 0 | |m: &File| { &m.insertion_point }, |
967 | 0 | |m: &mut File| { &mut m.insertion_point }, |
968 | | )); |
969 | 0 | fields.push(crate::reflect::rt::v2::make_option_accessor::<_, _>( |
970 | | "content", |
971 | 0 | |m: &File| { &m.content }, |
972 | 0 | |m: &mut File| { &mut m.content }, |
973 | | )); |
974 | 0 | fields.push(crate::reflect::rt::v2::make_message_field_accessor::<_, crate::descriptor::GeneratedCodeInfo>( |
975 | | "generated_code_info", |
976 | 0 | |m: &File| { &m.generated_code_info }, |
977 | 0 | |m: &mut File| { &mut m.generated_code_info }, |
978 | | )); |
979 | 0 | crate::reflect::GeneratedMessageDescriptorData::new_2::<File>( |
980 | | "CodeGeneratorResponse.File", |
981 | 0 | fields, |
982 | 0 | oneofs, |
983 | | ) |
984 | 0 | } |
985 | | } |
986 | | |
987 | | impl crate::Message for File { |
988 | | const NAME: &'static str = "File"; |
989 | | |
990 | 0 | fn is_initialized(&self) -> bool { |
991 | 0 | true |
992 | 0 | } |
993 | | |
994 | 0 | fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::Result<()> { |
995 | 0 | while let Some(tag) = is.read_raw_tag_or_eof()? { |
996 | 0 | match tag { |
997 | | 10 => { |
998 | 0 | self.name = ::std::option::Option::Some(is.read_string()?); |
999 | | }, |
1000 | | 18 => { |
1001 | 0 | self.insertion_point = ::std::option::Option::Some(is.read_string()?); |
1002 | | }, |
1003 | | 122 => { |
1004 | 0 | self.content = ::std::option::Option::Some(is.read_string()?); |
1005 | | }, |
1006 | | 130 => { |
1007 | 0 | crate::rt::read_singular_message_into_field(is, &mut self.generated_code_info)?; |
1008 | | }, |
1009 | 0 | tag => { |
1010 | 0 | crate::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; |
1011 | | }, |
1012 | | }; |
1013 | | } |
1014 | 0 | ::std::result::Result::Ok(()) |
1015 | 0 | } |
1016 | | |
1017 | | // Compute sizes of nested messages |
1018 | | #[allow(unused_variables)] |
1019 | 0 | fn compute_size(&self) -> u64 { |
1020 | 0 | let mut my_size = 0; |
1021 | 0 | if let Some(v) = self.name.as_ref() { |
1022 | 0 | my_size += crate::rt::string_size(1, &v); |
1023 | 0 | } |
1024 | 0 | if let Some(v) = self.insertion_point.as_ref() { |
1025 | 0 | my_size += crate::rt::string_size(2, &v); |
1026 | 0 | } |
1027 | 0 | if let Some(v) = self.content.as_ref() { |
1028 | 0 | my_size += crate::rt::string_size(15, &v); |
1029 | 0 | } |
1030 | 0 | if let Some(v) = self.generated_code_info.as_ref() { |
1031 | 0 | let len = v.compute_size(); |
1032 | 0 | my_size += 2 + crate::rt::compute_raw_varint64_size(len) + len; |
1033 | 0 | } |
1034 | 0 | my_size += crate::rt::unknown_fields_size(self.special_fields.unknown_fields()); |
1035 | 0 | self.special_fields.cached_size().set(my_size as u32); |
1036 | 0 | my_size |
1037 | 0 | } |
1038 | | |
1039 | 0 | fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::Result<()> { |
1040 | 0 | if let Some(v) = self.name.as_ref() { |
1041 | 0 | os.write_string(1, v)?; |
1042 | 0 | } |
1043 | 0 | if let Some(v) = self.insertion_point.as_ref() { |
1044 | 0 | os.write_string(2, v)?; |
1045 | 0 | } |
1046 | 0 | if let Some(v) = self.content.as_ref() { |
1047 | 0 | os.write_string(15, v)?; |
1048 | 0 | } |
1049 | 0 | if let Some(v) = self.generated_code_info.as_ref() { |
1050 | 0 | crate::rt::write_message_field_with_cached_size(16, v, os)?; |
1051 | 0 | } |
1052 | 0 | os.write_unknown_fields(self.special_fields.unknown_fields())?; |
1053 | 0 | ::std::result::Result::Ok(()) |
1054 | 0 | } |
1055 | | |
1056 | 0 | fn special_fields(&self) -> &crate::SpecialFields { |
1057 | 0 | &self.special_fields |
1058 | 0 | } |
1059 | | |
1060 | 0 | fn mut_special_fields(&mut self) -> &mut crate::SpecialFields { |
1061 | 0 | &mut self.special_fields |
1062 | 0 | } |
1063 | | |
1064 | 0 | fn new() -> File { |
1065 | 0 | File::new() |
1066 | 0 | } |
1067 | | |
1068 | 0 | fn clear(&mut self) { |
1069 | 0 | self.name = ::std::option::Option::None; |
1070 | 0 | self.insertion_point = ::std::option::Option::None; |
1071 | 0 | self.content = ::std::option::Option::None; |
1072 | 0 | self.generated_code_info.clear(); |
1073 | 0 | self.special_fields.clear(); |
1074 | 0 | } |
1075 | | |
1076 | 0 | fn default_instance() -> &'static File { |
1077 | | static instance: File = File { |
1078 | | name: ::std::option::Option::None, |
1079 | | insertion_point: ::std::option::Option::None, |
1080 | | content: ::std::option::Option::None, |
1081 | | generated_code_info: crate::MessageField::none(), |
1082 | | special_fields: crate::SpecialFields::new(), |
1083 | | }; |
1084 | 0 | &instance |
1085 | 0 | } |
1086 | | } |
1087 | | |
1088 | | impl crate::MessageFull for File { |
1089 | 0 | fn descriptor() -> crate::reflect::MessageDescriptor { |
1090 | | static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::new(); |
1091 | 0 | descriptor.get(|| super::file_descriptor().message_by_package_relative_name("CodeGeneratorResponse.File").unwrap()).clone() |
1092 | 0 | } |
1093 | | } |
1094 | | |
1095 | | impl ::std::fmt::Display for File { |
1096 | 0 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
1097 | 0 | crate::text_format::fmt(self, f) |
1098 | 0 | } |
1099 | | } |
1100 | | |
1101 | | impl crate::reflect::ProtobufValue for File { |
1102 | | type RuntimeType = crate::reflect::rt::RuntimeTypeMessage<Self>; |
1103 | | } |
1104 | | |
1105 | | /// Sync with code_generator.h. |
1106 | | #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] |
1107 | | // @@protoc_insertion_point(enum:google.protobuf.compiler.CodeGeneratorResponse.Feature) |
1108 | | pub enum Feature { |
1109 | | // @@protoc_insertion_point(enum_value:google.protobuf.compiler.CodeGeneratorResponse.Feature.FEATURE_NONE) |
1110 | | FEATURE_NONE = 0, |
1111 | | // @@protoc_insertion_point(enum_value:google.protobuf.compiler.CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL) |
1112 | | FEATURE_PROTO3_OPTIONAL = 1, |
1113 | | } |
1114 | | |
1115 | | impl crate::Enum for Feature { |
1116 | | const NAME: &'static str = "Feature"; |
1117 | | |
1118 | 0 | fn value(&self) -> i32 { |
1119 | 0 | *self as i32 |
1120 | 0 | } |
1121 | | |
1122 | 0 | fn from_i32(value: i32) -> ::std::option::Option<Feature> { |
1123 | 0 | match value { |
1124 | 0 | 0 => ::std::option::Option::Some(Feature::FEATURE_NONE), |
1125 | 0 | 1 => ::std::option::Option::Some(Feature::FEATURE_PROTO3_OPTIONAL), |
1126 | 0 | _ => ::std::option::Option::None |
1127 | | } |
1128 | 0 | } |
1129 | | |
1130 | | const VALUES: &'static [Feature] = &[ |
1131 | | Feature::FEATURE_NONE, |
1132 | | Feature::FEATURE_PROTO3_OPTIONAL, |
1133 | | ]; |
1134 | | } |
1135 | | |
1136 | | impl crate::EnumFull for Feature { |
1137 | 0 | fn enum_descriptor() -> crate::reflect::EnumDescriptor { |
1138 | | static descriptor: crate::rt::Lazy<crate::reflect::EnumDescriptor> = crate::rt::Lazy::new(); |
1139 | 0 | descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("CodeGeneratorResponse.Feature").unwrap()).clone() |
1140 | 0 | } |
1141 | | |
1142 | 0 | fn descriptor(&self) -> crate::reflect::EnumValueDescriptor { |
1143 | 0 | let index = *self as usize; |
1144 | 0 | Self::enum_descriptor().value_by_index(index) |
1145 | 0 | } |
1146 | | } |
1147 | | |
1148 | | impl ::std::default::Default for Feature { |
1149 | 0 | fn default() -> Self { |
1150 | 0 | Feature::FEATURE_NONE |
1151 | 0 | } |
1152 | | } |
1153 | | |
1154 | | impl Feature { |
1155 | 0 | pub(in super) fn generated_enum_descriptor_data() -> crate::reflect::GeneratedEnumDescriptorData { |
1156 | 0 | crate::reflect::GeneratedEnumDescriptorData::new::<Feature>("CodeGeneratorResponse.Feature") |
1157 | 0 | } |
1158 | | } |
1159 | | } |
1160 | | |
1161 | | static file_descriptor_proto_data: &'static [u8] = b"\ |
1162 | | \n%google/protobuf/compiler/plugin.proto\x12\x18google.protobuf.compiler\ |
1163 | | \x1a\x20google/protobuf/descriptor.proto\"c\n\x07Version\x12\x14\n\x05ma\ |
1164 | | jor\x18\x01\x20\x01(\x05R\x05major\x12\x14\n\x05minor\x18\x02\x20\x01(\ |
1165 | | \x05R\x05minor\x12\x14\n\x05patch\x18\x03\x20\x01(\x05R\x05patch\x12\x16\ |
1166 | | \n\x06suffix\x18\x04\x20\x01(\tR\x06suffix\"\xf1\x01\n\x14CodeGeneratorR\ |
1167 | | equest\x12(\n\x10file_to_generate\x18\x01\x20\x03(\tR\x0efileToGenerate\ |
1168 | | \x12\x1c\n\tparameter\x18\x02\x20\x01(\tR\tparameter\x12C\n\nproto_file\ |
1169 | | \x18\x0f\x20\x03(\x0b2$.google.protobuf.FileDescriptorProtoR\tprotoFile\ |
1170 | | \x12L\n\x10compiler_version\x18\x03\x20\x01(\x0b2!.google.protobuf.compi\ |
1171 | | ler.VersionR\x0fcompilerVersion\"\x94\x03\n\x15CodeGeneratorResponse\x12\ |
1172 | | \x14\n\x05error\x18\x01\x20\x01(\tR\x05error\x12-\n\x12supported_feature\ |
1173 | | s\x18\x02\x20\x01(\x04R\x11supportedFeatures\x12H\n\x04file\x18\x0f\x20\ |
1174 | | \x03(\x0b24.google.protobuf.compiler.CodeGeneratorResponse.FileR\x04file\ |
1175 | | \x1a\xb1\x01\n\x04File\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\ |
1176 | | '\n\x0finsertion_point\x18\x02\x20\x01(\tR\x0einsertionPoint\x12\x18\n\ |
1177 | | \x07content\x18\x0f\x20\x01(\tR\x07content\x12R\n\x13generated_code_info\ |
1178 | | \x18\x10\x20\x01(\x0b2\".google.protobuf.GeneratedCodeInfoR\x11generated\ |
1179 | | CodeInfo\"8\n\x07Feature\x12\x10\n\x0cFEATURE_NONE\x10\0\x12\x1b\n\x17FE\ |
1180 | | ATURE_PROTO3_OPTIONAL\x10\x01BW\n\x1ccom.google.protobuf.compilerB\x0cPl\ |
1181 | | uginProtosZ)google.golang.org/protobuf/types/pluginpbJ\xf9C\n\x07\x12\ |
1182 | | \x05.\0\xb6\x01\x01\n\xca\x11\n\x01\x0c\x12\x03.\0\x122\xc1\x0c\x20Proto\ |
1183 | | col\x20Buffers\x20-\x20Google's\x20data\x20interchange\x20format\n\x20Co\ |
1184 | | pyright\x202008\x20Google\x20Inc.\x20\x20All\x20rights\x20reserved.\n\ |
1185 | | \x20https://developers.google.com/protocol-buffers/\n\n\x20Redistributio\ |
1186 | | n\x20and\x20use\x20in\x20source\x20and\x20binary\x20forms,\x20with\x20or\ |
1187 | | \x20without\n\x20modification,\x20are\x20permitted\x20provided\x20that\ |
1188 | | \x20the\x20following\x20conditions\x20are\n\x20met:\n\n\x20\x20\x20\x20\ |
1189 | | \x20*\x20Redistributions\x20of\x20source\x20code\x20must\x20retain\x20th\ |
1190 | | e\x20above\x20copyright\n\x20notice,\x20this\x20list\x20of\x20conditions\ |
1191 | | \x20and\x20the\x20following\x20disclaimer.\n\x20\x20\x20\x20\x20*\x20Red\ |
1192 | | istributions\x20in\x20binary\x20form\x20must\x20reproduce\x20the\x20abov\ |
1193 | | e\n\x20copyright\x20notice,\x20this\x20list\x20of\x20conditions\x20and\ |
1194 | | \x20the\x20following\x20disclaimer\n\x20in\x20the\x20documentation\x20an\ |
1195 | | d/or\x20other\x20materials\x20provided\x20with\x20the\n\x20distribution.\ |
1196 | | \n\x20\x20\x20\x20\x20*\x20Neither\x20the\x20name\x20of\x20Google\x20Inc\ |
1197 | | .\x20nor\x20the\x20names\x20of\x20its\n\x20contributors\x20may\x20be\x20\ |
1198 | | used\x20to\x20endorse\x20or\x20promote\x20products\x20derived\x20from\n\ |
1199 | | \x20this\x20software\x20without\x20specific\x20prior\x20written\x20permi\ |
1200 | | ssion.\n\n\x20THIS\x20SOFTWARE\x20IS\x20PROVIDED\x20BY\x20THE\x20COPYRIG\ |
1201 | | HT\x20HOLDERS\x20AND\x20CONTRIBUTORS\n\x20\"AS\x20IS\"\x20AND\x20ANY\x20\ |
1202 | | EXPRESS\x20OR\x20IMPLIED\x20WARRANTIES,\x20INCLUDING,\x20BUT\x20NOT\n\ |
1203 | | \x20LIMITED\x20TO,\x20THE\x20IMPLIED\x20WARRANTIES\x20OF\x20MERCHANTABIL\ |
1204 | | ITY\x20AND\x20FITNESS\x20FOR\n\x20A\x20PARTICULAR\x20PURPOSE\x20ARE\x20D\ |
1205 | | ISCLAIMED.\x20IN\x20NO\x20EVENT\x20SHALL\x20THE\x20COPYRIGHT\n\x20OWNER\ |
1206 | | \x20OR\x20CONTRIBUTORS\x20BE\x20LIABLE\x20FOR\x20ANY\x20DIRECT,\x20INDIR\ |
1207 | | ECT,\x20INCIDENTAL,\n\x20SPECIAL,\x20EXEMPLARY,\x20OR\x20CONSEQUENTIAL\ |
1208 | | \x20DAMAGES\x20(INCLUDING,\x20BUT\x20NOT\n\x20LIMITED\x20TO,\x20PROCUREM\ |
1209 | | ENT\x20OF\x20SUBSTITUTE\x20GOODS\x20OR\x20SERVICES;\x20LOSS\x20OF\x20USE\ |
1210 | | ,\n\x20DATA,\x20OR\x20PROFITS;\x20OR\x20BUSINESS\x20INTERRUPTION)\x20HOW\ |
1211 | | EVER\x20CAUSED\x20AND\x20ON\x20ANY\n\x20THEORY\x20OF\x20LIABILITY,\x20WH\ |
1212 | | ETHER\x20IN\x20CONTRACT,\x20STRICT\x20LIABILITY,\x20OR\x20TORT\n\x20(INC\ |
1213 | | LUDING\x20NEGLIGENCE\x20OR\x20OTHERWISE)\x20ARISING\x20IN\x20ANY\x20WAY\ |
1214 | | \x20OUT\x20OF\x20THE\x20USE\n\x20OF\x20THIS\x20SOFTWARE,\x20EVEN\x20IF\ |
1215 | | \x20ADVISED\x20OF\x20THE\x20POSSIBILITY\x20OF\x20SUCH\x20DAMAGE.\n2\xfb\ |
1216 | | \x04\x20Author:\x20kenton@google.com\x20(Kenton\x20Varda)\n\n\x20WARNING\ |
1217 | | :\x20\x20The\x20plugin\x20interface\x20is\x20currently\x20EXPERIMENTAL\ |
1218 | | \x20and\x20is\x20subject\x20to\n\x20\x20\x20change.\n\n\x20protoc\x20(ak\ |
1219 | | a\x20the\x20Protocol\x20Compiler)\x20can\x20be\x20extended\x20via\x20plu\ |
1220 | | gins.\x20\x20A\x20plugin\x20is\n\x20just\x20a\x20program\x20that\x20read\ |
1221 | | s\x20a\x20CodeGeneratorRequest\x20from\x20stdin\x20and\x20writes\x20a\n\ |
1222 | | \x20CodeGeneratorResponse\x20to\x20stdout.\n\n\x20Plugins\x20written\x20\ |
1223 | | using\x20C++\x20can\x20use\x20google/protobuf/compiler/plugin.h\x20inste\ |
1224 | | ad\n\x20of\x20dealing\x20with\x20the\x20raw\x20protocol\x20defined\x20he\ |
1225 | | re.\n\n\x20A\x20plugin\x20executable\x20needs\x20only\x20to\x20be\x20pla\ |
1226 | | ced\x20somewhere\x20in\x20the\x20path.\x20\x20The\n\x20plugin\x20should\ |
1227 | | \x20be\x20named\x20\"protoc-gen-$NAME\",\x20and\x20will\x20then\x20be\ |
1228 | | \x20used\x20when\x20the\n\x20flag\x20\"--${NAME}_out\"\x20is\x20passed\ |
1229 | | \x20to\x20protoc.\n\n\x08\n\x01\x02\x12\x030\0!\n\x08\n\x01\x08\x12\x031\ |
1230 | | \05\n\t\n\x02\x08\x01\x12\x031\05\n\x08\n\x01\x08\x12\x032\0-\n\t\n\x02\ |
1231 | | \x08\x08\x12\x032\0-\n\x08\n\x01\x08\x12\x034\0@\n\t\n\x02\x08\x0b\x12\ |
1232 | | \x034\0@\n\t\n\x02\x03\0\x12\x036\0*\n6\n\x02\x04\0\x12\x049\0@\x01\x1a*\ |
1233 | | \x20The\x20version\x20number\x20of\x20protocol\x20compiler.\n\n\n\n\x03\ |
1234 | | \x04\0\x01\x12\x039\x08\x0f\n\x0b\n\x04\x04\0\x02\0\x12\x03:\x02\x1b\n\ |
1235 | | \x0c\n\x05\x04\0\x02\0\x04\x12\x03:\x02\n\n\x0c\n\x05\x04\0\x02\0\x05\ |
1236 | | \x12\x03:\x0b\x10\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03:\x11\x16\n\x0c\n\ |
1237 | | \x05\x04\0\x02\0\x03\x12\x03:\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\x12\x03;\ |
1238 | | \x02\x1b\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03;\x02\n\n\x0c\n\x05\x04\0\ |
1239 | | \x02\x01\x05\x12\x03;\x0b\x10\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03;\x11\ |
1240 | | \x16\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03;\x19\x1a\n\x0b\n\x04\x04\0\ |
1241 | | \x02\x02\x12\x03<\x02\x1b\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03<\x02\n\n\ |
1242 | | \x0c\n\x05\x04\0\x02\x02\x05\x12\x03<\x0b\x10\n\x0c\n\x05\x04\0\x02\x02\ |
1243 | | \x01\x12\x03<\x11\x16\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03<\x19\x1a\n\ |
1244 | | \x80\x01\n\x04\x04\0\x02\x03\x12\x03?\x02\x1d\x1as\x20A\x20suffix\x20for\ |
1245 | | \x20alpha,\x20beta\x20or\x20rc\x20release,\x20e.g.,\x20\"alpha-1\",\x20\ |
1246 | | \"rc2\".\x20It\x20should\n\x20be\x20empty\x20for\x20mainline\x20stable\ |
1247 | | \x20releases.\n\n\x0c\n\x05\x04\0\x02\x03\x04\x12\x03?\x02\n\n\x0c\n\x05\ |
1248 | | \x04\0\x02\x03\x05\x12\x03?\x0b\x11\n\x0c\n\x05\x04\0\x02\x03\x01\x12\ |
1249 | | \x03?\x12\x18\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03?\x1b\x1c\nO\n\x02\ |
1250 | | \x04\x01\x12\x04C\0_\x01\x1aC\x20An\x20encoded\x20CodeGeneratorRequest\ |
1251 | | \x20is\x20written\x20to\x20the\x20plugin's\x20stdin.\n\n\n\n\x03\x04\x01\ |
1252 | | \x01\x12\x03C\x08\x1c\n\xd1\x01\n\x04\x04\x01\x02\0\x12\x03G\x02'\x1a\ |
1253 | | \xc3\x01\x20The\x20.proto\x20files\x20that\x20were\x20explicitly\x20list\ |
1254 | | ed\x20on\x20the\x20command-line.\x20\x20The\n\x20code\x20generator\x20sh\ |
1255 | | ould\x20generate\x20code\x20only\x20for\x20these\x20files.\x20\x20Each\ |
1256 | | \x20file's\n\x20descriptor\x20will\x20be\x20included\x20in\x20proto_file\ |
1257 | | ,\x20below.\n\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03G\x02\n\n\x0c\n\x05\ |
1258 | | \x04\x01\x02\0\x05\x12\x03G\x0b\x11\n\x0c\n\x05\x04\x01\x02\0\x01\x12\ |
1259 | | \x03G\x12\"\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03G%&\nB\n\x04\x04\x01\ |
1260 | | \x02\x01\x12\x03J\x02\x20\x1a5\x20The\x20generator\x20parameter\x20passe\ |
1261 | | d\x20on\x20the\x20command-line.\n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\ |
1262 | | \x03J\x02\n\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03J\x0b\x11\n\x0c\n\x05\ |
1263 | | \x04\x01\x02\x01\x01\x12\x03J\x12\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\ |
1264 | | \x12\x03J\x1e\x1f\n\x87\x06\n\x04\x04\x01\x02\x02\x12\x03Z\x02/\x1a\xf9\ |
1265 | | \x05\x20FileDescriptorProtos\x20for\x20all\x20files\x20in\x20files_to_ge\ |
1266 | | nerate\x20and\x20everything\n\x20they\x20import.\x20\x20The\x20files\x20\ |
1267 | | will\x20appear\x20in\x20topological\x20order,\x20so\x20each\x20file\n\ |
1268 | | \x20appears\x20before\x20any\x20file\x20that\x20imports\x20it.\n\n\x20pr\ |
1269 | | otoc\x20guarantees\x20that\x20all\x20proto_files\x20will\x20be\x20writte\ |
1270 | | n\x20after\n\x20the\x20fields\x20above,\x20even\x20though\x20this\x20is\ |
1271 | | \x20not\x20technically\x20guaranteed\x20by\x20the\n\x20protobuf\x20wire\ |
1272 | | \x20format.\x20\x20This\x20theoretically\x20could\x20allow\x20a\x20plugi\ |
1273 | | n\x20to\x20stream\n\x20in\x20the\x20FileDescriptorProtos\x20and\x20handl\ |
1274 | | e\x20them\x20one\x20by\x20one\x20rather\x20than\x20read\n\x20the\x20enti\ |
1275 | | re\x20set\x20into\x20memory\x20at\x20once.\x20\x20However,\x20as\x20of\ |
1276 | | \x20this\x20writing,\x20this\n\x20is\x20not\x20similarly\x20optimized\ |
1277 | | \x20on\x20protoc's\x20end\x20--\x20it\x20will\x20store\x20all\x20fields\ |
1278 | | \x20in\n\x20memory\x20at\x20once\x20before\x20sending\x20them\x20to\x20t\ |
1279 | | he\x20plugin.\n\n\x20Type\x20names\x20of\x20fields\x20and\x20extensions\ |
1280 | | \x20in\x20the\x20FileDescriptorProto\x20are\x20always\n\x20fully\x20qual\ |
1281 | | ified.\n\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03Z\x02\n\n\x0c\n\x05\x04\ |
1282 | | \x01\x02\x02\x06\x12\x03Z\x0b\x1e\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\ |
1283 | | \x03Z\x1f)\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03Z,.\n7\n\x04\x04\x01\ |
1284 | | \x02\x03\x12\x03]\x02(\x1a*\x20The\x20version\x20number\x20of\x20protoco\ |
1285 | | l\x20compiler.\n\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x03]\x02\n\n\x0c\n\ |
1286 | | \x05\x04\x01\x02\x03\x06\x12\x03]\x0b\x12\n\x0c\n\x05\x04\x01\x02\x03\ |
1287 | | \x01\x12\x03]\x13#\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03]&'\nL\n\x02\ |
1288 | | \x04\x02\x12\x05b\0\xb6\x01\x01\x1a?\x20The\x20plugin\x20writes\x20an\ |
1289 | | \x20encoded\x20CodeGeneratorResponse\x20to\x20stdout.\n\n\n\n\x03\x04\ |
1290 | | \x02\x01\x12\x03b\x08\x1d\n\xed\x03\n\x04\x04\x02\x02\0\x12\x03k\x02\x1c\ |
1291 | | \x1a\xdf\x03\x20Error\x20message.\x20\x20If\x20non-empty,\x20code\x20gen\ |
1292 | | eration\x20failed.\x20\x20The\x20plugin\x20process\n\x20should\x20exit\ |
1293 | | \x20with\x20status\x20code\x20zero\x20even\x20if\x20it\x20reports\x20an\ |
1294 | | \x20error\x20in\x20this\x20way.\n\n\x20This\x20should\x20be\x20used\x20t\ |
1295 | | o\x20indicate\x20errors\x20in\x20.proto\x20files\x20which\x20prevent\x20\ |
1296 | | the\n\x20code\x20generator\x20from\x20generating\x20correct\x20code.\x20\ |
1297 | | \x20Errors\x20which\x20indicate\x20a\n\x20problem\x20in\x20protoc\x20its\ |
1298 | | elf\x20--\x20such\x20as\x20the\x20input\x20CodeGeneratorRequest\x20being\ |
1299 | | \n\x20unparseable\x20--\x20should\x20be\x20reported\x20by\x20writing\x20\ |
1300 | | a\x20message\x20to\x20stderr\x20and\n\x20exiting\x20with\x20a\x20non-zer\ |
1301 | | o\x20status\x20code.\n\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03k\x02\n\n\ |
1302 | | \x0c\n\x05\x04\x02\x02\0\x05\x12\x03k\x0b\x11\n\x0c\n\x05\x04\x02\x02\0\ |
1303 | | \x01\x12\x03k\x12\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03k\x1a\x1b\n\ |
1304 | | \x89\x01\n\x04\x04\x02\x02\x01\x12\x03o\x02)\x1a|\x20A\x20bitmask\x20of\ |
1305 | | \x20supported\x20features\x20that\x20the\x20code\x20generator\x20support\ |
1306 | | s.\n\x20This\x20is\x20a\x20bitwise\x20\"or\"\x20of\x20values\x20from\x20\ |
1307 | | the\x20Feature\x20enum.\n\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03o\x02\n\ |
1308 | | \n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03o\x0b\x11\n\x0c\n\x05\x04\x02\ |
1309 | | \x02\x01\x01\x12\x03o\x12$\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03o'(\n+\ |
1310 | | \n\x04\x04\x02\x04\0\x12\x04r\x02u\x03\x1a\x1d\x20Sync\x20with\x20code_g\ |
1311 | | enerator.h.\n\n\x0c\n\x05\x04\x02\x04\0\x01\x12\x03r\x07\x0e\n\r\n\x06\ |
1312 | | \x04\x02\x04\0\x02\0\x12\x03s\x04\x15\n\x0e\n\x07\x04\x02\x04\0\x02\0\ |
1313 | | \x01\x12\x03s\x04\x10\n\x0e\n\x07\x04\x02\x04\0\x02\0\x02\x12\x03s\x13\ |
1314 | | \x14\n\r\n\x06\x04\x02\x04\0\x02\x01\x12\x03t\x04\x20\n\x0e\n\x07\x04\ |
1315 | | \x02\x04\0\x02\x01\x01\x12\x03t\x04\x1b\n\x0e\n\x07\x04\x02\x04\0\x02\ |
1316 | | \x01\x02\x12\x03t\x1e\x1f\n4\n\x04\x04\x02\x03\0\x12\x05x\x02\xb4\x01\ |
1317 | | \x03\x1a%\x20Represents\x20a\x20single\x20generated\x20file.\n\n\x0c\n\ |
1318 | | \x05\x04\x02\x03\0\x01\x12\x03x\n\x0e\n\xae\x05\n\x06\x04\x02\x03\0\x02\ |
1319 | | \0\x12\x04\x84\x01\x04\x1d\x1a\x9d\x05\x20The\x20file\x20name,\x20relati\ |
1320 | | ve\x20to\x20the\x20output\x20directory.\x20\x20The\x20name\x20must\x20no\ |
1321 | | t\n\x20contain\x20\".\"\x20or\x20\"..\"\x20components\x20and\x20must\x20\ |
1322 | | be\x20relative,\x20not\x20be\x20absolute\x20(so,\n\x20the\x20file\x20can\ |
1323 | | not\x20lie\x20outside\x20the\x20output\x20directory).\x20\x20\"/\"\x20mu\ |
1324 | | st\x20be\x20used\x20as\n\x20the\x20path\x20separator,\x20not\x20\"\\\".\ |
1325 | | \n\n\x20If\x20the\x20name\x20is\x20omitted,\x20the\x20content\x20will\ |
1326 | | \x20be\x20appended\x20to\x20the\x20previous\n\x20file.\x20\x20This\x20al\ |
1327 | | lows\x20the\x20generator\x20to\x20break\x20large\x20files\x20into\x20sma\ |
1328 | | ll\x20chunks,\n\x20and\x20allows\x20the\x20generated\x20text\x20to\x20be\ |
1329 | | \x20streamed\x20back\x20to\x20protoc\x20so\x20that\x20large\n\x20files\ |
1330 | | \x20need\x20not\x20reside\x20completely\x20in\x20memory\x20at\x20one\x20\ |
1331 | | time.\x20\x20Note\x20that\x20as\x20of\n\x20this\x20writing\x20protoc\x20\ |
1332 | | does\x20not\x20optimize\x20for\x20this\x20--\x20it\x20will\x20read\x20th\ |
1333 | | e\x20entire\n\x20CodeGeneratorResponse\x20before\x20writing\x20files\x20\ |
1334 | | to\x20disk.\n\n\x0f\n\x07\x04\x02\x03\0\x02\0\x04\x12\x04\x84\x01\x04\ |
1335 | | \x0c\n\x0f\n\x07\x04\x02\x03\0\x02\0\x05\x12\x04\x84\x01\r\x13\n\x0f\n\ |
1336 | | \x07\x04\x02\x03\0\x02\0\x01\x12\x04\x84\x01\x14\x18\n\x0f\n\x07\x04\x02\ |
1337 | | \x03\0\x02\0\x03\x12\x04\x84\x01\x1b\x1c\n\xae\x10\n\x06\x04\x02\x03\0\ |
1338 | | \x02\x01\x12\x04\xab\x01\x04(\x1a\x9d\x10\x20If\x20non-empty,\x20indicat\ |
1339 | | es\x20that\x20the\x20named\x20file\x20should\x20already\x20exist,\x20and\ |
1340 | | \x20the\n\x20content\x20here\x20is\x20to\x20be\x20inserted\x20into\x20th\ |
1341 | | at\x20file\x20at\x20a\x20defined\x20insertion\n\x20point.\x20\x20This\ |
1342 | | \x20feature\x20allows\x20a\x20code\x20generator\x20to\x20extend\x20the\ |
1343 | | \x20output\n\x20produced\x20by\x20another\x20code\x20generator.\x20\x20T\ |
1344 | | he\x20original\x20generator\x20may\x20provide\n\x20insertion\x20points\ |
1345 | | \x20by\x20placing\x20special\x20annotations\x20in\x20the\x20file\x20that\ |
1346 | | \x20look\n\x20like:\n\x20\x20\x20@@protoc_insertion_point(NAME)\n\x20The\ |
1347 | | \x20annotation\x20can\x20have\x20arbitrary\x20text\x20before\x20and\x20a\ |
1348 | | fter\x20it\x20on\x20the\x20line,\n\x20which\x20allows\x20it\x20to\x20be\ |
1349 | | \x20placed\x20in\x20a\x20comment.\x20\x20NAME\x20should\x20be\x20replace\ |
1350 | | d\x20with\n\x20an\x20identifier\x20naming\x20the\x20point\x20--\x20this\ |
1351 | | \x20is\x20what\x20other\x20generators\x20will\x20use\n\x20as\x20the\x20i\ |
1352 | | nsertion_point.\x20\x20Code\x20inserted\x20at\x20this\x20point\x20will\ |
1353 | | \x20be\x20placed\n\x20immediately\x20above\x20the\x20line\x20containing\ |
1354 | | \x20the\x20insertion\x20point\x20(thus\x20multiple\n\x20insertions\x20to\ |
1355 | | \x20the\x20same\x20point\x20will\x20come\x20out\x20in\x20the\x20order\ |
1356 | | \x20they\x20were\x20added).\n\x20The\x20double-@\x20is\x20intended\x20to\ |
1357 | | \x20make\x20it\x20unlikely\x20that\x20the\x20generated\x20code\n\x20coul\ |
1358 | | d\x20contain\x20things\x20that\x20look\x20like\x20insertion\x20points\ |
1359 | | \x20by\x20accident.\n\n\x20For\x20example,\x20the\x20C++\x20code\x20gene\ |
1360 | | rator\x20places\x20the\x20following\x20line\x20in\x20the\n\x20.pb.h\x20f\ |
1361 | | iles\x20that\x20it\x20generates:\n\x20\x20\x20//\x20@@protoc_insertion_p\ |
1362 | | oint(namespace_scope)\n\x20This\x20line\x20appears\x20within\x20the\x20s\ |
1363 | | cope\x20of\x20the\x20file's\x20package\x20namespace,\x20but\n\x20outside\ |
1364 | | \x20of\x20any\x20particular\x20class.\x20\x20Another\x20plugin\x20can\ |
1365 | | \x20then\x20specify\x20the\n\x20insertion_point\x20\"namespace_scope\"\ |
1366 | | \x20to\x20generate\x20additional\x20classes\x20or\n\x20other\x20declarat\ |
1367 | | ions\x20that\x20should\x20be\x20placed\x20in\x20this\x20scope.\n\n\x20No\ |
1368 | | te\x20that\x20if\x20the\x20line\x20containing\x20the\x20insertion\x20poi\ |
1369 | | nt\x20begins\x20with\n\x20whitespace,\x20the\x20same\x20whitespace\x20wi\ |
1370 | | ll\x20be\x20added\x20to\x20every\x20line\x20of\x20the\n\x20inserted\x20t\ |
1371 | | ext.\x20\x20This\x20is\x20useful\x20for\x20languages\x20like\x20Python,\ |
1372 | | \x20where\n\x20indentation\x20matters.\x20\x20In\x20these\x20languages,\ |
1373 | | \x20the\x20insertion\x20point\x20comment\n\x20should\x20be\x20indented\ |
1374 | | \x20the\x20same\x20amount\x20as\x20any\x20inserted\x20code\x20will\x20ne\ |
1375 | | ed\x20to\x20be\n\x20in\x20order\x20to\x20work\x20correctly\x20in\x20that\ |
1376 | | \x20context.\n\n\x20The\x20code\x20generator\x20that\x20generates\x20the\ |
1377 | | \x20initial\x20file\x20and\x20the\x20one\x20which\n\x20inserts\x20into\ |
1378 | | \x20it\x20must\x20both\x20run\x20as\x20part\x20of\x20a\x20single\x20invo\ |
1379 | | cation\x20of\x20protoc.\n\x20Code\x20generators\x20are\x20executed\x20in\ |
1380 | | \x20the\x20order\x20in\x20which\x20they\x20appear\x20on\x20the\n\x20comm\ |
1381 | | and\x20line.\n\n\x20If\x20|insertion_point|\x20is\x20present,\x20|name|\ |
1382 | | \x20must\x20also\x20be\x20present.\n\n\x0f\n\x07\x04\x02\x03\0\x02\x01\ |
1383 | | \x04\x12\x04\xab\x01\x04\x0c\n\x0f\n\x07\x04\x02\x03\0\x02\x01\x05\x12\ |
1384 | | \x04\xab\x01\r\x13\n\x0f\n\x07\x04\x02\x03\0\x02\x01\x01\x12\x04\xab\x01\ |
1385 | | \x14#\n\x0f\n\x07\x04\x02\x03\0\x02\x01\x03\x12\x04\xab\x01&'\n$\n\x06\ |
1386 | | \x04\x02\x03\0\x02\x02\x12\x04\xae\x01\x04!\x1a\x14\x20The\x20file\x20co\ |
1387 | | ntents.\n\n\x0f\n\x07\x04\x02\x03\0\x02\x02\x04\x12\x04\xae\x01\x04\x0c\ |
1388 | | \n\x0f\n\x07\x04\x02\x03\0\x02\x02\x05\x12\x04\xae\x01\r\x13\n\x0f\n\x07\ |
1389 | | \x04\x02\x03\0\x02\x02\x01\x12\x04\xae\x01\x14\x1b\n\x0f\n\x07\x04\x02\ |
1390 | | \x03\0\x02\x02\x03\x12\x04\xae\x01\x1e\x20\n\xe1\x01\n\x06\x04\x02\x03\0\ |
1391 | | \x02\x03\x12\x04\xb3\x01\x048\x1a\xd0\x01\x20Information\x20describing\ |
1392 | | \x20the\x20file\x20content\x20being\x20inserted.\x20If\x20an\x20insertio\ |
1393 | | n\n\x20point\x20is\x20used,\x20this\x20information\x20will\x20be\x20appr\ |
1394 | | opriately\x20offset\x20and\x20inserted\n\x20into\x20the\x20code\x20gener\ |
1395 | | ation\x20metadata\x20for\x20the\x20generated\x20files.\n\n\x0f\n\x07\x04\ |
1396 | | \x02\x03\0\x02\x03\x04\x12\x04\xb3\x01\x04\x0c\n\x0f\n\x07\x04\x02\x03\0\ |
1397 | | \x02\x03\x06\x12\x04\xb3\x01\r\x1e\n\x0f\n\x07\x04\x02\x03\0\x02\x03\x01\ |
1398 | | \x12\x04\xb3\x01\x1f2\n\x0f\n\x07\x04\x02\x03\0\x02\x03\x03\x12\x04\xb3\ |
1399 | | \x0157\n\x0c\n\x04\x04\x02\x02\x02\x12\x04\xb5\x01\x02\x1a\n\r\n\x05\x04\ |
1400 | | \x02\x02\x02\x04\x12\x04\xb5\x01\x02\n\n\r\n\x05\x04\x02\x02\x02\x06\x12\ |
1401 | | \x04\xb5\x01\x0b\x0f\n\r\n\x05\x04\x02\x02\x02\x01\x12\x04\xb5\x01\x10\ |
1402 | | \x14\n\r\n\x05\x04\x02\x02\x02\x03\x12\x04\xb5\x01\x17\x19\ |
1403 | | "; |
1404 | | |
1405 | | /// `FileDescriptorProto` object which was a source for this generated file |
1406 | 0 | fn file_descriptor_proto() -> &'static crate::descriptor::FileDescriptorProto { |
1407 | | static file_descriptor_proto_lazy: crate::rt::Lazy<crate::descriptor::FileDescriptorProto> = crate::rt::Lazy::new(); |
1408 | 0 | file_descriptor_proto_lazy.get(|| { |
1409 | 0 | crate::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() |
1410 | 0 | }) |
1411 | 0 | } |
1412 | | |
1413 | | /// `FileDescriptor` object which allows dynamic access to files |
1414 | 0 | pub fn file_descriptor() -> &'static crate::reflect::FileDescriptor { |
1415 | | static generated_file_descriptor_lazy: crate::rt::Lazy<crate::reflect::GeneratedFileDescriptor> = crate::rt::Lazy::new(); |
1416 | | static file_descriptor: crate::rt::Lazy<crate::reflect::FileDescriptor> = crate::rt::Lazy::new(); |
1417 | 0 | file_descriptor.get(|| { |
1418 | 0 | let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { |
1419 | 0 | let mut deps = ::std::vec::Vec::with_capacity(1); |
1420 | 0 | deps.push(crate::descriptor::file_descriptor().clone()); |
1421 | 0 | let mut messages = ::std::vec::Vec::with_capacity(4); |
1422 | 0 | messages.push(Version::generated_message_descriptor_data()); |
1423 | 0 | messages.push(CodeGeneratorRequest::generated_message_descriptor_data()); |
1424 | 0 | messages.push(CodeGeneratorResponse::generated_message_descriptor_data()); |
1425 | 0 | messages.push(code_generator_response::File::generated_message_descriptor_data()); |
1426 | 0 | let mut enums = ::std::vec::Vec::with_capacity(1); |
1427 | 0 | enums.push(code_generator_response::Feature::generated_enum_descriptor_data()); |
1428 | 0 | crate::reflect::GeneratedFileDescriptor::new_generated( |
1429 | 0 | file_descriptor_proto(), |
1430 | 0 | deps, |
1431 | 0 | messages, |
1432 | 0 | enums, |
1433 | | ) |
1434 | 0 | }); |
1435 | 0 | crate::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) |
1436 | 0 | }) |
1437 | 0 | } |