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