浏览代码

Regenerate *.rs files in `src/proto/`

Johannes Hofmann 6 年前
父节点
当前提交
7bf89809d3
共有 2 个文件被更改,包括 590 次插入490 次删除
  1. 90
    73
      src/proto/fileformat.rs
  2. 500
    417
      src/proto/osmformat.rs

+ 90
- 73
src/proto/fileformat.rs 查看文件

1
-// This file is generated by rust-protobuf 2.0.0. Do not edit
1
+// This file is generated by rust-protobuf 2.8.1. Do not edit
2
 // @generated
2
 // @generated
3
 
3
 
4
 // https://github.com/Manishearth/rust-clippy/issues/702
4
 // https://github.com/Manishearth/rust-clippy/issues/702
5
 #![allow(unknown_lints)]
5
 #![allow(unknown_lints)]
6
-#![allow(clippy)]
6
+#![allow(clippy::all)]
7
 
7
 
8
 #![cfg_attr(rustfmt, rustfmt_skip)]
8
 #![cfg_attr(rustfmt, rustfmt_skip)]
9
 
9
 
17
 #![allow(unsafe_code)]
17
 #![allow(unsafe_code)]
18
 #![allow(unused_imports)]
18
 #![allow(unused_imports)]
19
 #![allow(unused_results)]
19
 #![allow(unused_results)]
20
+//! Generated file from `src/proto/fileformat.proto`
20
 
21
 
21
 use protobuf::Message as Message_imported_for_functions;
22
 use protobuf::Message as Message_imported_for_functions;
22
 use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
23
 use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
23
 
24
 
25
+/// Generated files are compatible only with the same version
26
+/// of protobuf runtime.
27
+const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1;
28
+
24
 #[derive(PartialEq,Clone,Default,Debug)]
29
 #[derive(PartialEq,Clone,Default,Debug)]
25
 pub struct Blob {
30
 pub struct Blob {
26
     // message fields
31
     // message fields
30
     lzma_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
35
     lzma_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
31
     OBSOLETE_bzip2_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
36
     OBSOLETE_bzip2_data: ::protobuf::SingularField<::std::vec::Vec<u8>>,
32
     // special fields
37
     // special fields
33
-    unknown_fields: ::protobuf::UnknownFields,
34
-    cached_size: ::protobuf::CachedSize,
38
+    pub unknown_fields: ::protobuf::UnknownFields,
39
+    pub cached_size: ::protobuf::CachedSize,
40
+}
41
+
42
+impl<'a> ::std::default::Default for &'a Blob {
43
+    fn default() -> &'a Blob {
44
+        <Blob as ::protobuf::Message>::default_instance()
45
+    }
35
 }
46
 }
36
 
47
 
37
 impl Blob {
48
 impl Blob {
41
 
52
 
42
     // optional bytes raw = 1;
53
     // optional bytes raw = 1;
43
 
54
 
55
+
56
+    pub fn get_raw(&self) -> &[u8] {
57
+        match self.raw.as_ref() {
58
+            Some(v) => &v,
59
+            None => &[],
60
+        }
61
+    }
44
     pub fn clear_raw(&mut self) {
62
     pub fn clear_raw(&mut self) {
45
         self.raw.clear();
63
         self.raw.clear();
46
     }
64
     }
68
         self.raw.take().unwrap_or_else(|| ::std::vec::Vec::new())
86
         self.raw.take().unwrap_or_else(|| ::std::vec::Vec::new())
69
     }
87
     }
70
 
88
 
71
-    pub fn get_raw(&self) -> &[u8] {
72
-        match self.raw.as_ref() {
73
-            Some(v) => &v,
74
-            None => &[],
75
-        }
76
-    }
77
-
78
     // optional int32 raw_size = 2;
89
     // optional int32 raw_size = 2;
79
 
90
 
