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