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