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
11pub type Memory = String;
13
14pub type Number = String;
17
18pub const MAX_PICONET_SIZE: u64 = 8;
19
20#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
22#[repr(u32)]
23pub enum CallDirection {
24 MobileOriginated = 1,
26 MobileTerminated = 2,
28}
29
30impl CallDirection {
31 #[inline]
32 pub fn from_primitive(prim: u32) -> Option<Self> {
33 match prim {
34 1 => Some(Self::MobileOriginated),
35 2 => Some(Self::MobileTerminated),
36 _ => None,
37 }
38 }
39
40 #[inline]
41 pub const fn into_primitive(self) -> u32 {
42 self as u32
43 }
44
45 #[deprecated = "Strict enums should not use `is_unknown`"]
46 #[inline]
47 pub fn is_unknown(&self) -> bool {
48 false
49 }
50}
51
52#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
54pub enum CallState {
55 OutgoingDialing,
59 OutgoingAlerting,
63 IncomingRinging,
65 IncomingWaiting,
67 OngoingHeld,
69 OngoingActive,
71 Terminated,
73 TransferredToAg,
76 #[doc(hidden)]
77 __SourceBreaking { unknown_ordinal: u32 },
78}
79
80#[macro_export]
82macro_rules! CallStateUnknown {
83 () => {
84 _
85 };
86}
87
88impl CallState {
89 #[inline]
90 pub fn from_primitive(prim: u32) -> Option<Self> {
91 match prim {
92 1 => Some(Self::OutgoingDialing),
93 2 => Some(Self::OutgoingAlerting),
94 3 => Some(Self::IncomingRinging),
95 4 => Some(Self::IncomingWaiting),
96 5 => Some(Self::OngoingHeld),
97 6 => Some(Self::OngoingActive),
98 7 => Some(Self::Terminated),
99 8 => Some(Self::TransferredToAg),
100 _ => None,
101 }
102 }
103
104 #[inline]
105 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
106 match prim {
107 1 => Self::OutgoingDialing,
108 2 => Self::OutgoingAlerting,
109 3 => Self::IncomingRinging,
110 4 => Self::IncomingWaiting,
111 5 => Self::OngoingHeld,
112 6 => Self::OngoingActive,
113 7 => Self::Terminated,
114 8 => Self::TransferredToAg,
115 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
116 }
117 }
118
119 #[inline]
120 pub fn unknown() -> Self {
121 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
122 }
123
124 #[inline]
125 pub const fn into_primitive(self) -> u32 {
126 match self {
127 Self::OutgoingDialing => 1,
128 Self::OutgoingAlerting => 2,
129 Self::IncomingRinging => 3,
130 Self::IncomingWaiting => 4,
131 Self::OngoingHeld => 5,
132 Self::OngoingActive => 6,
133 Self::Terminated => 7,
134 Self::TransferredToAg => 8,
135 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
136 }
137 }
138
139 #[inline]
140 pub fn is_unknown(&self) -> bool {
141 match self {
142 Self::__SourceBreaking { unknown_ordinal: _ } => true,
143 _ => false,
144 }
145 }
146}
147
148#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
150#[repr(u8)]
151pub enum DtmfCode {
152 One = 49,
154 Two = 50,
156 Three = 51,
158 Four = 52,
160 Five = 53,
162 Six = 54,
164 Seven = 55,
166 Eight = 56,
168 Nine = 57,
170 NumberSign = 35,
172 Zero = 48,
174 Asterisk = 42,
176 A = 65,
178 B = 66,
180 C = 67,
182 D = 68,
184}
185
186impl DtmfCode {
187 #[inline]
188 pub fn from_primitive(prim: u8) -> Option<Self> {
189 match prim {
190 49 => Some(Self::One),
191 50 => Some(Self::Two),
192 51 => Some(Self::Three),
193 52 => Some(Self::Four),
194 53 => Some(Self::Five),
195 54 => Some(Self::Six),
196 55 => Some(Self::Seven),
197 56 => Some(Self::Eight),
198 57 => Some(Self::Nine),
199 35 => Some(Self::NumberSign),
200 48 => Some(Self::Zero),
201 42 => Some(Self::Asterisk),
202 65 => Some(Self::A),
203 66 => Some(Self::B),
204 67 => Some(Self::C),
205 68 => Some(Self::D),
206 _ => None,
207 }
208 }
209
210 #[inline]
211 pub const fn into_primitive(self) -> u8 {
212 self as u8
213 }
214
215 #[deprecated = "Strict enums should not use `is_unknown`"]
216 #[inline]
217 pub fn is_unknown(&self) -> bool {
218 false
219 }
220}
221
222#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
225#[repr(i8)]
226pub enum SignalStrength {
227 None = 1,
228 VeryLow = 2,
229 Low = 3,
230 Medium = 4,
231 High = 5,
232 VeryHigh = 6,
233}
234
235impl SignalStrength {
236 #[inline]
237 pub fn from_primitive(prim: i8) -> Option<Self> {
238 match prim {
239 1 => Some(Self::None),
240 2 => Some(Self::VeryLow),
241 3 => Some(Self::Low),
242 4 => Some(Self::Medium),
243 5 => Some(Self::High),
244 6 => Some(Self::VeryHigh),
245 _ => None,
246 }
247 }
248
249 #[inline]
250 pub const fn into_primitive(self) -> i8 {
251 self as i8
252 }
253
254 #[deprecated = "Strict enums should not use `is_unknown`"]
255 #[inline]
256 pub fn is_unknown(&self) -> bool {
257 false
258 }
259}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262pub struct CallSendDtmfCodeRequest {
263 pub code: DtmfCode,
264}
265
266impl fidl::Persistable for CallSendDtmfCodeRequest {}
267
268#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
269pub struct CallWatchStateResponse {
270 pub state: CallState,
271}
272
273impl fidl::Persistable for CallWatchStateResponse {}
274
275#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
276#[repr(C)]
277pub struct HeadsetGainSetMicrophoneGainRequest {
278 pub requested: u8,
279}
280
281impl fidl::Persistable for HeadsetGainSetMicrophoneGainRequest {}
282
283#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
284#[repr(C)]
285pub struct HeadsetGainSetSpeakerGainRequest {
286 pub requested: u8,
287}
288
289impl fidl::Persistable for HeadsetGainSetSpeakerGainRequest {}
290
291#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
292#[repr(C)]
293pub struct HeadsetGainWatchMicrophoneGainResponse {
294 pub gain: u8,
295}
296
297impl fidl::Persistable for HeadsetGainWatchMicrophoneGainResponse {}
298
299#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
300#[repr(C)]
301pub struct HeadsetGainWatchSpeakerGainResponse {
302 pub gain: u8,
303}
304
305impl fidl::Persistable for HeadsetGainWatchSpeakerGainResponse {}
306
307#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
308pub struct PeerHandlerQueryOperatorResponse {
309 pub operator: Option<String>,
310}
311
312impl fidl::Persistable for PeerHandlerQueryOperatorResponse {}
313
314#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315#[repr(C)]
316pub struct PeerHandlerReportHeadsetBatteryLevelRequest {
317 pub level: u8,
318}
319
320impl fidl::Persistable for PeerHandlerReportHeadsetBatteryLevelRequest {}
321
322#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
323pub struct PeerHandlerRequestOutgoingCallRequest {
324 pub action: CallAction,
325}
326
327impl fidl::Persistable for PeerHandlerRequestOutgoingCallRequest {}
328
329#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
330pub struct PeerHandlerSetNrecModeRequest {
331 pub enabled: bool,
332}
333
334impl fidl::Persistable for PeerHandlerSetNrecModeRequest {}
335
336#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
337pub struct PeerHandlerSubscriberNumberInformationResponse {
338 pub numbers: Vec<String>,
339}
340
341impl fidl::Persistable for PeerHandlerSubscriberNumberInformationResponse {}
342
343#[derive(Clone, Debug, PartialEq)]
344pub struct PeerHandlerWatchNetworkInformationResponse {
345 pub update: NetworkInformation,
346}
347
348impl fidl::Persistable for PeerHandlerWatchNetworkInformationResponse {}
349
350#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
352pub struct RedialLast;
353
354impl fidl::Persistable for RedialLast {}
355
356#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
358pub struct TransferActive;
359
360impl fidl::Persistable for TransferActive {}
361
362#[derive(Clone, Debug, Default, PartialEq)]
365pub struct NetworkInformation {
366 pub service_available: Option<bool>,
369 pub signal_strength: Option<SignalStrength>,
372 pub roaming: Option<bool>,
375 #[doc(hidden)]
376 pub __source_breaking: fidl::marker::SourceBreaking,
377}
378
379impl fidl::Persistable for NetworkInformation {}
380
381#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383pub enum CallAction {
384 DialFromNumber(String),
387 DialFromLocation(String),
390 RedialLast(RedialLast),
393 TransferActive(TransferActive),
398}
399
400impl CallAction {
401 #[inline]
402 pub fn ordinal(&self) -> u64 {
403 match *self {
404 Self::DialFromNumber(_) => 1,
405 Self::DialFromLocation(_) => 2,
406 Self::RedialLast(_) => 3,
407 Self::TransferActive(_) => 4,
408 }
409 }
410
411 #[deprecated = "Strict unions should not use `is_unknown`"]
412 #[inline]
413 pub fn is_unknown(&self) -> bool {
414 false
415 }
416}
417
418impl fidl::Persistable for CallAction {}
419
420mod internal {
421 use super::*;
422 unsafe impl fidl::encoding::TypeMarker for CallDirection {
423 type Owned = Self;
424
425 #[inline(always)]
426 fn inline_align(_context: fidl::encoding::Context) -> usize {
427 std::mem::align_of::<u32>()
428 }
429
430 #[inline(always)]
431 fn inline_size(_context: fidl::encoding::Context) -> usize {
432 std::mem::size_of::<u32>()
433 }
434
435 #[inline(always)]
436 fn encode_is_copy() -> bool {
437 true
438 }
439
440 #[inline(always)]
441 fn decode_is_copy() -> bool {
442 false
443 }
444 }
445
446 impl fidl::encoding::ValueTypeMarker for CallDirection {
447 type Borrowed<'a> = Self;
448 #[inline(always)]
449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
450 *value
451 }
452 }
453
454 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CallDirection {
455 #[inline]
456 unsafe fn encode(
457 self,
458 encoder: &mut fidl::encoding::Encoder<'_, D>,
459 offset: usize,
460 _depth: fidl::encoding::Depth,
461 ) -> fidl::Result<()> {
462 encoder.debug_check_bounds::<Self>(offset);
463 encoder.write_num(self.into_primitive(), offset);
464 Ok(())
465 }
466 }
467
468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CallDirection {
469 #[inline(always)]
470 fn new_empty() -> Self {
471 Self::MobileOriginated
472 }
473
474 #[inline]
475 unsafe fn decode(
476 &mut self,
477 decoder: &mut fidl::encoding::Decoder<'_, D>,
478 offset: usize,
479 _depth: fidl::encoding::Depth,
480 ) -> fidl::Result<()> {
481 decoder.debug_check_bounds::<Self>(offset);
482 let prim = decoder.read_num::<u32>(offset);
483
484 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
485 Ok(())
486 }
487 }
488 unsafe impl fidl::encoding::TypeMarker for CallState {
489 type Owned = Self;
490
491 #[inline(always)]
492 fn inline_align(_context: fidl::encoding::Context) -> usize {
493 std::mem::align_of::<u32>()
494 }
495
496 #[inline(always)]
497 fn inline_size(_context: fidl::encoding::Context) -> usize {
498 std::mem::size_of::<u32>()
499 }
500
501 #[inline(always)]
502 fn encode_is_copy() -> bool {
503 false
504 }
505
506 #[inline(always)]
507 fn decode_is_copy() -> bool {
508 false
509 }
510 }
511
512 impl fidl::encoding::ValueTypeMarker for CallState {
513 type Borrowed<'a> = Self;
514 #[inline(always)]
515 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
516 *value
517 }
518 }
519
520 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CallState {
521 #[inline]
522 unsafe fn encode(
523 self,
524 encoder: &mut fidl::encoding::Encoder<'_, D>,
525 offset: usize,
526 _depth: fidl::encoding::Depth,
527 ) -> fidl::Result<()> {
528 encoder.debug_check_bounds::<Self>(offset);
529 encoder.write_num(self.into_primitive(), offset);
530 Ok(())
531 }
532 }
533
534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CallState {
535 #[inline(always)]
536 fn new_empty() -> Self {
537 Self::unknown()
538 }
539
540 #[inline]
541 unsafe fn decode(
542 &mut self,
543 decoder: &mut fidl::encoding::Decoder<'_, D>,
544 offset: usize,
545 _depth: fidl::encoding::Depth,
546 ) -> fidl::Result<()> {
547 decoder.debug_check_bounds::<Self>(offset);
548 let prim = decoder.read_num::<u32>(offset);
549
550 *self = Self::from_primitive_allow_unknown(prim);
551 Ok(())
552 }
553 }
554 unsafe impl fidl::encoding::TypeMarker for DtmfCode {
555 type Owned = Self;
556
557 #[inline(always)]
558 fn inline_align(_context: fidl::encoding::Context) -> usize {
559 std::mem::align_of::<u8>()
560 }
561
562 #[inline(always)]
563 fn inline_size(_context: fidl::encoding::Context) -> usize {
564 std::mem::size_of::<u8>()
565 }
566
567 #[inline(always)]
568 fn encode_is_copy() -> bool {
569 true
570 }
571
572 #[inline(always)]
573 fn decode_is_copy() -> bool {
574 false
575 }
576 }
577
578 impl fidl::encoding::ValueTypeMarker for DtmfCode {
579 type Borrowed<'a> = Self;
580 #[inline(always)]
581 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
582 *value
583 }
584 }
585
586 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DtmfCode {
587 #[inline]
588 unsafe fn encode(
589 self,
590 encoder: &mut fidl::encoding::Encoder<'_, D>,
591 offset: usize,
592 _depth: fidl::encoding::Depth,
593 ) -> fidl::Result<()> {
594 encoder.debug_check_bounds::<Self>(offset);
595 encoder.write_num(self.into_primitive(), offset);
596 Ok(())
597 }
598 }
599
600 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DtmfCode {
601 #[inline(always)]
602 fn new_empty() -> Self {
603 Self::NumberSign
604 }
605
606 #[inline]
607 unsafe fn decode(
608 &mut self,
609 decoder: &mut fidl::encoding::Decoder<'_, D>,
610 offset: usize,
611 _depth: fidl::encoding::Depth,
612 ) -> fidl::Result<()> {
613 decoder.debug_check_bounds::<Self>(offset);
614 let prim = decoder.read_num::<u8>(offset);
615
616 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
617 Ok(())
618 }
619 }
620 unsafe impl fidl::encoding::TypeMarker for SignalStrength {
621 type Owned = Self;
622
623 #[inline(always)]
624 fn inline_align(_context: fidl::encoding::Context) -> usize {
625 std::mem::align_of::<i8>()
626 }
627
628 #[inline(always)]
629 fn inline_size(_context: fidl::encoding::Context) -> usize {
630 std::mem::size_of::<i8>()
631 }
632
633 #[inline(always)]
634 fn encode_is_copy() -> bool {
635 true
636 }
637
638 #[inline(always)]
639 fn decode_is_copy() -> bool {
640 false
641 }
642 }
643
644 impl fidl::encoding::ValueTypeMarker for SignalStrength {
645 type Borrowed<'a> = Self;
646 #[inline(always)]
647 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
648 *value
649 }
650 }
651
652 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SignalStrength {
653 #[inline]
654 unsafe fn encode(
655 self,
656 encoder: &mut fidl::encoding::Encoder<'_, D>,
657 offset: usize,
658 _depth: fidl::encoding::Depth,
659 ) -> fidl::Result<()> {
660 encoder.debug_check_bounds::<Self>(offset);
661 encoder.write_num(self.into_primitive(), offset);
662 Ok(())
663 }
664 }
665
666 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SignalStrength {
667 #[inline(always)]
668 fn new_empty() -> Self {
669 Self::None
670 }
671
672 #[inline]
673 unsafe fn decode(
674 &mut self,
675 decoder: &mut fidl::encoding::Decoder<'_, D>,
676 offset: usize,
677 _depth: fidl::encoding::Depth,
678 ) -> fidl::Result<()> {
679 decoder.debug_check_bounds::<Self>(offset);
680 let prim = decoder.read_num::<i8>(offset);
681
682 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
683 Ok(())
684 }
685 }
686
687 impl fidl::encoding::ValueTypeMarker for CallSendDtmfCodeRequest {
688 type Borrowed<'a> = &'a Self;
689 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
690 value
691 }
692 }
693
694 unsafe impl fidl::encoding::TypeMarker for CallSendDtmfCodeRequest {
695 type Owned = Self;
696
697 #[inline(always)]
698 fn inline_align(_context: fidl::encoding::Context) -> usize {
699 1
700 }
701
702 #[inline(always)]
703 fn inline_size(_context: fidl::encoding::Context) -> usize {
704 1
705 }
706 }
707
708 unsafe impl<D: fidl::encoding::ResourceDialect>
709 fidl::encoding::Encode<CallSendDtmfCodeRequest, D> for &CallSendDtmfCodeRequest
710 {
711 #[inline]
712 unsafe fn encode(
713 self,
714 encoder: &mut fidl::encoding::Encoder<'_, D>,
715 offset: usize,
716 _depth: fidl::encoding::Depth,
717 ) -> fidl::Result<()> {
718 encoder.debug_check_bounds::<CallSendDtmfCodeRequest>(offset);
719 fidl::encoding::Encode::<CallSendDtmfCodeRequest, D>::encode(
721 (<DtmfCode as fidl::encoding::ValueTypeMarker>::borrow(&self.code),),
722 encoder,
723 offset,
724 _depth,
725 )
726 }
727 }
728 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DtmfCode, D>>
729 fidl::encoding::Encode<CallSendDtmfCodeRequest, D> for (T0,)
730 {
731 #[inline]
732 unsafe fn encode(
733 self,
734 encoder: &mut fidl::encoding::Encoder<'_, D>,
735 offset: usize,
736 depth: fidl::encoding::Depth,
737 ) -> fidl::Result<()> {
738 encoder.debug_check_bounds::<CallSendDtmfCodeRequest>(offset);
739 self.0.encode(encoder, offset + 0, depth)?;
743 Ok(())
744 }
745 }
746
747 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
748 for CallSendDtmfCodeRequest
749 {
750 #[inline(always)]
751 fn new_empty() -> Self {
752 Self { code: fidl::new_empty!(DtmfCode, 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!(DtmfCode, D, &mut self.code, decoder, offset + 0, _depth)?;
765 Ok(())
766 }
767 }
768
769 impl fidl::encoding::ValueTypeMarker for CallWatchStateResponse {
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 CallWatchStateResponse {
777 type Owned = Self;
778
779 #[inline(always)]
780 fn inline_align(_context: fidl::encoding::Context) -> usize {
781 4
782 }
783
784 #[inline(always)]
785 fn inline_size(_context: fidl::encoding::Context) -> usize {
786 4
787 }
788 }
789
790 unsafe impl<D: fidl::encoding::ResourceDialect>
791 fidl::encoding::Encode<CallWatchStateResponse, D> for &CallWatchStateResponse
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::<CallWatchStateResponse>(offset);
801 fidl::encoding::Encode::<CallWatchStateResponse, D>::encode(
803 (<CallState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
804 encoder,
805 offset,
806 _depth,
807 )
808 }
809 }
810 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CallState, D>>
811 fidl::encoding::Encode<CallWatchStateResponse, D> for (T0,)
812 {
813 #[inline]
814 unsafe fn encode(
815 self,
816 encoder: &mut fidl::encoding::Encoder<'_, D>,
817 offset: usize,
818 depth: fidl::encoding::Depth,
819 ) -> fidl::Result<()> {
820 encoder.debug_check_bounds::<CallWatchStateResponse>(offset);
821 self.0.encode(encoder, offset + 0, depth)?;
825 Ok(())
826 }
827 }
828
829 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
830 for CallWatchStateResponse
831 {
832 #[inline(always)]
833 fn new_empty() -> Self {
834 Self { state: fidl::new_empty!(CallState, D) }
835 }
836
837 #[inline]
838 unsafe fn decode(
839 &mut self,
840 decoder: &mut fidl::encoding::Decoder<'_, D>,
841 offset: usize,
842 _depth: fidl::encoding::Depth,
843 ) -> fidl::Result<()> {
844 decoder.debug_check_bounds::<Self>(offset);
845 fidl::decode!(CallState, D, &mut self.state, decoder, offset + 0, _depth)?;
847 Ok(())
848 }
849 }
850
851 impl fidl::encoding::ValueTypeMarker for HeadsetGainSetMicrophoneGainRequest {
852 type Borrowed<'a> = &'a Self;
853 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
854 value
855 }
856 }
857
858 unsafe impl fidl::encoding::TypeMarker for HeadsetGainSetMicrophoneGainRequest {
859 type Owned = Self;
860
861 #[inline(always)]
862 fn inline_align(_context: fidl::encoding::Context) -> usize {
863 1
864 }
865
866 #[inline(always)]
867 fn inline_size(_context: fidl::encoding::Context) -> usize {
868 1
869 }
870 #[inline(always)]
871 fn encode_is_copy() -> bool {
872 true
873 }
874
875 #[inline(always)]
876 fn decode_is_copy() -> bool {
877 true
878 }
879 }
880
881 unsafe impl<D: fidl::encoding::ResourceDialect>
882 fidl::encoding::Encode<HeadsetGainSetMicrophoneGainRequest, D>
883 for &HeadsetGainSetMicrophoneGainRequest
884 {
885 #[inline]
886 unsafe fn encode(
887 self,
888 encoder: &mut fidl::encoding::Encoder<'_, D>,
889 offset: usize,
890 _depth: fidl::encoding::Depth,
891 ) -> fidl::Result<()> {
892 encoder.debug_check_bounds::<HeadsetGainSetMicrophoneGainRequest>(offset);
893 unsafe {
894 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
896 (buf_ptr as *mut HeadsetGainSetMicrophoneGainRequest)
897 .write_unaligned((self as *const HeadsetGainSetMicrophoneGainRequest).read());
898 }
901 Ok(())
902 }
903 }
904 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
905 fidl::encoding::Encode<HeadsetGainSetMicrophoneGainRequest, D> for (T0,)
906 {
907 #[inline]
908 unsafe fn encode(
909 self,
910 encoder: &mut fidl::encoding::Encoder<'_, D>,
911 offset: usize,
912 depth: fidl::encoding::Depth,
913 ) -> fidl::Result<()> {
914 encoder.debug_check_bounds::<HeadsetGainSetMicrophoneGainRequest>(offset);
915 self.0.encode(encoder, offset + 0, depth)?;
919 Ok(())
920 }
921 }
922
923 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
924 for HeadsetGainSetMicrophoneGainRequest
925 {
926 #[inline(always)]
927 fn new_empty() -> Self {
928 Self { requested: fidl::new_empty!(u8, D) }
929 }
930
931 #[inline]
932 unsafe fn decode(
933 &mut self,
934 decoder: &mut fidl::encoding::Decoder<'_, D>,
935 offset: usize,
936 _depth: fidl::encoding::Depth,
937 ) -> fidl::Result<()> {
938 decoder.debug_check_bounds::<Self>(offset);
939 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
940 unsafe {
943 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
944 }
945 Ok(())
946 }
947 }
948
949 impl fidl::encoding::ValueTypeMarker for HeadsetGainSetSpeakerGainRequest {
950 type Borrowed<'a> = &'a Self;
951 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
952 value
953 }
954 }
955
956 unsafe impl fidl::encoding::TypeMarker for HeadsetGainSetSpeakerGainRequest {
957 type Owned = Self;
958
959 #[inline(always)]
960 fn inline_align(_context: fidl::encoding::Context) -> usize {
961 1
962 }
963
964 #[inline(always)]
965 fn inline_size(_context: fidl::encoding::Context) -> usize {
966 1
967 }
968 #[inline(always)]
969 fn encode_is_copy() -> bool {
970 true
971 }
972
973 #[inline(always)]
974 fn decode_is_copy() -> bool {
975 true
976 }
977 }
978
979 unsafe impl<D: fidl::encoding::ResourceDialect>
980 fidl::encoding::Encode<HeadsetGainSetSpeakerGainRequest, D>
981 for &HeadsetGainSetSpeakerGainRequest
982 {
983 #[inline]
984 unsafe fn encode(
985 self,
986 encoder: &mut fidl::encoding::Encoder<'_, D>,
987 offset: usize,
988 _depth: fidl::encoding::Depth,
989 ) -> fidl::Result<()> {
990 encoder.debug_check_bounds::<HeadsetGainSetSpeakerGainRequest>(offset);
991 unsafe {
992 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
994 (buf_ptr as *mut HeadsetGainSetSpeakerGainRequest)
995 .write_unaligned((self as *const HeadsetGainSetSpeakerGainRequest).read());
996 }
999 Ok(())
1000 }
1001 }
1002 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1003 fidl::encoding::Encode<HeadsetGainSetSpeakerGainRequest, D> for (T0,)
1004 {
1005 #[inline]
1006 unsafe fn encode(
1007 self,
1008 encoder: &mut fidl::encoding::Encoder<'_, D>,
1009 offset: usize,
1010 depth: fidl::encoding::Depth,
1011 ) -> fidl::Result<()> {
1012 encoder.debug_check_bounds::<HeadsetGainSetSpeakerGainRequest>(offset);
1013 self.0.encode(encoder, offset + 0, depth)?;
1017 Ok(())
1018 }
1019 }
1020
1021 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1022 for HeadsetGainSetSpeakerGainRequest
1023 {
1024 #[inline(always)]
1025 fn new_empty() -> Self {
1026 Self { requested: fidl::new_empty!(u8, D) }
1027 }
1028
1029 #[inline]
1030 unsafe fn decode(
1031 &mut self,
1032 decoder: &mut fidl::encoding::Decoder<'_, D>,
1033 offset: usize,
1034 _depth: fidl::encoding::Depth,
1035 ) -> fidl::Result<()> {
1036 decoder.debug_check_bounds::<Self>(offset);
1037 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1038 unsafe {
1041 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1042 }
1043 Ok(())
1044 }
1045 }
1046
1047 impl fidl::encoding::ValueTypeMarker for HeadsetGainWatchMicrophoneGainResponse {
1048 type Borrowed<'a> = &'a Self;
1049 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1050 value
1051 }
1052 }
1053
1054 unsafe impl fidl::encoding::TypeMarker for HeadsetGainWatchMicrophoneGainResponse {
1055 type Owned = Self;
1056
1057 #[inline(always)]
1058 fn inline_align(_context: fidl::encoding::Context) -> usize {
1059 1
1060 }
1061
1062 #[inline(always)]
1063 fn inline_size(_context: fidl::encoding::Context) -> usize {
1064 1
1065 }
1066 #[inline(always)]
1067 fn encode_is_copy() -> bool {
1068 true
1069 }
1070
1071 #[inline(always)]
1072 fn decode_is_copy() -> bool {
1073 true
1074 }
1075 }
1076
1077 unsafe impl<D: fidl::encoding::ResourceDialect>
1078 fidl::encoding::Encode<HeadsetGainWatchMicrophoneGainResponse, D>
1079 for &HeadsetGainWatchMicrophoneGainResponse
1080 {
1081 #[inline]
1082 unsafe fn encode(
1083 self,
1084 encoder: &mut fidl::encoding::Encoder<'_, D>,
1085 offset: usize,
1086 _depth: fidl::encoding::Depth,
1087 ) -> fidl::Result<()> {
1088 encoder.debug_check_bounds::<HeadsetGainWatchMicrophoneGainResponse>(offset);
1089 unsafe {
1090 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1092 (buf_ptr as *mut HeadsetGainWatchMicrophoneGainResponse).write_unaligned(
1093 (self as *const HeadsetGainWatchMicrophoneGainResponse).read(),
1094 );
1095 }
1098 Ok(())
1099 }
1100 }
1101 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1102 fidl::encoding::Encode<HeadsetGainWatchMicrophoneGainResponse, D> for (T0,)
1103 {
1104 #[inline]
1105 unsafe fn encode(
1106 self,
1107 encoder: &mut fidl::encoding::Encoder<'_, D>,
1108 offset: usize,
1109 depth: fidl::encoding::Depth,
1110 ) -> fidl::Result<()> {
1111 encoder.debug_check_bounds::<HeadsetGainWatchMicrophoneGainResponse>(offset);
1112 self.0.encode(encoder, offset + 0, depth)?;
1116 Ok(())
1117 }
1118 }
1119
1120 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1121 for HeadsetGainWatchMicrophoneGainResponse
1122 {
1123 #[inline(always)]
1124 fn new_empty() -> Self {
1125 Self { gain: fidl::new_empty!(u8, D) }
1126 }
1127
1128 #[inline]
1129 unsafe fn decode(
1130 &mut self,
1131 decoder: &mut fidl::encoding::Decoder<'_, D>,
1132 offset: usize,
1133 _depth: fidl::encoding::Depth,
1134 ) -> fidl::Result<()> {
1135 decoder.debug_check_bounds::<Self>(offset);
1136 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1137 unsafe {
1140 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1141 }
1142 Ok(())
1143 }
1144 }
1145
1146 impl fidl::encoding::ValueTypeMarker for HeadsetGainWatchSpeakerGainResponse {
1147 type Borrowed<'a> = &'a Self;
1148 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1149 value
1150 }
1151 }
1152
1153 unsafe impl fidl::encoding::TypeMarker for HeadsetGainWatchSpeakerGainResponse {
1154 type Owned = Self;
1155
1156 #[inline(always)]
1157 fn inline_align(_context: fidl::encoding::Context) -> usize {
1158 1
1159 }
1160
1161 #[inline(always)]
1162 fn inline_size(_context: fidl::encoding::Context) -> usize {
1163 1
1164 }
1165 #[inline(always)]
1166 fn encode_is_copy() -> bool {
1167 true
1168 }
1169
1170 #[inline(always)]
1171 fn decode_is_copy() -> bool {
1172 true
1173 }
1174 }
1175
1176 unsafe impl<D: fidl::encoding::ResourceDialect>
1177 fidl::encoding::Encode<HeadsetGainWatchSpeakerGainResponse, D>
1178 for &HeadsetGainWatchSpeakerGainResponse
1179 {
1180 #[inline]
1181 unsafe fn encode(
1182 self,
1183 encoder: &mut fidl::encoding::Encoder<'_, D>,
1184 offset: usize,
1185 _depth: fidl::encoding::Depth,
1186 ) -> fidl::Result<()> {
1187 encoder.debug_check_bounds::<HeadsetGainWatchSpeakerGainResponse>(offset);
1188 unsafe {
1189 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1191 (buf_ptr as *mut HeadsetGainWatchSpeakerGainResponse)
1192 .write_unaligned((self as *const HeadsetGainWatchSpeakerGainResponse).read());
1193 }
1196 Ok(())
1197 }
1198 }
1199 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1200 fidl::encoding::Encode<HeadsetGainWatchSpeakerGainResponse, D> for (T0,)
1201 {
1202 #[inline]
1203 unsafe fn encode(
1204 self,
1205 encoder: &mut fidl::encoding::Encoder<'_, D>,
1206 offset: usize,
1207 depth: fidl::encoding::Depth,
1208 ) -> fidl::Result<()> {
1209 encoder.debug_check_bounds::<HeadsetGainWatchSpeakerGainResponse>(offset);
1210 self.0.encode(encoder, offset + 0, depth)?;
1214 Ok(())
1215 }
1216 }
1217
1218 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1219 for HeadsetGainWatchSpeakerGainResponse
1220 {
1221 #[inline(always)]
1222 fn new_empty() -> Self {
1223 Self { gain: fidl::new_empty!(u8, D) }
1224 }
1225
1226 #[inline]
1227 unsafe fn decode(
1228 &mut self,
1229 decoder: &mut fidl::encoding::Decoder<'_, D>,
1230 offset: usize,
1231 _depth: fidl::encoding::Depth,
1232 ) -> fidl::Result<()> {
1233 decoder.debug_check_bounds::<Self>(offset);
1234 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1235 unsafe {
1238 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1239 }
1240 Ok(())
1241 }
1242 }
1243
1244 impl fidl::encoding::ValueTypeMarker for PeerHandlerQueryOperatorResponse {
1245 type Borrowed<'a> = &'a Self;
1246 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1247 value
1248 }
1249 }
1250
1251 unsafe impl fidl::encoding::TypeMarker for PeerHandlerQueryOperatorResponse {
1252 type Owned = Self;
1253
1254 #[inline(always)]
1255 fn inline_align(_context: fidl::encoding::Context) -> usize {
1256 8
1257 }
1258
1259 #[inline(always)]
1260 fn inline_size(_context: fidl::encoding::Context) -> usize {
1261 16
1262 }
1263 }
1264
1265 unsafe impl<D: fidl::encoding::ResourceDialect>
1266 fidl::encoding::Encode<PeerHandlerQueryOperatorResponse, D>
1267 for &PeerHandlerQueryOperatorResponse
1268 {
1269 #[inline]
1270 unsafe fn encode(
1271 self,
1272 encoder: &mut fidl::encoding::Encoder<'_, D>,
1273 offset: usize,
1274 _depth: fidl::encoding::Depth,
1275 ) -> fidl::Result<()> {
1276 encoder.debug_check_bounds::<PeerHandlerQueryOperatorResponse>(offset);
1277 fidl::encoding::Encode::<PeerHandlerQueryOperatorResponse, D>::encode(
1279 (
1280 <fidl::encoding::Optional<fidl::encoding::BoundedString<16>> as fidl::encoding::ValueTypeMarker>::borrow(&self.operator),
1281 ),
1282 encoder, offset, _depth
1283 )
1284 }
1285 }
1286 unsafe impl<
1287 D: fidl::encoding::ResourceDialect,
1288 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<16>>, D>,
1289 > fidl::encoding::Encode<PeerHandlerQueryOperatorResponse, D> for (T0,)
1290 {
1291 #[inline]
1292 unsafe fn encode(
1293 self,
1294 encoder: &mut fidl::encoding::Encoder<'_, D>,
1295 offset: usize,
1296 depth: fidl::encoding::Depth,
1297 ) -> fidl::Result<()> {
1298 encoder.debug_check_bounds::<PeerHandlerQueryOperatorResponse>(offset);
1299 self.0.encode(encoder, offset + 0, depth)?;
1303 Ok(())
1304 }
1305 }
1306
1307 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1308 for PeerHandlerQueryOperatorResponse
1309 {
1310 #[inline(always)]
1311 fn new_empty() -> Self {
1312 Self {
1313 operator: fidl::new_empty!(
1314 fidl::encoding::Optional<fidl::encoding::BoundedString<16>>,
1315 D
1316 ),
1317 }
1318 }
1319
1320 #[inline]
1321 unsafe fn decode(
1322 &mut self,
1323 decoder: &mut fidl::encoding::Decoder<'_, D>,
1324 offset: usize,
1325 _depth: fidl::encoding::Depth,
1326 ) -> fidl::Result<()> {
1327 decoder.debug_check_bounds::<Self>(offset);
1328 fidl::decode!(
1330 fidl::encoding::Optional<fidl::encoding::BoundedString<16>>,
1331 D,
1332 &mut self.operator,
1333 decoder,
1334 offset + 0,
1335 _depth
1336 )?;
1337 Ok(())
1338 }
1339 }
1340
1341 impl fidl::encoding::ValueTypeMarker for PeerHandlerReportHeadsetBatteryLevelRequest {
1342 type Borrowed<'a> = &'a Self;
1343 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1344 value
1345 }
1346 }
1347
1348 unsafe impl fidl::encoding::TypeMarker for PeerHandlerReportHeadsetBatteryLevelRequest {
1349 type Owned = Self;
1350
1351 #[inline(always)]
1352 fn inline_align(_context: fidl::encoding::Context) -> usize {
1353 1
1354 }
1355
1356 #[inline(always)]
1357 fn inline_size(_context: fidl::encoding::Context) -> usize {
1358 1
1359 }
1360 #[inline(always)]
1361 fn encode_is_copy() -> bool {
1362 true
1363 }
1364
1365 #[inline(always)]
1366 fn decode_is_copy() -> bool {
1367 true
1368 }
1369 }
1370
1371 unsafe impl<D: fidl::encoding::ResourceDialect>
1372 fidl::encoding::Encode<PeerHandlerReportHeadsetBatteryLevelRequest, D>
1373 for &PeerHandlerReportHeadsetBatteryLevelRequest
1374 {
1375 #[inline]
1376 unsafe fn encode(
1377 self,
1378 encoder: &mut fidl::encoding::Encoder<'_, D>,
1379 offset: usize,
1380 _depth: fidl::encoding::Depth,
1381 ) -> fidl::Result<()> {
1382 encoder.debug_check_bounds::<PeerHandlerReportHeadsetBatteryLevelRequest>(offset);
1383 unsafe {
1384 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1386 (buf_ptr as *mut PeerHandlerReportHeadsetBatteryLevelRequest).write_unaligned(
1387 (self as *const PeerHandlerReportHeadsetBatteryLevelRequest).read(),
1388 );
1389 }
1392 Ok(())
1393 }
1394 }
1395 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1396 fidl::encoding::Encode<PeerHandlerReportHeadsetBatteryLevelRequest, D> for (T0,)
1397 {
1398 #[inline]
1399 unsafe fn encode(
1400 self,
1401 encoder: &mut fidl::encoding::Encoder<'_, D>,
1402 offset: usize,
1403 depth: fidl::encoding::Depth,
1404 ) -> fidl::Result<()> {
1405 encoder.debug_check_bounds::<PeerHandlerReportHeadsetBatteryLevelRequest>(offset);
1406 self.0.encode(encoder, offset + 0, depth)?;
1410 Ok(())
1411 }
1412 }
1413
1414 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1415 for PeerHandlerReportHeadsetBatteryLevelRequest
1416 {
1417 #[inline(always)]
1418 fn new_empty() -> Self {
1419 Self { level: fidl::new_empty!(u8, D) }
1420 }
1421
1422 #[inline]
1423 unsafe fn decode(
1424 &mut self,
1425 decoder: &mut fidl::encoding::Decoder<'_, D>,
1426 offset: usize,
1427 _depth: fidl::encoding::Depth,
1428 ) -> fidl::Result<()> {
1429 decoder.debug_check_bounds::<Self>(offset);
1430 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1431 unsafe {
1434 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1435 }
1436 Ok(())
1437 }
1438 }
1439
1440 impl fidl::encoding::ValueTypeMarker for PeerHandlerRequestOutgoingCallRequest {
1441 type Borrowed<'a> = &'a Self;
1442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1443 value
1444 }
1445 }
1446
1447 unsafe impl fidl::encoding::TypeMarker for PeerHandlerRequestOutgoingCallRequest {
1448 type Owned = Self;
1449
1450 #[inline(always)]
1451 fn inline_align(_context: fidl::encoding::Context) -> usize {
1452 8
1453 }
1454
1455 #[inline(always)]
1456 fn inline_size(_context: fidl::encoding::Context) -> usize {
1457 16
1458 }
1459 }
1460
1461 unsafe impl<D: fidl::encoding::ResourceDialect>
1462 fidl::encoding::Encode<PeerHandlerRequestOutgoingCallRequest, D>
1463 for &PeerHandlerRequestOutgoingCallRequest
1464 {
1465 #[inline]
1466 unsafe fn encode(
1467 self,
1468 encoder: &mut fidl::encoding::Encoder<'_, D>,
1469 offset: usize,
1470 _depth: fidl::encoding::Depth,
1471 ) -> fidl::Result<()> {
1472 encoder.debug_check_bounds::<PeerHandlerRequestOutgoingCallRequest>(offset);
1473 fidl::encoding::Encode::<PeerHandlerRequestOutgoingCallRequest, D>::encode(
1475 (<CallAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),),
1476 encoder,
1477 offset,
1478 _depth,
1479 )
1480 }
1481 }
1482 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CallAction, D>>
1483 fidl::encoding::Encode<PeerHandlerRequestOutgoingCallRequest, D> for (T0,)
1484 {
1485 #[inline]
1486 unsafe fn encode(
1487 self,
1488 encoder: &mut fidl::encoding::Encoder<'_, D>,
1489 offset: usize,
1490 depth: fidl::encoding::Depth,
1491 ) -> fidl::Result<()> {
1492 encoder.debug_check_bounds::<PeerHandlerRequestOutgoingCallRequest>(offset);
1493 self.0.encode(encoder, offset + 0, depth)?;
1497 Ok(())
1498 }
1499 }
1500
1501 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1502 for PeerHandlerRequestOutgoingCallRequest
1503 {
1504 #[inline(always)]
1505 fn new_empty() -> Self {
1506 Self { action: fidl::new_empty!(CallAction, D) }
1507 }
1508
1509 #[inline]
1510 unsafe fn decode(
1511 &mut self,
1512 decoder: &mut fidl::encoding::Decoder<'_, D>,
1513 offset: usize,
1514 _depth: fidl::encoding::Depth,
1515 ) -> fidl::Result<()> {
1516 decoder.debug_check_bounds::<Self>(offset);
1517 fidl::decode!(CallAction, D, &mut self.action, decoder, offset + 0, _depth)?;
1519 Ok(())
1520 }
1521 }
1522
1523 impl fidl::encoding::ValueTypeMarker for PeerHandlerSetNrecModeRequest {
1524 type Borrowed<'a> = &'a Self;
1525 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1526 value
1527 }
1528 }
1529
1530 unsafe impl fidl::encoding::TypeMarker for PeerHandlerSetNrecModeRequest {
1531 type Owned = Self;
1532
1533 #[inline(always)]
1534 fn inline_align(_context: fidl::encoding::Context) -> usize {
1535 1
1536 }
1537
1538 #[inline(always)]
1539 fn inline_size(_context: fidl::encoding::Context) -> usize {
1540 1
1541 }
1542 }
1543
1544 unsafe impl<D: fidl::encoding::ResourceDialect>
1545 fidl::encoding::Encode<PeerHandlerSetNrecModeRequest, D>
1546 for &PeerHandlerSetNrecModeRequest
1547 {
1548 #[inline]
1549 unsafe fn encode(
1550 self,
1551 encoder: &mut fidl::encoding::Encoder<'_, D>,
1552 offset: usize,
1553 _depth: fidl::encoding::Depth,
1554 ) -> fidl::Result<()> {
1555 encoder.debug_check_bounds::<PeerHandlerSetNrecModeRequest>(offset);
1556 fidl::encoding::Encode::<PeerHandlerSetNrecModeRequest, D>::encode(
1558 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1559 encoder,
1560 offset,
1561 _depth,
1562 )
1563 }
1564 }
1565 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1566 fidl::encoding::Encode<PeerHandlerSetNrecModeRequest, D> for (T0,)
1567 {
1568 #[inline]
1569 unsafe fn encode(
1570 self,
1571 encoder: &mut fidl::encoding::Encoder<'_, D>,
1572 offset: usize,
1573 depth: fidl::encoding::Depth,
1574 ) -> fidl::Result<()> {
1575 encoder.debug_check_bounds::<PeerHandlerSetNrecModeRequest>(offset);
1576 self.0.encode(encoder, offset + 0, depth)?;
1580 Ok(())
1581 }
1582 }
1583
1584 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1585 for PeerHandlerSetNrecModeRequest
1586 {
1587 #[inline(always)]
1588 fn new_empty() -> Self {
1589 Self { enabled: fidl::new_empty!(bool, D) }
1590 }
1591
1592 #[inline]
1593 unsafe fn decode(
1594 &mut self,
1595 decoder: &mut fidl::encoding::Decoder<'_, D>,
1596 offset: usize,
1597 _depth: fidl::encoding::Depth,
1598 ) -> fidl::Result<()> {
1599 decoder.debug_check_bounds::<Self>(offset);
1600 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1602 Ok(())
1603 }
1604 }
1605
1606 impl fidl::encoding::ValueTypeMarker for PeerHandlerSubscriberNumberInformationResponse {
1607 type Borrowed<'a> = &'a Self;
1608 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1609 value
1610 }
1611 }
1612
1613 unsafe impl fidl::encoding::TypeMarker for PeerHandlerSubscriberNumberInformationResponse {
1614 type Owned = Self;
1615
1616 #[inline(always)]
1617 fn inline_align(_context: fidl::encoding::Context) -> usize {
1618 8
1619 }
1620
1621 #[inline(always)]
1622 fn inline_size(_context: fidl::encoding::Context) -> usize {
1623 16
1624 }
1625 }
1626
1627 unsafe impl<D: fidl::encoding::ResourceDialect>
1628 fidl::encoding::Encode<PeerHandlerSubscriberNumberInformationResponse, D>
1629 for &PeerHandlerSubscriberNumberInformationResponse
1630 {
1631 #[inline]
1632 unsafe fn encode(
1633 self,
1634 encoder: &mut fidl::encoding::Encoder<'_, D>,
1635 offset: usize,
1636 _depth: fidl::encoding::Depth,
1637 ) -> fidl::Result<()> {
1638 encoder.debug_check_bounds::<PeerHandlerSubscriberNumberInformationResponse>(offset);
1639 fidl::encoding::Encode::<PeerHandlerSubscriberNumberInformationResponse, D>::encode(
1641 (
1642 <fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.numbers),
1643 ),
1644 encoder, offset, _depth
1645 )
1646 }
1647 }
1648 unsafe impl<
1649 D: fidl::encoding::ResourceDialect,
1650 T0: fidl::encoding::Encode<
1651 fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 128>,
1652 D,
1653 >,
1654 > fidl::encoding::Encode<PeerHandlerSubscriberNumberInformationResponse, D> for (T0,)
1655 {
1656 #[inline]
1657 unsafe fn encode(
1658 self,
1659 encoder: &mut fidl::encoding::Encoder<'_, D>,
1660 offset: usize,
1661 depth: fidl::encoding::Depth,
1662 ) -> fidl::Result<()> {
1663 encoder.debug_check_bounds::<PeerHandlerSubscriberNumberInformationResponse>(offset);
1664 self.0.encode(encoder, offset + 0, depth)?;
1668 Ok(())
1669 }
1670 }
1671
1672 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1673 for PeerHandlerSubscriberNumberInformationResponse
1674 {
1675 #[inline(always)]
1676 fn new_empty() -> Self {
1677 Self {
1678 numbers: fidl::new_empty!(
1679 fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 128>,
1680 D
1681 ),
1682 }
1683 }
1684
1685 #[inline]
1686 unsafe fn decode(
1687 &mut self,
1688 decoder: &mut fidl::encoding::Decoder<'_, D>,
1689 offset: usize,
1690 _depth: fidl::encoding::Depth,
1691 ) -> fidl::Result<()> {
1692 decoder.debug_check_bounds::<Self>(offset);
1693 fidl::decode!(
1695 fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 128>,
1696 D,
1697 &mut self.numbers,
1698 decoder,
1699 offset + 0,
1700 _depth
1701 )?;
1702 Ok(())
1703 }
1704 }
1705
1706 impl fidl::encoding::ValueTypeMarker for PeerHandlerWatchNetworkInformationResponse {
1707 type Borrowed<'a> = &'a Self;
1708 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1709 value
1710 }
1711 }
1712
1713 unsafe impl fidl::encoding::TypeMarker for PeerHandlerWatchNetworkInformationResponse {
1714 type Owned = Self;
1715
1716 #[inline(always)]
1717 fn inline_align(_context: fidl::encoding::Context) -> usize {
1718 8
1719 }
1720
1721 #[inline(always)]
1722 fn inline_size(_context: fidl::encoding::Context) -> usize {
1723 16
1724 }
1725 }
1726
1727 unsafe impl<D: fidl::encoding::ResourceDialect>
1728 fidl::encoding::Encode<PeerHandlerWatchNetworkInformationResponse, D>
1729 for &PeerHandlerWatchNetworkInformationResponse
1730 {
1731 #[inline]
1732 unsafe fn encode(
1733 self,
1734 encoder: &mut fidl::encoding::Encoder<'_, D>,
1735 offset: usize,
1736 _depth: fidl::encoding::Depth,
1737 ) -> fidl::Result<()> {
1738 encoder.debug_check_bounds::<PeerHandlerWatchNetworkInformationResponse>(offset);
1739 fidl::encoding::Encode::<PeerHandlerWatchNetworkInformationResponse, D>::encode(
1741 (<NetworkInformation as fidl::encoding::ValueTypeMarker>::borrow(&self.update),),
1742 encoder,
1743 offset,
1744 _depth,
1745 )
1746 }
1747 }
1748 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkInformation, D>>
1749 fidl::encoding::Encode<PeerHandlerWatchNetworkInformationResponse, D> for (T0,)
1750 {
1751 #[inline]
1752 unsafe fn encode(
1753 self,
1754 encoder: &mut fidl::encoding::Encoder<'_, D>,
1755 offset: usize,
1756 depth: fidl::encoding::Depth,
1757 ) -> fidl::Result<()> {
1758 encoder.debug_check_bounds::<PeerHandlerWatchNetworkInformationResponse>(offset);
1759 self.0.encode(encoder, offset + 0, depth)?;
1763 Ok(())
1764 }
1765 }
1766
1767 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1768 for PeerHandlerWatchNetworkInformationResponse
1769 {
1770 #[inline(always)]
1771 fn new_empty() -> Self {
1772 Self { update: fidl::new_empty!(NetworkInformation, D) }
1773 }
1774
1775 #[inline]
1776 unsafe fn decode(
1777 &mut self,
1778 decoder: &mut fidl::encoding::Decoder<'_, D>,
1779 offset: usize,
1780 _depth: fidl::encoding::Depth,
1781 ) -> fidl::Result<()> {
1782 decoder.debug_check_bounds::<Self>(offset);
1783 fidl::decode!(NetworkInformation, D, &mut self.update, decoder, offset + 0, _depth)?;
1785 Ok(())
1786 }
1787 }
1788
1789 impl fidl::encoding::ValueTypeMarker for RedialLast {
1790 type Borrowed<'a> = &'a Self;
1791 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1792 value
1793 }
1794 }
1795
1796 unsafe impl fidl::encoding::TypeMarker for RedialLast {
1797 type Owned = Self;
1798
1799 #[inline(always)]
1800 fn inline_align(_context: fidl::encoding::Context) -> usize {
1801 1
1802 }
1803
1804 #[inline(always)]
1805 fn inline_size(_context: fidl::encoding::Context) -> usize {
1806 1
1807 }
1808 }
1809
1810 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RedialLast, D>
1811 for &RedialLast
1812 {
1813 #[inline]
1814 unsafe fn encode(
1815 self,
1816 encoder: &mut fidl::encoding::Encoder<'_, D>,
1817 offset: usize,
1818 _depth: fidl::encoding::Depth,
1819 ) -> fidl::Result<()> {
1820 encoder.debug_check_bounds::<RedialLast>(offset);
1821 encoder.write_num(0u8, offset);
1822 Ok(())
1823 }
1824 }
1825
1826 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RedialLast {
1827 #[inline(always)]
1828 fn new_empty() -> Self {
1829 Self
1830 }
1831
1832 #[inline]
1833 unsafe fn decode(
1834 &mut self,
1835 decoder: &mut fidl::encoding::Decoder<'_, D>,
1836 offset: usize,
1837 _depth: fidl::encoding::Depth,
1838 ) -> fidl::Result<()> {
1839 decoder.debug_check_bounds::<Self>(offset);
1840 match decoder.read_num::<u8>(offset) {
1841 0 => Ok(()),
1842 _ => Err(fidl::Error::Invalid),
1843 }
1844 }
1845 }
1846
1847 impl fidl::encoding::ValueTypeMarker for TransferActive {
1848 type Borrowed<'a> = &'a Self;
1849 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1850 value
1851 }
1852 }
1853
1854 unsafe impl fidl::encoding::TypeMarker for TransferActive {
1855 type Owned = Self;
1856
1857 #[inline(always)]
1858 fn inline_align(_context: fidl::encoding::Context) -> usize {
1859 1
1860 }
1861
1862 #[inline(always)]
1863 fn inline_size(_context: fidl::encoding::Context) -> usize {
1864 1
1865 }
1866 }
1867
1868 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TransferActive, D>
1869 for &TransferActive
1870 {
1871 #[inline]
1872 unsafe fn encode(
1873 self,
1874 encoder: &mut fidl::encoding::Encoder<'_, D>,
1875 offset: usize,
1876 _depth: fidl::encoding::Depth,
1877 ) -> fidl::Result<()> {
1878 encoder.debug_check_bounds::<TransferActive>(offset);
1879 encoder.write_num(0u8, offset);
1880 Ok(())
1881 }
1882 }
1883
1884 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TransferActive {
1885 #[inline(always)]
1886 fn new_empty() -> Self {
1887 Self
1888 }
1889
1890 #[inline]
1891 unsafe fn decode(
1892 &mut self,
1893 decoder: &mut fidl::encoding::Decoder<'_, D>,
1894 offset: usize,
1895 _depth: fidl::encoding::Depth,
1896 ) -> fidl::Result<()> {
1897 decoder.debug_check_bounds::<Self>(offset);
1898 match decoder.read_num::<u8>(offset) {
1899 0 => Ok(()),
1900 _ => Err(fidl::Error::Invalid),
1901 }
1902 }
1903 }
1904
1905 impl NetworkInformation {
1906 #[inline(always)]
1907 fn max_ordinal_present(&self) -> u64 {
1908 if let Some(_) = self.roaming {
1909 return 3;
1910 }
1911 if let Some(_) = self.signal_strength {
1912 return 2;
1913 }
1914 if let Some(_) = self.service_available {
1915 return 1;
1916 }
1917 0
1918 }
1919 }
1920
1921 impl fidl::encoding::ValueTypeMarker for NetworkInformation {
1922 type Borrowed<'a> = &'a Self;
1923 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1924 value
1925 }
1926 }
1927
1928 unsafe impl fidl::encoding::TypeMarker for NetworkInformation {
1929 type Owned = Self;
1930
1931 #[inline(always)]
1932 fn inline_align(_context: fidl::encoding::Context) -> usize {
1933 8
1934 }
1935
1936 #[inline(always)]
1937 fn inline_size(_context: fidl::encoding::Context) -> usize {
1938 16
1939 }
1940 }
1941
1942 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkInformation, D>
1943 for &NetworkInformation
1944 {
1945 unsafe fn encode(
1946 self,
1947 encoder: &mut fidl::encoding::Encoder<'_, D>,
1948 offset: usize,
1949 mut depth: fidl::encoding::Depth,
1950 ) -> fidl::Result<()> {
1951 encoder.debug_check_bounds::<NetworkInformation>(offset);
1952 let max_ordinal: u64 = self.max_ordinal_present();
1954 encoder.write_num(max_ordinal, offset);
1955 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1956 if max_ordinal == 0 {
1958 return Ok(());
1959 }
1960 depth.increment()?;
1961 let envelope_size = 8;
1962 let bytes_len = max_ordinal as usize * envelope_size;
1963 #[allow(unused_variables)]
1964 let offset = encoder.out_of_line_offset(bytes_len);
1965 let mut _prev_end_offset: usize = 0;
1966 if 1 > max_ordinal {
1967 return Ok(());
1968 }
1969
1970 let cur_offset: usize = (1 - 1) * envelope_size;
1973
1974 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1976
1977 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1982 self.service_available
1983 .as_ref()
1984 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1985 encoder,
1986 offset + cur_offset,
1987 depth,
1988 )?;
1989
1990 _prev_end_offset = cur_offset + envelope_size;
1991 if 2 > max_ordinal {
1992 return Ok(());
1993 }
1994
1995 let cur_offset: usize = (2 - 1) * envelope_size;
1998
1999 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2001
2002 fidl::encoding::encode_in_envelope_optional::<SignalStrength, D>(
2007 self.signal_strength
2008 .as_ref()
2009 .map(<SignalStrength as fidl::encoding::ValueTypeMarker>::borrow),
2010 encoder,
2011 offset + cur_offset,
2012 depth,
2013 )?;
2014
2015 _prev_end_offset = cur_offset + envelope_size;
2016 if 3 > max_ordinal {
2017 return Ok(());
2018 }
2019
2020 let cur_offset: usize = (3 - 1) * envelope_size;
2023
2024 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2026
2027 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2032 self.roaming.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2033 encoder,
2034 offset + cur_offset,
2035 depth,
2036 )?;
2037
2038 _prev_end_offset = cur_offset + envelope_size;
2039
2040 Ok(())
2041 }
2042 }
2043
2044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkInformation {
2045 #[inline(always)]
2046 fn new_empty() -> Self {
2047 Self::default()
2048 }
2049
2050 unsafe fn decode(
2051 &mut self,
2052 decoder: &mut fidl::encoding::Decoder<'_, D>,
2053 offset: usize,
2054 mut depth: fidl::encoding::Depth,
2055 ) -> fidl::Result<()> {
2056 decoder.debug_check_bounds::<Self>(offset);
2057 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2058 None => return Err(fidl::Error::NotNullable),
2059 Some(len) => len,
2060 };
2061 if len == 0 {
2063 return Ok(());
2064 };
2065 depth.increment()?;
2066 let envelope_size = 8;
2067 let bytes_len = len * envelope_size;
2068 let offset = decoder.out_of_line_offset(bytes_len)?;
2069 let mut _next_ordinal_to_read = 0;
2071 let mut next_offset = offset;
2072 let end_offset = offset + bytes_len;
2073 _next_ordinal_to_read += 1;
2074 if next_offset >= end_offset {
2075 return Ok(());
2076 }
2077
2078 while _next_ordinal_to_read < 1 {
2080 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2081 _next_ordinal_to_read += 1;
2082 next_offset += envelope_size;
2083 }
2084
2085 let next_out_of_line = decoder.next_out_of_line();
2086 let handles_before = decoder.remaining_handles();
2087 if let Some((inlined, num_bytes, num_handles)) =
2088 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2089 {
2090 let member_inline_size =
2091 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2092 if inlined != (member_inline_size <= 4) {
2093 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2094 }
2095 let inner_offset;
2096 let mut inner_depth = depth.clone();
2097 if inlined {
2098 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2099 inner_offset = next_offset;
2100 } else {
2101 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2102 inner_depth.increment()?;
2103 }
2104 let val_ref =
2105 self.service_available.get_or_insert_with(|| fidl::new_empty!(bool, D));
2106 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2107 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2108 {
2109 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2110 }
2111 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2112 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2113 }
2114 }
2115
2116 next_offset += envelope_size;
2117 _next_ordinal_to_read += 1;
2118 if next_offset >= end_offset {
2119 return Ok(());
2120 }
2121
2122 while _next_ordinal_to_read < 2 {
2124 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2125 _next_ordinal_to_read += 1;
2126 next_offset += envelope_size;
2127 }
2128
2129 let next_out_of_line = decoder.next_out_of_line();
2130 let handles_before = decoder.remaining_handles();
2131 if let Some((inlined, num_bytes, num_handles)) =
2132 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2133 {
2134 let member_inline_size =
2135 <SignalStrength as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2136 if inlined != (member_inline_size <= 4) {
2137 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2138 }
2139 let inner_offset;
2140 let mut inner_depth = depth.clone();
2141 if inlined {
2142 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2143 inner_offset = next_offset;
2144 } else {
2145 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2146 inner_depth.increment()?;
2147 }
2148 let val_ref =
2149 self.signal_strength.get_or_insert_with(|| fidl::new_empty!(SignalStrength, D));
2150 fidl::decode!(SignalStrength, D, val_ref, decoder, inner_offset, inner_depth)?;
2151 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2152 {
2153 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2154 }
2155 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2156 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2157 }
2158 }
2159
2160 next_offset += envelope_size;
2161 _next_ordinal_to_read += 1;
2162 if next_offset >= end_offset {
2163 return Ok(());
2164 }
2165
2166 while _next_ordinal_to_read < 3 {
2168 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2169 _next_ordinal_to_read += 1;
2170 next_offset += envelope_size;
2171 }
2172
2173 let next_out_of_line = decoder.next_out_of_line();
2174 let handles_before = decoder.remaining_handles();
2175 if let Some((inlined, num_bytes, num_handles)) =
2176 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2177 {
2178 let member_inline_size =
2179 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2180 if inlined != (member_inline_size <= 4) {
2181 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2182 }
2183 let inner_offset;
2184 let mut inner_depth = depth.clone();
2185 if inlined {
2186 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2187 inner_offset = next_offset;
2188 } else {
2189 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2190 inner_depth.increment()?;
2191 }
2192 let val_ref = self.roaming.get_or_insert_with(|| fidl::new_empty!(bool, D));
2193 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2194 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2195 {
2196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2197 }
2198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2200 }
2201 }
2202
2203 next_offset += envelope_size;
2204
2205 while next_offset < end_offset {
2207 _next_ordinal_to_read += 1;
2208 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2209 next_offset += envelope_size;
2210 }
2211
2212 Ok(())
2213 }
2214 }
2215
2216 impl fidl::encoding::ValueTypeMarker for CallAction {
2217 type Borrowed<'a> = &'a Self;
2218 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2219 value
2220 }
2221 }
2222
2223 unsafe impl fidl::encoding::TypeMarker for CallAction {
2224 type Owned = Self;
2225
2226 #[inline(always)]
2227 fn inline_align(_context: fidl::encoding::Context) -> usize {
2228 8
2229 }
2230
2231 #[inline(always)]
2232 fn inline_size(_context: fidl::encoding::Context) -> usize {
2233 16
2234 }
2235 }
2236
2237 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CallAction, D>
2238 for &CallAction
2239 {
2240 #[inline]
2241 unsafe fn encode(
2242 self,
2243 encoder: &mut fidl::encoding::Encoder<'_, D>,
2244 offset: usize,
2245 _depth: fidl::encoding::Depth,
2246 ) -> fidl::Result<()> {
2247 encoder.debug_check_bounds::<CallAction>(offset);
2248 encoder.write_num::<u64>(self.ordinal(), offset);
2249 match self {
2250 CallAction::DialFromNumber(ref val) => fidl::encoding::encode_in_envelope::<
2251 fidl::encoding::BoundedString<256>,
2252 D,
2253 >(
2254 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
2255 val,
2256 ),
2257 encoder,
2258 offset + 8,
2259 _depth,
2260 ),
2261 CallAction::DialFromLocation(ref val) => fidl::encoding::encode_in_envelope::<
2262 fidl::encoding::BoundedString<256>,
2263 D,
2264 >(
2265 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
2266 val,
2267 ),
2268 encoder,
2269 offset + 8,
2270 _depth,
2271 ),
2272 CallAction::RedialLast(ref val) => {
2273 fidl::encoding::encode_in_envelope::<RedialLast, D>(
2274 <RedialLast as fidl::encoding::ValueTypeMarker>::borrow(val),
2275 encoder,
2276 offset + 8,
2277 _depth,
2278 )
2279 }
2280 CallAction::TransferActive(ref val) => {
2281 fidl::encoding::encode_in_envelope::<TransferActive, D>(
2282 <TransferActive as fidl::encoding::ValueTypeMarker>::borrow(val),
2283 encoder,
2284 offset + 8,
2285 _depth,
2286 )
2287 }
2288 }
2289 }
2290 }
2291
2292 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CallAction {
2293 #[inline(always)]
2294 fn new_empty() -> Self {
2295 Self::DialFromNumber(fidl::new_empty!(fidl::encoding::BoundedString<256>, D))
2296 }
2297
2298 #[inline]
2299 unsafe fn decode(
2300 &mut self,
2301 decoder: &mut fidl::encoding::Decoder<'_, D>,
2302 offset: usize,
2303 mut depth: fidl::encoding::Depth,
2304 ) -> fidl::Result<()> {
2305 decoder.debug_check_bounds::<Self>(offset);
2306 #[allow(unused_variables)]
2307 let next_out_of_line = decoder.next_out_of_line();
2308 let handles_before = decoder.remaining_handles();
2309 let (ordinal, inlined, num_bytes, num_handles) =
2310 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2311
2312 let member_inline_size = match ordinal {
2313 1 => {
2314 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
2315 decoder.context,
2316 )
2317 }
2318 2 => {
2319 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
2320 decoder.context,
2321 )
2322 }
2323 3 => <RedialLast as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2324 4 => <TransferActive as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2325 _ => return Err(fidl::Error::UnknownUnionTag),
2326 };
2327
2328 if inlined != (member_inline_size <= 4) {
2329 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2330 }
2331 let _inner_offset;
2332 if inlined {
2333 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2334 _inner_offset = offset + 8;
2335 } else {
2336 depth.increment()?;
2337 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2338 }
2339 match ordinal {
2340 1 => {
2341 #[allow(irrefutable_let_patterns)]
2342 if let CallAction::DialFromNumber(_) = self {
2343 } else {
2345 *self = CallAction::DialFromNumber(fidl::new_empty!(
2347 fidl::encoding::BoundedString<256>,
2348 D
2349 ));
2350 }
2351 #[allow(irrefutable_let_patterns)]
2352 if let CallAction::DialFromNumber(ref mut val) = self {
2353 fidl::decode!(
2354 fidl::encoding::BoundedString<256>,
2355 D,
2356 val,
2357 decoder,
2358 _inner_offset,
2359 depth
2360 )?;
2361 } else {
2362 unreachable!()
2363 }
2364 }
2365 2 => {
2366 #[allow(irrefutable_let_patterns)]
2367 if let CallAction::DialFromLocation(_) = self {
2368 } else {
2370 *self = CallAction::DialFromLocation(fidl::new_empty!(
2372 fidl::encoding::BoundedString<256>,
2373 D
2374 ));
2375 }
2376 #[allow(irrefutable_let_patterns)]
2377 if let CallAction::DialFromLocation(ref mut val) = self {
2378 fidl::decode!(
2379 fidl::encoding::BoundedString<256>,
2380 D,
2381 val,
2382 decoder,
2383 _inner_offset,
2384 depth
2385 )?;
2386 } else {
2387 unreachable!()
2388 }
2389 }
2390 3 => {
2391 #[allow(irrefutable_let_patterns)]
2392 if let CallAction::RedialLast(_) = self {
2393 } else {
2395 *self = CallAction::RedialLast(fidl::new_empty!(RedialLast, D));
2397 }
2398 #[allow(irrefutable_let_patterns)]
2399 if let CallAction::RedialLast(ref mut val) = self {
2400 fidl::decode!(RedialLast, D, val, decoder, _inner_offset, depth)?;
2401 } else {
2402 unreachable!()
2403 }
2404 }
2405 4 => {
2406 #[allow(irrefutable_let_patterns)]
2407 if let CallAction::TransferActive(_) = self {
2408 } else {
2410 *self = CallAction::TransferActive(fidl::new_empty!(TransferActive, D));
2412 }
2413 #[allow(irrefutable_let_patterns)]
2414 if let CallAction::TransferActive(ref mut val) = self {
2415 fidl::decode!(TransferActive, D, val, decoder, _inner_offset, depth)?;
2416 } else {
2417 unreachable!()
2418 }
2419 }
2420 ordinal => panic!("unexpected ordinal {:?}", ordinal),
2421 }
2422 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2424 }
2425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2427 }
2428 Ok(())
2429 }
2430 }
2431}