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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
46#[repr(u8)]
47pub enum CriticalErrorReason {
48    /// Notifies the receiver that the wlan firmware running on the wlan PHY
49    /// has crashed.  Upon receiving this event, the client can decide to forward it to
50    /// higher layers of the wlan stack, handle it itself (for example by requesting a
51    /// reset via wlanphimpl) or ignore it.
52    FwCrash = 1,
53}
54
55impl CriticalErrorReason {
56    #[inline]
57    pub fn from_primitive(prim: u8) -> Option<Self> {
58        match prim {
59            1 => Some(Self::FwCrash),
60            _ => None,
61        }
62    }
63
64    #[inline]
65    pub const fn into_primitive(self) -> u8 {
66        self as u8
67    }
68}
69
70#[derive(Clone, Debug, PartialEq)]
71pub struct BandInfo {
72    pub band: fidl_fuchsia_wlan_ieee80211__common::WlanBand,
73    pub ht_caps: Option<Box<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>>,
74    pub vht_caps: Option<Box<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>>,
75    pub rates: Vec<u8>,
76    pub operating_channels: Vec<u8>,
77}
78
79impl fidl::Persistable for BandInfo {}
80
81/// The country code for a target WLAN PHY device.
82/// alpha2 is ISO 3166-1 code to indicate a country. eg. AF for Afghanistan.
83#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84#[repr(C)]
85pub struct CountryCode {
86    pub alpha2: [u8; 2],
87}
88
89impl fidl::Persistable for CountryCode {}
90
91#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
92#[repr(C)]
93pub struct DestroyIfaceRequest {
94    pub id: u16,
95}
96
97impl fidl::Persistable for DestroyIfaceRequest {}
98
99#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100#[repr(C)]
101pub struct PhyClearCountryResponse {
102    pub status: i32,
103}
104
105impl fidl::Persistable for PhyClearCountryResponse {}
106
107#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108#[repr(C)]
109pub struct PhyDestroyIfaceRequest {
110    pub req: DestroyIfaceRequest,
111}
112
113impl fidl::Persistable for PhyDestroyIfaceRequest {}
114
115#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
116pub struct PhyOnCriticalErrorRequest {
117    pub reason_code: CriticalErrorReason,
118}
119
120impl fidl::Persistable for PhyOnCriticalErrorRequest {}
121
122#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
123pub struct PhySetBtCoexistenceModeRequest {
124    pub mode: fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
125}
126
127impl fidl::Persistable for PhySetBtCoexistenceModeRequest {}
128
129#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
130#[repr(C)]
131pub struct PhySetCountryRequest {
132    pub req: CountryCode,
133}
134
135impl fidl::Persistable for PhySetCountryRequest {}
136
137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138#[repr(C)]
139pub struct PhySetCountryResponse {
140    pub status: i32,
141}
142
143impl fidl::Persistable for PhySetCountryResponse {}
144
145#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct PhySetPowerSaveModeRequest {
147    pub req: fidl_fuchsia_wlan_common__common::PowerSaveType,
148}
149
150impl fidl::Persistable for PhySetPowerSaveModeRequest {}
151
152#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
153#[repr(C)]
154pub struct PhySetPowerSaveModeResponse {
155    pub status: i32,
156}
157
158impl fidl::Persistable for PhySetPowerSaveModeResponse {}
159
160#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
161pub struct PhySetTxPowerScenarioRequest {
162    pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
163}
164
165impl fidl::Persistable for PhySetTxPowerScenarioRequest {}
166
167#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168#[repr(C)]
169pub struct PhyCreateIfaceResponse {
170    pub iface_id: u16,
171}
172
173impl fidl::Persistable for PhyCreateIfaceResponse {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176#[repr(C)]
177pub struct PhyGetCountryResponse {
178    pub resp: CountryCode,
179}
180
181impl fidl::Persistable for PhyGetCountryResponse {}
182
183#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184pub struct PhyGetPowerSaveModeResponse {
185    pub resp: fidl_fuchsia_wlan_common__common::PowerSaveType,
186}
187
188impl fidl::Persistable for PhyGetPowerSaveModeResponse {}
189
190#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
191pub struct PhyGetPowerStateResponse {
192    pub power_on: bool,
193}
194
195impl fidl::Persistable for PhyGetPowerStateResponse {}
196
197#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
198pub struct PhyGetSupportedMacRolesResponse {
199    pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common__common::WlanMacRole>,
200}
201
202impl fidl::Persistable for PhyGetSupportedMacRolesResponse {}
203
204#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
205pub struct PhyGetTxPowerScenarioResponse {
206    pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
207}
208
209impl fidl::Persistable for PhyGetTxPowerScenarioResponse {}
210
211pub mod connector_ordinals {
212    pub const CONNECT: u64 = 0x2dd039e4ba3a4d26;
213}
214
215pub mod phy_ordinals {
216    pub const GET_SUPPORTED_MAC_ROLES: u64 = 0x18f6b9091aa8a44;
217    pub const CREATE_IFACE: u64 = 0x665940c7aa4b9785;
218    pub const DESTROY_IFACE: u64 = 0x75a3048ae01942e8;
219    pub const SET_COUNTRY: u64 = 0x1367e9997ba00806;
220    pub const GET_COUNTRY: u64 = 0x3ed3281ce6feab3e;
221    pub const CLEAR_COUNTRY: u64 = 0x4ea9b83a9c494c95;
222    pub const SET_POWER_SAVE_MODE: u64 = 0x56be34b2f3abe17f;
223    pub const GET_POWER_SAVE_MODE: u64 = 0x3f7019c3672bc798;
224    pub const POWER_DOWN: u64 = 0x56bcae4b27a564d2;
225    pub const POWER_UP: u64 = 0x7aad8e525738b946;
226    pub const RESET: u64 = 0x647cdcc9def3db87;
227    pub const GET_POWER_STATE: u64 = 0xcddef2b16c7f00f;
228    pub const SET_BT_COEXISTENCE_MODE: u64 = 0x76c66d8313e73996;
229    pub const SET_TX_POWER_SCENARIO: u64 = 0x22748ccac6d497df;
230    pub const RESET_TX_POWER_SCENARIO: u64 = 0x4f9b16347768b8dd;
231    pub const GET_TX_POWER_SCENARIO: u64 = 0x3f6681e6458c14c2;
232    pub const ON_CRITICAL_ERROR: u64 = 0x7c82e274966111ab;
233}
234
235mod internal {
236    use super::*;
237    unsafe impl fidl::encoding::TypeMarker for Capability {
238        type Owned = Self;
239
240        #[inline(always)]
241        fn inline_align(_context: fidl::encoding::Context) -> usize {
242            std::mem::align_of::<u32>()
243        }
244
245        #[inline(always)]
246        fn inline_size(_context: fidl::encoding::Context) -> usize {
247            std::mem::size_of::<u32>()
248        }
249
250        #[inline(always)]
251        fn encode_is_copy() -> bool {
252            true
253        }
254
255        #[inline(always)]
256        fn decode_is_copy() -> bool {
257            false
258        }
259    }
260
261    impl fidl::encoding::ValueTypeMarker for Capability {
262        type Borrowed<'a> = Self;
263        #[inline(always)]
264        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
265            *value
266        }
267    }
268
269    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
270        #[inline]
271        unsafe fn encode(
272            self,
273            encoder: &mut fidl::encoding::Encoder<'_, D>,
274            offset: usize,
275            _depth: fidl::encoding::Depth,
276        ) -> fidl::Result<()> {
277            encoder.debug_check_bounds::<Self>(offset);
278            encoder.write_num(self.into_primitive(), offset);
279            Ok(())
280        }
281    }
282
283    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
284        #[inline(always)]
285        fn new_empty() -> Self {
286            Self::ShortPreamble
287        }
288
289        #[inline]
290        unsafe fn decode(
291            &mut self,
292            decoder: &mut fidl::encoding::Decoder<'_, D>,
293            offset: usize,
294            _depth: fidl::encoding::Depth,
295        ) -> fidl::Result<()> {
296            decoder.debug_check_bounds::<Self>(offset);
297            let prim = decoder.read_num::<u32>(offset);
298
299            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
300            Ok(())
301        }
302    }
303    unsafe impl fidl::encoding::TypeMarker for CriticalErrorReason {
304        type Owned = Self;
305
306        #[inline(always)]
307        fn inline_align(_context: fidl::encoding::Context) -> usize {
308            std::mem::align_of::<u8>()
309        }
310
311        #[inline(always)]
312        fn inline_size(_context: fidl::encoding::Context) -> usize {
313            std::mem::size_of::<u8>()
314        }
315
316        #[inline(always)]
317        fn encode_is_copy() -> bool {
318            true
319        }
320
321        #[inline(always)]
322        fn decode_is_copy() -> bool {
323            false
324        }
325    }
326
327    impl fidl::encoding::ValueTypeMarker for CriticalErrorReason {
328        type Borrowed<'a> = Self;
329        #[inline(always)]
330        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
331            *value
332        }
333    }
334
335    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
336        for CriticalErrorReason
337    {
338        #[inline]
339        unsafe fn encode(
340            self,
341            encoder: &mut fidl::encoding::Encoder<'_, D>,
342            offset: usize,
343            _depth: fidl::encoding::Depth,
344        ) -> fidl::Result<()> {
345            encoder.debug_check_bounds::<Self>(offset);
346            encoder.write_num(self.into_primitive(), offset);
347            Ok(())
348        }
349    }
350
351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CriticalErrorReason {
352        #[inline(always)]
353        fn new_empty() -> Self {
354            Self::FwCrash
355        }
356
357        #[inline]
358        unsafe fn decode(
359            &mut self,
360            decoder: &mut fidl::encoding::Decoder<'_, D>,
361            offset: usize,
362            _depth: fidl::encoding::Depth,
363        ) -> fidl::Result<()> {
364            decoder.debug_check_bounds::<Self>(offset);
365            let prim = decoder.read_num::<u8>(offset);
366
367            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
368            Ok(())
369        }
370    }
371
372    impl fidl::encoding::ValueTypeMarker for BandInfo {
373        type Borrowed<'a> = &'a Self;
374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
375            value
376        }
377    }
378
379    unsafe impl fidl::encoding::TypeMarker for BandInfo {
380        type Owned = Self;
381
382        #[inline(always)]
383        fn inline_align(_context: fidl::encoding::Context) -> usize {
384            8
385        }
386
387        #[inline(always)]
388        fn inline_size(_context: fidl::encoding::Context) -> usize {
389            56
390        }
391    }
392
393    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BandInfo, D> for &BandInfo {
394        #[inline]
395        unsafe fn encode(
396            self,
397            encoder: &mut fidl::encoding::Encoder<'_, D>,
398            offset: usize,
399            _depth: fidl::encoding::Depth,
400        ) -> fidl::Result<()> {
401            encoder.debug_check_bounds::<BandInfo>(offset);
402            // Delegate to tuple encoding.
403            fidl::encoding::Encode::<BandInfo, D>::encode(
404                (
405                    <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow(&self.band),
406                    <fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities> as fidl::encoding::ValueTypeMarker>::borrow(&self.ht_caps),
407                    <fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities> as fidl::encoding::ValueTypeMarker>::borrow(&self.vht_caps),
408                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow(&self.rates),
409                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.operating_channels),
410                ),
411                encoder, offset, _depth
412            )
413        }
414    }
415    unsafe impl<
416        D: fidl::encoding::ResourceDialect,
417        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>,
418        T1: fidl::encoding::Encode<
419                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
420                D,
421            >,
422        T2: fidl::encoding::Encode<
423                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
424                D,
425            >,
426        T3: fidl::encoding::Encode<fidl::encoding::Vector<u8, 12>, D>,
427        T4: fidl::encoding::Encode<fidl::encoding::Vector<u8, 256>, D>,
428    > fidl::encoding::Encode<BandInfo, D> for (T0, T1, T2, T3, T4)
429    {
430        #[inline]
431        unsafe fn encode(
432            self,
433            encoder: &mut fidl::encoding::Encoder<'_, D>,
434            offset: usize,
435            depth: fidl::encoding::Depth,
436        ) -> fidl::Result<()> {
437            encoder.debug_check_bounds::<BandInfo>(offset);
438            // Zero out padding regions. There's no need to apply masks
439            // because the unmasked parts will be overwritten by fields.
440            unsafe {
441                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
442                (ptr as *mut u64).write_unaligned(0);
443            }
444            // Write the fields.
445            self.0.encode(encoder, offset + 0, depth)?;
446            self.1.encode(encoder, offset + 8, depth)?;
447            self.2.encode(encoder, offset + 16, depth)?;
448            self.3.encode(encoder, offset + 24, depth)?;
449            self.4.encode(encoder, offset + 40, depth)?;
450            Ok(())
451        }
452    }
453
454    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BandInfo {
455        #[inline(always)]
456        fn new_empty() -> Self {
457            Self {
458                band: fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D),
459                ht_caps: fidl::new_empty!(
460                    fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
461                    D
462                ),
463                vht_caps: fidl::new_empty!(
464                    fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
465                    D
466                ),
467                rates: fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D),
468                operating_channels: fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D),
469            }
470        }
471
472        #[inline]
473        unsafe fn decode(
474            &mut self,
475            decoder: &mut fidl::encoding::Decoder<'_, D>,
476            offset: usize,
477            _depth: fidl::encoding::Depth,
478        ) -> fidl::Result<()> {
479            decoder.debug_check_bounds::<Self>(offset);
480            // Verify that padding bytes are zero.
481            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
482            let padval = unsafe { (ptr as *const u64).read_unaligned() };
483            let mask = 0xffffffffffffff00u64;
484            let maskedval = padval & mask;
485            if maskedval != 0 {
486                return Err(fidl::Error::NonZeroPadding {
487                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
488                });
489            }
490            fidl::decode!(
491                fidl_fuchsia_wlan_ieee80211__common::WlanBand,
492                D,
493                &mut self.band,
494                decoder,
495                offset + 0,
496                _depth
497            )?;
498            fidl::decode!(
499                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
500                D,
501                &mut self.ht_caps,
502                decoder,
503                offset + 8,
504                _depth
505            )?;
506            fidl::decode!(
507                fidl::encoding::Boxed<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
508                D,
509                &mut self.vht_caps,
510                decoder,
511                offset + 16,
512                _depth
513            )?;
514            fidl::decode!(fidl::encoding::Vector<u8, 12>, D, &mut self.rates, decoder, offset + 24, _depth)?;
515            fidl::decode!(fidl::encoding::Vector<u8, 256>, D, &mut self.operating_channels, decoder, offset + 40, _depth)?;
516            Ok(())
517        }
518    }
519
520    impl fidl::encoding::ValueTypeMarker for CountryCode {
521        type Borrowed<'a> = &'a Self;
522        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
523            value
524        }
525    }
526
527    unsafe impl fidl::encoding::TypeMarker for CountryCode {
528        type Owned = Self;
529
530        #[inline(always)]
531        fn inline_align(_context: fidl::encoding::Context) -> usize {
532            1
533        }
534
535        #[inline(always)]
536        fn inline_size(_context: fidl::encoding::Context) -> usize {
537            2
538        }
539        #[inline(always)]
540        fn encode_is_copy() -> bool {
541            true
542        }
543
544        #[inline(always)]
545        fn decode_is_copy() -> bool {
546            true
547        }
548    }
549
550    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CountryCode, D>
551        for &CountryCode
552    {
553        #[inline]
554        unsafe fn encode(
555            self,
556            encoder: &mut fidl::encoding::Encoder<'_, D>,
557            offset: usize,
558            _depth: fidl::encoding::Depth,
559        ) -> fidl::Result<()> {
560            encoder.debug_check_bounds::<CountryCode>(offset);
561            unsafe {
562                // Copy the object into the buffer.
563                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
564                (buf_ptr as *mut CountryCode).write_unaligned((self as *const CountryCode).read());
565                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
566                // done second because the memcpy will write garbage to these bytes.
567            }
568            Ok(())
569        }
570    }
571    unsafe impl<
572        D: fidl::encoding::ResourceDialect,
573        T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
574    > fidl::encoding::Encode<CountryCode, D> for (T0,)
575    {
576        #[inline]
577        unsafe fn encode(
578            self,
579            encoder: &mut fidl::encoding::Encoder<'_, D>,
580            offset: usize,
581            depth: fidl::encoding::Depth,
582        ) -> fidl::Result<()> {
583            encoder.debug_check_bounds::<CountryCode>(offset);
584            // Zero out padding regions. There's no need to apply masks
585            // because the unmasked parts will be overwritten by fields.
586            // Write the fields.
587            self.0.encode(encoder, offset + 0, depth)?;
588            Ok(())
589        }
590    }
591
592    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CountryCode {
593        #[inline(always)]
594        fn new_empty() -> Self {
595            Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
596        }
597
598        #[inline]
599        unsafe fn decode(
600            &mut self,
601            decoder: &mut fidl::encoding::Decoder<'_, D>,
602            offset: usize,
603            _depth: fidl::encoding::Depth,
604        ) -> fidl::Result<()> {
605            decoder.debug_check_bounds::<Self>(offset);
606            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
607            // Verify that padding bytes are zero.
608            // Copy from the buffer into the object.
609            unsafe {
610                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
611            }
612            Ok(())
613        }
614    }
615
616    impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
617        type Borrowed<'a> = &'a Self;
618        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
619            value
620        }
621    }
622
623    unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
624        type Owned = Self;
625
626        #[inline(always)]
627        fn inline_align(_context: fidl::encoding::Context) -> usize {
628            2
629        }
630
631        #[inline(always)]
632        fn inline_size(_context: fidl::encoding::Context) -> usize {
633            2
634        }
635        #[inline(always)]
636        fn encode_is_copy() -> bool {
637            true
638        }
639
640        #[inline(always)]
641        fn decode_is_copy() -> bool {
642            true
643        }
644    }
645
646    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyIfaceRequest, D>
647        for &DestroyIfaceRequest
648    {
649        #[inline]
650        unsafe fn encode(
651            self,
652            encoder: &mut fidl::encoding::Encoder<'_, D>,
653            offset: usize,
654            _depth: fidl::encoding::Depth,
655        ) -> fidl::Result<()> {
656            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
657            unsafe {
658                // Copy the object into the buffer.
659                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
660                (buf_ptr as *mut DestroyIfaceRequest)
661                    .write_unaligned((self as *const DestroyIfaceRequest).read());
662                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
663                // done second because the memcpy will write garbage to these bytes.
664            }
665            Ok(())
666        }
667    }
668    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
669        fidl::encoding::Encode<DestroyIfaceRequest, D> for (T0,)
670    {
671        #[inline]
672        unsafe fn encode(
673            self,
674            encoder: &mut fidl::encoding::Encoder<'_, D>,
675            offset: usize,
676            depth: fidl::encoding::Depth,
677        ) -> fidl::Result<()> {
678            encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
679            // Zero out padding regions. There's no need to apply masks
680            // because the unmasked parts will be overwritten by fields.
681            // Write the fields.
682            self.0.encode(encoder, offset + 0, depth)?;
683            Ok(())
684        }
685    }
686
687    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
688        #[inline(always)]
689        fn new_empty() -> Self {
690            Self { id: fidl::new_empty!(u16, D) }
691        }
692
693        #[inline]
694        unsafe fn decode(
695            &mut self,
696            decoder: &mut fidl::encoding::Decoder<'_, D>,
697            offset: usize,
698            _depth: fidl::encoding::Depth,
699        ) -> fidl::Result<()> {
700            decoder.debug_check_bounds::<Self>(offset);
701            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
702            // Verify that padding bytes are zero.
703            // Copy from the buffer into the object.
704            unsafe {
705                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
706            }
707            Ok(())
708        }
709    }
710
711    impl fidl::encoding::ValueTypeMarker for PhyClearCountryResponse {
712        type Borrowed<'a> = &'a Self;
713        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
714            value
715        }
716    }
717
718    unsafe impl fidl::encoding::TypeMarker for PhyClearCountryResponse {
719        type Owned = Self;
720
721        #[inline(always)]
722        fn inline_align(_context: fidl::encoding::Context) -> usize {
723            4
724        }
725
726        #[inline(always)]
727        fn inline_size(_context: fidl::encoding::Context) -> usize {
728            4
729        }
730        #[inline(always)]
731        fn encode_is_copy() -> bool {
732            true
733        }
734
735        #[inline(always)]
736        fn decode_is_copy() -> bool {
737            true
738        }
739    }
740
741    unsafe impl<D: fidl::encoding::ResourceDialect>
742        fidl::encoding::Encode<PhyClearCountryResponse, D> for &PhyClearCountryResponse
743    {
744        #[inline]
745        unsafe fn encode(
746            self,
747            encoder: &mut fidl::encoding::Encoder<'_, D>,
748            offset: usize,
749            _depth: fidl::encoding::Depth,
750        ) -> fidl::Result<()> {
751            encoder.debug_check_bounds::<PhyClearCountryResponse>(offset);
752            unsafe {
753                // Copy the object into the buffer.
754                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
755                (buf_ptr as *mut PhyClearCountryResponse)
756                    .write_unaligned((self as *const PhyClearCountryResponse).read());
757                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
758                // done second because the memcpy will write garbage to these bytes.
759            }
760            Ok(())
761        }
762    }
763    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
764        fidl::encoding::Encode<PhyClearCountryResponse, D> for (T0,)
765    {
766        #[inline]
767        unsafe fn encode(
768            self,
769            encoder: &mut fidl::encoding::Encoder<'_, D>,
770            offset: usize,
771            depth: fidl::encoding::Depth,
772        ) -> fidl::Result<()> {
773            encoder.debug_check_bounds::<PhyClearCountryResponse>(offset);
774            // Zero out padding regions. There's no need to apply masks
775            // because the unmasked parts will be overwritten by fields.
776            // Write the fields.
777            self.0.encode(encoder, offset + 0, depth)?;
778            Ok(())
779        }
780    }
781
782    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
783        for PhyClearCountryResponse
784    {
785        #[inline(always)]
786        fn new_empty() -> Self {
787            Self { status: fidl::new_empty!(i32, D) }
788        }
789
790        #[inline]
791        unsafe fn decode(
792            &mut self,
793            decoder: &mut fidl::encoding::Decoder<'_, D>,
794            offset: usize,
795            _depth: fidl::encoding::Depth,
796        ) -> fidl::Result<()> {
797            decoder.debug_check_bounds::<Self>(offset);
798            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
799            // Verify that padding bytes are zero.
800            // Copy from the buffer into the object.
801            unsafe {
802                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
803            }
804            Ok(())
805        }
806    }
807
808    impl fidl::encoding::ValueTypeMarker for PhyDestroyIfaceRequest {
809        type Borrowed<'a> = &'a Self;
810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
811            value
812        }
813    }
814
815    unsafe impl fidl::encoding::TypeMarker for PhyDestroyIfaceRequest {
816        type Owned = Self;
817
818        #[inline(always)]
819        fn inline_align(_context: fidl::encoding::Context) -> usize {
820            2
821        }
822
823        #[inline(always)]
824        fn inline_size(_context: fidl::encoding::Context) -> usize {
825            2
826        }
827        #[inline(always)]
828        fn encode_is_copy() -> bool {
829            true
830        }
831
832        #[inline(always)]
833        fn decode_is_copy() -> bool {
834            true
835        }
836    }
837
838    unsafe impl<D: fidl::encoding::ResourceDialect>
839        fidl::encoding::Encode<PhyDestroyIfaceRequest, D> for &PhyDestroyIfaceRequest
840    {
841        #[inline]
842        unsafe fn encode(
843            self,
844            encoder: &mut fidl::encoding::Encoder<'_, D>,
845            offset: usize,
846            _depth: fidl::encoding::Depth,
847        ) -> fidl::Result<()> {
848            encoder.debug_check_bounds::<PhyDestroyIfaceRequest>(offset);
849            unsafe {
850                // Copy the object into the buffer.
851                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
852                (buf_ptr as *mut PhyDestroyIfaceRequest)
853                    .write_unaligned((self as *const PhyDestroyIfaceRequest).read());
854                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
855                // done second because the memcpy will write garbage to these bytes.
856            }
857            Ok(())
858        }
859    }
860    unsafe impl<
861        D: fidl::encoding::ResourceDialect,
862        T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
863    > fidl::encoding::Encode<PhyDestroyIfaceRequest, D> for (T0,)
864    {
865        #[inline]
866        unsafe fn encode(
867            self,
868            encoder: &mut fidl::encoding::Encoder<'_, D>,
869            offset: usize,
870            depth: fidl::encoding::Depth,
871        ) -> fidl::Result<()> {
872            encoder.debug_check_bounds::<PhyDestroyIfaceRequest>(offset);
873            // Zero out padding regions. There's no need to apply masks
874            // because the unmasked parts will be overwritten by fields.
875            // Write the fields.
876            self.0.encode(encoder, offset + 0, depth)?;
877            Ok(())
878        }
879    }
880
881    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
882        for PhyDestroyIfaceRequest
883    {
884        #[inline(always)]
885        fn new_empty() -> Self {
886            Self { req: fidl::new_empty!(DestroyIfaceRequest, D) }
887        }
888
889        #[inline]
890        unsafe fn decode(
891            &mut self,
892            decoder: &mut fidl::encoding::Decoder<'_, D>,
893            offset: usize,
894            _depth: fidl::encoding::Depth,
895        ) -> fidl::Result<()> {
896            decoder.debug_check_bounds::<Self>(offset);
897            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
898            // Verify that padding bytes are zero.
899            // Copy from the buffer into the object.
900            unsafe {
901                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
902            }
903            Ok(())
904        }
905    }
906
907    impl fidl::encoding::ValueTypeMarker for PhyOnCriticalErrorRequest {
908        type Borrowed<'a> = &'a Self;
909        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
910            value
911        }
912    }
913
914    unsafe impl fidl::encoding::TypeMarker for PhyOnCriticalErrorRequest {
915        type Owned = Self;
916
917        #[inline(always)]
918        fn inline_align(_context: fidl::encoding::Context) -> usize {
919            1
920        }
921
922        #[inline(always)]
923        fn inline_size(_context: fidl::encoding::Context) -> usize {
924            1
925        }
926    }
927
928    unsafe impl<D: fidl::encoding::ResourceDialect>
929        fidl::encoding::Encode<PhyOnCriticalErrorRequest, D> for &PhyOnCriticalErrorRequest
930    {
931        #[inline]
932        unsafe fn encode(
933            self,
934            encoder: &mut fidl::encoding::Encoder<'_, D>,
935            offset: usize,
936            _depth: fidl::encoding::Depth,
937        ) -> fidl::Result<()> {
938            encoder.debug_check_bounds::<PhyOnCriticalErrorRequest>(offset);
939            // Delegate to tuple encoding.
940            fidl::encoding::Encode::<PhyOnCriticalErrorRequest, D>::encode(
941                (<CriticalErrorReason as fidl::encoding::ValueTypeMarker>::borrow(
942                    &self.reason_code,
943                ),),
944                encoder,
945                offset,
946                _depth,
947            )
948        }
949    }
950    unsafe impl<
951        D: fidl::encoding::ResourceDialect,
952        T0: fidl::encoding::Encode<CriticalErrorReason, D>,
953    > fidl::encoding::Encode<PhyOnCriticalErrorRequest, D> for (T0,)
954    {
955        #[inline]
956        unsafe fn encode(
957            self,
958            encoder: &mut fidl::encoding::Encoder<'_, D>,
959            offset: usize,
960            depth: fidl::encoding::Depth,
961        ) -> fidl::Result<()> {
962            encoder.debug_check_bounds::<PhyOnCriticalErrorRequest>(offset);
963            // Zero out padding regions. There's no need to apply masks
964            // because the unmasked parts will be overwritten by fields.
965            // Write the fields.
966            self.0.encode(encoder, offset + 0, depth)?;
967            Ok(())
968        }
969    }
970
971    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
972        for PhyOnCriticalErrorRequest
973    {
974        #[inline(always)]
975        fn new_empty() -> Self {
976            Self { reason_code: fidl::new_empty!(CriticalErrorReason, D) }
977        }
978
979        #[inline]
980        unsafe fn decode(
981            &mut self,
982            decoder: &mut fidl::encoding::Decoder<'_, D>,
983            offset: usize,
984            _depth: fidl::encoding::Depth,
985        ) -> fidl::Result<()> {
986            decoder.debug_check_bounds::<Self>(offset);
987            // Verify that padding bytes are zero.
988            fidl::decode!(
989                CriticalErrorReason,
990                D,
991                &mut self.reason_code,
992                decoder,
993                offset + 0,
994                _depth
995            )?;
996            Ok(())
997        }
998    }
999
1000    impl fidl::encoding::ValueTypeMarker for PhySetBtCoexistenceModeRequest {
1001        type Borrowed<'a> = &'a Self;
1002        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1003            value
1004        }
1005    }
1006
1007    unsafe impl fidl::encoding::TypeMarker for PhySetBtCoexistenceModeRequest {
1008        type Owned = Self;
1009
1010        #[inline(always)]
1011        fn inline_align(_context: fidl::encoding::Context) -> usize {
1012            4
1013        }
1014
1015        #[inline(always)]
1016        fn inline_size(_context: fidl::encoding::Context) -> usize {
1017            4
1018        }
1019    }
1020
1021    unsafe impl<D: fidl::encoding::ResourceDialect>
1022        fidl::encoding::Encode<PhySetBtCoexistenceModeRequest, D>
1023        for &PhySetBtCoexistenceModeRequest
1024    {
1025        #[inline]
1026        unsafe fn encode(
1027            self,
1028            encoder: &mut fidl::encoding::Encoder<'_, D>,
1029            offset: usize,
1030            _depth: fidl::encoding::Depth,
1031        ) -> fidl::Result<()> {
1032            encoder.debug_check_bounds::<PhySetBtCoexistenceModeRequest>(offset);
1033            // Delegate to tuple encoding.
1034            fidl::encoding::Encode::<PhySetBtCoexistenceModeRequest, D>::encode(
1035                (
1036                    <fidl_fuchsia_wlan_internal__common::BtCoexistenceMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
1037                ),
1038                encoder, offset, _depth
1039            )
1040        }
1041    }
1042    unsafe impl<
1043        D: fidl::encoding::ResourceDialect,
1044        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D>,
1045    > fidl::encoding::Encode<PhySetBtCoexistenceModeRequest, D> for (T0,)
1046    {
1047        #[inline]
1048        unsafe fn encode(
1049            self,
1050            encoder: &mut fidl::encoding::Encoder<'_, D>,
1051            offset: usize,
1052            depth: fidl::encoding::Depth,
1053        ) -> fidl::Result<()> {
1054            encoder.debug_check_bounds::<PhySetBtCoexistenceModeRequest>(offset);
1055            // Zero out padding regions. There's no need to apply masks
1056            // because the unmasked parts will be overwritten by fields.
1057            // Write the fields.
1058            self.0.encode(encoder, offset + 0, depth)?;
1059            Ok(())
1060        }
1061    }
1062
1063    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1064        for PhySetBtCoexistenceModeRequest
1065    {
1066        #[inline(always)]
1067        fn new_empty() -> Self {
1068            Self {
1069                mode: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D),
1070            }
1071        }
1072
1073        #[inline]
1074        unsafe fn decode(
1075            &mut self,
1076            decoder: &mut fidl::encoding::Decoder<'_, D>,
1077            offset: usize,
1078            _depth: fidl::encoding::Depth,
1079        ) -> fidl::Result<()> {
1080            decoder.debug_check_bounds::<Self>(offset);
1081            // Verify that padding bytes are zero.
1082            fidl::decode!(
1083                fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
1084                D,
1085                &mut self.mode,
1086                decoder,
1087                offset + 0,
1088                _depth
1089            )?;
1090            Ok(())
1091        }
1092    }
1093
1094    impl fidl::encoding::ValueTypeMarker for PhySetCountryRequest {
1095        type Borrowed<'a> = &'a Self;
1096        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1097            value
1098        }
1099    }
1100
1101    unsafe impl fidl::encoding::TypeMarker for PhySetCountryRequest {
1102        type Owned = Self;
1103
1104        #[inline(always)]
1105        fn inline_align(_context: fidl::encoding::Context) -> usize {
1106            1
1107        }
1108
1109        #[inline(always)]
1110        fn inline_size(_context: fidl::encoding::Context) -> usize {
1111            2
1112        }
1113        #[inline(always)]
1114        fn encode_is_copy() -> bool {
1115            true
1116        }
1117
1118        #[inline(always)]
1119        fn decode_is_copy() -> bool {
1120            true
1121        }
1122    }
1123
1124    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhySetCountryRequest, D>
1125        for &PhySetCountryRequest
1126    {
1127        #[inline]
1128        unsafe fn encode(
1129            self,
1130            encoder: &mut fidl::encoding::Encoder<'_, D>,
1131            offset: usize,
1132            _depth: fidl::encoding::Depth,
1133        ) -> fidl::Result<()> {
1134            encoder.debug_check_bounds::<PhySetCountryRequest>(offset);
1135            unsafe {
1136                // Copy the object into the buffer.
1137                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1138                (buf_ptr as *mut PhySetCountryRequest)
1139                    .write_unaligned((self as *const PhySetCountryRequest).read());
1140                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1141                // done second because the memcpy will write garbage to these bytes.
1142            }
1143            Ok(())
1144        }
1145    }
1146    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CountryCode, D>>
1147        fidl::encoding::Encode<PhySetCountryRequest, D> for (T0,)
1148    {
1149        #[inline]
1150        unsafe fn encode(
1151            self,
1152            encoder: &mut fidl::encoding::Encoder<'_, D>,
1153            offset: usize,
1154            depth: fidl::encoding::Depth,
1155        ) -> fidl::Result<()> {
1156            encoder.debug_check_bounds::<PhySetCountryRequest>(offset);
1157            // Zero out padding regions. There's no need to apply masks
1158            // because the unmasked parts will be overwritten by fields.
1159            // Write the fields.
1160            self.0.encode(encoder, offset + 0, depth)?;
1161            Ok(())
1162        }
1163    }
1164
1165    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhySetCountryRequest {
1166        #[inline(always)]
1167        fn new_empty() -> Self {
1168            Self { req: fidl::new_empty!(CountryCode, D) }
1169        }
1170
1171        #[inline]
1172        unsafe fn decode(
1173            &mut self,
1174            decoder: &mut fidl::encoding::Decoder<'_, D>,
1175            offset: usize,
1176            _depth: fidl::encoding::Depth,
1177        ) -> fidl::Result<()> {
1178            decoder.debug_check_bounds::<Self>(offset);
1179            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1180            // Verify that padding bytes are zero.
1181            // Copy from the buffer into the object.
1182            unsafe {
1183                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1184            }
1185            Ok(())
1186        }
1187    }
1188
1189    impl fidl::encoding::ValueTypeMarker for PhySetCountryResponse {
1190        type Borrowed<'a> = &'a Self;
1191        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1192            value
1193        }
1194    }
1195
1196    unsafe impl fidl::encoding::TypeMarker for PhySetCountryResponse {
1197        type Owned = Self;
1198
1199        #[inline(always)]
1200        fn inline_align(_context: fidl::encoding::Context) -> usize {
1201            4
1202        }
1203
1204        #[inline(always)]
1205        fn inline_size(_context: fidl::encoding::Context) -> usize {
1206            4
1207        }
1208        #[inline(always)]
1209        fn encode_is_copy() -> bool {
1210            true
1211        }
1212
1213        #[inline(always)]
1214        fn decode_is_copy() -> bool {
1215            true
1216        }
1217    }
1218
1219    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhySetCountryResponse, D>
1220        for &PhySetCountryResponse
1221    {
1222        #[inline]
1223        unsafe fn encode(
1224            self,
1225            encoder: &mut fidl::encoding::Encoder<'_, D>,
1226            offset: usize,
1227            _depth: fidl::encoding::Depth,
1228        ) -> fidl::Result<()> {
1229            encoder.debug_check_bounds::<PhySetCountryResponse>(offset);
1230            unsafe {
1231                // Copy the object into the buffer.
1232                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1233                (buf_ptr as *mut PhySetCountryResponse)
1234                    .write_unaligned((self as *const PhySetCountryResponse).read());
1235                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1236                // done second because the memcpy will write garbage to these bytes.
1237            }
1238            Ok(())
1239        }
1240    }
1241    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1242        fidl::encoding::Encode<PhySetCountryResponse, D> for (T0,)
1243    {
1244        #[inline]
1245        unsafe fn encode(
1246            self,
1247            encoder: &mut fidl::encoding::Encoder<'_, D>,
1248            offset: usize,
1249            depth: fidl::encoding::Depth,
1250        ) -> fidl::Result<()> {
1251            encoder.debug_check_bounds::<PhySetCountryResponse>(offset);
1252            // Zero out padding regions. There's no need to apply masks
1253            // because the unmasked parts will be overwritten by fields.
1254            // Write the fields.
1255            self.0.encode(encoder, offset + 0, depth)?;
1256            Ok(())
1257        }
1258    }
1259
1260    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhySetCountryResponse {
1261        #[inline(always)]
1262        fn new_empty() -> Self {
1263            Self { status: fidl::new_empty!(i32, D) }
1264        }
1265
1266        #[inline]
1267        unsafe fn decode(
1268            &mut self,
1269            decoder: &mut fidl::encoding::Decoder<'_, D>,
1270            offset: usize,
1271            _depth: fidl::encoding::Depth,
1272        ) -> fidl::Result<()> {
1273            decoder.debug_check_bounds::<Self>(offset);
1274            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1275            // Verify that padding bytes are zero.
1276            // Copy from the buffer into the object.
1277            unsafe {
1278                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1279            }
1280            Ok(())
1281        }
1282    }
1283
1284    impl fidl::encoding::ValueTypeMarker for PhySetPowerSaveModeRequest {
1285        type Borrowed<'a> = &'a Self;
1286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1287            value
1288        }
1289    }
1290
1291    unsafe impl fidl::encoding::TypeMarker for PhySetPowerSaveModeRequest {
1292        type Owned = Self;
1293
1294        #[inline(always)]
1295        fn inline_align(_context: fidl::encoding::Context) -> usize {
1296            4
1297        }
1298
1299        #[inline(always)]
1300        fn inline_size(_context: fidl::encoding::Context) -> usize {
1301            4
1302        }
1303    }
1304
1305    unsafe impl<D: fidl::encoding::ResourceDialect>
1306        fidl::encoding::Encode<PhySetPowerSaveModeRequest, D> for &PhySetPowerSaveModeRequest
1307    {
1308        #[inline]
1309        unsafe fn encode(
1310            self,
1311            encoder: &mut fidl::encoding::Encoder<'_, D>,
1312            offset: usize,
1313            _depth: fidl::encoding::Depth,
1314        ) -> fidl::Result<()> {
1315            encoder.debug_check_bounds::<PhySetPowerSaveModeRequest>(offset);
1316            // Delegate to tuple encoding.
1317            fidl::encoding::Encode::<PhySetPowerSaveModeRequest, D>::encode(
1318                (
1319                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.req),
1320                ),
1321                encoder, offset, _depth
1322            )
1323        }
1324    }
1325    unsafe impl<
1326        D: fidl::encoding::ResourceDialect,
1327        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
1328    > fidl::encoding::Encode<PhySetPowerSaveModeRequest, D> for (T0,)
1329    {
1330        #[inline]
1331        unsafe fn encode(
1332            self,
1333            encoder: &mut fidl::encoding::Encoder<'_, D>,
1334            offset: usize,
1335            depth: fidl::encoding::Depth,
1336        ) -> fidl::Result<()> {
1337            encoder.debug_check_bounds::<PhySetPowerSaveModeRequest>(offset);
1338            // Zero out padding regions. There's no need to apply masks
1339            // because the unmasked parts will be overwritten by fields.
1340            // Write the fields.
1341            self.0.encode(encoder, offset + 0, depth)?;
1342            Ok(())
1343        }
1344    }
1345
1346    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1347        for PhySetPowerSaveModeRequest
1348    {
1349        #[inline(always)]
1350        fn new_empty() -> Self {
1351            Self { req: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
1352        }
1353
1354        #[inline]
1355        unsafe fn decode(
1356            &mut self,
1357            decoder: &mut fidl::encoding::Decoder<'_, D>,
1358            offset: usize,
1359            _depth: fidl::encoding::Depth,
1360        ) -> fidl::Result<()> {
1361            decoder.debug_check_bounds::<Self>(offset);
1362            // Verify that padding bytes are zero.
1363            fidl::decode!(
1364                fidl_fuchsia_wlan_common__common::PowerSaveType,
1365                D,
1366                &mut self.req,
1367                decoder,
1368                offset + 0,
1369                _depth
1370            )?;
1371            Ok(())
1372        }
1373    }
1374
1375    impl fidl::encoding::ValueTypeMarker for PhySetPowerSaveModeResponse {
1376        type Borrowed<'a> = &'a Self;
1377        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1378            value
1379        }
1380    }
1381
1382    unsafe impl fidl::encoding::TypeMarker for PhySetPowerSaveModeResponse {
1383        type Owned = Self;
1384
1385        #[inline(always)]
1386        fn inline_align(_context: fidl::encoding::Context) -> usize {
1387            4
1388        }
1389
1390        #[inline(always)]
1391        fn inline_size(_context: fidl::encoding::Context) -> usize {
1392            4
1393        }
1394        #[inline(always)]
1395        fn encode_is_copy() -> bool {
1396            true
1397        }
1398
1399        #[inline(always)]
1400        fn decode_is_copy() -> bool {
1401            true
1402        }
1403    }
1404
1405    unsafe impl<D: fidl::encoding::ResourceDialect>
1406        fidl::encoding::Encode<PhySetPowerSaveModeResponse, D> for &PhySetPowerSaveModeResponse
1407    {
1408        #[inline]
1409        unsafe fn encode(
1410            self,
1411            encoder: &mut fidl::encoding::Encoder<'_, D>,
1412            offset: usize,
1413            _depth: fidl::encoding::Depth,
1414        ) -> fidl::Result<()> {
1415            encoder.debug_check_bounds::<PhySetPowerSaveModeResponse>(offset);
1416            unsafe {
1417                // Copy the object into the buffer.
1418                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1419                (buf_ptr as *mut PhySetPowerSaveModeResponse)
1420                    .write_unaligned((self as *const PhySetPowerSaveModeResponse).read());
1421                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1422                // done second because the memcpy will write garbage to these bytes.
1423            }
1424            Ok(())
1425        }
1426    }
1427    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1428        fidl::encoding::Encode<PhySetPowerSaveModeResponse, D> for (T0,)
1429    {
1430        #[inline]
1431        unsafe fn encode(
1432            self,
1433            encoder: &mut fidl::encoding::Encoder<'_, D>,
1434            offset: usize,
1435            depth: fidl::encoding::Depth,
1436        ) -> fidl::Result<()> {
1437            encoder.debug_check_bounds::<PhySetPowerSaveModeResponse>(offset);
1438            // Zero out padding regions. There's no need to apply masks
1439            // because the unmasked parts will be overwritten by fields.
1440            // Write the fields.
1441            self.0.encode(encoder, offset + 0, depth)?;
1442            Ok(())
1443        }
1444    }
1445
1446    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1447        for PhySetPowerSaveModeResponse
1448    {
1449        #[inline(always)]
1450        fn new_empty() -> Self {
1451            Self { status: fidl::new_empty!(i32, D) }
1452        }
1453
1454        #[inline]
1455        unsafe fn decode(
1456            &mut self,
1457            decoder: &mut fidl::encoding::Decoder<'_, D>,
1458            offset: usize,
1459            _depth: fidl::encoding::Depth,
1460        ) -> fidl::Result<()> {
1461            decoder.debug_check_bounds::<Self>(offset);
1462            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1463            // Verify that padding bytes are zero.
1464            // Copy from the buffer into the object.
1465            unsafe {
1466                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1467            }
1468            Ok(())
1469        }
1470    }
1471
1472    impl fidl::encoding::ValueTypeMarker for PhySetTxPowerScenarioRequest {
1473        type Borrowed<'a> = &'a Self;
1474        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1475            value
1476        }
1477    }
1478
1479    unsafe impl fidl::encoding::TypeMarker for PhySetTxPowerScenarioRequest {
1480        type Owned = Self;
1481
1482        #[inline(always)]
1483        fn inline_align(_context: fidl::encoding::Context) -> usize {
1484            4
1485        }
1486
1487        #[inline(always)]
1488        fn inline_size(_context: fidl::encoding::Context) -> usize {
1489            4
1490        }
1491    }
1492
1493    unsafe impl<D: fidl::encoding::ResourceDialect>
1494        fidl::encoding::Encode<PhySetTxPowerScenarioRequest, D> for &PhySetTxPowerScenarioRequest
1495    {
1496        #[inline]
1497        unsafe fn encode(
1498            self,
1499            encoder: &mut fidl::encoding::Encoder<'_, D>,
1500            offset: usize,
1501            _depth: fidl::encoding::Depth,
1502        ) -> fidl::Result<()> {
1503            encoder.debug_check_bounds::<PhySetTxPowerScenarioRequest>(offset);
1504            // Delegate to tuple encoding.
1505            fidl::encoding::Encode::<PhySetTxPowerScenarioRequest, D>::encode(
1506                (
1507                    <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
1508                ),
1509                encoder, offset, _depth
1510            )
1511        }
1512    }
1513    unsafe impl<
1514        D: fidl::encoding::ResourceDialect,
1515        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
1516    > fidl::encoding::Encode<PhySetTxPowerScenarioRequest, D> for (T0,)
1517    {
1518        #[inline]
1519        unsafe fn encode(
1520            self,
1521            encoder: &mut fidl::encoding::Encoder<'_, D>,
1522            offset: usize,
1523            depth: fidl::encoding::Depth,
1524        ) -> fidl::Result<()> {
1525            encoder.debug_check_bounds::<PhySetTxPowerScenarioRequest>(offset);
1526            // Zero out padding regions. There's no need to apply masks
1527            // because the unmasked parts will be overwritten by fields.
1528            // Write the fields.
1529            self.0.encode(encoder, offset + 0, depth)?;
1530            Ok(())
1531        }
1532    }
1533
1534    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1535        for PhySetTxPowerScenarioRequest
1536    {
1537        #[inline(always)]
1538        fn new_empty() -> Self {
1539            Self {
1540                scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
1541            }
1542        }
1543
1544        #[inline]
1545        unsafe fn decode(
1546            &mut self,
1547            decoder: &mut fidl::encoding::Decoder<'_, D>,
1548            offset: usize,
1549            _depth: fidl::encoding::Depth,
1550        ) -> fidl::Result<()> {
1551            decoder.debug_check_bounds::<Self>(offset);
1552            // Verify that padding bytes are zero.
1553            fidl::decode!(
1554                fidl_fuchsia_wlan_internal__common::TxPowerScenario,
1555                D,
1556                &mut self.scenario,
1557                decoder,
1558                offset + 0,
1559                _depth
1560            )?;
1561            Ok(())
1562        }
1563    }
1564
1565    impl fidl::encoding::ValueTypeMarker for PhyCreateIfaceResponse {
1566        type Borrowed<'a> = &'a Self;
1567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1568            value
1569        }
1570    }
1571
1572    unsafe impl fidl::encoding::TypeMarker for PhyCreateIfaceResponse {
1573        type Owned = Self;
1574
1575        #[inline(always)]
1576        fn inline_align(_context: fidl::encoding::Context) -> usize {
1577            2
1578        }
1579
1580        #[inline(always)]
1581        fn inline_size(_context: fidl::encoding::Context) -> usize {
1582            2
1583        }
1584        #[inline(always)]
1585        fn encode_is_copy() -> bool {
1586            true
1587        }
1588
1589        #[inline(always)]
1590        fn decode_is_copy() -> bool {
1591            true
1592        }
1593    }
1594
1595    unsafe impl<D: fidl::encoding::ResourceDialect>
1596        fidl::encoding::Encode<PhyCreateIfaceResponse, D> for &PhyCreateIfaceResponse
1597    {
1598        #[inline]
1599        unsafe fn encode(
1600            self,
1601            encoder: &mut fidl::encoding::Encoder<'_, D>,
1602            offset: usize,
1603            _depth: fidl::encoding::Depth,
1604        ) -> fidl::Result<()> {
1605            encoder.debug_check_bounds::<PhyCreateIfaceResponse>(offset);
1606            unsafe {
1607                // Copy the object into the buffer.
1608                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1609                (buf_ptr as *mut PhyCreateIfaceResponse)
1610                    .write_unaligned((self as *const PhyCreateIfaceResponse).read());
1611                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1612                // done second because the memcpy will write garbage to these bytes.
1613            }
1614            Ok(())
1615        }
1616    }
1617    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1618        fidl::encoding::Encode<PhyCreateIfaceResponse, D> for (T0,)
1619    {
1620        #[inline]
1621        unsafe fn encode(
1622            self,
1623            encoder: &mut fidl::encoding::Encoder<'_, D>,
1624            offset: usize,
1625            depth: fidl::encoding::Depth,
1626        ) -> fidl::Result<()> {
1627            encoder.debug_check_bounds::<PhyCreateIfaceResponse>(offset);
1628            // Zero out padding regions. There's no need to apply masks
1629            // because the unmasked parts will be overwritten by fields.
1630            // Write the fields.
1631            self.0.encode(encoder, offset + 0, depth)?;
1632            Ok(())
1633        }
1634    }
1635
1636    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1637        for PhyCreateIfaceResponse
1638    {
1639        #[inline(always)]
1640        fn new_empty() -> Self {
1641            Self { iface_id: fidl::new_empty!(u16, D) }
1642        }
1643
1644        #[inline]
1645        unsafe fn decode(
1646            &mut self,
1647            decoder: &mut fidl::encoding::Decoder<'_, D>,
1648            offset: usize,
1649            _depth: fidl::encoding::Depth,
1650        ) -> fidl::Result<()> {
1651            decoder.debug_check_bounds::<Self>(offset);
1652            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1653            // Verify that padding bytes are zero.
1654            // Copy from the buffer into the object.
1655            unsafe {
1656                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1657            }
1658            Ok(())
1659        }
1660    }
1661
1662    impl fidl::encoding::ValueTypeMarker for PhyGetCountryResponse {
1663        type Borrowed<'a> = &'a Self;
1664        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1665            value
1666        }
1667    }
1668
1669    unsafe impl fidl::encoding::TypeMarker for PhyGetCountryResponse {
1670        type Owned = Self;
1671
1672        #[inline(always)]
1673        fn inline_align(_context: fidl::encoding::Context) -> usize {
1674            1
1675        }
1676
1677        #[inline(always)]
1678        fn inline_size(_context: fidl::encoding::Context) -> usize {
1679            2
1680        }
1681        #[inline(always)]
1682        fn encode_is_copy() -> bool {
1683            true
1684        }
1685
1686        #[inline(always)]
1687        fn decode_is_copy() -> bool {
1688            true
1689        }
1690    }
1691
1692    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PhyGetCountryResponse, D>
1693        for &PhyGetCountryResponse
1694    {
1695        #[inline]
1696        unsafe fn encode(
1697            self,
1698            encoder: &mut fidl::encoding::Encoder<'_, D>,
1699            offset: usize,
1700            _depth: fidl::encoding::Depth,
1701        ) -> fidl::Result<()> {
1702            encoder.debug_check_bounds::<PhyGetCountryResponse>(offset);
1703            unsafe {
1704                // Copy the object into the buffer.
1705                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1706                (buf_ptr as *mut PhyGetCountryResponse)
1707                    .write_unaligned((self as *const PhyGetCountryResponse).read());
1708                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1709                // done second because the memcpy will write garbage to these bytes.
1710            }
1711            Ok(())
1712        }
1713    }
1714    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CountryCode, D>>
1715        fidl::encoding::Encode<PhyGetCountryResponse, D> for (T0,)
1716    {
1717        #[inline]
1718        unsafe fn encode(
1719            self,
1720            encoder: &mut fidl::encoding::Encoder<'_, D>,
1721            offset: usize,
1722            depth: fidl::encoding::Depth,
1723        ) -> fidl::Result<()> {
1724            encoder.debug_check_bounds::<PhyGetCountryResponse>(offset);
1725            // Zero out padding regions. There's no need to apply masks
1726            // because the unmasked parts will be overwritten by fields.
1727            // Write the fields.
1728            self.0.encode(encoder, offset + 0, depth)?;
1729            Ok(())
1730        }
1731    }
1732
1733    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PhyGetCountryResponse {
1734        #[inline(always)]
1735        fn new_empty() -> Self {
1736            Self { resp: fidl::new_empty!(CountryCode, D) }
1737        }
1738
1739        #[inline]
1740        unsafe fn decode(
1741            &mut self,
1742            decoder: &mut fidl::encoding::Decoder<'_, D>,
1743            offset: usize,
1744            _depth: fidl::encoding::Depth,
1745        ) -> fidl::Result<()> {
1746            decoder.debug_check_bounds::<Self>(offset);
1747            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1748            // Verify that padding bytes are zero.
1749            // Copy from the buffer into the object.
1750            unsafe {
1751                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1752            }
1753            Ok(())
1754        }
1755    }
1756
1757    impl fidl::encoding::ValueTypeMarker for PhyGetPowerSaveModeResponse {
1758        type Borrowed<'a> = &'a Self;
1759        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1760            value
1761        }
1762    }
1763
1764    unsafe impl fidl::encoding::TypeMarker for PhyGetPowerSaveModeResponse {
1765        type Owned = Self;
1766
1767        #[inline(always)]
1768        fn inline_align(_context: fidl::encoding::Context) -> usize {
1769            4
1770        }
1771
1772        #[inline(always)]
1773        fn inline_size(_context: fidl::encoding::Context) -> usize {
1774            4
1775        }
1776    }
1777
1778    unsafe impl<D: fidl::encoding::ResourceDialect>
1779        fidl::encoding::Encode<PhyGetPowerSaveModeResponse, D> for &PhyGetPowerSaveModeResponse
1780    {
1781        #[inline]
1782        unsafe fn encode(
1783            self,
1784            encoder: &mut fidl::encoding::Encoder<'_, D>,
1785            offset: usize,
1786            _depth: fidl::encoding::Depth,
1787        ) -> fidl::Result<()> {
1788            encoder.debug_check_bounds::<PhyGetPowerSaveModeResponse>(offset);
1789            // Delegate to tuple encoding.
1790            fidl::encoding::Encode::<PhyGetPowerSaveModeResponse, D>::encode(
1791                (
1792                    <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1793                ),
1794                encoder, offset, _depth
1795            )
1796        }
1797    }
1798    unsafe impl<
1799        D: fidl::encoding::ResourceDialect,
1800        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
1801    > fidl::encoding::Encode<PhyGetPowerSaveModeResponse, D> for (T0,)
1802    {
1803        #[inline]
1804        unsafe fn encode(
1805            self,
1806            encoder: &mut fidl::encoding::Encoder<'_, D>,
1807            offset: usize,
1808            depth: fidl::encoding::Depth,
1809        ) -> fidl::Result<()> {
1810            encoder.debug_check_bounds::<PhyGetPowerSaveModeResponse>(offset);
1811            // Zero out padding regions. There's no need to apply masks
1812            // because the unmasked parts will be overwritten by fields.
1813            // Write the fields.
1814            self.0.encode(encoder, offset + 0, depth)?;
1815            Ok(())
1816        }
1817    }
1818
1819    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1820        for PhyGetPowerSaveModeResponse
1821    {
1822        #[inline(always)]
1823        fn new_empty() -> Self {
1824            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
1825        }
1826
1827        #[inline]
1828        unsafe fn decode(
1829            &mut self,
1830            decoder: &mut fidl::encoding::Decoder<'_, D>,
1831            offset: usize,
1832            _depth: fidl::encoding::Depth,
1833        ) -> fidl::Result<()> {
1834            decoder.debug_check_bounds::<Self>(offset);
1835            // Verify that padding bytes are zero.
1836            fidl::decode!(
1837                fidl_fuchsia_wlan_common__common::PowerSaveType,
1838                D,
1839                &mut self.resp,
1840                decoder,
1841                offset + 0,
1842                _depth
1843            )?;
1844            Ok(())
1845        }
1846    }
1847
1848    impl fidl::encoding::ValueTypeMarker for PhyGetPowerStateResponse {
1849        type Borrowed<'a> = &'a Self;
1850        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1851            value
1852        }
1853    }
1854
1855    unsafe impl fidl::encoding::TypeMarker for PhyGetPowerStateResponse {
1856        type Owned = Self;
1857
1858        #[inline(always)]
1859        fn inline_align(_context: fidl::encoding::Context) -> usize {
1860            1
1861        }
1862
1863        #[inline(always)]
1864        fn inline_size(_context: fidl::encoding::Context) -> usize {
1865            1
1866        }
1867    }
1868
1869    unsafe impl<D: fidl::encoding::ResourceDialect>
1870        fidl::encoding::Encode<PhyGetPowerStateResponse, D> for &PhyGetPowerStateResponse
1871    {
1872        #[inline]
1873        unsafe fn encode(
1874            self,
1875            encoder: &mut fidl::encoding::Encoder<'_, D>,
1876            offset: usize,
1877            _depth: fidl::encoding::Depth,
1878        ) -> fidl::Result<()> {
1879            encoder.debug_check_bounds::<PhyGetPowerStateResponse>(offset);
1880            // Delegate to tuple encoding.
1881            fidl::encoding::Encode::<PhyGetPowerStateResponse, D>::encode(
1882                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_on),),
1883                encoder,
1884                offset,
1885                _depth,
1886            )
1887        }
1888    }
1889    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1890        fidl::encoding::Encode<PhyGetPowerStateResponse, D> for (T0,)
1891    {
1892        #[inline]
1893        unsafe fn encode(
1894            self,
1895            encoder: &mut fidl::encoding::Encoder<'_, D>,
1896            offset: usize,
1897            depth: fidl::encoding::Depth,
1898        ) -> fidl::Result<()> {
1899            encoder.debug_check_bounds::<PhyGetPowerStateResponse>(offset);
1900            // Zero out padding regions. There's no need to apply masks
1901            // because the unmasked parts will be overwritten by fields.
1902            // Write the fields.
1903            self.0.encode(encoder, offset + 0, depth)?;
1904            Ok(())
1905        }
1906    }
1907
1908    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1909        for PhyGetPowerStateResponse
1910    {
1911        #[inline(always)]
1912        fn new_empty() -> Self {
1913            Self { power_on: fidl::new_empty!(bool, D) }
1914        }
1915
1916        #[inline]
1917        unsafe fn decode(
1918            &mut self,
1919            decoder: &mut fidl::encoding::Decoder<'_, D>,
1920            offset: usize,
1921            _depth: fidl::encoding::Depth,
1922        ) -> fidl::Result<()> {
1923            decoder.debug_check_bounds::<Self>(offset);
1924            // Verify that padding bytes are zero.
1925            fidl::decode!(bool, D, &mut self.power_on, decoder, offset + 0, _depth)?;
1926            Ok(())
1927        }
1928    }
1929
1930    impl fidl::encoding::ValueTypeMarker for PhyGetSupportedMacRolesResponse {
1931        type Borrowed<'a> = &'a Self;
1932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1933            value
1934        }
1935    }
1936
1937    unsafe impl fidl::encoding::TypeMarker for PhyGetSupportedMacRolesResponse {
1938        type Owned = Self;
1939
1940        #[inline(always)]
1941        fn inline_align(_context: fidl::encoding::Context) -> usize {
1942            8
1943        }
1944
1945        #[inline(always)]
1946        fn inline_size(_context: fidl::encoding::Context) -> usize {
1947            16
1948        }
1949    }
1950
1951    unsafe impl<D: fidl::encoding::ResourceDialect>
1952        fidl::encoding::Encode<PhyGetSupportedMacRolesResponse, D>
1953        for &PhyGetSupportedMacRolesResponse
1954    {
1955        #[inline]
1956        unsafe fn encode(
1957            self,
1958            encoder: &mut fidl::encoding::Encoder<'_, D>,
1959            offset: usize,
1960            _depth: fidl::encoding::Depth,
1961        ) -> fidl::Result<()> {
1962            encoder.debug_check_bounds::<PhyGetSupportedMacRolesResponse>(offset);
1963            // Delegate to tuple encoding.
1964            fidl::encoding::Encode::<PhyGetSupportedMacRolesResponse, D>::encode(
1965                (
1966                    <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
1967                ),
1968                encoder, offset, _depth
1969            )
1970        }
1971    }
1972    unsafe impl<
1973        D: fidl::encoding::ResourceDialect,
1974        T0: fidl::encoding::Encode<
1975                fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>,
1976                D,
1977            >,
1978    > fidl::encoding::Encode<PhyGetSupportedMacRolesResponse, D> for (T0,)
1979    {
1980        #[inline]
1981        unsafe fn encode(
1982            self,
1983            encoder: &mut fidl::encoding::Encoder<'_, D>,
1984            offset: usize,
1985            depth: fidl::encoding::Depth,
1986        ) -> fidl::Result<()> {
1987            encoder.debug_check_bounds::<PhyGetSupportedMacRolesResponse>(offset);
1988            // Zero out padding regions. There's no need to apply masks
1989            // because the unmasked parts will be overwritten by fields.
1990            // Write the fields.
1991            self.0.encode(encoder, offset + 0, depth)?;
1992            Ok(())
1993        }
1994    }
1995
1996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1997        for PhyGetSupportedMacRolesResponse
1998    {
1999        #[inline(always)]
2000        fn new_empty() -> Self {
2001            Self {
2002                supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D),
2003            }
2004        }
2005
2006        #[inline]
2007        unsafe fn decode(
2008            &mut self,
2009            decoder: &mut fidl::encoding::Decoder<'_, D>,
2010            offset: usize,
2011            _depth: fidl::encoding::Depth,
2012        ) -> fidl::Result<()> {
2013            decoder.debug_check_bounds::<Self>(offset);
2014            // Verify that padding bytes are zero.
2015            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
2016            Ok(())
2017        }
2018    }
2019
2020    impl fidl::encoding::ValueTypeMarker for PhyGetTxPowerScenarioResponse {
2021        type Borrowed<'a> = &'a Self;
2022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2023            value
2024        }
2025    }
2026
2027    unsafe impl fidl::encoding::TypeMarker for PhyGetTxPowerScenarioResponse {
2028        type Owned = Self;
2029
2030        #[inline(always)]
2031        fn inline_align(_context: fidl::encoding::Context) -> usize {
2032            4
2033        }
2034
2035        #[inline(always)]
2036        fn inline_size(_context: fidl::encoding::Context) -> usize {
2037            4
2038        }
2039    }
2040
2041    unsafe impl<D: fidl::encoding::ResourceDialect>
2042        fidl::encoding::Encode<PhyGetTxPowerScenarioResponse, D>
2043        for &PhyGetTxPowerScenarioResponse
2044    {
2045        #[inline]
2046        unsafe fn encode(
2047            self,
2048            encoder: &mut fidl::encoding::Encoder<'_, D>,
2049            offset: usize,
2050            _depth: fidl::encoding::Depth,
2051        ) -> fidl::Result<()> {
2052            encoder.debug_check_bounds::<PhyGetTxPowerScenarioResponse>(offset);
2053            // Delegate to tuple encoding.
2054            fidl::encoding::Encode::<PhyGetTxPowerScenarioResponse, D>::encode(
2055                (
2056                    <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
2057                ),
2058                encoder, offset, _depth
2059            )
2060        }
2061    }
2062    unsafe impl<
2063        D: fidl::encoding::ResourceDialect,
2064        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
2065    > fidl::encoding::Encode<PhyGetTxPowerScenarioResponse, D> for (T0,)
2066    {
2067        #[inline]
2068        unsafe fn encode(
2069            self,
2070            encoder: &mut fidl::encoding::Encoder<'_, D>,
2071            offset: usize,
2072            depth: fidl::encoding::Depth,
2073        ) -> fidl::Result<()> {
2074            encoder.debug_check_bounds::<PhyGetTxPowerScenarioResponse>(offset);
2075            // Zero out padding regions. There's no need to apply masks
2076            // because the unmasked parts will be overwritten by fields.
2077            // Write the fields.
2078            self.0.encode(encoder, offset + 0, depth)?;
2079            Ok(())
2080        }
2081    }
2082
2083    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2084        for PhyGetTxPowerScenarioResponse
2085    {
2086        #[inline(always)]
2087        fn new_empty() -> Self {
2088            Self {
2089                scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
2090            }
2091        }
2092
2093        #[inline]
2094        unsafe fn decode(
2095            &mut self,
2096            decoder: &mut fidl::encoding::Decoder<'_, D>,
2097            offset: usize,
2098            _depth: fidl::encoding::Depth,
2099        ) -> fidl::Result<()> {
2100            decoder.debug_check_bounds::<Self>(offset);
2101            // Verify that padding bytes are zero.
2102            fidl::decode!(
2103                fidl_fuchsia_wlan_internal__common::TxPowerScenario,
2104                D,
2105                &mut self.scenario,
2106                decoder,
2107                offset + 0,
2108                _depth
2109            )?;
2110            Ok(())
2111        }
2112    }
2113}