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