1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Clone, Debug)]
6#[repr(C)]
7pub struct CalculatorAddRequest {
8 pub a: f64,
9
10 pub b: f64,
11}
12
13impl ::fidl_next::Encodable for CalculatorAddRequest {
14 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorAddRequest> = unsafe {
15 ::fidl_next::CopyOptimization::enable_if(
16 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
17 && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
18 )
19 };
20
21 type Encoded = WireCalculatorAddRequest;
22}
23
24unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorAddRequest
25where
26 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27{
28 #[inline]
29 fn encode(
30 self,
31 encoder: &mut ___E,
32 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33 ) -> Result<(), ::fidl_next::EncodeError> {
34 ::fidl_next::munge! {
35 let Self::Encoded {
36 a,
37 b,
38
39 } = out;
40 }
41
42 ::fidl_next::Encode::encode(self.a, encoder, a)?;
43
44 ::fidl_next::Encode::encode(self.b, encoder, b)?;
45
46 Ok(())
47 }
48}
49
50unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorAddRequest
51where
52 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
53{
54 #[inline]
55 fn encode_ref(
56 &self,
57 encoder: &mut ___E,
58 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
59 ) -> Result<(), ::fidl_next::EncodeError> {
60 ::fidl_next::munge! {
61 let Self::Encoded {
62 a,
63 b,
64
65 } = out;
66 }
67
68 ::fidl_next::EncodeRef::encode_ref(&self.a, encoder, a)?;
69
70 ::fidl_next::EncodeRef::encode_ref(&self.b, encoder, b)?;
71
72 Ok(())
73 }
74}
75
76impl ::fidl_next::EncodableOption for CalculatorAddRequest {
77 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorAddRequest>;
78}
79
80unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorAddRequest
81where
82 ___E: ::fidl_next::Encoder + ?Sized,
83 CalculatorAddRequest: ::fidl_next::Encode<___E>,
84{
85 #[inline]
86 fn encode_option(
87 this: Option<Self>,
88 encoder: &mut ___E,
89 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
90 ) -> Result<(), ::fidl_next::EncodeError> {
91 if let Some(inner) = this {
92 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
93 ::fidl_next::WireBox::encode_present(out);
94 } else {
95 ::fidl_next::WireBox::encode_absent(out);
96 }
97
98 Ok(())
99 }
100}
101
102unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorAddRequest
103where
104 ___E: ::fidl_next::Encoder + ?Sized,
105 CalculatorAddRequest: ::fidl_next::EncodeRef<___E>,
106{
107 #[inline]
108 fn encode_option_ref(
109 this: Option<&Self>,
110 encoder: &mut ___E,
111 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
112 ) -> Result<(), ::fidl_next::EncodeError> {
113 if let Some(inner) = this {
114 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
115 ::fidl_next::WireBox::encode_present(out);
116 } else {
117 ::fidl_next::WireBox::encode_absent(out);
118 }
119
120 Ok(())
121 }
122}
123
124impl ::fidl_next::FromWire<WireCalculatorAddRequest> for CalculatorAddRequest {
125 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorAddRequest, Self> = unsafe {
126 ::fidl_next::CopyOptimization::enable_if(
127 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
128 .is_enabled()
129 && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
130 .is_enabled(),
131 )
132 };
133
134 #[inline]
135 fn from_wire(wire: WireCalculatorAddRequest) -> Self {
136 Self {
137 a: ::fidl_next::FromWire::from_wire(wire.a),
138
139 b: ::fidl_next::FromWire::from_wire(wire.b),
140 }
141 }
142}
143
144impl ::fidl_next::FromWireRef<WireCalculatorAddRequest> for CalculatorAddRequest {
145 #[inline]
146 fn from_wire_ref(wire: &WireCalculatorAddRequest) -> Self {
147 Self {
148 a: ::fidl_next::FromWireRef::from_wire_ref(&wire.a),
149
150 b: ::fidl_next::FromWireRef::from_wire_ref(&wire.b),
151 }
152 }
153}
154
155#[derive(Clone, Debug)]
157#[repr(C)]
158pub struct WireCalculatorAddRequest {
159 pub a: ::fidl_next::WireF64,
160
161 pub b: ::fidl_next::WireF64,
162}
163
164unsafe impl ::fidl_next::Wire for WireCalculatorAddRequest {
165 type Decoded<'de> = WireCalculatorAddRequest;
166
167 #[inline]
168 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
169}
170
171unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorAddRequest
172where
173 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
174{
175 fn decode(
176 slot: ::fidl_next::Slot<'_, Self>,
177 decoder: &mut ___D,
178 ) -> Result<(), ::fidl_next::DecodeError> {
179 ::fidl_next::munge! {
180 let Self {
181 mut a,
182 mut b,
183
184 } = slot;
185 }
186
187 ::fidl_next::Decode::decode(a.as_mut(), decoder)?;
188
189 ::fidl_next::Decode::decode(b.as_mut(), decoder)?;
190
191 Ok(())
192 }
193}
194
195#[derive(Clone, Debug)]
196#[repr(C)]
197pub struct CalculatorAddResponse {
198 pub sum: f64,
199}
200
201impl ::fidl_next::Encodable for CalculatorAddResponse {
202 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorAddResponse> = unsafe {
203 ::fidl_next::CopyOptimization::enable_if(
204 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
205 )
206 };
207
208 type Encoded = WireCalculatorAddResponse;
209}
210
211unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorAddResponse
212where
213 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
214{
215 #[inline]
216 fn encode(
217 self,
218 encoder: &mut ___E,
219 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
220 ) -> Result<(), ::fidl_next::EncodeError> {
221 ::fidl_next::munge! {
222 let Self::Encoded {
223 sum,
224
225 } = out;
226 }
227
228 ::fidl_next::Encode::encode(self.sum, encoder, sum)?;
229
230 Ok(())
231 }
232}
233
234unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorAddResponse
235where
236 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
237{
238 #[inline]
239 fn encode_ref(
240 &self,
241 encoder: &mut ___E,
242 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
243 ) -> Result<(), ::fidl_next::EncodeError> {
244 ::fidl_next::munge! {
245 let Self::Encoded {
246 sum,
247
248 } = out;
249 }
250
251 ::fidl_next::EncodeRef::encode_ref(&self.sum, encoder, sum)?;
252
253 Ok(())
254 }
255}
256
257impl ::fidl_next::EncodableOption for CalculatorAddResponse {
258 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorAddResponse>;
259}
260
261unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorAddResponse
262where
263 ___E: ::fidl_next::Encoder + ?Sized,
264 CalculatorAddResponse: ::fidl_next::Encode<___E>,
265{
266 #[inline]
267 fn encode_option(
268 this: Option<Self>,
269 encoder: &mut ___E,
270 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
271 ) -> Result<(), ::fidl_next::EncodeError> {
272 if let Some(inner) = this {
273 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
274 ::fidl_next::WireBox::encode_present(out);
275 } else {
276 ::fidl_next::WireBox::encode_absent(out);
277 }
278
279 Ok(())
280 }
281}
282
283unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorAddResponse
284where
285 ___E: ::fidl_next::Encoder + ?Sized,
286 CalculatorAddResponse: ::fidl_next::EncodeRef<___E>,
287{
288 #[inline]
289 fn encode_option_ref(
290 this: Option<&Self>,
291 encoder: &mut ___E,
292 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
293 ) -> Result<(), ::fidl_next::EncodeError> {
294 if let Some(inner) = this {
295 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
296 ::fidl_next::WireBox::encode_present(out);
297 } else {
298 ::fidl_next::WireBox::encode_absent(out);
299 }
300
301 Ok(())
302 }
303}
304
305impl ::fidl_next::FromWire<WireCalculatorAddResponse> for CalculatorAddResponse {
306 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorAddResponse, Self> = unsafe {
307 ::fidl_next::CopyOptimization::enable_if(
308 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
309 .is_enabled(),
310 )
311 };
312
313 #[inline]
314 fn from_wire(wire: WireCalculatorAddResponse) -> Self {
315 Self { sum: ::fidl_next::FromWire::from_wire(wire.sum) }
316 }
317}
318
319impl ::fidl_next::FromWireRef<WireCalculatorAddResponse> for CalculatorAddResponse {
320 #[inline]
321 fn from_wire_ref(wire: &WireCalculatorAddResponse) -> Self {
322 Self { sum: ::fidl_next::FromWireRef::from_wire_ref(&wire.sum) }
323 }
324}
325
326#[derive(Clone, Debug)]
328#[repr(C)]
329pub struct WireCalculatorAddResponse {
330 pub sum: ::fidl_next::WireF64,
331}
332
333unsafe impl ::fidl_next::Wire for WireCalculatorAddResponse {
334 type Decoded<'de> = WireCalculatorAddResponse;
335
336 #[inline]
337 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
338}
339
340unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorAddResponse
341where
342 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
343{
344 fn decode(
345 slot: ::fidl_next::Slot<'_, Self>,
346 decoder: &mut ___D,
347 ) -> Result<(), ::fidl_next::DecodeError> {
348 ::fidl_next::munge! {
349 let Self {
350 mut sum,
351
352 } = slot;
353 }
354
355 ::fidl_next::Decode::decode(sum.as_mut(), decoder)?;
356
357 Ok(())
358 }
359}
360
361#[derive(Clone, Debug)]
362#[repr(C)]
363pub struct CalculatorSubtractRequest {
364 pub a: f64,
365
366 pub b: f64,
367}
368
369impl ::fidl_next::Encodable for CalculatorSubtractRequest {
370 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorSubtractRequest> = unsafe {
371 ::fidl_next::CopyOptimization::enable_if(
372 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
373 && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
374 )
375 };
376
377 type Encoded = WireCalculatorSubtractRequest;
378}
379
380unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorSubtractRequest
381where
382 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
383{
384 #[inline]
385 fn encode(
386 self,
387 encoder: &mut ___E,
388 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
389 ) -> Result<(), ::fidl_next::EncodeError> {
390 ::fidl_next::munge! {
391 let Self::Encoded {
392 a,
393 b,
394
395 } = out;
396 }
397
398 ::fidl_next::Encode::encode(self.a, encoder, a)?;
399
400 ::fidl_next::Encode::encode(self.b, encoder, b)?;
401
402 Ok(())
403 }
404}
405
406unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorSubtractRequest
407where
408 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
409{
410 #[inline]
411 fn encode_ref(
412 &self,
413 encoder: &mut ___E,
414 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
415 ) -> Result<(), ::fidl_next::EncodeError> {
416 ::fidl_next::munge! {
417 let Self::Encoded {
418 a,
419 b,
420
421 } = out;
422 }
423
424 ::fidl_next::EncodeRef::encode_ref(&self.a, encoder, a)?;
425
426 ::fidl_next::EncodeRef::encode_ref(&self.b, encoder, b)?;
427
428 Ok(())
429 }
430}
431
432impl ::fidl_next::EncodableOption for CalculatorSubtractRequest {
433 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorSubtractRequest>;
434}
435
436unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorSubtractRequest
437where
438 ___E: ::fidl_next::Encoder + ?Sized,
439 CalculatorSubtractRequest: ::fidl_next::Encode<___E>,
440{
441 #[inline]
442 fn encode_option(
443 this: Option<Self>,
444 encoder: &mut ___E,
445 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
446 ) -> Result<(), ::fidl_next::EncodeError> {
447 if let Some(inner) = this {
448 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
449 ::fidl_next::WireBox::encode_present(out);
450 } else {
451 ::fidl_next::WireBox::encode_absent(out);
452 }
453
454 Ok(())
455 }
456}
457
458unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorSubtractRequest
459where
460 ___E: ::fidl_next::Encoder + ?Sized,
461 CalculatorSubtractRequest: ::fidl_next::EncodeRef<___E>,
462{
463 #[inline]
464 fn encode_option_ref(
465 this: Option<&Self>,
466 encoder: &mut ___E,
467 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
468 ) -> Result<(), ::fidl_next::EncodeError> {
469 if let Some(inner) = this {
470 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
471 ::fidl_next::WireBox::encode_present(out);
472 } else {
473 ::fidl_next::WireBox::encode_absent(out);
474 }
475
476 Ok(())
477 }
478}
479
480impl ::fidl_next::FromWire<WireCalculatorSubtractRequest> for CalculatorSubtractRequest {
481 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorSubtractRequest, Self> = unsafe {
482 ::fidl_next::CopyOptimization::enable_if(
483 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
484 .is_enabled()
485 && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
486 .is_enabled(),
487 )
488 };
489
490 #[inline]
491 fn from_wire(wire: WireCalculatorSubtractRequest) -> Self {
492 Self {
493 a: ::fidl_next::FromWire::from_wire(wire.a),
494
495 b: ::fidl_next::FromWire::from_wire(wire.b),
496 }
497 }
498}
499
500impl ::fidl_next::FromWireRef<WireCalculatorSubtractRequest> for CalculatorSubtractRequest {
501 #[inline]
502 fn from_wire_ref(wire: &WireCalculatorSubtractRequest) -> Self {
503 Self {
504 a: ::fidl_next::FromWireRef::from_wire_ref(&wire.a),
505
506 b: ::fidl_next::FromWireRef::from_wire_ref(&wire.b),
507 }
508 }
509}
510
511#[derive(Clone, Debug)]
513#[repr(C)]
514pub struct WireCalculatorSubtractRequest {
515 pub a: ::fidl_next::WireF64,
516
517 pub b: ::fidl_next::WireF64,
518}
519
520unsafe impl ::fidl_next::Wire for WireCalculatorSubtractRequest {
521 type Decoded<'de> = WireCalculatorSubtractRequest;
522
523 #[inline]
524 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
525}
526
527unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorSubtractRequest
528where
529 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
530{
531 fn decode(
532 slot: ::fidl_next::Slot<'_, Self>,
533 decoder: &mut ___D,
534 ) -> Result<(), ::fidl_next::DecodeError> {
535 ::fidl_next::munge! {
536 let Self {
537 mut a,
538 mut b,
539
540 } = slot;
541 }
542
543 ::fidl_next::Decode::decode(a.as_mut(), decoder)?;
544
545 ::fidl_next::Decode::decode(b.as_mut(), decoder)?;
546
547 Ok(())
548 }
549}
550
551#[derive(Clone, Debug)]
552#[repr(C)]
553pub struct CalculatorSubtractResponse {
554 pub difference: f64,
555}
556
557impl ::fidl_next::Encodable for CalculatorSubtractResponse {
558 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorSubtractResponse> = unsafe {
559 ::fidl_next::CopyOptimization::enable_if(
560 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
561 )
562 };
563
564 type Encoded = WireCalculatorSubtractResponse;
565}
566
567unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorSubtractResponse
568where
569 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
570{
571 #[inline]
572 fn encode(
573 self,
574 encoder: &mut ___E,
575 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
576 ) -> Result<(), ::fidl_next::EncodeError> {
577 ::fidl_next::munge! {
578 let Self::Encoded {
579 difference,
580
581 } = out;
582 }
583
584 ::fidl_next::Encode::encode(self.difference, encoder, difference)?;
585
586 Ok(())
587 }
588}
589
590unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorSubtractResponse
591where
592 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
593{
594 #[inline]
595 fn encode_ref(
596 &self,
597 encoder: &mut ___E,
598 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
599 ) -> Result<(), ::fidl_next::EncodeError> {
600 ::fidl_next::munge! {
601 let Self::Encoded {
602 difference,
603
604 } = out;
605 }
606
607 ::fidl_next::EncodeRef::encode_ref(&self.difference, encoder, difference)?;
608
609 Ok(())
610 }
611}
612
613impl ::fidl_next::EncodableOption for CalculatorSubtractResponse {
614 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorSubtractResponse>;
615}
616
617unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorSubtractResponse
618where
619 ___E: ::fidl_next::Encoder + ?Sized,
620 CalculatorSubtractResponse: ::fidl_next::Encode<___E>,
621{
622 #[inline]
623 fn encode_option(
624 this: Option<Self>,
625 encoder: &mut ___E,
626 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
627 ) -> Result<(), ::fidl_next::EncodeError> {
628 if let Some(inner) = this {
629 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
630 ::fidl_next::WireBox::encode_present(out);
631 } else {
632 ::fidl_next::WireBox::encode_absent(out);
633 }
634
635 Ok(())
636 }
637}
638
639unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorSubtractResponse
640where
641 ___E: ::fidl_next::Encoder + ?Sized,
642 CalculatorSubtractResponse: ::fidl_next::EncodeRef<___E>,
643{
644 #[inline]
645 fn encode_option_ref(
646 this: Option<&Self>,
647 encoder: &mut ___E,
648 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
649 ) -> Result<(), ::fidl_next::EncodeError> {
650 if let Some(inner) = this {
651 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
652 ::fidl_next::WireBox::encode_present(out);
653 } else {
654 ::fidl_next::WireBox::encode_absent(out);
655 }
656
657 Ok(())
658 }
659}
660
661impl ::fidl_next::FromWire<WireCalculatorSubtractResponse> for CalculatorSubtractResponse {
662 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorSubtractResponse, Self> = unsafe {
663 ::fidl_next::CopyOptimization::enable_if(
664 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
665 .is_enabled(),
666 )
667 };
668
669 #[inline]
670 fn from_wire(wire: WireCalculatorSubtractResponse) -> Self {
671 Self { difference: ::fidl_next::FromWire::from_wire(wire.difference) }
672 }
673}
674
675impl ::fidl_next::FromWireRef<WireCalculatorSubtractResponse> for CalculatorSubtractResponse {
676 #[inline]
677 fn from_wire_ref(wire: &WireCalculatorSubtractResponse) -> Self {
678 Self { difference: ::fidl_next::FromWireRef::from_wire_ref(&wire.difference) }
679 }
680}
681
682#[derive(Clone, Debug)]
684#[repr(C)]
685pub struct WireCalculatorSubtractResponse {
686 pub difference: ::fidl_next::WireF64,
687}
688
689unsafe impl ::fidl_next::Wire for WireCalculatorSubtractResponse {
690 type Decoded<'de> = WireCalculatorSubtractResponse;
691
692 #[inline]
693 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
694}
695
696unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorSubtractResponse
697where
698 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
699{
700 fn decode(
701 slot: ::fidl_next::Slot<'_, Self>,
702 decoder: &mut ___D,
703 ) -> Result<(), ::fidl_next::DecodeError> {
704 ::fidl_next::munge! {
705 let Self {
706 mut difference,
707
708 } = slot;
709 }
710
711 ::fidl_next::Decode::decode(difference.as_mut(), decoder)?;
712
713 Ok(())
714 }
715}
716
717#[derive(Clone, Debug)]
718#[repr(C)]
719pub struct CalculatorMultiplyRequest {
720 pub a: f64,
721
722 pub b: f64,
723}
724
725impl ::fidl_next::Encodable for CalculatorMultiplyRequest {
726 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorMultiplyRequest> = unsafe {
727 ::fidl_next::CopyOptimization::enable_if(
728 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
729 && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
730 )
731 };
732
733 type Encoded = WireCalculatorMultiplyRequest;
734}
735
736unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorMultiplyRequest
737where
738 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
739{
740 #[inline]
741 fn encode(
742 self,
743 encoder: &mut ___E,
744 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
745 ) -> Result<(), ::fidl_next::EncodeError> {
746 ::fidl_next::munge! {
747 let Self::Encoded {
748 a,
749 b,
750
751 } = out;
752 }
753
754 ::fidl_next::Encode::encode(self.a, encoder, a)?;
755
756 ::fidl_next::Encode::encode(self.b, encoder, b)?;
757
758 Ok(())
759 }
760}
761
762unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorMultiplyRequest
763where
764 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
765{
766 #[inline]
767 fn encode_ref(
768 &self,
769 encoder: &mut ___E,
770 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
771 ) -> Result<(), ::fidl_next::EncodeError> {
772 ::fidl_next::munge! {
773 let Self::Encoded {
774 a,
775 b,
776
777 } = out;
778 }
779
780 ::fidl_next::EncodeRef::encode_ref(&self.a, encoder, a)?;
781
782 ::fidl_next::EncodeRef::encode_ref(&self.b, encoder, b)?;
783
784 Ok(())
785 }
786}
787
788impl ::fidl_next::EncodableOption for CalculatorMultiplyRequest {
789 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorMultiplyRequest>;
790}
791
792unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorMultiplyRequest
793where
794 ___E: ::fidl_next::Encoder + ?Sized,
795 CalculatorMultiplyRequest: ::fidl_next::Encode<___E>,
796{
797 #[inline]
798 fn encode_option(
799 this: Option<Self>,
800 encoder: &mut ___E,
801 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
802 ) -> Result<(), ::fidl_next::EncodeError> {
803 if let Some(inner) = this {
804 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
805 ::fidl_next::WireBox::encode_present(out);
806 } else {
807 ::fidl_next::WireBox::encode_absent(out);
808 }
809
810 Ok(())
811 }
812}
813
814unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorMultiplyRequest
815where
816 ___E: ::fidl_next::Encoder + ?Sized,
817 CalculatorMultiplyRequest: ::fidl_next::EncodeRef<___E>,
818{
819 #[inline]
820 fn encode_option_ref(
821 this: Option<&Self>,
822 encoder: &mut ___E,
823 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
824 ) -> Result<(), ::fidl_next::EncodeError> {
825 if let Some(inner) = this {
826 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
827 ::fidl_next::WireBox::encode_present(out);
828 } else {
829 ::fidl_next::WireBox::encode_absent(out);
830 }
831
832 Ok(())
833 }
834}
835
836impl ::fidl_next::FromWire<WireCalculatorMultiplyRequest> for CalculatorMultiplyRequest {
837 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorMultiplyRequest, Self> = unsafe {
838 ::fidl_next::CopyOptimization::enable_if(
839 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
840 .is_enabled()
841 && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
842 .is_enabled(),
843 )
844 };
845
846 #[inline]
847 fn from_wire(wire: WireCalculatorMultiplyRequest) -> Self {
848 Self {
849 a: ::fidl_next::FromWire::from_wire(wire.a),
850
851 b: ::fidl_next::FromWire::from_wire(wire.b),
852 }
853 }
854}
855
856impl ::fidl_next::FromWireRef<WireCalculatorMultiplyRequest> for CalculatorMultiplyRequest {
857 #[inline]
858 fn from_wire_ref(wire: &WireCalculatorMultiplyRequest) -> Self {
859 Self {
860 a: ::fidl_next::FromWireRef::from_wire_ref(&wire.a),
861
862 b: ::fidl_next::FromWireRef::from_wire_ref(&wire.b),
863 }
864 }
865}
866
867#[derive(Clone, Debug)]
869#[repr(C)]
870pub struct WireCalculatorMultiplyRequest {
871 pub a: ::fidl_next::WireF64,
872
873 pub b: ::fidl_next::WireF64,
874}
875
876unsafe impl ::fidl_next::Wire for WireCalculatorMultiplyRequest {
877 type Decoded<'de> = WireCalculatorMultiplyRequest;
878
879 #[inline]
880 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
881}
882
883unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorMultiplyRequest
884where
885 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
886{
887 fn decode(
888 slot: ::fidl_next::Slot<'_, Self>,
889 decoder: &mut ___D,
890 ) -> Result<(), ::fidl_next::DecodeError> {
891 ::fidl_next::munge! {
892 let Self {
893 mut a,
894 mut b,
895
896 } = slot;
897 }
898
899 ::fidl_next::Decode::decode(a.as_mut(), decoder)?;
900
901 ::fidl_next::Decode::decode(b.as_mut(), decoder)?;
902
903 Ok(())
904 }
905}
906
907#[derive(Clone, Debug)]
908#[repr(C)]
909pub struct CalculatorMultiplyResponse {
910 pub product: f64,
911}
912
913impl ::fidl_next::Encodable for CalculatorMultiplyResponse {
914 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorMultiplyResponse> = unsafe {
915 ::fidl_next::CopyOptimization::enable_if(
916 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
917 )
918 };
919
920 type Encoded = WireCalculatorMultiplyResponse;
921}
922
923unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorMultiplyResponse
924where
925 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
926{
927 #[inline]
928 fn encode(
929 self,
930 encoder: &mut ___E,
931 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
932 ) -> Result<(), ::fidl_next::EncodeError> {
933 ::fidl_next::munge! {
934 let Self::Encoded {
935 product,
936
937 } = out;
938 }
939
940 ::fidl_next::Encode::encode(self.product, encoder, product)?;
941
942 Ok(())
943 }
944}
945
946unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorMultiplyResponse
947where
948 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
949{
950 #[inline]
951 fn encode_ref(
952 &self,
953 encoder: &mut ___E,
954 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
955 ) -> Result<(), ::fidl_next::EncodeError> {
956 ::fidl_next::munge! {
957 let Self::Encoded {
958 product,
959
960 } = out;
961 }
962
963 ::fidl_next::EncodeRef::encode_ref(&self.product, encoder, product)?;
964
965 Ok(())
966 }
967}
968
969impl ::fidl_next::EncodableOption for CalculatorMultiplyResponse {
970 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorMultiplyResponse>;
971}
972
973unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorMultiplyResponse
974where
975 ___E: ::fidl_next::Encoder + ?Sized,
976 CalculatorMultiplyResponse: ::fidl_next::Encode<___E>,
977{
978 #[inline]
979 fn encode_option(
980 this: Option<Self>,
981 encoder: &mut ___E,
982 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
983 ) -> Result<(), ::fidl_next::EncodeError> {
984 if let Some(inner) = this {
985 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
986 ::fidl_next::WireBox::encode_present(out);
987 } else {
988 ::fidl_next::WireBox::encode_absent(out);
989 }
990
991 Ok(())
992 }
993}
994
995unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorMultiplyResponse
996where
997 ___E: ::fidl_next::Encoder + ?Sized,
998 CalculatorMultiplyResponse: ::fidl_next::EncodeRef<___E>,
999{
1000 #[inline]
1001 fn encode_option_ref(
1002 this: Option<&Self>,
1003 encoder: &mut ___E,
1004 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1005 ) -> Result<(), ::fidl_next::EncodeError> {
1006 if let Some(inner) = this {
1007 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1008 ::fidl_next::WireBox::encode_present(out);
1009 } else {
1010 ::fidl_next::WireBox::encode_absent(out);
1011 }
1012
1013 Ok(())
1014 }
1015}
1016
1017impl ::fidl_next::FromWire<WireCalculatorMultiplyResponse> for CalculatorMultiplyResponse {
1018 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorMultiplyResponse, Self> = unsafe {
1019 ::fidl_next::CopyOptimization::enable_if(
1020 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1021 .is_enabled(),
1022 )
1023 };
1024
1025 #[inline]
1026 fn from_wire(wire: WireCalculatorMultiplyResponse) -> Self {
1027 Self { product: ::fidl_next::FromWire::from_wire(wire.product) }
1028 }
1029}
1030
1031impl ::fidl_next::FromWireRef<WireCalculatorMultiplyResponse> for CalculatorMultiplyResponse {
1032 #[inline]
1033 fn from_wire_ref(wire: &WireCalculatorMultiplyResponse) -> Self {
1034 Self { product: ::fidl_next::FromWireRef::from_wire_ref(&wire.product) }
1035 }
1036}
1037
1038#[derive(Clone, Debug)]
1040#[repr(C)]
1041pub struct WireCalculatorMultiplyResponse {
1042 pub product: ::fidl_next::WireF64,
1043}
1044
1045unsafe impl ::fidl_next::Wire for WireCalculatorMultiplyResponse {
1046 type Decoded<'de> = WireCalculatorMultiplyResponse;
1047
1048 #[inline]
1049 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1050}
1051
1052unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorMultiplyResponse
1053where
1054 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1055{
1056 fn decode(
1057 slot: ::fidl_next::Slot<'_, Self>,
1058 decoder: &mut ___D,
1059 ) -> Result<(), ::fidl_next::DecodeError> {
1060 ::fidl_next::munge! {
1061 let Self {
1062 mut product,
1063
1064 } = slot;
1065 }
1066
1067 ::fidl_next::Decode::decode(product.as_mut(), decoder)?;
1068
1069 Ok(())
1070 }
1071}
1072
1073#[derive(Clone, Debug)]
1074#[repr(C)]
1075pub struct CalculatorDivideRequest {
1076 pub dividend: f64,
1077
1078 pub divisor: f64,
1079}
1080
1081impl ::fidl_next::Encodable for CalculatorDivideRequest {
1082 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorDivideRequest> = unsafe {
1083 ::fidl_next::CopyOptimization::enable_if(
1084 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
1085 && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
1086 )
1087 };
1088
1089 type Encoded = WireCalculatorDivideRequest;
1090}
1091
1092unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorDivideRequest
1093where
1094 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1095{
1096 #[inline]
1097 fn encode(
1098 self,
1099 encoder: &mut ___E,
1100 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1101 ) -> Result<(), ::fidl_next::EncodeError> {
1102 ::fidl_next::munge! {
1103 let Self::Encoded {
1104 dividend,
1105 divisor,
1106
1107 } = out;
1108 }
1109
1110 ::fidl_next::Encode::encode(self.dividend, encoder, dividend)?;
1111
1112 ::fidl_next::Encode::encode(self.divisor, encoder, divisor)?;
1113
1114 Ok(())
1115 }
1116}
1117
1118unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorDivideRequest
1119where
1120 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1121{
1122 #[inline]
1123 fn encode_ref(
1124 &self,
1125 encoder: &mut ___E,
1126 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1127 ) -> Result<(), ::fidl_next::EncodeError> {
1128 ::fidl_next::munge! {
1129 let Self::Encoded {
1130 dividend,
1131 divisor,
1132
1133 } = out;
1134 }
1135
1136 ::fidl_next::EncodeRef::encode_ref(&self.dividend, encoder, dividend)?;
1137
1138 ::fidl_next::EncodeRef::encode_ref(&self.divisor, encoder, divisor)?;
1139
1140 Ok(())
1141 }
1142}
1143
1144impl ::fidl_next::EncodableOption for CalculatorDivideRequest {
1145 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorDivideRequest>;
1146}
1147
1148unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorDivideRequest
1149where
1150 ___E: ::fidl_next::Encoder + ?Sized,
1151 CalculatorDivideRequest: ::fidl_next::Encode<___E>,
1152{
1153 #[inline]
1154 fn encode_option(
1155 this: Option<Self>,
1156 encoder: &mut ___E,
1157 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1158 ) -> Result<(), ::fidl_next::EncodeError> {
1159 if let Some(inner) = this {
1160 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1161 ::fidl_next::WireBox::encode_present(out);
1162 } else {
1163 ::fidl_next::WireBox::encode_absent(out);
1164 }
1165
1166 Ok(())
1167 }
1168}
1169
1170unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorDivideRequest
1171where
1172 ___E: ::fidl_next::Encoder + ?Sized,
1173 CalculatorDivideRequest: ::fidl_next::EncodeRef<___E>,
1174{
1175 #[inline]
1176 fn encode_option_ref(
1177 this: Option<&Self>,
1178 encoder: &mut ___E,
1179 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1180 ) -> Result<(), ::fidl_next::EncodeError> {
1181 if let Some(inner) = this {
1182 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1183 ::fidl_next::WireBox::encode_present(out);
1184 } else {
1185 ::fidl_next::WireBox::encode_absent(out);
1186 }
1187
1188 Ok(())
1189 }
1190}
1191
1192impl ::fidl_next::FromWire<WireCalculatorDivideRequest> for CalculatorDivideRequest {
1193 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorDivideRequest, Self> = unsafe {
1194 ::fidl_next::CopyOptimization::enable_if(
1195 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1196 .is_enabled()
1197 && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1198 .is_enabled(),
1199 )
1200 };
1201
1202 #[inline]
1203 fn from_wire(wire: WireCalculatorDivideRequest) -> Self {
1204 Self {
1205 dividend: ::fidl_next::FromWire::from_wire(wire.dividend),
1206
1207 divisor: ::fidl_next::FromWire::from_wire(wire.divisor),
1208 }
1209 }
1210}
1211
1212impl ::fidl_next::FromWireRef<WireCalculatorDivideRequest> for CalculatorDivideRequest {
1213 #[inline]
1214 fn from_wire_ref(wire: &WireCalculatorDivideRequest) -> Self {
1215 Self {
1216 dividend: ::fidl_next::FromWireRef::from_wire_ref(&wire.dividend),
1217
1218 divisor: ::fidl_next::FromWireRef::from_wire_ref(&wire.divisor),
1219 }
1220 }
1221}
1222
1223#[derive(Clone, Debug)]
1225#[repr(C)]
1226pub struct WireCalculatorDivideRequest {
1227 pub dividend: ::fidl_next::WireF64,
1228
1229 pub divisor: ::fidl_next::WireF64,
1230}
1231
1232unsafe impl ::fidl_next::Wire for WireCalculatorDivideRequest {
1233 type Decoded<'de> = WireCalculatorDivideRequest;
1234
1235 #[inline]
1236 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1237}
1238
1239unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorDivideRequest
1240where
1241 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1242{
1243 fn decode(
1244 slot: ::fidl_next::Slot<'_, Self>,
1245 decoder: &mut ___D,
1246 ) -> Result<(), ::fidl_next::DecodeError> {
1247 ::fidl_next::munge! {
1248 let Self {
1249 mut dividend,
1250 mut divisor,
1251
1252 } = slot;
1253 }
1254
1255 ::fidl_next::Decode::decode(dividend.as_mut(), decoder)?;
1256
1257 ::fidl_next::Decode::decode(divisor.as_mut(), decoder)?;
1258
1259 Ok(())
1260 }
1261}
1262
1263#[derive(Clone, Debug)]
1264#[repr(C)]
1265pub struct CalculatorDivideResponse {
1266 pub quotient: f64,
1267}
1268
1269impl ::fidl_next::Encodable for CalculatorDivideResponse {
1270 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorDivideResponse> = unsafe {
1271 ::fidl_next::CopyOptimization::enable_if(
1272 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
1273 )
1274 };
1275
1276 type Encoded = WireCalculatorDivideResponse;
1277}
1278
1279unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorDivideResponse
1280where
1281 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1282{
1283 #[inline]
1284 fn encode(
1285 self,
1286 encoder: &mut ___E,
1287 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1288 ) -> Result<(), ::fidl_next::EncodeError> {
1289 ::fidl_next::munge! {
1290 let Self::Encoded {
1291 quotient,
1292
1293 } = out;
1294 }
1295
1296 ::fidl_next::Encode::encode(self.quotient, encoder, quotient)?;
1297
1298 Ok(())
1299 }
1300}
1301
1302unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorDivideResponse
1303where
1304 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1305{
1306 #[inline]
1307 fn encode_ref(
1308 &self,
1309 encoder: &mut ___E,
1310 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1311 ) -> Result<(), ::fidl_next::EncodeError> {
1312 ::fidl_next::munge! {
1313 let Self::Encoded {
1314 quotient,
1315
1316 } = out;
1317 }
1318
1319 ::fidl_next::EncodeRef::encode_ref(&self.quotient, encoder, quotient)?;
1320
1321 Ok(())
1322 }
1323}
1324
1325impl ::fidl_next::EncodableOption for CalculatorDivideResponse {
1326 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorDivideResponse>;
1327}
1328
1329unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorDivideResponse
1330where
1331 ___E: ::fidl_next::Encoder + ?Sized,
1332 CalculatorDivideResponse: ::fidl_next::Encode<___E>,
1333{
1334 #[inline]
1335 fn encode_option(
1336 this: Option<Self>,
1337 encoder: &mut ___E,
1338 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1339 ) -> Result<(), ::fidl_next::EncodeError> {
1340 if let Some(inner) = this {
1341 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1342 ::fidl_next::WireBox::encode_present(out);
1343 } else {
1344 ::fidl_next::WireBox::encode_absent(out);
1345 }
1346
1347 Ok(())
1348 }
1349}
1350
1351unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorDivideResponse
1352where
1353 ___E: ::fidl_next::Encoder + ?Sized,
1354 CalculatorDivideResponse: ::fidl_next::EncodeRef<___E>,
1355{
1356 #[inline]
1357 fn encode_option_ref(
1358 this: Option<&Self>,
1359 encoder: &mut ___E,
1360 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1361 ) -> Result<(), ::fidl_next::EncodeError> {
1362 if let Some(inner) = this {
1363 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1364 ::fidl_next::WireBox::encode_present(out);
1365 } else {
1366 ::fidl_next::WireBox::encode_absent(out);
1367 }
1368
1369 Ok(())
1370 }
1371}
1372
1373impl ::fidl_next::FromWire<WireCalculatorDivideResponse> for CalculatorDivideResponse {
1374 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorDivideResponse, Self> = unsafe {
1375 ::fidl_next::CopyOptimization::enable_if(
1376 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1377 .is_enabled(),
1378 )
1379 };
1380
1381 #[inline]
1382 fn from_wire(wire: WireCalculatorDivideResponse) -> Self {
1383 Self { quotient: ::fidl_next::FromWire::from_wire(wire.quotient) }
1384 }
1385}
1386
1387impl ::fidl_next::FromWireRef<WireCalculatorDivideResponse> for CalculatorDivideResponse {
1388 #[inline]
1389 fn from_wire_ref(wire: &WireCalculatorDivideResponse) -> Self {
1390 Self { quotient: ::fidl_next::FromWireRef::from_wire_ref(&wire.quotient) }
1391 }
1392}
1393
1394#[derive(Clone, Debug)]
1396#[repr(C)]
1397pub struct WireCalculatorDivideResponse {
1398 pub quotient: ::fidl_next::WireF64,
1399}
1400
1401unsafe impl ::fidl_next::Wire for WireCalculatorDivideResponse {
1402 type Decoded<'de> = WireCalculatorDivideResponse;
1403
1404 #[inline]
1405 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1406}
1407
1408unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorDivideResponse
1409where
1410 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1411{
1412 fn decode(
1413 slot: ::fidl_next::Slot<'_, Self>,
1414 decoder: &mut ___D,
1415 ) -> Result<(), ::fidl_next::DecodeError> {
1416 ::fidl_next::munge! {
1417 let Self {
1418 mut quotient,
1419
1420 } = slot;
1421 }
1422
1423 ::fidl_next::Decode::decode(quotient.as_mut(), decoder)?;
1424
1425 Ok(())
1426 }
1427}
1428
1429#[derive(Clone, Debug)]
1430#[repr(C)]
1431pub struct CalculatorPowRequest {
1432 pub base: f64,
1433
1434 pub exponent: f64,
1435}
1436
1437impl ::fidl_next::Encodable for CalculatorPowRequest {
1438 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorPowRequest> = unsafe {
1439 ::fidl_next::CopyOptimization::enable_if(
1440 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
1441 && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
1442 )
1443 };
1444
1445 type Encoded = WireCalculatorPowRequest;
1446}
1447
1448unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorPowRequest
1449where
1450 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1451{
1452 #[inline]
1453 fn encode(
1454 self,
1455 encoder: &mut ___E,
1456 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1457 ) -> Result<(), ::fidl_next::EncodeError> {
1458 ::fidl_next::munge! {
1459 let Self::Encoded {
1460 base,
1461 exponent,
1462
1463 } = out;
1464 }
1465
1466 ::fidl_next::Encode::encode(self.base, encoder, base)?;
1467
1468 ::fidl_next::Encode::encode(self.exponent, encoder, exponent)?;
1469
1470 Ok(())
1471 }
1472}
1473
1474unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorPowRequest
1475where
1476 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1477{
1478 #[inline]
1479 fn encode_ref(
1480 &self,
1481 encoder: &mut ___E,
1482 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1483 ) -> Result<(), ::fidl_next::EncodeError> {
1484 ::fidl_next::munge! {
1485 let Self::Encoded {
1486 base,
1487 exponent,
1488
1489 } = out;
1490 }
1491
1492 ::fidl_next::EncodeRef::encode_ref(&self.base, encoder, base)?;
1493
1494 ::fidl_next::EncodeRef::encode_ref(&self.exponent, encoder, exponent)?;
1495
1496 Ok(())
1497 }
1498}
1499
1500impl ::fidl_next::EncodableOption for CalculatorPowRequest {
1501 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorPowRequest>;
1502}
1503
1504unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorPowRequest
1505where
1506 ___E: ::fidl_next::Encoder + ?Sized,
1507 CalculatorPowRequest: ::fidl_next::Encode<___E>,
1508{
1509 #[inline]
1510 fn encode_option(
1511 this: Option<Self>,
1512 encoder: &mut ___E,
1513 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1514 ) -> Result<(), ::fidl_next::EncodeError> {
1515 if let Some(inner) = this {
1516 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1517 ::fidl_next::WireBox::encode_present(out);
1518 } else {
1519 ::fidl_next::WireBox::encode_absent(out);
1520 }
1521
1522 Ok(())
1523 }
1524}
1525
1526unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorPowRequest
1527where
1528 ___E: ::fidl_next::Encoder + ?Sized,
1529 CalculatorPowRequest: ::fidl_next::EncodeRef<___E>,
1530{
1531 #[inline]
1532 fn encode_option_ref(
1533 this: Option<&Self>,
1534 encoder: &mut ___E,
1535 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1536 ) -> Result<(), ::fidl_next::EncodeError> {
1537 if let Some(inner) = this {
1538 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1539 ::fidl_next::WireBox::encode_present(out);
1540 } else {
1541 ::fidl_next::WireBox::encode_absent(out);
1542 }
1543
1544 Ok(())
1545 }
1546}
1547
1548impl ::fidl_next::FromWire<WireCalculatorPowRequest> for CalculatorPowRequest {
1549 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorPowRequest, Self> = unsafe {
1550 ::fidl_next::CopyOptimization::enable_if(
1551 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1552 .is_enabled()
1553 && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1554 .is_enabled(),
1555 )
1556 };
1557
1558 #[inline]
1559 fn from_wire(wire: WireCalculatorPowRequest) -> Self {
1560 Self {
1561 base: ::fidl_next::FromWire::from_wire(wire.base),
1562
1563 exponent: ::fidl_next::FromWire::from_wire(wire.exponent),
1564 }
1565 }
1566}
1567
1568impl ::fidl_next::FromWireRef<WireCalculatorPowRequest> for CalculatorPowRequest {
1569 #[inline]
1570 fn from_wire_ref(wire: &WireCalculatorPowRequest) -> Self {
1571 Self {
1572 base: ::fidl_next::FromWireRef::from_wire_ref(&wire.base),
1573
1574 exponent: ::fidl_next::FromWireRef::from_wire_ref(&wire.exponent),
1575 }
1576 }
1577}
1578
1579#[derive(Clone, Debug)]
1581#[repr(C)]
1582pub struct WireCalculatorPowRequest {
1583 pub base: ::fidl_next::WireF64,
1584
1585 pub exponent: ::fidl_next::WireF64,
1586}
1587
1588unsafe impl ::fidl_next::Wire for WireCalculatorPowRequest {
1589 type Decoded<'de> = WireCalculatorPowRequest;
1590
1591 #[inline]
1592 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1593}
1594
1595unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorPowRequest
1596where
1597 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1598{
1599 fn decode(
1600 slot: ::fidl_next::Slot<'_, Self>,
1601 decoder: &mut ___D,
1602 ) -> Result<(), ::fidl_next::DecodeError> {
1603 ::fidl_next::munge! {
1604 let Self {
1605 mut base,
1606 mut exponent,
1607
1608 } = slot;
1609 }
1610
1611 ::fidl_next::Decode::decode(base.as_mut(), decoder)?;
1612
1613 ::fidl_next::Decode::decode(exponent.as_mut(), decoder)?;
1614
1615 Ok(())
1616 }
1617}
1618
1619#[derive(Clone, Debug)]
1620#[repr(C)]
1621pub struct CalculatorPowResponse {
1622 pub power: f64,
1623}
1624
1625impl ::fidl_next::Encodable for CalculatorPowResponse {
1626 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCalculatorPowResponse> = unsafe {
1627 ::fidl_next::CopyOptimization::enable_if(
1628 true && <f64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
1629 )
1630 };
1631
1632 type Encoded = WireCalculatorPowResponse;
1633}
1634
1635unsafe impl<___E> ::fidl_next::Encode<___E> for CalculatorPowResponse
1636where
1637 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1638{
1639 #[inline]
1640 fn encode(
1641 self,
1642 encoder: &mut ___E,
1643 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1644 ) -> Result<(), ::fidl_next::EncodeError> {
1645 ::fidl_next::munge! {
1646 let Self::Encoded {
1647 power,
1648
1649 } = out;
1650 }
1651
1652 ::fidl_next::Encode::encode(self.power, encoder, power)?;
1653
1654 Ok(())
1655 }
1656}
1657
1658unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CalculatorPowResponse
1659where
1660 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1661{
1662 #[inline]
1663 fn encode_ref(
1664 &self,
1665 encoder: &mut ___E,
1666 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1667 ) -> Result<(), ::fidl_next::EncodeError> {
1668 ::fidl_next::munge! {
1669 let Self::Encoded {
1670 power,
1671
1672 } = out;
1673 }
1674
1675 ::fidl_next::EncodeRef::encode_ref(&self.power, encoder, power)?;
1676
1677 Ok(())
1678 }
1679}
1680
1681impl ::fidl_next::EncodableOption for CalculatorPowResponse {
1682 type EncodedOption = ::fidl_next::WireBox<'static, WireCalculatorPowResponse>;
1683}
1684
1685unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CalculatorPowResponse
1686where
1687 ___E: ::fidl_next::Encoder + ?Sized,
1688 CalculatorPowResponse: ::fidl_next::Encode<___E>,
1689{
1690 #[inline]
1691 fn encode_option(
1692 this: Option<Self>,
1693 encoder: &mut ___E,
1694 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1695 ) -> Result<(), ::fidl_next::EncodeError> {
1696 if let Some(inner) = this {
1697 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1698 ::fidl_next::WireBox::encode_present(out);
1699 } else {
1700 ::fidl_next::WireBox::encode_absent(out);
1701 }
1702
1703 Ok(())
1704 }
1705}
1706
1707unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CalculatorPowResponse
1708where
1709 ___E: ::fidl_next::Encoder + ?Sized,
1710 CalculatorPowResponse: ::fidl_next::EncodeRef<___E>,
1711{
1712 #[inline]
1713 fn encode_option_ref(
1714 this: Option<&Self>,
1715 encoder: &mut ___E,
1716 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1717 ) -> Result<(), ::fidl_next::EncodeError> {
1718 if let Some(inner) = this {
1719 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1720 ::fidl_next::WireBox::encode_present(out);
1721 } else {
1722 ::fidl_next::WireBox::encode_absent(out);
1723 }
1724
1725 Ok(())
1726 }
1727}
1728
1729impl ::fidl_next::FromWire<WireCalculatorPowResponse> for CalculatorPowResponse {
1730 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCalculatorPowResponse, Self> = unsafe {
1731 ::fidl_next::CopyOptimization::enable_if(
1732 true && <f64 as ::fidl_next::FromWire<::fidl_next::WireF64>>::COPY_OPTIMIZATION
1733 .is_enabled(),
1734 )
1735 };
1736
1737 #[inline]
1738 fn from_wire(wire: WireCalculatorPowResponse) -> Self {
1739 Self { power: ::fidl_next::FromWire::from_wire(wire.power) }
1740 }
1741}
1742
1743impl ::fidl_next::FromWireRef<WireCalculatorPowResponse> for CalculatorPowResponse {
1744 #[inline]
1745 fn from_wire_ref(wire: &WireCalculatorPowResponse) -> Self {
1746 Self { power: ::fidl_next::FromWireRef::from_wire_ref(&wire.power) }
1747 }
1748}
1749
1750#[derive(Clone, Debug)]
1752#[repr(C)]
1753pub struct WireCalculatorPowResponse {
1754 pub power: ::fidl_next::WireF64,
1755}
1756
1757unsafe impl ::fidl_next::Wire for WireCalculatorPowResponse {
1758 type Decoded<'de> = WireCalculatorPowResponse;
1759
1760 #[inline]
1761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1762}
1763
1764unsafe impl<___D> ::fidl_next::Decode<___D> for WireCalculatorPowResponse
1765where
1766 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1767{
1768 fn decode(
1769 slot: ::fidl_next::Slot<'_, Self>,
1770 decoder: &mut ___D,
1771 ) -> Result<(), ::fidl_next::DecodeError> {
1772 ::fidl_next::munge! {
1773 let Self {
1774 mut power,
1775
1776 } = slot;
1777 }
1778
1779 ::fidl_next::Decode::decode(power.as_mut(), decoder)?;
1780
1781 Ok(())
1782 }
1783}
1784
1785#[doc = " A protocol for a simple calculator.\n\n Supports the following operations:\n + [`fuchsia.examples.calculator/Calculator.Add`]\n + [`fuchsia.examples.calculator/Calculator.Subtract`]\n + [`fuchsia.examples.calculator/Calculator.Multiply`]\n + [`fuchsia.examples.calculator/Calculator.Divide`]\n + [`fuchsia.examples.calculator/Calculator.Pow`]\n"]
1787#[derive(Debug)]
1788pub struct Calculator;
1789
1790impl ::fidl_next::Discoverable for Calculator {
1791 const PROTOCOL_NAME: &'static str = "fuchsia.examples.calculator.Calculator";
1792}
1793
1794pub mod calculator {
1795 pub mod prelude {
1796 pub use crate::{Calculator, CalculatorClientHandler, CalculatorServerHandler, calculator};
1797
1798 pub use crate::CalculatorAddRequest;
1799
1800 pub use crate::CalculatorAddResponse;
1801
1802 pub use crate::CalculatorDivideRequest;
1803
1804 pub use crate::CalculatorDivideResponse;
1805
1806 pub use crate::CalculatorMultiplyRequest;
1807
1808 pub use crate::CalculatorMultiplyResponse;
1809
1810 pub use crate::CalculatorPowRequest;
1811
1812 pub use crate::CalculatorPowResponse;
1813
1814 pub use crate::CalculatorSubtractRequest;
1815
1816 pub use crate::CalculatorSubtractResponse;
1817 }
1818
1819 pub struct Add;
1820
1821 impl ::fidl_next::Method for Add {
1822 const ORDINAL: u64 = 6855189016650709278;
1823
1824 type Protocol = crate::Calculator;
1825
1826 type Request = crate::WireCalculatorAddRequest;
1827
1828 type Response = crate::WireCalculatorAddResponse;
1829 }
1830
1831 pub struct Subtract;
1832
1833 impl ::fidl_next::Method for Subtract {
1834 const ORDINAL: u64 = 7263901511078514040;
1835
1836 type Protocol = crate::Calculator;
1837
1838 type Request = crate::WireCalculatorSubtractRequest;
1839
1840 type Response = crate::WireCalculatorSubtractResponse;
1841 }
1842
1843 pub struct Multiply;
1844
1845 impl ::fidl_next::Method for Multiply {
1846 const ORDINAL: u64 = 5579939962788903989;
1847
1848 type Protocol = crate::Calculator;
1849
1850 type Request = crate::WireCalculatorMultiplyRequest;
1851
1852 type Response = crate::WireCalculatorMultiplyResponse;
1853 }
1854
1855 pub struct Divide;
1856
1857 impl ::fidl_next::Method for Divide {
1858 const ORDINAL: u64 = 5603396952649205946;
1859
1860 type Protocol = crate::Calculator;
1861
1862 type Request = crate::WireCalculatorDivideRequest;
1863
1864 type Response = crate::WireCalculatorDivideResponse;
1865 }
1866
1867 pub struct Pow;
1868
1869 impl ::fidl_next::Method for Pow {
1870 const ORDINAL: u64 = 3776118813804437910;
1871
1872 type Protocol = crate::Calculator;
1873
1874 type Request = crate::WireCalculatorPowRequest;
1875
1876 type Response = crate::WireCalculatorPowResponse;
1877 }
1878
1879 mod ___detail {
1880
1881 pub struct Add<T0, T1> {
1882 a: T0,
1883
1884 b: T1,
1885 }
1886
1887 impl<T0, T1> ::fidl_next::Encodable for Add<T0, T1>
1888 where
1889 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1890 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1891 {
1892 type Encoded = crate::WireCalculatorAddRequest;
1893 }
1894
1895 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Add<T0, T1>
1896 where
1897 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1898 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1899 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1900 {
1901 #[inline]
1902 fn encode(
1903 self,
1904 encoder: &mut ___E,
1905 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1906 ) -> Result<(), ::fidl_next::EncodeError> {
1907 ::fidl_next::munge! {
1908 let Self::Encoded {
1909 a,
1910 b,
1911
1912 } = out;
1913 }
1914
1915 ::fidl_next::Encode::encode(self.a, encoder, a)?;
1916
1917 ::fidl_next::Encode::encode(self.b, encoder, b)?;
1918
1919 Ok(())
1920 }
1921 }
1922
1923 pub struct Subtract<T0, T1> {
1924 a: T0,
1925
1926 b: T1,
1927 }
1928
1929 impl<T0, T1> ::fidl_next::Encodable for Subtract<T0, T1>
1930 where
1931 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1932 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1933 {
1934 type Encoded = crate::WireCalculatorSubtractRequest;
1935 }
1936
1937 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Subtract<T0, T1>
1938 where
1939 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1940 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1941 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1942 {
1943 #[inline]
1944 fn encode(
1945 self,
1946 encoder: &mut ___E,
1947 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1948 ) -> Result<(), ::fidl_next::EncodeError> {
1949 ::fidl_next::munge! {
1950 let Self::Encoded {
1951 a,
1952 b,
1953
1954 } = out;
1955 }
1956
1957 ::fidl_next::Encode::encode(self.a, encoder, a)?;
1958
1959 ::fidl_next::Encode::encode(self.b, encoder, b)?;
1960
1961 Ok(())
1962 }
1963 }
1964
1965 pub struct Multiply<T0, T1> {
1966 a: T0,
1967
1968 b: T1,
1969 }
1970
1971 impl<T0, T1> ::fidl_next::Encodable for Multiply<T0, T1>
1972 where
1973 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1974 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
1975 {
1976 type Encoded = crate::WireCalculatorMultiplyRequest;
1977 }
1978
1979 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Multiply<T0, T1>
1980 where
1981 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1982 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1983 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
1984 {
1985 #[inline]
1986 fn encode(
1987 self,
1988 encoder: &mut ___E,
1989 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1990 ) -> Result<(), ::fidl_next::EncodeError> {
1991 ::fidl_next::munge! {
1992 let Self::Encoded {
1993 a,
1994 b,
1995
1996 } = out;
1997 }
1998
1999 ::fidl_next::Encode::encode(self.a, encoder, a)?;
2000
2001 ::fidl_next::Encode::encode(self.b, encoder, b)?;
2002
2003 Ok(())
2004 }
2005 }
2006
2007 pub struct Divide<T0, T1> {
2008 dividend: T0,
2009
2010 divisor: T1,
2011 }
2012
2013 impl<T0, T1> ::fidl_next::Encodable for Divide<T0, T1>
2014 where
2015 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
2016 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
2017 {
2018 type Encoded = crate::WireCalculatorDivideRequest;
2019 }
2020
2021 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Divide<T0, T1>
2022 where
2023 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2024 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
2025 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
2026 {
2027 #[inline]
2028 fn encode(
2029 self,
2030 encoder: &mut ___E,
2031 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2032 ) -> Result<(), ::fidl_next::EncodeError> {
2033 ::fidl_next::munge! {
2034 let Self::Encoded {
2035 dividend,
2036 divisor,
2037
2038 } = out;
2039 }
2040
2041 ::fidl_next::Encode::encode(self.dividend, encoder, dividend)?;
2042
2043 ::fidl_next::Encode::encode(self.divisor, encoder, divisor)?;
2044
2045 Ok(())
2046 }
2047 }
2048
2049 pub struct Pow<T0, T1> {
2050 base: T0,
2051
2052 exponent: T1,
2053 }
2054
2055 impl<T0, T1> ::fidl_next::Encodable for Pow<T0, T1>
2056 where
2057 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
2058 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireF64>,
2059 {
2060 type Encoded = crate::WireCalculatorPowRequest;
2061 }
2062
2063 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Pow<T0, T1>
2064 where
2065 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2066 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
2067 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireF64>,
2068 {
2069 #[inline]
2070 fn encode(
2071 self,
2072 encoder: &mut ___E,
2073 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2074 ) -> Result<(), ::fidl_next::EncodeError> {
2075 ::fidl_next::munge! {
2076 let Self::Encoded {
2077 base,
2078 exponent,
2079
2080 } = out;
2081 }
2082
2083 ::fidl_next::Encode::encode(self.base, encoder, base)?;
2084
2085 ::fidl_next::Encode::encode(self.exponent, encoder, exponent)?;
2086
2087 Ok(())
2088 }
2089 }
2090
2091 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Calculator
2092 where
2093 ___T: ::fidl_next::Transport,
2094 {
2095 type ClientSender = CalculatorClientSender<___T>;
2096 type ServerSender = CalculatorServerSender<___T>;
2097 }
2098
2099 #[repr(transparent)]
2101 pub struct CalculatorClientSender<___T: ::fidl_next::Transport> {
2102 #[allow(dead_code)]
2103 sender: ::fidl_next::protocol::ClientSender<___T>,
2104 }
2105
2106 impl<___T> CalculatorClientSender<___T>
2107 where
2108 ___T: ::fidl_next::Transport,
2109 {
2110 #[doc = " Adds two numbers together and returns their `sum`.\n\n For example, with `a` being 4.5 and `b` being 3.2, the response `sum` is\n 7.7.\n\n + request `a` the first number to be added.\n + request `b` the second number to be added.\n - response `sum` the sum of a and b.\n"]
2111 pub fn add(
2112 &self,
2113
2114 a: impl ::fidl_next::Encode<
2115 <___T as ::fidl_next::Transport>::SendBuffer,
2116 Encoded = ::fidl_next::WireF64,
2117 >,
2118
2119 b: impl ::fidl_next::Encode<
2120 <___T as ::fidl_next::Transport>::SendBuffer,
2121 Encoded = ::fidl_next::WireF64,
2122 >,
2123 ) -> ::fidl_next::TwoWayFuture<'_, super::Add, ___T>
2124 where
2125 <___T as ::fidl_next::Transport>::SendBuffer:
2126 ::fidl_next::encoder::InternalHandleEncoder,
2127 {
2128 self.add_with(Add { a, b })
2129 }
2130
2131 #[doc = " Adds two numbers together and returns their `sum`.\n\n For example, with `a` being 4.5 and `b` being 3.2, the response `sum` is\n 7.7.\n\n + request `a` the first number to be added.\n + request `b` the second number to be added.\n - response `sum` the sum of a and b.\n"]
2132 pub fn add_with<___R>(
2133 &self,
2134 request: ___R,
2135 ) -> ::fidl_next::TwoWayFuture<'_, super::Add, ___T>
2136 where
2137 ___R: ::fidl_next::Encode<
2138 <___T as ::fidl_next::Transport>::SendBuffer,
2139 Encoded = crate::WireCalculatorAddRequest,
2140 >,
2141 {
2142 ::fidl_next::TwoWayFuture::from_untyped(
2143 self.sender.send_two_way(6855189016650709278, request),
2144 )
2145 }
2146
2147 #[doc = " Subtracts two numbers and returns their `difference`.\n\n For example, with `a` being 7.7 and `b` being 3.2, the response\n `difference` is 4.5\n\n + request `a` the number to be subracted _from_.\n + request `b` the number to subtract.\n - response `difference` the difference between `a` and `b`.\n"]
2148 pub fn subtract(
2149 &self,
2150
2151 a: impl ::fidl_next::Encode<
2152 <___T as ::fidl_next::Transport>::SendBuffer,
2153 Encoded = ::fidl_next::WireF64,
2154 >,
2155
2156 b: impl ::fidl_next::Encode<
2157 <___T as ::fidl_next::Transport>::SendBuffer,
2158 Encoded = ::fidl_next::WireF64,
2159 >,
2160 ) -> ::fidl_next::TwoWayFuture<'_, super::Subtract, ___T>
2161 where
2162 <___T as ::fidl_next::Transport>::SendBuffer:
2163 ::fidl_next::encoder::InternalHandleEncoder,
2164 {
2165 self.subtract_with(Subtract { a, b })
2166 }
2167
2168 #[doc = " Subtracts two numbers and returns their `difference`.\n\n For example, with `a` being 7.7 and `b` being 3.2, the response\n `difference` is 4.5\n\n + request `a` the number to be subracted _from_.\n + request `b` the number to subtract.\n - response `difference` the difference between `a` and `b`.\n"]
2169 pub fn subtract_with<___R>(
2170 &self,
2171 request: ___R,
2172 ) -> ::fidl_next::TwoWayFuture<'_, super::Subtract, ___T>
2173 where
2174 ___R: ::fidl_next::Encode<
2175 <___T as ::fidl_next::Transport>::SendBuffer,
2176 Encoded = crate::WireCalculatorSubtractRequest,
2177 >,
2178 {
2179 ::fidl_next::TwoWayFuture::from_untyped(
2180 self.sender.send_two_way(7263901511078514040, request),
2181 )
2182 }
2183
2184 #[doc = " Multiplies two numbers and returns their `product`.\n\n For example, with `a` being 1.5 and `b` being 2.0, the response\n `product` is 3.0\n\n + request `a` the first number used to calculatorulate the `product`.\n + request `b` the second number used to calculatorulate the `product`.\n - response `product` the result of multiplying `a` and `b`.\n"]
2185 pub fn multiply(
2186 &self,
2187
2188 a: impl ::fidl_next::Encode<
2189 <___T as ::fidl_next::Transport>::SendBuffer,
2190 Encoded = ::fidl_next::WireF64,
2191 >,
2192
2193 b: impl ::fidl_next::Encode<
2194 <___T as ::fidl_next::Transport>::SendBuffer,
2195 Encoded = ::fidl_next::WireF64,
2196 >,
2197 ) -> ::fidl_next::TwoWayFuture<'_, super::Multiply, ___T>
2198 where
2199 <___T as ::fidl_next::Transport>::SendBuffer:
2200 ::fidl_next::encoder::InternalHandleEncoder,
2201 {
2202 self.multiply_with(Multiply { a, b })
2203 }
2204
2205 #[doc = " Multiplies two numbers and returns their `product`.\n\n For example, with `a` being 1.5 and `b` being 2.0, the response\n `product` is 3.0\n\n + request `a` the first number used to calculatorulate the `product`.\n + request `b` the second number used to calculatorulate the `product`.\n - response `product` the result of multiplying `a` and `b`.\n"]
2206 pub fn multiply_with<___R>(
2207 &self,
2208 request: ___R,
2209 ) -> ::fidl_next::TwoWayFuture<'_, super::Multiply, ___T>
2210 where
2211 ___R: ::fidl_next::Encode<
2212 <___T as ::fidl_next::Transport>::SendBuffer,
2213 Encoded = crate::WireCalculatorMultiplyRequest,
2214 >,
2215 {
2216 ::fidl_next::TwoWayFuture::from_untyped(
2217 self.sender.send_two_way(5579939962788903989, request),
2218 )
2219 }
2220
2221 #[doc = " Divides one number by another and return the `quotient`.\n\n For example with a `dividend` of 2.0 and a `divisor` of 4.0, the\n response `quotient` is 0.5.\n\n + request `dividend` the number to divide with.\n + request `divisor` the number to divide into.\n - response `quotient` the result of dividing the `dividend` into the `divisor`.\n"]
2222 pub fn divide(
2223 &self,
2224
2225 dividend: impl ::fidl_next::Encode<
2226 <___T as ::fidl_next::Transport>::SendBuffer,
2227 Encoded = ::fidl_next::WireF64,
2228 >,
2229
2230 divisor: impl ::fidl_next::Encode<
2231 <___T as ::fidl_next::Transport>::SendBuffer,
2232 Encoded = ::fidl_next::WireF64,
2233 >,
2234 ) -> ::fidl_next::TwoWayFuture<'_, super::Divide, ___T>
2235 where
2236 <___T as ::fidl_next::Transport>::SendBuffer:
2237 ::fidl_next::encoder::InternalHandleEncoder,
2238 {
2239 self.divide_with(Divide { dividend, divisor })
2240 }
2241
2242 #[doc = " Divides one number by another and return the `quotient`.\n\n For example with a `dividend` of 2.0 and a `divisor` of 4.0, the\n response `quotient` is 0.5.\n\n + request `dividend` the number to divide with.\n + request `divisor` the number to divide into.\n - response `quotient` the result of dividing the `dividend` into the `divisor`.\n"]
2243 pub fn divide_with<___R>(
2244 &self,
2245 request: ___R,
2246 ) -> ::fidl_next::TwoWayFuture<'_, super::Divide, ___T>
2247 where
2248 ___R: ::fidl_next::Encode<
2249 <___T as ::fidl_next::Transport>::SendBuffer,
2250 Encoded = crate::WireCalculatorDivideRequest,
2251 >,
2252 {
2253 ::fidl_next::TwoWayFuture::from_untyped(
2254 self.sender.send_two_way(5603396952649205946, request),
2255 )
2256 }
2257
2258 #[doc = " Takes `base` to the `exponent` and returns the `power`.\n\n For example with a `base` of 3.0 and an `exponent` of 4.0, the response\n `power` is 81.0.\n\n + request `base` the number to multiply by itself.\n + request `exponent` the number of times to successively multiply\n `base`.\n - response `power` the result of multiplying `base` by itself `exponent`\n times..\n"]
2259 pub fn pow(
2260 &self,
2261
2262 base: impl ::fidl_next::Encode<
2263 <___T as ::fidl_next::Transport>::SendBuffer,
2264 Encoded = ::fidl_next::WireF64,
2265 >,
2266
2267 exponent: impl ::fidl_next::Encode<
2268 <___T as ::fidl_next::Transport>::SendBuffer,
2269 Encoded = ::fidl_next::WireF64,
2270 >,
2271 ) -> ::fidl_next::TwoWayFuture<'_, super::Pow, ___T>
2272 where
2273 <___T as ::fidl_next::Transport>::SendBuffer:
2274 ::fidl_next::encoder::InternalHandleEncoder,
2275 {
2276 self.pow_with(Pow { base, exponent })
2277 }
2278
2279 #[doc = " Takes `base` to the `exponent` and returns the `power`.\n\n For example with a `base` of 3.0 and an `exponent` of 4.0, the response\n `power` is 81.0.\n\n + request `base` the number to multiply by itself.\n + request `exponent` the number of times to successively multiply\n `base`.\n - response `power` the result of multiplying `base` by itself `exponent`\n times..\n"]
2280 pub fn pow_with<___R>(
2281 &self,
2282 request: ___R,
2283 ) -> ::fidl_next::TwoWayFuture<'_, super::Pow, ___T>
2284 where
2285 ___R: ::fidl_next::Encode<
2286 <___T as ::fidl_next::Transport>::SendBuffer,
2287 Encoded = crate::WireCalculatorPowRequest,
2288 >,
2289 {
2290 ::fidl_next::TwoWayFuture::from_untyped(
2291 self.sender.send_two_way(3776118813804437910, request),
2292 )
2293 }
2294 }
2295
2296 #[repr(transparent)]
2298 pub struct CalculatorServerSender<___T: ::fidl_next::Transport> {
2299 sender: ::fidl_next::protocol::ServerSender<___T>,
2300 }
2301
2302 impl<___T> CalculatorServerSender<___T> where ___T: ::fidl_next::Transport {}
2303 }
2304}
2305
2306pub trait CalculatorClientHandler<
2310 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2311 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2312>
2313{
2314}
2315
2316impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Calculator
2317where
2318 ___H: CalculatorClientHandler<___T> + ::core::marker::Send,
2319 ___T: ::fidl_next::Transport,
2320 <calculator::Add as ::fidl_next::Method>::Response:
2321 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2322 <calculator::Subtract as ::fidl_next::Method>::Response:
2323 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2324 <calculator::Multiply as ::fidl_next::Method>::Response:
2325 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2326 <calculator::Divide as ::fidl_next::Method>::Response:
2327 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2328 <calculator::Pow as ::fidl_next::Method>::Response:
2329 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2330{
2331 async fn on_event(
2332 handler: &mut ___H,
2333 sender: &::fidl_next::ClientSender<Self, ___T>,
2334 ordinal: u64,
2335 buffer: ___T::RecvBuffer,
2336 ) {
2337 match ordinal {
2338 ordinal => sender.close(),
2339 }
2340 }
2341}
2342
2343pub trait CalculatorServerHandler<
2347 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2348 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2349>
2350{
2351 #[doc = " Adds two numbers together and returns their `sum`.\n\n For example, with `a` being 4.5 and `b` being 3.2, the response `sum` is\n 7.7.\n\n + request `a` the first number to be added.\n + request `b` the second number to be added.\n - response `sum` the sum of a and b.\n"]
2352 fn add(
2353 &mut self,
2354 sender: &::fidl_next::ServerSender<Calculator, ___T>,
2355
2356 request: ::fidl_next::Request<calculator::Add, ___T>,
2357
2358 responder: ::fidl_next::Responder<calculator::Add>,
2359 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2360
2361 #[doc = " Subtracts two numbers and returns their `difference`.\n\n For example, with `a` being 7.7 and `b` being 3.2, the response\n `difference` is 4.5\n\n + request `a` the number to be subracted _from_.\n + request `b` the number to subtract.\n - response `difference` the difference between `a` and `b`.\n"]
2362 fn subtract(
2363 &mut self,
2364 sender: &::fidl_next::ServerSender<Calculator, ___T>,
2365
2366 request: ::fidl_next::Request<calculator::Subtract, ___T>,
2367
2368 responder: ::fidl_next::Responder<calculator::Subtract>,
2369 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2370
2371 #[doc = " Multiplies two numbers and returns their `product`.\n\n For example, with `a` being 1.5 and `b` being 2.0, the response\n `product` is 3.0\n\n + request `a` the first number used to calculatorulate the `product`.\n + request `b` the second number used to calculatorulate the `product`.\n - response `product` the result of multiplying `a` and `b`.\n"]
2372 fn multiply(
2373 &mut self,
2374 sender: &::fidl_next::ServerSender<Calculator, ___T>,
2375
2376 request: ::fidl_next::Request<calculator::Multiply, ___T>,
2377
2378 responder: ::fidl_next::Responder<calculator::Multiply>,
2379 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2380
2381 #[doc = " Divides one number by another and return the `quotient`.\n\n For example with a `dividend` of 2.0 and a `divisor` of 4.0, the\n response `quotient` is 0.5.\n\n + request `dividend` the number to divide with.\n + request `divisor` the number to divide into.\n - response `quotient` the result of dividing the `dividend` into the `divisor`.\n"]
2382 fn divide(
2383 &mut self,
2384 sender: &::fidl_next::ServerSender<Calculator, ___T>,
2385
2386 request: ::fidl_next::Request<calculator::Divide, ___T>,
2387
2388 responder: ::fidl_next::Responder<calculator::Divide>,
2389 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2390
2391 #[doc = " Takes `base` to the `exponent` and returns the `power`.\n\n For example with a `base` of 3.0 and an `exponent` of 4.0, the response\n `power` is 81.0.\n\n + request `base` the number to multiply by itself.\n + request `exponent` the number of times to successively multiply\n `base`.\n - response `power` the result of multiplying `base` by itself `exponent`\n times..\n"]
2392 fn pow(
2393 &mut self,
2394 sender: &::fidl_next::ServerSender<Calculator, ___T>,
2395
2396 request: ::fidl_next::Request<calculator::Pow, ___T>,
2397
2398 responder: ::fidl_next::Responder<calculator::Pow>,
2399 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2400}
2401
2402impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Calculator
2403where
2404 ___H: CalculatorServerHandler<___T> + ::core::marker::Send,
2405 ___T: ::fidl_next::Transport,
2406 <calculator::Add as ::fidl_next::Method>::Request:
2407 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2408 <calculator::Subtract as ::fidl_next::Method>::Request:
2409 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2410 <calculator::Multiply as ::fidl_next::Method>::Request:
2411 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2412 <calculator::Divide as ::fidl_next::Method>::Request:
2413 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2414 <calculator::Pow as ::fidl_next::Method>::Request:
2415 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2416{
2417 async fn on_one_way(
2418 handler: &mut ___H,
2419 sender: &::fidl_next::ServerSender<Self, ___T>,
2420 ordinal: u64,
2421 buffer: ___T::RecvBuffer,
2422 ) {
2423 match ordinal {
2424 ordinal => sender.close(),
2425 }
2426 }
2427
2428 async fn on_two_way(
2429 handler: &mut ___H,
2430 sender: &::fidl_next::ServerSender<Self, ___T>,
2431 ordinal: u64,
2432 buffer: ___T::RecvBuffer,
2433 responder: ::fidl_next::protocol::Responder,
2434 ) {
2435 match ordinal {
2436 6855189016650709278 => {
2437 let responder = ::fidl_next::Responder::from_untyped(responder);
2438
2439 match ::fidl_next::DecoderExt::decode(buffer) {
2440 Ok(decoded) => handler.add(sender, decoded, responder).await,
2441 Err(e) => sender.close(),
2442 }
2443 }
2444
2445 7263901511078514040 => {
2446 let responder = ::fidl_next::Responder::from_untyped(responder);
2447
2448 match ::fidl_next::DecoderExt::decode(buffer) {
2449 Ok(decoded) => handler.subtract(sender, decoded, responder).await,
2450 Err(e) => sender.close(),
2451 }
2452 }
2453
2454 5579939962788903989 => {
2455 let responder = ::fidl_next::Responder::from_untyped(responder);
2456
2457 match ::fidl_next::DecoderExt::decode(buffer) {
2458 Ok(decoded) => handler.multiply(sender, decoded, responder).await,
2459 Err(e) => sender.close(),
2460 }
2461 }
2462
2463 5603396952649205946 => {
2464 let responder = ::fidl_next::Responder::from_untyped(responder);
2465
2466 match ::fidl_next::DecoderExt::decode(buffer) {
2467 Ok(decoded) => handler.divide(sender, decoded, responder).await,
2468 Err(e) => sender.close(),
2469 }
2470 }
2471
2472 3776118813804437910 => {
2473 let responder = ::fidl_next::Responder::from_untyped(responder);
2474
2475 match ::fidl_next::DecoderExt::decode(buffer) {
2476 Ok(decoded) => handler.pow(sender, decoded, responder).await,
2477 Err(e) => sender.close(),
2478 }
2479 }
2480
2481 ordinal => sender.close(),
2482 }
2483 }
2484}
2485
2486pub mod compat {
2488
2489 impl ::fidl_next::CompatFrom<crate::CalculatorAddRequest>
2490 for ::fidl_fuchsia_examples_calculator::CalculatorAddRequest
2491 {
2492 #[inline]
2493 fn compat_from(value: crate::CalculatorAddRequest) -> Self {
2494 Self {
2495 a: ::fidl_next::CompatFrom::compat_from(value.a),
2496
2497 b: ::fidl_next::CompatFrom::compat_from(value.b),
2498 }
2499 }
2500 }
2501
2502 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorAddRequest>
2503 for crate::CalculatorAddRequest
2504 {
2505 #[inline]
2506 fn compat_from(value: ::fidl_fuchsia_examples_calculator::CalculatorAddRequest) -> Self {
2507 Self {
2508 a: ::fidl_next::CompatFrom::compat_from(value.a),
2509
2510 b: ::fidl_next::CompatFrom::compat_from(value.b),
2511 }
2512 }
2513 }
2514
2515 impl ::fidl_next::CompatFrom<crate::CalculatorAddResponse>
2516 for ::fidl_fuchsia_examples_calculator::CalculatorAddResponse
2517 {
2518 #[inline]
2519 fn compat_from(value: crate::CalculatorAddResponse) -> Self {
2520 Self { sum: ::fidl_next::CompatFrom::compat_from(value.sum) }
2521 }
2522 }
2523
2524 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorAddResponse>
2525 for crate::CalculatorAddResponse
2526 {
2527 #[inline]
2528 fn compat_from(value: ::fidl_fuchsia_examples_calculator::CalculatorAddResponse) -> Self {
2529 Self { sum: ::fidl_next::CompatFrom::compat_from(value.sum) }
2530 }
2531 }
2532
2533 impl ::fidl_next::CompatFrom<crate::CalculatorSubtractRequest>
2534 for ::fidl_fuchsia_examples_calculator::CalculatorSubtractRequest
2535 {
2536 #[inline]
2537 fn compat_from(value: crate::CalculatorSubtractRequest) -> Self {
2538 Self {
2539 a: ::fidl_next::CompatFrom::compat_from(value.a),
2540
2541 b: ::fidl_next::CompatFrom::compat_from(value.b),
2542 }
2543 }
2544 }
2545
2546 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorSubtractRequest>
2547 for crate::CalculatorSubtractRequest
2548 {
2549 #[inline]
2550 fn compat_from(
2551 value: ::fidl_fuchsia_examples_calculator::CalculatorSubtractRequest,
2552 ) -> Self {
2553 Self {
2554 a: ::fidl_next::CompatFrom::compat_from(value.a),
2555
2556 b: ::fidl_next::CompatFrom::compat_from(value.b),
2557 }
2558 }
2559 }
2560
2561 impl ::fidl_next::CompatFrom<crate::CalculatorSubtractResponse>
2562 for ::fidl_fuchsia_examples_calculator::CalculatorSubtractResponse
2563 {
2564 #[inline]
2565 fn compat_from(value: crate::CalculatorSubtractResponse) -> Self {
2566 Self { difference: ::fidl_next::CompatFrom::compat_from(value.difference) }
2567 }
2568 }
2569
2570 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorSubtractResponse>
2571 for crate::CalculatorSubtractResponse
2572 {
2573 #[inline]
2574 fn compat_from(
2575 value: ::fidl_fuchsia_examples_calculator::CalculatorSubtractResponse,
2576 ) -> Self {
2577 Self { difference: ::fidl_next::CompatFrom::compat_from(value.difference) }
2578 }
2579 }
2580
2581 impl ::fidl_next::CompatFrom<crate::CalculatorMultiplyRequest>
2582 for ::fidl_fuchsia_examples_calculator::CalculatorMultiplyRequest
2583 {
2584 #[inline]
2585 fn compat_from(value: crate::CalculatorMultiplyRequest) -> Self {
2586 Self {
2587 a: ::fidl_next::CompatFrom::compat_from(value.a),
2588
2589 b: ::fidl_next::CompatFrom::compat_from(value.b),
2590 }
2591 }
2592 }
2593
2594 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorMultiplyRequest>
2595 for crate::CalculatorMultiplyRequest
2596 {
2597 #[inline]
2598 fn compat_from(
2599 value: ::fidl_fuchsia_examples_calculator::CalculatorMultiplyRequest,
2600 ) -> Self {
2601 Self {
2602 a: ::fidl_next::CompatFrom::compat_from(value.a),
2603
2604 b: ::fidl_next::CompatFrom::compat_from(value.b),
2605 }
2606 }
2607 }
2608
2609 impl ::fidl_next::CompatFrom<crate::CalculatorMultiplyResponse>
2610 for ::fidl_fuchsia_examples_calculator::CalculatorMultiplyResponse
2611 {
2612 #[inline]
2613 fn compat_from(value: crate::CalculatorMultiplyResponse) -> Self {
2614 Self { product: ::fidl_next::CompatFrom::compat_from(value.product) }
2615 }
2616 }
2617
2618 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorMultiplyResponse>
2619 for crate::CalculatorMultiplyResponse
2620 {
2621 #[inline]
2622 fn compat_from(
2623 value: ::fidl_fuchsia_examples_calculator::CalculatorMultiplyResponse,
2624 ) -> Self {
2625 Self { product: ::fidl_next::CompatFrom::compat_from(value.product) }
2626 }
2627 }
2628
2629 impl ::fidl_next::CompatFrom<crate::CalculatorDivideRequest>
2630 for ::fidl_fuchsia_examples_calculator::CalculatorDivideRequest
2631 {
2632 #[inline]
2633 fn compat_from(value: crate::CalculatorDivideRequest) -> Self {
2634 Self {
2635 dividend: ::fidl_next::CompatFrom::compat_from(value.dividend),
2636
2637 divisor: ::fidl_next::CompatFrom::compat_from(value.divisor),
2638 }
2639 }
2640 }
2641
2642 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorDivideRequest>
2643 for crate::CalculatorDivideRequest
2644 {
2645 #[inline]
2646 fn compat_from(value: ::fidl_fuchsia_examples_calculator::CalculatorDivideRequest) -> Self {
2647 Self {
2648 dividend: ::fidl_next::CompatFrom::compat_from(value.dividend),
2649
2650 divisor: ::fidl_next::CompatFrom::compat_from(value.divisor),
2651 }
2652 }
2653 }
2654
2655 impl ::fidl_next::CompatFrom<crate::CalculatorDivideResponse>
2656 for ::fidl_fuchsia_examples_calculator::CalculatorDivideResponse
2657 {
2658 #[inline]
2659 fn compat_from(value: crate::CalculatorDivideResponse) -> Self {
2660 Self { quotient: ::fidl_next::CompatFrom::compat_from(value.quotient) }
2661 }
2662 }
2663
2664 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorDivideResponse>
2665 for crate::CalculatorDivideResponse
2666 {
2667 #[inline]
2668 fn compat_from(
2669 value: ::fidl_fuchsia_examples_calculator::CalculatorDivideResponse,
2670 ) -> Self {
2671 Self { quotient: ::fidl_next::CompatFrom::compat_from(value.quotient) }
2672 }
2673 }
2674
2675 impl ::fidl_next::CompatFrom<crate::CalculatorPowRequest>
2676 for ::fidl_fuchsia_examples_calculator::CalculatorPowRequest
2677 {
2678 #[inline]
2679 fn compat_from(value: crate::CalculatorPowRequest) -> Self {
2680 Self {
2681 base: ::fidl_next::CompatFrom::compat_from(value.base),
2682
2683 exponent: ::fidl_next::CompatFrom::compat_from(value.exponent),
2684 }
2685 }
2686 }
2687
2688 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorPowRequest>
2689 for crate::CalculatorPowRequest
2690 {
2691 #[inline]
2692 fn compat_from(value: ::fidl_fuchsia_examples_calculator::CalculatorPowRequest) -> Self {
2693 Self {
2694 base: ::fidl_next::CompatFrom::compat_from(value.base),
2695
2696 exponent: ::fidl_next::CompatFrom::compat_from(value.exponent),
2697 }
2698 }
2699 }
2700
2701 impl ::fidl_next::CompatFrom<crate::CalculatorPowResponse>
2702 for ::fidl_fuchsia_examples_calculator::CalculatorPowResponse
2703 {
2704 #[inline]
2705 fn compat_from(value: crate::CalculatorPowResponse) -> Self {
2706 Self { power: ::fidl_next::CompatFrom::compat_from(value.power) }
2707 }
2708 }
2709
2710 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorPowResponse>
2711 for crate::CalculatorPowResponse
2712 {
2713 #[inline]
2714 fn compat_from(value: ::fidl_fuchsia_examples_calculator::CalculatorPowResponse) -> Self {
2715 Self { power: ::fidl_next::CompatFrom::compat_from(value.power) }
2716 }
2717 }
2718
2719 #[cfg(target_os = "fuchsia")]
2720 pub type CalculatorProxy = ::fidl_next::ClientSender<crate::Calculator>;
2723
2724 impl ::fidl_next::CompatFrom<crate::Calculator>
2725 for ::fidl_fuchsia_examples_calculator::CalculatorMarker
2726 {
2727 fn compat_from(_: crate::Calculator) -> Self {
2728 Self
2729 }
2730 }
2731
2732 impl ::fidl_next::CompatFrom<::fidl_fuchsia_examples_calculator::CalculatorMarker>
2733 for crate::Calculator
2734 {
2735 fn compat_from(_: ::fidl_fuchsia_examples_calculator::CalculatorMarker) -> Self {
2736 Self
2737 }
2738 }
2739
2740 #[cfg(target_os = "fuchsia")]
2741
2742 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_examples_calculator::CalculatorProxy>
2743 for crate::Calculator
2744 {
2745 fn client_compat_from(
2746 proxy: ::fidl_fuchsia_examples_calculator::CalculatorProxy,
2747 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
2748 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
2749 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
2750 ::fidl_next::Client::new(client_end)
2751 }
2752 }
2753}