fidl_fuchsia_wlan_device__common/
fidl_fuchsia_wlan_device__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
11pub const MAX_NUM_RATES: u8 = 12;
12
13/// IEEE Std 802.11-206 Section 9.4.1.4 Capability Information Field
14#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
15#[repr(u32)]
16pub enum Capability {
17    ShortPreamble = 32,
18    SpectrumMgmt = 256,
19    Qos = 512,
20    ShortSlotTime = 1024,
21    RadioMsmt = 4096,
22    SimultaneousClientAp = 65536,
23}
24
25impl Capability {
26    #[inline]
27    pub fn from_primitive(prim: u32) -> Option<Self> {
28        match prim {
29            32 => Some(Self::ShortPreamble),
30            256 => Some(Self::SpectrumMgmt),
31            512 => Some(Self::Qos),
32            1024 => Some(Self::ShortSlotTime),
33            4096 => Some(Self::RadioMsmt),
34            65536 => Some(Self::SimultaneousClientAp),
35            _ => None,
36        }
37    }
38
39    #[inline]
40    pub const fn into_primitive(self) -> u32 {
41        self as u32
42    }
43}
44
45#[derive(Clone, Debug, PartialEq)]
46pub struct BandInfo {
47    pub band: fidl_fuchsia_wlan_ieee80211__common::WlanBand,
48    pub ht_caps: Option<Box<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>>,
49    pub vht_caps: Option<Box<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>>,
50    pub rates: Vec<u8>,
51    pub operating_channels: Vec<u8>,
52}
53
54impl fidl::Persistable for BandInfo {}
55
56/// The country code for a target WLAN PHY device.
57/// alpha2 is ISO 3166-1 code to indicate a country. eg. AF for Afghanistan.
58#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59#[repr(C)]
60pub struct CountryCode {
61    pub alpha2: [u8; 2],
62}
63
64impl fidl::Persistable for CountryCode {}
65
66#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67#[repr(C)]
68pub struct DestroyIfaceRequest {
69    pub id: u16,
70}
71
72impl fidl::Persistable for DestroyIfaceRequest {}
73
74#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75#[repr(C)]
76pub struct PhyClearCountryResponse {
77    pub status: i32,
78}
79
80impl fidl::Persistable for PhyClearCountryResponse {}
81
82#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83#[repr(C)]
84pub struct PhyDestroyIfaceRequest {
85    pub req: DestroyIfaceRequest,
86}
87
88impl fidl::Persistable for PhyDestroyIfaceRequest {}
89
90#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
91#[repr(C)]
92pub struct PhySetCountryRequest {
93    pub req: CountryCode,
94}
95
96impl fidl::Persistable for PhySetCountryRequest {}
97
98#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
99#[repr(C)]
100pub struct PhySetCountryResponse {
101    pub status: i32,
102}
103
104impl fidl::Persistable for PhySetCountryResponse {}
105
106#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
107pub struct PhySetPowerSaveModeRequest {
108    pub req: fidl_fuchsia_wlan_common__common::PowerSaveType,
109}
110
111impl fidl::Persistable for PhySetPowerSaveModeRequest {}
112
113#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114#[repr(C)]
115pub struct PhySetPowerSaveModeResponse {
116    pub status: i32,
117}
118
119impl fidl::Persistable for PhySetPowerSaveModeResponse {}
120
121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122#[repr(C)]
123pub struct PhyCreateIfaceResponse {
124    pub iface_id: u16,
125}
126
127impl fidl::Persistable for PhyCreateIfaceResponse {}
128
129#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
130#[repr(C)]
131pub struct PhyGetCountryResponse {
132    pub resp: CountryCode,
133}
134
135impl fidl::Persistable for PhyGetCountryResponse {}
136
137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138pub struct PhyGetPowerSaveModeResponse {
139    pub resp: fidl_fuchsia_wlan_common__common::PowerSaveType,
140}
141
142impl fidl::Persistable for PhyGetPowerSaveModeResponse {}
143
144#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct PhyGetSupportedMacRolesResponse {
146    pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common__common::WlanMacRole>,
147}
148
149impl fidl::Persistable for PhyGetSupportedMacRolesResponse {}
150
151mod internal {
152    use super::*;
153    unsafe impl fidl::encoding::TypeMarker for Capability {
154        type Owned = Self;
155
156        #[inline(always)]
157        fn inline_align(_context: fidl::encoding::Context) -> usize {
158            std::mem::align_of::<u32>()
159        }
160
161        #[inline(always)]
162        fn inline_size(_context: fidl::encoding::Context) -> usize {
163            std::mem::size_of::<u32>()
164        }
165
166        #[inline(always)]
167        fn encode_is_copy() -> bool {
168            true
169        }
170
171        #[inline(always)]
172        fn decode_is_copy() -> bool {
173            false
174        }
175    }
176
177    impl fidl::encoding::ValueTypeMarker for Capability {
178        type Borrowed<'a> = Self;
179        #[inline(always)]
180        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
181            *value
182        }
183    }
184
185    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
186        #[inline]
187        unsafe fn encode(
188            self,
189            encoder: &mut fidl::encoding::Encoder<'_, D>,
190            offset: usize,
191            _depth: fidl::encoding::Depth,
192        ) -> fidl::Result<()> {
193            encoder.debug_check_bounds::<Self>(offset);
194            encoder.write_num(self.into_primitive(), offset);
195            Ok(())
196        }
197    }
198
199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
200        #[inline(always)]
201        fn new_empty() -> Self {
202            Self::ShortPreamble
203        }
204
205        #[inline]
206        unsafe fn decode(
207            &mut self,
208            decoder: &mut fidl::encoding::Decoder<'_, D>,
209            offset: usize,
210            _depth: fidl::encoding::Depth,
211        ) -> fidl::Result<()> {
212            decoder.debug_check_bounds::<Self>(offset);
213            let prim = decoder.read_num::<u32>(offset);
214
215            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
216            Ok(())
217        }
218    }
219
220    impl fidl::encoding::ValueTypeMarker for BandInfo {
221        type Borrowed<'a> = &'a Self;
222        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
223            value
224        }
225    }
226
227    unsafe impl fidl::encoding::TypeMarker for BandInfo {
228        type Owned = Self;
229
230        #[inline(always)]
231        fn inline_align(_context: fidl::encoding::Context) -> usize {
232            8
233        }
234
235        #[inline(always)]
236        fn inline_size(_context: fidl::encoding::Context) -> usize {
237            56
238        }
239    }
240
241    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BandInfo, D> for &BandInfo {
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::<BandInfo>(offset);
250            // Delegate to tuple encoding.
251            fidl::encoding::Encode::<BandInfo, D>::encode(
252                (
253                    <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow(&self.band),
254                    <fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities> as fidl::encoding::ValueTypeMarker>::borrow(&self.ht_caps),
255                    <fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities> as fidl::encoding::ValueTypeMarker>::borrow(&self.vht_caps),
256                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow(&self.rates),
257                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.operating_channels),
258                ),
259                encoder, offset, _depth
260            )
261        }
262    }
263    unsafe impl<
264            D: fidl::encoding::ResourceDialect,
265            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>,
266            T1: fidl::encoding::Encode<
267                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
268                D,
269            >,
270            T2: fidl::encoding::Encode<
271                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
272                D,
273            >,
274            T3: fidl::encoding::Encode<fidl::encoding::Vector<u8, 12>, D>,
275            T4: fidl::encoding::Encode<fidl::encoding::Vector<u8, 256>, D>,
276        > fidl::encoding::Encode<BandInfo, D> for (T0, T1, T2, T3, T4)
277    {
278        #[inline]
279        unsafe fn encode(
280            self,
281            encoder: &mut fidl::encoding::Encoder<'_, D>,
282            offset: usize,
283            depth: fidl::encoding::Depth,
284        ) -> fidl::Result<()> {
285            encoder.debug_check_bounds::<BandInfo>(offset);
286            // Zero out padding regions. There's no need to apply masks
287            // because the unmasked parts will be overwritten by fields.
288            unsafe {
289                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
290                (ptr as *mut u64).write_unaligned(0);
291            }
292            // Write the fields.
293            self.0.encode(encoder, offset + 0, depth)?;
294            self.1.encode(encoder, offset + 8, depth)?;
295            self.2.encode(encoder, offset + 16, depth)?;
296            self.3.encode(encoder, offset + 24, depth)?;
297            self.4.encode(encoder, offset + 40, depth)?;
298            Ok(())
299        }
300    }
301
302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BandInfo {
303        #[inline(always)]
304        fn new_empty() -> Self {
305            Self {
306                band: fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D),
307                ht_caps: fidl::new_empty!(
308                    fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
309                    D
310                ),
311                vht_caps: fidl::new_empty!(
312                    fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
313                    D
314                ),
315                rates: fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D),
316                operating_channels: fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D),
317            }
318        }
319
320        #[inline]
321        unsafe fn decode(
322            &mut self,
323            decoder: &mut fidl::encoding::Decoder<'_, D>,
324            offset: usize,
325            _depth: fidl::encoding::Depth,
326        ) -> fidl::Result<()> {
327            decoder.debug_check_bounds::<Self>(offset);
328            // Verify that padding bytes are zero.
329            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
330            let padval = unsafe { (ptr as *const u64).read_unaligned() };
331            let mask = 0xffffffffffffff00u64;
332            let maskedval = padval & mask;
333            if maskedval != 0 {
334                return Err(fidl::Error::NonZeroPadding {
335                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
336                });
337            }
338            fidl::decode!(
339                fidl_fuchsia_wlan_ieee80211__common::WlanBand,
340                D,
341                &mut self.band,
342                decoder,
343                offset + 0,
344                _depth
345            )?;
346            fidl::decode!(
347                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
348                D,
349                &mut self.ht_caps,
350                decoder,
351                offset + 8,
352                _depth
353            )?;
354            fidl::decode!(
355                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
356                D,
357                &mut self.vht_caps,
358                decoder,
359                offset + 16,
360                _depth
361            )?;
362            fidl::decode!(fidl::encoding::Vector<u8, 12>, D, &mut self.rates, decoder, offset + 24, _depth)?;
363            fidl::decode!(fidl::encoding::Vector<u8, 256>, D, &mut self.operating_channels, decoder, offset + 40, _depth)?;
364            Ok(())
365        }
366    }
367
368    impl fidl::encoding::ValueTypeMarker for CountryCode {
369        type Borrowed<'a> = &'a Self;
370        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
371            value
372        }
373    }
374
375    unsafe impl fidl::encoding::TypeMarker for CountryCode {
376        type Owned = Self;
377
378        #[inline(always)]
379        fn inline_align(_context: fidl::encoding::Context) -> usize {
380            1
381        }
382
383        #[inline(always)]
384        fn inline_size(_context: fidl::encoding::Context) -> usize {
385            2
386        }
387        #[inline(always)]
388        fn encode_is_copy() -> bool {
389            true
390        }
391
392        #[inline(always)]
393        fn decode_is_copy() -> bool {
394            true
395        }
396    }
397
398    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CountryCode, D>
399        for &CountryCode
400    {
401        #[inline]
402        unsafe fn encode(
403            self,
404            encoder: &mut fidl::encoding::Encoder<'_, D>,
405            offset: usize,
406            _depth: fidl::encoding::Depth,
407        ) -> fidl::Result<()> {
408            encoder.debug_check_bounds::<CountryCode>(offset);
409            unsafe {
410                // Copy the object into the buffer.
411                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
412                (buf_ptr as *mut CountryCode).write_unaligned((self as *const CountryCode).read());
413                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
414                // done second because the memcpy will write garbage to these bytes.
415            }
416            Ok(())
417        }
418    }
419    unsafe impl<
420            D: fidl::encoding::ResourceDialect,
421            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
422        > fidl::encoding::Encode<CountryCode, D> for (T0,)
423    {
424        #[inline]
425        unsafe fn encode(
426            self,
427            encoder: &mut fidl::encoding::Encoder<'_, D>,
428            offset: usize,
429            depth: fidl::encoding::Depth,
430        ) -> fidl::Result<()> {
431            encoder.debug_check_bounds::<CountryCode>(offset);
432            // Zero out padding regions. There's no need to apply masks
433            // because the unmasked parts will be overwritten by fields.
434            // Write the fields.
435            self.0.encode(encoder, offset + 0, depth)?;
436            Ok(())
437        }
438    }
439
440    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CountryCode {
441        #[inline(always)]
442        fn new_empty() -> Self {
443            Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
444        }
445
446        #[inline]
447        unsafe fn decode(
448            &mut self,
449            decoder: &mut fidl::encoding::Decoder<'_, D>,
450            offset: usize,
451            _depth: fidl::encoding::Depth,
452        ) -> fidl::Result<()> {
453            decoder.debug_check_bounds::<Self>(offset);
454            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
455            // Verify that padding bytes are zero.
456            // Copy from the buffer into the object.
457            unsafe {
458                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
459            }
460            Ok(())
461        }
462    }
463
464    impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
465        type Borrowed<'a> = &'a Self;
466        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
467            value
468        }
469    }
470
471    unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
472        type Owned = Self;
473
474        #[inline(always)]
475        fn inline_align(_context: fidl::encoding::Context) -> usize {
476            2
477        }
478
479        #[inline(always)]
480        fn inline_size(_context: fidl::encoding::Context) -> usize {
481            2
482        }
483        #[inline(always)]
484        fn encode_is_copy() -> bool {
485            true
486        }
487
488        #[inline(always)]
489        fn decode_is_copy() -> bool {
490            true
491        }
492    }
493
494    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyIfaceRequest, D>
495        for &DestroyIfaceRequest
496    {
497        #[inline]
498        unsafe fn encode(
499            self,
500            encoder: &mut fidl::encoding::Encoder<'_, D>,
501            offset: usize,
502            _depth: fidl::encoding::Depth,
503        ) -> fidl::Result<()> {
504            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
505            unsafe {
506                // Copy the object into the buffer.
507                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
508                (buf_ptr as *mut DestroyIfaceRequest)
509                    .write_unaligned((self as *const DestroyIfaceRequest).read());
510                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
511                // done second because the memcpy will write garbage to these bytes.
512            }
513            Ok(())
514        }
515    }
516    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
517        fidl::encoding::Encode<DestroyIfaceRequest, D> for (T0,)
518    {
519        #[inline]
520        unsafe fn encode(
521            self,
522            encoder: &mut fidl::encoding::Encoder<'_, D>,
523            offset: usize,
524            depth: fidl::encoding::Depth,
525        ) -> fidl::Result<()> {
526            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
527            // Zero out padding regions. There's no need to apply masks
528            // because the unmasked parts will be overwritten by fields.
529            // Write the fields.
530            self.0.encode(encoder, offset + 0, depth)?;
531            Ok(())
532        }
533    }
534
535    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
536        #[inline(always)]
537        fn new_empty() -> Self {
538            Self { id: fidl::new_empty!(u16, D) }
539        }
540
541        #[inline]
542        unsafe fn decode(
543            &mut self,
544            decoder: &mut fidl::encoding::Decoder<'_, D>,
545            offset: usize,
546            _depth: fidl::encoding::Depth,
547        ) -> fidl::Result<()> {
548            decoder.debug_check_bounds::<Self>(offset);
549            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
550            // Verify that padding bytes are zero.
551            // Copy from the buffer into the object.
552            unsafe {
553                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
554            }
555            Ok(())
556        }
557    }
558
559    impl fidl::encoding::ValueTypeMarker for PhyClearCountryResponse {
560        type Borrowed<'a> = &'a Self;
561        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
562            value
563        }
564    }
565
566    unsafe impl fidl::encoding::TypeMarker for PhyClearCountryResponse {
567        type Owned = Self;
568
569        #[inline(always)]
570        fn inline_align(_context: fidl::encoding::Context) -> usize {
571            4
572        }
573
574        #[inline(always)]
575        fn inline_size(_context: fidl::encoding::Context) -> usize {
576            4
577        }
578        #[inline(always)]
579        fn encode_is_copy() -> bool {
580            true
581        }
582
583        #[inline(always)]
584        fn decode_is_copy() -> bool {
585            true
586        }
587    }
588
589    unsafe impl<D: fidl::encoding::ResourceDialect>
590        fidl::encoding::Encode<PhyClearCountryResponse, D> for &PhyClearCountryResponse
591    {
592        #[inline]
593        unsafe fn encode(
594            self,
595            encoder: &mut fidl::encoding::Encoder<'_, D>,
596            offset: usize,
597            _depth: fidl::encoding::Depth,
598        ) -> fidl::Result<()> {
599            encoder.debug_check_bounds::<PhyClearCountryResponse>(offset);
600            unsafe {
601                // Copy the object into the buffer.
602                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
603                (buf_ptr as *mut PhyClearCountryResponse)
604                    .write_unaligned((self as *const PhyClearCountryResponse).read());
605                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
606                // done second because the memcpy will write garbage to these bytes.
607            }
608            Ok(())
609        }
610    }
611    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
612        fidl::encoding::Encode<PhyClearCountryResponse, D> for (T0,)
613    {
614        #[inline]
615        unsafe fn encode(
616            self,
617            encoder: &mut fidl::encoding::Encoder<'_, D>,
618            offset: usize,
619            depth: fidl::encoding::Depth,
620        ) -> fidl::Result<()> {
621            encoder.debug_check_bounds::<PhyClearCountryResponse>(offset);
622            // Zero out padding regions. There's no need to apply masks
623            // because the unmasked parts will be overwritten by fields.
624            // Write the fields.
625            self.0.encode(encoder, offset + 0, depth)?;
626            Ok(())
627        }
628    }
629
630    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
631        for PhyClearCountryResponse
632    {
633        #[inline(always)]
634        fn new_empty() -> Self {
635            Self { status: fidl::new_empty!(i32, D) }
636        }
637
638        #[inline]
639        unsafe fn decode(
640            &mut self,
641            decoder: &mut fidl::encoding::Decoder<'_, D>,
642            offset: usize,
643            _depth: fidl::encoding::Depth,
644        ) -> fidl::Result<()> {
645            decoder.debug_check_bounds::<Self>(offset);
646            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
647            // Verify that padding bytes are zero.
648            // Copy from the buffer into the object.
649            unsafe {
650                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
651            }
652            Ok(())
653        }
654    }
655
656    impl fidl::encoding::ValueTypeMarker for PhyDestroyIfaceRequest {
657        type Borrowed<'a> = &'a Self;
658        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
659            value
660        }
661    }
662
663    unsafe impl fidl::encoding::TypeMarker for PhyDestroyIfaceRequest {
664        type Owned = Self;
665
666        #[inline(always)]
667        fn inline_align(_context: fidl::encoding::Context) -> usize {
668            2
669        }
670
671        #[inline(always)]
672        fn inline_size(_context: fidl::encoding::Context) -> usize {
673            2
674        }
675        #[inline(always)]
676        fn encode_is_copy() -> bool {
677            true
678        }
679
680        #[inline(always)]
681        fn decode_is_copy() -> bool {
682            true
683        }
684    }
685
686    unsafe impl<D: fidl::encoding::ResourceDialect>
687        fidl::encoding::Encode<PhyDestroyIfaceRequest, D> for &PhyDestroyIfaceRequest
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::<PhyDestroyIfaceRequest>(offset);
697            unsafe {
698                // Copy the object into the buffer.
699                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
700                (buf_ptr as *mut PhyDestroyIfaceRequest)
701                    .write_unaligned((self as *const PhyDestroyIfaceRequest).read());
702                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
703                // done second because the memcpy will write garbage to these bytes.
704            }
705            Ok(())
706        }
707    }
708    unsafe impl<
709            D: fidl::encoding::ResourceDialect,
710            T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
711        > fidl::encoding::Encode<PhyDestroyIfaceRequest, D> for (T0,)
712    {
713        #[inline]
714        unsafe fn encode(
715            self,
716            encoder: &mut fidl::encoding::Encoder<'_, D>,
717            offset: usize,
718            depth: fidl::encoding::Depth,
719        ) -> fidl::Result<()> {
720            encoder.debug_check_bounds::<PhyDestroyIfaceRequest>(offset);
721            // Zero out padding regions. There's no need to apply masks
722            // because the unmasked parts will be overwritten by fields.
723            // Write the fields.
724            self.0.encode(encoder, offset + 0, depth)?;
725            Ok(())
726        }
727    }
728
729    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
730        for PhyDestroyIfaceRequest
731    {
732        #[inline(always)]
733        fn new_empty() -> Self {
734            Self { req: fidl::new_empty!(DestroyIfaceRequest, D) }
735        }
736
737        #[inline]
738        unsafe fn decode(
739            &mut self,
740            decoder: &mut fidl::encoding::Decoder<'_, D>,
741            offset: usize,
742            _depth: fidl::encoding::Depth,
743        ) -> fidl::Result<()> {
744            decoder.debug_check_bounds::<Self>(offset);
745            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
746            // Verify that padding bytes are zero.
747            // Copy from the buffer into the object.
748            unsafe {
749                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
750            }
751            Ok(())
752        }
753    }
754
755    impl fidl::encoding::ValueTypeMarker for PhySetCountryRequest {
756        type Borrowed<'a> = &'a Self;
757        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
758            value
759        }
760    }
761
762    unsafe impl fidl::encoding::TypeMarker for PhySetCountryRequest {
763        type Owned = Self;
764
765        #[inline(always)]
766        fn inline_align(_context: fidl::encoding::Context) -> usize {
767            1
768        }
769
770        #[inline(always)]
771        fn inline_size(_context: fidl::encoding::Context) -> usize {
772            2
773        }
774        #[inline(always)]
775        fn encode_is_copy() -> bool {
776            true
777        }
778
779        #[inline(always)]
780        fn decode_is_copy() -> bool {
781            true
782        }
783    }
784
785    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhySetCountryRequest, D>
786        for &PhySetCountryRequest
787    {
788        #[inline]
789        unsafe fn encode(
790            self,
791            encoder: &mut fidl::encoding::Encoder<'_, D>,
792            offset: usize,
793            _depth: fidl::encoding::Depth,
794        ) -> fidl::Result<()> {
795            encoder.debug_check_bounds::<PhySetCountryRequest>(offset);
796            unsafe {
797                // Copy the object into the buffer.
798                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
799                (buf_ptr as *mut PhySetCountryRequest)
800                    .write_unaligned((self as *const PhySetCountryRequest).read());
801                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
802                // done second because the memcpy will write garbage to these bytes.
803            }
804            Ok(())
805        }
806    }
807    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CountryCode, D>>
808        fidl::encoding::Encode<PhySetCountryRequest, D> for (T0,)
809    {
810        #[inline]
811        unsafe fn encode(
812            self,
813            encoder: &mut fidl::encoding::Encoder<'_, D>,
814            offset: usize,
815            depth: fidl::encoding::Depth,
816        ) -> fidl::Result<()> {
817            encoder.debug_check_bounds::<PhySetCountryRequest>(offset);
818            // Zero out padding regions. There's no need to apply masks
819            // because the unmasked parts will be overwritten by fields.
820            // Write the fields.
821            self.0.encode(encoder, offset + 0, depth)?;
822            Ok(())
823        }
824    }
825
826    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhySetCountryRequest {
827        #[inline(always)]
828        fn new_empty() -> Self {
829            Self { req: fidl::new_empty!(CountryCode, D) }
830        }
831
832        #[inline]
833        unsafe fn decode(
834            &mut self,
835            decoder: &mut fidl::encoding::Decoder<'_, D>,
836            offset: usize,
837            _depth: fidl::encoding::Depth,
838        ) -> fidl::Result<()> {
839            decoder.debug_check_bounds::<Self>(offset);
840            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
841            // Verify that padding bytes are zero.
842            // Copy from the buffer into the object.
843            unsafe {
844                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
845            }
846            Ok(())
847        }
848    }
849
850    impl fidl::encoding::ValueTypeMarker for PhySetCountryResponse {
851        type Borrowed<'a> = &'a Self;
852        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
853            value
854        }
855    }
856
857    unsafe impl fidl::encoding::TypeMarker for PhySetCountryResponse {
858        type Owned = Self;
859
860        #[inline(always)]
861        fn inline_align(_context: fidl::encoding::Context) -> usize {
862            4
863        }
864
865        #[inline(always)]
866        fn inline_size(_context: fidl::encoding::Context) -> usize {
867            4
868        }
869        #[inline(always)]
870        fn encode_is_copy() -> bool {
871            true
872        }
873
874        #[inline(always)]
875        fn decode_is_copy() -> bool {
876            true
877        }
878    }
879
880    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhySetCountryResponse, D>
881        for &PhySetCountryResponse
882    {
883        #[inline]
884        unsafe fn encode(
885            self,
886            encoder: &mut fidl::encoding::Encoder<'_, D>,
887            offset: usize,
888            _depth: fidl::encoding::Depth,
889        ) -> fidl::Result<()> {
890            encoder.debug_check_bounds::<PhySetCountryResponse>(offset);
891            unsafe {
892                // Copy the object into the buffer.
893                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
894                (buf_ptr as *mut PhySetCountryResponse)
895                    .write_unaligned((self as *const PhySetCountryResponse).read());
896                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
897                // done second because the memcpy will write garbage to these bytes.
898            }
899            Ok(())
900        }
901    }
902    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
903        fidl::encoding::Encode<PhySetCountryResponse, D> for (T0,)
904    {
905        #[inline]
906        unsafe fn encode(
907            self,
908            encoder: &mut fidl::encoding::Encoder<'_, D>,
909            offset: usize,
910            depth: fidl::encoding::Depth,
911        ) -> fidl::Result<()> {
912            encoder.debug_check_bounds::<PhySetCountryResponse>(offset);
913            // Zero out padding regions. There's no need to apply masks
914            // because the unmasked parts will be overwritten by fields.
915            // Write the fields.
916            self.0.encode(encoder, offset + 0, depth)?;
917            Ok(())
918        }
919    }
920
921    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhySetCountryResponse {
922        #[inline(always)]
923        fn new_empty() -> Self {
924            Self { status: fidl::new_empty!(i32, D) }
925        }
926
927        #[inline]
928        unsafe fn decode(
929            &mut self,
930            decoder: &mut fidl::encoding::Decoder<'_, D>,
931            offset: usize,
932            _depth: fidl::encoding::Depth,
933        ) -> fidl::Result<()> {
934            decoder.debug_check_bounds::<Self>(offset);
935            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
936            // Verify that padding bytes are zero.
937            // Copy from the buffer into the object.
938            unsafe {
939                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
940            }
941            Ok(())
942        }
943    }
944
945    impl fidl::encoding::ValueTypeMarker for PhySetPowerSaveModeRequest {
946        type Borrowed<'a> = &'a Self;
947        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
948            value
949        }
950    }
951
952    unsafe impl fidl::encoding::TypeMarker for PhySetPowerSaveModeRequest {
953        type Owned = Self;
954
955        #[inline(always)]
956        fn inline_align(_context: fidl::encoding::Context) -> usize {
957            4
958        }
959
960        #[inline(always)]
961        fn inline_size(_context: fidl::encoding::Context) -> usize {
962            4
963        }
964    }
965
966    unsafe impl<D: fidl::encoding::ResourceDialect>
967        fidl::encoding::Encode<PhySetPowerSaveModeRequest, D> for &PhySetPowerSaveModeRequest
968    {
969        #[inline]
970        unsafe fn encode(
971            self,
972            encoder: &mut fidl::encoding::Encoder<'_, D>,
973            offset: usize,
974            _depth: fidl::encoding::Depth,
975        ) -> fidl::Result<()> {
976            encoder.debug_check_bounds::<PhySetPowerSaveModeRequest>(offset);
977            // Delegate to tuple encoding.
978            fidl::encoding::Encode::<PhySetPowerSaveModeRequest, D>::encode(
979                (
980                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.req),
981                ),
982                encoder, offset, _depth
983            )
984        }
985    }
986    unsafe impl<
987            D: fidl::encoding::ResourceDialect,
988            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
989        > fidl::encoding::Encode<PhySetPowerSaveModeRequest, D> for (T0,)
990    {
991        #[inline]
992        unsafe fn encode(
993            self,
994            encoder: &mut fidl::encoding::Encoder<'_, D>,
995            offset: usize,
996            depth: fidl::encoding::Depth,
997        ) -> fidl::Result<()> {
998            encoder.debug_check_bounds::<PhySetPowerSaveModeRequest>(offset);
999            // Zero out padding regions. There's no need to apply masks
1000            // because the unmasked parts will be overwritten by fields.
1001            // Write the fields.
1002            self.0.encode(encoder, offset + 0, depth)?;
1003            Ok(())
1004        }
1005    }
1006
1007    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1008        for PhySetPowerSaveModeRequest
1009    {
1010        #[inline(always)]
1011        fn new_empty() -> Self {
1012            Self { req: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
1013        }
1014
1015        #[inline]
1016        unsafe fn decode(
1017            &mut self,
1018            decoder: &mut fidl::encoding::Decoder<'_, D>,
1019            offset: usize,
1020            _depth: fidl::encoding::Depth,
1021        ) -> fidl::Result<()> {
1022            decoder.debug_check_bounds::<Self>(offset);
1023            // Verify that padding bytes are zero.
1024            fidl::decode!(
1025                fidl_fuchsia_wlan_common__common::PowerSaveType,
1026                D,
1027                &mut self.req,
1028                decoder,
1029                offset + 0,
1030                _depth
1031            )?;
1032            Ok(())
1033        }
1034    }
1035
1036    impl fidl::encoding::ValueTypeMarker for PhySetPowerSaveModeResponse {
1037        type Borrowed<'a> = &'a Self;
1038        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1039            value
1040        }
1041    }
1042
1043    unsafe impl fidl::encoding::TypeMarker for PhySetPowerSaveModeResponse {
1044        type Owned = Self;
1045
1046        #[inline(always)]
1047        fn inline_align(_context: fidl::encoding::Context) -> usize {
1048            4
1049        }
1050
1051        #[inline(always)]
1052        fn inline_size(_context: fidl::encoding::Context) -> usize {
1053            4
1054        }
1055        #[inline(always)]
1056        fn encode_is_copy() -> bool {
1057            true
1058        }
1059
1060        #[inline(always)]
1061        fn decode_is_copy() -> bool {
1062            true
1063        }
1064    }
1065
1066    unsafe impl<D: fidl::encoding::ResourceDialect>
1067        fidl::encoding::Encode<PhySetPowerSaveModeResponse, D> for &PhySetPowerSaveModeResponse
1068    {
1069        #[inline]
1070        unsafe fn encode(
1071            self,
1072            encoder: &mut fidl::encoding::Encoder<'_, D>,
1073            offset: usize,
1074            _depth: fidl::encoding::Depth,
1075        ) -> fidl::Result<()> {
1076            encoder.debug_check_bounds::<PhySetPowerSaveModeResponse>(offset);
1077            unsafe {
1078                // Copy the object into the buffer.
1079                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1080                (buf_ptr as *mut PhySetPowerSaveModeResponse)
1081                    .write_unaligned((self as *const PhySetPowerSaveModeResponse).read());
1082                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1083                // done second because the memcpy will write garbage to these bytes.
1084            }
1085            Ok(())
1086        }
1087    }
1088    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1089        fidl::encoding::Encode<PhySetPowerSaveModeResponse, D> for (T0,)
1090    {
1091        #[inline]
1092        unsafe fn encode(
1093            self,
1094            encoder: &mut fidl::encoding::Encoder<'_, D>,
1095            offset: usize,
1096            depth: fidl::encoding::Depth,
1097        ) -> fidl::Result<()> {
1098            encoder.debug_check_bounds::<PhySetPowerSaveModeResponse>(offset);
1099            // Zero out padding regions. There's no need to apply masks
1100            // because the unmasked parts will be overwritten by fields.
1101            // Write the fields.
1102            self.0.encode(encoder, offset + 0, depth)?;
1103            Ok(())
1104        }
1105    }
1106
1107    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1108        for PhySetPowerSaveModeResponse
1109    {
1110        #[inline(always)]
1111        fn new_empty() -> Self {
1112            Self { status: fidl::new_empty!(i32, D) }
1113        }
1114
1115        #[inline]
1116        unsafe fn decode(
1117            &mut self,
1118            decoder: &mut fidl::encoding::Decoder<'_, D>,
1119            offset: usize,
1120            _depth: fidl::encoding::Depth,
1121        ) -> fidl::Result<()> {
1122            decoder.debug_check_bounds::<Self>(offset);
1123            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1124            // Verify that padding bytes are zero.
1125            // Copy from the buffer into the object.
1126            unsafe {
1127                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1128            }
1129            Ok(())
1130        }
1131    }
1132
1133    impl fidl::encoding::ValueTypeMarker for PhyCreateIfaceResponse {
1134        type Borrowed<'a> = &'a Self;
1135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1136            value
1137        }
1138    }
1139
1140    unsafe impl fidl::encoding::TypeMarker for PhyCreateIfaceResponse {
1141        type Owned = Self;
1142
1143        #[inline(always)]
1144        fn inline_align(_context: fidl::encoding::Context) -> usize {
1145            2
1146        }
1147
1148        #[inline(always)]
1149        fn inline_size(_context: fidl::encoding::Context) -> usize {
1150            2
1151        }
1152        #[inline(always)]
1153        fn encode_is_copy() -> bool {
1154            true
1155        }
1156
1157        #[inline(always)]
1158        fn decode_is_copy() -> bool {
1159            true
1160        }
1161    }
1162
1163    unsafe impl<D: fidl::encoding::ResourceDialect>
1164        fidl::encoding::Encode<PhyCreateIfaceResponse, D> for &PhyCreateIfaceResponse
1165    {
1166        #[inline]
1167        unsafe fn encode(
1168            self,
1169            encoder: &mut fidl::encoding::Encoder<'_, D>,
1170            offset: usize,
1171            _depth: fidl::encoding::Depth,
1172        ) -> fidl::Result<()> {
1173            encoder.debug_check_bounds::<PhyCreateIfaceResponse>(offset);
1174            unsafe {
1175                // Copy the object into the buffer.
1176                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1177                (buf_ptr as *mut PhyCreateIfaceResponse)
1178                    .write_unaligned((self as *const PhyCreateIfaceResponse).read());
1179                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1180                // done second because the memcpy will write garbage to these bytes.
1181            }
1182            Ok(())
1183        }
1184    }
1185    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1186        fidl::encoding::Encode<PhyCreateIfaceResponse, D> for (T0,)
1187    {
1188        #[inline]
1189        unsafe fn encode(
1190            self,
1191            encoder: &mut fidl::encoding::Encoder<'_, D>,
1192            offset: usize,
1193            depth: fidl::encoding::Depth,
1194        ) -> fidl::Result<()> {
1195            encoder.debug_check_bounds::<PhyCreateIfaceResponse>(offset);
1196            // Zero out padding regions. There's no need to apply masks
1197            // because the unmasked parts will be overwritten by fields.
1198            // Write the fields.
1199            self.0.encode(encoder, offset + 0, depth)?;
1200            Ok(())
1201        }
1202    }
1203
1204    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1205        for PhyCreateIfaceResponse
1206    {
1207        #[inline(always)]
1208        fn new_empty() -> Self {
1209            Self { iface_id: fidl::new_empty!(u16, D) }
1210        }
1211
1212        #[inline]
1213        unsafe fn decode(
1214            &mut self,
1215            decoder: &mut fidl::encoding::Decoder<'_, D>,
1216            offset: usize,
1217            _depth: fidl::encoding::Depth,
1218        ) -> fidl::Result<()> {
1219            decoder.debug_check_bounds::<Self>(offset);
1220            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1221            // Verify that padding bytes are zero.
1222            // Copy from the buffer into the object.
1223            unsafe {
1224                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1225            }
1226            Ok(())
1227        }
1228    }
1229
1230    impl fidl::encoding::ValueTypeMarker for PhyGetCountryResponse {
1231        type Borrowed<'a> = &'a Self;
1232        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1233            value
1234        }
1235    }
1236
1237    unsafe impl fidl::encoding::TypeMarker for PhyGetCountryResponse {
1238        type Owned = Self;
1239
1240        #[inline(always)]
1241        fn inline_align(_context: fidl::encoding::Context) -> usize {
1242            1
1243        }
1244
1245        #[inline(always)]
1246        fn inline_size(_context: fidl::encoding::Context) -> usize {
1247            2
1248        }
1249        #[inline(always)]
1250        fn encode_is_copy() -> bool {
1251            true
1252        }
1253
1254        #[inline(always)]
1255        fn decode_is_copy() -> bool {
1256            true
1257        }
1258    }
1259
1260    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhyGetCountryResponse, D>
1261        for &PhyGetCountryResponse
1262    {
1263        #[inline]
1264        unsafe fn encode(
1265            self,
1266            encoder: &mut fidl::encoding::Encoder<'_, D>,
1267            offset: usize,
1268            _depth: fidl::encoding::Depth,
1269        ) -> fidl::Result<()> {
1270            encoder.debug_check_bounds::<PhyGetCountryResponse>(offset);
1271            unsafe {
1272                // Copy the object into the buffer.
1273                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1274                (buf_ptr as *mut PhyGetCountryResponse)
1275                    .write_unaligned((self as *const PhyGetCountryResponse).read());
1276                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1277                // done second because the memcpy will write garbage to these bytes.
1278            }
1279            Ok(())
1280        }
1281    }
1282    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CountryCode, D>>
1283        fidl::encoding::Encode<PhyGetCountryResponse, D> for (T0,)
1284    {
1285        #[inline]
1286        unsafe fn encode(
1287            self,
1288            encoder: &mut fidl::encoding::Encoder<'_, D>,
1289            offset: usize,
1290            depth: fidl::encoding::Depth,
1291        ) -> fidl::Result<()> {
1292            encoder.debug_check_bounds::<PhyGetCountryResponse>(offset);
1293            // Zero out padding regions. There's no need to apply masks
1294            // because the unmasked parts will be overwritten by fields.
1295            // Write the fields.
1296            self.0.encode(encoder, offset + 0, depth)?;
1297            Ok(())
1298        }
1299    }
1300
1301    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhyGetCountryResponse {
1302        #[inline(always)]
1303        fn new_empty() -> Self {
1304            Self { resp: fidl::new_empty!(CountryCode, D) }
1305        }
1306
1307        #[inline]
1308        unsafe fn decode(
1309            &mut self,
1310            decoder: &mut fidl::encoding::Decoder<'_, D>,
1311            offset: usize,
1312            _depth: fidl::encoding::Depth,
1313        ) -> fidl::Result<()> {
1314            decoder.debug_check_bounds::<Self>(offset);
1315            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1316            // Verify that padding bytes are zero.
1317            // Copy from the buffer into the object.
1318            unsafe {
1319                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1320            }
1321            Ok(())
1322        }
1323    }
1324
1325    impl fidl::encoding::ValueTypeMarker for PhyGetPowerSaveModeResponse {
1326        type Borrowed<'a> = &'a Self;
1327        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1328            value
1329        }
1330    }
1331
1332    unsafe impl fidl::encoding::TypeMarker for PhyGetPowerSaveModeResponse {
1333        type Owned = Self;
1334
1335        #[inline(always)]
1336        fn inline_align(_context: fidl::encoding::Context) -> usize {
1337            4
1338        }
1339
1340        #[inline(always)]
1341        fn inline_size(_context: fidl::encoding::Context) -> usize {
1342            4
1343        }
1344    }
1345
1346    unsafe impl<D: fidl::encoding::ResourceDialect>
1347        fidl::encoding::Encode<PhyGetPowerSaveModeResponse, D> for &PhyGetPowerSaveModeResponse
1348    {
1349        #[inline]
1350        unsafe fn encode(
1351            self,
1352            encoder: &mut fidl::encoding::Encoder<'_, D>,
1353            offset: usize,
1354            _depth: fidl::encoding::Depth,
1355        ) -> fidl::Result<()> {
1356            encoder.debug_check_bounds::<PhyGetPowerSaveModeResponse>(offset);
1357            // Delegate to tuple encoding.
1358            fidl::encoding::Encode::<PhyGetPowerSaveModeResponse, D>::encode(
1359                (
1360                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1361                ),
1362                encoder, offset, _depth
1363            )
1364        }
1365    }
1366    unsafe impl<
1367            D: fidl::encoding::ResourceDialect,
1368            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
1369        > fidl::encoding::Encode<PhyGetPowerSaveModeResponse, D> for (T0,)
1370    {
1371        #[inline]
1372        unsafe fn encode(
1373            self,
1374            encoder: &mut fidl::encoding::Encoder<'_, D>,
1375            offset: usize,
1376            depth: fidl::encoding::Depth,
1377        ) -> fidl::Result<()> {
1378            encoder.debug_check_bounds::<PhyGetPowerSaveModeResponse>(offset);
1379            // Zero out padding regions. There's no need to apply masks
1380            // because the unmasked parts will be overwritten by fields.
1381            // Write the fields.
1382            self.0.encode(encoder, offset + 0, depth)?;
1383            Ok(())
1384        }
1385    }
1386
1387    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1388        for PhyGetPowerSaveModeResponse
1389    {
1390        #[inline(always)]
1391        fn new_empty() -> Self {
1392            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
1393        }
1394
1395        #[inline]
1396        unsafe fn decode(
1397            &mut self,
1398            decoder: &mut fidl::encoding::Decoder<'_, D>,
1399            offset: usize,
1400            _depth: fidl::encoding::Depth,
1401        ) -> fidl::Result<()> {
1402            decoder.debug_check_bounds::<Self>(offset);
1403            // Verify that padding bytes are zero.
1404            fidl::decode!(
1405                fidl_fuchsia_wlan_common__common::PowerSaveType,
1406                D,
1407                &mut self.resp,
1408                decoder,
1409                offset + 0,
1410                _depth
1411            )?;
1412            Ok(())
1413        }
1414    }
1415
1416    impl fidl::encoding::ValueTypeMarker for PhyGetSupportedMacRolesResponse {
1417        type Borrowed<'a> = &'a Self;
1418        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1419            value
1420        }
1421    }
1422
1423    unsafe impl fidl::encoding::TypeMarker for PhyGetSupportedMacRolesResponse {
1424        type Owned = Self;
1425
1426        #[inline(always)]
1427        fn inline_align(_context: fidl::encoding::Context) -> usize {
1428            8
1429        }
1430
1431        #[inline(always)]
1432        fn inline_size(_context: fidl::encoding::Context) -> usize {
1433            16
1434        }
1435    }
1436
1437    unsafe impl<D: fidl::encoding::ResourceDialect>
1438        fidl::encoding::Encode<PhyGetSupportedMacRolesResponse, D>
1439        for &PhyGetSupportedMacRolesResponse
1440    {
1441        #[inline]
1442        unsafe fn encode(
1443            self,
1444            encoder: &mut fidl::encoding::Encoder<'_, D>,
1445            offset: usize,
1446            _depth: fidl::encoding::Depth,
1447        ) -> fidl::Result<()> {
1448            encoder.debug_check_bounds::<PhyGetSupportedMacRolesResponse>(offset);
1449            // Delegate to tuple encoding.
1450            fidl::encoding::Encode::<PhyGetSupportedMacRolesResponse, D>::encode(
1451                (
1452                    <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
1453                ),
1454                encoder, offset, _depth
1455            )
1456        }
1457    }
1458    unsafe impl<
1459            D: fidl::encoding::ResourceDialect,
1460            T0: fidl::encoding::Encode<
1461                fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>,
1462                D,
1463            >,
1464        > fidl::encoding::Encode<PhyGetSupportedMacRolesResponse, D> for (T0,)
1465    {
1466        #[inline]
1467        unsafe fn encode(
1468            self,
1469            encoder: &mut fidl::encoding::Encoder<'_, D>,
1470            offset: usize,
1471            depth: fidl::encoding::Depth,
1472        ) -> fidl::Result<()> {
1473            encoder.debug_check_bounds::<PhyGetSupportedMacRolesResponse>(offset);
1474            // Zero out padding regions. There's no need to apply masks
1475            // because the unmasked parts will be overwritten by fields.
1476            // Write the fields.
1477            self.0.encode(encoder, offset + 0, depth)?;
1478            Ok(())
1479        }
1480    }
1481
1482    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1483        for PhyGetSupportedMacRolesResponse
1484    {
1485        #[inline(always)]
1486        fn new_empty() -> Self {
1487            Self {
1488                supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D),
1489            }
1490        }
1491
1492        #[inline]
1493        unsafe fn decode(
1494            &mut self,
1495            decoder: &mut fidl::encoding::Decoder<'_, D>,
1496            offset: usize,
1497            _depth: fidl::encoding::Depth,
1498        ) -> fidl::Result<()> {
1499            decoder.debug_check_bounds::<Self>(offset);
1500            // Verify that padding bytes are zero.
1501            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
1502            Ok(())
1503        }
1504    }
1505}