wasmy_abi/
test.rs

1// This file is generated by rust-protobuf 2.27.1. Do not edit
2// @generated
3
4// https://github.com/rust-lang/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![allow(unused_attributes)]
9#![cfg_attr(rustfmt, rustfmt::skip)]
10
11#![allow(box_pointers)]
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_imports)]
19#![allow(unused_results)]
20//! Generated file from `test.proto`
21
22/// Generated files are compatible only with the same version
23/// of protobuf runtime.
24// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_27_1;
25
26#[derive(PartialEq,Clone,Default)]
27#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
28pub struct TestArgs {
29    // message fields
30    pub a: i32,
31    pub b: i32,
32    // special fields
33    #[cfg_attr(feature = "with-serde", serde(skip))]
34    pub unknown_fields: ::protobuf::UnknownFields,
35    #[cfg_attr(feature = "with-serde", serde(skip))]
36    pub cached_size: ::protobuf::CachedSize,
37}
38
39impl<'a> ::std::default::Default for &'a TestArgs {
40    fn default() -> &'a TestArgs {
41        <TestArgs as ::protobuf::Message>::default_instance()
42    }
43}
44
45impl TestArgs {
46    pub fn new() -> TestArgs {
47        ::std::default::Default::default()
48    }
49
50    // int32 a = 1;
51
52
53    pub fn get_a(&self) -> i32 {
54        self.a
55    }
56    pub fn clear_a(&mut self) {
57        self.a = 0;
58    }
59
60    // Param is passed by value, moved
61    pub fn set_a(&mut self, v: i32) {
62        self.a = v;
63    }
64
65    // int32 b = 2;
66
67
68    pub fn get_b(&self) -> i32 {
69        self.b
70    }
71    pub fn clear_b(&mut self) {
72        self.b = 0;
73    }
74
75    // Param is passed by value, moved
76    pub fn set_b(&mut self, v: i32) {
77        self.b = v;
78    }
79}
80
81impl ::protobuf::Message for TestArgs {
82    fn is_initialized(&self) -> bool {
83        true
84    }
85
86    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
87        while !is.eof()? {
88            let (field_number, wire_type) = is.read_tag_unpack()?;
89            match field_number {
90                1 => {
91                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
92                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
93                    }
94                    let tmp = is.read_int32()?;
95                    self.a = tmp;
96                },
97                2 => {
98                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
99                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
100                    }
101                    let tmp = is.read_int32()?;
102                    self.b = tmp;
103                },
104                _ => {
105                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
106                },
107            };
108        }
109        ::std::result::Result::Ok(())
110    }
111
112    // Compute sizes of nested messages
113    #[allow(unused_variables)]
114    fn compute_size(&self) -> u32 {
115        let mut my_size = 0;
116        if self.a != 0 {
117            my_size += ::protobuf::rt::value_size(1, self.a, ::protobuf::wire_format::WireTypeVarint);
118        }
119        if self.b != 0 {
120            my_size += ::protobuf::rt::value_size(2, self.b, ::protobuf::wire_format::WireTypeVarint);
121        }
122        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
123        self.cached_size.set(my_size);
124        my_size
125    }
126
127    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
128        if self.a != 0 {
129            os.write_int32(1, self.a)?;
130        }
131        if self.b != 0 {
132            os.write_int32(2, self.b)?;
133        }
134        os.write_unknown_fields(self.get_unknown_fields())?;
135        ::std::result::Result::Ok(())
136    }
137
138    fn get_cached_size(&self) -> u32 {
139        self.cached_size.get()
140    }
141
142    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
143        &self.unknown_fields
144    }
145
146    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
147        &mut self.unknown_fields
148    }
149
150    fn as_any(&self) -> &dyn (::std::any::Any) {
151        self as &dyn (::std::any::Any)
152    }
153    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
154        self as &mut dyn (::std::any::Any)
155    }
156    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
157        self
158    }
159
160    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
161        Self::descriptor_static()
162    }
163
164    fn new() -> TestArgs {
165        TestArgs::new()
166    }
167
168    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
169        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
170        descriptor.get(|| {
171            let mut fields = ::std::vec::Vec::new();
172            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
173                "a",
174                |m: &TestArgs| { &m.a },
175                |m: &mut TestArgs| { &mut m.a },
176            ));
177            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
178                "b",
179                |m: &TestArgs| { &m.b },
180                |m: &mut TestArgs| { &mut m.b },
181            ));
182            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TestArgs>(
183                "TestArgs",
184                fields,
185                file_descriptor_proto()
186            )
187        })
188    }
189
190    fn default_instance() -> &'static TestArgs {
191        static instance: ::protobuf::rt::LazyV2<TestArgs> = ::protobuf::rt::LazyV2::INIT;
192        instance.get(TestArgs::new)
193    }
194}
195
196impl ::protobuf::Clear for TestArgs {
197    fn clear(&mut self) {
198        self.a = 0;
199        self.b = 0;
200        self.unknown_fields.clear();
201    }
202}
203
204impl ::std::fmt::Debug for TestArgs {
205    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
206        ::protobuf::text_format::fmt(self, f)
207    }
208}
209
210impl ::protobuf::reflect::ProtobufValue for TestArgs {
211    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
212        ::protobuf::reflect::ReflectValueRef::Message(self)
213    }
214}
215
216#[derive(PartialEq,Clone,Default)]
217#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
218pub struct TestRets {
219    // message fields
220    pub c: i32,
221    // special fields
222    #[cfg_attr(feature = "with-serde", serde(skip))]
223    pub unknown_fields: ::protobuf::UnknownFields,
224    #[cfg_attr(feature = "with-serde", serde(skip))]
225    pub cached_size: ::protobuf::CachedSize,
226}
227
228impl<'a> ::std::default::Default for &'a TestRets {
229    fn default() -> &'a TestRets {
230        <TestRets as ::protobuf::Message>::default_instance()
231    }
232}
233
234impl TestRets {
235    pub fn new() -> TestRets {
236        ::std::default::Default::default()
237    }
238
239    // int32 c = 1;
240
241
242    pub fn get_c(&self) -> i32 {
243        self.c
244    }
245    pub fn clear_c(&mut self) {
246        self.c = 0;
247    }
248
249    // Param is passed by value, moved
250    pub fn set_c(&mut self, v: i32) {
251        self.c = v;
252    }
253}
254
255impl ::protobuf::Message for TestRets {
256    fn is_initialized(&self) -> bool {
257        true
258    }
259
260    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
261        while !is.eof()? {
262            let (field_number, wire_type) = is.read_tag_unpack()?;
263            match field_number {
264                1 => {
265                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
266                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
267                    }
268                    let tmp = is.read_int32()?;
269                    self.c = tmp;
270                },
271                _ => {
272                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
273                },
274            };
275        }
276        ::std::result::Result::Ok(())
277    }
278
279    // Compute sizes of nested messages
280    #[allow(unused_variables)]
281    fn compute_size(&self) -> u32 {
282        let mut my_size = 0;
283        if self.c != 0 {
284            my_size += ::protobuf::rt::value_size(1, self.c, ::protobuf::wire_format::WireTypeVarint);
285        }
286        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
287        self.cached_size.set(my_size);
288        my_size
289    }
290
291    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
292        if self.c != 0 {
293            os.write_int32(1, self.c)?;
294        }
295        os.write_unknown_fields(self.get_unknown_fields())?;
296        ::std::result::Result::Ok(())
297    }
298
299    fn get_cached_size(&self) -> u32 {
300        self.cached_size.get()
301    }
302
303    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
304        &self.unknown_fields
305    }
306
307    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
308        &mut self.unknown_fields
309    }
310
311    fn as_any(&self) -> &dyn (::std::any::Any) {
312        self as &dyn (::std::any::Any)
313    }
314    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
315        self as &mut dyn (::std::any::Any)
316    }
317    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
318        self
319    }
320
321    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
322        Self::descriptor_static()
323    }
324
325    fn new() -> TestRets {
326        TestRets::new()
327    }
328
329    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
330        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
331        descriptor.get(|| {
332            let mut fields = ::std::vec::Vec::new();
333            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
334                "c",
335                |m: &TestRets| { &m.c },
336                |m: &mut TestRets| { &mut m.c },
337            ));
338            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TestRets>(
339                "TestRets",
340                fields,
341                file_descriptor_proto()
342            )
343        })
344    }
345
346    fn default_instance() -> &'static TestRets {
347        static instance: ::protobuf::rt::LazyV2<TestRets> = ::protobuf::rt::LazyV2::INIT;
348        instance.get(TestRets::new)
349    }
350}
351
352impl ::protobuf::Clear for TestRets {
353    fn clear(&mut self) {
354        self.c = 0;
355        self.unknown_fields.clear();
356    }
357}
358
359impl ::std::fmt::Debug for TestRets {
360    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
361        ::protobuf::text_format::fmt(self, f)
362    }
363}
364
365impl ::protobuf::reflect::ProtobufValue for TestRets {
366    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
367        ::protobuf::reflect::ReflectValueRef::Message(self)
368    }
369}
370
371#[derive(PartialEq,Clone,Default)]
372#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
373pub struct TestCtxValue {
374    // message fields
375    pub value: ::std::string::String,
376    // special fields
377    #[cfg_attr(feature = "with-serde", serde(skip))]
378    pub unknown_fields: ::protobuf::UnknownFields,
379    #[cfg_attr(feature = "with-serde", serde(skip))]
380    pub cached_size: ::protobuf::CachedSize,
381}
382
383impl<'a> ::std::default::Default for &'a TestCtxValue {
384    fn default() -> &'a TestCtxValue {
385        <TestCtxValue as ::protobuf::Message>::default_instance()
386    }
387}
388
389impl TestCtxValue {
390    pub fn new() -> TestCtxValue {
391        ::std::default::Default::default()
392    }
393
394    // string value = 1;
395
396
397    pub fn get_value(&self) -> &str {
398        &self.value
399    }
400    pub fn clear_value(&mut self) {
401        self.value.clear();
402    }
403
404    // Param is passed by value, moved
405    pub fn set_value(&mut self, v: ::std::string::String) {
406        self.value = v;
407    }
408
409    // Mutable pointer to the field.
410    // If field is not initialized, it is initialized with default value first.
411    pub fn mut_value(&mut self) -> &mut ::std::string::String {
412        &mut self.value
413    }
414
415    // Take field
416    pub fn take_value(&mut self) -> ::std::string::String {
417        ::std::mem::replace(&mut self.value, ::std::string::String::new())
418    }
419}
420
421impl ::protobuf::Message for TestCtxValue {
422    fn is_initialized(&self) -> bool {
423        true
424    }
425
426    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
427        while !is.eof()? {
428            let (field_number, wire_type) = is.read_tag_unpack()?;
429            match field_number {
430                1 => {
431                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
432                },
433                _ => {
434                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
435                },
436            };
437        }
438        ::std::result::Result::Ok(())
439    }
440
441    // Compute sizes of nested messages
442    #[allow(unused_variables)]
443    fn compute_size(&self) -> u32 {
444        let mut my_size = 0;
445        if !self.value.is_empty() {
446            my_size += ::protobuf::rt::string_size(1, &self.value);
447        }
448        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
449        self.cached_size.set(my_size);
450        my_size
451    }
452
453    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
454        if !self.value.is_empty() {
455            os.write_string(1, &self.value)?;
456        }
457        os.write_unknown_fields(self.get_unknown_fields())?;
458        ::std::result::Result::Ok(())
459    }
460
461    fn get_cached_size(&self) -> u32 {
462        self.cached_size.get()
463    }
464
465    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
466        &self.unknown_fields
467    }
468
469    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
470        &mut self.unknown_fields
471    }
472
473    fn as_any(&self) -> &dyn (::std::any::Any) {
474        self as &dyn (::std::any::Any)
475    }
476    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
477        self as &mut dyn (::std::any::Any)
478    }
479    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
480        self
481    }
482
483    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
484        Self::descriptor_static()
485    }
486
487    fn new() -> TestCtxValue {
488        TestCtxValue::new()
489    }
490
491    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
492        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
493        descriptor.get(|| {
494            let mut fields = ::std::vec::Vec::new();
495            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
496                "value",
497                |m: &TestCtxValue| { &m.value },
498                |m: &mut TestCtxValue| { &mut m.value },
499            ));
500            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TestCtxValue>(
501                "TestCtxValue",
502                fields,
503                file_descriptor_proto()
504            )
505        })
506    }
507
508    fn default_instance() -> &'static TestCtxValue {
509        static instance: ::protobuf::rt::LazyV2<TestCtxValue> = ::protobuf::rt::LazyV2::INIT;
510        instance.get(TestCtxValue::new)
511    }
512}
513
514impl ::protobuf::Clear for TestCtxValue {
515    fn clear(&mut self) {
516        self.value.clear();
517        self.unknown_fields.clear();
518    }
519}
520
521impl ::std::fmt::Debug for TestCtxValue {
522    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
523        ::protobuf::text_format::fmt(self, f)
524    }
525}
526
527impl ::protobuf::reflect::ProtobufValue for TestCtxValue {
528    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
529        ::protobuf::reflect::ReflectValueRef::Message(self)
530    }
531}
532
533static file_descriptor_proto_data: &'static [u8] = b"\
534    \n\ntest.proto\x12\x04test\"&\n\x08TestArgs\x12\x0c\n\x01a\x18\x01\x20\
535    \x01(\x05R\x01a\x12\x0c\n\x01b\x18\x02\x20\x01(\x05R\x01b\"\x18\n\x08Tes\
536    tRets\x12\x0c\n\x01c\x18\x01\x20\x01(\x05R\x01c\"$\n\x0cTestCtxValue\x12\
537    \x14\n\x05value\x18\x01\x20\x01(\tR\x05valueb\x06proto3\
538";
539
540static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
541
542fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
543    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
544}
545
546pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
547    file_descriptor_proto_lazy.get(|| {
548        parse_descriptor_proto()
549    })
550}