grpcio_proto/proto/protobuf/example/
route_guide.rs

1// This file is generated by rust-protobuf 2.8.2. Do not edit
2// @generated
3
4// https://github.com/Manishearth/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20//! Generated file from `grpc/example/route_guide.proto`
21
22use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25/// Generated files are compatible only with the same version
26/// of protobuf runtime.
27
28#[derive(PartialEq,Clone,Default)]
29pub struct Point {
30    // message fields
31    pub latitude: i32,
32    pub longitude: i32,
33    // special fields
34    pub unknown_fields: ::protobuf::UnknownFields,
35    pub cached_size: ::protobuf::CachedSize,
36}
37
38impl<'a> ::std::default::Default for &'a Point {
39    fn default() -> &'a Point {
40        <Point as ::protobuf::Message>::default_instance()
41    }
42}
43
44impl Point {
45    pub fn new() -> Point {
46        ::std::default::Default::default()
47    }
48
49    // int32 latitude = 1;
50
51
52    pub fn get_latitude(&self) -> i32 {
53        self.latitude
54    }
55    pub fn clear_latitude(&mut self) {
56        self.latitude = 0;
57    }
58
59    // Param is passed by value, moved
60    pub fn set_latitude(&mut self, v: i32) {
61        self.latitude = v;
62    }
63
64    // int32 longitude = 2;
65
66
67    pub fn get_longitude(&self) -> i32 {
68        self.longitude
69    }
70    pub fn clear_longitude(&mut self) {
71        self.longitude = 0;
72    }
73
74    // Param is passed by value, moved
75    pub fn set_longitude(&mut self, v: i32) {
76        self.longitude = v;
77    }
78}
79
80impl ::protobuf::Message for Point {
81    fn is_initialized(&self) -> bool {
82        true
83    }
84
85    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
86        while !is.eof()? {
87            let (field_number, wire_type) = is.read_tag_unpack()?;
88            match field_number {
89                1 => {
90                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
91                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
92                    }
93                    let tmp = is.read_int32()?;
94                    self.latitude = tmp;
95                },
96                2 => {
97                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
98                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
99                    }
100                    let tmp = is.read_int32()?;
101                    self.longitude = tmp;
102                },
103                _ => {
104                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
105                },
106            };
107        }
108        ::std::result::Result::Ok(())
109    }
110
111    // Compute sizes of nested messages
112    #[allow(unused_variables)]
113    fn compute_size(&self) -> u32 {
114        let mut my_size = 0;
115        if self.latitude != 0 {
116            my_size += ::protobuf::rt::value_size(1, self.latitude, ::protobuf::wire_format::WireTypeVarint);
117        }
118        if self.longitude != 0 {
119            my_size += ::protobuf::rt::value_size(2, self.longitude, ::protobuf::wire_format::WireTypeVarint);
120        }
121        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
122        self.cached_size.set(my_size);
123        my_size
124    }
125
126    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
127        if self.latitude != 0 {
128            os.write_int32(1, self.latitude)?;
129        }
130        if self.longitude != 0 {
131            os.write_int32(2, self.longitude)?;
132        }
133        os.write_unknown_fields(self.get_unknown_fields())?;
134        ::std::result::Result::Ok(())
135    }
136
137    fn get_cached_size(&self) -> u32 {
138        self.cached_size.get()
139    }
140
141    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
142        &self.unknown_fields
143    }
144
145    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
146        &mut self.unknown_fields
147    }
148
149    fn as_any(&self) -> &dyn (::std::any::Any) {
150        self as &dyn (::std::any::Any)
151    }
152    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
153        self as &mut dyn (::std::any::Any)
154    }
155    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
156        self
157    }
158
159    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
160        Self::descriptor_static()
161    }
162
163    fn new() -> Point {
164        Point::new()
165    }
166
167    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
168        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
169            lock: ::protobuf::lazy::ONCE_INIT,
170            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
171        };
172        unsafe {
173            descriptor.get(|| {
174                let mut fields = ::std::vec::Vec::new();
175                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
176                    "latitude",
177                    |m: &Point| { &m.latitude },
178                    |m: &mut Point| { &mut m.latitude },
179                ));
180                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
181                    "longitude",
182                    |m: &Point| { &m.longitude },
183                    |m: &mut Point| { &mut m.longitude },
184                ));
185                ::protobuf::reflect::MessageDescriptor::new::<Point>(
186                    "Point",
187                    fields,
188                    file_descriptor_proto()
189                )
190            })
191        }
192    }
193
194    fn default_instance() -> &'static Point {
195        static mut instance: ::protobuf::lazy::Lazy<Point> = ::protobuf::lazy::Lazy {
196            lock: ::protobuf::lazy::ONCE_INIT,
197            ptr: 0 as *const Point,
198        };
199        unsafe {
200            instance.get(Point::new)
201        }
202    }
203}
204
205impl ::protobuf::Clear for Point {
206    fn clear(&mut self) {
207        self.latitude = 0;
208        self.longitude = 0;
209        self.unknown_fields.clear();
210    }
211}
212
213impl ::std::fmt::Debug for Point {
214    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
215        ::protobuf::text_format::fmt(self, f)
216    }
217}
218
219impl ::protobuf::reflect::ProtobufValue for Point {
220    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
221        ::protobuf::reflect::ProtobufValueRef::Message(self)
222    }
223}
224
225#[derive(PartialEq,Clone,Default)]
226pub struct Rectangle {
227    // message fields
228    pub lo: ::protobuf::SingularPtrField<Point>,
229    pub hi: ::protobuf::SingularPtrField<Point>,
230    // special fields
231    pub unknown_fields: ::protobuf::UnknownFields,
232    pub cached_size: ::protobuf::CachedSize,
233}
234
235impl<'a> ::std::default::Default for &'a Rectangle {
236    fn default() -> &'a Rectangle {
237        <Rectangle as ::protobuf::Message>::default_instance()
238    }
239}
240
241impl Rectangle {
242    pub fn new() -> Rectangle {
243        ::std::default::Default::default()
244    }
245
246    // .routeguide.Point lo = 1;
247
248
249    pub fn get_lo(&self) -> &Point {
250        self.lo.as_ref().unwrap_or_else(|| Point::default_instance())
251    }
252    pub fn clear_lo(&mut self) {
253        self.lo.clear();
254    }
255
256    pub fn has_lo(&self) -> bool {
257        self.lo.is_some()
258    }
259
260    // Param is passed by value, moved
261    pub fn set_lo(&mut self, v: Point) {
262        self.lo = ::protobuf::SingularPtrField::some(v);
263    }
264
265    // Mutable pointer to the field.
266    // If field is not initialized, it is initialized with default value first.
267    pub fn mut_lo(&mut self) -> &mut Point {
268        if self.lo.is_none() {
269            self.lo.set_default();
270        }
271        self.lo.as_mut().unwrap()
272    }
273
274    // Take field
275    pub fn take_lo(&mut self) -> Point {
276        self.lo.take().unwrap_or_else(|| Point::new())
277    }
278
279    // .routeguide.Point hi = 2;
280
281
282    pub fn get_hi(&self) -> &Point {
283        self.hi.as_ref().unwrap_or_else(|| Point::default_instance())
284    }
285    pub fn clear_hi(&mut self) {
286        self.hi.clear();
287    }
288
289    pub fn has_hi(&self) -> bool {
290        self.hi.is_some()
291    }
292
293    // Param is passed by value, moved
294    pub fn set_hi(&mut self, v: Point) {
295        self.hi = ::protobuf::SingularPtrField::some(v);
296    }
297
298    // Mutable pointer to the field.
299    // If field is not initialized, it is initialized with default value first.
300    pub fn mut_hi(&mut self) -> &mut Point {
301        if self.hi.is_none() {
302            self.hi.set_default();
303        }
304        self.hi.as_mut().unwrap()
305    }
306
307    // Take field
308    pub fn take_hi(&mut self) -> Point {
309        self.hi.take().unwrap_or_else(|| Point::new())
310    }
311}
312
313impl ::protobuf::Message for Rectangle {
314    fn is_initialized(&self) -> bool {
315        for v in &self.lo {
316            if !v.is_initialized() {
317                return false;
318            }
319        };
320        for v in &self.hi {
321            if !v.is_initialized() {
322                return false;
323            }
324        };
325        true
326    }
327
328    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
329        while !is.eof()? {
330            let (field_number, wire_type) = is.read_tag_unpack()?;
331            match field_number {
332                1 => {
333                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.lo)?;
334                },
335                2 => {
336                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hi)?;
337                },
338                _ => {
339                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
340                },
341            };
342        }
343        ::std::result::Result::Ok(())
344    }
345
346    // Compute sizes of nested messages
347    #[allow(unused_variables)]
348    fn compute_size(&self) -> u32 {
349        let mut my_size = 0;
350        if let Some(ref v) = self.lo.as_ref() {
351            let len = v.compute_size();
352            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
353        }
354        if let Some(ref v) = self.hi.as_ref() {
355            let len = v.compute_size();
356            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
357        }
358        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
359        self.cached_size.set(my_size);
360        my_size
361    }
362
363    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
364        if let Some(ref v) = self.lo.as_ref() {
365            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
366            os.write_raw_varint32(v.get_cached_size())?;
367            v.write_to_with_cached_sizes(os)?;
368        }
369        if let Some(ref v) = self.hi.as_ref() {
370            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
371            os.write_raw_varint32(v.get_cached_size())?;
372            v.write_to_with_cached_sizes(os)?;
373        }
374        os.write_unknown_fields(self.get_unknown_fields())?;
375        ::std::result::Result::Ok(())
376    }
377
378    fn get_cached_size(&self) -> u32 {
379        self.cached_size.get()
380    }
381
382    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
383        &self.unknown_fields
384    }
385
386    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
387        &mut self.unknown_fields
388    }
389
390    fn as_any(&self) -> &dyn (::std::any::Any) {
391        self as &dyn (::std::any::Any)
392    }
393    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
394        self as &mut dyn (::std::any::Any)
395    }
396    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
397        self
398    }
399
400    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
401        Self::descriptor_static()
402    }
403
404    fn new() -> Rectangle {
405        Rectangle::new()
406    }
407
408    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
409        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
410            lock: ::protobuf::lazy::ONCE_INIT,
411            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
412        };
413        unsafe {
414            descriptor.get(|| {
415                let mut fields = ::std::vec::Vec::new();
416                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Point>>(
417                    "lo",
418                    |m: &Rectangle| { &m.lo },
419                    |m: &mut Rectangle| { &mut m.lo },
420                ));
421                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Point>>(
422                    "hi",
423                    |m: &Rectangle| { &m.hi },
424                    |m: &mut Rectangle| { &mut m.hi },
425                ));
426                ::protobuf::reflect::MessageDescriptor::new::<Rectangle>(
427                    "Rectangle",
428                    fields,
429                    file_descriptor_proto()
430                )
431            })
432        }
433    }
434
435    fn default_instance() -> &'static Rectangle {
436        static mut instance: ::protobuf::lazy::Lazy<Rectangle> = ::protobuf::lazy::Lazy {
437            lock: ::protobuf::lazy::ONCE_INIT,
438            ptr: 0 as *const Rectangle,
439        };
440        unsafe {
441            instance.get(Rectangle::new)
442        }
443    }
444}
445
446impl ::protobuf::Clear for Rectangle {
447    fn clear(&mut self) {
448        self.lo.clear();
449        self.hi.clear();
450        self.unknown_fields.clear();
451    }
452}
453
454impl ::std::fmt::Debug for Rectangle {
455    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
456        ::protobuf::text_format::fmt(self, f)
457    }
458}
459
460impl ::protobuf::reflect::ProtobufValue for Rectangle {
461    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
462        ::protobuf::reflect::ProtobufValueRef::Message(self)
463    }
464}
465
466#[derive(PartialEq,Clone,Default)]
467pub struct Feature {
468    // message fields
469    pub name: ::std::string::String,
470    pub location: ::protobuf::SingularPtrField<Point>,
471    // special fields
472    pub unknown_fields: ::protobuf::UnknownFields,
473    pub cached_size: ::protobuf::CachedSize,
474}
475
476impl<'a> ::std::default::Default for &'a Feature {
477    fn default() -> &'a Feature {
478        <Feature as ::protobuf::Message>::default_instance()
479    }
480}
481
482impl Feature {
483    pub fn new() -> Feature {
484        ::std::default::Default::default()
485    }
486
487    // string name = 1;
488
489
490    pub fn get_name(&self) -> &str {
491        &self.name
492    }
493    pub fn clear_name(&mut self) {
494        self.name.clear();
495    }
496
497    // Param is passed by value, moved
498    pub fn set_name(&mut self, v: ::std::string::String) {
499        self.name = v;
500    }
501
502    // Mutable pointer to the field.
503    // If field is not initialized, it is initialized with default value first.
504    pub fn mut_name(&mut self) -> &mut ::std::string::String {
505        &mut self.name
506    }
507
508    // Take field
509    pub fn take_name(&mut self) -> ::std::string::String {
510        ::std::mem::replace(&mut self.name, ::std::string::String::new())
511    }
512
513    // .routeguide.Point location = 2;
514
515
516    pub fn get_location(&self) -> &Point {
517        self.location.as_ref().unwrap_or_else(|| Point::default_instance())
518    }
519    pub fn clear_location(&mut self) {
520        self.location.clear();
521    }
522
523    pub fn has_location(&self) -> bool {
524        self.location.is_some()
525    }
526
527    // Param is passed by value, moved
528    pub fn set_location(&mut self, v: Point) {
529        self.location = ::protobuf::SingularPtrField::some(v);
530    }
531
532    // Mutable pointer to the field.
533    // If field is not initialized, it is initialized with default value first.
534    pub fn mut_location(&mut self) -> &mut Point {
535        if self.location.is_none() {
536            self.location.set_default();
537        }
538        self.location.as_mut().unwrap()
539    }
540
541    // Take field
542    pub fn take_location(&mut self) -> Point {
543        self.location.take().unwrap_or_else(|| Point::new())
544    }
545}
546
547impl ::protobuf::Message for Feature {
548    fn is_initialized(&self) -> bool {
549        for v in &self.location {
550            if !v.is_initialized() {
551                return false;
552            }
553        };
554        true
555    }
556
557    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
558        while !is.eof()? {
559            let (field_number, wire_type) = is.read_tag_unpack()?;
560            match field_number {
561                1 => {
562                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
563                },
564                2 => {
565                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.location)?;
566                },
567                _ => {
568                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
569                },
570            };
571        }
572        ::std::result::Result::Ok(())
573    }
574
575    // Compute sizes of nested messages
576    #[allow(unused_variables)]
577    fn compute_size(&self) -> u32 {
578        let mut my_size = 0;
579        if !self.name.is_empty() {
580            my_size += ::protobuf::rt::string_size(1, &self.name);
581        }
582        if let Some(ref v) = self.location.as_ref() {
583            let len = v.compute_size();
584            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
585        }
586        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
587        self.cached_size.set(my_size);
588        my_size
589    }
590
591    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
592        if !self.name.is_empty() {
593            os.write_string(1, &self.name)?;
594        }
595        if let Some(ref v) = self.location.as_ref() {
596            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
597            os.write_raw_varint32(v.get_cached_size())?;
598            v.write_to_with_cached_sizes(os)?;
599        }
600        os.write_unknown_fields(self.get_unknown_fields())?;
601        ::std::result::Result::Ok(())
602    }
603
604    fn get_cached_size(&self) -> u32 {
605        self.cached_size.get()
606    }
607
608    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
609        &self.unknown_fields
610    }
611
612    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
613        &mut self.unknown_fields
614    }
615
616    fn as_any(&self) -> &dyn (::std::any::Any) {
617        self as &dyn (::std::any::Any)
618    }
619    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
620        self as &mut dyn (::std::any::Any)
621    }
622    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
623        self
624    }
625
626    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
627        Self::descriptor_static()
628    }
629
630    fn new() -> Feature {
631        Feature::new()
632    }
633
634    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
635        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
636            lock: ::protobuf::lazy::ONCE_INIT,
637            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
638        };
639        unsafe {
640            descriptor.get(|| {
641                let mut fields = ::std::vec::Vec::new();
642                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
643                    "name",
644                    |m: &Feature| { &m.name },
645                    |m: &mut Feature| { &mut m.name },
646                ));
647                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Point>>(
648                    "location",
649                    |m: &Feature| { &m.location },
650                    |m: &mut Feature| { &mut m.location },
651                ));
652                ::protobuf::reflect::MessageDescriptor::new::<Feature>(
653                    "Feature",
654                    fields,
655                    file_descriptor_proto()
656                )
657            })
658        }
659    }
660
661    fn default_instance() -> &'static Feature {
662        static mut instance: ::protobuf::lazy::Lazy<Feature> = ::protobuf::lazy::Lazy {
663            lock: ::protobuf::lazy::ONCE_INIT,
664            ptr: 0 as *const Feature,
665        };
666        unsafe {
667            instance.get(Feature::new)
668        }
669    }
670}
671
672impl ::protobuf::Clear for Feature {
673    fn clear(&mut self) {
674        self.name.clear();
675        self.location.clear();
676        self.unknown_fields.clear();
677    }
678}
679
680impl ::std::fmt::Debug for Feature {
681    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
682        ::protobuf::text_format::fmt(self, f)
683    }
684}
685
686impl ::protobuf::reflect::ProtobufValue for Feature {
687    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
688        ::protobuf::reflect::ProtobufValueRef::Message(self)
689    }
690}
691
692#[derive(PartialEq,Clone,Default)]
693pub struct RouteNote {
694    // message fields
695    pub location: ::protobuf::SingularPtrField<Point>,
696    pub message: ::std::string::String,
697    // special fields
698    pub unknown_fields: ::protobuf::UnknownFields,
699    pub cached_size: ::protobuf::CachedSize,
700}
701
702impl<'a> ::std::default::Default for &'a RouteNote {
703    fn default() -> &'a RouteNote {
704        <RouteNote as ::protobuf::Message>::default_instance()
705    }
706}
707
708impl RouteNote {
709    pub fn new() -> RouteNote {
710        ::std::default::Default::default()
711    }
712
713    // .routeguide.Point location = 1;
714
715
716    pub fn get_location(&self) -> &Point {
717        self.location.as_ref().unwrap_or_else(|| Point::default_instance())
718    }
719    pub fn clear_location(&mut self) {
720        self.location.clear();
721    }
722
723    pub fn has_location(&self) -> bool {
724        self.location.is_some()
725    }
726
727    // Param is passed by value, moved
728    pub fn set_location(&mut self, v: Point) {
729        self.location = ::protobuf::SingularPtrField::some(v);
730    }
731
732    // Mutable pointer to the field.
733    // If field is not initialized, it is initialized with default value first.
734    pub fn mut_location(&mut self) -> &mut Point {
735        if self.location.is_none() {
736            self.location.set_default();
737        }
738        self.location.as_mut().unwrap()
739    }
740
741    // Take field
742    pub fn take_location(&mut self) -> Point {
743        self.location.take().unwrap_or_else(|| Point::new())
744    }
745
746    // string message = 2;
747
748
749    pub fn get_message(&self) -> &str {
750        &self.message
751    }
752    pub fn clear_message(&mut self) {
753        self.message.clear();
754    }
755
756    // Param is passed by value, moved
757    pub fn set_message(&mut self, v: ::std::string::String) {
758        self.message = v;
759    }
760
761    // Mutable pointer to the field.
762    // If field is not initialized, it is initialized with default value first.
763    pub fn mut_message(&mut self) -> &mut ::std::string::String {
764        &mut self.message
765    }
766
767    // Take field
768    pub fn take_message(&mut self) -> ::std::string::String {
769        ::std::mem::replace(&mut self.message, ::std::string::String::new())
770    }
771}
772
773impl ::protobuf::Message for RouteNote {
774    fn is_initialized(&self) -> bool {
775        for v in &self.location {
776            if !v.is_initialized() {
777                return false;
778            }
779        };
780        true
781    }
782
783    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
784        while !is.eof()? {
785            let (field_number, wire_type) = is.read_tag_unpack()?;
786            match field_number {
787                1 => {
788                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.location)?;
789                },
790                2 => {
791                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.message)?;
792                },
793                _ => {
794                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
795                },
796            };
797        }
798        ::std::result::Result::Ok(())
799    }
800
801    // Compute sizes of nested messages
802    #[allow(unused_variables)]
803    fn compute_size(&self) -> u32 {
804        let mut my_size = 0;
805        if let Some(ref v) = self.location.as_ref() {
806            let len = v.compute_size();
807            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
808        }
809        if !self.message.is_empty() {
810            my_size += ::protobuf::rt::string_size(2, &self.message);
811        }
812        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
813        self.cached_size.set(my_size);
814        my_size
815    }
816
817    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
818        if let Some(ref v) = self.location.as_ref() {
819            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
820            os.write_raw_varint32(v.get_cached_size())?;
821            v.write_to_with_cached_sizes(os)?;
822        }
823        if !self.message.is_empty() {
824            os.write_string(2, &self.message)?;
825        }
826        os.write_unknown_fields(self.get_unknown_fields())?;
827        ::std::result::Result::Ok(())
828    }
829
830    fn get_cached_size(&self) -> u32 {
831        self.cached_size.get()
832    }
833
834    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
835        &self.unknown_fields
836    }
837
838    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
839        &mut self.unknown_fields
840    }
841
842    fn as_any(&self) -> &dyn (::std::any::Any) {
843        self as &dyn (::std::any::Any)
844    }
845    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
846        self as &mut dyn (::std::any::Any)
847    }
848    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
849        self
850    }
851
852    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
853        Self::descriptor_static()
854    }
855
856    fn new() -> RouteNote {
857        RouteNote::new()
858    }
859
860    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
861        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
862            lock: ::protobuf::lazy::ONCE_INIT,
863            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
864        };
865        unsafe {
866            descriptor.get(|| {
867                let mut fields = ::std::vec::Vec::new();
868                fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Point>>(
869                    "location",
870                    |m: &RouteNote| { &m.location },
871                    |m: &mut RouteNote| { &mut m.location },
872                ));
873                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
874                    "message",
875                    |m: &RouteNote| { &m.message },
876                    |m: &mut RouteNote| { &mut m.message },
877                ));
878                ::protobuf::reflect::MessageDescriptor::new::<RouteNote>(
879                    "RouteNote",
880                    fields,
881                    file_descriptor_proto()
882                )
883            })
884        }
885    }
886
887    fn default_instance() -> &'static RouteNote {
888        static mut instance: ::protobuf::lazy::Lazy<RouteNote> = ::protobuf::lazy::Lazy {
889            lock: ::protobuf::lazy::ONCE_INIT,
890            ptr: 0 as *const RouteNote,
891        };
892        unsafe {
893            instance.get(RouteNote::new)
894        }
895    }
896}
897
898impl ::protobuf::Clear for RouteNote {
899    fn clear(&mut self) {
900        self.location.clear();
901        self.message.clear();
902        self.unknown_fields.clear();
903    }
904}
905
906impl ::std::fmt::Debug for RouteNote {
907    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
908        ::protobuf::text_format::fmt(self, f)
909    }
910}
911
912impl ::protobuf::reflect::ProtobufValue for RouteNote {
913    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
914        ::protobuf::reflect::ProtobufValueRef::Message(self)
915    }
916}
917
918#[derive(PartialEq,Clone,Default)]
919pub struct RouteSummary {
920    // message fields
921    pub point_count: i32,
922    pub feature_count: i32,
923    pub distance: i32,
924    pub elapsed_time: i32,
925    // special fields
926    pub unknown_fields: ::protobuf::UnknownFields,
927    pub cached_size: ::protobuf::CachedSize,
928}
929
930impl<'a> ::std::default::Default for &'a RouteSummary {
931    fn default() -> &'a RouteSummary {
932        <RouteSummary as ::protobuf::Message>::default_instance()
933    }
934}
935
936impl RouteSummary {
937    pub fn new() -> RouteSummary {
938        ::std::default::Default::default()
939    }
940
941    // int32 point_count = 1;
942
943
944    pub fn get_point_count(&self) -> i32 {
945        self.point_count
946    }
947    pub fn clear_point_count(&mut self) {
948        self.point_count = 0;
949    }
950
951    // Param is passed by value, moved
952    pub fn set_point_count(&mut self, v: i32) {
953        self.point_count = v;
954    }
955
956    // int32 feature_count = 2;
957
958
959    pub fn get_feature_count(&self) -> i32 {
960        self.feature_count
961    }
962    pub fn clear_feature_count(&mut self) {
963        self.feature_count = 0;
964    }
965
966    // Param is passed by value, moved
967    pub fn set_feature_count(&mut self, v: i32) {
968        self.feature_count = v;
969    }
970
971    // int32 distance = 3;
972
973
974    pub fn get_distance(&self) -> i32 {
975        self.distance
976    }
977    pub fn clear_distance(&mut self) {
978        self.distance = 0;
979    }
980
981    // Param is passed by value, moved
982    pub fn set_distance(&mut self, v: i32) {
983        self.distance = v;
984    }
985
986    // int32 elapsed_time = 4;
987
988
989    pub fn get_elapsed_time(&self) -> i32 {
990        self.elapsed_time
991    }
992    pub fn clear_elapsed_time(&mut self) {
993        self.elapsed_time = 0;
994    }
995
996    // Param is passed by value, moved
997    pub fn set_elapsed_time(&mut self, v: i32) {
998        self.elapsed_time = v;
999    }
1000}
1001
1002impl ::protobuf::Message for RouteSummary {
1003    fn is_initialized(&self) -> bool {
1004        true
1005    }
1006
1007    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
1008        while !is.eof()? {
1009            let (field_number, wire_type) = is.read_tag_unpack()?;
1010            match field_number {
1011                1 => {
1012                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
1013                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
1014                    }
1015                    let tmp = is.read_int32()?;
1016                    self.point_count = tmp;
1017                },
1018                2 => {
1019                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
1020                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
1021                    }
1022                    let tmp = is.read_int32()?;
1023                    self.feature_count = tmp;
1024                },
1025                3 => {
1026                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
1027                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
1028                    }
1029                    let tmp = is.read_int32()?;
1030                    self.distance = tmp;
1031                },
1032                4 => {
1033                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
1034                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
1035                    }
1036                    let tmp = is.read_int32()?;
1037                    self.elapsed_time = tmp;
1038                },
1039                _ => {
1040                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
1041                },
1042            };
1043        }
1044        ::std::result::Result::Ok(())
1045    }
1046
1047    // Compute sizes of nested messages
1048    #[allow(unused_variables)]
1049    fn compute_size(&self) -> u32 {
1050        let mut my_size = 0;
1051        if self.point_count != 0 {
1052            my_size += ::protobuf::rt::value_size(1, self.point_count, ::protobuf::wire_format::WireTypeVarint);
1053        }
1054        if self.feature_count != 0 {
1055            my_size += ::protobuf::rt::value_size(2, self.feature_count, ::protobuf::wire_format::WireTypeVarint);
1056        }
1057        if self.distance != 0 {
1058            my_size += ::protobuf::rt::value_size(3, self.distance, ::protobuf::wire_format::WireTypeVarint);
1059        }
1060        if self.elapsed_time != 0 {
1061            my_size += ::protobuf::rt::value_size(4, self.elapsed_time, ::protobuf::wire_format::WireTypeVarint);
1062        }
1063        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
1064        self.cached_size.set(my_size);
1065        my_size
1066    }
1067
1068    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
1069        if self.point_count != 0 {
1070            os.write_int32(1, self.point_count)?;
1071        }
1072        if self.feature_count != 0 {
1073            os.write_int32(2, self.feature_count)?;
1074        }
1075        if self.distance != 0 {
1076            os.write_int32(3, self.distance)?;
1077        }
1078        if self.elapsed_time != 0 {
1079            os.write_int32(4, self.elapsed_time)?;
1080        }
1081        os.write_unknown_fields(self.get_unknown_fields())?;
1082        ::std::result::Result::Ok(())
1083    }
1084
1085    fn get_cached_size(&self) -> u32 {
1086        self.cached_size.get()
1087    }
1088
1089    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
1090        &self.unknown_fields
1091    }
1092
1093    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
1094        &mut self.unknown_fields
1095    }
1096
1097    fn as_any(&self) -> &dyn (::std::any::Any) {
1098        self as &dyn (::std::any::Any)
1099    }
1100    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
1101        self as &mut dyn (::std::any::Any)
1102    }
1103    fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
1104        self
1105    }
1106
1107    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
1108        Self::descriptor_static()
1109    }
1110
1111    fn new() -> RouteSummary {
1112        RouteSummary::new()
1113    }
1114
1115    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
1116        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
1117            lock: ::protobuf::lazy::ONCE_INIT,
1118            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
1119        };
1120        unsafe {
1121            descriptor.get(|| {
1122                let mut fields = ::std::vec::Vec::new();
1123                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
1124                    "point_count",
1125                    |m: &RouteSummary| { &m.point_count },
1126                    |m: &mut RouteSummary| { &mut m.point_count },
1127                ));
1128                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
1129                    "feature_count",
1130                    |m: &RouteSummary| { &m.feature_count },
1131                    |m: &mut RouteSummary| { &mut m.feature_count },
1132                ));
1133                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
1134                    "distance",
1135                    |m: &RouteSummary| { &m.distance },
1136                    |m: &mut RouteSummary| { &mut m.distance },
1137                ));
1138                fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
1139                    "elapsed_time",
1140                    |m: &RouteSummary| { &m.elapsed_time },
1141                    |m: &mut RouteSummary| { &mut m.elapsed_time },
1142                ));
1143                ::protobuf::reflect::MessageDescriptor::new::<RouteSummary>(
1144                    "RouteSummary",
1145                    fields,
1146                    file_descriptor_proto()
1147                )
1148            })
1149        }
1150    }
1151
1152    fn default_instance() -> &'static RouteSummary {
1153        static mut instance: ::protobuf::lazy::Lazy<RouteSummary> = ::protobuf::lazy::Lazy {
1154            lock: ::protobuf::lazy::ONCE_INIT,
1155            ptr: 0 as *const RouteSummary,
1156        };
1157        unsafe {
1158            instance.get(RouteSummary::new)
1159        }
1160    }
1161}
1162
1163impl ::protobuf::Clear for RouteSummary {
1164    fn clear(&mut self) {
1165        self.point_count = 0;
1166        self.feature_count = 0;
1167        self.distance = 0;
1168        self.elapsed_time = 0;
1169        self.unknown_fields.clear();
1170    }
1171}
1172
1173impl ::std::fmt::Debug for RouteSummary {
1174    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1175        ::protobuf::text_format::fmt(self, f)
1176    }
1177}
1178
1179impl ::protobuf::reflect::ProtobufValue for RouteSummary {
1180    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
1181        ::protobuf::reflect::ProtobufValueRef::Message(self)
1182    }
1183}
1184
1185static file_descriptor_proto_data: &'static [u8] = b"\
1186    \n\x1egrpc/example/route_guide.proto\x12\nrouteguide\"A\n\x05Point\x12\
1187    \x1a\n\x08latitude\x18\x01\x20\x01(\x05R\x08latitude\x12\x1c\n\tlongitud\
1188    e\x18\x02\x20\x01(\x05R\tlongitude\"Q\n\tRectangle\x12!\n\x02lo\x18\x01\
1189    \x20\x01(\x0b2\x11.routeguide.PointR\x02lo\x12!\n\x02hi\x18\x02\x20\x01(\
1190    \x0b2\x11.routeguide.PointR\x02hi\"L\n\x07Feature\x12\x12\n\x04name\x18\
1191    \x01\x20\x01(\tR\x04name\x12-\n\x08location\x18\x02\x20\x01(\x0b2\x11.ro\
1192    uteguide.PointR\x08location\"T\n\tRouteNote\x12-\n\x08location\x18\x01\
1193    \x20\x01(\x0b2\x11.routeguide.PointR\x08location\x12\x18\n\x07message\
1194    \x18\x02\x20\x01(\tR\x07message\"\x93\x01\n\x0cRouteSummary\x12\x1f\n\
1195    \x0bpoint_count\x18\x01\x20\x01(\x05R\npointCount\x12#\n\rfeature_count\
1196    \x18\x02\x20\x01(\x05R\x0cfeatureCount\x12\x1a\n\x08distance\x18\x03\x20\
1197    \x01(\x05R\x08distance\x12!\n\x0celapsed_time\x18\x04\x20\x01(\x05R\x0be\
1198    lapsedTime2\x85\x02\n\nRouteGuide\x126\n\nGetFeature\x12\x11.routeguide.\
1199    Point\x1a\x13.routeguide.Feature\"\0\x12>\n\x0cListFeatures\x12\x15.rout\
1200    eguide.Rectangle\x1a\x13.routeguide.Feature\"\00\x01\x12>\n\x0bRecordRou\
1201    te\x12\x11.routeguide.Point\x1a\x18.routeguide.RouteSummary\"\0(\x01\x12\
1202    ?\n\tRouteChat\x12\x15.routeguide.RouteNote\x1a\x15.routeguide.RouteNote\
1203    \"\0(\x010\x01B6\n\x1bio.grpc.examples.routeguideB\x0fRouteGuideProtoP\
1204    \x01\xa2\x02\x03RTGb\x06proto3\
1205";
1206
1207static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
1208    lock: ::protobuf::lazy::ONCE_INIT,
1209    ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
1210};
1211
1212fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
1213    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
1214}
1215
1216pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
1217    unsafe {
1218        file_descriptor_proto_lazy.get(|| {
1219            parse_descriptor_proto()
1220        })
1221    }
1222}
1223
1224pub use super::route_guide_grpc::*;