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::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::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::WlanPhyType,
87    pub data_rate: u32,
88    pub channel: fidl_fuchsia_wlan_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::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::WlanMacRole,
134    pub supported_phys: Vec<fidl_fuchsia_wlan_common::WlanPhyType>,
135    pub hardware_capability: u32,
136    pub bands: Vec<fidl_fuchsia_wlan_device::BandInfo>,
137    pub name: String,
138    pub quiet: bool,
139    pub discovery_support: fidl_fuchsia_wlan_softmac::DiscoverySupport,
140    pub mac_sublayer_support: fidl_fuchsia_wlan_common::MacSublayerSupport,
141    pub security_support: fidl_fuchsia_wlan_common::SecuritySupport,
142    pub spectrum_management_support: fidl_fuchsia_wlan_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::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::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::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::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::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::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::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::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::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::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1018                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1019                    <fidl_fuchsia_wlan_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::WlanPhyType, D>,
1033            T3: fidl::encoding::Encode<u32, D>,
1034            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_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::WlanPhyType, D),
1070                data_rate: fidl::new_empty!(u32, D),
1071                channel: fidl::new_empty!(fidl_fuchsia_wlan_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::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::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::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::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::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::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::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_role),
1498                    <fidl::encoding::Vector<fidl_fuchsia_wlan_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::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::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.discovery_support),
1504                    <fidl_fuchsia_wlan_common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_sublayer_support),
1505                    <fidl_fuchsia_wlan_common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.security_support),
1506                    <fidl_fuchsia_wlan_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::WlanMacRole, D>,
1516            T2: fidl::encoding::Encode<
1517                fidl::encoding::Vector<fidl_fuchsia_wlan_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::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::DiscoverySupport, D>,
1528            T8: fidl::encoding::Encode<fidl_fuchsia_wlan_common::MacSublayerSupport, D>,
1529            T9: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SecuritySupport, D>,
1530            T10: fidl::encoding::Encode<fidl_fuchsia_wlan_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::WlanMacRole, D),
1582                supported_phys: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D),
1583                hardware_capability: fidl::new_empty!(u32, D),
1584                bands: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_device::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!(fidl_fuchsia_wlan_softmac::DiscoverySupport, D),
1588                mac_sublayer_support: fidl::new_empty!(
1589                    fidl_fuchsia_wlan_common::MacSublayerSupport,
1590                    D
1591                ),
1592                security_support: fidl::new_empty!(fidl_fuchsia_wlan_common::SecuritySupport, D),
1593                spectrum_management_support: fidl::new_empty!(
1594                    fidl_fuchsia_wlan_common::SpectrumManagementSupport,
1595                    D
1596                ),
1597            }
1598        }
1599
1600        #[inline]
1601        unsafe fn decode(
1602            &mut self,
1603            decoder: &mut fidl::encoding::Decoder<'_, D>,
1604            offset: usize,
1605            _depth: fidl::encoding::Depth,
1606        ) -> fidl::Result<()> {
1607            decoder.debug_check_bounds::<Self>(offset);
1608            // Verify that padding bytes are zero.
1609            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1610            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1611            let mask = 0xffff000000000000u64;
1612            let maskedval = padval & mask;
1613            if maskedval != 0 {
1614                return Err(fidl::Error::NonZeroPadding {
1615                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1616                });
1617            }
1618            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1619            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1620            let mask = 0xffffffff00000000u64;
1621            let maskedval = padval & mask;
1622            if maskedval != 0 {
1623                return Err(fidl::Error::NonZeroPadding {
1624                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1625                });
1626            }
1627            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1628            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1629            let mask = 0xffffffff00000000u64;
1630            let maskedval = padval & mask;
1631            if maskedval != 0 {
1632                return Err(fidl::Error::NonZeroPadding {
1633                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1634                });
1635            }
1636            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
1637            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1638            let mask = 0xffffff0000000000u64;
1639            let maskedval = padval & mask;
1640            if maskedval != 0 {
1641                return Err(fidl::Error::NonZeroPadding {
1642                    padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
1643                });
1644            }
1645            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 0, _depth)?;
1646            fidl::decode!(
1647                fidl_fuchsia_wlan_common::WlanMacRole,
1648                D,
1649                &mut self.mac_role,
1650                decoder,
1651                offset + 8,
1652                _depth
1653            )?;
1654            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D, &mut self.supported_phys, decoder, offset + 16, _depth)?;
1655            fidl::decode!(u32, D, &mut self.hardware_capability, decoder, offset + 32, _depth)?;
1656            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_device::BandInfo, 8>, D, &mut self.bands, decoder, offset + 40, _depth)?;
1657            fidl::decode!(
1658                fidl::encoding::BoundedString<32>,
1659                D,
1660                &mut self.name,
1661                decoder,
1662                offset + 56,
1663                _depth
1664            )?;
1665            fidl::decode!(bool, D, &mut self.quiet, decoder, offset + 72, _depth)?;
1666            fidl::decode!(
1667                fidl_fuchsia_wlan_softmac::DiscoverySupport,
1668                D,
1669                &mut self.discovery_support,
1670                decoder,
1671                offset + 73,
1672                _depth
1673            )?;
1674            fidl::decode!(
1675                fidl_fuchsia_wlan_common::MacSublayerSupport,
1676                D,
1677                &mut self.mac_sublayer_support,
1678                decoder,
1679                offset + 76,
1680                _depth
1681            )?;
1682            fidl::decode!(
1683                fidl_fuchsia_wlan_common::SecuritySupport,
1684                D,
1685                &mut self.security_support,
1686                decoder,
1687                offset + 81,
1688                _depth
1689            )?;
1690            fidl::decode!(
1691                fidl_fuchsia_wlan_common::SpectrumManagementSupport,
1692                D,
1693                &mut self.spectrum_management_support,
1694                decoder,
1695                offset + 84,
1696                _depth
1697            )?;
1698            Ok(())
1699        }
1700    }
1701
1702    impl fidl::encoding::ValueTypeMarker for WlantapPhyJoinBssRequest {
1703        type Borrowed<'a> = &'a Self;
1704        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1705            value
1706        }
1707    }
1708
1709    unsafe impl fidl::encoding::TypeMarker for WlantapPhyJoinBssRequest {
1710        type Owned = Self;
1711
1712        #[inline(always)]
1713        fn inline_align(_context: fidl::encoding::Context) -> usize {
1714            8
1715        }
1716
1717        #[inline(always)]
1718        fn inline_size(_context: fidl::encoding::Context) -> usize {
1719            24
1720        }
1721    }
1722
1723    unsafe impl<D: fidl::encoding::ResourceDialect>
1724        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for &WlantapPhyJoinBssRequest
1725    {
1726        #[inline]
1727        unsafe fn encode(
1728            self,
1729            encoder: &mut fidl::encoding::Encoder<'_, D>,
1730            offset: usize,
1731            _depth: fidl::encoding::Depth,
1732        ) -> fidl::Result<()> {
1733            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1734            // Delegate to tuple encoding.
1735            fidl::encoding::Encode::<WlantapPhyJoinBssRequest, D>::encode(
1736                (<JoinBssArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
1737                encoder,
1738                offset,
1739                _depth,
1740            )
1741        }
1742    }
1743    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<JoinBssArgs, D>>
1744        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for (T0,)
1745    {
1746        #[inline]
1747        unsafe fn encode(
1748            self,
1749            encoder: &mut fidl::encoding::Encoder<'_, D>,
1750            offset: usize,
1751            depth: fidl::encoding::Depth,
1752        ) -> fidl::Result<()> {
1753            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1754            // Zero out padding regions. There's no need to apply masks
1755            // because the unmasked parts will be overwritten by fields.
1756            // Write the fields.
1757            self.0.encode(encoder, offset + 0, depth)?;
1758            Ok(())
1759        }
1760    }
1761
1762    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1763        for WlantapPhyJoinBssRequest
1764    {
1765        #[inline(always)]
1766        fn new_empty() -> Self {
1767            Self { args: fidl::new_empty!(JoinBssArgs, D) }
1768        }
1769
1770        #[inline]
1771        unsafe fn decode(
1772            &mut self,
1773            decoder: &mut fidl::encoding::Decoder<'_, D>,
1774            offset: usize,
1775            _depth: fidl::encoding::Depth,
1776        ) -> fidl::Result<()> {
1777            decoder.debug_check_bounds::<Self>(offset);
1778            // Verify that padding bytes are zero.
1779            fidl::decode!(JoinBssArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
1780            Ok(())
1781        }
1782    }
1783
1784    impl fidl::encoding::ValueTypeMarker for WlantapPhyReportTxResultRequest {
1785        type Borrowed<'a> = &'a Self;
1786        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1787            value
1788        }
1789    }
1790
1791    unsafe impl fidl::encoding::TypeMarker for WlantapPhyReportTxResultRequest {
1792        type Owned = Self;
1793
1794        #[inline(always)]
1795        fn inline_align(_context: fidl::encoding::Context) -> usize {
1796            2
1797        }
1798
1799        #[inline(always)]
1800        fn inline_size(_context: fidl::encoding::Context) -> usize {
1801            40
1802        }
1803    }
1804
1805    unsafe impl<D: fidl::encoding::ResourceDialect>
1806        fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D>
1807        for &WlantapPhyReportTxResultRequest
1808    {
1809        #[inline]
1810        unsafe fn encode(
1811            self,
1812            encoder: &mut fidl::encoding::Encoder<'_, D>,
1813            offset: usize,
1814            _depth: fidl::encoding::Depth,
1815        ) -> fidl::Result<()> {
1816            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1817            // Delegate to tuple encoding.
1818            fidl::encoding::Encode::<WlantapPhyReportTxResultRequest, D>::encode(
1819                (
1820                    <fidl_fuchsia_wlan_common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.txr),
1821                ),
1822                encoder, offset, _depth
1823            )
1824        }
1825    }
1826    unsafe impl<
1827            D: fidl::encoding::ResourceDialect,
1828            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanTxResult, D>,
1829        > fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D> for (T0,)
1830    {
1831        #[inline]
1832        unsafe fn encode(
1833            self,
1834            encoder: &mut fidl::encoding::Encoder<'_, D>,
1835            offset: usize,
1836            depth: fidl::encoding::Depth,
1837        ) -> fidl::Result<()> {
1838            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1839            // Zero out padding regions. There's no need to apply masks
1840            // because the unmasked parts will be overwritten by fields.
1841            // Write the fields.
1842            self.0.encode(encoder, offset + 0, depth)?;
1843            Ok(())
1844        }
1845    }
1846
1847    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1848        for WlantapPhyReportTxResultRequest
1849    {
1850        #[inline(always)]
1851        fn new_empty() -> Self {
1852            Self { txr: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanTxResult, D) }
1853        }
1854
1855        #[inline]
1856        unsafe fn decode(
1857            &mut self,
1858            decoder: &mut fidl::encoding::Decoder<'_, D>,
1859            offset: usize,
1860            _depth: fidl::encoding::Depth,
1861        ) -> fidl::Result<()> {
1862            decoder.debug_check_bounds::<Self>(offset);
1863            // Verify that padding bytes are zero.
1864            fidl::decode!(
1865                fidl_fuchsia_wlan_common::WlanTxResult,
1866                D,
1867                &mut self.txr,
1868                decoder,
1869                offset + 0,
1870                _depth
1871            )?;
1872            Ok(())
1873        }
1874    }
1875
1876    impl fidl::encoding::ValueTypeMarker for WlantapPhyRxRequest {
1877        type Borrowed<'a> = &'a Self;
1878        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1879            value
1880        }
1881    }
1882
1883    unsafe impl fidl::encoding::TypeMarker for WlantapPhyRxRequest {
1884        type Owned = Self;
1885
1886        #[inline(always)]
1887        fn inline_align(_context: fidl::encoding::Context) -> usize {
1888            8
1889        }
1890
1891        #[inline(always)]
1892        fn inline_size(_context: fidl::encoding::Context) -> usize {
1893            48
1894        }
1895    }
1896
1897    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyRxRequest, D>
1898        for &WlantapPhyRxRequest
1899    {
1900        #[inline]
1901        unsafe fn encode(
1902            self,
1903            encoder: &mut fidl::encoding::Encoder<'_, D>,
1904            offset: usize,
1905            _depth: fidl::encoding::Depth,
1906        ) -> fidl::Result<()> {
1907            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1908            // Delegate to tuple encoding.
1909            fidl::encoding::Encode::<WlantapPhyRxRequest, D>::encode(
1910                (
1911                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1912                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1913                ),
1914                encoder, offset, _depth
1915            )
1916        }
1917    }
1918    unsafe impl<
1919            D: fidl::encoding::ResourceDialect,
1920            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1921            T1: fidl::encoding::Encode<WlanRxInfo, D>,
1922        > fidl::encoding::Encode<WlantapPhyRxRequest, D> for (T0, T1)
1923    {
1924        #[inline]
1925        unsafe fn encode(
1926            self,
1927            encoder: &mut fidl::encoding::Encoder<'_, D>,
1928            offset: usize,
1929            depth: fidl::encoding::Depth,
1930        ) -> fidl::Result<()> {
1931            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1932            // Zero out padding regions. There's no need to apply masks
1933            // because the unmasked parts will be overwritten by fields.
1934            // Write the fields.
1935            self.0.encode(encoder, offset + 0, depth)?;
1936            self.1.encode(encoder, offset + 16, depth)?;
1937            Ok(())
1938        }
1939    }
1940
1941    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyRxRequest {
1942        #[inline(always)]
1943        fn new_empty() -> Self {
1944            Self {
1945                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1946                info: fidl::new_empty!(WlanRxInfo, D),
1947            }
1948        }
1949
1950        #[inline]
1951        unsafe fn decode(
1952            &mut self,
1953            decoder: &mut fidl::encoding::Decoder<'_, D>,
1954            offset: usize,
1955            _depth: fidl::encoding::Depth,
1956        ) -> fidl::Result<()> {
1957            decoder.debug_check_bounds::<Self>(offset);
1958            // Verify that padding bytes are zero.
1959            fidl::decode!(
1960                fidl::encoding::UnboundedVector<u8>,
1961                D,
1962                &mut self.data,
1963                decoder,
1964                offset + 0,
1965                _depth
1966            )?;
1967            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1968            Ok(())
1969        }
1970    }
1971
1972    impl fidl::encoding::ValueTypeMarker for WlantapPhyScanCompleteRequest {
1973        type Borrowed<'a> = &'a Self;
1974        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1975            value
1976        }
1977    }
1978
1979    unsafe impl fidl::encoding::TypeMarker for WlantapPhyScanCompleteRequest {
1980        type Owned = Self;
1981
1982        #[inline(always)]
1983        fn inline_align(_context: fidl::encoding::Context) -> usize {
1984            8
1985        }
1986
1987        #[inline(always)]
1988        fn inline_size(_context: fidl::encoding::Context) -> usize {
1989            16
1990        }
1991    }
1992
1993    unsafe impl<D: fidl::encoding::ResourceDialect>
1994        fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D>
1995        for &WlantapPhyScanCompleteRequest
1996    {
1997        #[inline]
1998        unsafe fn encode(
1999            self,
2000            encoder: &mut fidl::encoding::Encoder<'_, D>,
2001            offset: usize,
2002            _depth: fidl::encoding::Depth,
2003        ) -> fidl::Result<()> {
2004            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2005            unsafe {
2006                // Copy the object into the buffer.
2007                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2008                (buf_ptr as *mut WlantapPhyScanCompleteRequest)
2009                    .write_unaligned((self as *const WlantapPhyScanCompleteRequest).read());
2010                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2011                // done second because the memcpy will write garbage to these bytes.
2012                let padding_ptr = buf_ptr.offset(8) as *mut u64;
2013                let padding_mask = 0xffffffff00000000u64;
2014                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2015            }
2016            Ok(())
2017        }
2018    }
2019    unsafe impl<
2020            D: fidl::encoding::ResourceDialect,
2021            T0: fidl::encoding::Encode<u64, D>,
2022            T1: fidl::encoding::Encode<i32, D>,
2023        > fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D> for (T0, T1)
2024    {
2025        #[inline]
2026        unsafe fn encode(
2027            self,
2028            encoder: &mut fidl::encoding::Encoder<'_, D>,
2029            offset: usize,
2030            depth: fidl::encoding::Depth,
2031        ) -> fidl::Result<()> {
2032            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2033            // Zero out padding regions. There's no need to apply masks
2034            // because the unmasked parts will be overwritten by fields.
2035            unsafe {
2036                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2037                (ptr as *mut u64).write_unaligned(0);
2038            }
2039            // Write the fields.
2040            self.0.encode(encoder, offset + 0, depth)?;
2041            self.1.encode(encoder, offset + 8, depth)?;
2042            Ok(())
2043        }
2044    }
2045
2046    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2047        for WlantapPhyScanCompleteRequest
2048    {
2049        #[inline(always)]
2050        fn new_empty() -> Self {
2051            Self { scan_id: fidl::new_empty!(u64, D), status: fidl::new_empty!(i32, D) }
2052        }
2053
2054        #[inline]
2055        unsafe fn decode(
2056            &mut self,
2057            decoder: &mut fidl::encoding::Decoder<'_, D>,
2058            offset: usize,
2059            _depth: fidl::encoding::Depth,
2060        ) -> fidl::Result<()> {
2061            decoder.debug_check_bounds::<Self>(offset);
2062            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2063            // Verify that padding bytes are zero.
2064            let ptr = unsafe { buf_ptr.offset(8) };
2065            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2066            let mask = 0xffffffff00000000u64;
2067            let maskedval = padval & mask;
2068            if maskedval != 0 {
2069                return Err(fidl::Error::NonZeroPadding {
2070                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2071                });
2072            }
2073            // Copy from the buffer into the object.
2074            unsafe {
2075                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2076            }
2077            Ok(())
2078        }
2079    }
2080
2081    impl fidl::encoding::ValueTypeMarker for WlantapPhySetChannelRequest {
2082        type Borrowed<'a> = &'a Self;
2083        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2084            value
2085        }
2086    }
2087
2088    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetChannelRequest {
2089        type Owned = Self;
2090
2091        #[inline(always)]
2092        fn inline_align(_context: fidl::encoding::Context) -> usize {
2093            4
2094        }
2095
2096        #[inline(always)]
2097        fn inline_size(_context: fidl::encoding::Context) -> usize {
2098            16
2099        }
2100    }
2101
2102    unsafe impl<D: fidl::encoding::ResourceDialect>
2103        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for &WlantapPhySetChannelRequest
2104    {
2105        #[inline]
2106        unsafe fn encode(
2107            self,
2108            encoder: &mut fidl::encoding::Encoder<'_, D>,
2109            offset: usize,
2110            _depth: fidl::encoding::Depth,
2111        ) -> fidl::Result<()> {
2112            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2113            // Delegate to tuple encoding.
2114            fidl::encoding::Encode::<WlantapPhySetChannelRequest, D>::encode(
2115                (<SetChannelArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2116                encoder,
2117                offset,
2118                _depth,
2119            )
2120        }
2121    }
2122    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetChannelArgs, D>>
2123        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for (T0,)
2124    {
2125        #[inline]
2126        unsafe fn encode(
2127            self,
2128            encoder: &mut fidl::encoding::Encoder<'_, D>,
2129            offset: usize,
2130            depth: fidl::encoding::Depth,
2131        ) -> fidl::Result<()> {
2132            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2133            // Zero out padding regions. There's no need to apply masks
2134            // because the unmasked parts will be overwritten by fields.
2135            // Write the fields.
2136            self.0.encode(encoder, offset + 0, depth)?;
2137            Ok(())
2138        }
2139    }
2140
2141    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2142        for WlantapPhySetChannelRequest
2143    {
2144        #[inline(always)]
2145        fn new_empty() -> Self {
2146            Self { args: fidl::new_empty!(SetChannelArgs, D) }
2147        }
2148
2149        #[inline]
2150        unsafe fn decode(
2151            &mut self,
2152            decoder: &mut fidl::encoding::Decoder<'_, D>,
2153            offset: usize,
2154            _depth: fidl::encoding::Depth,
2155        ) -> fidl::Result<()> {
2156            decoder.debug_check_bounds::<Self>(offset);
2157            // Verify that padding bytes are zero.
2158            fidl::decode!(SetChannelArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2159            Ok(())
2160        }
2161    }
2162
2163    impl fidl::encoding::ValueTypeMarker for WlantapPhySetCountryRequest {
2164        type Borrowed<'a> = &'a Self;
2165        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2166            value
2167        }
2168    }
2169
2170    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetCountryRequest {
2171        type Owned = Self;
2172
2173        #[inline(always)]
2174        fn inline_align(_context: fidl::encoding::Context) -> usize {
2175            1
2176        }
2177
2178        #[inline(always)]
2179        fn inline_size(_context: fidl::encoding::Context) -> usize {
2180            2
2181        }
2182        #[inline(always)]
2183        fn encode_is_copy() -> bool {
2184            true
2185        }
2186
2187        #[inline(always)]
2188        fn decode_is_copy() -> bool {
2189            true
2190        }
2191    }
2192
2193    unsafe impl<D: fidl::encoding::ResourceDialect>
2194        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for &WlantapPhySetCountryRequest
2195    {
2196        #[inline]
2197        unsafe fn encode(
2198            self,
2199            encoder: &mut fidl::encoding::Encoder<'_, D>,
2200            offset: usize,
2201            _depth: fidl::encoding::Depth,
2202        ) -> fidl::Result<()> {
2203            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2204            unsafe {
2205                // Copy the object into the buffer.
2206                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2207                (buf_ptr as *mut WlantapPhySetCountryRequest)
2208                    .write_unaligned((self as *const WlantapPhySetCountryRequest).read());
2209                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2210                // done second because the memcpy will write garbage to these bytes.
2211            }
2212            Ok(())
2213        }
2214    }
2215    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryArgs, D>>
2216        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for (T0,)
2217    {
2218        #[inline]
2219        unsafe fn encode(
2220            self,
2221            encoder: &mut fidl::encoding::Encoder<'_, D>,
2222            offset: usize,
2223            depth: fidl::encoding::Depth,
2224        ) -> fidl::Result<()> {
2225            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2226            // Zero out padding regions. There's no need to apply masks
2227            // because the unmasked parts will be overwritten by fields.
2228            // Write the fields.
2229            self.0.encode(encoder, offset + 0, depth)?;
2230            Ok(())
2231        }
2232    }
2233
2234    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2235        for WlantapPhySetCountryRequest
2236    {
2237        #[inline(always)]
2238        fn new_empty() -> Self {
2239            Self { args: fidl::new_empty!(SetCountryArgs, D) }
2240        }
2241
2242        #[inline]
2243        unsafe fn decode(
2244            &mut self,
2245            decoder: &mut fidl::encoding::Decoder<'_, D>,
2246            offset: usize,
2247            _depth: fidl::encoding::Depth,
2248        ) -> fidl::Result<()> {
2249            decoder.debug_check_bounds::<Self>(offset);
2250            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2251            // Verify that padding bytes are zero.
2252            // Copy from the buffer into the object.
2253            unsafe {
2254                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2255            }
2256            Ok(())
2257        }
2258    }
2259
2260    impl fidl::encoding::ValueTypeMarker for WlantapPhySetKeyRequest {
2261        type Borrowed<'a> = &'a Self;
2262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2263            value
2264        }
2265    }
2266
2267    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetKeyRequest {
2268        type Owned = Self;
2269
2270        #[inline(always)]
2271        fn inline_align(_context: fidl::encoding::Context) -> usize {
2272            8
2273        }
2274
2275        #[inline(always)]
2276        fn inline_size(_context: fidl::encoding::Context) -> usize {
2277            40
2278        }
2279    }
2280
2281    unsafe impl<D: fidl::encoding::ResourceDialect>
2282        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for &WlantapPhySetKeyRequest
2283    {
2284        #[inline]
2285        unsafe fn encode(
2286            self,
2287            encoder: &mut fidl::encoding::Encoder<'_, D>,
2288            offset: usize,
2289            _depth: fidl::encoding::Depth,
2290        ) -> fidl::Result<()> {
2291            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2292            // Delegate to tuple encoding.
2293            fidl::encoding::Encode::<WlantapPhySetKeyRequest, D>::encode(
2294                (<SetKeyArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2295                encoder,
2296                offset,
2297                _depth,
2298            )
2299        }
2300    }
2301    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetKeyArgs, D>>
2302        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for (T0,)
2303    {
2304        #[inline]
2305        unsafe fn encode(
2306            self,
2307            encoder: &mut fidl::encoding::Encoder<'_, D>,
2308            offset: usize,
2309            depth: fidl::encoding::Depth,
2310        ) -> fidl::Result<()> {
2311            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2312            // Zero out padding regions. There's no need to apply masks
2313            // because the unmasked parts will be overwritten by fields.
2314            // Write the fields.
2315            self.0.encode(encoder, offset + 0, depth)?;
2316            Ok(())
2317        }
2318    }
2319
2320    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2321        for WlantapPhySetKeyRequest
2322    {
2323        #[inline(always)]
2324        fn new_empty() -> Self {
2325            Self { args: fidl::new_empty!(SetKeyArgs, D) }
2326        }
2327
2328        #[inline]
2329        unsafe fn decode(
2330            &mut self,
2331            decoder: &mut fidl::encoding::Decoder<'_, D>,
2332            offset: usize,
2333            _depth: fidl::encoding::Depth,
2334        ) -> fidl::Result<()> {
2335            decoder.debug_check_bounds::<Self>(offset);
2336            // Verify that padding bytes are zero.
2337            fidl::decode!(SetKeyArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2338            Ok(())
2339        }
2340    }
2341
2342    impl fidl::encoding::ValueTypeMarker for WlantapPhyStartScanRequest {
2343        type Borrowed<'a> = &'a Self;
2344        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2345            value
2346        }
2347    }
2348
2349    unsafe impl fidl::encoding::TypeMarker for WlantapPhyStartScanRequest {
2350        type Owned = Self;
2351
2352        #[inline(always)]
2353        fn inline_align(_context: fidl::encoding::Context) -> usize {
2354            8
2355        }
2356
2357        #[inline(always)]
2358        fn inline_size(_context: fidl::encoding::Context) -> usize {
2359            16
2360        }
2361    }
2362
2363    unsafe impl<D: fidl::encoding::ResourceDialect>
2364        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for &WlantapPhyStartScanRequest
2365    {
2366        #[inline]
2367        unsafe fn encode(
2368            self,
2369            encoder: &mut fidl::encoding::Encoder<'_, D>,
2370            offset: usize,
2371            _depth: fidl::encoding::Depth,
2372        ) -> fidl::Result<()> {
2373            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2374            unsafe {
2375                // Copy the object into the buffer.
2376                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2377                (buf_ptr as *mut WlantapPhyStartScanRequest)
2378                    .write_unaligned((self as *const WlantapPhyStartScanRequest).read());
2379                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2380                // done second because the memcpy will write garbage to these bytes.
2381                let padding_ptr = buf_ptr.offset(0) as *mut u64;
2382                let padding_mask = 0xffffffffffff0000u64;
2383                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2384            }
2385            Ok(())
2386        }
2387    }
2388    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartScanArgs, D>>
2389        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for (T0,)
2390    {
2391        #[inline]
2392        unsafe fn encode(
2393            self,
2394            encoder: &mut fidl::encoding::Encoder<'_, D>,
2395            offset: usize,
2396            depth: fidl::encoding::Depth,
2397        ) -> fidl::Result<()> {
2398            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2399            // Zero out padding regions. There's no need to apply masks
2400            // because the unmasked parts will be overwritten by fields.
2401            // Write the fields.
2402            self.0.encode(encoder, offset + 0, depth)?;
2403            Ok(())
2404        }
2405    }
2406
2407    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2408        for WlantapPhyStartScanRequest
2409    {
2410        #[inline(always)]
2411        fn new_empty() -> Self {
2412            Self { args: fidl::new_empty!(StartScanArgs, D) }
2413        }
2414
2415        #[inline]
2416        unsafe fn decode(
2417            &mut self,
2418            decoder: &mut fidl::encoding::Decoder<'_, D>,
2419            offset: usize,
2420            _depth: fidl::encoding::Depth,
2421        ) -> fidl::Result<()> {
2422            decoder.debug_check_bounds::<Self>(offset);
2423            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2424            // Verify that padding bytes are zero.
2425            let ptr = unsafe { buf_ptr.offset(0) };
2426            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2427            let mask = 0xffffffffffff0000u64;
2428            let maskedval = padval & mask;
2429            if maskedval != 0 {
2430                return Err(fidl::Error::NonZeroPadding {
2431                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2432                });
2433            }
2434            // Copy from the buffer into the object.
2435            unsafe {
2436                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2437            }
2438            Ok(())
2439        }
2440    }
2441
2442    impl fidl::encoding::ValueTypeMarker for WlantapPhyTxRequest {
2443        type Borrowed<'a> = &'a Self;
2444        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2445            value
2446        }
2447    }
2448
2449    unsafe impl fidl::encoding::TypeMarker for WlantapPhyTxRequest {
2450        type Owned = Self;
2451
2452        #[inline(always)]
2453        fn inline_align(_context: fidl::encoding::Context) -> usize {
2454            8
2455        }
2456
2457        #[inline(always)]
2458        fn inline_size(_context: fidl::encoding::Context) -> usize {
2459            48
2460        }
2461    }
2462
2463    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyTxRequest, D>
2464        for &WlantapPhyTxRequest
2465    {
2466        #[inline]
2467        unsafe fn encode(
2468            self,
2469            encoder: &mut fidl::encoding::Encoder<'_, D>,
2470            offset: usize,
2471            _depth: fidl::encoding::Depth,
2472        ) -> fidl::Result<()> {
2473            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2474            // Delegate to tuple encoding.
2475            fidl::encoding::Encode::<WlantapPhyTxRequest, D>::encode(
2476                (<TxArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2477                encoder,
2478                offset,
2479                _depth,
2480            )
2481        }
2482    }
2483    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TxArgs, D>>
2484        fidl::encoding::Encode<WlantapPhyTxRequest, D> for (T0,)
2485    {
2486        #[inline]
2487        unsafe fn encode(
2488            self,
2489            encoder: &mut fidl::encoding::Encoder<'_, D>,
2490            offset: usize,
2491            depth: fidl::encoding::Depth,
2492        ) -> fidl::Result<()> {
2493            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2494            // Zero out padding regions. There's no need to apply masks
2495            // because the unmasked parts will be overwritten by fields.
2496            // Write the fields.
2497            self.0.encode(encoder, offset + 0, depth)?;
2498            Ok(())
2499        }
2500    }
2501
2502    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyTxRequest {
2503        #[inline(always)]
2504        fn new_empty() -> Self {
2505            Self { args: fidl::new_empty!(TxArgs, D) }
2506        }
2507
2508        #[inline]
2509        unsafe fn decode(
2510            &mut self,
2511            decoder: &mut fidl::encoding::Decoder<'_, D>,
2512            offset: usize,
2513            _depth: fidl::encoding::Depth,
2514        ) -> fidl::Result<()> {
2515            decoder.debug_check_bounds::<Self>(offset);
2516            // Verify that padding bytes are zero.
2517            fidl::decode!(TxArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2518            Ok(())
2519        }
2520    }
2521}