gz_msgs/gz_msgs10/
clock.rs

1// This file is generated by rust-protobuf 3.7.2. Do not edit
2// .proto file is parsed by protoc 3.21.12
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(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_results)]
19#![allow(unused_mut)]
20
21//! Generated file from `gz/msgs/clock.proto`
22
23/// Generated files are compatible only with the same version
24/// of protobuf runtime.
25const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
26
27#[derive(::gz_msgs_common::GzMessage)]
28// @@protoc_insertion_point(message:gz.msgs.Clock)
29#[derive(PartialEq,Clone,Default,Debug)]
30pub struct Clock {
31    // message fields
32    // @@protoc_insertion_point(field:gz.msgs.Clock.header)
33    pub header: ::protobuf::MessageField<super::header::Header>,
34    // @@protoc_insertion_point(field:gz.msgs.Clock.system)
35    pub system: ::protobuf::MessageField<super::time::Time>,
36    // @@protoc_insertion_point(field:gz.msgs.Clock.real)
37    pub real: ::protobuf::MessageField<super::time::Time>,
38    // @@protoc_insertion_point(field:gz.msgs.Clock.sim)
39    pub sim: ::protobuf::MessageField<super::time::Time>,
40    // special fields
41    // @@protoc_insertion_point(special_field:gz.msgs.Clock.special_fields)
42    pub special_fields: ::protobuf::SpecialFields,
43}
44
45impl<'a> ::std::default::Default for &'a Clock {
46    fn default() -> &'a Clock {
47        <Clock as ::protobuf::Message>::default_instance()
48    }
49}
50
51impl Clock {
52    pub fn new() -> Clock {
53        ::std::default::Default::default()
54    }
55
56    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
57        let mut fields = ::std::vec::Vec::with_capacity(4);
58        let mut oneofs = ::std::vec::Vec::with_capacity(0);
59        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::header::Header>(
60            "header",
61            |m: &Clock| { &m.header },
62            |m: &mut Clock| { &mut m.header },
63        ));
64        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::time::Time>(
65            "system",
66            |m: &Clock| { &m.system },
67            |m: &mut Clock| { &mut m.system },
68        ));
69        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::time::Time>(
70            "real",
71            |m: &Clock| { &m.real },
72            |m: &mut Clock| { &mut m.real },
73        ));
74        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::time::Time>(
75            "sim",
76            |m: &Clock| { &m.sim },
77            |m: &mut Clock| { &mut m.sim },
78        ));
79        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Clock>(
80            "Clock",
81            fields,
82            oneofs,
83        )
84    }
85}
86
87impl ::protobuf::Message for Clock {
88    const NAME: &'static str = "Clock";
89
90    fn is_initialized(&self) -> bool {
91        true
92    }
93
94    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
95        while let Some(tag) = is.read_raw_tag_or_eof()? {
96            match tag {
97                10 => {
98                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
99                },
100                18 => {
101                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.system)?;
102                },
103                26 => {
104                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.real)?;
105                },
106                34 => {
107                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.sim)?;
108                },
109                tag => {
110                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
111                },
112            };
113        }
114        ::std::result::Result::Ok(())
115    }
116
117    // Compute sizes of nested messages
118    #[allow(unused_variables)]
119    fn compute_size(&self) -> u64 {
120        let mut my_size = 0;
121        if let Some(v) = self.header.as_ref() {
122            let len = v.compute_size();
123            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
124        }
125        if let Some(v) = self.system.as_ref() {
126            let len = v.compute_size();
127            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
128        }
129        if let Some(v) = self.real.as_ref() {
130            let len = v.compute_size();
131            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
132        }
133        if let Some(v) = self.sim.as_ref() {
134            let len = v.compute_size();
135            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
136        }
137        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
138        self.special_fields.cached_size().set(my_size as u32);
139        my_size
140    }
141
142    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
143        if let Some(v) = self.header.as_ref() {
144            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
145        }
146        if let Some(v) = self.system.as_ref() {
147            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
148        }
149        if let Some(v) = self.real.as_ref() {
150            ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
151        }
152        if let Some(v) = self.sim.as_ref() {
153            ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
154        }
155        os.write_unknown_fields(self.special_fields.unknown_fields())?;
156        ::std::result::Result::Ok(())
157    }
158
159    fn special_fields(&self) -> &::protobuf::SpecialFields {
160        &self.special_fields
161    }
162
163    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
164        &mut self.special_fields
165    }
166
167    fn new() -> Clock {
168        Clock::new()
169    }
170
171    fn clear(&mut self) {
172        self.header.clear();
173        self.system.clear();
174        self.real.clear();
175        self.sim.clear();
176        self.special_fields.clear();
177    }
178
179    fn default_instance() -> &'static Clock {
180        static instance: Clock = Clock {
181            header: ::protobuf::MessageField::none(),
182            system: ::protobuf::MessageField::none(),
183            real: ::protobuf::MessageField::none(),
184            sim: ::protobuf::MessageField::none(),
185            special_fields: ::protobuf::SpecialFields::new(),
186        };
187        &instance
188    }
189}
190
191impl ::protobuf::MessageFull for Clock {
192    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
193        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
194        descriptor.get(|| file_descriptor().message_by_package_relative_name("Clock").unwrap()).clone()
195    }
196}
197
198impl ::std::fmt::Display for Clock {
199    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
200        ::protobuf::text_format::fmt(self, f)
201    }
202}
203
204impl ::protobuf::reflect::ProtobufValue for Clock {
205    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
206}
207
208static file_descriptor_proto_data: &'static [u8] = b"\
209    \n\x13gz/msgs/clock.proto\x12\x07gz.msgs\x1a\x12gz/msgs/time.proto\x1a\
210    \x14gz/msgs/header.proto\"\x9b\x01\n\x05Clock\x12'\n\x06header\x18\x01\
211    \x20\x01(\x0b2\x0f.gz.msgs.HeaderR\x06header\x12%\n\x06system\x18\x02\
212    \x20\x01(\x0b2\r.gz.msgs.TimeR\x06system\x12!\n\x04real\x18\x03\x20\x01(\
213    \x0b2\r.gz.msgs.TimeR\x04real\x12\x1f\n\x03sim\x18\x04\x20\x01(\x0b2\r.g\
214    z.msgs.TimeR\x03simB\x1a\n\x0bcom.gz.msgsB\x0bClockProtosb\x06proto3\
215";
216
217/// `FileDescriptorProto` object which was a source for this generated file
218fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
219    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
220    file_descriptor_proto_lazy.get(|| {
221        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
222    })
223}
224
225/// `FileDescriptor` object which allows dynamic access to files
226pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
227    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
228    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
229    file_descriptor.get(|| {
230        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
231            let mut deps = ::std::vec::Vec::with_capacity(2);
232            deps.push(super::time::file_descriptor().clone());
233            deps.push(super::header::file_descriptor().clone());
234            let mut messages = ::std::vec::Vec::with_capacity(1);
235            messages.push(Clock::generated_message_descriptor_data());
236            let mut enums = ::std::vec::Vec::with_capacity(0);
237            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
238                file_descriptor_proto(),
239                deps,
240                messages,
241                enums,
242            )
243        });
244        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
245    })
246}