fidl_fuchsia_wlan_tap__common/
fidl_fuchsia_wlan_tap__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(Clone, Debug, PartialEq)]
12pub struct JoinBssArgs {
13    pub wlan_softmac_id: u16,
14    pub config: fidl_fuchsia_wlan_common__common::JoinBssRequest,
15}
16
17impl fidl::Persistable for JoinBssArgs {}
18
19#[derive(Clone, Debug, PartialEq)]
20pub struct SetChannelArgs {
21    pub wlan_softmac_id: u16,
22    pub channel: fidl_fuchsia_wlan_common__common::WlanChannel,
23}
24
25impl fidl::Persistable for SetChannelArgs {}
26
27/// Country code the device is to switch to.
28/// These values are populated by the wlantap driver and should not be specified manually.
29/// See also phy.fidl CountryCode.
30#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31#[repr(C)]
32pub struct SetCountryArgs {
33    pub alpha2: [u8; 2],
34}
35
36impl fidl::Persistable for SetCountryArgs {}
37
38#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub struct SetKeyArgs {
40    pub wlan_softmac_id: u16,
41    pub config: WlanKeyConfig,
42}
43
44impl fidl::Persistable for SetKeyArgs {}
45
46#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47#[repr(C)]
48pub struct StartScanArgs {
49    pub wlan_softmac_id: u16,
50    pub scan_id: u64,
51}
52
53impl fidl::Persistable for StartScanArgs {}
54
55#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct TxArgs {
57    pub wlan_softmac_id: u16,
58    pub packet: WlanTxPacket,
59}
60
61impl fidl::Persistable for TxArgs {}
62
63/// Configuration pertaining to security keys, often used by RSN and other secure authentication.
64/// These values are populated by the wlantap driver and should not be specified manually.
65/// See wlan_key_config_t for details about each field.
66#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67pub struct WlanKeyConfig {
68    pub protection: u8,
69    pub cipher_oui: [u8; 3],
70    pub cipher_type: u8,
71    pub key_type: u8,
72    pub peer_addr: [u8; 6],
73    pub key_idx: u8,
74    pub key: Vec<u8>,
75}
76
77impl fidl::Persistable for WlanKeyConfig {}
78
79/// Information pertaining to incoming packets. One WlanRxInfo is associated with each packet.
80/// You are encouraged to use the default value in //src/connectivity/wlan/testing/hw-sim/src/lib.rs
81/// See wlan_rx_info_t for details about each field.
82#[derive(Clone, Debug, PartialEq)]
83pub struct WlanRxInfo {
84    pub rx_flags: u32,
85    pub valid_fields: u32,
86    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
87    pub data_rate: u32,
88    pub channel: fidl_fuchsia_wlan_common__common::WlanChannel,
89    pub mcs: u8,
90    pub rssi_dbm: i8,
91    pub snr_dbh: i16,
92}
93
94impl fidl::Persistable for WlanRxInfo {}
95
96/// Instruction from generic WLAN driver on how to send a packet. One WlanTxInfo per packet.
97/// These values are populated by the wlantap driver and should not be specified manually.
98/// See wlan_tx_info_t for details about each field.
99#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100pub struct WlanTxInfo {
101    pub tx_flags: u32,
102    pub valid_fields: u32,
103    pub tx_vector_idx: u16,
104    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
105    pub cbw: u8,
106    pub mcs: u8,
107}
108
109impl fidl::Persistable for WlanTxInfo {}
110
111/// An outgoing packet that is to be "sent" by the wlantap device. `data` contains the packet
112/// in its wire format.
113#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114pub struct WlanTxPacket {
115    pub data: Vec<u8>,
116    pub info: WlanTxInfo,
117}
118
119impl fidl::Persistable for WlanTxPacket {}
120
121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122#[repr(C)]
123pub struct WlantapCtlCreatePhyResponse {
124    pub status: i32,
125}
126
127impl fidl::Persistable for WlantapCtlCreatePhyResponse {}
128
129/// Describes the capabilities of the fake wlantap-phy device to be created.
130#[derive(Clone, Debug, PartialEq)]
131pub struct WlantapPhyConfig {
132    pub sta_addr: [u8; 6],
133    pub mac_role: fidl_fuchsia_wlan_common__common::WlanMacRole,
134    pub supported_phys: Vec<fidl_fuchsia_wlan_common__common::WlanPhyType>,
135    pub hardware_capability: u32,
136    pub bands: Vec<fidl_fuchsia_wlan_device__common::BandInfo>,
137    pub name: String,
138    pub quiet: bool,
139    pub discovery_support: fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
140    pub mac_sublayer_support: fidl_fuchsia_wlan_common__common::MacSublayerSupport,
141    pub security_support: fidl_fuchsia_wlan_common__common::SecuritySupport,
142    pub spectrum_management_support: fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
143}
144
145impl fidl::Persistable for WlantapPhyConfig {}
146
147#[derive(Clone, Debug, PartialEq)]
148pub struct WlantapPhyJoinBssRequest {
149    pub args: JoinBssArgs,
150}
151
152impl fidl::Persistable for WlantapPhyJoinBssRequest {}
153
154#[derive(Clone, Debug, PartialEq)]
155pub struct WlantapPhyReportTxResultRequest {
156    pub txr: fidl_fuchsia_wlan_common__common::WlanTxResult,
157}
158
159impl fidl::Persistable for WlantapPhyReportTxResultRequest {}
160
161#[derive(Clone, Debug, PartialEq)]
162pub struct WlantapPhyRxRequest {
163    pub data: Vec<u8>,
164    pub info: WlanRxInfo,
165}
166
167impl fidl::Persistable for WlantapPhyRxRequest {}
168
169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170#[repr(C)]
171pub struct WlantapPhyScanCompleteRequest {
172    pub scan_id: u64,
173    pub status: i32,
174}
175
176impl fidl::Persistable for WlantapPhyScanCompleteRequest {}
177
178#[derive(Clone, Debug, PartialEq)]
179pub struct WlantapPhySetChannelRequest {
180    pub args: SetChannelArgs,
181}
182
183impl fidl::Persistable for WlantapPhySetChannelRequest {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186#[repr(C)]
187pub struct WlantapPhySetCountryRequest {
188    pub args: SetCountryArgs,
189}
190
191impl fidl::Persistable for WlantapPhySetCountryRequest {}
192
193#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
194pub struct WlantapPhySetKeyRequest {
195    pub args: SetKeyArgs,
196}
197
198impl fidl::Persistable for WlantapPhySetKeyRequest {}
199
200#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
201#[repr(C)]
202pub struct WlantapPhyStartScanRequest {
203    pub args: StartScanArgs,
204}
205
206impl fidl::Persistable for WlantapPhyStartScanRequest {}
207
208#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct WlantapPhyTxRequest {
210    pub args: TxArgs,
211}
212
213impl fidl::Persistable for WlantapPhyTxRequest {}
214
215mod internal {
216    use super::*;
217
218    impl fidl::encoding::ValueTypeMarker for JoinBssArgs {
219        type Borrowed<'a> = &'a Self;
220        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
221            value
222        }
223    }
224
225    unsafe impl fidl::encoding::TypeMarker for JoinBssArgs {
226        type Owned = Self;
227
228        #[inline(always)]
229        fn inline_align(_context: fidl::encoding::Context) -> usize {
230            8
231        }
232
233        #[inline(always)]
234        fn inline_size(_context: fidl::encoding::Context) -> usize {
235            24
236        }
237    }
238
239    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssArgs, D>
240        for &JoinBssArgs
241    {
242        #[inline]
243        unsafe fn encode(
244            self,
245            encoder: &mut fidl::encoding::Encoder<'_, D>,
246            offset: usize,
247            _depth: fidl::encoding::Depth,
248        ) -> fidl::Result<()> {
249            encoder.debug_check_bounds::<JoinBssArgs>(offset);
250            // Delegate to tuple encoding.
251            fidl::encoding::Encode::<JoinBssArgs, D>::encode(
252                (
253                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
254                    <fidl_fuchsia_wlan_common__common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
255                ),
256                encoder, offset, _depth
257            )
258        }
259    }
260    unsafe impl<
261            D: fidl::encoding::ResourceDialect,
262            T0: fidl::encoding::Encode<u16, D>,
263            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::JoinBssRequest, D>,
264        > fidl::encoding::Encode<JoinBssArgs, D> for (T0, T1)
265    {
266        #[inline]
267        unsafe fn encode(
268            self,
269            encoder: &mut fidl::encoding::Encoder<'_, D>,
270            offset: usize,
271            depth: fidl::encoding::Depth,
272        ) -> fidl::Result<()> {
273            encoder.debug_check_bounds::<JoinBssArgs>(offset);
274            // Zero out padding regions. There's no need to apply masks
275            // because the unmasked parts will be overwritten by fields.
276            unsafe {
277                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
278                (ptr as *mut u64).write_unaligned(0);
279            }
280            // Write the fields.
281            self.0.encode(encoder, offset + 0, depth)?;
282            self.1.encode(encoder, offset + 8, depth)?;
283            Ok(())
284        }
285    }
286
287    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssArgs {
288        #[inline(always)]
289        fn new_empty() -> Self {
290            Self {
291                wlan_softmac_id: fidl::new_empty!(u16, D),
292                config: fidl::new_empty!(fidl_fuchsia_wlan_common__common::JoinBssRequest, D),
293            }
294        }
295
296        #[inline]
297        unsafe fn decode(
298            &mut self,
299            decoder: &mut fidl::encoding::Decoder<'_, D>,
300            offset: usize,
301            _depth: fidl::encoding::Depth,
302        ) -> fidl::Result<()> {
303            decoder.debug_check_bounds::<Self>(offset);
304            // Verify that padding bytes are zero.
305            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
306            let padval = unsafe { (ptr as *const u64).read_unaligned() };
307            let mask = 0xffffffffffff0000u64;
308            let maskedval = padval & mask;
309            if maskedval != 0 {
310                return Err(fidl::Error::NonZeroPadding {
311                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
312                });
313            }
314            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
315            fidl::decode!(
316                fidl_fuchsia_wlan_common__common::JoinBssRequest,
317                D,
318                &mut self.config,
319                decoder,
320                offset + 8,
321                _depth
322            )?;
323            Ok(())
324        }
325    }
326
327    impl fidl::encoding::ValueTypeMarker for SetChannelArgs {
328        type Borrowed<'a> = &'a Self;
329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
330            value
331        }
332    }
333
334    unsafe impl fidl::encoding::TypeMarker for SetChannelArgs {
335        type Owned = Self;
336
337        #[inline(always)]
338        fn inline_align(_context: fidl::encoding::Context) -> usize {
339            4
340        }
341
342        #[inline(always)]
343        fn inline_size(_context: fidl::encoding::Context) -> usize {
344            16
345        }
346    }
347
348    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetChannelArgs, D>
349        for &SetChannelArgs
350    {
351        #[inline]
352        unsafe fn encode(
353            self,
354            encoder: &mut fidl::encoding::Encoder<'_, D>,
355            offset: usize,
356            _depth: fidl::encoding::Depth,
357        ) -> fidl::Result<()> {
358            encoder.debug_check_bounds::<SetChannelArgs>(offset);
359            // Delegate to tuple encoding.
360            fidl::encoding::Encode::<SetChannelArgs, D>::encode(
361                (
362                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
363                    <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
364                ),
365                encoder, offset, _depth
366            )
367        }
368    }
369    unsafe impl<
370            D: fidl::encoding::ResourceDialect,
371            T0: fidl::encoding::Encode<u16, D>,
372            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanChannel, D>,
373        > fidl::encoding::Encode<SetChannelArgs, D> for (T0, T1)
374    {
375        #[inline]
376        unsafe fn encode(
377            self,
378            encoder: &mut fidl::encoding::Encoder<'_, D>,
379            offset: usize,
380            depth: fidl::encoding::Depth,
381        ) -> fidl::Result<()> {
382            encoder.debug_check_bounds::<SetChannelArgs>(offset);
383            // Zero out padding regions. There's no need to apply masks
384            // because the unmasked parts will be overwritten by fields.
385            unsafe {
386                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
387                (ptr as *mut u32).write_unaligned(0);
388            }
389            // Write the fields.
390            self.0.encode(encoder, offset + 0, depth)?;
391            self.1.encode(encoder, offset + 4, depth)?;
392            Ok(())
393        }
394    }
395
396    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetChannelArgs {
397        #[inline(always)]
398        fn new_empty() -> Self {
399            Self {
400                wlan_softmac_id: fidl::new_empty!(u16, D),
401                channel: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D),
402            }
403        }
404
405        #[inline]
406        unsafe fn decode(
407            &mut self,
408            decoder: &mut fidl::encoding::Decoder<'_, D>,
409            offset: usize,
410            _depth: fidl::encoding::Depth,
411        ) -> fidl::Result<()> {
412            decoder.debug_check_bounds::<Self>(offset);
413            // Verify that padding bytes are zero.
414            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
415            let padval = unsafe { (ptr as *const u32).read_unaligned() };
416            let mask = 0xffff0000u32;
417            let maskedval = padval & mask;
418            if maskedval != 0 {
419                return Err(fidl::Error::NonZeroPadding {
420                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
421                });
422            }
423            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
424            fidl::decode!(
425                fidl_fuchsia_wlan_common__common::WlanChannel,
426                D,
427                &mut self.channel,
428                decoder,
429                offset + 4,
430                _depth
431            )?;
432            Ok(())
433        }
434    }
435
436    impl fidl::encoding::ValueTypeMarker for SetCountryArgs {
437        type Borrowed<'a> = &'a Self;
438        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
439            value
440        }
441    }
442
443    unsafe impl fidl::encoding::TypeMarker for SetCountryArgs {
444        type Owned = Self;
445
446        #[inline(always)]
447        fn inline_align(_context: fidl::encoding::Context) -> usize {
448            1
449        }
450
451        #[inline(always)]
452        fn inline_size(_context: fidl::encoding::Context) -> usize {
453            2
454        }
455        #[inline(always)]
456        fn encode_is_copy() -> bool {
457            true
458        }
459
460        #[inline(always)]
461        fn decode_is_copy() -> bool {
462            true
463        }
464    }
465
466    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryArgs, D>
467        for &SetCountryArgs
468    {
469        #[inline]
470        unsafe fn encode(
471            self,
472            encoder: &mut fidl::encoding::Encoder<'_, D>,
473            offset: usize,
474            _depth: fidl::encoding::Depth,
475        ) -> fidl::Result<()> {
476            encoder.debug_check_bounds::<SetCountryArgs>(offset);
477            unsafe {
478                // Copy the object into the buffer.
479                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
480                (buf_ptr as *mut SetCountryArgs)
481                    .write_unaligned((self as *const SetCountryArgs).read());
482                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
483                // done second because the memcpy will write garbage to these bytes.
484            }
485            Ok(())
486        }
487    }
488    unsafe impl<
489            D: fidl::encoding::ResourceDialect,
490            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
491        > fidl::encoding::Encode<SetCountryArgs, D> for (T0,)
492    {
493        #[inline]
494        unsafe fn encode(
495            self,
496            encoder: &mut fidl::encoding::Encoder<'_, D>,
497            offset: usize,
498            depth: fidl::encoding::Depth,
499        ) -> fidl::Result<()> {
500            encoder.debug_check_bounds::<SetCountryArgs>(offset);
501            // Zero out padding regions. There's no need to apply masks
502            // because the unmasked parts will be overwritten by fields.
503            // Write the fields.
504            self.0.encode(encoder, offset + 0, depth)?;
505            Ok(())
506        }
507    }
508
509    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryArgs {
510        #[inline(always)]
511        fn new_empty() -> Self {
512            Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
513        }
514
515        #[inline]
516        unsafe fn decode(
517            &mut self,
518            decoder: &mut fidl::encoding::Decoder<'_, D>,
519            offset: usize,
520            _depth: fidl::encoding::Depth,
521        ) -> fidl::Result<()> {
522            decoder.debug_check_bounds::<Self>(offset);
523            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
524            // Verify that padding bytes are zero.
525            // Copy from the buffer into the object.
526            unsafe {
527                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
528            }
529            Ok(())
530        }
531    }
532
533    impl fidl::encoding::ValueTypeMarker for SetKeyArgs {
534        type Borrowed<'a> = &'a Self;
535        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
536            value
537        }
538    }
539
540    unsafe impl fidl::encoding::TypeMarker for SetKeyArgs {
541        type Owned = Self;
542
543        #[inline(always)]
544        fn inline_align(_context: fidl::encoding::Context) -> usize {
545            8
546        }
547
548        #[inline(always)]
549        fn inline_size(_context: fidl::encoding::Context) -> usize {
550            40
551        }
552    }
553
554    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetKeyArgs, D>
555        for &SetKeyArgs
556    {
557        #[inline]
558        unsafe fn encode(
559            self,
560            encoder: &mut fidl::encoding::Encoder<'_, D>,
561            offset: usize,
562            _depth: fidl::encoding::Depth,
563        ) -> fidl::Result<()> {
564            encoder.debug_check_bounds::<SetKeyArgs>(offset);
565            // Delegate to tuple encoding.
566            fidl::encoding::Encode::<SetKeyArgs, D>::encode(
567                (
568                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
569                    <WlanKeyConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
570                ),
571                encoder,
572                offset,
573                _depth,
574            )
575        }
576    }
577    unsafe impl<
578            D: fidl::encoding::ResourceDialect,
579            T0: fidl::encoding::Encode<u16, D>,
580            T1: fidl::encoding::Encode<WlanKeyConfig, D>,
581        > fidl::encoding::Encode<SetKeyArgs, D> for (T0, T1)
582    {
583        #[inline]
584        unsafe fn encode(
585            self,
586            encoder: &mut fidl::encoding::Encoder<'_, D>,
587            offset: usize,
588            depth: fidl::encoding::Depth,
589        ) -> fidl::Result<()> {
590            encoder.debug_check_bounds::<SetKeyArgs>(offset);
591            // Zero out padding regions. There's no need to apply masks
592            // because the unmasked parts will be overwritten by fields.
593            unsafe {
594                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
595                (ptr as *mut u64).write_unaligned(0);
596            }
597            // Write the fields.
598            self.0.encode(encoder, offset + 0, depth)?;
599            self.1.encode(encoder, offset + 8, depth)?;
600            Ok(())
601        }
602    }
603
604    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetKeyArgs {
605        #[inline(always)]
606        fn new_empty() -> Self {
607            Self {
608                wlan_softmac_id: fidl::new_empty!(u16, D),
609                config: fidl::new_empty!(WlanKeyConfig, D),
610            }
611        }
612
613        #[inline]
614        unsafe fn decode(
615            &mut self,
616            decoder: &mut fidl::encoding::Decoder<'_, D>,
617            offset: usize,
618            _depth: fidl::encoding::Depth,
619        ) -> fidl::Result<()> {
620            decoder.debug_check_bounds::<Self>(offset);
621            // Verify that padding bytes are zero.
622            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
623            let padval = unsafe { (ptr as *const u64).read_unaligned() };
624            let mask = 0xffffffffffff0000u64;
625            let maskedval = padval & mask;
626            if maskedval != 0 {
627                return Err(fidl::Error::NonZeroPadding {
628                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
629                });
630            }
631            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
632            fidl::decode!(WlanKeyConfig, D, &mut self.config, decoder, offset + 8, _depth)?;
633            Ok(())
634        }
635    }
636
637    impl fidl::encoding::ValueTypeMarker for StartScanArgs {
638        type Borrowed<'a> = &'a Self;
639        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
640            value
641        }
642    }
643
644    unsafe impl fidl::encoding::TypeMarker for StartScanArgs {
645        type Owned = Self;
646
647        #[inline(always)]
648        fn inline_align(_context: fidl::encoding::Context) -> usize {
649            8
650        }
651
652        #[inline(always)]
653        fn inline_size(_context: fidl::encoding::Context) -> usize {
654            16
655        }
656    }
657
658    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartScanArgs, D>
659        for &StartScanArgs
660    {
661        #[inline]
662        unsafe fn encode(
663            self,
664            encoder: &mut fidl::encoding::Encoder<'_, D>,
665            offset: usize,
666            _depth: fidl::encoding::Depth,
667        ) -> fidl::Result<()> {
668            encoder.debug_check_bounds::<StartScanArgs>(offset);
669            unsafe {
670                // Copy the object into the buffer.
671                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
672                (buf_ptr as *mut StartScanArgs)
673                    .write_unaligned((self as *const StartScanArgs).read());
674                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
675                // done second because the memcpy will write garbage to these bytes.
676                let padding_ptr = buf_ptr.offset(0) as *mut u64;
677                let padding_mask = 0xffffffffffff0000u64;
678                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
679            }
680            Ok(())
681        }
682    }
683    unsafe impl<
684            D: fidl::encoding::ResourceDialect,
685            T0: fidl::encoding::Encode<u16, D>,
686            T1: fidl::encoding::Encode<u64, D>,
687        > fidl::encoding::Encode<StartScanArgs, D> for (T0, T1)
688    {
689        #[inline]
690        unsafe fn encode(
691            self,
692            encoder: &mut fidl::encoding::Encoder<'_, D>,
693            offset: usize,
694            depth: fidl::encoding::Depth,
695        ) -> fidl::Result<()> {
696            encoder.debug_check_bounds::<StartScanArgs>(offset);
697            // Zero out padding regions. There's no need to apply masks
698            // because the unmasked parts will be overwritten by fields.
699            unsafe {
700                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
701                (ptr as *mut u64).write_unaligned(0);
702            }
703            // Write the fields.
704            self.0.encode(encoder, offset + 0, depth)?;
705            self.1.encode(encoder, offset + 8, depth)?;
706            Ok(())
707        }
708    }
709
710    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartScanArgs {
711        #[inline(always)]
712        fn new_empty() -> Self {
713            Self { wlan_softmac_id: fidl::new_empty!(u16, D), scan_id: fidl::new_empty!(u64, D) }
714        }
715
716        #[inline]
717        unsafe fn decode(
718            &mut self,
719            decoder: &mut fidl::encoding::Decoder<'_, D>,
720            offset: usize,
721            _depth: fidl::encoding::Depth,
722        ) -> fidl::Result<()> {
723            decoder.debug_check_bounds::<Self>(offset);
724            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
725            // Verify that padding bytes are zero.
726            let ptr = unsafe { buf_ptr.offset(0) };
727            let padval = unsafe { (ptr as *const u64).read_unaligned() };
728            let mask = 0xffffffffffff0000u64;
729            let maskedval = padval & mask;
730            if maskedval != 0 {
731                return Err(fidl::Error::NonZeroPadding {
732                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
733                });
734            }
735            // Copy from the buffer into the object.
736            unsafe {
737                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
738            }
739            Ok(())
740        }
741    }
742
743    impl fidl::encoding::ValueTypeMarker for TxArgs {
744        type Borrowed<'a> = &'a Self;
745        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
746            value
747        }
748    }
749
750    unsafe impl fidl::encoding::TypeMarker for TxArgs {
751        type Owned = Self;
752
753        #[inline(always)]
754        fn inline_align(_context: fidl::encoding::Context) -> usize {
755            8
756        }
757
758        #[inline(always)]
759        fn inline_size(_context: fidl::encoding::Context) -> usize {
760            48
761        }
762    }
763
764    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TxArgs, D> for &TxArgs {
765        #[inline]
766        unsafe fn encode(
767            self,
768            encoder: &mut fidl::encoding::Encoder<'_, D>,
769            offset: usize,
770            _depth: fidl::encoding::Depth,
771        ) -> fidl::Result<()> {
772            encoder.debug_check_bounds::<TxArgs>(offset);
773            // Delegate to tuple encoding.
774            fidl::encoding::Encode::<TxArgs, D>::encode(
775                (
776                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
777                    <WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow(&self.packet),
778                ),
779                encoder,
780                offset,
781                _depth,
782            )
783        }
784    }
785    unsafe impl<
786            D: fidl::encoding::ResourceDialect,
787            T0: fidl::encoding::Encode<u16, D>,
788            T1: fidl::encoding::Encode<WlanTxPacket, D>,
789        > fidl::encoding::Encode<TxArgs, D> for (T0, T1)
790    {
791        #[inline]
792        unsafe fn encode(
793            self,
794            encoder: &mut fidl::encoding::Encoder<'_, D>,
795            offset: usize,
796            depth: fidl::encoding::Depth,
797        ) -> fidl::Result<()> {
798            encoder.debug_check_bounds::<TxArgs>(offset);
799            // Zero out padding regions. There's no need to apply masks
800            // because the unmasked parts will be overwritten by fields.
801            unsafe {
802                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
803                (ptr as *mut u64).write_unaligned(0);
804            }
805            // Write the fields.
806            self.0.encode(encoder, offset + 0, depth)?;
807            self.1.encode(encoder, offset + 8, depth)?;
808            Ok(())
809        }
810    }
811
812    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxArgs {
813        #[inline(always)]
814        fn new_empty() -> Self {
815            Self {
816                wlan_softmac_id: fidl::new_empty!(u16, D),
817                packet: fidl::new_empty!(WlanTxPacket, D),
818            }
819        }
820
821        #[inline]
822        unsafe fn decode(
823            &mut self,
824            decoder: &mut fidl::encoding::Decoder<'_, D>,
825            offset: usize,
826            _depth: fidl::encoding::Depth,
827        ) -> fidl::Result<()> {
828            decoder.debug_check_bounds::<Self>(offset);
829            // Verify that padding bytes are zero.
830            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
831            let padval = unsafe { (ptr as *const u64).read_unaligned() };
832            let mask = 0xffffffffffff0000u64;
833            let maskedval = padval & mask;
834            if maskedval != 0 {
835                return Err(fidl::Error::NonZeroPadding {
836                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
837                });
838            }
839            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
840            fidl::decode!(WlanTxPacket, D, &mut self.packet, decoder, offset + 8, _depth)?;
841            Ok(())
842        }
843    }
844
845    impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
846        type Borrowed<'a> = &'a Self;
847        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
848            value
849        }
850    }
851
852    unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
853        type Owned = Self;
854
855        #[inline(always)]
856        fn inline_align(_context: fidl::encoding::Context) -> usize {
857            8
858        }
859
860        #[inline(always)]
861        fn inline_size(_context: fidl::encoding::Context) -> usize {
862            32
863        }
864    }
865
866    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
867        for &WlanKeyConfig
868    {
869        #[inline]
870        unsafe fn encode(
871            self,
872            encoder: &mut fidl::encoding::Encoder<'_, D>,
873            offset: usize,
874            _depth: fidl::encoding::Depth,
875        ) -> fidl::Result<()> {
876            encoder.debug_check_bounds::<WlanKeyConfig>(offset);
877            // Delegate to tuple encoding.
878            fidl::encoding::Encode::<WlanKeyConfig, D>::encode(
879                (
880                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.protection),
881                    <fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow(
882                        &self.cipher_oui,
883                    ),
884                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cipher_type),
885                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_type),
886                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(
887                        &self.peer_addr,
888                    ),
889                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_idx),
890                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
891                        &self.key,
892                    ),
893                ),
894                encoder,
895                offset,
896                _depth,
897            )
898        }
899    }
900    unsafe impl<
901            D: fidl::encoding::ResourceDialect,
902            T0: fidl::encoding::Encode<u8, D>,
903            T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 3>, D>,
904            T2: fidl::encoding::Encode<u8, D>,
905            T3: fidl::encoding::Encode<u8, D>,
906            T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
907            T5: fidl::encoding::Encode<u8, D>,
908            T6: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
909        > fidl::encoding::Encode<WlanKeyConfig, D> for (T0, T1, T2, T3, T4, T5, T6)
910    {
911        #[inline]
912        unsafe fn encode(
913            self,
914            encoder: &mut fidl::encoding::Encoder<'_, D>,
915            offset: usize,
916            depth: fidl::encoding::Depth,
917        ) -> fidl::Result<()> {
918            encoder.debug_check_bounds::<WlanKeyConfig>(offset);
919            // Zero out padding regions. There's no need to apply masks
920            // because the unmasked parts will be overwritten by fields.
921            unsafe {
922                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
923                (ptr as *mut u64).write_unaligned(0);
924            }
925            // Write the fields.
926            self.0.encode(encoder, offset + 0, depth)?;
927            self.1.encode(encoder, offset + 1, depth)?;
928            self.2.encode(encoder, offset + 4, depth)?;
929            self.3.encode(encoder, offset + 5, depth)?;
930            self.4.encode(encoder, offset + 6, depth)?;
931            self.5.encode(encoder, offset + 12, depth)?;
932            self.6.encode(encoder, offset + 16, depth)?;
933            Ok(())
934        }
935    }
936
937    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
938        #[inline(always)]
939        fn new_empty() -> Self {
940            Self {
941                protection: fidl::new_empty!(u8, D),
942                cipher_oui: fidl::new_empty!(fidl::encoding::Array<u8, 3>, D),
943                cipher_type: fidl::new_empty!(u8, D),
944                key_type: fidl::new_empty!(u8, D),
945                peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
946                key_idx: fidl::new_empty!(u8, D),
947                key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
948            }
949        }
950
951        #[inline]
952        unsafe fn decode(
953            &mut self,
954            decoder: &mut fidl::encoding::Decoder<'_, D>,
955            offset: usize,
956            _depth: fidl::encoding::Depth,
957        ) -> fidl::Result<()> {
958            decoder.debug_check_bounds::<Self>(offset);
959            // Verify that padding bytes are zero.
960            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
961            let padval = unsafe { (ptr as *const u64).read_unaligned() };
962            let mask = 0xffffff0000000000u64;
963            let maskedval = padval & mask;
964            if maskedval != 0 {
965                return Err(fidl::Error::NonZeroPadding {
966                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
967                });
968            }
969            fidl::decode!(u8, D, &mut self.protection, decoder, offset + 0, _depth)?;
970            fidl::decode!(fidl::encoding::Array<u8, 3>, D, &mut self.cipher_oui, decoder, offset + 1, _depth)?;
971            fidl::decode!(u8, D, &mut self.cipher_type, decoder, offset + 4, _depth)?;
972            fidl::decode!(u8, D, &mut self.key_type, decoder, offset + 5, _depth)?;
973            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 6, _depth)?;
974            fidl::decode!(u8, D, &mut self.key_idx, decoder, offset + 12, _depth)?;
975            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key, decoder, offset + 16, _depth)?;
976            Ok(())
977        }
978    }
979
980    impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
981        type Borrowed<'a> = &'a Self;
982        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
983            value
984        }
985    }
986
987    unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
988        type Owned = Self;
989
990        #[inline(always)]
991        fn inline_align(_context: fidl::encoding::Context) -> usize {
992            4
993        }
994
995        #[inline(always)]
996        fn inline_size(_context: fidl::encoding::Context) -> usize {
997            32
998        }
999    }
1000
1001    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
1002        for &WlanRxInfo
1003    {
1004        #[inline]
1005        unsafe fn encode(
1006            self,
1007            encoder: &mut fidl::encoding::Encoder<'_, D>,
1008            offset: usize,
1009            _depth: fidl::encoding::Depth,
1010        ) -> fidl::Result<()> {
1011            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1012            // Delegate to tuple encoding.
1013            fidl::encoding::Encode::<WlanRxInfo, D>::encode(
1014                (
1015                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
1016                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1017                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1018                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1019                    <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1020                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1021                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1022                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
1023                ),
1024                encoder, offset, _depth
1025            )
1026        }
1027    }
1028    unsafe impl<
1029            D: fidl::encoding::ResourceDialect,
1030            T0: fidl::encoding::Encode<u32, D>,
1031            T1: fidl::encoding::Encode<u32, D>,
1032            T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1033            T3: fidl::encoding::Encode<u32, D>,
1034            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanChannel, D>,
1035            T5: fidl::encoding::Encode<u8, D>,
1036            T6: fidl::encoding::Encode<i8, D>,
1037            T7: fidl::encoding::Encode<i16, D>,
1038        > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1039    {
1040        #[inline]
1041        unsafe fn encode(
1042            self,
1043            encoder: &mut fidl::encoding::Encoder<'_, D>,
1044            offset: usize,
1045            depth: fidl::encoding::Depth,
1046        ) -> fidl::Result<()> {
1047            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1048            // Zero out padding regions. There's no need to apply masks
1049            // because the unmasked parts will be overwritten by fields.
1050            // Write the fields.
1051            self.0.encode(encoder, offset + 0, depth)?;
1052            self.1.encode(encoder, offset + 4, depth)?;
1053            self.2.encode(encoder, offset + 8, depth)?;
1054            self.3.encode(encoder, offset + 12, depth)?;
1055            self.4.encode(encoder, offset + 16, depth)?;
1056            self.5.encode(encoder, offset + 28, depth)?;
1057            self.6.encode(encoder, offset + 29, depth)?;
1058            self.7.encode(encoder, offset + 30, depth)?;
1059            Ok(())
1060        }
1061    }
1062
1063    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
1064        #[inline(always)]
1065        fn new_empty() -> Self {
1066            Self {
1067                rx_flags: fidl::new_empty!(u32, D),
1068                valid_fields: fidl::new_empty!(u32, D),
1069                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1070                data_rate: fidl::new_empty!(u32, D),
1071                channel: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D),
1072                mcs: fidl::new_empty!(u8, D),
1073                rssi_dbm: fidl::new_empty!(i8, D),
1074                snr_dbh: fidl::new_empty!(i16, D),
1075            }
1076        }
1077
1078        #[inline]
1079        unsafe fn decode(
1080            &mut self,
1081            decoder: &mut fidl::encoding::Decoder<'_, D>,
1082            offset: usize,
1083            _depth: fidl::encoding::Depth,
1084        ) -> fidl::Result<()> {
1085            decoder.debug_check_bounds::<Self>(offset);
1086            // Verify that padding bytes are zero.
1087            fidl::decode!(u32, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
1088            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1089            fidl::decode!(
1090                fidl_fuchsia_wlan_common__common::WlanPhyType,
1091                D,
1092                &mut self.phy,
1093                decoder,
1094                offset + 8,
1095                _depth
1096            )?;
1097            fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
1098            fidl::decode!(
1099                fidl_fuchsia_wlan_common__common::WlanChannel,
1100                D,
1101                &mut self.channel,
1102                decoder,
1103                offset + 16,
1104                _depth
1105            )?;
1106            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
1107            fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
1108            fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
1109            Ok(())
1110        }
1111    }
1112
1113    impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
1114        type Borrowed<'a> = &'a Self;
1115        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1116            value
1117        }
1118    }
1119
1120    unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
1121        type Owned = Self;
1122
1123        #[inline(always)]
1124        fn inline_align(_context: fidl::encoding::Context) -> usize {
1125            4
1126        }
1127
1128        #[inline(always)]
1129        fn inline_size(_context: fidl::encoding::Context) -> usize {
1130            20
1131        }
1132    }
1133
1134    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
1135        for &WlanTxInfo
1136    {
1137        #[inline]
1138        unsafe fn encode(
1139            self,
1140            encoder: &mut fidl::encoding::Encoder<'_, D>,
1141            offset: usize,
1142            _depth: fidl::encoding::Depth,
1143        ) -> fidl::Result<()> {
1144            encoder.debug_check_bounds::<WlanTxInfo>(offset);
1145            // Delegate to tuple encoding.
1146            fidl::encoding::Encode::<WlanTxInfo, D>::encode(
1147                (
1148                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
1149                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1150                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
1151                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1152                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
1153                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1154                ),
1155                encoder, offset, _depth
1156            )
1157        }
1158    }
1159    unsafe impl<
1160            D: fidl::encoding::ResourceDialect,
1161            T0: fidl::encoding::Encode<u32, D>,
1162            T1: fidl::encoding::Encode<u32, D>,
1163            T2: fidl::encoding::Encode<u16, D>,
1164            T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1165            T4: fidl::encoding::Encode<u8, D>,
1166            T5: fidl::encoding::Encode<u8, D>,
1167        > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
1168    {
1169        #[inline]
1170        unsafe fn encode(
1171            self,
1172            encoder: &mut fidl::encoding::Encoder<'_, D>,
1173            offset: usize,
1174            depth: fidl::encoding::Depth,
1175        ) -> fidl::Result<()> {
1176            encoder.debug_check_bounds::<WlanTxInfo>(offset);
1177            // Zero out padding regions. There's no need to apply masks
1178            // because the unmasked parts will be overwritten by fields.
1179            unsafe {
1180                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1181                (ptr as *mut u32).write_unaligned(0);
1182            }
1183            unsafe {
1184                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1185                (ptr as *mut u32).write_unaligned(0);
1186            }
1187            // Write the fields.
1188            self.0.encode(encoder, offset + 0, depth)?;
1189            self.1.encode(encoder, offset + 4, depth)?;
1190            self.2.encode(encoder, offset + 8, depth)?;
1191            self.3.encode(encoder, offset + 12, depth)?;
1192            self.4.encode(encoder, offset + 16, depth)?;
1193            self.5.encode(encoder, offset + 17, depth)?;
1194            Ok(())
1195        }
1196    }
1197
1198    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
1199        #[inline(always)]
1200        fn new_empty() -> Self {
1201            Self {
1202                tx_flags: fidl::new_empty!(u32, D),
1203                valid_fields: fidl::new_empty!(u32, D),
1204                tx_vector_idx: fidl::new_empty!(u16, D),
1205                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1206                cbw: fidl::new_empty!(u8, D),
1207                mcs: fidl::new_empty!(u8, D),
1208            }
1209        }
1210
1211        #[inline]
1212        unsafe fn decode(
1213            &mut self,
1214            decoder: &mut fidl::encoding::Decoder<'_, D>,
1215            offset: usize,
1216            _depth: fidl::encoding::Depth,
1217        ) -> fidl::Result<()> {
1218            decoder.debug_check_bounds::<Self>(offset);
1219            // Verify that padding bytes are zero.
1220            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1221            let padval = unsafe { (ptr as *const u32).read_unaligned() };
1222            let mask = 0xffff0000u32;
1223            let maskedval = padval & mask;
1224            if maskedval != 0 {
1225                return Err(fidl::Error::NonZeroPadding {
1226                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1227                });
1228            }
1229            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1230            let padval = unsafe { (ptr as *const u32).read_unaligned() };
1231            let mask = 0xffff0000u32;
1232            let maskedval = padval & mask;
1233            if maskedval != 0 {
1234                return Err(fidl::Error::NonZeroPadding {
1235                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1236                });
1237            }
1238            fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
1239            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1240            fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
1241            fidl::decode!(
1242                fidl_fuchsia_wlan_common__common::WlanPhyType,
1243                D,
1244                &mut self.phy,
1245                decoder,
1246                offset + 12,
1247                _depth
1248            )?;
1249            fidl::decode!(u8, D, &mut self.cbw, decoder, offset + 16, _depth)?;
1250            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 17, _depth)?;
1251            Ok(())
1252        }
1253    }
1254
1255    impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
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 WlanTxPacket {
1263        type Owned = Self;
1264
1265        #[inline(always)]
1266        fn inline_align(_context: fidl::encoding::Context) -> usize {
1267            8
1268        }
1269
1270        #[inline(always)]
1271        fn inline_size(_context: fidl::encoding::Context) -> usize {
1272            40
1273        }
1274    }
1275
1276    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
1277        for &WlanTxPacket
1278    {
1279        #[inline]
1280        unsafe fn encode(
1281            self,
1282            encoder: &mut fidl::encoding::Encoder<'_, D>,
1283            offset: usize,
1284            _depth: fidl::encoding::Depth,
1285        ) -> fidl::Result<()> {
1286            encoder.debug_check_bounds::<WlanTxPacket>(offset);
1287            // Delegate to tuple encoding.
1288            fidl::encoding::Encode::<WlanTxPacket, D>::encode(
1289                (
1290                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1291                    <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1292                ),
1293                encoder, offset, _depth
1294            )
1295        }
1296    }
1297    unsafe impl<
1298            D: fidl::encoding::ResourceDialect,
1299            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1300            T1: fidl::encoding::Encode<WlanTxInfo, D>,
1301        > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
1302    {
1303        #[inline]
1304        unsafe fn encode(
1305            self,
1306            encoder: &mut fidl::encoding::Encoder<'_, D>,
1307            offset: usize,
1308            depth: fidl::encoding::Depth,
1309        ) -> fidl::Result<()> {
1310            encoder.debug_check_bounds::<WlanTxPacket>(offset);
1311            // Zero out padding regions. There's no need to apply masks
1312            // because the unmasked parts will be overwritten by fields.
1313            unsafe {
1314                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
1315                (ptr as *mut u64).write_unaligned(0);
1316            }
1317            // Write the fields.
1318            self.0.encode(encoder, offset + 0, depth)?;
1319            self.1.encode(encoder, offset + 16, depth)?;
1320            Ok(())
1321        }
1322    }
1323
1324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
1325        #[inline(always)]
1326        fn new_empty() -> Self {
1327            Self {
1328                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1329                info: fidl::new_empty!(WlanTxInfo, D),
1330            }
1331        }
1332
1333        #[inline]
1334        unsafe fn decode(
1335            &mut self,
1336            decoder: &mut fidl::encoding::Decoder<'_, D>,
1337            offset: usize,
1338            _depth: fidl::encoding::Depth,
1339        ) -> fidl::Result<()> {
1340            decoder.debug_check_bounds::<Self>(offset);
1341            // Verify that padding bytes are zero.
1342            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1343            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1344            let mask = 0xffffffff00000000u64;
1345            let maskedval = padval & mask;
1346            if maskedval != 0 {
1347                return Err(fidl::Error::NonZeroPadding {
1348                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1349                });
1350            }
1351            fidl::decode!(
1352                fidl::encoding::UnboundedVector<u8>,
1353                D,
1354                &mut self.data,
1355                decoder,
1356                offset + 0,
1357                _depth
1358            )?;
1359            fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1360            Ok(())
1361        }
1362    }
1363
1364    impl fidl::encoding::ValueTypeMarker for WlantapCtlCreatePhyResponse {
1365        type Borrowed<'a> = &'a Self;
1366        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1367            value
1368        }
1369    }
1370
1371    unsafe impl fidl::encoding::TypeMarker for WlantapCtlCreatePhyResponse {
1372        type Owned = Self;
1373
1374        #[inline(always)]
1375        fn inline_align(_context: fidl::encoding::Context) -> usize {
1376            4
1377        }
1378
1379        #[inline(always)]
1380        fn inline_size(_context: fidl::encoding::Context) -> usize {
1381            4
1382        }
1383        #[inline(always)]
1384        fn encode_is_copy() -> bool {
1385            true
1386        }
1387
1388        #[inline(always)]
1389        fn decode_is_copy() -> bool {
1390            true
1391        }
1392    }
1393
1394    unsafe impl<D: fidl::encoding::ResourceDialect>
1395        fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for &WlantapCtlCreatePhyResponse
1396    {
1397        #[inline]
1398        unsafe fn encode(
1399            self,
1400            encoder: &mut fidl::encoding::Encoder<'_, D>,
1401            offset: usize,
1402            _depth: fidl::encoding::Depth,
1403        ) -> fidl::Result<()> {
1404            encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
1405            unsafe {
1406                // Copy the object into the buffer.
1407                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1408                (buf_ptr as *mut WlantapCtlCreatePhyResponse)
1409                    .write_unaligned((self as *const WlantapCtlCreatePhyResponse).read());
1410                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1411                // done second because the memcpy will write garbage to these bytes.
1412            }
1413            Ok(())
1414        }
1415    }
1416    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1417        fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for (T0,)
1418    {
1419        #[inline]
1420        unsafe fn encode(
1421            self,
1422            encoder: &mut fidl::encoding::Encoder<'_, D>,
1423            offset: usize,
1424            depth: fidl::encoding::Depth,
1425        ) -> fidl::Result<()> {
1426            encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
1427            // Zero out padding regions. There's no need to apply masks
1428            // because the unmasked parts will be overwritten by fields.
1429            // Write the fields.
1430            self.0.encode(encoder, offset + 0, depth)?;
1431            Ok(())
1432        }
1433    }
1434
1435    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1436        for WlantapCtlCreatePhyResponse
1437    {
1438        #[inline(always)]
1439        fn new_empty() -> Self {
1440            Self { status: fidl::new_empty!(i32, D) }
1441        }
1442
1443        #[inline]
1444        unsafe fn decode(
1445            &mut self,
1446            decoder: &mut fidl::encoding::Decoder<'_, D>,
1447            offset: usize,
1448            _depth: fidl::encoding::Depth,
1449        ) -> fidl::Result<()> {
1450            decoder.debug_check_bounds::<Self>(offset);
1451            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1452            // Verify that padding bytes are zero.
1453            // Copy from the buffer into the object.
1454            unsafe {
1455                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1456            }
1457            Ok(())
1458        }
1459    }
1460
1461    impl fidl::encoding::ValueTypeMarker for WlantapPhyConfig {
1462        type Borrowed<'a> = &'a Self;
1463        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1464            value
1465        }
1466    }
1467
1468    unsafe impl fidl::encoding::TypeMarker for WlantapPhyConfig {
1469        type Owned = Self;
1470
1471        #[inline(always)]
1472        fn inline_align(_context: fidl::encoding::Context) -> usize {
1473            8
1474        }
1475
1476        #[inline(always)]
1477        fn inline_size(_context: fidl::encoding::Context) -> usize {
1478            88
1479        }
1480    }
1481
1482    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyConfig, D>
1483        for &WlantapPhyConfig
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::<WlantapPhyConfig>(offset);
1493            // Delegate to tuple encoding.
1494            fidl::encoding::Encode::<WlantapPhyConfig, D>::encode(
1495                (
1496                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
1497                    <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_role),
1498                    <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_phys),
1499                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.hardware_capability),
1500                    <fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bands),
1501                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1502                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.quiet),
1503                    <fidl_fuchsia_wlan_softmac__common::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.discovery_support),
1504                    <fidl_fuchsia_wlan_common__common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_sublayer_support),
1505                    <fidl_fuchsia_wlan_common__common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.security_support),
1506                    <fidl_fuchsia_wlan_common__common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.spectrum_management_support),
1507                ),
1508                encoder, offset, _depth
1509            )
1510        }
1511    }
1512    unsafe impl<
1513            D: fidl::encoding::ResourceDialect,
1514            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
1515            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanMacRole, D>,
1516            T2: fidl::encoding::Encode<
1517                fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>,
1518                D,
1519            >,
1520            T3: fidl::encoding::Encode<u32, D>,
1521            T4: fidl::encoding::Encode<
1522                fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>,
1523                D,
1524            >,
1525            T5: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
1526            T6: fidl::encoding::Encode<bool, D>,
1527            T7: fidl::encoding::Encode<fidl_fuchsia_wlan_softmac__common::DiscoverySupport, D>,
1528            T8: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::MacSublayerSupport, D>,
1529            T9: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SecuritySupport, D>,
1530            T10: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SpectrumManagementSupport, D>,
1531        > fidl::encoding::Encode<WlantapPhyConfig, D>
1532        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
1533    {
1534        #[inline]
1535        unsafe fn encode(
1536            self,
1537            encoder: &mut fidl::encoding::Encoder<'_, D>,
1538            offset: usize,
1539            depth: fidl::encoding::Depth,
1540        ) -> fidl::Result<()> {
1541            encoder.debug_check_bounds::<WlantapPhyConfig>(offset);
1542            // Zero out padding regions. There's no need to apply masks
1543            // because the unmasked parts will be overwritten by fields.
1544            unsafe {
1545                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1546                (ptr as *mut u64).write_unaligned(0);
1547            }
1548            unsafe {
1549                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1550                (ptr as *mut u64).write_unaligned(0);
1551            }
1552            unsafe {
1553                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
1554                (ptr as *mut u64).write_unaligned(0);
1555            }
1556            unsafe {
1557                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
1558                (ptr as *mut u64).write_unaligned(0);
1559            }
1560            // Write the fields.
1561            self.0.encode(encoder, offset + 0, depth)?;
1562            self.1.encode(encoder, offset + 8, depth)?;
1563            self.2.encode(encoder, offset + 16, depth)?;
1564            self.3.encode(encoder, offset + 32, depth)?;
1565            self.4.encode(encoder, offset + 40, depth)?;
1566            self.5.encode(encoder, offset + 56, depth)?;
1567            self.6.encode(encoder, offset + 72, depth)?;
1568            self.7.encode(encoder, offset + 73, depth)?;
1569            self.8.encode(encoder, offset + 76, depth)?;
1570            self.9.encode(encoder, offset + 81, depth)?;
1571            self.10.encode(encoder, offset + 84, depth)?;
1572            Ok(())
1573        }
1574    }
1575
1576    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyConfig {
1577        #[inline(always)]
1578        fn new_empty() -> Self {
1579            Self {
1580                sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
1581                mac_role: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D),
1582                supported_phys: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D),
1583                hardware_capability: fidl::new_empty!(u32, D),
1584                bands: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>, D),
1585                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
1586                quiet: fidl::new_empty!(bool, D),
1587                discovery_support: fidl::new_empty!(
1588                    fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
1589                    D
1590                ),
1591                mac_sublayer_support: fidl::new_empty!(
1592                    fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1593                    D
1594                ),
1595                security_support: fidl::new_empty!(
1596                    fidl_fuchsia_wlan_common__common::SecuritySupport,
1597                    D
1598                ),
1599                spectrum_management_support: fidl::new_empty!(
1600                    fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1601                    D
1602                ),
1603            }
1604        }
1605
1606        #[inline]
1607        unsafe fn decode(
1608            &mut self,
1609            decoder: &mut fidl::encoding::Decoder<'_, D>,
1610            offset: usize,
1611            _depth: fidl::encoding::Depth,
1612        ) -> fidl::Result<()> {
1613            decoder.debug_check_bounds::<Self>(offset);
1614            // Verify that padding bytes are zero.
1615            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1616            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1617            let mask = 0xffff000000000000u64;
1618            let maskedval = padval & mask;
1619            if maskedval != 0 {
1620                return Err(fidl::Error::NonZeroPadding {
1621                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1622                });
1623            }
1624            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1625            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1626            let mask = 0xffffffff00000000u64;
1627            let maskedval = padval & mask;
1628            if maskedval != 0 {
1629                return Err(fidl::Error::NonZeroPadding {
1630                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1631                });
1632            }
1633            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1634            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1635            let mask = 0xffffffff00000000u64;
1636            let maskedval = padval & mask;
1637            if maskedval != 0 {
1638                return Err(fidl::Error::NonZeroPadding {
1639                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1640                });
1641            }
1642            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
1643            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1644            let mask = 0xffffff0000000000u64;
1645            let maskedval = padval & mask;
1646            if maskedval != 0 {
1647                return Err(fidl::Error::NonZeroPadding {
1648                    padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
1649                });
1650            }
1651            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 0, _depth)?;
1652            fidl::decode!(
1653                fidl_fuchsia_wlan_common__common::WlanMacRole,
1654                D,
1655                &mut self.mac_role,
1656                decoder,
1657                offset + 8,
1658                _depth
1659            )?;
1660            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, &mut self.supported_phys, decoder, offset + 16, _depth)?;
1661            fidl::decode!(u32, D, &mut self.hardware_capability, decoder, offset + 32, _depth)?;
1662            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>, D, &mut self.bands, decoder, offset + 40, _depth)?;
1663            fidl::decode!(
1664                fidl::encoding::BoundedString<32>,
1665                D,
1666                &mut self.name,
1667                decoder,
1668                offset + 56,
1669                _depth
1670            )?;
1671            fidl::decode!(bool, D, &mut self.quiet, decoder, offset + 72, _depth)?;
1672            fidl::decode!(
1673                fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
1674                D,
1675                &mut self.discovery_support,
1676                decoder,
1677                offset + 73,
1678                _depth
1679            )?;
1680            fidl::decode!(
1681                fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1682                D,
1683                &mut self.mac_sublayer_support,
1684                decoder,
1685                offset + 76,
1686                _depth
1687            )?;
1688            fidl::decode!(
1689                fidl_fuchsia_wlan_common__common::SecuritySupport,
1690                D,
1691                &mut self.security_support,
1692                decoder,
1693                offset + 81,
1694                _depth
1695            )?;
1696            fidl::decode!(
1697                fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1698                D,
1699                &mut self.spectrum_management_support,
1700                decoder,
1701                offset + 84,
1702                _depth
1703            )?;
1704            Ok(())
1705        }
1706    }
1707
1708    impl fidl::encoding::ValueTypeMarker for WlantapPhyJoinBssRequest {
1709        type Borrowed<'a> = &'a Self;
1710        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1711            value
1712        }
1713    }
1714
1715    unsafe impl fidl::encoding::TypeMarker for WlantapPhyJoinBssRequest {
1716        type Owned = Self;
1717
1718        #[inline(always)]
1719        fn inline_align(_context: fidl::encoding::Context) -> usize {
1720            8
1721        }
1722
1723        #[inline(always)]
1724        fn inline_size(_context: fidl::encoding::Context) -> usize {
1725            24
1726        }
1727    }
1728
1729    unsafe impl<D: fidl::encoding::ResourceDialect>
1730        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for &WlantapPhyJoinBssRequest
1731    {
1732        #[inline]
1733        unsafe fn encode(
1734            self,
1735            encoder: &mut fidl::encoding::Encoder<'_, D>,
1736            offset: usize,
1737            _depth: fidl::encoding::Depth,
1738        ) -> fidl::Result<()> {
1739            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1740            // Delegate to tuple encoding.
1741            fidl::encoding::Encode::<WlantapPhyJoinBssRequest, D>::encode(
1742                (<JoinBssArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
1743                encoder,
1744                offset,
1745                _depth,
1746            )
1747        }
1748    }
1749    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<JoinBssArgs, D>>
1750        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for (T0,)
1751    {
1752        #[inline]
1753        unsafe fn encode(
1754            self,
1755            encoder: &mut fidl::encoding::Encoder<'_, D>,
1756            offset: usize,
1757            depth: fidl::encoding::Depth,
1758        ) -> fidl::Result<()> {
1759            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1760            // Zero out padding regions. There's no need to apply masks
1761            // because the unmasked parts will be overwritten by fields.
1762            // Write the fields.
1763            self.0.encode(encoder, offset + 0, depth)?;
1764            Ok(())
1765        }
1766    }
1767
1768    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1769        for WlantapPhyJoinBssRequest
1770    {
1771        #[inline(always)]
1772        fn new_empty() -> Self {
1773            Self { args: fidl::new_empty!(JoinBssArgs, D) }
1774        }
1775
1776        #[inline]
1777        unsafe fn decode(
1778            &mut self,
1779            decoder: &mut fidl::encoding::Decoder<'_, D>,
1780            offset: usize,
1781            _depth: fidl::encoding::Depth,
1782        ) -> fidl::Result<()> {
1783            decoder.debug_check_bounds::<Self>(offset);
1784            // Verify that padding bytes are zero.
1785            fidl::decode!(JoinBssArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
1786            Ok(())
1787        }
1788    }
1789
1790    impl fidl::encoding::ValueTypeMarker for WlantapPhyReportTxResultRequest {
1791        type Borrowed<'a> = &'a Self;
1792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1793            value
1794        }
1795    }
1796
1797    unsafe impl fidl::encoding::TypeMarker for WlantapPhyReportTxResultRequest {
1798        type Owned = Self;
1799
1800        #[inline(always)]
1801        fn inline_align(_context: fidl::encoding::Context) -> usize {
1802            2
1803        }
1804
1805        #[inline(always)]
1806        fn inline_size(_context: fidl::encoding::Context) -> usize {
1807            40
1808        }
1809    }
1810
1811    unsafe impl<D: fidl::encoding::ResourceDialect>
1812        fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D>
1813        for &WlantapPhyReportTxResultRequest
1814    {
1815        #[inline]
1816        unsafe fn encode(
1817            self,
1818            encoder: &mut fidl::encoding::Encoder<'_, D>,
1819            offset: usize,
1820            _depth: fidl::encoding::Depth,
1821        ) -> fidl::Result<()> {
1822            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1823            // Delegate to tuple encoding.
1824            fidl::encoding::Encode::<WlantapPhyReportTxResultRequest, D>::encode(
1825                (
1826                    <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.txr),
1827                ),
1828                encoder, offset, _depth
1829            )
1830        }
1831    }
1832    unsafe impl<
1833            D: fidl::encoding::ResourceDialect,
1834            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
1835        > fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D> for (T0,)
1836    {
1837        #[inline]
1838        unsafe fn encode(
1839            self,
1840            encoder: &mut fidl::encoding::Encoder<'_, D>,
1841            offset: usize,
1842            depth: fidl::encoding::Depth,
1843        ) -> fidl::Result<()> {
1844            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1845            // Zero out padding regions. There's no need to apply masks
1846            // because the unmasked parts will be overwritten by fields.
1847            // Write the fields.
1848            self.0.encode(encoder, offset + 0, depth)?;
1849            Ok(())
1850        }
1851    }
1852
1853    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1854        for WlantapPhyReportTxResultRequest
1855    {
1856        #[inline(always)]
1857        fn new_empty() -> Self {
1858            Self { txr: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
1859        }
1860
1861        #[inline]
1862        unsafe fn decode(
1863            &mut self,
1864            decoder: &mut fidl::encoding::Decoder<'_, D>,
1865            offset: usize,
1866            _depth: fidl::encoding::Depth,
1867        ) -> fidl::Result<()> {
1868            decoder.debug_check_bounds::<Self>(offset);
1869            // Verify that padding bytes are zero.
1870            fidl::decode!(
1871                fidl_fuchsia_wlan_common__common::WlanTxResult,
1872                D,
1873                &mut self.txr,
1874                decoder,
1875                offset + 0,
1876                _depth
1877            )?;
1878            Ok(())
1879        }
1880    }
1881
1882    impl fidl::encoding::ValueTypeMarker for WlantapPhyRxRequest {
1883        type Borrowed<'a> = &'a Self;
1884        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1885            value
1886        }
1887    }
1888
1889    unsafe impl fidl::encoding::TypeMarker for WlantapPhyRxRequest {
1890        type Owned = Self;
1891
1892        #[inline(always)]
1893        fn inline_align(_context: fidl::encoding::Context) -> usize {
1894            8
1895        }
1896
1897        #[inline(always)]
1898        fn inline_size(_context: fidl::encoding::Context) -> usize {
1899            48
1900        }
1901    }
1902
1903    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyRxRequest, D>
1904        for &WlantapPhyRxRequest
1905    {
1906        #[inline]
1907        unsafe fn encode(
1908            self,
1909            encoder: &mut fidl::encoding::Encoder<'_, D>,
1910            offset: usize,
1911            _depth: fidl::encoding::Depth,
1912        ) -> fidl::Result<()> {
1913            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1914            // Delegate to tuple encoding.
1915            fidl::encoding::Encode::<WlantapPhyRxRequest, D>::encode(
1916                (
1917                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1918                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1919                ),
1920                encoder, offset, _depth
1921            )
1922        }
1923    }
1924    unsafe impl<
1925            D: fidl::encoding::ResourceDialect,
1926            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1927            T1: fidl::encoding::Encode<WlanRxInfo, D>,
1928        > fidl::encoding::Encode<WlantapPhyRxRequest, D> for (T0, T1)
1929    {
1930        #[inline]
1931        unsafe fn encode(
1932            self,
1933            encoder: &mut fidl::encoding::Encoder<'_, D>,
1934            offset: usize,
1935            depth: fidl::encoding::Depth,
1936        ) -> fidl::Result<()> {
1937            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1938            // Zero out padding regions. There's no need to apply masks
1939            // because the unmasked parts will be overwritten by fields.
1940            // Write the fields.
1941            self.0.encode(encoder, offset + 0, depth)?;
1942            self.1.encode(encoder, offset + 16, depth)?;
1943            Ok(())
1944        }
1945    }
1946
1947    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyRxRequest {
1948        #[inline(always)]
1949        fn new_empty() -> Self {
1950            Self {
1951                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1952                info: fidl::new_empty!(WlanRxInfo, D),
1953            }
1954        }
1955
1956        #[inline]
1957        unsafe fn decode(
1958            &mut self,
1959            decoder: &mut fidl::encoding::Decoder<'_, D>,
1960            offset: usize,
1961            _depth: fidl::encoding::Depth,
1962        ) -> fidl::Result<()> {
1963            decoder.debug_check_bounds::<Self>(offset);
1964            // Verify that padding bytes are zero.
1965            fidl::decode!(
1966                fidl::encoding::UnboundedVector<u8>,
1967                D,
1968                &mut self.data,
1969                decoder,
1970                offset + 0,
1971                _depth
1972            )?;
1973            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1974            Ok(())
1975        }
1976    }
1977
1978    impl fidl::encoding::ValueTypeMarker for WlantapPhyScanCompleteRequest {
1979        type Borrowed<'a> = &'a Self;
1980        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1981            value
1982        }
1983    }
1984
1985    unsafe impl fidl::encoding::TypeMarker for WlantapPhyScanCompleteRequest {
1986        type Owned = Self;
1987
1988        #[inline(always)]
1989        fn inline_align(_context: fidl::encoding::Context) -> usize {
1990            8
1991        }
1992
1993        #[inline(always)]
1994        fn inline_size(_context: fidl::encoding::Context) -> usize {
1995            16
1996        }
1997    }
1998
1999    unsafe impl<D: fidl::encoding::ResourceDialect>
2000        fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D>
2001        for &WlantapPhyScanCompleteRequest
2002    {
2003        #[inline]
2004        unsafe fn encode(
2005            self,
2006            encoder: &mut fidl::encoding::Encoder<'_, D>,
2007            offset: usize,
2008            _depth: fidl::encoding::Depth,
2009        ) -> fidl::Result<()> {
2010            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2011            unsafe {
2012                // Copy the object into the buffer.
2013                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2014                (buf_ptr as *mut WlantapPhyScanCompleteRequest)
2015                    .write_unaligned((self as *const WlantapPhyScanCompleteRequest).read());
2016                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2017                // done second because the memcpy will write garbage to these bytes.
2018                let padding_ptr = buf_ptr.offset(8) as *mut u64;
2019                let padding_mask = 0xffffffff00000000u64;
2020                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2021            }
2022            Ok(())
2023        }
2024    }
2025    unsafe impl<
2026            D: fidl::encoding::ResourceDialect,
2027            T0: fidl::encoding::Encode<u64, D>,
2028            T1: fidl::encoding::Encode<i32, D>,
2029        > fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D> for (T0, T1)
2030    {
2031        #[inline]
2032        unsafe fn encode(
2033            self,
2034            encoder: &mut fidl::encoding::Encoder<'_, D>,
2035            offset: usize,
2036            depth: fidl::encoding::Depth,
2037        ) -> fidl::Result<()> {
2038            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2039            // Zero out padding regions. There's no need to apply masks
2040            // because the unmasked parts will be overwritten by fields.
2041            unsafe {
2042                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2043                (ptr as *mut u64).write_unaligned(0);
2044            }
2045            // Write the fields.
2046            self.0.encode(encoder, offset + 0, depth)?;
2047            self.1.encode(encoder, offset + 8, depth)?;
2048            Ok(())
2049        }
2050    }
2051
2052    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2053        for WlantapPhyScanCompleteRequest
2054    {
2055        #[inline(always)]
2056        fn new_empty() -> Self {
2057            Self { scan_id: fidl::new_empty!(u64, D), status: fidl::new_empty!(i32, D) }
2058        }
2059
2060        #[inline]
2061        unsafe fn decode(
2062            &mut self,
2063            decoder: &mut fidl::encoding::Decoder<'_, D>,
2064            offset: usize,
2065            _depth: fidl::encoding::Depth,
2066        ) -> fidl::Result<()> {
2067            decoder.debug_check_bounds::<Self>(offset);
2068            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2069            // Verify that padding bytes are zero.
2070            let ptr = unsafe { buf_ptr.offset(8) };
2071            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2072            let mask = 0xffffffff00000000u64;
2073            let maskedval = padval & mask;
2074            if maskedval != 0 {
2075                return Err(fidl::Error::NonZeroPadding {
2076                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2077                });
2078            }
2079            // Copy from the buffer into the object.
2080            unsafe {
2081                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2082            }
2083            Ok(())
2084        }
2085    }
2086
2087    impl fidl::encoding::ValueTypeMarker for WlantapPhySetChannelRequest {
2088        type Borrowed<'a> = &'a Self;
2089        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2090            value
2091        }
2092    }
2093
2094    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetChannelRequest {
2095        type Owned = Self;
2096
2097        #[inline(always)]
2098        fn inline_align(_context: fidl::encoding::Context) -> usize {
2099            4
2100        }
2101
2102        #[inline(always)]
2103        fn inline_size(_context: fidl::encoding::Context) -> usize {
2104            16
2105        }
2106    }
2107
2108    unsafe impl<D: fidl::encoding::ResourceDialect>
2109        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for &WlantapPhySetChannelRequest
2110    {
2111        #[inline]
2112        unsafe fn encode(
2113            self,
2114            encoder: &mut fidl::encoding::Encoder<'_, D>,
2115            offset: usize,
2116            _depth: fidl::encoding::Depth,
2117        ) -> fidl::Result<()> {
2118            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2119            // Delegate to tuple encoding.
2120            fidl::encoding::Encode::<WlantapPhySetChannelRequest, D>::encode(
2121                (<SetChannelArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2122                encoder,
2123                offset,
2124                _depth,
2125            )
2126        }
2127    }
2128    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetChannelArgs, D>>
2129        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for (T0,)
2130    {
2131        #[inline]
2132        unsafe fn encode(
2133            self,
2134            encoder: &mut fidl::encoding::Encoder<'_, D>,
2135            offset: usize,
2136            depth: fidl::encoding::Depth,
2137        ) -> fidl::Result<()> {
2138            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2139            // Zero out padding regions. There's no need to apply masks
2140            // because the unmasked parts will be overwritten by fields.
2141            // Write the fields.
2142            self.0.encode(encoder, offset + 0, depth)?;
2143            Ok(())
2144        }
2145    }
2146
2147    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2148        for WlantapPhySetChannelRequest
2149    {
2150        #[inline(always)]
2151        fn new_empty() -> Self {
2152            Self { args: fidl::new_empty!(SetChannelArgs, D) }
2153        }
2154
2155        #[inline]
2156        unsafe fn decode(
2157            &mut self,
2158            decoder: &mut fidl::encoding::Decoder<'_, D>,
2159            offset: usize,
2160            _depth: fidl::encoding::Depth,
2161        ) -> fidl::Result<()> {
2162            decoder.debug_check_bounds::<Self>(offset);
2163            // Verify that padding bytes are zero.
2164            fidl::decode!(SetChannelArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2165            Ok(())
2166        }
2167    }
2168
2169    impl fidl::encoding::ValueTypeMarker for WlantapPhySetCountryRequest {
2170        type Borrowed<'a> = &'a Self;
2171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2172            value
2173        }
2174    }
2175
2176    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetCountryRequest {
2177        type Owned = Self;
2178
2179        #[inline(always)]
2180        fn inline_align(_context: fidl::encoding::Context) -> usize {
2181            1
2182        }
2183
2184        #[inline(always)]
2185        fn inline_size(_context: fidl::encoding::Context) -> usize {
2186            2
2187        }
2188        #[inline(always)]
2189        fn encode_is_copy() -> bool {
2190            true
2191        }
2192
2193        #[inline(always)]
2194        fn decode_is_copy() -> bool {
2195            true
2196        }
2197    }
2198
2199    unsafe impl<D: fidl::encoding::ResourceDialect>
2200        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for &WlantapPhySetCountryRequest
2201    {
2202        #[inline]
2203        unsafe fn encode(
2204            self,
2205            encoder: &mut fidl::encoding::Encoder<'_, D>,
2206            offset: usize,
2207            _depth: fidl::encoding::Depth,
2208        ) -> fidl::Result<()> {
2209            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2210            unsafe {
2211                // Copy the object into the buffer.
2212                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2213                (buf_ptr as *mut WlantapPhySetCountryRequest)
2214                    .write_unaligned((self as *const WlantapPhySetCountryRequest).read());
2215                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2216                // done second because the memcpy will write garbage to these bytes.
2217            }
2218            Ok(())
2219        }
2220    }
2221    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryArgs, D>>
2222        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for (T0,)
2223    {
2224        #[inline]
2225        unsafe fn encode(
2226            self,
2227            encoder: &mut fidl::encoding::Encoder<'_, D>,
2228            offset: usize,
2229            depth: fidl::encoding::Depth,
2230        ) -> fidl::Result<()> {
2231            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2232            // Zero out padding regions. There's no need to apply masks
2233            // because the unmasked parts will be overwritten by fields.
2234            // Write the fields.
2235            self.0.encode(encoder, offset + 0, depth)?;
2236            Ok(())
2237        }
2238    }
2239
2240    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2241        for WlantapPhySetCountryRequest
2242    {
2243        #[inline(always)]
2244        fn new_empty() -> Self {
2245            Self { args: fidl::new_empty!(SetCountryArgs, D) }
2246        }
2247
2248        #[inline]
2249        unsafe fn decode(
2250            &mut self,
2251            decoder: &mut fidl::encoding::Decoder<'_, D>,
2252            offset: usize,
2253            _depth: fidl::encoding::Depth,
2254        ) -> fidl::Result<()> {
2255            decoder.debug_check_bounds::<Self>(offset);
2256            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2257            // Verify that padding bytes are zero.
2258            // Copy from the buffer into the object.
2259            unsafe {
2260                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2261            }
2262            Ok(())
2263        }
2264    }
2265
2266    impl fidl::encoding::ValueTypeMarker for WlantapPhySetKeyRequest {
2267        type Borrowed<'a> = &'a Self;
2268        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2269            value
2270        }
2271    }
2272
2273    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetKeyRequest {
2274        type Owned = Self;
2275
2276        #[inline(always)]
2277        fn inline_align(_context: fidl::encoding::Context) -> usize {
2278            8
2279        }
2280
2281        #[inline(always)]
2282        fn inline_size(_context: fidl::encoding::Context) -> usize {
2283            40
2284        }
2285    }
2286
2287    unsafe impl<D: fidl::encoding::ResourceDialect>
2288        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for &WlantapPhySetKeyRequest
2289    {
2290        #[inline]
2291        unsafe fn encode(
2292            self,
2293            encoder: &mut fidl::encoding::Encoder<'_, D>,
2294            offset: usize,
2295            _depth: fidl::encoding::Depth,
2296        ) -> fidl::Result<()> {
2297            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2298            // Delegate to tuple encoding.
2299            fidl::encoding::Encode::<WlantapPhySetKeyRequest, D>::encode(
2300                (<SetKeyArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2301                encoder,
2302                offset,
2303                _depth,
2304            )
2305        }
2306    }
2307    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetKeyArgs, D>>
2308        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for (T0,)
2309    {
2310        #[inline]
2311        unsafe fn encode(
2312            self,
2313            encoder: &mut fidl::encoding::Encoder<'_, D>,
2314            offset: usize,
2315            depth: fidl::encoding::Depth,
2316        ) -> fidl::Result<()> {
2317            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2318            // Zero out padding regions. There's no need to apply masks
2319            // because the unmasked parts will be overwritten by fields.
2320            // Write the fields.
2321            self.0.encode(encoder, offset + 0, depth)?;
2322            Ok(())
2323        }
2324    }
2325
2326    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2327        for WlantapPhySetKeyRequest
2328    {
2329        #[inline(always)]
2330        fn new_empty() -> Self {
2331            Self { args: fidl::new_empty!(SetKeyArgs, D) }
2332        }
2333
2334        #[inline]
2335        unsafe fn decode(
2336            &mut self,
2337            decoder: &mut fidl::encoding::Decoder<'_, D>,
2338            offset: usize,
2339            _depth: fidl::encoding::Depth,
2340        ) -> fidl::Result<()> {
2341            decoder.debug_check_bounds::<Self>(offset);
2342            // Verify that padding bytes are zero.
2343            fidl::decode!(SetKeyArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2344            Ok(())
2345        }
2346    }
2347
2348    impl fidl::encoding::ValueTypeMarker for WlantapPhyStartScanRequest {
2349        type Borrowed<'a> = &'a Self;
2350        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2351            value
2352        }
2353    }
2354
2355    unsafe impl fidl::encoding::TypeMarker for WlantapPhyStartScanRequest {
2356        type Owned = Self;
2357
2358        #[inline(always)]
2359        fn inline_align(_context: fidl::encoding::Context) -> usize {
2360            8
2361        }
2362
2363        #[inline(always)]
2364        fn inline_size(_context: fidl::encoding::Context) -> usize {
2365            16
2366        }
2367    }
2368
2369    unsafe impl<D: fidl::encoding::ResourceDialect>
2370        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for &WlantapPhyStartScanRequest
2371    {
2372        #[inline]
2373        unsafe fn encode(
2374            self,
2375            encoder: &mut fidl::encoding::Encoder<'_, D>,
2376            offset: usize,
2377            _depth: fidl::encoding::Depth,
2378        ) -> fidl::Result<()> {
2379            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2380            unsafe {
2381                // Copy the object into the buffer.
2382                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2383                (buf_ptr as *mut WlantapPhyStartScanRequest)
2384                    .write_unaligned((self as *const WlantapPhyStartScanRequest).read());
2385                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2386                // done second because the memcpy will write garbage to these bytes.
2387                let padding_ptr = buf_ptr.offset(0) as *mut u64;
2388                let padding_mask = 0xffffffffffff0000u64;
2389                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2390            }
2391            Ok(())
2392        }
2393    }
2394    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartScanArgs, D>>
2395        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for (T0,)
2396    {
2397        #[inline]
2398        unsafe fn encode(
2399            self,
2400            encoder: &mut fidl::encoding::Encoder<'_, D>,
2401            offset: usize,
2402            depth: fidl::encoding::Depth,
2403        ) -> fidl::Result<()> {
2404            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2405            // Zero out padding regions. There's no need to apply masks
2406            // because the unmasked parts will be overwritten by fields.
2407            // Write the fields.
2408            self.0.encode(encoder, offset + 0, depth)?;
2409            Ok(())
2410        }
2411    }
2412
2413    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2414        for WlantapPhyStartScanRequest
2415    {
2416        #[inline(always)]
2417        fn new_empty() -> Self {
2418            Self { args: fidl::new_empty!(StartScanArgs, D) }
2419        }
2420
2421        #[inline]
2422        unsafe fn decode(
2423            &mut self,
2424            decoder: &mut fidl::encoding::Decoder<'_, D>,
2425            offset: usize,
2426            _depth: fidl::encoding::Depth,
2427        ) -> fidl::Result<()> {
2428            decoder.debug_check_bounds::<Self>(offset);
2429            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2430            // Verify that padding bytes are zero.
2431            let ptr = unsafe { buf_ptr.offset(0) };
2432            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2433            let mask = 0xffffffffffff0000u64;
2434            let maskedval = padval & mask;
2435            if maskedval != 0 {
2436                return Err(fidl::Error::NonZeroPadding {
2437                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2438                });
2439            }
2440            // Copy from the buffer into the object.
2441            unsafe {
2442                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2443            }
2444            Ok(())
2445        }
2446    }
2447
2448    impl fidl::encoding::ValueTypeMarker for WlantapPhyTxRequest {
2449        type Borrowed<'a> = &'a Self;
2450        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2451            value
2452        }
2453    }
2454
2455    unsafe impl fidl::encoding::TypeMarker for WlantapPhyTxRequest {
2456        type Owned = Self;
2457
2458        #[inline(always)]
2459        fn inline_align(_context: fidl::encoding::Context) -> usize {
2460            8
2461        }
2462
2463        #[inline(always)]
2464        fn inline_size(_context: fidl::encoding::Context) -> usize {
2465            48
2466        }
2467    }
2468
2469    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyTxRequest, D>
2470        for &WlantapPhyTxRequest
2471    {
2472        #[inline]
2473        unsafe fn encode(
2474            self,
2475            encoder: &mut fidl::encoding::Encoder<'_, D>,
2476            offset: usize,
2477            _depth: fidl::encoding::Depth,
2478        ) -> fidl::Result<()> {
2479            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2480            // Delegate to tuple encoding.
2481            fidl::encoding::Encode::<WlantapPhyTxRequest, D>::encode(
2482                (<TxArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2483                encoder,
2484                offset,
2485                _depth,
2486            )
2487        }
2488    }
2489    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TxArgs, D>>
2490        fidl::encoding::Encode<WlantapPhyTxRequest, D> for (T0,)
2491    {
2492        #[inline]
2493        unsafe fn encode(
2494            self,
2495            encoder: &mut fidl::encoding::Encoder<'_, D>,
2496            offset: usize,
2497            depth: fidl::encoding::Depth,
2498        ) -> fidl::Result<()> {
2499            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2500            // Zero out padding regions. There's no need to apply masks
2501            // because the unmasked parts will be overwritten by fields.
2502            // Write the fields.
2503            self.0.encode(encoder, offset + 0, depth)?;
2504            Ok(())
2505        }
2506    }
2507
2508    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyTxRequest {
2509        #[inline(always)]
2510        fn new_empty() -> Self {
2511            Self { args: fidl::new_empty!(TxArgs, D) }
2512        }
2513
2514        #[inline]
2515        unsafe fn decode(
2516            &mut self,
2517            decoder: &mut fidl::encoding::Decoder<'_, D>,
2518            offset: usize,
2519            _depth: fidl::encoding::Depth,
2520        ) -> fidl::Result<()> {
2521            decoder.debug_check_bounds::<Self>(offset);
2522            // Verify that padding bytes are zero.
2523            fidl::decode!(TxArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2524            Ok(())
2525        }
2526    }
2527}