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