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