91
+
92
+    pub fn get_raw_size(&self) -> i32 {
93
+        self.raw_size.unwrap_or(0)
94
+    }
80
     pub fn clear_raw_size(&mut self) {
95
     pub fn clear_raw_size(&mut self) {
81
         self.raw_size = ::std::option::Option::None;
96
         self.raw_size = ::std::option::Option::None;
82
     }
97
     }
90
         self.raw_size = ::std::option::Option::Some(v);
105
         self.raw_size = ::std::option::Option::Some(v);
91
     }
106
     }
92
 
107
 
93
-    pub fn get_raw_size(&self) -> i32 {
94
-        self.raw_size.unwrap_or(0)
95
-    }
96
-
97
     // optional bytes zlib_data = 3;
108
     // optional bytes zlib_data = 3;
98
 
109
 
110
+
111
+    pub fn get_zlib_data(&self) -> &[u8] {
112
+        match self.zlib_data.as_ref() {
113
+            Some(v) => &v,
114
+            None => &[],
115
+        }
116
+    }
99
     pub fn clear_zlib_data(&mut self) {
117
     pub fn clear_zlib_data(&mut self) {
100
         self.zlib_data.clear();
118
         self.zlib_data.clear();
101
     }
119
     }
123
         self.zlib_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
141
         self.zlib_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
124
     }
142
     }
125
 
143
 
126
-    pub fn get_zlib_data(&self) -> &[u8] {
127
-        match self.zlib_data.as_ref() {
144
+    // optional bytes lzma_data = 4;
145
+
146
+
147
+    pub fn get_lzma_data(&self) -> &[u8] {
148
+        match self.lzma_data.as_ref() {
128
             Some(v) => &v,
149
             Some(v) => &v,
129
             None => &[],
150
             None => &[],
130
         }
151
         }
131
     }
152
     }
132
-
133
-    // optional bytes lzma_data = 4;
134
-
135
     pub fn clear_lzma_data(&mut self) {
153
     pub fn clear_lzma_data(&mut self) {
136
         self.lzma_data.clear();
154
         self.lzma_data.clear();
137
     }
155
     }
159
         self.lzma_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
177
         self.lzma_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
160
     }
178
     }
161
 
179
 
162
-    pub fn get_lzma_data(&self) -> &[u8] {
163
-        match self.lzma_data.as_ref() {
180
+    // optional bytes OBSOLETE_bzip2_data = 5;
181
+
182
+
183
+    pub fn get_OBSOLETE_bzip2_data(&self) -> &[u8] {
184
+        match self.OBSOLETE_bzip2_data.as_ref() {
164
             Some(v) => &v,
185
             Some(v) => &v,
165
             None => &[],
186
             None => &[],
166
         }
187
         }
167
     }
188
     }
168
-
169
-    // optional bytes OBSOLETE_bzip2_data = 5;
170
-
171
     pub fn clear_OBSOLETE_bzip2_data(&mut self) {
189
     pub fn clear_OBSOLETE_bzip2_data(&mut self) {
172
         self.OBSOLETE_bzip2_data.clear();
190
         self.OBSOLETE_bzip2_data.clear();
173
     }
191
     }
194
     pub fn take_OBSOLETE_bzip2_data(&mut self) -> ::std::vec::Vec<u8> {
212
     pub fn take_OBSOLETE_bzip2_data(&mut self) -> ::std::vec::Vec<u8> {
195
         self.OBSOLETE_bzip2_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
213
         self.OBSOLETE_bzip2_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
196
     }
214
     }
197
-
198
-    pub fn get_OBSOLETE_bzip2_data(&self) -> &[u8] {
199
-        match self.OBSOLETE_bzip2_data.as_ref() {
200
-            Some(v) => &v,
201
-            None => &[],
202
-        }
203
-    }
204
 }
215
 }
205
 
216
 
206
 impl ::protobuf::Message for Blob {
217
 impl ::protobuf::Message for Blob {
208
         true
219
         true
209
     }
220
     }
210
 
221
 
