sleep_protocol/
info.rs

1// This file is generated. Do not edit
2// @generated
3
4// https://github.com/Manishearth/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy)]
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
21use protobuf::Message as Message_imported_for_functions;
22use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
23
24#[derive(PartialEq,Clone,Default)]
25pub struct Info {
26    // message fields
27    uploading: ::std::option::Option<bool>,
28    downloading: ::std::option::Option<bool>,
29    // special fields
30    unknown_fields: ::protobuf::UnknownFields,
31    cached_size: ::protobuf::CachedSize,
32}
33
34// see codegen.rs for the explanation why impl Sync explicitly
35unsafe impl ::std::marker::Sync for Info {}
36
37impl Info {
38    pub fn new() -> Info {
39        ::std::default::Default::default()
40    }
41
42    pub fn default_instance() -> &'static Info {
43        static mut instance: ::protobuf::lazy::Lazy<Info> = ::protobuf::lazy::Lazy {
44            lock: ::protobuf::lazy::ONCE_INIT,
45            ptr: 0 as *const Info,
46        };
47        unsafe {
48            instance.get(Info::new)
49        }
50    }
51
52    // optional bool uploading = 1;
53
54    pub fn clear_uploading(&mut self) {
55        self.uploading = ::std::option::Option::None;
56    }
57
58    pub fn has_uploading(&self) -> bool {
59        self.uploading.is_some()
60    }
61
62    // Param is passed by value, moved
63    pub fn set_uploading(&mut self, v: bool) {
64        self.uploading = ::std::option::Option::Some(v);
65    }
66
67    pub fn get_uploading(&self) -> bool {
68        self.uploading.unwrap_or(false)
69    }
70
71    fn get_uploading_for_reflect(&self) -> &::std::option::Option<bool> {
72        &self.uploading
73    }
74
75    fn mut_uploading_for_reflect(&mut self) -> &mut ::std::option::Option<bool> {
76        &mut self.uploading
77    }
78
79    // optional bool downloading = 2;
80
81    pub fn clear_downloading(&mut self) {
82        self.downloading = ::std::option::Option::None;
83    }
84
85    pub fn has_downloading(&self) -> bool {
86        self.downloading.is_some()
87    }
88
89    // Param is passed by value, moved
90    pub fn set_downloading(&mut self, v: bool) {
91        self.downloading = ::std::option::Option::Some(v);
92    }
93
94    pub fn get_downloading(&self) -> bool {
95        self.downloading.unwrap_or(false)
96    }
97
98    fn get_downloading_for_reflect(&self) -> &::std::option::Option<bool> {
99        &self.downloading
100    }
101
102    fn mut_downloading_for_reflect(&mut self) -> &mut ::std::option::Option<bool> {
103        &mut self.downloading
104    }
105}
106
107impl ::protobuf::Message for Info {
108    fn is_initialized(&self) -> bool {
109        true
110    }
111
112    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
113        while !is.eof()? {
114            let (field_number, wire_type) = is.read_tag_unpack()?;
115            match field_number {
116                1 => {
117                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
118                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
119                    }
120                    let tmp = is.read_bool()?;
121                    self.uploading = ::std::option::Option::Some(tmp);
122                },
123                2 => {
124                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
125                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
126                    }
127                    let tmp = is.read_bool()?;
128                    self.downloading = ::std::option::Option::Some(tmp);
129                },
130                _ => {
131                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
132                },
133            };
134        }
135        ::std::result::Result::Ok(())
136    }
137
138    // Compute sizes of nested messages
139    #[allow(unused_variables)]
140    fn compute_size(&self) -> u32 {
141        let mut my_size = 0;
142        if let Some(v) = self.uploading {
143            my_size += 2;
144        }
145        if let Some(v) = self.downloading {
146            my_size += 2;
147        }
148        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
149        self.cached_size.set(my_size);
150        my_size
151    }
152
153    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
154        if let Some(v) = self.uploading {
155            os.write_bool(1, v)?;
156        }
157        if let Some(v) = self.downloading {
158            os.write_bool(2, v)?;
159        }
160        os.write_unknown_fields(self.get_unknown_fields())?;
161        ::std::result::Result::Ok(())
162    }
163
164    fn get_cached_size(&self) -> u32 {
165        self.cached_size.get()
166    }
167
168    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
169        &self.unknown_fields
170    }
171
172    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
173        &mut self.unknown_fields
174    }
175
176    fn as_any(&self) -> &::std::any::Any {
177        self as &::std::any::Any
178    }
179    fn as_any_mut(&mut self) -> &mut ::std::any::Any {
180        self as &mut ::std::any::Any
181    }
182    fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
183        self
184    }
185
186    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
187        ::protobuf::MessageStatic::descriptor_static(None::<Self>)
188    }
189}
190
191impl ::protobuf::MessageStatic for Info {
192    fn new() -> Info {
193        Info::new()
194    }
195
196    fn descriptor_static(_: ::std::option::Option<Info>) -> &'static ::protobuf::reflect::MessageDescriptor {
197        static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
198            lock: ::protobuf::lazy::ONCE_INIT,
199            ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
200        };
201        unsafe {
202            descriptor.get(|| {
203                let mut fields = ::std::vec::Vec::new();
204                fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
205                    "uploading",
206                    Info::get_uploading_for_reflect,
207                    Info::mut_uploading_for_reflect,
208                ));
209                fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
210                    "downloading",
211                    Info::get_downloading_for_reflect,
212                    Info::mut_downloading_for_reflect,
213                ));
214                ::protobuf::reflect::MessageDescriptor::new::<Info>(
215                    "Info",
216                    fields,
217                    file_descriptor_proto()
218                )
219            })
220        }
221    }
222}
223
224impl ::protobuf::Clear for Info {
225    fn clear(&mut self) {
226        self.clear_uploading();
227        self.clear_downloading();
228        self.unknown_fields.clear();
229    }
230}
231
232impl ::std::fmt::Debug for Info {
233    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
234        ::protobuf::text_format::fmt(self, f)
235    }
236}
237
238impl ::protobuf::reflect::ProtobufValue for Info {
239    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
240        ::protobuf::reflect::ProtobufValueRef::Message(self)
241    }
242}
243
244static file_descriptor_proto_data: &'static [u8] = b"\
245    \n\ninfo.proto\"F\n\x04Info\x12\x1c\n\tuploading\x18\x01\x20\x01(\x08R\t\
246    uploading\x12\x20\n\x0bdownloading\x18\x02\x20\x01(\x08R\x0bdownloading\
247";
248
249static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
250    lock: ::protobuf::lazy::ONCE_INIT,
251    ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
252};
253
254fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
255    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
256}
257
258pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
259    unsafe {
260        file_descriptor_proto_lazy.get(|| {
261            parse_descriptor_proto()
262        })
263    }
264}