Skip to main content

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