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