fidl_fuchsia_examples_calculator__common/
fidl_fuchsia_examples_calculator__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
12pub struct CalculatorAddRequest {
13    pub a: f64,
14    pub b: f64,
15}
16
17impl fidl::Persistable for CalculatorAddRequest {}
18
19#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
20pub struct CalculatorAddResponse {
21    pub sum: f64,
22}
23
24impl fidl::Persistable for CalculatorAddResponse {}
25
26#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
27pub struct CalculatorDivideRequest {
28    pub dividend: f64,
29    pub divisor: f64,
30}
31
32impl fidl::Persistable for CalculatorDivideRequest {}
33
34#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
35pub struct CalculatorDivideResponse {
36    pub quotient: f64,
37}
38
39impl fidl::Persistable for CalculatorDivideResponse {}
40
41#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
42pub struct CalculatorMultiplyRequest {
43    pub a: f64,
44    pub b: f64,
45}
46
47impl fidl::Persistable for CalculatorMultiplyRequest {}
48
49#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
50pub struct CalculatorMultiplyResponse {
51    pub product: f64,
52}
53
54impl fidl::Persistable for CalculatorMultiplyResponse {}
55
56#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
57pub struct CalculatorPowRequest {
58    pub base: f64,
59    pub exponent: f64,
60}
61
62impl fidl::Persistable for CalculatorPowRequest {}
63
64#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
65pub struct CalculatorPowResponse {
66    pub power: f64,
67}
68
69impl fidl::Persistable for CalculatorPowResponse {}
70
71#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
72pub struct CalculatorSubtractRequest {
73    pub a: f64,
74    pub b: f64,
75}
76
77impl fidl::Persistable for CalculatorSubtractRequest {}
78
79#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
80pub struct CalculatorSubtractResponse {
81    pub difference: f64,
82}
83
84impl fidl::Persistable for CalculatorSubtractResponse {}
85
86pub mod calculator_ordinals {
87    pub const ADD: u64 = 0x5f2286171d9ff91e;
88    pub const SUBTRACT: u64 = 0x64ce8ff043420d78;
89    pub const MULTIPLY: u64 = 0x4d6fedd51609fc35;
90    pub const DIVIDE: u64 = 0x4dc343d7222988ba;
91    pub const POW: u64 = 0x3467780dee7ba196;
92}
93
94mod internal {
95    use super::*;
96
97    impl fidl::encoding::ValueTypeMarker for CalculatorAddRequest {
98        type Borrowed<'a> = &'a Self;
99        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
100            value
101        }
102    }
103
104    unsafe impl fidl::encoding::TypeMarker for CalculatorAddRequest {
105        type Owned = Self;
106
107        #[inline(always)]
108        fn inline_align(_context: fidl::encoding::Context) -> usize {
109            8
110        }
111
112        #[inline(always)]
113        fn inline_size(_context: fidl::encoding::Context) -> usize {
114            16
115        }
116    }
117
118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalculatorAddRequest, D>
119        for &CalculatorAddRequest
120    {
121        #[inline]
122        unsafe fn encode(
123            self,
124            encoder: &mut fidl::encoding::Encoder<'_, D>,
125            offset: usize,
126            _depth: fidl::encoding::Depth,
127        ) -> fidl::Result<()> {
128            encoder.debug_check_bounds::<CalculatorAddRequest>(offset);
129            // Delegate to tuple encoding.
130            fidl::encoding::Encode::<CalculatorAddRequest, D>::encode(
131                (
132                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.a),
133                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.b),
134                ),
135                encoder,
136                offset,
137                _depth,
138            )
139        }
140    }
141    unsafe impl<
142            D: fidl::encoding::ResourceDialect,
143            T0: fidl::encoding::Encode<f64, D>,
144            T1: fidl::encoding::Encode<f64, D>,
145        > fidl::encoding::Encode<CalculatorAddRequest, D> for (T0, T1)
146    {
147        #[inline]
148        unsafe fn encode(
149            self,
150            encoder: &mut fidl::encoding::Encoder<'_, D>,
151            offset: usize,
152            depth: fidl::encoding::Depth,
153        ) -> fidl::Result<()> {
154            encoder.debug_check_bounds::<CalculatorAddRequest>(offset);
155            // Zero out padding regions. There's no need to apply masks
156            // because the unmasked parts will be overwritten by fields.
157            // Write the fields.
158            self.0.encode(encoder, offset + 0, depth)?;
159            self.1.encode(encoder, offset + 8, depth)?;
160            Ok(())
161        }
162    }
163
164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalculatorAddRequest {
165        #[inline(always)]
166        fn new_empty() -> Self {
167            Self { a: fidl::new_empty!(f64, D), b: fidl::new_empty!(f64, D) }
168        }
169
170        #[inline]
171        unsafe fn decode(
172            &mut self,
173            decoder: &mut fidl::encoding::Decoder<'_, D>,
174            offset: usize,
175            _depth: fidl::encoding::Depth,
176        ) -> fidl::Result<()> {
177            decoder.debug_check_bounds::<Self>(offset);
178            // Verify that padding bytes are zero.
179            fidl::decode!(f64, D, &mut self.a, decoder, offset + 0, _depth)?;
180            fidl::decode!(f64, D, &mut self.b, decoder, offset + 8, _depth)?;
181            Ok(())
182        }
183    }
184
185    impl fidl::encoding::ValueTypeMarker for CalculatorAddResponse {
186        type Borrowed<'a> = &'a Self;
187        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
188            value
189        }
190    }
191
192    unsafe impl fidl::encoding::TypeMarker for CalculatorAddResponse {
193        type Owned = Self;
194
195        #[inline(always)]
196        fn inline_align(_context: fidl::encoding::Context) -> usize {
197            8
198        }
199
200        #[inline(always)]
201        fn inline_size(_context: fidl::encoding::Context) -> usize {
202            8
203        }
204    }
205
206    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalculatorAddResponse, D>
207        for &CalculatorAddResponse
208    {
209        #[inline]
210        unsafe fn encode(
211            self,
212            encoder: &mut fidl::encoding::Encoder<'_, D>,
213            offset: usize,
214            _depth: fidl::encoding::Depth,
215        ) -> fidl::Result<()> {
216            encoder.debug_check_bounds::<CalculatorAddResponse>(offset);
217            // Delegate to tuple encoding.
218            fidl::encoding::Encode::<CalculatorAddResponse, D>::encode(
219                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.sum),),
220                encoder,
221                offset,
222                _depth,
223            )
224        }
225    }
226    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
227        fidl::encoding::Encode<CalculatorAddResponse, D> for (T0,)
228    {
229        #[inline]
230        unsafe fn encode(
231            self,
232            encoder: &mut fidl::encoding::Encoder<'_, D>,
233            offset: usize,
234            depth: fidl::encoding::Depth,
235        ) -> fidl::Result<()> {
236            encoder.debug_check_bounds::<CalculatorAddResponse>(offset);
237            // Zero out padding regions. There's no need to apply masks
238            // because the unmasked parts will be overwritten by fields.
239            // Write the fields.
240            self.0.encode(encoder, offset + 0, depth)?;
241            Ok(())
242        }
243    }
244
245    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalculatorAddResponse {
246        #[inline(always)]
247        fn new_empty() -> Self {
248            Self { sum: fidl::new_empty!(f64, D) }
249        }
250
251        #[inline]
252        unsafe fn decode(
253            &mut self,
254            decoder: &mut fidl::encoding::Decoder<'_, D>,
255            offset: usize,
256            _depth: fidl::encoding::Depth,
257        ) -> fidl::Result<()> {
258            decoder.debug_check_bounds::<Self>(offset);
259            // Verify that padding bytes are zero.
260            fidl::decode!(f64, D, &mut self.sum, decoder, offset + 0, _depth)?;
261            Ok(())
262        }
263    }
264
265    impl fidl::encoding::ValueTypeMarker for CalculatorDivideRequest {
266        type Borrowed<'a> = &'a Self;
267        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
268            value
269        }
270    }
271
272    unsafe impl fidl::encoding::TypeMarker for CalculatorDivideRequest {
273        type Owned = Self;
274
275        #[inline(always)]
276        fn inline_align(_context: fidl::encoding::Context) -> usize {
277            8
278        }
279
280        #[inline(always)]
281        fn inline_size(_context: fidl::encoding::Context) -> usize {
282            16
283        }
284    }
285
286    unsafe impl<D: fidl::encoding::ResourceDialect>
287        fidl::encoding::Encode<CalculatorDivideRequest, D> for &CalculatorDivideRequest
288    {
289        #[inline]
290        unsafe fn encode(
291            self,
292            encoder: &mut fidl::encoding::Encoder<'_, D>,
293            offset: usize,
294            _depth: fidl::encoding::Depth,
295        ) -> fidl::Result<()> {
296            encoder.debug_check_bounds::<CalculatorDivideRequest>(offset);
297            // Delegate to tuple encoding.
298            fidl::encoding::Encode::<CalculatorDivideRequest, D>::encode(
299                (
300                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.dividend),
301                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.divisor),
302                ),
303                encoder,
304                offset,
305                _depth,
306            )
307        }
308    }
309    unsafe impl<
310            D: fidl::encoding::ResourceDialect,
311            T0: fidl::encoding::Encode<f64, D>,
312            T1: fidl::encoding::Encode<f64, D>,
313        > fidl::encoding::Encode<CalculatorDivideRequest, D> for (T0, T1)
314    {
315        #[inline]
316        unsafe fn encode(
317            self,
318            encoder: &mut fidl::encoding::Encoder<'_, D>,
319            offset: usize,
320            depth: fidl::encoding::Depth,
321        ) -> fidl::Result<()> {
322            encoder.debug_check_bounds::<CalculatorDivideRequest>(offset);
323            // Zero out padding regions. There's no need to apply masks
324            // because the unmasked parts will be overwritten by fields.
325            // Write the fields.
326            self.0.encode(encoder, offset + 0, depth)?;
327            self.1.encode(encoder, offset + 8, depth)?;
328            Ok(())
329        }
330    }
331
332    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
333        for CalculatorDivideRequest
334    {
335        #[inline(always)]
336        fn new_empty() -> Self {
337            Self { dividend: fidl::new_empty!(f64, D), divisor: fidl::new_empty!(f64, D) }
338        }
339
340        #[inline]
341        unsafe fn decode(
342            &mut self,
343            decoder: &mut fidl::encoding::Decoder<'_, D>,
344            offset: usize,
345            _depth: fidl::encoding::Depth,
346        ) -> fidl::Result<()> {
347            decoder.debug_check_bounds::<Self>(offset);
348            // Verify that padding bytes are zero.
349            fidl::decode!(f64, D, &mut self.dividend, decoder, offset + 0, _depth)?;
350            fidl::decode!(f64, D, &mut self.divisor, decoder, offset + 8, _depth)?;
351            Ok(())
352        }
353    }
354
355    impl fidl::encoding::ValueTypeMarker for CalculatorDivideResponse {
356        type Borrowed<'a> = &'a Self;
357        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
358            value
359        }
360    }
361
362    unsafe impl fidl::encoding::TypeMarker for CalculatorDivideResponse {
363        type Owned = Self;
364
365        #[inline(always)]
366        fn inline_align(_context: fidl::encoding::Context) -> usize {
367            8
368        }
369
370        #[inline(always)]
371        fn inline_size(_context: fidl::encoding::Context) -> usize {
372            8
373        }
374    }
375
376    unsafe impl<D: fidl::encoding::ResourceDialect>
377        fidl::encoding::Encode<CalculatorDivideResponse, D> for &CalculatorDivideResponse
378    {
379        #[inline]
380        unsafe fn encode(
381            self,
382            encoder: &mut fidl::encoding::Encoder<'_, D>,
383            offset: usize,
384            _depth: fidl::encoding::Depth,
385        ) -> fidl::Result<()> {
386            encoder.debug_check_bounds::<CalculatorDivideResponse>(offset);
387            // Delegate to tuple encoding.
388            fidl::encoding::Encode::<CalculatorDivideResponse, D>::encode(
389                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.quotient),),
390                encoder,
391                offset,
392                _depth,
393            )
394        }
395    }
396    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
397        fidl::encoding::Encode<CalculatorDivideResponse, D> for (T0,)
398    {
399        #[inline]
400        unsafe fn encode(
401            self,
402            encoder: &mut fidl::encoding::Encoder<'_, D>,
403            offset: usize,
404            depth: fidl::encoding::Depth,
405        ) -> fidl::Result<()> {
406            encoder.debug_check_bounds::<CalculatorDivideResponse>(offset);
407            // Zero out padding regions. There's no need to apply masks
408            // because the unmasked parts will be overwritten by fields.
409            // Write the fields.
410            self.0.encode(encoder, offset + 0, depth)?;
411            Ok(())
412        }
413    }
414
415    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
416        for CalculatorDivideResponse
417    {
418        #[inline(always)]
419        fn new_empty() -> Self {
420            Self { quotient: fidl::new_empty!(f64, D) }
421        }
422
423        #[inline]
424        unsafe fn decode(
425            &mut self,
426            decoder: &mut fidl::encoding::Decoder<'_, D>,
427            offset: usize,
428            _depth: fidl::encoding::Depth,
429        ) -> fidl::Result<()> {
430            decoder.debug_check_bounds::<Self>(offset);
431            // Verify that padding bytes are zero.
432            fidl::decode!(f64, D, &mut self.quotient, decoder, offset + 0, _depth)?;
433            Ok(())
434        }
435    }
436
437    impl fidl::encoding::ValueTypeMarker for CalculatorMultiplyRequest {
438        type Borrowed<'a> = &'a Self;
439        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
440            value
441        }
442    }
443
444    unsafe impl fidl::encoding::TypeMarker for CalculatorMultiplyRequest {
445        type Owned = Self;
446
447        #[inline(always)]
448        fn inline_align(_context: fidl::encoding::Context) -> usize {
449            8
450        }
451
452        #[inline(always)]
453        fn inline_size(_context: fidl::encoding::Context) -> usize {
454            16
455        }
456    }
457
458    unsafe impl<D: fidl::encoding::ResourceDialect>
459        fidl::encoding::Encode<CalculatorMultiplyRequest, D> for &CalculatorMultiplyRequest
460    {
461        #[inline]
462        unsafe fn encode(
463            self,
464            encoder: &mut fidl::encoding::Encoder<'_, D>,
465            offset: usize,
466            _depth: fidl::encoding::Depth,
467        ) -> fidl::Result<()> {
468            encoder.debug_check_bounds::<CalculatorMultiplyRequest>(offset);
469            // Delegate to tuple encoding.
470            fidl::encoding::Encode::<CalculatorMultiplyRequest, D>::encode(
471                (
472                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.a),
473                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.b),
474                ),
475                encoder,
476                offset,
477                _depth,
478            )
479        }
480    }
481    unsafe impl<
482            D: fidl::encoding::ResourceDialect,
483            T0: fidl::encoding::Encode<f64, D>,
484            T1: fidl::encoding::Encode<f64, D>,
485        > fidl::encoding::Encode<CalculatorMultiplyRequest, D> for (T0, T1)
486    {
487        #[inline]
488        unsafe fn encode(
489            self,
490            encoder: &mut fidl::encoding::Encoder<'_, D>,
491            offset: usize,
492            depth: fidl::encoding::Depth,
493        ) -> fidl::Result<()> {
494            encoder.debug_check_bounds::<CalculatorMultiplyRequest>(offset);
495            // Zero out padding regions. There's no need to apply masks
496            // because the unmasked parts will be overwritten by fields.
497            // Write the fields.
498            self.0.encode(encoder, offset + 0, depth)?;
499            self.1.encode(encoder, offset + 8, depth)?;
500            Ok(())
501        }
502    }
503
504    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
505        for CalculatorMultiplyRequest
506    {
507        #[inline(always)]
508        fn new_empty() -> Self {
509            Self { a: fidl::new_empty!(f64, D), b: fidl::new_empty!(f64, D) }
510        }
511
512        #[inline]
513        unsafe fn decode(
514            &mut self,
515            decoder: &mut fidl::encoding::Decoder<'_, D>,
516            offset: usize,
517            _depth: fidl::encoding::Depth,
518        ) -> fidl::Result<()> {
519            decoder.debug_check_bounds::<Self>(offset);
520            // Verify that padding bytes are zero.
521            fidl::decode!(f64, D, &mut self.a, decoder, offset + 0, _depth)?;
522            fidl::decode!(f64, D, &mut self.b, decoder, offset + 8, _depth)?;
523            Ok(())
524        }
525    }
526
527    impl fidl::encoding::ValueTypeMarker for CalculatorMultiplyResponse {
528        type Borrowed<'a> = &'a Self;
529        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
530            value
531        }
532    }
533
534    unsafe impl fidl::encoding::TypeMarker for CalculatorMultiplyResponse {
535        type Owned = Self;
536
537        #[inline(always)]
538        fn inline_align(_context: fidl::encoding::Context) -> usize {
539            8
540        }
541
542        #[inline(always)]
543        fn inline_size(_context: fidl::encoding::Context) -> usize {
544            8
545        }
546    }
547
548    unsafe impl<D: fidl::encoding::ResourceDialect>
549        fidl::encoding::Encode<CalculatorMultiplyResponse, D> for &CalculatorMultiplyResponse
550    {
551        #[inline]
552        unsafe fn encode(
553            self,
554            encoder: &mut fidl::encoding::Encoder<'_, D>,
555            offset: usize,
556            _depth: fidl::encoding::Depth,
557        ) -> fidl::Result<()> {
558            encoder.debug_check_bounds::<CalculatorMultiplyResponse>(offset);
559            // Delegate to tuple encoding.
560            fidl::encoding::Encode::<CalculatorMultiplyResponse, D>::encode(
561                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.product),),
562                encoder,
563                offset,
564                _depth,
565            )
566        }
567    }
568    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
569        fidl::encoding::Encode<CalculatorMultiplyResponse, D> for (T0,)
570    {
571        #[inline]
572        unsafe fn encode(
573            self,
574            encoder: &mut fidl::encoding::Encoder<'_, D>,
575            offset: usize,
576            depth: fidl::encoding::Depth,
577        ) -> fidl::Result<()> {
578            encoder.debug_check_bounds::<CalculatorMultiplyResponse>(offset);
579            // Zero out padding regions. There's no need to apply masks
580            // because the unmasked parts will be overwritten by fields.
581            // Write the fields.
582            self.0.encode(encoder, offset + 0, depth)?;
583            Ok(())
584        }
585    }
586
587    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
588        for CalculatorMultiplyResponse
589    {
590        #[inline(always)]
591        fn new_empty() -> Self {
592            Self { product: fidl::new_empty!(f64, D) }
593        }
594
595        #[inline]
596        unsafe fn decode(
597            &mut self,
598            decoder: &mut fidl::encoding::Decoder<'_, D>,
599            offset: usize,
600            _depth: fidl::encoding::Depth,
601        ) -> fidl::Result<()> {
602            decoder.debug_check_bounds::<Self>(offset);
603            // Verify that padding bytes are zero.
604            fidl::decode!(f64, D, &mut self.product, decoder, offset + 0, _depth)?;
605            Ok(())
606        }
607    }
608
609    impl fidl::encoding::ValueTypeMarker for CalculatorPowRequest {
610        type Borrowed<'a> = &'a Self;
611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
612            value
613        }
614    }
615
616    unsafe impl fidl::encoding::TypeMarker for CalculatorPowRequest {
617        type Owned = Self;
618
619        #[inline(always)]
620        fn inline_align(_context: fidl::encoding::Context) -> usize {
621            8
622        }
623
624        #[inline(always)]
625        fn inline_size(_context: fidl::encoding::Context) -> usize {
626            16
627        }
628    }
629
630    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalculatorPowRequest, D>
631        for &CalculatorPowRequest
632    {
633        #[inline]
634        unsafe fn encode(
635            self,
636            encoder: &mut fidl::encoding::Encoder<'_, D>,
637            offset: usize,
638            _depth: fidl::encoding::Depth,
639        ) -> fidl::Result<()> {
640            encoder.debug_check_bounds::<CalculatorPowRequest>(offset);
641            // Delegate to tuple encoding.
642            fidl::encoding::Encode::<CalculatorPowRequest, D>::encode(
643                (
644                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.base),
645                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.exponent),
646                ),
647                encoder,
648                offset,
649                _depth,
650            )
651        }
652    }
653    unsafe impl<
654            D: fidl::encoding::ResourceDialect,
655            T0: fidl::encoding::Encode<f64, D>,
656            T1: fidl::encoding::Encode<f64, D>,
657        > fidl::encoding::Encode<CalculatorPowRequest, D> for (T0, T1)
658    {
659        #[inline]
660        unsafe fn encode(
661            self,
662            encoder: &mut fidl::encoding::Encoder<'_, D>,
663            offset: usize,
664            depth: fidl::encoding::Depth,
665        ) -> fidl::Result<()> {
666            encoder.debug_check_bounds::<CalculatorPowRequest>(offset);
667            // Zero out padding regions. There's no need to apply masks
668            // because the unmasked parts will be overwritten by fields.
669            // Write the fields.
670            self.0.encode(encoder, offset + 0, depth)?;
671            self.1.encode(encoder, offset + 8, depth)?;
672            Ok(())
673        }
674    }
675
676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalculatorPowRequest {
677        #[inline(always)]
678        fn new_empty() -> Self {
679            Self { base: fidl::new_empty!(f64, D), exponent: fidl::new_empty!(f64, D) }
680        }
681
682        #[inline]
683        unsafe fn decode(
684            &mut self,
685            decoder: &mut fidl::encoding::Decoder<'_, D>,
686            offset: usize,
687            _depth: fidl::encoding::Depth,
688        ) -> fidl::Result<()> {
689            decoder.debug_check_bounds::<Self>(offset);
690            // Verify that padding bytes are zero.
691            fidl::decode!(f64, D, &mut self.base, decoder, offset + 0, _depth)?;
692            fidl::decode!(f64, D, &mut self.exponent, decoder, offset + 8, _depth)?;
693            Ok(())
694        }
695    }
696
697    impl fidl::encoding::ValueTypeMarker for CalculatorPowResponse {
698        type Borrowed<'a> = &'a Self;
699        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
700            value
701        }
702    }
703
704    unsafe impl fidl::encoding::TypeMarker for CalculatorPowResponse {
705        type Owned = Self;
706
707        #[inline(always)]
708        fn inline_align(_context: fidl::encoding::Context) -> usize {
709            8
710        }
711
712        #[inline(always)]
713        fn inline_size(_context: fidl::encoding::Context) -> usize {
714            8
715        }
716    }
717
718    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalculatorPowResponse, D>
719        for &CalculatorPowResponse
720    {
721        #[inline]
722        unsafe fn encode(
723            self,
724            encoder: &mut fidl::encoding::Encoder<'_, D>,
725            offset: usize,
726            _depth: fidl::encoding::Depth,
727        ) -> fidl::Result<()> {
728            encoder.debug_check_bounds::<CalculatorPowResponse>(offset);
729            // Delegate to tuple encoding.
730            fidl::encoding::Encode::<CalculatorPowResponse, D>::encode(
731                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.power),),
732                encoder,
733                offset,
734                _depth,
735            )
736        }
737    }
738    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
739        fidl::encoding::Encode<CalculatorPowResponse, D> for (T0,)
740    {
741        #[inline]
742        unsafe fn encode(
743            self,
744            encoder: &mut fidl::encoding::Encoder<'_, D>,
745            offset: usize,
746            depth: fidl::encoding::Depth,
747        ) -> fidl::Result<()> {
748            encoder.debug_check_bounds::<CalculatorPowResponse>(offset);
749            // Zero out padding regions. There's no need to apply masks
750            // because the unmasked parts will be overwritten by fields.
751            // Write the fields.
752            self.0.encode(encoder, offset + 0, depth)?;
753            Ok(())
754        }
755    }
756
757    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalculatorPowResponse {
758        #[inline(always)]
759        fn new_empty() -> Self {
760            Self { power: fidl::new_empty!(f64, D) }
761        }
762
763        #[inline]
764        unsafe fn decode(
765            &mut self,
766            decoder: &mut fidl::encoding::Decoder<'_, D>,
767            offset: usize,
768            _depth: fidl::encoding::Depth,
769        ) -> fidl::Result<()> {
770            decoder.debug_check_bounds::<Self>(offset);
771            // Verify that padding bytes are zero.
772            fidl::decode!(f64, D, &mut self.power, decoder, offset + 0, _depth)?;
773            Ok(())
774        }
775    }
776
777    impl fidl::encoding::ValueTypeMarker for CalculatorSubtractRequest {
778        type Borrowed<'a> = &'a Self;
779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
780            value
781        }
782    }
783
784    unsafe impl fidl::encoding::TypeMarker for CalculatorSubtractRequest {
785        type Owned = Self;
786
787        #[inline(always)]
788        fn inline_align(_context: fidl::encoding::Context) -> usize {
789            8
790        }
791
792        #[inline(always)]
793        fn inline_size(_context: fidl::encoding::Context) -> usize {
794            16
795        }
796    }
797
798    unsafe impl<D: fidl::encoding::ResourceDialect>
799        fidl::encoding::Encode<CalculatorSubtractRequest, D> for &CalculatorSubtractRequest
800    {
801        #[inline]
802        unsafe fn encode(
803            self,
804            encoder: &mut fidl::encoding::Encoder<'_, D>,
805            offset: usize,
806            _depth: fidl::encoding::Depth,
807        ) -> fidl::Result<()> {
808            encoder.debug_check_bounds::<CalculatorSubtractRequest>(offset);
809            // Delegate to tuple encoding.
810            fidl::encoding::Encode::<CalculatorSubtractRequest, D>::encode(
811                (
812                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.a),
813                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.b),
814                ),
815                encoder,
816                offset,
817                _depth,
818            )
819        }
820    }
821    unsafe impl<
822            D: fidl::encoding::ResourceDialect,
823            T0: fidl::encoding::Encode<f64, D>,
824            T1: fidl::encoding::Encode<f64, D>,
825        > fidl::encoding::Encode<CalculatorSubtractRequest, D> for (T0, T1)
826    {
827        #[inline]
828        unsafe fn encode(
829            self,
830            encoder: &mut fidl::encoding::Encoder<'_, D>,
831            offset: usize,
832            depth: fidl::encoding::Depth,
833        ) -> fidl::Result<()> {
834            encoder.debug_check_bounds::<CalculatorSubtractRequest>(offset);
835            // Zero out padding regions. There's no need to apply masks
836            // because the unmasked parts will be overwritten by fields.
837            // Write the fields.
838            self.0.encode(encoder, offset + 0, depth)?;
839            self.1.encode(encoder, offset + 8, depth)?;
840            Ok(())
841        }
842    }
843
844    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
845        for CalculatorSubtractRequest
846    {
847        #[inline(always)]
848        fn new_empty() -> Self {
849            Self { a: fidl::new_empty!(f64, D), b: fidl::new_empty!(f64, D) }
850        }
851
852        #[inline]
853        unsafe fn decode(
854            &mut self,
855            decoder: &mut fidl::encoding::Decoder<'_, D>,
856            offset: usize,
857            _depth: fidl::encoding::Depth,
858        ) -> fidl::Result<()> {
859            decoder.debug_check_bounds::<Self>(offset);
860            // Verify that padding bytes are zero.
861            fidl::decode!(f64, D, &mut self.a, decoder, offset + 0, _depth)?;
862            fidl::decode!(f64, D, &mut self.b, decoder, offset + 8, _depth)?;
863            Ok(())
864        }
865    }
866
867    impl fidl::encoding::ValueTypeMarker for CalculatorSubtractResponse {
868        type Borrowed<'a> = &'a Self;
869        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
870            value
871        }
872    }
873
874    unsafe impl fidl::encoding::TypeMarker for CalculatorSubtractResponse {
875        type Owned = Self;
876
877        #[inline(always)]
878        fn inline_align(_context: fidl::encoding::Context) -> usize {
879            8
880        }
881
882        #[inline(always)]
883        fn inline_size(_context: fidl::encoding::Context) -> usize {
884            8
885        }
886    }
887
888    unsafe impl<D: fidl::encoding::ResourceDialect>
889        fidl::encoding::Encode<CalculatorSubtractResponse, D> for &CalculatorSubtractResponse
890    {
891        #[inline]
892        unsafe fn encode(
893            self,
894            encoder: &mut fidl::encoding::Encoder<'_, D>,
895            offset: usize,
896            _depth: fidl::encoding::Depth,
897        ) -> fidl::Result<()> {
898            encoder.debug_check_bounds::<CalculatorSubtractResponse>(offset);
899            // Delegate to tuple encoding.
900            fidl::encoding::Encode::<CalculatorSubtractResponse, D>::encode(
901                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.difference),),
902                encoder,
903                offset,
904                _depth,
905            )
906        }
907    }
908    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
909        fidl::encoding::Encode<CalculatorSubtractResponse, D> for (T0,)
910    {
911        #[inline]
912        unsafe fn encode(
913            self,
914            encoder: &mut fidl::encoding::Encoder<'_, D>,
915            offset: usize,
916            depth: fidl::encoding::Depth,
917        ) -> fidl::Result<()> {
918            encoder.debug_check_bounds::<CalculatorSubtractResponse>(offset);
919            // Zero out padding regions. There's no need to apply masks
920            // because the unmasked parts will be overwritten by fields.
921            // Write the fields.
922            self.0.encode(encoder, offset + 0, depth)?;
923            Ok(())
924        }
925    }
926
927    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
928        for CalculatorSubtractResponse
929    {
930        #[inline(always)]
931        fn new_empty() -> Self {
932            Self { difference: fidl::new_empty!(f64, D) }
933        }
934
935        #[inline]
936        unsafe fn decode(
937            &mut self,
938            decoder: &mut fidl::encoding::Decoder<'_, D>,
939            offset: usize,
940            _depth: fidl::encoding::Depth,
941        ) -> fidl::Result<()> {
942            decoder.debug_check_bounds::<Self>(offset);
943            // Verify that padding bytes are zero.
944            fidl::decode!(f64, D, &mut self.difference, decoder, offset + 0, _depth)?;
945            Ok(())
946        }
947    }
948}