fidl_fuchsia_wlan_device_service__common/
fidl_fuchsia_wlan_device_service__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12#[repr(u8)]
13pub enum CriticalErrorReason {
14    FwCrash = 1,
15}
16
17impl CriticalErrorReason {
18    #[inline]
19    pub fn from_primitive(prim: u8) -> Option<Self> {
20        match prim {
21            1 => Some(Self::FwCrash),
22            _ => None,
23        }
24    }
25
26    #[inline]
27    pub const fn into_primitive(self) -> u8 {
28        self as u8
29    }
30}
31
32#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
33pub enum DeviceMonitorError {
34    Internal,
35    #[doc(hidden)]
36    __SourceBreaking {
37        unknown_ordinal: u32,
38    },
39}
40
41/// Pattern that matches an unknown `DeviceMonitorError` member.
42#[macro_export]
43macro_rules! DeviceMonitorErrorUnknown {
44    () => {
45        _
46    };
47}
48
49impl DeviceMonitorError {
50    #[inline]
51    pub fn from_primitive(prim: u32) -> Option<Self> {
52        match prim {
53            1 => Some(Self::Internal),
54            _ => None,
55        }
56    }
57
58    #[inline]
59    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
60        match prim {
61            1 => Self::Internal,
62            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
63        }
64    }
65
66    #[inline]
67    pub fn unknown() -> Self {
68        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
69    }
70
71    #[inline]
72    pub const fn into_primitive(self) -> u32 {
73        match self {
74            Self::Internal => 1,
75            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
76        }
77    }
78
79    #[inline]
80    pub fn is_unknown(&self) -> bool {
81        match self {
82            Self::__SourceBreaking { unknown_ordinal: _ } => true,
83            _ => false,
84        }
85    }
86}
87
88#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89#[repr(C)]
90pub struct ClearCountryRequest {
91    pub phy_id: u16,
92}
93
94impl fidl::Persistable for ClearCountryRequest {}
95
96#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97#[repr(C)]
98pub struct DestroyIfaceRequest {
99    pub iface_id: u16,
100}
101
102impl fidl::Persistable for DestroyIfaceRequest {}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105#[repr(C)]
106pub struct DeviceMonitorClearCountryRequest {
107    pub req: ClearCountryRequest,
108}
109
110impl fidl::Persistable for DeviceMonitorClearCountryRequest {}
111
112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113#[repr(C)]
114pub struct DeviceMonitorClearCountryResponse {
115    pub status: i32,
116}
117
118impl fidl::Persistable for DeviceMonitorClearCountryResponse {}
119
120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121#[repr(C)]
122pub struct DeviceMonitorDestroyIfaceRequest {
123    pub req: DestroyIfaceRequest,
124}
125
126impl fidl::Persistable for DeviceMonitorDestroyIfaceRequest {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct DeviceMonitorDestroyIfaceResponse {
131    pub status: i32,
132}
133
134impl fidl::Persistable for DeviceMonitorDestroyIfaceResponse {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct DeviceMonitorGetCountryRequest {
139    pub phy_id: u16,
140}
141
142impl fidl::Persistable for DeviceMonitorGetCountryRequest {}
143
144#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145#[repr(C)]
146pub struct DeviceMonitorGetDevPathRequest {
147    pub phy_id: u16,
148}
149
150impl fidl::Persistable for DeviceMonitorGetDevPathRequest {}
151
152#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
153pub struct DeviceMonitorGetDevPathResponse {
154    pub dev_path: Option<String>,
155}
156
157impl fidl::Persistable for DeviceMonitorGetDevPathResponse {}
158
159#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
160#[repr(C)]
161pub struct DeviceMonitorGetPowerSaveModeRequest {
162    pub phy_id: u16,
163}
164
165impl fidl::Persistable for DeviceMonitorGetPowerSaveModeRequest {}
166
167#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168#[repr(C)]
169pub struct DeviceMonitorGetPowerStateRequest {
170    pub phy_id: u16,
171}
172
173impl fidl::Persistable for DeviceMonitorGetPowerStateRequest {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176#[repr(C)]
177pub struct DeviceMonitorGetSupportedMacRolesRequest {
178    pub phy_id: u16,
179}
180
181impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesRequest {}
182
183#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184#[repr(C)]
185pub struct DeviceMonitorGetTxPowerScenarioRequest {
186    pub phy_id: u16,
187}
188
189impl fidl::Persistable for DeviceMonitorGetTxPowerScenarioRequest {}
190
191#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
192pub struct DeviceMonitorListIfacesResponse {
193    pub iface_list: Vec<u16>,
194}
195
196impl fidl::Persistable for DeviceMonitorListIfacesResponse {}
197
198#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
199pub struct DeviceMonitorListPhysResponse {
200    pub phy_list: Vec<u16>,
201}
202
203impl fidl::Persistable for DeviceMonitorListPhysResponse {}
204
205#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
206#[repr(C)]
207pub struct DeviceMonitorPowerDownRequest {
208    pub phy_id: u16,
209}
210
211impl fidl::Persistable for DeviceMonitorPowerDownRequest {}
212
213#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
214#[repr(C)]
215pub struct DeviceMonitorPowerUpRequest {
216    pub phy_id: u16,
217}
218
219impl fidl::Persistable for DeviceMonitorPowerUpRequest {}
220
221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
222#[repr(C)]
223pub struct DeviceMonitorQueryIfaceRequest {
224    pub iface_id: u16,
225}
226
227impl fidl::Persistable for DeviceMonitorQueryIfaceRequest {}
228
229#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230#[repr(C)]
231pub struct DeviceMonitorResetRequest {
232    pub phy_id: u16,
233}
234
235impl fidl::Persistable for DeviceMonitorResetRequest {}
236
237#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
238#[repr(C)]
239pub struct DeviceMonitorResetTxPowerScenarioRequest {
240    pub phy_id: u16,
241}
242
243impl fidl::Persistable for DeviceMonitorResetTxPowerScenarioRequest {}
244
245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246pub struct DeviceMonitorSetBtCoexistenceModeRequest {
247    pub phy_id: u16,
248    pub mode: fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
249}
250
251impl fidl::Persistable for DeviceMonitorSetBtCoexistenceModeRequest {}
252
253#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
254#[repr(C)]
255pub struct DeviceMonitorSetCountryRequest {
256    pub req: SetCountryRequest,
257}
258
259impl fidl::Persistable for DeviceMonitorSetCountryRequest {}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262#[repr(C)]
263pub struct DeviceMonitorSetCountryResponse {
264    pub status: i32,
265}
266
267impl fidl::Persistable for DeviceMonitorSetCountryResponse {}
268
269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270pub struct DeviceMonitorSetPowerSaveModeRequest {
271    pub req: SetPowerSaveModeRequest,
272}
273
274impl fidl::Persistable for DeviceMonitorSetPowerSaveModeRequest {}
275
276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277#[repr(C)]
278pub struct DeviceMonitorSetPowerSaveModeResponse {
279    pub status: i32,
280}
281
282impl fidl::Persistable for DeviceMonitorSetPowerSaveModeResponse {}
283
284#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
285pub struct DeviceMonitorSetTxPowerScenarioRequest {
286    pub phy_id: u16,
287    pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
288}
289
290impl fidl::Persistable for DeviceMonitorSetTxPowerScenarioRequest {}
291
292#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
293#[repr(C)]
294pub struct DeviceMonitorGetCountryResponse {
295    pub resp: GetCountryResponse,
296}
297
298impl fidl::Persistable for DeviceMonitorGetCountryResponse {}
299
300#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
301pub struct DeviceMonitorGetPowerSaveModeResponse {
302    pub resp: GetPowerSaveModeResponse,
303}
304
305impl fidl::Persistable for DeviceMonitorGetPowerSaveModeResponse {}
306
307#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
308pub struct DeviceMonitorGetPowerStateResponse {
309    pub power_on: bool,
310}
311
312impl fidl::Persistable for DeviceMonitorGetPowerStateResponse {}
313
314#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315pub struct DeviceMonitorGetSupportedMacRolesResponse {
316    pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common__common::WlanMacRole>,
317}
318
319impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesResponse {}
320
321#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
322pub struct DeviceMonitorGetTxPowerScenarioResponse {
323    pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
324}
325
326impl fidl::Persistable for DeviceMonitorGetTxPowerScenarioResponse {}
327
328#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
329pub struct DeviceMonitorQueryIfaceResponse {
330    pub resp: QueryIfaceResponse,
331}
332
333impl fidl::Persistable for DeviceMonitorQueryIfaceResponse {}
334
335#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
336#[repr(C)]
337pub struct DeviceWatcherOnIfaceAddedRequest {
338    pub iface_id: u16,
339}
340
341impl fidl::Persistable for DeviceWatcherOnIfaceAddedRequest {}
342
343#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
344#[repr(C)]
345pub struct DeviceWatcherOnIfaceRemovedRequest {
346    pub iface_id: u16,
347}
348
349impl fidl::Persistable for DeviceWatcherOnIfaceRemovedRequest {}
350
351#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
352#[repr(C)]
353pub struct DeviceWatcherOnPhyAddedRequest {
354    pub phy_id: u16,
355}
356
357impl fidl::Persistable for DeviceWatcherOnPhyAddedRequest {}
358
359#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
360#[repr(C)]
361pub struct DeviceWatcherOnPhyRemovedRequest {
362    pub phy_id: u16,
363}
364
365impl fidl::Persistable for DeviceWatcherOnPhyRemovedRequest {}
366
367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
368#[repr(C)]
369pub struct GetCountryResponse {
370    pub alpha2: [u8; 2],
371}
372
373impl fidl::Persistable for GetCountryResponse {}
374
375#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
376pub struct GetPowerSaveModeResponse {
377    /// Power Save Mode bit mask
378    pub ps_mode: fidl_fuchsia_wlan_common__common::PowerSaveType,
379}
380
381impl fidl::Persistable for GetPowerSaveModeResponse {}
382
383#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384#[repr(C)]
385pub struct PhyEventWatcherOnCountryCodeChangeRequest {
386    pub phy_id: u16,
387    pub alpha2: [u8; 2],
388}
389
390impl fidl::Persistable for PhyEventWatcherOnCountryCodeChangeRequest {}
391
392#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
393pub struct PhyEventWatcherOnCriticalErrorRequest {
394    pub phy_id: u16,
395    pub reason_code: CriticalErrorReason,
396}
397
398impl fidl::Persistable for PhyEventWatcherOnCriticalErrorRequest {}
399
400#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
401pub struct QueryIfaceResponse {
402    /// The role the iface is currently operating in, e.g., client role.
403    pub role: fidl_fuchsia_wlan_common__common::WlanMacRole,
404    /// The iface's global ID.
405    pub id: u16,
406    /// Iface's PHY ID.
407    pub phy_id: u16,
408    /// Local ID assigned by this iface's PHY.
409    pub phy_assigned_id: u16,
410    /// The iface's MAC.
411    pub sta_addr: [u8; 6],
412}
413
414impl fidl::Persistable for QueryIfaceResponse {}
415
416#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
417#[repr(C)]
418pub struct SetCountryRequest {
419    pub phy_id: u16,
420    pub alpha2: [u8; 2],
421}
422
423impl fidl::Persistable for SetCountryRequest {}
424
425#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
426pub struct SetPowerSaveModeRequest {
427    /// Interface's PHY ID
428    pub phy_id: u16,
429    /// Power Save Mode bit mask
430    pub ps_mode: fidl_fuchsia_wlan_common__common::PowerSaveType,
431}
432
433impl fidl::Persistable for SetPowerSaveModeRequest {}
434
435#[derive(Clone, Debug, Default, PartialEq)]
436pub struct DeviceMonitorCreateIfaceRequest {
437    pub phy_id: Option<u16>,
438    pub role: Option<fidl_fuchsia_wlan_common__common::WlanMacRole>,
439    pub sta_address: Option<[u8; 6]>,
440    #[doc(hidden)]
441    pub __source_breaking: fidl::marker::SourceBreaking,
442}
443
444impl fidl::Persistable for DeviceMonitorCreateIfaceRequest {}
445
446#[derive(Clone, Debug, Default, PartialEq)]
447pub struct DeviceMonitorCreateIfaceResponse {
448    pub iface_id: Option<u16>,
449    #[doc(hidden)]
450    pub __source_breaking: fidl::marker::SourceBreaking,
451}
452
453impl fidl::Persistable for DeviceMonitorCreateIfaceResponse {}
454
455#[derive(Clone, Debug, PartialEq)]
456pub enum GetIfaceHistogramStatsResponse {
457    Stats(fidl_fuchsia_wlan_stats__common::IfaceHistogramStats),
458    ErrorStatus(i32),
459}
460
461impl GetIfaceHistogramStatsResponse {
462    #[inline]
463    pub fn ordinal(&self) -> u64 {
464        match *self {
465            Self::Stats(_) => 1,
466            Self::ErrorStatus(_) => 2,
467        }
468    }
469}
470
471impl fidl::Persistable for GetIfaceHistogramStatsResponse {}
472
473pub mod device_monitor_ordinals {
474    pub const LIST_PHYS: u64 = 0x3a08518874196aab;
475    pub const LIST_IFACES: u64 = 0x129e758fb8e0b113;
476    pub const GET_DEV_PATH: u64 = 0x4aa489b57113bccf;
477    pub const GET_SUPPORTED_MAC_ROLES: u64 = 0x172b3d2eabd5a14e;
478    pub const WATCH_DEVICES: u64 = 0x4615941e67e31b8e;
479    pub const WATCH_PHY_EVENTS: u64 = 0x2c5af9d064099745;
480    pub const GET_COUNTRY: u64 = 0x6f1040bd81bde90e;
481    pub const SET_COUNTRY: u64 = 0xdaa7b77a5a6e71b;
482    pub const CLEAR_COUNTRY: u64 = 0x66714d61103120e9;
483    pub const SET_POWER_SAVE_MODE: u64 = 0x62202b4d360533bc;
484    pub const GET_POWER_SAVE_MODE: u64 = 0x14304d406ada8693;
485    pub const POWER_DOWN: u64 = 0x374ad717fe8902e0;
486    pub const POWER_UP: u64 = 0xa2379b639869c17;
487    pub const RESET: u64 = 0x6def240c9f8c6867;
488    pub const SET_TX_POWER_SCENARIO: u64 = 0x7c51443a985934fd;
489    pub const RESET_TX_POWER_SCENARIO: u64 = 0x4790357c9cdddc4a;
490    pub const GET_TX_POWER_SCENARIO: u64 = 0x555fb197f90e9830;
491    pub const GET_POWER_STATE: u64 = 0x58cf95c5bbbe3f;
492    pub const SET_BT_COEXISTENCE_MODE: u64 = 0x97539596c9a79c7;
493    pub const CREATE_IFACE: u64 = 0x1e1d30c24c0ec144;
494    pub const QUERY_IFACE: u64 = 0x1a48c4a2b86259ef;
495    pub const DESTROY_IFACE: u64 = 0x4c77982c1616a3b0;
496    pub const GET_CLIENT_SME: u64 = 0x1b056c379ca98273;
497    pub const GET_AP_SME: u64 = 0x754de680c4318c52;
498    pub const GET_SME_TELEMETRY: u64 = 0x1baf42b003f7452a;
499}
500
501pub mod device_watcher_ordinals {
502    pub const ON_PHY_ADDED: u64 = 0x771c58e0bd059f86;
503    pub const ON_PHY_REMOVED: u64 = 0x4ad72b96ccb7cff6;
504    pub const ON_IFACE_ADDED: u64 = 0x6ee685e4aa1f31d8;
505    pub const ON_IFACE_REMOVED: u64 = 0x3b771b1fce38c291;
506}
507
508pub mod phy_event_watcher_ordinals {
509    pub const ON_CRITICAL_ERROR: u64 = 0x609a325d54f9e6ac;
510    pub const ON_COUNTRY_CODE_CHANGE: u64 = 0x781d791772be33ed;
511}
512
513mod internal {
514    use super::*;
515    unsafe impl fidl::encoding::TypeMarker for CriticalErrorReason {
516        type Owned = Self;
517
518        #[inline(always)]
519        fn inline_align(_context: fidl::encoding::Context) -> usize {
520            std::mem::align_of::<u8>()
521        }
522
523        #[inline(always)]
524        fn inline_size(_context: fidl::encoding::Context) -> usize {
525            std::mem::size_of::<u8>()
526        }
527
528        #[inline(always)]
529        fn encode_is_copy() -> bool {
530            true
531        }
532
533        #[inline(always)]
534        fn decode_is_copy() -> bool {
535            false
536        }
537    }
538
539    impl fidl::encoding::ValueTypeMarker for CriticalErrorReason {
540        type Borrowed<'a> = Self;
541        #[inline(always)]
542        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
543            *value
544        }
545    }
546
547    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
548        for CriticalErrorReason
549    {
550        #[inline]
551        unsafe fn encode(
552            self,
553            encoder: &mut fidl::encoding::Encoder<'_, D>,
554            offset: usize,
555            _depth: fidl::encoding::Depth,
556        ) -> fidl::Result<()> {
557            encoder.debug_check_bounds::<Self>(offset);
558            encoder.write_num(self.into_primitive(), offset);
559            Ok(())
560        }
561    }
562
563    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CriticalErrorReason {
564        #[inline(always)]
565        fn new_empty() -> Self {
566            Self::FwCrash
567        }
568
569        #[inline]
570        unsafe fn decode(
571            &mut self,
572            decoder: &mut fidl::encoding::Decoder<'_, D>,
573            offset: usize,
574            _depth: fidl::encoding::Depth,
575        ) -> fidl::Result<()> {
576            decoder.debug_check_bounds::<Self>(offset);
577            let prim = decoder.read_num::<u8>(offset);
578
579            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
580            Ok(())
581        }
582    }
583    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorError {
584        type Owned = Self;
585
586        #[inline(always)]
587        fn inline_align(_context: fidl::encoding::Context) -> usize {
588            std::mem::align_of::<u32>()
589        }
590
591        #[inline(always)]
592        fn inline_size(_context: fidl::encoding::Context) -> usize {
593            std::mem::size_of::<u32>()
594        }
595
596        #[inline(always)]
597        fn encode_is_copy() -> bool {
598            false
599        }
600
601        #[inline(always)]
602        fn decode_is_copy() -> bool {
603            false
604        }
605    }
606
607    impl fidl::encoding::ValueTypeMarker for DeviceMonitorError {
608        type Borrowed<'a> = Self;
609        #[inline(always)]
610        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
611            *value
612        }
613    }
614
615    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
616        for DeviceMonitorError
617    {
618        #[inline]
619        unsafe fn encode(
620            self,
621            encoder: &mut fidl::encoding::Encoder<'_, D>,
622            offset: usize,
623            _depth: fidl::encoding::Depth,
624        ) -> fidl::Result<()> {
625            encoder.debug_check_bounds::<Self>(offset);
626            encoder.write_num(self.into_primitive(), offset);
627            Ok(())
628        }
629    }
630
631    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceMonitorError {
632        #[inline(always)]
633        fn new_empty() -> Self {
634            Self::unknown()
635        }
636
637        #[inline]
638        unsafe fn decode(
639            &mut self,
640            decoder: &mut fidl::encoding::Decoder<'_, D>,
641            offset: usize,
642            _depth: fidl::encoding::Depth,
643        ) -> fidl::Result<()> {
644            decoder.debug_check_bounds::<Self>(offset);
645            let prim = decoder.read_num::<u32>(offset);
646
647            *self = Self::from_primitive_allow_unknown(prim);
648            Ok(())
649        }
650    }
651
652    impl fidl::encoding::ValueTypeMarker for ClearCountryRequest {
653        type Borrowed<'a> = &'a Self;
654        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
655            value
656        }
657    }
658
659    unsafe impl fidl::encoding::TypeMarker for ClearCountryRequest {
660        type Owned = Self;
661
662        #[inline(always)]
663        fn inline_align(_context: fidl::encoding::Context) -> usize {
664            2
665        }
666
667        #[inline(always)]
668        fn inline_size(_context: fidl::encoding::Context) -> usize {
669            2
670        }
671        #[inline(always)]
672        fn encode_is_copy() -> bool {
673            true
674        }
675
676        #[inline(always)]
677        fn decode_is_copy() -> bool {
678            true
679        }
680    }
681
682    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClearCountryRequest, D>
683        for &ClearCountryRequest
684    {
685        #[inline]
686        unsafe fn encode(
687            self,
688            encoder: &mut fidl::encoding::Encoder<'_, D>,
689            offset: usize,
690            _depth: fidl::encoding::Depth,
691        ) -> fidl::Result<()> {
692            encoder.debug_check_bounds::<ClearCountryRequest>(offset);
693            unsafe {
694                // Copy the object into the buffer.
695                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
696                (buf_ptr as *mut ClearCountryRequest)
697                    .write_unaligned((self as *const ClearCountryRequest).read());
698                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
699                // done second because the memcpy will write garbage to these bytes.
700            }
701            Ok(())
702        }
703    }
704    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
705        fidl::encoding::Encode<ClearCountryRequest, D> for (T0,)
706    {
707        #[inline]
708        unsafe fn encode(
709            self,
710            encoder: &mut fidl::encoding::Encoder<'_, D>,
711            offset: usize,
712            depth: fidl::encoding::Depth,
713        ) -> fidl::Result<()> {
714            encoder.debug_check_bounds::<ClearCountryRequest>(offset);
715            // Zero out padding regions. There's no need to apply masks
716            // because the unmasked parts will be overwritten by fields.
717            // Write the fields.
718            self.0.encode(encoder, offset + 0, depth)?;
719            Ok(())
720        }
721    }
722
723    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClearCountryRequest {
724        #[inline(always)]
725        fn new_empty() -> Self {
726            Self { phy_id: fidl::new_empty!(u16, D) }
727        }
728
729        #[inline]
730        unsafe fn decode(
731            &mut self,
732            decoder: &mut fidl::encoding::Decoder<'_, D>,
733            offset: usize,
734            _depth: fidl::encoding::Depth,
735        ) -> fidl::Result<()> {
736            decoder.debug_check_bounds::<Self>(offset);
737            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
738            // Verify that padding bytes are zero.
739            // Copy from the buffer into the object.
740            unsafe {
741                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
742            }
743            Ok(())
744        }
745    }
746
747    impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
748        type Borrowed<'a> = &'a Self;
749        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
750            value
751        }
752    }
753
754    unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
755        type Owned = Self;
756
757        #[inline(always)]
758        fn inline_align(_context: fidl::encoding::Context) -> usize {
759            2
760        }
761
762        #[inline(always)]
763        fn inline_size(_context: fidl::encoding::Context) -> usize {
764            2
765        }
766        #[inline(always)]
767        fn encode_is_copy() -> bool {
768            true
769        }
770
771        #[inline(always)]
772        fn decode_is_copy() -> bool {
773            true
774        }
775    }
776
777    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyIfaceRequest, D>
778        for &DestroyIfaceRequest
779    {
780        #[inline]
781        unsafe fn encode(
782            self,
783            encoder: &mut fidl::encoding::Encoder<'_, D>,
784            offset: usize,
785            _depth: fidl::encoding::Depth,
786        ) -> fidl::Result<()> {
787            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
788            unsafe {
789                // Copy the object into the buffer.
790                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
791                (buf_ptr as *mut DestroyIfaceRequest)
792                    .write_unaligned((self as *const DestroyIfaceRequest).read());
793                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
794                // done second because the memcpy will write garbage to these bytes.
795            }
796            Ok(())
797        }
798    }
799    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
800        fidl::encoding::Encode<DestroyIfaceRequest, D> for (T0,)
801    {
802        #[inline]
803        unsafe fn encode(
804            self,
805            encoder: &mut fidl::encoding::Encoder<'_, D>,
806            offset: usize,
807            depth: fidl::encoding::Depth,
808        ) -> fidl::Result<()> {
809            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
810            // Zero out padding regions. There's no need to apply masks
811            // because the unmasked parts will be overwritten by fields.
812            // Write the fields.
813            self.0.encode(encoder, offset + 0, depth)?;
814            Ok(())
815        }
816    }
817
818    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
819        #[inline(always)]
820        fn new_empty() -> Self {
821            Self { iface_id: fidl::new_empty!(u16, D) }
822        }
823
824        #[inline]
825        unsafe fn decode(
826            &mut self,
827            decoder: &mut fidl::encoding::Decoder<'_, D>,
828            offset: usize,
829            _depth: fidl::encoding::Depth,
830        ) -> fidl::Result<()> {
831            decoder.debug_check_bounds::<Self>(offset);
832            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
833            // Verify that padding bytes are zero.
834            // Copy from the buffer into the object.
835            unsafe {
836                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
837            }
838            Ok(())
839        }
840    }
841
842    impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryRequest {
843        type Borrowed<'a> = &'a Self;
844        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
845            value
846        }
847    }
848
849    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryRequest {
850        type Owned = Self;
851
852        #[inline(always)]
853        fn inline_align(_context: fidl::encoding::Context) -> usize {
854            2
855        }
856
857        #[inline(always)]
858        fn inline_size(_context: fidl::encoding::Context) -> usize {
859            2
860        }
861        #[inline(always)]
862        fn encode_is_copy() -> bool {
863            true
864        }
865
866        #[inline(always)]
867        fn decode_is_copy() -> bool {
868            true
869        }
870    }
871
872    unsafe impl<D: fidl::encoding::ResourceDialect>
873        fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D>
874        for &DeviceMonitorClearCountryRequest
875    {
876        #[inline]
877        unsafe fn encode(
878            self,
879            encoder: &mut fidl::encoding::Encoder<'_, D>,
880            offset: usize,
881            _depth: fidl::encoding::Depth,
882        ) -> fidl::Result<()> {
883            encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
884            unsafe {
885                // Copy the object into the buffer.
886                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
887                (buf_ptr as *mut DeviceMonitorClearCountryRequest)
888                    .write_unaligned((self as *const DeviceMonitorClearCountryRequest).read());
889                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
890                // done second because the memcpy will write garbage to these bytes.
891            }
892            Ok(())
893        }
894    }
895    unsafe impl<
896        D: fidl::encoding::ResourceDialect,
897        T0: fidl::encoding::Encode<ClearCountryRequest, D>,
898    > fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D> for (T0,)
899    {
900        #[inline]
901        unsafe fn encode(
902            self,
903            encoder: &mut fidl::encoding::Encoder<'_, D>,
904            offset: usize,
905            depth: fidl::encoding::Depth,
906        ) -> fidl::Result<()> {
907            encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
908            // Zero out padding regions. There's no need to apply masks
909            // because the unmasked parts will be overwritten by fields.
910            // Write the fields.
911            self.0.encode(encoder, offset + 0, depth)?;
912            Ok(())
913        }
914    }
915
916    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
917        for DeviceMonitorClearCountryRequest
918    {
919        #[inline(always)]
920        fn new_empty() -> Self {
921            Self { req: fidl::new_empty!(ClearCountryRequest, D) }
922        }
923
924        #[inline]
925        unsafe fn decode(
926            &mut self,
927            decoder: &mut fidl::encoding::Decoder<'_, D>,
928            offset: usize,
929            _depth: fidl::encoding::Depth,
930        ) -> fidl::Result<()> {
931            decoder.debug_check_bounds::<Self>(offset);
932            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
933            // Verify that padding bytes are zero.
934            // Copy from the buffer into the object.
935            unsafe {
936                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
937            }
938            Ok(())
939        }
940    }
941
942    impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryResponse {
943        type Borrowed<'a> = &'a Self;
944        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
945            value
946        }
947    }
948
949    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryResponse {
950        type Owned = Self;
951
952        #[inline(always)]
953        fn inline_align(_context: fidl::encoding::Context) -> usize {
954            4
955        }
956
957        #[inline(always)]
958        fn inline_size(_context: fidl::encoding::Context) -> usize {
959            4
960        }
961        #[inline(always)]
962        fn encode_is_copy() -> bool {
963            true
964        }
965
966        #[inline(always)]
967        fn decode_is_copy() -> bool {
968            true
969        }
970    }
971
972    unsafe impl<D: fidl::encoding::ResourceDialect>
973        fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D>
974        for &DeviceMonitorClearCountryResponse
975    {
976        #[inline]
977        unsafe fn encode(
978            self,
979            encoder: &mut fidl::encoding::Encoder<'_, D>,
980            offset: usize,
981            _depth: fidl::encoding::Depth,
982        ) -> fidl::Result<()> {
983            encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
984            unsafe {
985                // Copy the object into the buffer.
986                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
987                (buf_ptr as *mut DeviceMonitorClearCountryResponse)
988                    .write_unaligned((self as *const DeviceMonitorClearCountryResponse).read());
989                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
990                // done second because the memcpy will write garbage to these bytes.
991            }
992            Ok(())
993        }
994    }
995    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
996        fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D> for (T0,)
997    {
998        #[inline]
999        unsafe fn encode(
1000            self,
1001            encoder: &mut fidl::encoding::Encoder<'_, D>,
1002            offset: usize,
1003            depth: fidl::encoding::Depth,
1004        ) -> fidl::Result<()> {
1005            encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
1006            // Zero out padding regions. There's no need to apply masks
1007            // because the unmasked parts will be overwritten by fields.
1008            // Write the fields.
1009            self.0.encode(encoder, offset + 0, depth)?;
1010            Ok(())
1011        }
1012    }
1013
1014    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1015        for DeviceMonitorClearCountryResponse
1016    {
1017        #[inline(always)]
1018        fn new_empty() -> Self {
1019            Self { status: fidl::new_empty!(i32, D) }
1020        }
1021
1022        #[inline]
1023        unsafe fn decode(
1024            &mut self,
1025            decoder: &mut fidl::encoding::Decoder<'_, D>,
1026            offset: usize,
1027            _depth: fidl::encoding::Depth,
1028        ) -> fidl::Result<()> {
1029            decoder.debug_check_bounds::<Self>(offset);
1030            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1031            // Verify that padding bytes are zero.
1032            // Copy from the buffer into the object.
1033            unsafe {
1034                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1035            }
1036            Ok(())
1037        }
1038    }
1039
1040    impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceRequest {
1041        type Borrowed<'a> = &'a Self;
1042        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1043            value
1044        }
1045    }
1046
1047    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceRequest {
1048        type Owned = Self;
1049
1050        #[inline(always)]
1051        fn inline_align(_context: fidl::encoding::Context) -> usize {
1052            2
1053        }
1054
1055        #[inline(always)]
1056        fn inline_size(_context: fidl::encoding::Context) -> usize {
1057            2
1058        }
1059        #[inline(always)]
1060        fn encode_is_copy() -> bool {
1061            true
1062        }
1063
1064        #[inline(always)]
1065        fn decode_is_copy() -> bool {
1066            true
1067        }
1068    }
1069
1070    unsafe impl<D: fidl::encoding::ResourceDialect>
1071        fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D>
1072        for &DeviceMonitorDestroyIfaceRequest
1073    {
1074        #[inline]
1075        unsafe fn encode(
1076            self,
1077            encoder: &mut fidl::encoding::Encoder<'_, D>,
1078            offset: usize,
1079            _depth: fidl::encoding::Depth,
1080        ) -> fidl::Result<()> {
1081            encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
1082            unsafe {
1083                // Copy the object into the buffer.
1084                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1085                (buf_ptr as *mut DeviceMonitorDestroyIfaceRequest)
1086                    .write_unaligned((self as *const DeviceMonitorDestroyIfaceRequest).read());
1087                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1088                // done second because the memcpy will write garbage to these bytes.
1089            }
1090            Ok(())
1091        }
1092    }
1093    unsafe impl<
1094        D: fidl::encoding::ResourceDialect,
1095        T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
1096    > fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D> for (T0,)
1097    {
1098        #[inline]
1099        unsafe fn encode(
1100            self,
1101            encoder: &mut fidl::encoding::Encoder<'_, D>,
1102            offset: usize,
1103            depth: fidl::encoding::Depth,
1104        ) -> fidl::Result<()> {
1105            encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
1106            // Zero out padding regions. There's no need to apply masks
1107            // because the unmasked parts will be overwritten by fields.
1108            // Write the fields.
1109            self.0.encode(encoder, offset + 0, depth)?;
1110            Ok(())
1111        }
1112    }
1113
1114    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1115        for DeviceMonitorDestroyIfaceRequest
1116    {
1117        #[inline(always)]
1118        fn new_empty() -> Self {
1119            Self { req: fidl::new_empty!(DestroyIfaceRequest, D) }
1120        }
1121
1122        #[inline]
1123        unsafe fn decode(
1124            &mut self,
1125            decoder: &mut fidl::encoding::Decoder<'_, D>,
1126            offset: usize,
1127            _depth: fidl::encoding::Depth,
1128        ) -> fidl::Result<()> {
1129            decoder.debug_check_bounds::<Self>(offset);
1130            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1131            // Verify that padding bytes are zero.
1132            // Copy from the buffer into the object.
1133            unsafe {
1134                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1135            }
1136            Ok(())
1137        }
1138    }
1139
1140    impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceResponse {
1141        type Borrowed<'a> = &'a Self;
1142        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1143            value
1144        }
1145    }
1146
1147    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceResponse {
1148        type Owned = Self;
1149
1150        #[inline(always)]
1151        fn inline_align(_context: fidl::encoding::Context) -> usize {
1152            4
1153        }
1154
1155        #[inline(always)]
1156        fn inline_size(_context: fidl::encoding::Context) -> usize {
1157            4
1158        }
1159        #[inline(always)]
1160        fn encode_is_copy() -> bool {
1161            true
1162        }
1163
1164        #[inline(always)]
1165        fn decode_is_copy() -> bool {
1166            true
1167        }
1168    }
1169
1170    unsafe impl<D: fidl::encoding::ResourceDialect>
1171        fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D>
1172        for &DeviceMonitorDestroyIfaceResponse
1173    {
1174        #[inline]
1175        unsafe fn encode(
1176            self,
1177            encoder: &mut fidl::encoding::Encoder<'_, D>,
1178            offset: usize,
1179            _depth: fidl::encoding::Depth,
1180        ) -> fidl::Result<()> {
1181            encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
1182            unsafe {
1183                // Copy the object into the buffer.
1184                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1185                (buf_ptr as *mut DeviceMonitorDestroyIfaceResponse)
1186                    .write_unaligned((self as *const DeviceMonitorDestroyIfaceResponse).read());
1187                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1188                // done second because the memcpy will write garbage to these bytes.
1189            }
1190            Ok(())
1191        }
1192    }
1193    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1194        fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D> for (T0,)
1195    {
1196        #[inline]
1197        unsafe fn encode(
1198            self,
1199            encoder: &mut fidl::encoding::Encoder<'_, D>,
1200            offset: usize,
1201            depth: fidl::encoding::Depth,
1202        ) -> fidl::Result<()> {
1203            encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
1204            // Zero out padding regions. There's no need to apply masks
1205            // because the unmasked parts will be overwritten by fields.
1206            // Write the fields.
1207            self.0.encode(encoder, offset + 0, depth)?;
1208            Ok(())
1209        }
1210    }
1211
1212    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1213        for DeviceMonitorDestroyIfaceResponse
1214    {
1215        #[inline(always)]
1216        fn new_empty() -> Self {
1217            Self { status: fidl::new_empty!(i32, D) }
1218        }
1219
1220        #[inline]
1221        unsafe fn decode(
1222            &mut self,
1223            decoder: &mut fidl::encoding::Decoder<'_, D>,
1224            offset: usize,
1225            _depth: fidl::encoding::Depth,
1226        ) -> fidl::Result<()> {
1227            decoder.debug_check_bounds::<Self>(offset);
1228            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1229            // Verify that padding bytes are zero.
1230            // Copy from the buffer into the object.
1231            unsafe {
1232                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1233            }
1234            Ok(())
1235        }
1236    }
1237
1238    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryRequest {
1239        type Borrowed<'a> = &'a Self;
1240        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1241            value
1242        }
1243    }
1244
1245    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryRequest {
1246        type Owned = Self;
1247
1248        #[inline(always)]
1249        fn inline_align(_context: fidl::encoding::Context) -> usize {
1250            2
1251        }
1252
1253        #[inline(always)]
1254        fn inline_size(_context: fidl::encoding::Context) -> usize {
1255            2
1256        }
1257        #[inline(always)]
1258        fn encode_is_copy() -> bool {
1259            true
1260        }
1261
1262        #[inline(always)]
1263        fn decode_is_copy() -> bool {
1264            true
1265        }
1266    }
1267
1268    unsafe impl<D: fidl::encoding::ResourceDialect>
1269        fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D>
1270        for &DeviceMonitorGetCountryRequest
1271    {
1272        #[inline]
1273        unsafe fn encode(
1274            self,
1275            encoder: &mut fidl::encoding::Encoder<'_, D>,
1276            offset: usize,
1277            _depth: fidl::encoding::Depth,
1278        ) -> fidl::Result<()> {
1279            encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1280            unsafe {
1281                // Copy the object into the buffer.
1282                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1283                (buf_ptr as *mut DeviceMonitorGetCountryRequest)
1284                    .write_unaligned((self as *const DeviceMonitorGetCountryRequest).read());
1285                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1286                // done second because the memcpy will write garbage to these bytes.
1287            }
1288            Ok(())
1289        }
1290    }
1291    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1292        fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D> for (T0,)
1293    {
1294        #[inline]
1295        unsafe fn encode(
1296            self,
1297            encoder: &mut fidl::encoding::Encoder<'_, D>,
1298            offset: usize,
1299            depth: fidl::encoding::Depth,
1300        ) -> fidl::Result<()> {
1301            encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1302            // Zero out padding regions. There's no need to apply masks
1303            // because the unmasked parts will be overwritten by fields.
1304            // Write the fields.
1305            self.0.encode(encoder, offset + 0, depth)?;
1306            Ok(())
1307        }
1308    }
1309
1310    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1311        for DeviceMonitorGetCountryRequest
1312    {
1313        #[inline(always)]
1314        fn new_empty() -> Self {
1315            Self { phy_id: fidl::new_empty!(u16, D) }
1316        }
1317
1318        #[inline]
1319        unsafe fn decode(
1320            &mut self,
1321            decoder: &mut fidl::encoding::Decoder<'_, D>,
1322            offset: usize,
1323            _depth: fidl::encoding::Depth,
1324        ) -> fidl::Result<()> {
1325            decoder.debug_check_bounds::<Self>(offset);
1326            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1327            // Verify that padding bytes are zero.
1328            // Copy from the buffer into the object.
1329            unsafe {
1330                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1331            }
1332            Ok(())
1333        }
1334    }
1335
1336    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathRequest {
1337        type Borrowed<'a> = &'a Self;
1338        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1339            value
1340        }
1341    }
1342
1343    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathRequest {
1344        type Owned = Self;
1345
1346        #[inline(always)]
1347        fn inline_align(_context: fidl::encoding::Context) -> usize {
1348            2
1349        }
1350
1351        #[inline(always)]
1352        fn inline_size(_context: fidl::encoding::Context) -> usize {
1353            2
1354        }
1355        #[inline(always)]
1356        fn encode_is_copy() -> bool {
1357            true
1358        }
1359
1360        #[inline(always)]
1361        fn decode_is_copy() -> bool {
1362            true
1363        }
1364    }
1365
1366    unsafe impl<D: fidl::encoding::ResourceDialect>
1367        fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D>
1368        for &DeviceMonitorGetDevPathRequest
1369    {
1370        #[inline]
1371        unsafe fn encode(
1372            self,
1373            encoder: &mut fidl::encoding::Encoder<'_, D>,
1374            offset: usize,
1375            _depth: fidl::encoding::Depth,
1376        ) -> fidl::Result<()> {
1377            encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1378            unsafe {
1379                // Copy the object into the buffer.
1380                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1381                (buf_ptr as *mut DeviceMonitorGetDevPathRequest)
1382                    .write_unaligned((self as *const DeviceMonitorGetDevPathRequest).read());
1383                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1384                // done second because the memcpy will write garbage to these bytes.
1385            }
1386            Ok(())
1387        }
1388    }
1389    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1390        fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D> for (T0,)
1391    {
1392        #[inline]
1393        unsafe fn encode(
1394            self,
1395            encoder: &mut fidl::encoding::Encoder<'_, D>,
1396            offset: usize,
1397            depth: fidl::encoding::Depth,
1398        ) -> fidl::Result<()> {
1399            encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1400            // Zero out padding regions. There's no need to apply masks
1401            // because the unmasked parts will be overwritten by fields.
1402            // Write the fields.
1403            self.0.encode(encoder, offset + 0, depth)?;
1404            Ok(())
1405        }
1406    }
1407
1408    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1409        for DeviceMonitorGetDevPathRequest
1410    {
1411        #[inline(always)]
1412        fn new_empty() -> Self {
1413            Self { phy_id: fidl::new_empty!(u16, D) }
1414        }
1415
1416        #[inline]
1417        unsafe fn decode(
1418            &mut self,
1419            decoder: &mut fidl::encoding::Decoder<'_, D>,
1420            offset: usize,
1421            _depth: fidl::encoding::Depth,
1422        ) -> fidl::Result<()> {
1423            decoder.debug_check_bounds::<Self>(offset);
1424            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1425            // Verify that padding bytes are zero.
1426            // Copy from the buffer into the object.
1427            unsafe {
1428                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1429            }
1430            Ok(())
1431        }
1432    }
1433
1434    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathResponse {
1435        type Borrowed<'a> = &'a Self;
1436        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1437            value
1438        }
1439    }
1440
1441    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathResponse {
1442        type Owned = Self;
1443
1444        #[inline(always)]
1445        fn inline_align(_context: fidl::encoding::Context) -> usize {
1446            8
1447        }
1448
1449        #[inline(always)]
1450        fn inline_size(_context: fidl::encoding::Context) -> usize {
1451            16
1452        }
1453    }
1454
1455    unsafe impl<D: fidl::encoding::ResourceDialect>
1456        fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D>
1457        for &DeviceMonitorGetDevPathResponse
1458    {
1459        #[inline]
1460        unsafe fn encode(
1461            self,
1462            encoder: &mut fidl::encoding::Encoder<'_, D>,
1463            offset: usize,
1464            _depth: fidl::encoding::Depth,
1465        ) -> fidl::Result<()> {
1466            encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1467            // Delegate to tuple encoding.
1468            fidl::encoding::Encode::<DeviceMonitorGetDevPathResponse, D>::encode(
1469                (
1470                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.dev_path),
1471                ),
1472                encoder, offset, _depth
1473            )
1474        }
1475    }
1476    unsafe impl<
1477        D: fidl::encoding::ResourceDialect,
1478        T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
1479    > fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D> for (T0,)
1480    {
1481        #[inline]
1482        unsafe fn encode(
1483            self,
1484            encoder: &mut fidl::encoding::Encoder<'_, D>,
1485            offset: usize,
1486            depth: fidl::encoding::Depth,
1487        ) -> fidl::Result<()> {
1488            encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1489            // Zero out padding regions. There's no need to apply masks
1490            // because the unmasked parts will be overwritten by fields.
1491            // Write the fields.
1492            self.0.encode(encoder, offset + 0, depth)?;
1493            Ok(())
1494        }
1495    }
1496
1497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1498        for DeviceMonitorGetDevPathResponse
1499    {
1500        #[inline(always)]
1501        fn new_empty() -> Self {
1502            Self {
1503                dev_path: fidl::new_empty!(
1504                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1505                    D
1506                ),
1507            }
1508        }
1509
1510        #[inline]
1511        unsafe fn decode(
1512            &mut self,
1513            decoder: &mut fidl::encoding::Decoder<'_, D>,
1514            offset: usize,
1515            _depth: fidl::encoding::Depth,
1516        ) -> fidl::Result<()> {
1517            decoder.debug_check_bounds::<Self>(offset);
1518            // Verify that padding bytes are zero.
1519            fidl::decode!(
1520                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1521                D,
1522                &mut self.dev_path,
1523                decoder,
1524                offset + 0,
1525                _depth
1526            )?;
1527            Ok(())
1528        }
1529    }
1530
1531    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1532        type Borrowed<'a> = &'a Self;
1533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1534            value
1535        }
1536    }
1537
1538    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1539        type Owned = Self;
1540
1541        #[inline(always)]
1542        fn inline_align(_context: fidl::encoding::Context) -> usize {
1543            2
1544        }
1545
1546        #[inline(always)]
1547        fn inline_size(_context: fidl::encoding::Context) -> usize {
1548            2
1549        }
1550        #[inline(always)]
1551        fn encode_is_copy() -> bool {
1552            true
1553        }
1554
1555        #[inline(always)]
1556        fn decode_is_copy() -> bool {
1557            true
1558        }
1559    }
1560
1561    unsafe impl<D: fidl::encoding::ResourceDialect>
1562        fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D>
1563        for &DeviceMonitorGetPowerSaveModeRequest
1564    {
1565        #[inline]
1566        unsafe fn encode(
1567            self,
1568            encoder: &mut fidl::encoding::Encoder<'_, D>,
1569            offset: usize,
1570            _depth: fidl::encoding::Depth,
1571        ) -> fidl::Result<()> {
1572            encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1573            unsafe {
1574                // Copy the object into the buffer.
1575                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1576                (buf_ptr as *mut DeviceMonitorGetPowerSaveModeRequest)
1577                    .write_unaligned((self as *const DeviceMonitorGetPowerSaveModeRequest).read());
1578                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1579                // done second because the memcpy will write garbage to these bytes.
1580            }
1581            Ok(())
1582        }
1583    }
1584    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1585        fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D> for (T0,)
1586    {
1587        #[inline]
1588        unsafe fn encode(
1589            self,
1590            encoder: &mut fidl::encoding::Encoder<'_, D>,
1591            offset: usize,
1592            depth: fidl::encoding::Depth,
1593        ) -> fidl::Result<()> {
1594            encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1595            // Zero out padding regions. There's no need to apply masks
1596            // because the unmasked parts will be overwritten by fields.
1597            // Write the fields.
1598            self.0.encode(encoder, offset + 0, depth)?;
1599            Ok(())
1600        }
1601    }
1602
1603    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1604        for DeviceMonitorGetPowerSaveModeRequest
1605    {
1606        #[inline(always)]
1607        fn new_empty() -> Self {
1608            Self { phy_id: fidl::new_empty!(u16, D) }
1609        }
1610
1611        #[inline]
1612        unsafe fn decode(
1613            &mut self,
1614            decoder: &mut fidl::encoding::Decoder<'_, D>,
1615            offset: usize,
1616            _depth: fidl::encoding::Depth,
1617        ) -> fidl::Result<()> {
1618            decoder.debug_check_bounds::<Self>(offset);
1619            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1620            // Verify that padding bytes are zero.
1621            // Copy from the buffer into the object.
1622            unsafe {
1623                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1624            }
1625            Ok(())
1626        }
1627    }
1628
1629    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerStateRequest {
1630        type Borrowed<'a> = &'a Self;
1631        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1632            value
1633        }
1634    }
1635
1636    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerStateRequest {
1637        type Owned = Self;
1638
1639        #[inline(always)]
1640        fn inline_align(_context: fidl::encoding::Context) -> usize {
1641            2
1642        }
1643
1644        #[inline(always)]
1645        fn inline_size(_context: fidl::encoding::Context) -> usize {
1646            2
1647        }
1648        #[inline(always)]
1649        fn encode_is_copy() -> bool {
1650            true
1651        }
1652
1653        #[inline(always)]
1654        fn decode_is_copy() -> bool {
1655            true
1656        }
1657    }
1658
1659    unsafe impl<D: fidl::encoding::ResourceDialect>
1660        fidl::encoding::Encode<DeviceMonitorGetPowerStateRequest, D>
1661        for &DeviceMonitorGetPowerStateRequest
1662    {
1663        #[inline]
1664        unsafe fn encode(
1665            self,
1666            encoder: &mut fidl::encoding::Encoder<'_, D>,
1667            offset: usize,
1668            _depth: fidl::encoding::Depth,
1669        ) -> fidl::Result<()> {
1670            encoder.debug_check_bounds::<DeviceMonitorGetPowerStateRequest>(offset);
1671            unsafe {
1672                // Copy the object into the buffer.
1673                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1674                (buf_ptr as *mut DeviceMonitorGetPowerStateRequest)
1675                    .write_unaligned((self as *const DeviceMonitorGetPowerStateRequest).read());
1676                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1677                // done second because the memcpy will write garbage to these bytes.
1678            }
1679            Ok(())
1680        }
1681    }
1682    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1683        fidl::encoding::Encode<DeviceMonitorGetPowerStateRequest, D> for (T0,)
1684    {
1685        #[inline]
1686        unsafe fn encode(
1687            self,
1688            encoder: &mut fidl::encoding::Encoder<'_, D>,
1689            offset: usize,
1690            depth: fidl::encoding::Depth,
1691        ) -> fidl::Result<()> {
1692            encoder.debug_check_bounds::<DeviceMonitorGetPowerStateRequest>(offset);
1693            // Zero out padding regions. There's no need to apply masks
1694            // because the unmasked parts will be overwritten by fields.
1695            // Write the fields.
1696            self.0.encode(encoder, offset + 0, depth)?;
1697            Ok(())
1698        }
1699    }
1700
1701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1702        for DeviceMonitorGetPowerStateRequest
1703    {
1704        #[inline(always)]
1705        fn new_empty() -> Self {
1706            Self { phy_id: fidl::new_empty!(u16, D) }
1707        }
1708
1709        #[inline]
1710        unsafe fn decode(
1711            &mut self,
1712            decoder: &mut fidl::encoding::Decoder<'_, D>,
1713            offset: usize,
1714            _depth: fidl::encoding::Depth,
1715        ) -> fidl::Result<()> {
1716            decoder.debug_check_bounds::<Self>(offset);
1717            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1718            // Verify that padding bytes are zero.
1719            // Copy from the buffer into the object.
1720            unsafe {
1721                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1722            }
1723            Ok(())
1724        }
1725    }
1726
1727    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1728        type Borrowed<'a> = &'a Self;
1729        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1730            value
1731        }
1732    }
1733
1734    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1735        type Owned = Self;
1736
1737        #[inline(always)]
1738        fn inline_align(_context: fidl::encoding::Context) -> usize {
1739            2
1740        }
1741
1742        #[inline(always)]
1743        fn inline_size(_context: fidl::encoding::Context) -> usize {
1744            2
1745        }
1746        #[inline(always)]
1747        fn encode_is_copy() -> bool {
1748            true
1749        }
1750
1751        #[inline(always)]
1752        fn decode_is_copy() -> bool {
1753            true
1754        }
1755    }
1756
1757    unsafe impl<D: fidl::encoding::ResourceDialect>
1758        fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D>
1759        for &DeviceMonitorGetSupportedMacRolesRequest
1760    {
1761        #[inline]
1762        unsafe fn encode(
1763            self,
1764            encoder: &mut fidl::encoding::Encoder<'_, D>,
1765            offset: usize,
1766            _depth: fidl::encoding::Depth,
1767        ) -> fidl::Result<()> {
1768            encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1769            unsafe {
1770                // Copy the object into the buffer.
1771                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1772                (buf_ptr as *mut DeviceMonitorGetSupportedMacRolesRequest).write_unaligned(
1773                    (self as *const DeviceMonitorGetSupportedMacRolesRequest).read(),
1774                );
1775                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1776                // done second because the memcpy will write garbage to these bytes.
1777            }
1778            Ok(())
1779        }
1780    }
1781    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1782        fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D> for (T0,)
1783    {
1784        #[inline]
1785        unsafe fn encode(
1786            self,
1787            encoder: &mut fidl::encoding::Encoder<'_, D>,
1788            offset: usize,
1789            depth: fidl::encoding::Depth,
1790        ) -> fidl::Result<()> {
1791            encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1792            // Zero out padding regions. There's no need to apply masks
1793            // because the unmasked parts will be overwritten by fields.
1794            // Write the fields.
1795            self.0.encode(encoder, offset + 0, depth)?;
1796            Ok(())
1797        }
1798    }
1799
1800    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1801        for DeviceMonitorGetSupportedMacRolesRequest
1802    {
1803        #[inline(always)]
1804        fn new_empty() -> Self {
1805            Self { phy_id: fidl::new_empty!(u16, D) }
1806        }
1807
1808        #[inline]
1809        unsafe fn decode(
1810            &mut self,
1811            decoder: &mut fidl::encoding::Decoder<'_, D>,
1812            offset: usize,
1813            _depth: fidl::encoding::Depth,
1814        ) -> fidl::Result<()> {
1815            decoder.debug_check_bounds::<Self>(offset);
1816            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1817            // Verify that padding bytes are zero.
1818            // Copy from the buffer into the object.
1819            unsafe {
1820                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1821            }
1822            Ok(())
1823        }
1824    }
1825
1826    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetTxPowerScenarioRequest {
1827        type Borrowed<'a> = &'a Self;
1828        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1829            value
1830        }
1831    }
1832
1833    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetTxPowerScenarioRequest {
1834        type Owned = Self;
1835
1836        #[inline(always)]
1837        fn inline_align(_context: fidl::encoding::Context) -> usize {
1838            2
1839        }
1840
1841        #[inline(always)]
1842        fn inline_size(_context: fidl::encoding::Context) -> usize {
1843            2
1844        }
1845        #[inline(always)]
1846        fn encode_is_copy() -> bool {
1847            true
1848        }
1849
1850        #[inline(always)]
1851        fn decode_is_copy() -> bool {
1852            true
1853        }
1854    }
1855
1856    unsafe impl<D: fidl::encoding::ResourceDialect>
1857        fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioRequest, D>
1858        for &DeviceMonitorGetTxPowerScenarioRequest
1859    {
1860        #[inline]
1861        unsafe fn encode(
1862            self,
1863            encoder: &mut fidl::encoding::Encoder<'_, D>,
1864            offset: usize,
1865            _depth: fidl::encoding::Depth,
1866        ) -> fidl::Result<()> {
1867            encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioRequest>(offset);
1868            unsafe {
1869                // Copy the object into the buffer.
1870                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1871                (buf_ptr as *mut DeviceMonitorGetTxPowerScenarioRequest).write_unaligned(
1872                    (self as *const DeviceMonitorGetTxPowerScenarioRequest).read(),
1873                );
1874                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1875                // done second because the memcpy will write garbage to these bytes.
1876            }
1877            Ok(())
1878        }
1879    }
1880    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1881        fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioRequest, D> for (T0,)
1882    {
1883        #[inline]
1884        unsafe fn encode(
1885            self,
1886            encoder: &mut fidl::encoding::Encoder<'_, D>,
1887            offset: usize,
1888            depth: fidl::encoding::Depth,
1889        ) -> fidl::Result<()> {
1890            encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioRequest>(offset);
1891            // Zero out padding regions. There's no need to apply masks
1892            // because the unmasked parts will be overwritten by fields.
1893            // Write the fields.
1894            self.0.encode(encoder, offset + 0, depth)?;
1895            Ok(())
1896        }
1897    }
1898
1899    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1900        for DeviceMonitorGetTxPowerScenarioRequest
1901    {
1902        #[inline(always)]
1903        fn new_empty() -> Self {
1904            Self { phy_id: fidl::new_empty!(u16, D) }
1905        }
1906
1907        #[inline]
1908        unsafe fn decode(
1909            &mut self,
1910            decoder: &mut fidl::encoding::Decoder<'_, D>,
1911            offset: usize,
1912            _depth: fidl::encoding::Depth,
1913        ) -> fidl::Result<()> {
1914            decoder.debug_check_bounds::<Self>(offset);
1915            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1916            // Verify that padding bytes are zero.
1917            // Copy from the buffer into the object.
1918            unsafe {
1919                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1920            }
1921            Ok(())
1922        }
1923    }
1924
1925    impl fidl::encoding::ValueTypeMarker for DeviceMonitorListIfacesResponse {
1926        type Borrowed<'a> = &'a Self;
1927        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1928            value
1929        }
1930    }
1931
1932    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListIfacesResponse {
1933        type Owned = Self;
1934
1935        #[inline(always)]
1936        fn inline_align(_context: fidl::encoding::Context) -> usize {
1937            8
1938        }
1939
1940        #[inline(always)]
1941        fn inline_size(_context: fidl::encoding::Context) -> usize {
1942            16
1943        }
1944    }
1945
1946    unsafe impl<D: fidl::encoding::ResourceDialect>
1947        fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D>
1948        for &DeviceMonitorListIfacesResponse
1949    {
1950        #[inline]
1951        unsafe fn encode(
1952            self,
1953            encoder: &mut fidl::encoding::Encoder<'_, D>,
1954            offset: usize,
1955            _depth: fidl::encoding::Depth,
1956        ) -> fidl::Result<()> {
1957            encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1958            // Delegate to tuple encoding.
1959            fidl::encoding::Encode::<DeviceMonitorListIfacesResponse, D>::encode(
1960                (
1961                    <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_list),
1962                ),
1963                encoder, offset, _depth
1964            )
1965        }
1966    }
1967    unsafe impl<
1968        D: fidl::encoding::ResourceDialect,
1969        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
1970    > fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D> for (T0,)
1971    {
1972        #[inline]
1973        unsafe fn encode(
1974            self,
1975            encoder: &mut fidl::encoding::Encoder<'_, D>,
1976            offset: usize,
1977            depth: fidl::encoding::Depth,
1978        ) -> fidl::Result<()> {
1979            encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1980            // Zero out padding regions. There's no need to apply masks
1981            // because the unmasked parts will be overwritten by fields.
1982            // Write the fields.
1983            self.0.encode(encoder, offset + 0, depth)?;
1984            Ok(())
1985        }
1986    }
1987
1988    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1989        for DeviceMonitorListIfacesResponse
1990    {
1991        #[inline(always)]
1992        fn new_empty() -> Self {
1993            Self { iface_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
1994        }
1995
1996        #[inline]
1997        unsafe fn decode(
1998            &mut self,
1999            decoder: &mut fidl::encoding::Decoder<'_, D>,
2000            offset: usize,
2001            _depth: fidl::encoding::Depth,
2002        ) -> fidl::Result<()> {
2003            decoder.debug_check_bounds::<Self>(offset);
2004            // Verify that padding bytes are zero.
2005            fidl::decode!(
2006                fidl::encoding::UnboundedVector<u16>,
2007                D,
2008                &mut self.iface_list,
2009                decoder,
2010                offset + 0,
2011                _depth
2012            )?;
2013            Ok(())
2014        }
2015    }
2016
2017    impl fidl::encoding::ValueTypeMarker for DeviceMonitorListPhysResponse {
2018        type Borrowed<'a> = &'a Self;
2019        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2020            value
2021        }
2022    }
2023
2024    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListPhysResponse {
2025        type Owned = Self;
2026
2027        #[inline(always)]
2028        fn inline_align(_context: fidl::encoding::Context) -> usize {
2029            8
2030        }
2031
2032        #[inline(always)]
2033        fn inline_size(_context: fidl::encoding::Context) -> usize {
2034            16
2035        }
2036    }
2037
2038    unsafe impl<D: fidl::encoding::ResourceDialect>
2039        fidl::encoding::Encode<DeviceMonitorListPhysResponse, D>
2040        for &DeviceMonitorListPhysResponse
2041    {
2042        #[inline]
2043        unsafe fn encode(
2044            self,
2045            encoder: &mut fidl::encoding::Encoder<'_, D>,
2046            offset: usize,
2047            _depth: fidl::encoding::Depth,
2048        ) -> fidl::Result<()> {
2049            encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
2050            // Delegate to tuple encoding.
2051            fidl::encoding::Encode::<DeviceMonitorListPhysResponse, D>::encode(
2052                (
2053                    <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_list),
2054                ),
2055                encoder, offset, _depth
2056            )
2057        }
2058    }
2059    unsafe impl<
2060        D: fidl::encoding::ResourceDialect,
2061        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
2062    > fidl::encoding::Encode<DeviceMonitorListPhysResponse, D> for (T0,)
2063    {
2064        #[inline]
2065        unsafe fn encode(
2066            self,
2067            encoder: &mut fidl::encoding::Encoder<'_, D>,
2068            offset: usize,
2069            depth: fidl::encoding::Depth,
2070        ) -> fidl::Result<()> {
2071            encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
2072            // Zero out padding regions. There's no need to apply masks
2073            // because the unmasked parts will be overwritten by fields.
2074            // Write the fields.
2075            self.0.encode(encoder, offset + 0, depth)?;
2076            Ok(())
2077        }
2078    }
2079
2080    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2081        for DeviceMonitorListPhysResponse
2082    {
2083        #[inline(always)]
2084        fn new_empty() -> Self {
2085            Self { phy_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
2086        }
2087
2088        #[inline]
2089        unsafe fn decode(
2090            &mut self,
2091            decoder: &mut fidl::encoding::Decoder<'_, D>,
2092            offset: usize,
2093            _depth: fidl::encoding::Depth,
2094        ) -> fidl::Result<()> {
2095            decoder.debug_check_bounds::<Self>(offset);
2096            // Verify that padding bytes are zero.
2097            fidl::decode!(
2098                fidl::encoding::UnboundedVector<u16>,
2099                D,
2100                &mut self.phy_list,
2101                decoder,
2102                offset + 0,
2103                _depth
2104            )?;
2105            Ok(())
2106        }
2107    }
2108
2109    impl fidl::encoding::ValueTypeMarker for DeviceMonitorPowerDownRequest {
2110        type Borrowed<'a> = &'a Self;
2111        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2112            value
2113        }
2114    }
2115
2116    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorPowerDownRequest {
2117        type Owned = Self;
2118
2119        #[inline(always)]
2120        fn inline_align(_context: fidl::encoding::Context) -> usize {
2121            2
2122        }
2123
2124        #[inline(always)]
2125        fn inline_size(_context: fidl::encoding::Context) -> usize {
2126            2
2127        }
2128        #[inline(always)]
2129        fn encode_is_copy() -> bool {
2130            true
2131        }
2132
2133        #[inline(always)]
2134        fn decode_is_copy() -> bool {
2135            true
2136        }
2137    }
2138
2139    unsafe impl<D: fidl::encoding::ResourceDialect>
2140        fidl::encoding::Encode<DeviceMonitorPowerDownRequest, D>
2141        for &DeviceMonitorPowerDownRequest
2142    {
2143        #[inline]
2144        unsafe fn encode(
2145            self,
2146            encoder: &mut fidl::encoding::Encoder<'_, D>,
2147            offset: usize,
2148            _depth: fidl::encoding::Depth,
2149        ) -> fidl::Result<()> {
2150            encoder.debug_check_bounds::<DeviceMonitorPowerDownRequest>(offset);
2151            unsafe {
2152                // Copy the object into the buffer.
2153                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2154                (buf_ptr as *mut DeviceMonitorPowerDownRequest)
2155                    .write_unaligned((self as *const DeviceMonitorPowerDownRequest).read());
2156                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2157                // done second because the memcpy will write garbage to these bytes.
2158            }
2159            Ok(())
2160        }
2161    }
2162    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2163        fidl::encoding::Encode<DeviceMonitorPowerDownRequest, D> for (T0,)
2164    {
2165        #[inline]
2166        unsafe fn encode(
2167            self,
2168            encoder: &mut fidl::encoding::Encoder<'_, D>,
2169            offset: usize,
2170            depth: fidl::encoding::Depth,
2171        ) -> fidl::Result<()> {
2172            encoder.debug_check_bounds::<DeviceMonitorPowerDownRequest>(offset);
2173            // Zero out padding regions. There's no need to apply masks
2174            // because the unmasked parts will be overwritten by fields.
2175            // Write the fields.
2176            self.0.encode(encoder, offset + 0, depth)?;
2177            Ok(())
2178        }
2179    }
2180
2181    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2182        for DeviceMonitorPowerDownRequest
2183    {
2184        #[inline(always)]
2185        fn new_empty() -> Self {
2186            Self { phy_id: fidl::new_empty!(u16, D) }
2187        }
2188
2189        #[inline]
2190        unsafe fn decode(
2191            &mut self,
2192            decoder: &mut fidl::encoding::Decoder<'_, D>,
2193            offset: usize,
2194            _depth: fidl::encoding::Depth,
2195        ) -> fidl::Result<()> {
2196            decoder.debug_check_bounds::<Self>(offset);
2197            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2198            // Verify that padding bytes are zero.
2199            // Copy from the buffer into the object.
2200            unsafe {
2201                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2202            }
2203            Ok(())
2204        }
2205    }
2206
2207    impl fidl::encoding::ValueTypeMarker for DeviceMonitorPowerUpRequest {
2208        type Borrowed<'a> = &'a Self;
2209        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2210            value
2211        }
2212    }
2213
2214    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorPowerUpRequest {
2215        type Owned = Self;
2216
2217        #[inline(always)]
2218        fn inline_align(_context: fidl::encoding::Context) -> usize {
2219            2
2220        }
2221
2222        #[inline(always)]
2223        fn inline_size(_context: fidl::encoding::Context) -> usize {
2224            2
2225        }
2226        #[inline(always)]
2227        fn encode_is_copy() -> bool {
2228            true
2229        }
2230
2231        #[inline(always)]
2232        fn decode_is_copy() -> bool {
2233            true
2234        }
2235    }
2236
2237    unsafe impl<D: fidl::encoding::ResourceDialect>
2238        fidl::encoding::Encode<DeviceMonitorPowerUpRequest, D> for &DeviceMonitorPowerUpRequest
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::<DeviceMonitorPowerUpRequest>(offset);
2248            unsafe {
2249                // Copy the object into the buffer.
2250                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2251                (buf_ptr as *mut DeviceMonitorPowerUpRequest)
2252                    .write_unaligned((self as *const DeviceMonitorPowerUpRequest).read());
2253                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2254                // done second because the memcpy will write garbage to these bytes.
2255            }
2256            Ok(())
2257        }
2258    }
2259    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2260        fidl::encoding::Encode<DeviceMonitorPowerUpRequest, D> for (T0,)
2261    {
2262        #[inline]
2263        unsafe fn encode(
2264            self,
2265            encoder: &mut fidl::encoding::Encoder<'_, D>,
2266            offset: usize,
2267            depth: fidl::encoding::Depth,
2268        ) -> fidl::Result<()> {
2269            encoder.debug_check_bounds::<DeviceMonitorPowerUpRequest>(offset);
2270            // Zero out padding regions. There's no need to apply masks
2271            // because the unmasked parts will be overwritten by fields.
2272            // Write the fields.
2273            self.0.encode(encoder, offset + 0, depth)?;
2274            Ok(())
2275        }
2276    }
2277
2278    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2279        for DeviceMonitorPowerUpRequest
2280    {
2281        #[inline(always)]
2282        fn new_empty() -> Self {
2283            Self { phy_id: fidl::new_empty!(u16, D) }
2284        }
2285
2286        #[inline]
2287        unsafe fn decode(
2288            &mut self,
2289            decoder: &mut fidl::encoding::Decoder<'_, D>,
2290            offset: usize,
2291            _depth: fidl::encoding::Depth,
2292        ) -> fidl::Result<()> {
2293            decoder.debug_check_bounds::<Self>(offset);
2294            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2295            // Verify that padding bytes are zero.
2296            // Copy from the buffer into the object.
2297            unsafe {
2298                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2299            }
2300            Ok(())
2301        }
2302    }
2303
2304    impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceRequest {
2305        type Borrowed<'a> = &'a Self;
2306        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2307            value
2308        }
2309    }
2310
2311    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceRequest {
2312        type Owned = Self;
2313
2314        #[inline(always)]
2315        fn inline_align(_context: fidl::encoding::Context) -> usize {
2316            2
2317        }
2318
2319        #[inline(always)]
2320        fn inline_size(_context: fidl::encoding::Context) -> usize {
2321            2
2322        }
2323        #[inline(always)]
2324        fn encode_is_copy() -> bool {
2325            true
2326        }
2327
2328        #[inline(always)]
2329        fn decode_is_copy() -> bool {
2330            true
2331        }
2332    }
2333
2334    unsafe impl<D: fidl::encoding::ResourceDialect>
2335        fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D>
2336        for &DeviceMonitorQueryIfaceRequest
2337    {
2338        #[inline]
2339        unsafe fn encode(
2340            self,
2341            encoder: &mut fidl::encoding::Encoder<'_, D>,
2342            offset: usize,
2343            _depth: fidl::encoding::Depth,
2344        ) -> fidl::Result<()> {
2345            encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
2346            unsafe {
2347                // Copy the object into the buffer.
2348                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2349                (buf_ptr as *mut DeviceMonitorQueryIfaceRequest)
2350                    .write_unaligned((self as *const DeviceMonitorQueryIfaceRequest).read());
2351                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2352                // done second because the memcpy will write garbage to these bytes.
2353            }
2354            Ok(())
2355        }
2356    }
2357    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2358        fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D> for (T0,)
2359    {
2360        #[inline]
2361        unsafe fn encode(
2362            self,
2363            encoder: &mut fidl::encoding::Encoder<'_, D>,
2364            offset: usize,
2365            depth: fidl::encoding::Depth,
2366        ) -> fidl::Result<()> {
2367            encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
2368            // Zero out padding regions. There's no need to apply masks
2369            // because the unmasked parts will be overwritten by fields.
2370            // Write the fields.
2371            self.0.encode(encoder, offset + 0, depth)?;
2372            Ok(())
2373        }
2374    }
2375
2376    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2377        for DeviceMonitorQueryIfaceRequest
2378    {
2379        #[inline(always)]
2380        fn new_empty() -> Self {
2381            Self { iface_id: fidl::new_empty!(u16, D) }
2382        }
2383
2384        #[inline]
2385        unsafe fn decode(
2386            &mut self,
2387            decoder: &mut fidl::encoding::Decoder<'_, D>,
2388            offset: usize,
2389            _depth: fidl::encoding::Depth,
2390        ) -> fidl::Result<()> {
2391            decoder.debug_check_bounds::<Self>(offset);
2392            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2393            // Verify that padding bytes are zero.
2394            // Copy from the buffer into the object.
2395            unsafe {
2396                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2397            }
2398            Ok(())
2399        }
2400    }
2401
2402    impl fidl::encoding::ValueTypeMarker for DeviceMonitorResetRequest {
2403        type Borrowed<'a> = &'a Self;
2404        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2405            value
2406        }
2407    }
2408
2409    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorResetRequest {
2410        type Owned = Self;
2411
2412        #[inline(always)]
2413        fn inline_align(_context: fidl::encoding::Context) -> usize {
2414            2
2415        }
2416
2417        #[inline(always)]
2418        fn inline_size(_context: fidl::encoding::Context) -> usize {
2419            2
2420        }
2421        #[inline(always)]
2422        fn encode_is_copy() -> bool {
2423            true
2424        }
2425
2426        #[inline(always)]
2427        fn decode_is_copy() -> bool {
2428            true
2429        }
2430    }
2431
2432    unsafe impl<D: fidl::encoding::ResourceDialect>
2433        fidl::encoding::Encode<DeviceMonitorResetRequest, D> for &DeviceMonitorResetRequest
2434    {
2435        #[inline]
2436        unsafe fn encode(
2437            self,
2438            encoder: &mut fidl::encoding::Encoder<'_, D>,
2439            offset: usize,
2440            _depth: fidl::encoding::Depth,
2441        ) -> fidl::Result<()> {
2442            encoder.debug_check_bounds::<DeviceMonitorResetRequest>(offset);
2443            unsafe {
2444                // Copy the object into the buffer.
2445                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2446                (buf_ptr as *mut DeviceMonitorResetRequest)
2447                    .write_unaligned((self as *const DeviceMonitorResetRequest).read());
2448                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2449                // done second because the memcpy will write garbage to these bytes.
2450            }
2451            Ok(())
2452        }
2453    }
2454    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2455        fidl::encoding::Encode<DeviceMonitorResetRequest, D> for (T0,)
2456    {
2457        #[inline]
2458        unsafe fn encode(
2459            self,
2460            encoder: &mut fidl::encoding::Encoder<'_, D>,
2461            offset: usize,
2462            depth: fidl::encoding::Depth,
2463        ) -> fidl::Result<()> {
2464            encoder.debug_check_bounds::<DeviceMonitorResetRequest>(offset);
2465            // Zero out padding regions. There's no need to apply masks
2466            // because the unmasked parts will be overwritten by fields.
2467            // Write the fields.
2468            self.0.encode(encoder, offset + 0, depth)?;
2469            Ok(())
2470        }
2471    }
2472
2473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2474        for DeviceMonitorResetRequest
2475    {
2476        #[inline(always)]
2477        fn new_empty() -> Self {
2478            Self { phy_id: fidl::new_empty!(u16, D) }
2479        }
2480
2481        #[inline]
2482        unsafe fn decode(
2483            &mut self,
2484            decoder: &mut fidl::encoding::Decoder<'_, D>,
2485            offset: usize,
2486            _depth: fidl::encoding::Depth,
2487        ) -> fidl::Result<()> {
2488            decoder.debug_check_bounds::<Self>(offset);
2489            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2490            // Verify that padding bytes are zero.
2491            // Copy from the buffer into the object.
2492            unsafe {
2493                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2494            }
2495            Ok(())
2496        }
2497    }
2498
2499    impl fidl::encoding::ValueTypeMarker for DeviceMonitorResetTxPowerScenarioRequest {
2500        type Borrowed<'a> = &'a Self;
2501        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2502            value
2503        }
2504    }
2505
2506    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorResetTxPowerScenarioRequest {
2507        type Owned = Self;
2508
2509        #[inline(always)]
2510        fn inline_align(_context: fidl::encoding::Context) -> usize {
2511            2
2512        }
2513
2514        #[inline(always)]
2515        fn inline_size(_context: fidl::encoding::Context) -> usize {
2516            2
2517        }
2518        #[inline(always)]
2519        fn encode_is_copy() -> bool {
2520            true
2521        }
2522
2523        #[inline(always)]
2524        fn decode_is_copy() -> bool {
2525            true
2526        }
2527    }
2528
2529    unsafe impl<D: fidl::encoding::ResourceDialect>
2530        fidl::encoding::Encode<DeviceMonitorResetTxPowerScenarioRequest, D>
2531        for &DeviceMonitorResetTxPowerScenarioRequest
2532    {
2533        #[inline]
2534        unsafe fn encode(
2535            self,
2536            encoder: &mut fidl::encoding::Encoder<'_, D>,
2537            offset: usize,
2538            _depth: fidl::encoding::Depth,
2539        ) -> fidl::Result<()> {
2540            encoder.debug_check_bounds::<DeviceMonitorResetTxPowerScenarioRequest>(offset);
2541            unsafe {
2542                // Copy the object into the buffer.
2543                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2544                (buf_ptr as *mut DeviceMonitorResetTxPowerScenarioRequest).write_unaligned(
2545                    (self as *const DeviceMonitorResetTxPowerScenarioRequest).read(),
2546                );
2547                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2548                // done second because the memcpy will write garbage to these bytes.
2549            }
2550            Ok(())
2551        }
2552    }
2553    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2554        fidl::encoding::Encode<DeviceMonitorResetTxPowerScenarioRequest, D> for (T0,)
2555    {
2556        #[inline]
2557        unsafe fn encode(
2558            self,
2559            encoder: &mut fidl::encoding::Encoder<'_, D>,
2560            offset: usize,
2561            depth: fidl::encoding::Depth,
2562        ) -> fidl::Result<()> {
2563            encoder.debug_check_bounds::<DeviceMonitorResetTxPowerScenarioRequest>(offset);
2564            // Zero out padding regions. There's no need to apply masks
2565            // because the unmasked parts will be overwritten by fields.
2566            // Write the fields.
2567            self.0.encode(encoder, offset + 0, depth)?;
2568            Ok(())
2569        }
2570    }
2571
2572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2573        for DeviceMonitorResetTxPowerScenarioRequest
2574    {
2575        #[inline(always)]
2576        fn new_empty() -> Self {
2577            Self { phy_id: fidl::new_empty!(u16, D) }
2578        }
2579
2580        #[inline]
2581        unsafe fn decode(
2582            &mut self,
2583            decoder: &mut fidl::encoding::Decoder<'_, D>,
2584            offset: usize,
2585            _depth: fidl::encoding::Depth,
2586        ) -> fidl::Result<()> {
2587            decoder.debug_check_bounds::<Self>(offset);
2588            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2589            // Verify that padding bytes are zero.
2590            // Copy from the buffer into the object.
2591            unsafe {
2592                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2593            }
2594            Ok(())
2595        }
2596    }
2597
2598    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetBtCoexistenceModeRequest {
2599        type Borrowed<'a> = &'a Self;
2600        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2601            value
2602        }
2603    }
2604
2605    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetBtCoexistenceModeRequest {
2606        type Owned = Self;
2607
2608        #[inline(always)]
2609        fn inline_align(_context: fidl::encoding::Context) -> usize {
2610            4
2611        }
2612
2613        #[inline(always)]
2614        fn inline_size(_context: fidl::encoding::Context) -> usize {
2615            8
2616        }
2617    }
2618
2619    unsafe impl<D: fidl::encoding::ResourceDialect>
2620        fidl::encoding::Encode<DeviceMonitorSetBtCoexistenceModeRequest, D>
2621        for &DeviceMonitorSetBtCoexistenceModeRequest
2622    {
2623        #[inline]
2624        unsafe fn encode(
2625            self,
2626            encoder: &mut fidl::encoding::Encoder<'_, D>,
2627            offset: usize,
2628            _depth: fidl::encoding::Depth,
2629        ) -> fidl::Result<()> {
2630            encoder.debug_check_bounds::<DeviceMonitorSetBtCoexistenceModeRequest>(offset);
2631            // Delegate to tuple encoding.
2632            fidl::encoding::Encode::<DeviceMonitorSetBtCoexistenceModeRequest, D>::encode(
2633                (
2634                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
2635                    <fidl_fuchsia_wlan_internal__common::BtCoexistenceMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2636                ),
2637                encoder, offset, _depth
2638            )
2639        }
2640    }
2641    unsafe impl<
2642        D: fidl::encoding::ResourceDialect,
2643        T0: fidl::encoding::Encode<u16, D>,
2644        T1: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D>,
2645    > fidl::encoding::Encode<DeviceMonitorSetBtCoexistenceModeRequest, D> for (T0, T1)
2646    {
2647        #[inline]
2648        unsafe fn encode(
2649            self,
2650            encoder: &mut fidl::encoding::Encoder<'_, D>,
2651            offset: usize,
2652            depth: fidl::encoding::Depth,
2653        ) -> fidl::Result<()> {
2654            encoder.debug_check_bounds::<DeviceMonitorSetBtCoexistenceModeRequest>(offset);
2655            // Zero out padding regions. There's no need to apply masks
2656            // because the unmasked parts will be overwritten by fields.
2657            unsafe {
2658                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2659                (ptr as *mut u32).write_unaligned(0);
2660            }
2661            // Write the fields.
2662            self.0.encode(encoder, offset + 0, depth)?;
2663            self.1.encode(encoder, offset + 4, depth)?;
2664            Ok(())
2665        }
2666    }
2667
2668    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2669        for DeviceMonitorSetBtCoexistenceModeRequest
2670    {
2671        #[inline(always)]
2672        fn new_empty() -> Self {
2673            Self {
2674                phy_id: fidl::new_empty!(u16, D),
2675                mode: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D),
2676            }
2677        }
2678
2679        #[inline]
2680        unsafe fn decode(
2681            &mut self,
2682            decoder: &mut fidl::encoding::Decoder<'_, D>,
2683            offset: usize,
2684            _depth: fidl::encoding::Depth,
2685        ) -> fidl::Result<()> {
2686            decoder.debug_check_bounds::<Self>(offset);
2687            // Verify that padding bytes are zero.
2688            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2689            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2690            let mask = 0xffff0000u32;
2691            let maskedval = padval & mask;
2692            if maskedval != 0 {
2693                return Err(fidl::Error::NonZeroPadding {
2694                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2695                });
2696            }
2697            fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
2698            fidl::decode!(
2699                fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
2700                D,
2701                &mut self.mode,
2702                decoder,
2703                offset + 4,
2704                _depth
2705            )?;
2706            Ok(())
2707        }
2708    }
2709
2710    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryRequest {
2711        type Borrowed<'a> = &'a Self;
2712        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2713            value
2714        }
2715    }
2716
2717    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryRequest {
2718        type Owned = Self;
2719
2720        #[inline(always)]
2721        fn inline_align(_context: fidl::encoding::Context) -> usize {
2722            2
2723        }
2724
2725        #[inline(always)]
2726        fn inline_size(_context: fidl::encoding::Context) -> usize {
2727            4
2728        }
2729        #[inline(always)]
2730        fn encode_is_copy() -> bool {
2731            true
2732        }
2733
2734        #[inline(always)]
2735        fn decode_is_copy() -> bool {
2736            true
2737        }
2738    }
2739
2740    unsafe impl<D: fidl::encoding::ResourceDialect>
2741        fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D>
2742        for &DeviceMonitorSetCountryRequest
2743    {
2744        #[inline]
2745        unsafe fn encode(
2746            self,
2747            encoder: &mut fidl::encoding::Encoder<'_, D>,
2748            offset: usize,
2749            _depth: fidl::encoding::Depth,
2750        ) -> fidl::Result<()> {
2751            encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
2752            unsafe {
2753                // Copy the object into the buffer.
2754                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2755                (buf_ptr as *mut DeviceMonitorSetCountryRequest)
2756                    .write_unaligned((self as *const DeviceMonitorSetCountryRequest).read());
2757                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2758                // done second because the memcpy will write garbage to these bytes.
2759            }
2760            Ok(())
2761        }
2762    }
2763    unsafe impl<
2764        D: fidl::encoding::ResourceDialect,
2765        T0: fidl::encoding::Encode<SetCountryRequest, D>,
2766    > fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D> for (T0,)
2767    {
2768        #[inline]
2769        unsafe fn encode(
2770            self,
2771            encoder: &mut fidl::encoding::Encoder<'_, D>,
2772            offset: usize,
2773            depth: fidl::encoding::Depth,
2774        ) -> fidl::Result<()> {
2775            encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
2776            // Zero out padding regions. There's no need to apply masks
2777            // because the unmasked parts will be overwritten by fields.
2778            // Write the fields.
2779            self.0.encode(encoder, offset + 0, depth)?;
2780            Ok(())
2781        }
2782    }
2783
2784    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2785        for DeviceMonitorSetCountryRequest
2786    {
2787        #[inline(always)]
2788        fn new_empty() -> Self {
2789            Self { req: fidl::new_empty!(SetCountryRequest, D) }
2790        }
2791
2792        #[inline]
2793        unsafe fn decode(
2794            &mut self,
2795            decoder: &mut fidl::encoding::Decoder<'_, D>,
2796            offset: usize,
2797            _depth: fidl::encoding::Depth,
2798        ) -> fidl::Result<()> {
2799            decoder.debug_check_bounds::<Self>(offset);
2800            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2801            // Verify that padding bytes are zero.
2802            // Copy from the buffer into the object.
2803            unsafe {
2804                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2805            }
2806            Ok(())
2807        }
2808    }
2809
2810    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryResponse {
2811        type Borrowed<'a> = &'a Self;
2812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2813            value
2814        }
2815    }
2816
2817    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryResponse {
2818        type Owned = Self;
2819
2820        #[inline(always)]
2821        fn inline_align(_context: fidl::encoding::Context) -> usize {
2822            4
2823        }
2824
2825        #[inline(always)]
2826        fn inline_size(_context: fidl::encoding::Context) -> usize {
2827            4
2828        }
2829        #[inline(always)]
2830        fn encode_is_copy() -> bool {
2831            true
2832        }
2833
2834        #[inline(always)]
2835        fn decode_is_copy() -> bool {
2836            true
2837        }
2838    }
2839
2840    unsafe impl<D: fidl::encoding::ResourceDialect>
2841        fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D>
2842        for &DeviceMonitorSetCountryResponse
2843    {
2844        #[inline]
2845        unsafe fn encode(
2846            self,
2847            encoder: &mut fidl::encoding::Encoder<'_, D>,
2848            offset: usize,
2849            _depth: fidl::encoding::Depth,
2850        ) -> fidl::Result<()> {
2851            encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
2852            unsafe {
2853                // Copy the object into the buffer.
2854                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2855                (buf_ptr as *mut DeviceMonitorSetCountryResponse)
2856                    .write_unaligned((self as *const DeviceMonitorSetCountryResponse).read());
2857                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2858                // done second because the memcpy will write garbage to these bytes.
2859            }
2860            Ok(())
2861        }
2862    }
2863    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2864        fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D> for (T0,)
2865    {
2866        #[inline]
2867        unsafe fn encode(
2868            self,
2869            encoder: &mut fidl::encoding::Encoder<'_, D>,
2870            offset: usize,
2871            depth: fidl::encoding::Depth,
2872        ) -> fidl::Result<()> {
2873            encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
2874            // Zero out padding regions. There's no need to apply masks
2875            // because the unmasked parts will be overwritten by fields.
2876            // Write the fields.
2877            self.0.encode(encoder, offset + 0, depth)?;
2878            Ok(())
2879        }
2880    }
2881
2882    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2883        for DeviceMonitorSetCountryResponse
2884    {
2885        #[inline(always)]
2886        fn new_empty() -> Self {
2887            Self { status: fidl::new_empty!(i32, D) }
2888        }
2889
2890        #[inline]
2891        unsafe fn decode(
2892            &mut self,
2893            decoder: &mut fidl::encoding::Decoder<'_, D>,
2894            offset: usize,
2895            _depth: fidl::encoding::Depth,
2896        ) -> fidl::Result<()> {
2897            decoder.debug_check_bounds::<Self>(offset);
2898            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2899            // Verify that padding bytes are zero.
2900            // Copy from the buffer into the object.
2901            unsafe {
2902                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2903            }
2904            Ok(())
2905        }
2906    }
2907
2908    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeRequest {
2909        type Borrowed<'a> = &'a Self;
2910        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2911            value
2912        }
2913    }
2914
2915    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeRequest {
2916        type Owned = Self;
2917
2918        #[inline(always)]
2919        fn inline_align(_context: fidl::encoding::Context) -> usize {
2920            4
2921        }
2922
2923        #[inline(always)]
2924        fn inline_size(_context: fidl::encoding::Context) -> usize {
2925            8
2926        }
2927    }
2928
2929    unsafe impl<D: fidl::encoding::ResourceDialect>
2930        fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D>
2931        for &DeviceMonitorSetPowerSaveModeRequest
2932    {
2933        #[inline]
2934        unsafe fn encode(
2935            self,
2936            encoder: &mut fidl::encoding::Encoder<'_, D>,
2937            offset: usize,
2938            _depth: fidl::encoding::Depth,
2939        ) -> fidl::Result<()> {
2940            encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2941            // Delegate to tuple encoding.
2942            fidl::encoding::Encode::<DeviceMonitorSetPowerSaveModeRequest, D>::encode(
2943                (<SetPowerSaveModeRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
2944                encoder,
2945                offset,
2946                _depth,
2947            )
2948        }
2949    }
2950    unsafe impl<
2951        D: fidl::encoding::ResourceDialect,
2952        T0: fidl::encoding::Encode<SetPowerSaveModeRequest, D>,
2953    > fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D> for (T0,)
2954    {
2955        #[inline]
2956        unsafe fn encode(
2957            self,
2958            encoder: &mut fidl::encoding::Encoder<'_, D>,
2959            offset: usize,
2960            depth: fidl::encoding::Depth,
2961        ) -> fidl::Result<()> {
2962            encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2963            // Zero out padding regions. There's no need to apply masks
2964            // because the unmasked parts will be overwritten by fields.
2965            // Write the fields.
2966            self.0.encode(encoder, offset + 0, depth)?;
2967            Ok(())
2968        }
2969    }
2970
2971    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2972        for DeviceMonitorSetPowerSaveModeRequest
2973    {
2974        #[inline(always)]
2975        fn new_empty() -> Self {
2976            Self { req: fidl::new_empty!(SetPowerSaveModeRequest, D) }
2977        }
2978
2979        #[inline]
2980        unsafe fn decode(
2981            &mut self,
2982            decoder: &mut fidl::encoding::Decoder<'_, D>,
2983            offset: usize,
2984            _depth: fidl::encoding::Depth,
2985        ) -> fidl::Result<()> {
2986            decoder.debug_check_bounds::<Self>(offset);
2987            // Verify that padding bytes are zero.
2988            fidl::decode!(SetPowerSaveModeRequest, D, &mut self.req, decoder, offset + 0, _depth)?;
2989            Ok(())
2990        }
2991    }
2992
2993    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeResponse {
2994        type Borrowed<'a> = &'a Self;
2995        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2996            value
2997        }
2998    }
2999
3000    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeResponse {
3001        type Owned = Self;
3002
3003        #[inline(always)]
3004        fn inline_align(_context: fidl::encoding::Context) -> usize {
3005            4
3006        }
3007
3008        #[inline(always)]
3009        fn inline_size(_context: fidl::encoding::Context) -> usize {
3010            4
3011        }
3012        #[inline(always)]
3013        fn encode_is_copy() -> bool {
3014            true
3015        }
3016
3017        #[inline(always)]
3018        fn decode_is_copy() -> bool {
3019            true
3020        }
3021    }
3022
3023    unsafe impl<D: fidl::encoding::ResourceDialect>
3024        fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D>
3025        for &DeviceMonitorSetPowerSaveModeResponse
3026    {
3027        #[inline]
3028        unsafe fn encode(
3029            self,
3030            encoder: &mut fidl::encoding::Encoder<'_, D>,
3031            offset: usize,
3032            _depth: fidl::encoding::Depth,
3033        ) -> fidl::Result<()> {
3034            encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
3035            unsafe {
3036                // Copy the object into the buffer.
3037                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3038                (buf_ptr as *mut DeviceMonitorSetPowerSaveModeResponse)
3039                    .write_unaligned((self as *const DeviceMonitorSetPowerSaveModeResponse).read());
3040                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3041                // done second because the memcpy will write garbage to these bytes.
3042            }
3043            Ok(())
3044        }
3045    }
3046    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3047        fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D> for (T0,)
3048    {
3049        #[inline]
3050        unsafe fn encode(
3051            self,
3052            encoder: &mut fidl::encoding::Encoder<'_, D>,
3053            offset: usize,
3054            depth: fidl::encoding::Depth,
3055        ) -> fidl::Result<()> {
3056            encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
3057            // Zero out padding regions. There's no need to apply masks
3058            // because the unmasked parts will be overwritten by fields.
3059            // Write the fields.
3060            self.0.encode(encoder, offset + 0, depth)?;
3061            Ok(())
3062        }
3063    }
3064
3065    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3066        for DeviceMonitorSetPowerSaveModeResponse
3067    {
3068        #[inline(always)]
3069        fn new_empty() -> Self {
3070            Self { status: fidl::new_empty!(i32, D) }
3071        }
3072
3073        #[inline]
3074        unsafe fn decode(
3075            &mut self,
3076            decoder: &mut fidl::encoding::Decoder<'_, D>,
3077            offset: usize,
3078            _depth: fidl::encoding::Depth,
3079        ) -> fidl::Result<()> {
3080            decoder.debug_check_bounds::<Self>(offset);
3081            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3082            // Verify that padding bytes are zero.
3083            // Copy from the buffer into the object.
3084            unsafe {
3085                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3086            }
3087            Ok(())
3088        }
3089    }
3090
3091    impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetTxPowerScenarioRequest {
3092        type Borrowed<'a> = &'a Self;
3093        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3094            value
3095        }
3096    }
3097
3098    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetTxPowerScenarioRequest {
3099        type Owned = Self;
3100
3101        #[inline(always)]
3102        fn inline_align(_context: fidl::encoding::Context) -> usize {
3103            4
3104        }
3105
3106        #[inline(always)]
3107        fn inline_size(_context: fidl::encoding::Context) -> usize {
3108            8
3109        }
3110    }
3111
3112    unsafe impl<D: fidl::encoding::ResourceDialect>
3113        fidl::encoding::Encode<DeviceMonitorSetTxPowerScenarioRequest, D>
3114        for &DeviceMonitorSetTxPowerScenarioRequest
3115    {
3116        #[inline]
3117        unsafe fn encode(
3118            self,
3119            encoder: &mut fidl::encoding::Encoder<'_, D>,
3120            offset: usize,
3121            _depth: fidl::encoding::Depth,
3122        ) -> fidl::Result<()> {
3123            encoder.debug_check_bounds::<DeviceMonitorSetTxPowerScenarioRequest>(offset);
3124            // Delegate to tuple encoding.
3125            fidl::encoding::Encode::<DeviceMonitorSetTxPowerScenarioRequest, D>::encode(
3126                (
3127                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
3128                    <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
3129                ),
3130                encoder, offset, _depth
3131            )
3132        }
3133    }
3134    unsafe impl<
3135        D: fidl::encoding::ResourceDialect,
3136        T0: fidl::encoding::Encode<u16, D>,
3137        T1: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
3138    > fidl::encoding::Encode<DeviceMonitorSetTxPowerScenarioRequest, D> for (T0, T1)
3139    {
3140        #[inline]
3141        unsafe fn encode(
3142            self,
3143            encoder: &mut fidl::encoding::Encoder<'_, D>,
3144            offset: usize,
3145            depth: fidl::encoding::Depth,
3146        ) -> fidl::Result<()> {
3147            encoder.debug_check_bounds::<DeviceMonitorSetTxPowerScenarioRequest>(offset);
3148            // Zero out padding regions. There's no need to apply masks
3149            // because the unmasked parts will be overwritten by fields.
3150            unsafe {
3151                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3152                (ptr as *mut u32).write_unaligned(0);
3153            }
3154            // Write the fields.
3155            self.0.encode(encoder, offset + 0, depth)?;
3156            self.1.encode(encoder, offset + 4, depth)?;
3157            Ok(())
3158        }
3159    }
3160
3161    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3162        for DeviceMonitorSetTxPowerScenarioRequest
3163    {
3164        #[inline(always)]
3165        fn new_empty() -> Self {
3166            Self {
3167                phy_id: fidl::new_empty!(u16, D),
3168                scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
3169            }
3170        }
3171
3172        #[inline]
3173        unsafe fn decode(
3174            &mut self,
3175            decoder: &mut fidl::encoding::Decoder<'_, D>,
3176            offset: usize,
3177            _depth: fidl::encoding::Depth,
3178        ) -> fidl::Result<()> {
3179            decoder.debug_check_bounds::<Self>(offset);
3180            // Verify that padding bytes are zero.
3181            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3182            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3183            let mask = 0xffff0000u32;
3184            let maskedval = padval & mask;
3185            if maskedval != 0 {
3186                return Err(fidl::Error::NonZeroPadding {
3187                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3188                });
3189            }
3190            fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
3191            fidl::decode!(
3192                fidl_fuchsia_wlan_internal__common::TxPowerScenario,
3193                D,
3194                &mut self.scenario,
3195                decoder,
3196                offset + 4,
3197                _depth
3198            )?;
3199            Ok(())
3200        }
3201    }
3202
3203    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryResponse {
3204        type Borrowed<'a> = &'a Self;
3205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3206            value
3207        }
3208    }
3209
3210    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryResponse {
3211        type Owned = Self;
3212
3213        #[inline(always)]
3214        fn inline_align(_context: fidl::encoding::Context) -> usize {
3215            1
3216        }
3217
3218        #[inline(always)]
3219        fn inline_size(_context: fidl::encoding::Context) -> usize {
3220            2
3221        }
3222        #[inline(always)]
3223        fn encode_is_copy() -> bool {
3224            true
3225        }
3226
3227        #[inline(always)]
3228        fn decode_is_copy() -> bool {
3229            true
3230        }
3231    }
3232
3233    unsafe impl<D: fidl::encoding::ResourceDialect>
3234        fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D>
3235        for &DeviceMonitorGetCountryResponse
3236    {
3237        #[inline]
3238        unsafe fn encode(
3239            self,
3240            encoder: &mut fidl::encoding::Encoder<'_, D>,
3241            offset: usize,
3242            _depth: fidl::encoding::Depth,
3243        ) -> fidl::Result<()> {
3244            encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
3245            unsafe {
3246                // Copy the object into the buffer.
3247                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3248                (buf_ptr as *mut DeviceMonitorGetCountryResponse)
3249                    .write_unaligned((self as *const DeviceMonitorGetCountryResponse).read());
3250                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3251                // done second because the memcpy will write garbage to these bytes.
3252            }
3253            Ok(())
3254        }
3255    }
3256    unsafe impl<
3257        D: fidl::encoding::ResourceDialect,
3258        T0: fidl::encoding::Encode<GetCountryResponse, D>,
3259    > fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D> for (T0,)
3260    {
3261        #[inline]
3262        unsafe fn encode(
3263            self,
3264            encoder: &mut fidl::encoding::Encoder<'_, D>,
3265            offset: usize,
3266            depth: fidl::encoding::Depth,
3267        ) -> fidl::Result<()> {
3268            encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
3269            // Zero out padding regions. There's no need to apply masks
3270            // because the unmasked parts will be overwritten by fields.
3271            // Write the fields.
3272            self.0.encode(encoder, offset + 0, depth)?;
3273            Ok(())
3274        }
3275    }
3276
3277    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3278        for DeviceMonitorGetCountryResponse
3279    {
3280        #[inline(always)]
3281        fn new_empty() -> Self {
3282            Self { resp: fidl::new_empty!(GetCountryResponse, D) }
3283        }
3284
3285        #[inline]
3286        unsafe fn decode(
3287            &mut self,
3288            decoder: &mut fidl::encoding::Decoder<'_, D>,
3289            offset: usize,
3290            _depth: fidl::encoding::Depth,
3291        ) -> fidl::Result<()> {
3292            decoder.debug_check_bounds::<Self>(offset);
3293            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3294            // Verify that padding bytes are zero.
3295            // Copy from the buffer into the object.
3296            unsafe {
3297                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3298            }
3299            Ok(())
3300        }
3301    }
3302
3303    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeResponse {
3304        type Borrowed<'a> = &'a Self;
3305        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3306            value
3307        }
3308    }
3309
3310    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeResponse {
3311        type Owned = Self;
3312
3313        #[inline(always)]
3314        fn inline_align(_context: fidl::encoding::Context) -> usize {
3315            4
3316        }
3317
3318        #[inline(always)]
3319        fn inline_size(_context: fidl::encoding::Context) -> usize {
3320            4
3321        }
3322    }
3323
3324    unsafe impl<D: fidl::encoding::ResourceDialect>
3325        fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D>
3326        for &DeviceMonitorGetPowerSaveModeResponse
3327    {
3328        #[inline]
3329        unsafe fn encode(
3330            self,
3331            encoder: &mut fidl::encoding::Encoder<'_, D>,
3332            offset: usize,
3333            _depth: fidl::encoding::Depth,
3334        ) -> fidl::Result<()> {
3335            encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
3336            // Delegate to tuple encoding.
3337            fidl::encoding::Encode::<DeviceMonitorGetPowerSaveModeResponse, D>::encode(
3338                (<GetPowerSaveModeResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
3339                encoder,
3340                offset,
3341                _depth,
3342            )
3343        }
3344    }
3345    unsafe impl<
3346        D: fidl::encoding::ResourceDialect,
3347        T0: fidl::encoding::Encode<GetPowerSaveModeResponse, D>,
3348    > fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D> for (T0,)
3349    {
3350        #[inline]
3351        unsafe fn encode(
3352            self,
3353            encoder: &mut fidl::encoding::Encoder<'_, D>,
3354            offset: usize,
3355            depth: fidl::encoding::Depth,
3356        ) -> fidl::Result<()> {
3357            encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
3358            // Zero out padding regions. There's no need to apply masks
3359            // because the unmasked parts will be overwritten by fields.
3360            // Write the fields.
3361            self.0.encode(encoder, offset + 0, depth)?;
3362            Ok(())
3363        }
3364    }
3365
3366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3367        for DeviceMonitorGetPowerSaveModeResponse
3368    {
3369        #[inline(always)]
3370        fn new_empty() -> Self {
3371            Self { resp: fidl::new_empty!(GetPowerSaveModeResponse, D) }
3372        }
3373
3374        #[inline]
3375        unsafe fn decode(
3376            &mut self,
3377            decoder: &mut fidl::encoding::Decoder<'_, D>,
3378            offset: usize,
3379            _depth: fidl::encoding::Depth,
3380        ) -> fidl::Result<()> {
3381            decoder.debug_check_bounds::<Self>(offset);
3382            // Verify that padding bytes are zero.
3383            fidl::decode!(
3384                GetPowerSaveModeResponse,
3385                D,
3386                &mut self.resp,
3387                decoder,
3388                offset + 0,
3389                _depth
3390            )?;
3391            Ok(())
3392        }
3393    }
3394
3395    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerStateResponse {
3396        type Borrowed<'a> = &'a Self;
3397        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3398            value
3399        }
3400    }
3401
3402    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerStateResponse {
3403        type Owned = Self;
3404
3405        #[inline(always)]
3406        fn inline_align(_context: fidl::encoding::Context) -> usize {
3407            1
3408        }
3409
3410        #[inline(always)]
3411        fn inline_size(_context: fidl::encoding::Context) -> usize {
3412            1
3413        }
3414    }
3415
3416    unsafe impl<D: fidl::encoding::ResourceDialect>
3417        fidl::encoding::Encode<DeviceMonitorGetPowerStateResponse, D>
3418        for &DeviceMonitorGetPowerStateResponse
3419    {
3420        #[inline]
3421        unsafe fn encode(
3422            self,
3423            encoder: &mut fidl::encoding::Encoder<'_, D>,
3424            offset: usize,
3425            _depth: fidl::encoding::Depth,
3426        ) -> fidl::Result<()> {
3427            encoder.debug_check_bounds::<DeviceMonitorGetPowerStateResponse>(offset);
3428            // Delegate to tuple encoding.
3429            fidl::encoding::Encode::<DeviceMonitorGetPowerStateResponse, D>::encode(
3430                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_on),),
3431                encoder,
3432                offset,
3433                _depth,
3434            )
3435        }
3436    }
3437    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3438        fidl::encoding::Encode<DeviceMonitorGetPowerStateResponse, D> for (T0,)
3439    {
3440        #[inline]
3441        unsafe fn encode(
3442            self,
3443            encoder: &mut fidl::encoding::Encoder<'_, D>,
3444            offset: usize,
3445            depth: fidl::encoding::Depth,
3446        ) -> fidl::Result<()> {
3447            encoder.debug_check_bounds::<DeviceMonitorGetPowerStateResponse>(offset);
3448            // Zero out padding regions. There's no need to apply masks
3449            // because the unmasked parts will be overwritten by fields.
3450            // Write the fields.
3451            self.0.encode(encoder, offset + 0, depth)?;
3452            Ok(())
3453        }
3454    }
3455
3456    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3457        for DeviceMonitorGetPowerStateResponse
3458    {
3459        #[inline(always)]
3460        fn new_empty() -> Self {
3461            Self { power_on: fidl::new_empty!(bool, D) }
3462        }
3463
3464        #[inline]
3465        unsafe fn decode(
3466            &mut self,
3467            decoder: &mut fidl::encoding::Decoder<'_, D>,
3468            offset: usize,
3469            _depth: fidl::encoding::Depth,
3470        ) -> fidl::Result<()> {
3471            decoder.debug_check_bounds::<Self>(offset);
3472            // Verify that padding bytes are zero.
3473            fidl::decode!(bool, D, &mut self.power_on, decoder, offset + 0, _depth)?;
3474            Ok(())
3475        }
3476    }
3477
3478    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
3479        type Borrowed<'a> = &'a Self;
3480        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3481            value
3482        }
3483    }
3484
3485    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
3486        type Owned = Self;
3487
3488        #[inline(always)]
3489        fn inline_align(_context: fidl::encoding::Context) -> usize {
3490            8
3491        }
3492
3493        #[inline(always)]
3494        fn inline_size(_context: fidl::encoding::Context) -> usize {
3495            16
3496        }
3497    }
3498
3499    unsafe impl<D: fidl::encoding::ResourceDialect>
3500        fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D>
3501        for &DeviceMonitorGetSupportedMacRolesResponse
3502    {
3503        #[inline]
3504        unsafe fn encode(
3505            self,
3506            encoder: &mut fidl::encoding::Encoder<'_, D>,
3507            offset: usize,
3508            _depth: fidl::encoding::Depth,
3509        ) -> fidl::Result<()> {
3510            encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
3511            // Delegate to tuple encoding.
3512            fidl::encoding::Encode::<DeviceMonitorGetSupportedMacRolesResponse, D>::encode(
3513                (
3514                    <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
3515                ),
3516                encoder, offset, _depth
3517            )
3518        }
3519    }
3520    unsafe impl<
3521        D: fidl::encoding::ResourceDialect,
3522        T0: fidl::encoding::Encode<
3523                fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>,
3524                D,
3525            >,
3526    > fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D> for (T0,)
3527    {
3528        #[inline]
3529        unsafe fn encode(
3530            self,
3531            encoder: &mut fidl::encoding::Encoder<'_, D>,
3532            offset: usize,
3533            depth: fidl::encoding::Depth,
3534        ) -> fidl::Result<()> {
3535            encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
3536            // Zero out padding regions. There's no need to apply masks
3537            // because the unmasked parts will be overwritten by fields.
3538            // Write the fields.
3539            self.0.encode(encoder, offset + 0, depth)?;
3540            Ok(())
3541        }
3542    }
3543
3544    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3545        for DeviceMonitorGetSupportedMacRolesResponse
3546    {
3547        #[inline(always)]
3548        fn new_empty() -> Self {
3549            Self {
3550                supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D),
3551            }
3552        }
3553
3554        #[inline]
3555        unsafe fn decode(
3556            &mut self,
3557            decoder: &mut fidl::encoding::Decoder<'_, D>,
3558            offset: usize,
3559            _depth: fidl::encoding::Depth,
3560        ) -> fidl::Result<()> {
3561            decoder.debug_check_bounds::<Self>(offset);
3562            // Verify that padding bytes are zero.
3563            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
3564            Ok(())
3565        }
3566    }
3567
3568    impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetTxPowerScenarioResponse {
3569        type Borrowed<'a> = &'a Self;
3570        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3571            value
3572        }
3573    }
3574
3575    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetTxPowerScenarioResponse {
3576        type Owned = Self;
3577
3578        #[inline(always)]
3579        fn inline_align(_context: fidl::encoding::Context) -> usize {
3580            4
3581        }
3582
3583        #[inline(always)]
3584        fn inline_size(_context: fidl::encoding::Context) -> usize {
3585            4
3586        }
3587    }
3588
3589    unsafe impl<D: fidl::encoding::ResourceDialect>
3590        fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioResponse, D>
3591        for &DeviceMonitorGetTxPowerScenarioResponse
3592    {
3593        #[inline]
3594        unsafe fn encode(
3595            self,
3596            encoder: &mut fidl::encoding::Encoder<'_, D>,
3597            offset: usize,
3598            _depth: fidl::encoding::Depth,
3599        ) -> fidl::Result<()> {
3600            encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioResponse>(offset);
3601            // Delegate to tuple encoding.
3602            fidl::encoding::Encode::<DeviceMonitorGetTxPowerScenarioResponse, D>::encode(
3603                (
3604                    <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
3605                ),
3606                encoder, offset, _depth
3607            )
3608        }
3609    }
3610    unsafe impl<
3611        D: fidl::encoding::ResourceDialect,
3612        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
3613    > fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioResponse, D> for (T0,)
3614    {
3615        #[inline]
3616        unsafe fn encode(
3617            self,
3618            encoder: &mut fidl::encoding::Encoder<'_, D>,
3619            offset: usize,
3620            depth: fidl::encoding::Depth,
3621        ) -> fidl::Result<()> {
3622            encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioResponse>(offset);
3623            // Zero out padding regions. There's no need to apply masks
3624            // because the unmasked parts will be overwritten by fields.
3625            // Write the fields.
3626            self.0.encode(encoder, offset + 0, depth)?;
3627            Ok(())
3628        }
3629    }
3630
3631    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3632        for DeviceMonitorGetTxPowerScenarioResponse
3633    {
3634        #[inline(always)]
3635        fn new_empty() -> Self {
3636            Self {
3637                scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
3638            }
3639        }
3640
3641        #[inline]
3642        unsafe fn decode(
3643            &mut self,
3644            decoder: &mut fidl::encoding::Decoder<'_, D>,
3645            offset: usize,
3646            _depth: fidl::encoding::Depth,
3647        ) -> fidl::Result<()> {
3648            decoder.debug_check_bounds::<Self>(offset);
3649            // Verify that padding bytes are zero.
3650            fidl::decode!(
3651                fidl_fuchsia_wlan_internal__common::TxPowerScenario,
3652                D,
3653                &mut self.scenario,
3654                decoder,
3655                offset + 0,
3656                _depth
3657            )?;
3658            Ok(())
3659        }
3660    }
3661
3662    impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceResponse {
3663        type Borrowed<'a> = &'a Self;
3664        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3665            value
3666        }
3667    }
3668
3669    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceResponse {
3670        type Owned = Self;
3671
3672        #[inline(always)]
3673        fn inline_align(_context: fidl::encoding::Context) -> usize {
3674            4
3675        }
3676
3677        #[inline(always)]
3678        fn inline_size(_context: fidl::encoding::Context) -> usize {
3679            16
3680        }
3681    }
3682
3683    unsafe impl<D: fidl::encoding::ResourceDialect>
3684        fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D>
3685        for &DeviceMonitorQueryIfaceResponse
3686    {
3687        #[inline]
3688        unsafe fn encode(
3689            self,
3690            encoder: &mut fidl::encoding::Encoder<'_, D>,
3691            offset: usize,
3692            _depth: fidl::encoding::Depth,
3693        ) -> fidl::Result<()> {
3694            encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
3695            // Delegate to tuple encoding.
3696            fidl::encoding::Encode::<DeviceMonitorQueryIfaceResponse, D>::encode(
3697                (<QueryIfaceResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
3698                encoder,
3699                offset,
3700                _depth,
3701            )
3702        }
3703    }
3704    unsafe impl<
3705        D: fidl::encoding::ResourceDialect,
3706        T0: fidl::encoding::Encode<QueryIfaceResponse, D>,
3707    > fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D> for (T0,)
3708    {
3709        #[inline]
3710        unsafe fn encode(
3711            self,
3712            encoder: &mut fidl::encoding::Encoder<'_, D>,
3713            offset: usize,
3714            depth: fidl::encoding::Depth,
3715        ) -> fidl::Result<()> {
3716            encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
3717            // Zero out padding regions. There's no need to apply masks
3718            // because the unmasked parts will be overwritten by fields.
3719            // Write the fields.
3720            self.0.encode(encoder, offset + 0, depth)?;
3721            Ok(())
3722        }
3723    }
3724
3725    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3726        for DeviceMonitorQueryIfaceResponse
3727    {
3728        #[inline(always)]
3729        fn new_empty() -> Self {
3730            Self { resp: fidl::new_empty!(QueryIfaceResponse, D) }
3731        }
3732
3733        #[inline]
3734        unsafe fn decode(
3735            &mut self,
3736            decoder: &mut fidl::encoding::Decoder<'_, D>,
3737            offset: usize,
3738            _depth: fidl::encoding::Depth,
3739        ) -> fidl::Result<()> {
3740            decoder.debug_check_bounds::<Self>(offset);
3741            // Verify that padding bytes are zero.
3742            fidl::decode!(QueryIfaceResponse, D, &mut self.resp, decoder, offset + 0, _depth)?;
3743            Ok(())
3744        }
3745    }
3746
3747    impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceAddedRequest {
3748        type Borrowed<'a> = &'a Self;
3749        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3750            value
3751        }
3752    }
3753
3754    unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceAddedRequest {
3755        type Owned = Self;
3756
3757        #[inline(always)]
3758        fn inline_align(_context: fidl::encoding::Context) -> usize {
3759            2
3760        }
3761
3762        #[inline(always)]
3763        fn inline_size(_context: fidl::encoding::Context) -> usize {
3764            2
3765        }
3766        #[inline(always)]
3767        fn encode_is_copy() -> bool {
3768            true
3769        }
3770
3771        #[inline(always)]
3772        fn decode_is_copy() -> bool {
3773            true
3774        }
3775    }
3776
3777    unsafe impl<D: fidl::encoding::ResourceDialect>
3778        fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D>
3779        for &DeviceWatcherOnIfaceAddedRequest
3780    {
3781        #[inline]
3782        unsafe fn encode(
3783            self,
3784            encoder: &mut fidl::encoding::Encoder<'_, D>,
3785            offset: usize,
3786            _depth: fidl::encoding::Depth,
3787        ) -> fidl::Result<()> {
3788            encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
3789            unsafe {
3790                // Copy the object into the buffer.
3791                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3792                (buf_ptr as *mut DeviceWatcherOnIfaceAddedRequest)
3793                    .write_unaligned((self as *const DeviceWatcherOnIfaceAddedRequest).read());
3794                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3795                // done second because the memcpy will write garbage to these bytes.
3796            }
3797            Ok(())
3798        }
3799    }
3800    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3801        fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D> for (T0,)
3802    {
3803        #[inline]
3804        unsafe fn encode(
3805            self,
3806            encoder: &mut fidl::encoding::Encoder<'_, D>,
3807            offset: usize,
3808            depth: fidl::encoding::Depth,
3809        ) -> fidl::Result<()> {
3810            encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
3811            // Zero out padding regions. There's no need to apply masks
3812            // because the unmasked parts will be overwritten by fields.
3813            // Write the fields.
3814            self.0.encode(encoder, offset + 0, depth)?;
3815            Ok(())
3816        }
3817    }
3818
3819    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3820        for DeviceWatcherOnIfaceAddedRequest
3821    {
3822        #[inline(always)]
3823        fn new_empty() -> Self {
3824            Self { iface_id: fidl::new_empty!(u16, D) }
3825        }
3826
3827        #[inline]
3828        unsafe fn decode(
3829            &mut self,
3830            decoder: &mut fidl::encoding::Decoder<'_, D>,
3831            offset: usize,
3832            _depth: fidl::encoding::Depth,
3833        ) -> fidl::Result<()> {
3834            decoder.debug_check_bounds::<Self>(offset);
3835            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3836            // Verify that padding bytes are zero.
3837            // Copy from the buffer into the object.
3838            unsafe {
3839                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3840            }
3841            Ok(())
3842        }
3843    }
3844
3845    impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceRemovedRequest {
3846        type Borrowed<'a> = &'a Self;
3847        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3848            value
3849        }
3850    }
3851
3852    unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceRemovedRequest {
3853        type Owned = Self;
3854
3855        #[inline(always)]
3856        fn inline_align(_context: fidl::encoding::Context) -> usize {
3857            2
3858        }
3859
3860        #[inline(always)]
3861        fn inline_size(_context: fidl::encoding::Context) -> usize {
3862            2
3863        }
3864        #[inline(always)]
3865        fn encode_is_copy() -> bool {
3866            true
3867        }
3868
3869        #[inline(always)]
3870        fn decode_is_copy() -> bool {
3871            true
3872        }
3873    }
3874
3875    unsafe impl<D: fidl::encoding::ResourceDialect>
3876        fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D>
3877        for &DeviceWatcherOnIfaceRemovedRequest
3878    {
3879        #[inline]
3880        unsafe fn encode(
3881            self,
3882            encoder: &mut fidl::encoding::Encoder<'_, D>,
3883            offset: usize,
3884            _depth: fidl::encoding::Depth,
3885        ) -> fidl::Result<()> {
3886            encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
3887            unsafe {
3888                // Copy the object into the buffer.
3889                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3890                (buf_ptr as *mut DeviceWatcherOnIfaceRemovedRequest)
3891                    .write_unaligned((self as *const DeviceWatcherOnIfaceRemovedRequest).read());
3892                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3893                // done second because the memcpy will write garbage to these bytes.
3894            }
3895            Ok(())
3896        }
3897    }
3898    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3899        fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D> for (T0,)
3900    {
3901        #[inline]
3902        unsafe fn encode(
3903            self,
3904            encoder: &mut fidl::encoding::Encoder<'_, D>,
3905            offset: usize,
3906            depth: fidl::encoding::Depth,
3907        ) -> fidl::Result<()> {
3908            encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
3909            // Zero out padding regions. There's no need to apply masks
3910            // because the unmasked parts will be overwritten by fields.
3911            // Write the fields.
3912            self.0.encode(encoder, offset + 0, depth)?;
3913            Ok(())
3914        }
3915    }
3916
3917    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3918        for DeviceWatcherOnIfaceRemovedRequest
3919    {
3920        #[inline(always)]
3921        fn new_empty() -> Self {
3922            Self { iface_id: fidl::new_empty!(u16, D) }
3923        }
3924
3925        #[inline]
3926        unsafe fn decode(
3927            &mut self,
3928            decoder: &mut fidl::encoding::Decoder<'_, D>,
3929            offset: usize,
3930            _depth: fidl::encoding::Depth,
3931        ) -> fidl::Result<()> {
3932            decoder.debug_check_bounds::<Self>(offset);
3933            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3934            // Verify that padding bytes are zero.
3935            // Copy from the buffer into the object.
3936            unsafe {
3937                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3938            }
3939            Ok(())
3940        }
3941    }
3942
3943    impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyAddedRequest {
3944        type Borrowed<'a> = &'a Self;
3945        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3946            value
3947        }
3948    }
3949
3950    unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyAddedRequest {
3951        type Owned = Self;
3952
3953        #[inline(always)]
3954        fn inline_align(_context: fidl::encoding::Context) -> usize {
3955            2
3956        }
3957
3958        #[inline(always)]
3959        fn inline_size(_context: fidl::encoding::Context) -> usize {
3960            2
3961        }
3962        #[inline(always)]
3963        fn encode_is_copy() -> bool {
3964            true
3965        }
3966
3967        #[inline(always)]
3968        fn decode_is_copy() -> bool {
3969            true
3970        }
3971    }
3972
3973    unsafe impl<D: fidl::encoding::ResourceDialect>
3974        fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D>
3975        for &DeviceWatcherOnPhyAddedRequest
3976    {
3977        #[inline]
3978        unsafe fn encode(
3979            self,
3980            encoder: &mut fidl::encoding::Encoder<'_, D>,
3981            offset: usize,
3982            _depth: fidl::encoding::Depth,
3983        ) -> fidl::Result<()> {
3984            encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
3985            unsafe {
3986                // Copy the object into the buffer.
3987                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3988                (buf_ptr as *mut DeviceWatcherOnPhyAddedRequest)
3989                    .write_unaligned((self as *const DeviceWatcherOnPhyAddedRequest).read());
3990                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3991                // done second because the memcpy will write garbage to these bytes.
3992            }
3993            Ok(())
3994        }
3995    }
3996    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3997        fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D> for (T0,)
3998    {
3999        #[inline]
4000        unsafe fn encode(
4001            self,
4002            encoder: &mut fidl::encoding::Encoder<'_, D>,
4003            offset: usize,
4004            depth: fidl::encoding::Depth,
4005        ) -> fidl::Result<()> {
4006            encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
4007            // Zero out padding regions. There's no need to apply masks
4008            // because the unmasked parts will be overwritten by fields.
4009            // Write the fields.
4010            self.0.encode(encoder, offset + 0, depth)?;
4011            Ok(())
4012        }
4013    }
4014
4015    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4016        for DeviceWatcherOnPhyAddedRequest
4017    {
4018        #[inline(always)]
4019        fn new_empty() -> Self {
4020            Self { phy_id: fidl::new_empty!(u16, D) }
4021        }
4022
4023        #[inline]
4024        unsafe fn decode(
4025            &mut self,
4026            decoder: &mut fidl::encoding::Decoder<'_, D>,
4027            offset: usize,
4028            _depth: fidl::encoding::Depth,
4029        ) -> fidl::Result<()> {
4030            decoder.debug_check_bounds::<Self>(offset);
4031            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4032            // Verify that padding bytes are zero.
4033            // Copy from the buffer into the object.
4034            unsafe {
4035                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4036            }
4037            Ok(())
4038        }
4039    }
4040
4041    impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyRemovedRequest {
4042        type Borrowed<'a> = &'a Self;
4043        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4044            value
4045        }
4046    }
4047
4048    unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyRemovedRequest {
4049        type Owned = Self;
4050
4051        #[inline(always)]
4052        fn inline_align(_context: fidl::encoding::Context) -> usize {
4053            2
4054        }
4055
4056        #[inline(always)]
4057        fn inline_size(_context: fidl::encoding::Context) -> usize {
4058            2
4059        }
4060        #[inline(always)]
4061        fn encode_is_copy() -> bool {
4062            true
4063        }
4064
4065        #[inline(always)]
4066        fn decode_is_copy() -> bool {
4067            true
4068        }
4069    }
4070
4071    unsafe impl<D: fidl::encoding::ResourceDialect>
4072        fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D>
4073        for &DeviceWatcherOnPhyRemovedRequest
4074    {
4075        #[inline]
4076        unsafe fn encode(
4077            self,
4078            encoder: &mut fidl::encoding::Encoder<'_, D>,
4079            offset: usize,
4080            _depth: fidl::encoding::Depth,
4081        ) -> fidl::Result<()> {
4082            encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
4083            unsafe {
4084                // Copy the object into the buffer.
4085                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4086                (buf_ptr as *mut DeviceWatcherOnPhyRemovedRequest)
4087                    .write_unaligned((self as *const DeviceWatcherOnPhyRemovedRequest).read());
4088                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4089                // done second because the memcpy will write garbage to these bytes.
4090            }
4091            Ok(())
4092        }
4093    }
4094    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
4095        fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D> for (T0,)
4096    {
4097        #[inline]
4098        unsafe fn encode(
4099            self,
4100            encoder: &mut fidl::encoding::Encoder<'_, D>,
4101            offset: usize,
4102            depth: fidl::encoding::Depth,
4103        ) -> fidl::Result<()> {
4104            encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
4105            // Zero out padding regions. There's no need to apply masks
4106            // because the unmasked parts will be overwritten by fields.
4107            // Write the fields.
4108            self.0.encode(encoder, offset + 0, depth)?;
4109            Ok(())
4110        }
4111    }
4112
4113    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4114        for DeviceWatcherOnPhyRemovedRequest
4115    {
4116        #[inline(always)]
4117        fn new_empty() -> Self {
4118            Self { phy_id: fidl::new_empty!(u16, D) }
4119        }
4120
4121        #[inline]
4122        unsafe fn decode(
4123            &mut self,
4124            decoder: &mut fidl::encoding::Decoder<'_, D>,
4125            offset: usize,
4126            _depth: fidl::encoding::Depth,
4127        ) -> fidl::Result<()> {
4128            decoder.debug_check_bounds::<Self>(offset);
4129            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4130            // Verify that padding bytes are zero.
4131            // Copy from the buffer into the object.
4132            unsafe {
4133                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4134            }
4135            Ok(())
4136        }
4137    }
4138
4139    impl fidl::encoding::ValueTypeMarker for GetCountryResponse {
4140        type Borrowed<'a> = &'a Self;
4141        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4142            value
4143        }
4144    }
4145
4146    unsafe impl fidl::encoding::TypeMarker for GetCountryResponse {
4147        type Owned = Self;
4148
4149        #[inline(always)]
4150        fn inline_align(_context: fidl::encoding::Context) -> usize {
4151            1
4152        }
4153
4154        #[inline(always)]
4155        fn inline_size(_context: fidl::encoding::Context) -> usize {
4156            2
4157        }
4158        #[inline(always)]
4159        fn encode_is_copy() -> bool {
4160            true
4161        }
4162
4163        #[inline(always)]
4164        fn decode_is_copy() -> bool {
4165            true
4166        }
4167    }
4168
4169    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetCountryResponse, D>
4170        for &GetCountryResponse
4171    {
4172        #[inline]
4173        unsafe fn encode(
4174            self,
4175            encoder: &mut fidl::encoding::Encoder<'_, D>,
4176            offset: usize,
4177            _depth: fidl::encoding::Depth,
4178        ) -> fidl::Result<()> {
4179            encoder.debug_check_bounds::<GetCountryResponse>(offset);
4180            unsafe {
4181                // Copy the object into the buffer.
4182                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4183                (buf_ptr as *mut GetCountryResponse)
4184                    .write_unaligned((self as *const GetCountryResponse).read());
4185                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4186                // done second because the memcpy will write garbage to these bytes.
4187            }
4188            Ok(())
4189        }
4190    }
4191    unsafe impl<
4192        D: fidl::encoding::ResourceDialect,
4193        T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
4194    > fidl::encoding::Encode<GetCountryResponse, D> for (T0,)
4195    {
4196        #[inline]
4197        unsafe fn encode(
4198            self,
4199            encoder: &mut fidl::encoding::Encoder<'_, D>,
4200            offset: usize,
4201            depth: fidl::encoding::Depth,
4202        ) -> fidl::Result<()> {
4203            encoder.debug_check_bounds::<GetCountryResponse>(offset);
4204            // Zero out padding regions. There's no need to apply masks
4205            // because the unmasked parts will be overwritten by fields.
4206            // Write the fields.
4207            self.0.encode(encoder, offset + 0, depth)?;
4208            Ok(())
4209        }
4210    }
4211
4212    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetCountryResponse {
4213        #[inline(always)]
4214        fn new_empty() -> Self {
4215            Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
4216        }
4217
4218        #[inline]
4219        unsafe fn decode(
4220            &mut self,
4221            decoder: &mut fidl::encoding::Decoder<'_, D>,
4222            offset: usize,
4223            _depth: fidl::encoding::Depth,
4224        ) -> fidl::Result<()> {
4225            decoder.debug_check_bounds::<Self>(offset);
4226            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4227            // Verify that padding bytes are zero.
4228            // Copy from the buffer into the object.
4229            unsafe {
4230                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4231            }
4232            Ok(())
4233        }
4234    }
4235
4236    impl fidl::encoding::ValueTypeMarker for GetPowerSaveModeResponse {
4237        type Borrowed<'a> = &'a Self;
4238        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4239            value
4240        }
4241    }
4242
4243    unsafe impl fidl::encoding::TypeMarker for GetPowerSaveModeResponse {
4244        type Owned = Self;
4245
4246        #[inline(always)]
4247        fn inline_align(_context: fidl::encoding::Context) -> usize {
4248            4
4249        }
4250
4251        #[inline(always)]
4252        fn inline_size(_context: fidl::encoding::Context) -> usize {
4253            4
4254        }
4255    }
4256
4257    unsafe impl<D: fidl::encoding::ResourceDialect>
4258        fidl::encoding::Encode<GetPowerSaveModeResponse, D> for &GetPowerSaveModeResponse
4259    {
4260        #[inline]
4261        unsafe fn encode(
4262            self,
4263            encoder: &mut fidl::encoding::Encoder<'_, D>,
4264            offset: usize,
4265            _depth: fidl::encoding::Depth,
4266        ) -> fidl::Result<()> {
4267            encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
4268            // Delegate to tuple encoding.
4269            fidl::encoding::Encode::<GetPowerSaveModeResponse, D>::encode(
4270                (
4271                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
4272                ),
4273                encoder, offset, _depth
4274            )
4275        }
4276    }
4277    unsafe impl<
4278        D: fidl::encoding::ResourceDialect,
4279        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
4280    > fidl::encoding::Encode<GetPowerSaveModeResponse, D> for (T0,)
4281    {
4282        #[inline]
4283        unsafe fn encode(
4284            self,
4285            encoder: &mut fidl::encoding::Encoder<'_, D>,
4286            offset: usize,
4287            depth: fidl::encoding::Depth,
4288        ) -> fidl::Result<()> {
4289            encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
4290            // Zero out padding regions. There's no need to apply masks
4291            // because the unmasked parts will be overwritten by fields.
4292            // Write the fields.
4293            self.0.encode(encoder, offset + 0, depth)?;
4294            Ok(())
4295        }
4296    }
4297
4298    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4299        for GetPowerSaveModeResponse
4300    {
4301        #[inline(always)]
4302        fn new_empty() -> Self {
4303            Self { ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
4304        }
4305
4306        #[inline]
4307        unsafe fn decode(
4308            &mut self,
4309            decoder: &mut fidl::encoding::Decoder<'_, D>,
4310            offset: usize,
4311            _depth: fidl::encoding::Depth,
4312        ) -> fidl::Result<()> {
4313            decoder.debug_check_bounds::<Self>(offset);
4314            // Verify that padding bytes are zero.
4315            fidl::decode!(
4316                fidl_fuchsia_wlan_common__common::PowerSaveType,
4317                D,
4318                &mut self.ps_mode,
4319                decoder,
4320                offset + 0,
4321                _depth
4322            )?;
4323            Ok(())
4324        }
4325    }
4326
4327    impl fidl::encoding::ValueTypeMarker for PhyEventWatcherOnCountryCodeChangeRequest {
4328        type Borrowed<'a> = &'a Self;
4329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4330            value
4331        }
4332    }
4333
4334    unsafe impl fidl::encoding::TypeMarker for PhyEventWatcherOnCountryCodeChangeRequest {
4335        type Owned = Self;
4336
4337        #[inline(always)]
4338        fn inline_align(_context: fidl::encoding::Context) -> usize {
4339            2
4340        }
4341
4342        #[inline(always)]
4343        fn inline_size(_context: fidl::encoding::Context) -> usize {
4344            4
4345        }
4346        #[inline(always)]
4347        fn encode_is_copy() -> bool {
4348            true
4349        }
4350
4351        #[inline(always)]
4352        fn decode_is_copy() -> bool {
4353            true
4354        }
4355    }
4356
4357    unsafe impl<D: fidl::encoding::ResourceDialect>
4358        fidl::encoding::Encode<PhyEventWatcherOnCountryCodeChangeRequest, D>
4359        for &PhyEventWatcherOnCountryCodeChangeRequest
4360    {
4361        #[inline]
4362        unsafe fn encode(
4363            self,
4364            encoder: &mut fidl::encoding::Encoder<'_, D>,
4365            offset: usize,
4366            _depth: fidl::encoding::Depth,
4367        ) -> fidl::Result<()> {
4368            encoder.debug_check_bounds::<PhyEventWatcherOnCountryCodeChangeRequest>(offset);
4369            unsafe {
4370                // Copy the object into the buffer.
4371                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4372                (buf_ptr as *mut PhyEventWatcherOnCountryCodeChangeRequest).write_unaligned(
4373                    (self as *const PhyEventWatcherOnCountryCodeChangeRequest).read(),
4374                );
4375                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4376                // done second because the memcpy will write garbage to these bytes.
4377            }
4378            Ok(())
4379        }
4380    }
4381    unsafe impl<
4382        D: fidl::encoding::ResourceDialect,
4383        T0: fidl::encoding::Encode<u16, D>,
4384        T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
4385    > fidl::encoding::Encode<PhyEventWatcherOnCountryCodeChangeRequest, D> for (T0, T1)
4386    {
4387        #[inline]
4388        unsafe fn encode(
4389            self,
4390            encoder: &mut fidl::encoding::Encoder<'_, D>,
4391            offset: usize,
4392            depth: fidl::encoding::Depth,
4393        ) -> fidl::Result<()> {
4394            encoder.debug_check_bounds::<PhyEventWatcherOnCountryCodeChangeRequest>(offset);
4395            // Zero out padding regions. There's no need to apply masks
4396            // because the unmasked parts will be overwritten by fields.
4397            // Write the fields.
4398            self.0.encode(encoder, offset + 0, depth)?;
4399            self.1.encode(encoder, offset + 2, depth)?;
4400            Ok(())
4401        }
4402    }
4403
4404    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4405        for PhyEventWatcherOnCountryCodeChangeRequest
4406    {
4407        #[inline(always)]
4408        fn new_empty() -> Self {
4409            Self {
4410                phy_id: fidl::new_empty!(u16, D),
4411                alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D),
4412            }
4413        }
4414
4415        #[inline]
4416        unsafe fn decode(
4417            &mut self,
4418            decoder: &mut fidl::encoding::Decoder<'_, D>,
4419            offset: usize,
4420            _depth: fidl::encoding::Depth,
4421        ) -> fidl::Result<()> {
4422            decoder.debug_check_bounds::<Self>(offset);
4423            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4424            // Verify that padding bytes are zero.
4425            // Copy from the buffer into the object.
4426            unsafe {
4427                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4428            }
4429            Ok(())
4430        }
4431    }
4432
4433    impl fidl::encoding::ValueTypeMarker for PhyEventWatcherOnCriticalErrorRequest {
4434        type Borrowed<'a> = &'a Self;
4435        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4436            value
4437        }
4438    }
4439
4440    unsafe impl fidl::encoding::TypeMarker for PhyEventWatcherOnCriticalErrorRequest {
4441        type Owned = Self;
4442
4443        #[inline(always)]
4444        fn inline_align(_context: fidl::encoding::Context) -> usize {
4445            2
4446        }
4447
4448        #[inline(always)]
4449        fn inline_size(_context: fidl::encoding::Context) -> usize {
4450            4
4451        }
4452    }
4453
4454    unsafe impl<D: fidl::encoding::ResourceDialect>
4455        fidl::encoding::Encode<PhyEventWatcherOnCriticalErrorRequest, D>
4456        for &PhyEventWatcherOnCriticalErrorRequest
4457    {
4458        #[inline]
4459        unsafe fn encode(
4460            self,
4461            encoder: &mut fidl::encoding::Encoder<'_, D>,
4462            offset: usize,
4463            _depth: fidl::encoding::Depth,
4464        ) -> fidl::Result<()> {
4465            encoder.debug_check_bounds::<PhyEventWatcherOnCriticalErrorRequest>(offset);
4466            // Delegate to tuple encoding.
4467            fidl::encoding::Encode::<PhyEventWatcherOnCriticalErrorRequest, D>::encode(
4468                (
4469                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4470                    <CriticalErrorReason as fidl::encoding::ValueTypeMarker>::borrow(
4471                        &self.reason_code,
4472                    ),
4473                ),
4474                encoder,
4475                offset,
4476                _depth,
4477            )
4478        }
4479    }
4480    unsafe impl<
4481        D: fidl::encoding::ResourceDialect,
4482        T0: fidl::encoding::Encode<u16, D>,
4483        T1: fidl::encoding::Encode<CriticalErrorReason, D>,
4484    > fidl::encoding::Encode<PhyEventWatcherOnCriticalErrorRequest, D> for (T0, T1)
4485    {
4486        #[inline]
4487        unsafe fn encode(
4488            self,
4489            encoder: &mut fidl::encoding::Encoder<'_, D>,
4490            offset: usize,
4491            depth: fidl::encoding::Depth,
4492        ) -> fidl::Result<()> {
4493            encoder.debug_check_bounds::<PhyEventWatcherOnCriticalErrorRequest>(offset);
4494            // Zero out padding regions. There's no need to apply masks
4495            // because the unmasked parts will be overwritten by fields.
4496            unsafe {
4497                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
4498                (ptr as *mut u16).write_unaligned(0);
4499            }
4500            // Write the fields.
4501            self.0.encode(encoder, offset + 0, depth)?;
4502            self.1.encode(encoder, offset + 2, depth)?;
4503            Ok(())
4504        }
4505    }
4506
4507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4508        for PhyEventWatcherOnCriticalErrorRequest
4509    {
4510        #[inline(always)]
4511        fn new_empty() -> Self {
4512            Self {
4513                phy_id: fidl::new_empty!(u16, D),
4514                reason_code: fidl::new_empty!(CriticalErrorReason, D),
4515            }
4516        }
4517
4518        #[inline]
4519        unsafe fn decode(
4520            &mut self,
4521            decoder: &mut fidl::encoding::Decoder<'_, D>,
4522            offset: usize,
4523            _depth: fidl::encoding::Depth,
4524        ) -> fidl::Result<()> {
4525            decoder.debug_check_bounds::<Self>(offset);
4526            // Verify that padding bytes are zero.
4527            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
4528            let padval = unsafe { (ptr as *const u16).read_unaligned() };
4529            let mask = 0xff00u16;
4530            let maskedval = padval & mask;
4531            if maskedval != 0 {
4532                return Err(fidl::Error::NonZeroPadding {
4533                    padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
4534                });
4535            }
4536            fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
4537            fidl::decode!(
4538                CriticalErrorReason,
4539                D,
4540                &mut self.reason_code,
4541                decoder,
4542                offset + 2,
4543                _depth
4544            )?;
4545            Ok(())
4546        }
4547    }
4548
4549    impl fidl::encoding::ValueTypeMarker for QueryIfaceResponse {
4550        type Borrowed<'a> = &'a Self;
4551        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4552            value
4553        }
4554    }
4555
4556    unsafe impl fidl::encoding::TypeMarker for QueryIfaceResponse {
4557        type Owned = Self;
4558
4559        #[inline(always)]
4560        fn inline_align(_context: fidl::encoding::Context) -> usize {
4561            4
4562        }
4563
4564        #[inline(always)]
4565        fn inline_size(_context: fidl::encoding::Context) -> usize {
4566            16
4567        }
4568    }
4569
4570    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QueryIfaceResponse, D>
4571        for &QueryIfaceResponse
4572    {
4573        #[inline]
4574        unsafe fn encode(
4575            self,
4576            encoder: &mut fidl::encoding::Encoder<'_, D>,
4577            offset: usize,
4578            _depth: fidl::encoding::Depth,
4579        ) -> fidl::Result<()> {
4580            encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
4581            // Delegate to tuple encoding.
4582            fidl::encoding::Encode::<QueryIfaceResponse, D>::encode(
4583                (
4584                    <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
4585                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4586                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4587                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_assigned_id),
4588                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
4589                ),
4590                encoder, offset, _depth
4591            )
4592        }
4593    }
4594    unsafe impl<
4595        D: fidl::encoding::ResourceDialect,
4596        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanMacRole, D>,
4597        T1: fidl::encoding::Encode<u16, D>,
4598        T2: fidl::encoding::Encode<u16, D>,
4599        T3: fidl::encoding::Encode<u16, D>,
4600        T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
4601    > fidl::encoding::Encode<QueryIfaceResponse, D> for (T0, T1, T2, T3, T4)
4602    {
4603        #[inline]
4604        unsafe fn encode(
4605            self,
4606            encoder: &mut fidl::encoding::Encoder<'_, D>,
4607            offset: usize,
4608            depth: fidl::encoding::Depth,
4609        ) -> fidl::Result<()> {
4610            encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
4611            // Zero out padding regions. There's no need to apply masks
4612            // because the unmasked parts will be overwritten by fields.
4613            // Write the fields.
4614            self.0.encode(encoder, offset + 0, depth)?;
4615            self.1.encode(encoder, offset + 4, depth)?;
4616            self.2.encode(encoder, offset + 6, depth)?;
4617            self.3.encode(encoder, offset + 8, depth)?;
4618            self.4.encode(encoder, offset + 10, depth)?;
4619            Ok(())
4620        }
4621    }
4622
4623    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QueryIfaceResponse {
4624        #[inline(always)]
4625        fn new_empty() -> Self {
4626            Self {
4627                role: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D),
4628                id: fidl::new_empty!(u16, D),
4629                phy_id: fidl::new_empty!(u16, D),
4630                phy_assigned_id: fidl::new_empty!(u16, D),
4631                sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
4632            }
4633        }
4634
4635        #[inline]
4636        unsafe fn decode(
4637            &mut self,
4638            decoder: &mut fidl::encoding::Decoder<'_, D>,
4639            offset: usize,
4640            _depth: fidl::encoding::Depth,
4641        ) -> fidl::Result<()> {
4642            decoder.debug_check_bounds::<Self>(offset);
4643            // Verify that padding bytes are zero.
4644            fidl::decode!(
4645                fidl_fuchsia_wlan_common__common::WlanMacRole,
4646                D,
4647                &mut self.role,
4648                decoder,
4649                offset + 0,
4650                _depth
4651            )?;
4652            fidl::decode!(u16, D, &mut self.id, decoder, offset + 4, _depth)?;
4653            fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 6, _depth)?;
4654            fidl::decode!(u16, D, &mut self.phy_assigned_id, decoder, offset + 8, _depth)?;
4655            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 10, _depth)?;
4656            Ok(())
4657        }
4658    }
4659
4660    impl fidl::encoding::ValueTypeMarker for SetCountryRequest {
4661        type Borrowed<'a> = &'a Self;
4662        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4663            value
4664        }
4665    }
4666
4667    unsafe impl fidl::encoding::TypeMarker for SetCountryRequest {
4668        type Owned = Self;
4669
4670        #[inline(always)]
4671        fn inline_align(_context: fidl::encoding::Context) -> usize {
4672            2
4673        }
4674
4675        #[inline(always)]
4676        fn inline_size(_context: fidl::encoding::Context) -> usize {
4677            4
4678        }
4679        #[inline(always)]
4680        fn encode_is_copy() -> bool {
4681            true
4682        }
4683
4684        #[inline(always)]
4685        fn decode_is_copy() -> bool {
4686            true
4687        }
4688    }
4689
4690    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryRequest, D>
4691        for &SetCountryRequest
4692    {
4693        #[inline]
4694        unsafe fn encode(
4695            self,
4696            encoder: &mut fidl::encoding::Encoder<'_, D>,
4697            offset: usize,
4698            _depth: fidl::encoding::Depth,
4699        ) -> fidl::Result<()> {
4700            encoder.debug_check_bounds::<SetCountryRequest>(offset);
4701            unsafe {
4702                // Copy the object into the buffer.
4703                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4704                (buf_ptr as *mut SetCountryRequest)
4705                    .write_unaligned((self as *const SetCountryRequest).read());
4706                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4707                // done second because the memcpy will write garbage to these bytes.
4708            }
4709            Ok(())
4710        }
4711    }
4712    unsafe impl<
4713        D: fidl::encoding::ResourceDialect,
4714        T0: fidl::encoding::Encode<u16, D>,
4715        T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
4716    > fidl::encoding::Encode<SetCountryRequest, D> for (T0, T1)
4717    {
4718        #[inline]
4719        unsafe fn encode(
4720            self,
4721            encoder: &mut fidl::encoding::Encoder<'_, D>,
4722            offset: usize,
4723            depth: fidl::encoding::Depth,
4724        ) -> fidl::Result<()> {
4725            encoder.debug_check_bounds::<SetCountryRequest>(offset);
4726            // Zero out padding regions. There's no need to apply masks
4727            // because the unmasked parts will be overwritten by fields.
4728            // Write the fields.
4729            self.0.encode(encoder, offset + 0, depth)?;
4730            self.1.encode(encoder, offset + 2, depth)?;
4731            Ok(())
4732        }
4733    }
4734
4735    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryRequest {
4736        #[inline(always)]
4737        fn new_empty() -> Self {
4738            Self {
4739                phy_id: fidl::new_empty!(u16, D),
4740                alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D),
4741            }
4742        }
4743
4744        #[inline]
4745        unsafe fn decode(
4746            &mut self,
4747            decoder: &mut fidl::encoding::Decoder<'_, D>,
4748            offset: usize,
4749            _depth: fidl::encoding::Depth,
4750        ) -> fidl::Result<()> {
4751            decoder.debug_check_bounds::<Self>(offset);
4752            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4753            // Verify that padding bytes are zero.
4754            // Copy from the buffer into the object.
4755            unsafe {
4756                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4757            }
4758            Ok(())
4759        }
4760    }
4761
4762    impl fidl::encoding::ValueTypeMarker for SetPowerSaveModeRequest {
4763        type Borrowed<'a> = &'a Self;
4764        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4765            value
4766        }
4767    }
4768
4769    unsafe impl fidl::encoding::TypeMarker for SetPowerSaveModeRequest {
4770        type Owned = Self;
4771
4772        #[inline(always)]
4773        fn inline_align(_context: fidl::encoding::Context) -> usize {
4774            4
4775        }
4776
4777        #[inline(always)]
4778        fn inline_size(_context: fidl::encoding::Context) -> usize {
4779            8
4780        }
4781    }
4782
4783    unsafe impl<D: fidl::encoding::ResourceDialect>
4784        fidl::encoding::Encode<SetPowerSaveModeRequest, D> for &SetPowerSaveModeRequest
4785    {
4786        #[inline]
4787        unsafe fn encode(
4788            self,
4789            encoder: &mut fidl::encoding::Encoder<'_, D>,
4790            offset: usize,
4791            _depth: fidl::encoding::Depth,
4792        ) -> fidl::Result<()> {
4793            encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
4794            // Delegate to tuple encoding.
4795            fidl::encoding::Encode::<SetPowerSaveModeRequest, D>::encode(
4796                (
4797                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4798                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
4799                ),
4800                encoder, offset, _depth
4801            )
4802        }
4803    }
4804    unsafe impl<
4805        D: fidl::encoding::ResourceDialect,
4806        T0: fidl::encoding::Encode<u16, D>,
4807        T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
4808    > fidl::encoding::Encode<SetPowerSaveModeRequest, D> for (T0, T1)
4809    {
4810        #[inline]
4811        unsafe fn encode(
4812            self,
4813            encoder: &mut fidl::encoding::Encoder<'_, D>,
4814            offset: usize,
4815            depth: fidl::encoding::Depth,
4816        ) -> fidl::Result<()> {
4817            encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
4818            // Zero out padding regions. There's no need to apply masks
4819            // because the unmasked parts will be overwritten by fields.
4820            unsafe {
4821                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4822                (ptr as *mut u32).write_unaligned(0);
4823            }
4824            // Write the fields.
4825            self.0.encode(encoder, offset + 0, depth)?;
4826            self.1.encode(encoder, offset + 4, depth)?;
4827            Ok(())
4828        }
4829    }
4830
4831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4832        for SetPowerSaveModeRequest
4833    {
4834        #[inline(always)]
4835        fn new_empty() -> Self {
4836            Self {
4837                phy_id: fidl::new_empty!(u16, D),
4838                ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D),
4839            }
4840        }
4841
4842        #[inline]
4843        unsafe fn decode(
4844            &mut self,
4845            decoder: &mut fidl::encoding::Decoder<'_, D>,
4846            offset: usize,
4847            _depth: fidl::encoding::Depth,
4848        ) -> fidl::Result<()> {
4849            decoder.debug_check_bounds::<Self>(offset);
4850            // Verify that padding bytes are zero.
4851            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4852            let padval = unsafe { (ptr as *const u32).read_unaligned() };
4853            let mask = 0xffff0000u32;
4854            let maskedval = padval & mask;
4855            if maskedval != 0 {
4856                return Err(fidl::Error::NonZeroPadding {
4857                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4858                });
4859            }
4860            fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
4861            fidl::decode!(
4862                fidl_fuchsia_wlan_common__common::PowerSaveType,
4863                D,
4864                &mut self.ps_mode,
4865                decoder,
4866                offset + 4,
4867                _depth
4868            )?;
4869            Ok(())
4870        }
4871    }
4872
4873    impl DeviceMonitorCreateIfaceRequest {
4874        #[inline(always)]
4875        fn max_ordinal_present(&self) -> u64 {
4876            if let Some(_) = self.sta_address {
4877                return 3;
4878            }
4879            if let Some(_) = self.role {
4880                return 2;
4881            }
4882            if let Some(_) = self.phy_id {
4883                return 1;
4884            }
4885            0
4886        }
4887    }
4888
4889    impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceRequest {
4890        type Borrowed<'a> = &'a Self;
4891        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4892            value
4893        }
4894    }
4895
4896    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceRequest {
4897        type Owned = Self;
4898
4899        #[inline(always)]
4900        fn inline_align(_context: fidl::encoding::Context) -> usize {
4901            8
4902        }
4903
4904        #[inline(always)]
4905        fn inline_size(_context: fidl::encoding::Context) -> usize {
4906            16
4907        }
4908    }
4909
4910    unsafe impl<D: fidl::encoding::ResourceDialect>
4911        fidl::encoding::Encode<DeviceMonitorCreateIfaceRequest, D>
4912        for &DeviceMonitorCreateIfaceRequest
4913    {
4914        unsafe fn encode(
4915            self,
4916            encoder: &mut fidl::encoding::Encoder<'_, D>,
4917            offset: usize,
4918            mut depth: fidl::encoding::Depth,
4919        ) -> fidl::Result<()> {
4920            encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
4921            // Vector header
4922            let max_ordinal: u64 = self.max_ordinal_present();
4923            encoder.write_num(max_ordinal, offset);
4924            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4925            // Calling encoder.out_of_line_offset(0) is not allowed.
4926            if max_ordinal == 0 {
4927                return Ok(());
4928            }
4929            depth.increment()?;
4930            let envelope_size = 8;
4931            let bytes_len = max_ordinal as usize * envelope_size;
4932            #[allow(unused_variables)]
4933            let offset = encoder.out_of_line_offset(bytes_len);
4934            let mut _prev_end_offset: usize = 0;
4935            if 1 > max_ordinal {
4936                return Ok(());
4937            }
4938
4939            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4940            // are envelope_size bytes.
4941            let cur_offset: usize = (1 - 1) * envelope_size;
4942
4943            // Zero reserved fields.
4944            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4945
4946            // Safety:
4947            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4948            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4949            //   envelope_size bytes, there is always sufficient room.
4950            fidl::encoding::encode_in_envelope_optional::<u16, D>(
4951                self.phy_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
4952                encoder,
4953                offset + cur_offset,
4954                depth,
4955            )?;
4956
4957            _prev_end_offset = cur_offset + envelope_size;
4958            if 2 > max_ordinal {
4959                return Ok(());
4960            }
4961
4962            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4963            // are envelope_size bytes.
4964            let cur_offset: usize = (2 - 1) * envelope_size;
4965
4966            // Zero reserved fields.
4967            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4968
4969            // Safety:
4970            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4971            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4972            //   envelope_size bytes, there is always sufficient room.
4973            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
4974            self.role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
4975            encoder, offset + cur_offset, depth
4976        )?;
4977
4978            _prev_end_offset = cur_offset + envelope_size;
4979            if 3 > max_ordinal {
4980                return Ok(());
4981            }
4982
4983            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4984            // are envelope_size bytes.
4985            let cur_offset: usize = (3 - 1) * envelope_size;
4986
4987            // Zero reserved fields.
4988            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4989
4990            // Safety:
4991            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4992            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4993            //   envelope_size bytes, there is always sufficient room.
4994            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4995                self.sta_address
4996                    .as_ref()
4997                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4998                encoder,
4999                offset + cur_offset,
5000                depth,
5001            )?;
5002
5003            _prev_end_offset = cur_offset + envelope_size;
5004
5005            Ok(())
5006        }
5007    }
5008
5009    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5010        for DeviceMonitorCreateIfaceRequest
5011    {
5012        #[inline(always)]
5013        fn new_empty() -> Self {
5014            Self::default()
5015        }
5016
5017        unsafe fn decode(
5018            &mut self,
5019            decoder: &mut fidl::encoding::Decoder<'_, D>,
5020            offset: usize,
5021            mut depth: fidl::encoding::Depth,
5022        ) -> fidl::Result<()> {
5023            decoder.debug_check_bounds::<Self>(offset);
5024            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5025                None => return Err(fidl::Error::NotNullable),
5026                Some(len) => len,
5027            };
5028            // Calling decoder.out_of_line_offset(0) is not allowed.
5029            if len == 0 {
5030                return Ok(());
5031            };
5032            depth.increment()?;
5033            let envelope_size = 8;
5034            let bytes_len = len * envelope_size;
5035            let offset = decoder.out_of_line_offset(bytes_len)?;
5036            // Decode the envelope for each type.
5037            let mut _next_ordinal_to_read = 0;
5038            let mut next_offset = offset;
5039            let end_offset = offset + bytes_len;
5040            _next_ordinal_to_read += 1;
5041            if next_offset >= end_offset {
5042                return Ok(());
5043            }
5044
5045            // Decode unknown envelopes for gaps in ordinals.
5046            while _next_ordinal_to_read < 1 {
5047                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5048                _next_ordinal_to_read += 1;
5049                next_offset += envelope_size;
5050            }
5051
5052            let next_out_of_line = decoder.next_out_of_line();
5053            let handles_before = decoder.remaining_handles();
5054            if let Some((inlined, num_bytes, num_handles)) =
5055                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5056            {
5057                let member_inline_size =
5058                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5059                if inlined != (member_inline_size <= 4) {
5060                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5061                }
5062                let inner_offset;
5063                let mut inner_depth = depth.clone();
5064                if inlined {
5065                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5066                    inner_offset = next_offset;
5067                } else {
5068                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5069                    inner_depth.increment()?;
5070                }
5071                let val_ref = self.phy_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
5072                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
5073                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5074                {
5075                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5076                }
5077                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5078                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5079                }
5080            }
5081
5082            next_offset += envelope_size;
5083            _next_ordinal_to_read += 1;
5084            if next_offset >= end_offset {
5085                return Ok(());
5086            }
5087
5088            // Decode unknown envelopes for gaps in ordinals.
5089            while _next_ordinal_to_read < 2 {
5090                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5091                _next_ordinal_to_read += 1;
5092                next_offset += envelope_size;
5093            }
5094
5095            let next_out_of_line = decoder.next_out_of_line();
5096            let handles_before = decoder.remaining_handles();
5097            if let Some((inlined, num_bytes, num_handles)) =
5098                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5099            {
5100                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5101                if inlined != (member_inline_size <= 4) {
5102                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5103                }
5104                let inner_offset;
5105                let mut inner_depth = depth.clone();
5106                if inlined {
5107                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5108                    inner_offset = next_offset;
5109                } else {
5110                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5111                    inner_depth.increment()?;
5112                }
5113                let val_ref = self.role.get_or_insert_with(|| {
5114                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
5115                });
5116                fidl::decode!(
5117                    fidl_fuchsia_wlan_common__common::WlanMacRole,
5118                    D,
5119                    val_ref,
5120                    decoder,
5121                    inner_offset,
5122                    inner_depth
5123                )?;
5124                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5125                {
5126                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5127                }
5128                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5129                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5130                }
5131            }
5132
5133            next_offset += envelope_size;
5134            _next_ordinal_to_read += 1;
5135            if next_offset >= end_offset {
5136                return Ok(());
5137            }
5138
5139            // Decode unknown envelopes for gaps in ordinals.
5140            while _next_ordinal_to_read < 3 {
5141                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5142                _next_ordinal_to_read += 1;
5143                next_offset += envelope_size;
5144            }
5145
5146            let next_out_of_line = decoder.next_out_of_line();
5147            let handles_before = decoder.remaining_handles();
5148            if let Some((inlined, num_bytes, num_handles)) =
5149                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5150            {
5151                let member_inline_size =
5152                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5153                        decoder.context,
5154                    );
5155                if inlined != (member_inline_size <= 4) {
5156                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5157                }
5158                let inner_offset;
5159                let mut inner_depth = depth.clone();
5160                if inlined {
5161                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5162                    inner_offset = next_offset;
5163                } else {
5164                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5165                    inner_depth.increment()?;
5166                }
5167                let val_ref = self
5168                    .sta_address
5169                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5170                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5171                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5172                {
5173                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5174                }
5175                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5176                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5177                }
5178            }
5179
5180            next_offset += envelope_size;
5181
5182            // Decode the remaining unknown envelopes.
5183            while next_offset < end_offset {
5184                _next_ordinal_to_read += 1;
5185                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5186                next_offset += envelope_size;
5187            }
5188
5189            Ok(())
5190        }
5191    }
5192
5193    impl DeviceMonitorCreateIfaceResponse {
5194        #[inline(always)]
5195        fn max_ordinal_present(&self) -> u64 {
5196            if let Some(_) = self.iface_id {
5197                return 1;
5198            }
5199            0
5200        }
5201    }
5202
5203    impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceResponse {
5204        type Borrowed<'a> = &'a Self;
5205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5206            value
5207        }
5208    }
5209
5210    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceResponse {
5211        type Owned = Self;
5212
5213        #[inline(always)]
5214        fn inline_align(_context: fidl::encoding::Context) -> usize {
5215            8
5216        }
5217
5218        #[inline(always)]
5219        fn inline_size(_context: fidl::encoding::Context) -> usize {
5220            16
5221        }
5222    }
5223
5224    unsafe impl<D: fidl::encoding::ResourceDialect>
5225        fidl::encoding::Encode<DeviceMonitorCreateIfaceResponse, D>
5226        for &DeviceMonitorCreateIfaceResponse
5227    {
5228        unsafe fn encode(
5229            self,
5230            encoder: &mut fidl::encoding::Encoder<'_, D>,
5231            offset: usize,
5232            mut depth: fidl::encoding::Depth,
5233        ) -> fidl::Result<()> {
5234            encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
5235            // Vector header
5236            let max_ordinal: u64 = self.max_ordinal_present();
5237            encoder.write_num(max_ordinal, offset);
5238            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5239            // Calling encoder.out_of_line_offset(0) is not allowed.
5240            if max_ordinal == 0 {
5241                return Ok(());
5242            }
5243            depth.increment()?;
5244            let envelope_size = 8;
5245            let bytes_len = max_ordinal as usize * envelope_size;
5246            #[allow(unused_variables)]
5247            let offset = encoder.out_of_line_offset(bytes_len);
5248            let mut _prev_end_offset: usize = 0;
5249            if 1 > max_ordinal {
5250                return Ok(());
5251            }
5252
5253            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5254            // are envelope_size bytes.
5255            let cur_offset: usize = (1 - 1) * envelope_size;
5256
5257            // Zero reserved fields.
5258            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5259
5260            // Safety:
5261            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5262            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5263            //   envelope_size bytes, there is always sufficient room.
5264            fidl::encoding::encode_in_envelope_optional::<u16, D>(
5265                self.iface_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5266                encoder,
5267                offset + cur_offset,
5268                depth,
5269            )?;
5270
5271            _prev_end_offset = cur_offset + envelope_size;
5272
5273            Ok(())
5274        }
5275    }
5276
5277    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5278        for DeviceMonitorCreateIfaceResponse
5279    {
5280        #[inline(always)]
5281        fn new_empty() -> Self {
5282            Self::default()
5283        }
5284
5285        unsafe fn decode(
5286            &mut self,
5287            decoder: &mut fidl::encoding::Decoder<'_, D>,
5288            offset: usize,
5289            mut depth: fidl::encoding::Depth,
5290        ) -> fidl::Result<()> {
5291            decoder.debug_check_bounds::<Self>(offset);
5292            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5293                None => return Err(fidl::Error::NotNullable),
5294                Some(len) => len,
5295            };
5296            // Calling decoder.out_of_line_offset(0) is not allowed.
5297            if len == 0 {
5298                return Ok(());
5299            };
5300            depth.increment()?;
5301            let envelope_size = 8;
5302            let bytes_len = len * envelope_size;
5303            let offset = decoder.out_of_line_offset(bytes_len)?;
5304            // Decode the envelope for each type.
5305            let mut _next_ordinal_to_read = 0;
5306            let mut next_offset = offset;
5307            let end_offset = offset + bytes_len;
5308            _next_ordinal_to_read += 1;
5309            if next_offset >= end_offset {
5310                return Ok(());
5311            }
5312
5313            // Decode unknown envelopes for gaps in ordinals.
5314            while _next_ordinal_to_read < 1 {
5315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5316                _next_ordinal_to_read += 1;
5317                next_offset += envelope_size;
5318            }
5319
5320            let next_out_of_line = decoder.next_out_of_line();
5321            let handles_before = decoder.remaining_handles();
5322            if let Some((inlined, num_bytes, num_handles)) =
5323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5324            {
5325                let member_inline_size =
5326                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5327                if inlined != (member_inline_size <= 4) {
5328                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5329                }
5330                let inner_offset;
5331                let mut inner_depth = depth.clone();
5332                if inlined {
5333                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5334                    inner_offset = next_offset;
5335                } else {
5336                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5337                    inner_depth.increment()?;
5338                }
5339                let val_ref = self.iface_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
5340                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
5341                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5342                {
5343                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5344                }
5345                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5346                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5347                }
5348            }
5349
5350            next_offset += envelope_size;
5351
5352            // Decode the remaining unknown envelopes.
5353            while next_offset < end_offset {
5354                _next_ordinal_to_read += 1;
5355                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5356                next_offset += envelope_size;
5357            }
5358
5359            Ok(())
5360        }
5361    }
5362
5363    impl fidl::encoding::ValueTypeMarker for GetIfaceHistogramStatsResponse {
5364        type Borrowed<'a> = &'a Self;
5365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5366            value
5367        }
5368    }
5369
5370    unsafe impl fidl::encoding::TypeMarker for GetIfaceHistogramStatsResponse {
5371        type Owned = Self;
5372
5373        #[inline(always)]
5374        fn inline_align(_context: fidl::encoding::Context) -> usize {
5375            8
5376        }
5377
5378        #[inline(always)]
5379        fn inline_size(_context: fidl::encoding::Context) -> usize {
5380            16
5381        }
5382    }
5383
5384    unsafe impl<D: fidl::encoding::ResourceDialect>
5385        fidl::encoding::Encode<GetIfaceHistogramStatsResponse, D>
5386        for &GetIfaceHistogramStatsResponse
5387    {
5388        #[inline]
5389        unsafe fn encode(
5390            self,
5391            encoder: &mut fidl::encoding::Encoder<'_, D>,
5392            offset: usize,
5393            _depth: fidl::encoding::Depth,
5394        ) -> fidl::Result<()> {
5395            encoder.debug_check_bounds::<GetIfaceHistogramStatsResponse>(offset);
5396            encoder.write_num::<u64>(self.ordinal(), offset);
5397            match self {
5398            GetIfaceHistogramStatsResponse::Stats(ref val) => {
5399                fidl::encoding::encode_in_envelope::<fidl_fuchsia_wlan_stats__common::IfaceHistogramStats, D>(
5400                    <fidl_fuchsia_wlan_stats__common::IfaceHistogramStats as fidl::encoding::ValueTypeMarker>::borrow(val),
5401                    encoder, offset + 8, _depth
5402                )
5403            }
5404            GetIfaceHistogramStatsResponse::ErrorStatus(ref val) => {
5405                fidl::encoding::encode_in_envelope::<i32, D>(
5406                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
5407                    encoder, offset + 8, _depth
5408                )
5409            }
5410        }
5411        }
5412    }
5413
5414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5415        for GetIfaceHistogramStatsResponse
5416    {
5417        #[inline(always)]
5418        fn new_empty() -> Self {
5419            Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats__common::IfaceHistogramStats, D))
5420        }
5421
5422        #[inline]
5423        unsafe fn decode(
5424            &mut self,
5425            decoder: &mut fidl::encoding::Decoder<'_, D>,
5426            offset: usize,
5427            mut depth: fidl::encoding::Depth,
5428        ) -> fidl::Result<()> {
5429            decoder.debug_check_bounds::<Self>(offset);
5430            #[allow(unused_variables)]
5431            let next_out_of_line = decoder.next_out_of_line();
5432            let handles_before = decoder.remaining_handles();
5433            let (ordinal, inlined, num_bytes, num_handles) =
5434                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5435
5436            let member_inline_size = match ordinal {
5437            1 => <fidl_fuchsia_wlan_stats__common::IfaceHistogramStats as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5438            2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5439            _ => return Err(fidl::Error::UnknownUnionTag),
5440        };
5441
5442            if inlined != (member_inline_size <= 4) {
5443                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5444            }
5445            let _inner_offset;
5446            if inlined {
5447                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5448                _inner_offset = offset + 8;
5449            } else {
5450                depth.increment()?;
5451                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5452            }
5453            match ordinal {
5454                1 => {
5455                    #[allow(irrefutable_let_patterns)]
5456                    if let GetIfaceHistogramStatsResponse::Stats(_) = self {
5457                        // Do nothing, read the value into the object
5458                    } else {
5459                        // Initialize `self` to the right variant
5460                        *self = GetIfaceHistogramStatsResponse::Stats(fidl::new_empty!(
5461                            fidl_fuchsia_wlan_stats__common::IfaceHistogramStats,
5462                            D
5463                        ));
5464                    }
5465                    #[allow(irrefutable_let_patterns)]
5466                    if let GetIfaceHistogramStatsResponse::Stats(ref mut val) = self {
5467                        fidl::decode!(
5468                            fidl_fuchsia_wlan_stats__common::IfaceHistogramStats,
5469                            D,
5470                            val,
5471                            decoder,
5472                            _inner_offset,
5473                            depth
5474                        )?;
5475                    } else {
5476                        unreachable!()
5477                    }
5478                }
5479                2 => {
5480                    #[allow(irrefutable_let_patterns)]
5481                    if let GetIfaceHistogramStatsResponse::ErrorStatus(_) = self {
5482                        // Do nothing, read the value into the object
5483                    } else {
5484                        // Initialize `self` to the right variant
5485                        *self =
5486                            GetIfaceHistogramStatsResponse::ErrorStatus(fidl::new_empty!(i32, D));
5487                    }
5488                    #[allow(irrefutable_let_patterns)]
5489                    if let GetIfaceHistogramStatsResponse::ErrorStatus(ref mut val) = self {
5490                        fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
5491                    } else {
5492                        unreachable!()
5493                    }
5494                }
5495                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5496            }
5497            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5498                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5499            }
5500            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5501                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5502            }
5503            Ok(())
5504        }
5505    }
5506}