211
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
222
+    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
212
         while !is.eof()? {
223
         while !is.eof()? {
213
             let (field_number, wire_type) = is.read_tag_unpack()?;
224
             let (field_number, wire_type) = is.read_tag_unpack()?;
214
             match field_number {
225
             match field_number {
263
         my_size
274
         my_size
264
     }
275
     }
265
 
276
 
266
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
277
+    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
267
         if let Some(ref v) = self.raw.as_ref() {
278
         if let Some(ref v) = self.raw.as_ref() {
268
             os.write_bytes(1, &v)?;
279
             os.write_bytes(1, &v)?;
269
         }
280
         }
295
         &mut self.unknown_fields
306
         &mut self.unknown_fields
296
     }
307
     }
297
 
308
 
298
-    fn as_any(&self) -> &::std::any::Any {
299
-        self as &::std::any::Any
309
+    fn as_any(&self) -> &dyn (::std::any::Any) {
310
+        self as &dyn (::std::any::Any)
300
     }
311
     }
301
-    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
302
-        self as &mut ::std::any::Any
312
+    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
313
+        self as &mut dyn (::std::any::Any)
303
     }
314
     }
304
-    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
315
+    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
305
         self
316
         self
306
     }
317
     }
307
 
318
 
326
 
337
 
327
 impl ::protobuf::Clear for Blob {
338
 impl ::protobuf::Clear for Blob {
328
     fn clear(&mut self) {
339
     fn clear(&mut self) {
329
-        self.clear_raw();
330
-        self.clear_raw_size();
331
-        self.clear_zlib_data();
332
-        self.clear_lzma_data();
333
-        self.clear_OBSOLETE_bzip2_data();
340
+        self.raw.clear();
341
+        self.raw_size = ::std::option::Option::None;
342
+        self.zlib_data.clear();
343
+        self.lzma_data.clear();
344
+        self.OBSOLETE_bzip2_data.clear();
334
         self.unknown_fields.clear();
345
         self.unknown_fields.clear();
335
     }
346
     }
336
 }
347
 }
348
     indexdata: ::protobuf::SingularField<::std::vec::Vec<u8>>,
359
     indexdata: ::protobuf::SingularField<::std::vec::Vec<u8>>,
349
     datasize: ::std::option::Option<i32>,
360
     datasize: ::std::option::Option<i32>,
350
     // special fields
361
     // special fields
351
-    unknown_fields: ::protobuf::UnknownFields,
352
-    cached_size: ::protobuf::CachedSize,
362
+    pub unknown_fields: ::protobuf::UnknownFields,
363
+    pub cached_size: ::protobuf::CachedSize,
364
+}
365
+
366
+impl<'a> ::std::default::Default for &'a BlobHeader {
367
+    fn default() -> &'a BlobHeader {
368
+        <BlobHeader as ::protobuf::Message>::default_instance()
369
+    }
353
 }
370
 }
354
 
371
 
355
 impl BlobHeader {
372
 impl BlobHeader {
359
 
376
 
360
     // required string type = 1;
377
     // required string type = 1;
361
 
378
 
379
+
380
+    pub fn get_field_type(&self) -> &str {
381
+        match self.field_type.as_ref() {
382
+            Some(v) => &v,
383
+            None => "",
384
+        }
385
+    }
362
     pub fn clear_field_type(&mut self) {
386
     pub fn clear_field_type(&mut self) {
363
         self.field_type.clear();
387
         self.field_type.clear();
364
     }
388
     }
386
         self.field_type.take().unwrap_or_else(|| ::std::string::String::new())
410
         self.field_type.take().unwrap_or_else(|| ::std::string::String::new())
387
     }
411
     }
388
 
412
 
389
-    pub fn get_field_type(&self) -> &str {
390
-        match self.field_type.as_ref() {
413
+    // optional bytes indexdata = 2;
414
+
415
+
416
+    pub fn get_indexdata(&self) -> &[u8] {
417
+        match self.indexdata.as_ref() {
391
             Some(v) => &v,
418
             Some(v) => &v,
392
-            None => "",
419
+            None => &[],
393
         }
420
         }
394
     }
421
     }
