gz_msgs/gz_msgs9/
server_control.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/server_control.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.ServerControl)
29#[derive(PartialEq,Clone,Default,Debug)]
30pub struct ServerControl {
31    // message fields
32    // @@protoc_insertion_point(field:gz.msgs.ServerControl.header)
33    pub header: ::protobuf::MessageField<super::header::Header>,
34    // @@protoc_insertion_point(field:gz.msgs.ServerControl.save_world_name)
35    pub save_world_name: ::std::string::String,
36    // @@protoc_insertion_point(field:gz.msgs.ServerControl.save_filename)
37    pub save_filename: ::std::string::String,
38    // @@protoc_insertion_point(field:gz.msgs.ServerControl.open_filename)
39    pub open_filename: ::std::string::String,
40    // @@protoc_insertion_point(field:gz.msgs.ServerControl.new_world)
41    pub new_world: bool,
42    // @@protoc_insertion_point(field:gz.msgs.ServerControl.stop)
43    pub stop: bool,
44    // @@protoc_insertion_point(field:gz.msgs.ServerControl.clone)
45    pub clone: bool,
46    // @@protoc_insertion_point(field:gz.msgs.ServerControl.new_port)
47    pub new_port: u32,
48    // special fields
49    // @@protoc_insertion_point(special_field:gz.msgs.ServerControl.special_fields)
50    pub special_fields: ::protobuf::SpecialFields,
51}
52
53impl<'a> ::std::default::Default for &'a ServerControl {
54    fn default() -> &'a ServerControl {
55        <ServerControl as ::protobuf::Message>::default_instance()
56    }
57}
58
59impl ServerControl {
60    pub fn new() -> ServerControl {
61        ::std::default::Default::default()
62    }
63
64    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
65        let mut fields = ::std::vec::Vec::with_capacity(8);
66        let mut oneofs = ::std::vec::Vec::with_capacity(0);
67        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::header::Header>(
68            "header",
69            |m: &ServerControl| { &m.header },
70            |m: &mut ServerControl| { &mut m.header },
71        ));
72        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
73            "save_world_name",
74            |m: &ServerControl| { &m.save_world_name },
75            |m: &mut ServerControl| { &mut m.save_world_name },
76        ));
77        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
78            "save_filename",
79            |m: &ServerControl| { &m.save_filename },
80            |m: &mut ServerControl| { &mut m.save_filename },
81        ));
82        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
83            "open_filename",
84            |m: &ServerControl| { &m.open_filename },
85            |m: &mut ServerControl| { &mut m.open_filename },
86        ));
87        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
88            "new_world",
89            |m: &ServerControl| { &m.new_world },
90            |m: &mut ServerControl| { &mut m.new_world },
91        ));
92        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
93            "stop",
94            |m: &ServerControl| { &m.stop },
95            |m: &mut ServerControl| { &mut m.stop },
96        ));
97        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
98            "clone",
99            |m: &ServerControl| { &m.clone },
100            |m: &mut ServerControl| { &mut m.clone },
101        ));
102        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
103            "new_port",
104            |m: &ServerControl| { &m.new_port },
105            |m: &mut ServerControl| { &mut m.new_port },
106        ));
107        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ServerControl>(
108            "ServerControl",
109            fields,
110            oneofs,
111        )
112    }
113}
114
115impl ::protobuf::Message for ServerControl {
116    const NAME: &'static str = "ServerControl";
117
118    fn is_initialized(&self) -> bool {
119        true
120    }
121
122    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
123        while let Some(tag) = is.read_raw_tag_or_eof()? {
124            match tag {
125                10 => {
126                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
127                },
128                18 => {
129                    self.save_world_name = is.read_string()?;
130                },
131                26 => {
132                    self.save_filename = is.read_string()?;
133                },
134                34 => {
135                    self.open_filename = is.read_string()?;
136                },
137                40 => {
138                    self.new_world = is.read_bool()?;
139                },
140                48 => {
141                    self.stop = is.read_bool()?;
142                },
143                56 => {
144                    self.clone = is.read_bool()?;
145                },
146                64 => {
147                    self.new_port = is.read_uint32()?;
148                },
149                tag => {
150                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
151                },
152            };
153        }
154        ::std::result::Result::Ok(())
155    }
156
157    // Compute sizes of nested messages
158    #[allow(unused_variables)]
159    fn compute_size(&self) -> u64 {
160        let mut my_size = 0;
161        if let Some(v) = self.header.as_ref() {
162            let len = v.compute_size();
163            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
164        }
165        if !self.save_world_name.is_empty() {
166            my_size += ::protobuf::rt::string_size(2, &self.save_world_name);
167        }
168        if !self.save_filename.is_empty() {
169            my_size += ::protobuf::rt::string_size(3, &self.save_filename);
170        }
171        if !self.open_filename.is_empty() {
172            my_size += ::protobuf::rt::string_size(4, &self.open_filename);
173        }
174        if self.new_world != false {
175            my_size += 1 + 1;
176        }
177        if self.stop != false {
178            my_size += 1 + 1;
179        }
180        if self.clone != false {
181            my_size += 1 + 1;
182        }
183        if self.new_port != 0 {
184            my_size += ::protobuf::rt::uint32_size(8, self.new_port);
185        }
186        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
187        self.special_fields.cached_size().set(my_size as u32);
188        my_size
189    }
190
191    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
192        if let Some(v) = self.header.as_ref() {
193            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
194        }
195        if !self.save_world_name.is_empty() {
196            os.write_string(2, &self.save_world_name)?;
197        }
198        if !self.save_filename.is_empty() {
199            os.write_string(3, &self.save_filename)?;
200        }
201        if !self.open_filename.is_empty() {
202            os.write_string(4, &self.open_filename)?;
203        }
204        if self.new_world != false {
205            os.write_bool(5, self.new_world)?;
206        }
207        if self.stop != false {
208            os.write_bool(6, self.stop)?;
209        }
210        if self.clone != false {
211            os.write_bool(7, self.clone)?;
212        }
213        if self.new_port != 0 {
214            os.write_uint32(8, self.new_port)?;
215        }
216        os.write_unknown_fields(self.special_fields.unknown_fields())?;
217        ::std::result::Result::Ok(())
218    }
219
220    fn special_fields(&self) -> &::protobuf::SpecialFields {
221        &self.special_fields
222    }
223
224    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
225        &mut self.special_fields
226    }
227
228    fn new() -> ServerControl {
229        ServerControl::new()
230    }
231
232    fn clear(&mut self) {
233        self.header.clear();
234        self.save_world_name.clear();
235        self.save_filename.clear();
236        self.open_filename.clear();
237        self.new_world = false;
238        self.stop = false;
239        self.clone = false;
240        self.new_port = 0;
241        self.special_fields.clear();
242    }
243
244    fn default_instance() -> &'static ServerControl {
245        static instance: ServerControl = ServerControl {
246            header: ::protobuf::MessageField::none(),
247            save_world_name: ::std::string::String::new(),
248            save_filename: ::std::string::String::new(),
249            open_filename: ::std::string::String::new(),
250            new_world: false,
251            stop: false,
252            clone: false,
253            new_port: 0,
254            special_fields: ::protobuf::SpecialFields::new(),
255        };
256        &instance
257    }
258}
259
260impl ::protobuf::MessageFull for ServerControl {
261    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
262        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
263        descriptor.get(|| file_descriptor().message_by_package_relative_name("ServerControl").unwrap()).clone()
264    }
265}
266
267impl ::std::fmt::Display for ServerControl {
268    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
269        ::protobuf::text_format::fmt(self, f)
270    }
271}
272
273impl ::protobuf::reflect::ProtobufValue for ServerControl {
274    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
275}
276
277static file_descriptor_proto_data: &'static [u8] = b"\
278    \n\x1cgz/msgs/server_control.proto\x12\x07gz.msgs\x1a\x14gz/msgs/header.\
279    proto\"\x8c\x02\n\rServerControl\x12'\n\x06header\x18\x01\x20\x01(\x0b2\
280    \x0f.gz.msgs.HeaderR\x06header\x12&\n\x0fsave_world_name\x18\x02\x20\x01\
281    (\tR\rsaveWorldName\x12#\n\rsave_filename\x18\x03\x20\x01(\tR\x0csaveFil\
282    ename\x12#\n\ropen_filename\x18\x04\x20\x01(\tR\x0copenFilename\x12\x1b\
283    \n\tnew_world\x18\x05\x20\x01(\x08R\x08newWorld\x12\x12\n\x04stop\x18\
284    \x06\x20\x01(\x08R\x04stop\x12\x14\n\x05clone\x18\x07\x20\x01(\x08R\x05c\
285    lone\x12\x19\n\x08new_port\x18\x08\x20\x01(\rR\x07newPortB\"\n\x0bcom.gz\
286    .msgsB\x13ServerControlProtosb\x06proto3\
287";
288
289/// `FileDescriptorProto` object which was a source for this generated file
290fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
291    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
292    file_descriptor_proto_lazy.get(|| {
293        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
294    })
295}
296
297/// `FileDescriptor` object which allows dynamic access to files
298pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
299    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
300    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
301    file_descriptor.get(|| {
302        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
303            let mut deps = ::std::vec::Vec::with_capacity(1);
304            deps.push(super::header::file_descriptor().clone());
305            let mut messages = ::std::vec::Vec::with_capacity(1);
306            messages.push(ServerControl::generated_message_descriptor_data());
307            let mut enums = ::std::vec::Vec::with_capacity(0);
308            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
309                file_descriptor_proto(),
310                deps,
311                messages,
312                enums,
313            )
314        });
315        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
316    })
317}