395
-
396
-    // optional bytes indexdata = 2;
397
-
398
     pub fn clear_indexdata(&mut self) {
422
     pub fn clear_indexdata(&mut self) {
399
         self.indexdata.clear();
423
         self.indexdata.clear();
400
     }
424
     }
422
         self.indexdata.take().unwrap_or_else(|| ::std::vec::Vec::new())
446
         self.indexdata.take().unwrap_or_else(|| ::std::vec::Vec::new())
423
     }
447
     }
424
 
448
 
425
-    pub fn get_indexdata(&self) -> &[u8] {
426
-        match self.indexdata.as_ref() {
427
-            Some(v) => &v,
428
-            None => &[],
429
-        }
430
-    }
431
-
432
     // required int32 datasize = 3;
449
     // required int32 datasize = 3;
433
 
450
 
451
+
452
+    pub fn get_datasize(&self) -> i32 {
453
+        self.datasize.unwrap_or(0)
454
+    }
434
     pub fn clear_datasize(&mut self) {
455
     pub fn clear_datasize(&mut self) {
435
         self.datasize = ::std::option::Option::None;
456
         self.datasize = ::std::option::Option::None;
436
     }
457
     }
443
     pub fn set_datasize(&mut self, v: i32) {
464
     pub fn set_datasize(&mut self, v: i32) {
444
         self.datasize = ::std::option::Option::Some(v);
465
         self.datasize = ::std::option::Option::Some(v);
445
     }
466
     }
446
-
447
-    pub fn get_datasize(&self) -> i32 {
448
-        self.datasize.unwrap_or(0)
449
-    }
450
 }
467
 }
451
 
468
 
452
 impl ::protobuf::Message for BlobHeader {
469
 impl ::protobuf::Message for BlobHeader {
460
         true
477
         true
461
     }
478
     }
462
 
479
 
463
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
480
+    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
464
         while !is.eof()? {
481
         while !is.eof()? {
465
             let (field_number, wire_type) = is.read_tag_unpack()?;
482
             let (field_number, wire_type) = is.read_tag_unpack()?;
466
             match field_number {
483
             match field_number {
503
         my_size
520
         my_size
504
     }
521
     }
505
 
522
 
506
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
523
+    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
507
         if let Some(ref v) = self.field_type.as_ref() {
524
         if let Some(ref v) = self.field_type.as_ref() {
508
             os.write_string(1, &v)?;
525
             os.write_string(1, &v)?;
509
         }
526
         }
529
         &mut self.unknown_fields
546
         &mut self.unknown_fields
530
     }
547
     }
531
 
548
 
532
-    fn as_any(&self) -> &::std::any::Any {
533
-        self as &::std::any::Any
549
+    fn as_any(&self) -> &dyn (::std::any::Any) {
550
+        self as &dyn (::std::any::Any)
534
     }
551
     }
535
-    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
536
-        self as &mut ::std::any::Any
552
+    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
553
+        self as &mut dyn (::std::any::Any)
537
     }
554
     }
538
-    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
555
+    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
539
         self
556
         self
540
     }
557
     }
541
 
558
 
560
 
577
 
561
 impl ::protobuf::Clear for BlobHeader {
578
 impl ::protobuf::Clear for BlobHeader {
562
     fn clear(&mut self) {
579
     fn clear(&mut self) {
563
-        self.clear_field_type();
564
-        self.clear_indexdata();
565
-        self.clear_datasize();
580
+        self.field_type.clear();
581
+        self.indexdata.clear();
582
+        self.datasize = ::std::option::Option::None;
566
         self.unknown_fields.clear();
583
         self.unknown_fields.clear();
567
     }
584
     }
568
 }
585
 }

+ 500
- 417
src/proto/osmformat.rs
文件差异内容过多而无法显示
查看文件