1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub type WlanPhyInitResponse = ();
8
9 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10 pub struct WlanPhyGetSupportedMacRolesResponse {
11 pub supported_mac_roles: ::core::option::Option<
12 ::std::vec::Vec<::fidl_next_common_fuchsia_wlan_common::natural::WlanMacRole>,
13 >,
14 }
15
16 impl WlanPhyGetSupportedMacRolesResponse {
17 fn __max_ordinal(&self) -> usize {
18 if self.supported_mac_roles.is_some() {
19 return 1;
20 }
21
22 0
23 }
24 }
25
26 unsafe impl<___E>
27 ::fidl_next::Encode<crate::wire::WlanPhyGetSupportedMacRolesResponse<'static>, ___E>
28 for WlanPhyGetSupportedMacRolesResponse
29 where
30 ___E: ::fidl_next::Encoder + ?Sized,
31 {
32 #[inline]
33 fn encode(
34 mut self,
35 encoder: &mut ___E,
36 out: &mut ::core::mem::MaybeUninit<
37 crate::wire::WlanPhyGetSupportedMacRolesResponse<'static>,
38 >,
39 _: (),
40 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
41 ::fidl_next::munge!(let crate::wire::WlanPhyGetSupportedMacRolesResponse { table } = out);
42
43 let max_ord = self.__max_ordinal();
44
45 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
46 ::fidl_next::Wire::zero_padding(&mut out);
47
48 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
49 ::fidl_next::wire::Envelope,
50 >(encoder, max_ord);
51
52 for i in 1..=max_ord {
53 match i {
54 1 => {
55 if let Some(value) = self.supported_mac_roles.take() {
56 ::fidl_next::wire::Envelope::encode_value::<
57 ::fidl_next::wire::Vector<
58 'static,
59 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
60 >,
61 ___E,
62 >(
63 value, preallocated.encoder, &mut out, (16, ())
64 )?;
65 } else {
66 ::fidl_next::wire::Envelope::encode_zero(&mut out)
67 }
68 }
69
70 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
71 }
72 unsafe {
73 preallocated.write_next(out.assume_init_ref());
74 }
75 }
76
77 ::fidl_next::wire::Table::encode_len(table, max_ord);
78
79 Ok(())
80 }
81 }
82
83 unsafe impl<'a, ___E>
84 ::fidl_next::Encode<crate::wire::WlanPhyGetSupportedMacRolesResponse<'static>, ___E>
85 for &'a WlanPhyGetSupportedMacRolesResponse
86 where
87 ___E: ::fidl_next::Encoder + ?Sized,
88 {
89 #[inline]
90 fn encode(
91 self,
92 encoder: &mut ___E,
93 out: &mut ::core::mem::MaybeUninit<
94 crate::wire::WlanPhyGetSupportedMacRolesResponse<'static>,
95 >,
96 _: (),
97 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
98 ::fidl_next::munge!(let crate::wire::WlanPhyGetSupportedMacRolesResponse { table } = out);
99
100 let max_ord = self.__max_ordinal();
101
102 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
103 ::fidl_next::Wire::zero_padding(&mut out);
104
105 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
106 ::fidl_next::wire::Envelope,
107 >(encoder, max_ord);
108
109 for i in 1..=max_ord {
110 match i {
111 1 => {
112 if let Some(value) = &self.supported_mac_roles {
113 ::fidl_next::wire::Envelope::encode_value::<
114 ::fidl_next::wire::Vector<
115 'static,
116 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
117 >,
118 ___E,
119 >(
120 value, preallocated.encoder, &mut out, (16, ())
121 )?;
122 } else {
123 ::fidl_next::wire::Envelope::encode_zero(&mut out)
124 }
125 }
126
127 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
128 }
129 unsafe {
130 preallocated.write_next(out.assume_init_ref());
131 }
132 }
133
134 ::fidl_next::wire::Table::encode_len(table, max_ord);
135
136 Ok(())
137 }
138 }
139
140 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyGetSupportedMacRolesResponse<'de>>
141 for WlanPhyGetSupportedMacRolesResponse
142 {
143 #[inline]
144 fn from_wire(wire_: crate::wire::WlanPhyGetSupportedMacRolesResponse<'de>) -> Self {
145 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
146
147 let supported_mac_roles = wire_.table.get(1);
148
149 Self {
150 supported_mac_roles: supported_mac_roles.map(|envelope| {
151 ::fidl_next::FromWire::from_wire(unsafe {
152 envelope.read_unchecked::<::fidl_next::wire::Vector<
153 'de,
154 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
155 >>()
156 })
157 }),
158 }
159 }
160 }
161
162 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyGetSupportedMacRolesResponse<'de>>
163 for WlanPhyGetSupportedMacRolesResponse
164 {
165 #[inline]
166 fn from_wire_ref(wire: &crate::wire::WlanPhyGetSupportedMacRolesResponse<'de>) -> Self {
167 Self {
168 supported_mac_roles: wire.table.get(1).map(|envelope| {
169 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
170 envelope.deref_unchecked::<::fidl_next::wire::Vector<
171 'de,
172 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
173 >>()
174 })
175 }),
176 }
177 }
178 }
179
180 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
181 pub struct WlanPhyCreateIfaceResponse {
182 pub iface_id: ::core::option::Option<u16>,
183 }
184
185 impl WlanPhyCreateIfaceResponse {
186 fn __max_ordinal(&self) -> usize {
187 if self.iface_id.is_some() {
188 return 1;
189 }
190
191 0
192 }
193 }
194
195 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyCreateIfaceResponse<'static>, ___E>
196 for WlanPhyCreateIfaceResponse
197 where
198 ___E: ::fidl_next::Encoder + ?Sized,
199 {
200 #[inline]
201 fn encode(
202 mut self,
203 encoder: &mut ___E,
204 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyCreateIfaceResponse<'static>>,
205 _: (),
206 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
207 ::fidl_next::munge!(let crate::wire::WlanPhyCreateIfaceResponse { table } = out);
208
209 let max_ord = self.__max_ordinal();
210
211 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
212 ::fidl_next::Wire::zero_padding(&mut out);
213
214 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
215 ::fidl_next::wire::Envelope,
216 >(encoder, max_ord);
217
218 for i in 1..=max_ord {
219 match i {
220 1 => {
221 if let Some(value) = self.iface_id.take() {
222 ::fidl_next::wire::Envelope::encode_value::<
223 ::fidl_next::wire::Uint16,
224 ___E,
225 >(
226 value, preallocated.encoder, &mut out, ()
227 )?;
228 } else {
229 ::fidl_next::wire::Envelope::encode_zero(&mut out)
230 }
231 }
232
233 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
234 }
235 unsafe {
236 preallocated.write_next(out.assume_init_ref());
237 }
238 }
239
240 ::fidl_next::wire::Table::encode_len(table, max_ord);
241
242 Ok(())
243 }
244 }
245
246 unsafe impl<'a, ___E>
247 ::fidl_next::Encode<crate::wire::WlanPhyCreateIfaceResponse<'static>, ___E>
248 for &'a WlanPhyCreateIfaceResponse
249 where
250 ___E: ::fidl_next::Encoder + ?Sized,
251 {
252 #[inline]
253 fn encode(
254 self,
255 encoder: &mut ___E,
256 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyCreateIfaceResponse<'static>>,
257 _: (),
258 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
259 ::fidl_next::munge!(let crate::wire::WlanPhyCreateIfaceResponse { table } = out);
260
261 let max_ord = self.__max_ordinal();
262
263 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
264 ::fidl_next::Wire::zero_padding(&mut out);
265
266 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
267 ::fidl_next::wire::Envelope,
268 >(encoder, max_ord);
269
270 for i in 1..=max_ord {
271 match i {
272 1 => {
273 if let Some(value) = &self.iface_id {
274 ::fidl_next::wire::Envelope::encode_value::<
275 ::fidl_next::wire::Uint16,
276 ___E,
277 >(
278 value, preallocated.encoder, &mut out, ()
279 )?;
280 } else {
281 ::fidl_next::wire::Envelope::encode_zero(&mut out)
282 }
283 }
284
285 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
286 }
287 unsafe {
288 preallocated.write_next(out.assume_init_ref());
289 }
290 }
291
292 ::fidl_next::wire::Table::encode_len(table, max_ord);
293
294 Ok(())
295 }
296 }
297
298 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyCreateIfaceResponse<'de>>
299 for WlanPhyCreateIfaceResponse
300 {
301 #[inline]
302 fn from_wire(wire_: crate::wire::WlanPhyCreateIfaceResponse<'de>) -> Self {
303 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
304
305 let iface_id = wire_.table.get(1);
306
307 Self {
308 iface_id: iface_id.map(|envelope| {
309 ::fidl_next::FromWire::from_wire(unsafe {
310 envelope.read_unchecked::<::fidl_next::wire::Uint16>()
311 })
312 }),
313 }
314 }
315 }
316
317 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyCreateIfaceResponse<'de>>
318 for WlanPhyCreateIfaceResponse
319 {
320 #[inline]
321 fn from_wire_ref(wire: &crate::wire::WlanPhyCreateIfaceResponse<'de>) -> Self {
322 Self {
323 iface_id: wire.table.get(1).map(|envelope| {
324 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
325 envelope.deref_unchecked::<::fidl_next::wire::Uint16>()
326 })
327 }),
328 }
329 }
330 }
331
332 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
333 pub struct WlanPhyDestroyIfaceRequest {
334 pub iface_id: ::core::option::Option<u16>,
335 }
336
337 impl WlanPhyDestroyIfaceRequest {
338 fn __max_ordinal(&self) -> usize {
339 if self.iface_id.is_some() {
340 return 1;
341 }
342
343 0
344 }
345 }
346
347 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyDestroyIfaceRequest<'static>, ___E>
348 for WlanPhyDestroyIfaceRequest
349 where
350 ___E: ::fidl_next::Encoder + ?Sized,
351 {
352 #[inline]
353 fn encode(
354 mut self,
355 encoder: &mut ___E,
356 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyDestroyIfaceRequest<'static>>,
357 _: (),
358 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
359 ::fidl_next::munge!(let crate::wire::WlanPhyDestroyIfaceRequest { table } = out);
360
361 let max_ord = self.__max_ordinal();
362
363 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
364 ::fidl_next::Wire::zero_padding(&mut out);
365
366 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
367 ::fidl_next::wire::Envelope,
368 >(encoder, max_ord);
369
370 for i in 1..=max_ord {
371 match i {
372 1 => {
373 if let Some(value) = self.iface_id.take() {
374 ::fidl_next::wire::Envelope::encode_value::<
375 ::fidl_next::wire::Uint16,
376 ___E,
377 >(
378 value, preallocated.encoder, &mut out, ()
379 )?;
380 } else {
381 ::fidl_next::wire::Envelope::encode_zero(&mut out)
382 }
383 }
384
385 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
386 }
387 unsafe {
388 preallocated.write_next(out.assume_init_ref());
389 }
390 }
391
392 ::fidl_next::wire::Table::encode_len(table, max_ord);
393
394 Ok(())
395 }
396 }
397
398 unsafe impl<'a, ___E>
399 ::fidl_next::Encode<crate::wire::WlanPhyDestroyIfaceRequest<'static>, ___E>
400 for &'a WlanPhyDestroyIfaceRequest
401 where
402 ___E: ::fidl_next::Encoder + ?Sized,
403 {
404 #[inline]
405 fn encode(
406 self,
407 encoder: &mut ___E,
408 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyDestroyIfaceRequest<'static>>,
409 _: (),
410 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
411 ::fidl_next::munge!(let crate::wire::WlanPhyDestroyIfaceRequest { table } = out);
412
413 let max_ord = self.__max_ordinal();
414
415 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
416 ::fidl_next::Wire::zero_padding(&mut out);
417
418 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
419 ::fidl_next::wire::Envelope,
420 >(encoder, max_ord);
421
422 for i in 1..=max_ord {
423 match i {
424 1 => {
425 if let Some(value) = &self.iface_id {
426 ::fidl_next::wire::Envelope::encode_value::<
427 ::fidl_next::wire::Uint16,
428 ___E,
429 >(
430 value, preallocated.encoder, &mut out, ()
431 )?;
432 } else {
433 ::fidl_next::wire::Envelope::encode_zero(&mut out)
434 }
435 }
436
437 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
438 }
439 unsafe {
440 preallocated.write_next(out.assume_init_ref());
441 }
442 }
443
444 ::fidl_next::wire::Table::encode_len(table, max_ord);
445
446 Ok(())
447 }
448 }
449
450 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyDestroyIfaceRequest<'de>>
451 for WlanPhyDestroyIfaceRequest
452 {
453 #[inline]
454 fn from_wire(wire_: crate::wire::WlanPhyDestroyIfaceRequest<'de>) -> Self {
455 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
456
457 let iface_id = wire_.table.get(1);
458
459 Self {
460 iface_id: iface_id.map(|envelope| {
461 ::fidl_next::FromWire::from_wire(unsafe {
462 envelope.read_unchecked::<::fidl_next::wire::Uint16>()
463 })
464 }),
465 }
466 }
467 }
468
469 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyDestroyIfaceRequest<'de>>
470 for WlanPhyDestroyIfaceRequest
471 {
472 #[inline]
473 fn from_wire_ref(wire: &crate::wire::WlanPhyDestroyIfaceRequest<'de>) -> Self {
474 Self {
475 iface_id: wire.table.get(1).map(|envelope| {
476 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
477 envelope.deref_unchecked::<::fidl_next::wire::Uint16>()
478 })
479 }),
480 }
481 }
482 }
483
484 pub type WlanPhyDestroyIfaceResponse = ();
485
486 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
487 #[repr(C)]
488 pub struct WlanPhySetCountryRequest {
489 pub country: [u8; 2],
490 }
491
492 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhySetCountryRequest, ___E>
493 for WlanPhySetCountryRequest
494 where
495 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
496 {
497 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
498 Self,
499 crate::wire::WlanPhySetCountryRequest,
500 > = unsafe {
501 ::fidl_next::CopyOptimization::enable_if(
502 true && <[u8; 2] as ::fidl_next::Encode<[u8; 2], ___E>>::COPY_OPTIMIZATION
503 .is_enabled(),
504 )
505 };
506
507 #[inline]
508 fn encode(
509 self,
510 encoder_: &mut ___E,
511 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhySetCountryRequest>,
512 _: (),
513 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
514 ::fidl_next::munge! {
515 let crate::wire::WlanPhySetCountryRequest {
516 country,
517
518 } = out_;
519 }
520
521 ::fidl_next::Encode::encode(self.country, encoder_, country, ())?;
522
523 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(country.as_mut_ptr()) };
524
525 Ok(())
526 }
527 }
528
529 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WlanPhySetCountryRequest, ___E>
530 for &'a WlanPhySetCountryRequest
531 where
532 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
533 {
534 #[inline]
535 fn encode(
536 self,
537 encoder_: &mut ___E,
538 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhySetCountryRequest>,
539 _: (),
540 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
541 ::fidl_next::munge! {
542 let crate::wire::WlanPhySetCountryRequest {
543 country,
544
545 } = out_;
546 }
547
548 ::fidl_next::Encode::encode(&self.country, encoder_, country, ())?;
549
550 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(country.as_mut_ptr()) };
551
552 Ok(())
553 }
554 }
555
556 unsafe impl<___E>
557 ::fidl_next::EncodeOption<
558 ::fidl_next::wire::Box<'static, crate::wire::WlanPhySetCountryRequest>,
559 ___E,
560 > for WlanPhySetCountryRequest
561 where
562 ___E: ::fidl_next::Encoder + ?Sized,
563 WlanPhySetCountryRequest: ::fidl_next::Encode<crate::wire::WlanPhySetCountryRequest, ___E>,
564 {
565 #[inline]
566 fn encode_option(
567 this: ::core::option::Option<Self>,
568 encoder: &mut ___E,
569 out: &mut ::core::mem::MaybeUninit<
570 ::fidl_next::wire::Box<'static, crate::wire::WlanPhySetCountryRequest>,
571 >,
572 _: (),
573 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
574 if let Some(inner) = this {
575 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
576 ::fidl_next::wire::Box::encode_present(out);
577 } else {
578 ::fidl_next::wire::Box::encode_absent(out);
579 }
580
581 Ok(())
582 }
583 }
584
585 unsafe impl<'a, ___E>
586 ::fidl_next::EncodeOption<
587 ::fidl_next::wire::Box<'static, crate::wire::WlanPhySetCountryRequest>,
588 ___E,
589 > for &'a WlanPhySetCountryRequest
590 where
591 ___E: ::fidl_next::Encoder + ?Sized,
592 &'a WlanPhySetCountryRequest:
593 ::fidl_next::Encode<crate::wire::WlanPhySetCountryRequest, ___E>,
594 {
595 #[inline]
596 fn encode_option(
597 this: ::core::option::Option<Self>,
598 encoder: &mut ___E,
599 out: &mut ::core::mem::MaybeUninit<
600 ::fidl_next::wire::Box<'static, crate::wire::WlanPhySetCountryRequest>,
601 >,
602 _: (),
603 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
604 if let Some(inner) = this {
605 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
606 ::fidl_next::wire::Box::encode_present(out);
607 } else {
608 ::fidl_next::wire::Box::encode_absent(out);
609 }
610
611 Ok(())
612 }
613 }
614
615 impl ::fidl_next::FromWire<crate::wire::WlanPhySetCountryRequest> for WlanPhySetCountryRequest {
616 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
617 crate::wire::WlanPhySetCountryRequest,
618 Self,
619 > = unsafe {
620 ::fidl_next::CopyOptimization::enable_if(
621 true && <[u8; 2] as ::fidl_next::FromWire<[u8; 2]>>::COPY_OPTIMIZATION.is_enabled(),
622 )
623 };
624
625 #[inline]
626 fn from_wire(wire: crate::wire::WlanPhySetCountryRequest) -> Self {
627 Self { country: ::fidl_next::FromWire::from_wire(wire.country) }
628 }
629 }
630
631 impl ::fidl_next::FromWireRef<crate::wire::WlanPhySetCountryRequest> for WlanPhySetCountryRequest {
632 #[inline]
633 fn from_wire_ref(wire: &crate::wire::WlanPhySetCountryRequest) -> Self {
634 Self { country: ::fidl_next::FromWireRef::from_wire_ref(&wire.country) }
635 }
636 }
637
638 pub type WlanPhySetCountryResponse = ();
639
640 pub type WlanPhyClearCountryResponse = ();
641
642 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
643 #[repr(C)]
644 pub struct WlanPhyGetCountryResponse {
645 pub country: [u8; 2],
646 }
647
648 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyGetCountryResponse, ___E>
649 for WlanPhyGetCountryResponse
650 where
651 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
652 {
653 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
654 Self,
655 crate::wire::WlanPhyGetCountryResponse,
656 > = unsafe {
657 ::fidl_next::CopyOptimization::enable_if(
658 true && <[u8; 2] as ::fidl_next::Encode<[u8; 2], ___E>>::COPY_OPTIMIZATION
659 .is_enabled(),
660 )
661 };
662
663 #[inline]
664 fn encode(
665 self,
666 encoder_: &mut ___E,
667 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetCountryResponse>,
668 _: (),
669 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
670 ::fidl_next::munge! {
671 let crate::wire::WlanPhyGetCountryResponse {
672 country,
673
674 } = out_;
675 }
676
677 ::fidl_next::Encode::encode(self.country, encoder_, country, ())?;
678
679 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(country.as_mut_ptr()) };
680
681 Ok(())
682 }
683 }
684
685 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WlanPhyGetCountryResponse, ___E>
686 for &'a WlanPhyGetCountryResponse
687 where
688 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
689 {
690 #[inline]
691 fn encode(
692 self,
693 encoder_: &mut ___E,
694 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetCountryResponse>,
695 _: (),
696 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
697 ::fidl_next::munge! {
698 let crate::wire::WlanPhyGetCountryResponse {
699 country,
700
701 } = out_;
702 }
703
704 ::fidl_next::Encode::encode(&self.country, encoder_, country, ())?;
705
706 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(country.as_mut_ptr()) };
707
708 Ok(())
709 }
710 }
711
712 unsafe impl<___E>
713 ::fidl_next::EncodeOption<
714 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetCountryResponse>,
715 ___E,
716 > for WlanPhyGetCountryResponse
717 where
718 ___E: ::fidl_next::Encoder + ?Sized,
719 WlanPhyGetCountryResponse:
720 ::fidl_next::Encode<crate::wire::WlanPhyGetCountryResponse, ___E>,
721 {
722 #[inline]
723 fn encode_option(
724 this: ::core::option::Option<Self>,
725 encoder: &mut ___E,
726 out: &mut ::core::mem::MaybeUninit<
727 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetCountryResponse>,
728 >,
729 _: (),
730 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
731 if let Some(inner) = this {
732 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
733 ::fidl_next::wire::Box::encode_present(out);
734 } else {
735 ::fidl_next::wire::Box::encode_absent(out);
736 }
737
738 Ok(())
739 }
740 }
741
742 unsafe impl<'a, ___E>
743 ::fidl_next::EncodeOption<
744 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetCountryResponse>,
745 ___E,
746 > for &'a WlanPhyGetCountryResponse
747 where
748 ___E: ::fidl_next::Encoder + ?Sized,
749 &'a WlanPhyGetCountryResponse:
750 ::fidl_next::Encode<crate::wire::WlanPhyGetCountryResponse, ___E>,
751 {
752 #[inline]
753 fn encode_option(
754 this: ::core::option::Option<Self>,
755 encoder: &mut ___E,
756 out: &mut ::core::mem::MaybeUninit<
757 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetCountryResponse>,
758 >,
759 _: (),
760 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
761 if let Some(inner) = this {
762 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
763 ::fidl_next::wire::Box::encode_present(out);
764 } else {
765 ::fidl_next::wire::Box::encode_absent(out);
766 }
767
768 Ok(())
769 }
770 }
771
772 impl ::fidl_next::FromWire<crate::wire::WlanPhyGetCountryResponse> for WlanPhyGetCountryResponse {
773 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
774 crate::wire::WlanPhyGetCountryResponse,
775 Self,
776 > = unsafe {
777 ::fidl_next::CopyOptimization::enable_if(
778 true && <[u8; 2] as ::fidl_next::FromWire<[u8; 2]>>::COPY_OPTIMIZATION.is_enabled(),
779 )
780 };
781
782 #[inline]
783 fn from_wire(wire: crate::wire::WlanPhyGetCountryResponse) -> Self {
784 Self { country: ::fidl_next::FromWire::from_wire(wire.country) }
785 }
786 }
787
788 impl ::fidl_next::FromWireRef<crate::wire::WlanPhyGetCountryResponse>
789 for WlanPhyGetCountryResponse
790 {
791 #[inline]
792 fn from_wire_ref(wire: &crate::wire::WlanPhyGetCountryResponse) -> Self {
793 Self { country: ::fidl_next::FromWireRef::from_wire_ref(&wire.country) }
794 }
795 }
796
797 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
798 pub struct WlanPhySetPowerSaveModeRequest {
799 pub ps_mode:
800 ::core::option::Option<::fidl_next_common_fuchsia_wlan_common::natural::PowerSaveType>,
801 }
802
803 impl WlanPhySetPowerSaveModeRequest {
804 fn __max_ordinal(&self) -> usize {
805 if self.ps_mode.is_some() {
806 return 1;
807 }
808
809 0
810 }
811 }
812
813 unsafe impl<___E>
814 ::fidl_next::Encode<crate::wire::WlanPhySetPowerSaveModeRequest<'static>, ___E>
815 for WlanPhySetPowerSaveModeRequest
816 where
817 ___E: ::fidl_next::Encoder + ?Sized,
818 {
819 #[inline]
820 fn encode(
821 mut self,
822 encoder: &mut ___E,
823 out: &mut ::core::mem::MaybeUninit<
824 crate::wire::WlanPhySetPowerSaveModeRequest<'static>,
825 >,
826 _: (),
827 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
828 ::fidl_next::munge!(let crate::wire::WlanPhySetPowerSaveModeRequest { table } = out);
829
830 let max_ord = self.__max_ordinal();
831
832 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
833 ::fidl_next::Wire::zero_padding(&mut out);
834
835 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
836 ::fidl_next::wire::Envelope,
837 >(encoder, max_ord);
838
839 for i in 1..=max_ord {
840 match i {
841 1 => {
842 if let Some(value) = self.ps_mode.take() {
843 ::fidl_next::wire::Envelope::encode_value::<
844 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
845 ___E,
846 >(
847 value, preallocated.encoder, &mut out, ()
848 )?;
849 } else {
850 ::fidl_next::wire::Envelope::encode_zero(&mut out)
851 }
852 }
853
854 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
855 }
856 unsafe {
857 preallocated.write_next(out.assume_init_ref());
858 }
859 }
860
861 ::fidl_next::wire::Table::encode_len(table, max_ord);
862
863 Ok(())
864 }
865 }
866
867 unsafe impl<'a, ___E>
868 ::fidl_next::Encode<crate::wire::WlanPhySetPowerSaveModeRequest<'static>, ___E>
869 for &'a WlanPhySetPowerSaveModeRequest
870 where
871 ___E: ::fidl_next::Encoder + ?Sized,
872 {
873 #[inline]
874 fn encode(
875 self,
876 encoder: &mut ___E,
877 out: &mut ::core::mem::MaybeUninit<
878 crate::wire::WlanPhySetPowerSaveModeRequest<'static>,
879 >,
880 _: (),
881 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
882 ::fidl_next::munge!(let crate::wire::WlanPhySetPowerSaveModeRequest { table } = out);
883
884 let max_ord = self.__max_ordinal();
885
886 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
887 ::fidl_next::Wire::zero_padding(&mut out);
888
889 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
890 ::fidl_next::wire::Envelope,
891 >(encoder, max_ord);
892
893 for i in 1..=max_ord {
894 match i {
895 1 => {
896 if let Some(value) = &self.ps_mode {
897 ::fidl_next::wire::Envelope::encode_value::<
898 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
899 ___E,
900 >(
901 value, preallocated.encoder, &mut out, ()
902 )?;
903 } else {
904 ::fidl_next::wire::Envelope::encode_zero(&mut out)
905 }
906 }
907
908 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
909 }
910 unsafe {
911 preallocated.write_next(out.assume_init_ref());
912 }
913 }
914
915 ::fidl_next::wire::Table::encode_len(table, max_ord);
916
917 Ok(())
918 }
919 }
920
921 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhySetPowerSaveModeRequest<'de>>
922 for WlanPhySetPowerSaveModeRequest
923 {
924 #[inline]
925 fn from_wire(wire_: crate::wire::WlanPhySetPowerSaveModeRequest<'de>) -> Self {
926 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
927
928 let ps_mode = wire_.table.get(1);
929
930 Self {
931
932
933 ps_mode: ps_mode.map(|envelope| ::fidl_next::FromWire::from_wire(
934 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>() }
935 )),
936
937 }
938 }
939 }
940
941 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhySetPowerSaveModeRequest<'de>>
942 for WlanPhySetPowerSaveModeRequest
943 {
944 #[inline]
945 fn from_wire_ref(wire: &crate::wire::WlanPhySetPowerSaveModeRequest<'de>) -> Self {
946 Self {
947
948
949 ps_mode: wire.table.get(1)
950 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
951 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>() }
952 )),
953
954 }
955 }
956 }
957
958 pub type WlanPhySetPowerSaveModeResponse = ();
959
960 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
961 pub struct WlanPhyGetPowerSaveModeResponse {
962 pub ps_mode:
963 ::core::option::Option<::fidl_next_common_fuchsia_wlan_common::natural::PowerSaveType>,
964 }
965
966 impl WlanPhyGetPowerSaveModeResponse {
967 fn __max_ordinal(&self) -> usize {
968 if self.ps_mode.is_some() {
969 return 1;
970 }
971
972 0
973 }
974 }
975
976 unsafe impl<___E>
977 ::fidl_next::Encode<crate::wire::WlanPhyGetPowerSaveModeResponse<'static>, ___E>
978 for WlanPhyGetPowerSaveModeResponse
979 where
980 ___E: ::fidl_next::Encoder + ?Sized,
981 {
982 #[inline]
983 fn encode(
984 mut self,
985 encoder: &mut ___E,
986 out: &mut ::core::mem::MaybeUninit<
987 crate::wire::WlanPhyGetPowerSaveModeResponse<'static>,
988 >,
989 _: (),
990 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
991 ::fidl_next::munge!(let crate::wire::WlanPhyGetPowerSaveModeResponse { table } = out);
992
993 let max_ord = self.__max_ordinal();
994
995 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
996 ::fidl_next::Wire::zero_padding(&mut out);
997
998 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
999 ::fidl_next::wire::Envelope,
1000 >(encoder, max_ord);
1001
1002 for i in 1..=max_ord {
1003 match i {
1004 1 => {
1005 if let Some(value) = self.ps_mode.take() {
1006 ::fidl_next::wire::Envelope::encode_value::<
1007 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
1008 ___E,
1009 >(
1010 value, preallocated.encoder, &mut out, ()
1011 )?;
1012 } else {
1013 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1014 }
1015 }
1016
1017 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1018 }
1019 unsafe {
1020 preallocated.write_next(out.assume_init_ref());
1021 }
1022 }
1023
1024 ::fidl_next::wire::Table::encode_len(table, max_ord);
1025
1026 Ok(())
1027 }
1028 }
1029
1030 unsafe impl<'a, ___E>
1031 ::fidl_next::Encode<crate::wire::WlanPhyGetPowerSaveModeResponse<'static>, ___E>
1032 for &'a WlanPhyGetPowerSaveModeResponse
1033 where
1034 ___E: ::fidl_next::Encoder + ?Sized,
1035 {
1036 #[inline]
1037 fn encode(
1038 self,
1039 encoder: &mut ___E,
1040 out: &mut ::core::mem::MaybeUninit<
1041 crate::wire::WlanPhyGetPowerSaveModeResponse<'static>,
1042 >,
1043 _: (),
1044 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1045 ::fidl_next::munge!(let crate::wire::WlanPhyGetPowerSaveModeResponse { table } = out);
1046
1047 let max_ord = self.__max_ordinal();
1048
1049 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1050 ::fidl_next::Wire::zero_padding(&mut out);
1051
1052 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1053 ::fidl_next::wire::Envelope,
1054 >(encoder, max_ord);
1055
1056 for i in 1..=max_ord {
1057 match i {
1058 1 => {
1059 if let Some(value) = &self.ps_mode {
1060 ::fidl_next::wire::Envelope::encode_value::<
1061 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
1062 ___E,
1063 >(
1064 value, preallocated.encoder, &mut out, ()
1065 )?;
1066 } else {
1067 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1068 }
1069 }
1070
1071 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1072 }
1073 unsafe {
1074 preallocated.write_next(out.assume_init_ref());
1075 }
1076 }
1077
1078 ::fidl_next::wire::Table::encode_len(table, max_ord);
1079
1080 Ok(())
1081 }
1082 }
1083
1084 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyGetPowerSaveModeResponse<'de>>
1085 for WlanPhyGetPowerSaveModeResponse
1086 {
1087 #[inline]
1088 fn from_wire(wire_: crate::wire::WlanPhyGetPowerSaveModeResponse<'de>) -> Self {
1089 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1090
1091 let ps_mode = wire_.table.get(1);
1092
1093 Self {
1094
1095
1096 ps_mode: ps_mode.map(|envelope| ::fidl_next::FromWire::from_wire(
1097 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>() }
1098 )),
1099
1100 }
1101 }
1102 }
1103
1104 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyGetPowerSaveModeResponse<'de>>
1105 for WlanPhyGetPowerSaveModeResponse
1106 {
1107 #[inline]
1108 fn from_wire_ref(wire: &crate::wire::WlanPhyGetPowerSaveModeResponse<'de>) -> Self {
1109 Self {
1110
1111
1112 ps_mode: wire.table.get(1)
1113 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1114 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>() }
1115 )),
1116
1117 }
1118 }
1119 }
1120
1121 pub type WlanPhyPowerDownResponse = ();
1122
1123 pub type WlanPhyPowerUpResponse = ();
1124
1125 pub type WlanPhyResetResponse = ();
1126
1127 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1128 pub struct WlanPhyGetPowerStateResponse {
1129 pub power_on: ::core::option::Option<bool>,
1130 }
1131
1132 impl WlanPhyGetPowerStateResponse {
1133 fn __max_ordinal(&self) -> usize {
1134 if self.power_on.is_some() {
1135 return 1;
1136 }
1137
1138 0
1139 }
1140 }
1141
1142 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyGetPowerStateResponse<'static>, ___E>
1143 for WlanPhyGetPowerStateResponse
1144 where
1145 ___E: ::fidl_next::Encoder + ?Sized,
1146 {
1147 #[inline]
1148 fn encode(
1149 mut self,
1150 encoder: &mut ___E,
1151 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetPowerStateResponse<'static>>,
1152 _: (),
1153 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1154 ::fidl_next::munge!(let crate::wire::WlanPhyGetPowerStateResponse { table } = out);
1155
1156 let max_ord = self.__max_ordinal();
1157
1158 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1159 ::fidl_next::Wire::zero_padding(&mut out);
1160
1161 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1162 ::fidl_next::wire::Envelope,
1163 >(encoder, max_ord);
1164
1165 for i in 1..=max_ord {
1166 match i {
1167 1 => {
1168 if let Some(value) = self.power_on.take() {
1169 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1170 value,
1171 preallocated.encoder,
1172 &mut out,
1173 (),
1174 )?;
1175 } else {
1176 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1177 }
1178 }
1179
1180 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1181 }
1182 unsafe {
1183 preallocated.write_next(out.assume_init_ref());
1184 }
1185 }
1186
1187 ::fidl_next::wire::Table::encode_len(table, max_ord);
1188
1189 Ok(())
1190 }
1191 }
1192
1193 unsafe impl<'a, ___E>
1194 ::fidl_next::Encode<crate::wire::WlanPhyGetPowerStateResponse<'static>, ___E>
1195 for &'a WlanPhyGetPowerStateResponse
1196 where
1197 ___E: ::fidl_next::Encoder + ?Sized,
1198 {
1199 #[inline]
1200 fn encode(
1201 self,
1202 encoder: &mut ___E,
1203 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetPowerStateResponse<'static>>,
1204 _: (),
1205 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1206 ::fidl_next::munge!(let crate::wire::WlanPhyGetPowerStateResponse { table } = out);
1207
1208 let max_ord = self.__max_ordinal();
1209
1210 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1211 ::fidl_next::Wire::zero_padding(&mut out);
1212
1213 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1214 ::fidl_next::wire::Envelope,
1215 >(encoder, max_ord);
1216
1217 for i in 1..=max_ord {
1218 match i {
1219 1 => {
1220 if let Some(value) = &self.power_on {
1221 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1222 value,
1223 preallocated.encoder,
1224 &mut out,
1225 (),
1226 )?;
1227 } else {
1228 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1229 }
1230 }
1231
1232 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1233 }
1234 unsafe {
1235 preallocated.write_next(out.assume_init_ref());
1236 }
1237 }
1238
1239 ::fidl_next::wire::Table::encode_len(table, max_ord);
1240
1241 Ok(())
1242 }
1243 }
1244
1245 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyGetPowerStateResponse<'de>>
1246 for WlanPhyGetPowerStateResponse
1247 {
1248 #[inline]
1249 fn from_wire(wire_: crate::wire::WlanPhyGetPowerStateResponse<'de>) -> Self {
1250 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1251
1252 let power_on = wire_.table.get(1);
1253
1254 Self {
1255 power_on: power_on.map(|envelope| {
1256 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
1257 }),
1258 }
1259 }
1260 }
1261
1262 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyGetPowerStateResponse<'de>>
1263 for WlanPhyGetPowerStateResponse
1264 {
1265 #[inline]
1266 fn from_wire_ref(wire: &crate::wire::WlanPhyGetPowerStateResponse<'de>) -> Self {
1267 Self {
1268 power_on: wire.table.get(1).map(|envelope| {
1269 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1270 envelope.deref_unchecked::<bool>()
1271 })
1272 }),
1273 }
1274 }
1275 }
1276
1277 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1278 pub struct WlanPhySetBtCoexistenceModeRequest {
1279 pub mode: ::core::option::Option<
1280 ::fidl_next_common_fuchsia_wlan_internal::natural::BtCoexistenceMode,
1281 >,
1282 }
1283
1284 impl WlanPhySetBtCoexistenceModeRequest {
1285 fn __max_ordinal(&self) -> usize {
1286 if self.mode.is_some() {
1287 return 1;
1288 }
1289
1290 0
1291 }
1292 }
1293
1294 unsafe impl<___E>
1295 ::fidl_next::Encode<crate::wire::WlanPhySetBtCoexistenceModeRequest<'static>, ___E>
1296 for WlanPhySetBtCoexistenceModeRequest
1297 where
1298 ___E: ::fidl_next::Encoder + ?Sized,
1299 {
1300 #[inline]
1301 fn encode(
1302 mut self,
1303 encoder: &mut ___E,
1304 out: &mut ::core::mem::MaybeUninit<
1305 crate::wire::WlanPhySetBtCoexistenceModeRequest<'static>,
1306 >,
1307 _: (),
1308 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1309 ::fidl_next::munge!(let crate::wire::WlanPhySetBtCoexistenceModeRequest { table } = out);
1310
1311 let max_ord = self.__max_ordinal();
1312
1313 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1314 ::fidl_next::Wire::zero_padding(&mut out);
1315
1316 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1317 ::fidl_next::wire::Envelope,
1318 >(encoder, max_ord);
1319
1320 for i in 1..=max_ord {
1321 match i {
1322 1 => {
1323 if let Some(value) = self.mode.take() {
1324 ::fidl_next::wire::Envelope::encode_value::<
1325 ::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode,
1326 ___E,
1327 >(
1328 value, preallocated.encoder, &mut out, ()
1329 )?;
1330 } else {
1331 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1332 }
1333 }
1334
1335 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1336 }
1337 unsafe {
1338 preallocated.write_next(out.assume_init_ref());
1339 }
1340 }
1341
1342 ::fidl_next::wire::Table::encode_len(table, max_ord);
1343
1344 Ok(())
1345 }
1346 }
1347
1348 unsafe impl<'a, ___E>
1349 ::fidl_next::Encode<crate::wire::WlanPhySetBtCoexistenceModeRequest<'static>, ___E>
1350 for &'a WlanPhySetBtCoexistenceModeRequest
1351 where
1352 ___E: ::fidl_next::Encoder + ?Sized,
1353 {
1354 #[inline]
1355 fn encode(
1356 self,
1357 encoder: &mut ___E,
1358 out: &mut ::core::mem::MaybeUninit<
1359 crate::wire::WlanPhySetBtCoexistenceModeRequest<'static>,
1360 >,
1361 _: (),
1362 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1363 ::fidl_next::munge!(let crate::wire::WlanPhySetBtCoexistenceModeRequest { table } = out);
1364
1365 let max_ord = self.__max_ordinal();
1366
1367 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1368 ::fidl_next::Wire::zero_padding(&mut out);
1369
1370 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1371 ::fidl_next::wire::Envelope,
1372 >(encoder, max_ord);
1373
1374 for i in 1..=max_ord {
1375 match i {
1376 1 => {
1377 if let Some(value) = &self.mode {
1378 ::fidl_next::wire::Envelope::encode_value::<
1379 ::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode,
1380 ___E,
1381 >(
1382 value, preallocated.encoder, &mut out, ()
1383 )?;
1384 } else {
1385 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1386 }
1387 }
1388
1389 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1390 }
1391 unsafe {
1392 preallocated.write_next(out.assume_init_ref());
1393 }
1394 }
1395
1396 ::fidl_next::wire::Table::encode_len(table, max_ord);
1397
1398 Ok(())
1399 }
1400 }
1401
1402 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhySetBtCoexistenceModeRequest<'de>>
1403 for WlanPhySetBtCoexistenceModeRequest
1404 {
1405 #[inline]
1406 fn from_wire(wire_: crate::wire::WlanPhySetBtCoexistenceModeRequest<'de>) -> Self {
1407 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1408
1409 let mode = wire_.table.get(1);
1410
1411 Self {
1412
1413
1414 mode: mode.map(|envelope| ::fidl_next::FromWire::from_wire(
1415 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode>() }
1416 )),
1417
1418 }
1419 }
1420 }
1421
1422 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhySetBtCoexistenceModeRequest<'de>>
1423 for WlanPhySetBtCoexistenceModeRequest
1424 {
1425 #[inline]
1426 fn from_wire_ref(wire: &crate::wire::WlanPhySetBtCoexistenceModeRequest<'de>) -> Self {
1427 Self {
1428
1429
1430 mode: wire.table.get(1)
1431 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1432 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode>() }
1433 )),
1434
1435 }
1436 }
1437 }
1438
1439 pub type WlanPhySetBtCoexistenceModeResponse = ();
1440
1441 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1442 pub struct WlanPhySetTxPowerScenarioRequest {
1443 pub scenario: ::core::option::Option<
1444 ::fidl_next_common_fuchsia_wlan_internal::natural::TxPowerScenario,
1445 >,
1446 }
1447
1448 impl WlanPhySetTxPowerScenarioRequest {
1449 fn __max_ordinal(&self) -> usize {
1450 if self.scenario.is_some() {
1451 return 1;
1452 }
1453
1454 0
1455 }
1456 }
1457
1458 unsafe impl<___E>
1459 ::fidl_next::Encode<crate::wire::WlanPhySetTxPowerScenarioRequest<'static>, ___E>
1460 for WlanPhySetTxPowerScenarioRequest
1461 where
1462 ___E: ::fidl_next::Encoder + ?Sized,
1463 {
1464 #[inline]
1465 fn encode(
1466 mut self,
1467 encoder: &mut ___E,
1468 out: &mut ::core::mem::MaybeUninit<
1469 crate::wire::WlanPhySetTxPowerScenarioRequest<'static>,
1470 >,
1471 _: (),
1472 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1473 ::fidl_next::munge!(let crate::wire::WlanPhySetTxPowerScenarioRequest { table } = out);
1474
1475 let max_ord = self.__max_ordinal();
1476
1477 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1478 ::fidl_next::Wire::zero_padding(&mut out);
1479
1480 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1481 ::fidl_next::wire::Envelope,
1482 >(encoder, max_ord);
1483
1484 for i in 1..=max_ord {
1485 match i {
1486 1 => {
1487 if let Some(value) = self.scenario.take() {
1488 ::fidl_next::wire::Envelope::encode_value::<
1489 ::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario,
1490 ___E,
1491 >(
1492 value, preallocated.encoder, &mut out, ()
1493 )?;
1494 } else {
1495 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1496 }
1497 }
1498
1499 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1500 }
1501 unsafe {
1502 preallocated.write_next(out.assume_init_ref());
1503 }
1504 }
1505
1506 ::fidl_next::wire::Table::encode_len(table, max_ord);
1507
1508 Ok(())
1509 }
1510 }
1511
1512 unsafe impl<'a, ___E>
1513 ::fidl_next::Encode<crate::wire::WlanPhySetTxPowerScenarioRequest<'static>, ___E>
1514 for &'a WlanPhySetTxPowerScenarioRequest
1515 where
1516 ___E: ::fidl_next::Encoder + ?Sized,
1517 {
1518 #[inline]
1519 fn encode(
1520 self,
1521 encoder: &mut ___E,
1522 out: &mut ::core::mem::MaybeUninit<
1523 crate::wire::WlanPhySetTxPowerScenarioRequest<'static>,
1524 >,
1525 _: (),
1526 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1527 ::fidl_next::munge!(let crate::wire::WlanPhySetTxPowerScenarioRequest { table } = out);
1528
1529 let max_ord = self.__max_ordinal();
1530
1531 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1532 ::fidl_next::Wire::zero_padding(&mut out);
1533
1534 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1535 ::fidl_next::wire::Envelope,
1536 >(encoder, max_ord);
1537
1538 for i in 1..=max_ord {
1539 match i {
1540 1 => {
1541 if let Some(value) = &self.scenario {
1542 ::fidl_next::wire::Envelope::encode_value::<
1543 ::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario,
1544 ___E,
1545 >(
1546 value, preallocated.encoder, &mut out, ()
1547 )?;
1548 } else {
1549 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1550 }
1551 }
1552
1553 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1554 }
1555 unsafe {
1556 preallocated.write_next(out.assume_init_ref());
1557 }
1558 }
1559
1560 ::fidl_next::wire::Table::encode_len(table, max_ord);
1561
1562 Ok(())
1563 }
1564 }
1565
1566 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhySetTxPowerScenarioRequest<'de>>
1567 for WlanPhySetTxPowerScenarioRequest
1568 {
1569 #[inline]
1570 fn from_wire(wire_: crate::wire::WlanPhySetTxPowerScenarioRequest<'de>) -> Self {
1571 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1572
1573 let scenario = wire_.table.get(1);
1574
1575 Self {
1576
1577
1578 scenario: scenario.map(|envelope| ::fidl_next::FromWire::from_wire(
1579 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>() }
1580 )),
1581
1582 }
1583 }
1584 }
1585
1586 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhySetTxPowerScenarioRequest<'de>>
1587 for WlanPhySetTxPowerScenarioRequest
1588 {
1589 #[inline]
1590 fn from_wire_ref(wire: &crate::wire::WlanPhySetTxPowerScenarioRequest<'de>) -> Self {
1591 Self {
1592
1593
1594 scenario: wire.table.get(1)
1595 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1596 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>() }
1597 )),
1598
1599 }
1600 }
1601 }
1602
1603 pub type WlanPhySetTxPowerScenarioResponse = ();
1604
1605 pub type WlanPhyResetTxPowerScenarioResponse = ();
1606
1607 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1608 #[repr(C)]
1609 pub struct WlanPhyGetTxPowerScenarioResponse {
1610 pub scenario: ::fidl_next_common_fuchsia_wlan_internal::natural::TxPowerScenario,
1611 }
1612
1613 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyGetTxPowerScenarioResponse, ___E>
1614 for WlanPhyGetTxPowerScenarioResponse
1615 where
1616 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1617 {
1618 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1619 Self,
1620 crate::wire::WlanPhyGetTxPowerScenarioResponse,
1621 > = unsafe {
1622 ::fidl_next::CopyOptimization::enable_if(
1623 true
1624
1625 && <
1626 ::fidl_next_common_fuchsia_wlan_internal::natural::TxPowerScenario as ::fidl_next::Encode<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario, ___E>
1627 >::COPY_OPTIMIZATION.is_enabled()
1628
1629 )
1630 };
1631
1632 #[inline]
1633 fn encode(
1634 self,
1635 encoder_: &mut ___E,
1636 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1637 _: (),
1638 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1639 ::fidl_next::munge! {
1640 let crate::wire::WlanPhyGetTxPowerScenarioResponse {
1641 scenario,
1642
1643 } = out_;
1644 }
1645
1646 ::fidl_next::Encode::encode(self.scenario, encoder_, scenario, ())?;
1647
1648 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(scenario.as_mut_ptr()) };
1649
1650 Ok(())
1651 }
1652 }
1653
1654 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WlanPhyGetTxPowerScenarioResponse, ___E>
1655 for &'a WlanPhyGetTxPowerScenarioResponse
1656 where
1657 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1658 {
1659 #[inline]
1660 fn encode(
1661 self,
1662 encoder_: &mut ___E,
1663 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1664 _: (),
1665 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1666 ::fidl_next::munge! {
1667 let crate::wire::WlanPhyGetTxPowerScenarioResponse {
1668 scenario,
1669
1670 } = out_;
1671 }
1672
1673 ::fidl_next::Encode::encode(&self.scenario, encoder_, scenario, ())?;
1674
1675 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(scenario.as_mut_ptr()) };
1676
1677 Ok(())
1678 }
1679 }
1680
1681 unsafe impl<___E>
1682 ::fidl_next::EncodeOption<
1683 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1684 ___E,
1685 > for WlanPhyGetTxPowerScenarioResponse
1686 where
1687 ___E: ::fidl_next::Encoder + ?Sized,
1688 WlanPhyGetTxPowerScenarioResponse:
1689 ::fidl_next::Encode<crate::wire::WlanPhyGetTxPowerScenarioResponse, ___E>,
1690 {
1691 #[inline]
1692 fn encode_option(
1693 this: ::core::option::Option<Self>,
1694 encoder: &mut ___E,
1695 out: &mut ::core::mem::MaybeUninit<
1696 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1697 >,
1698 _: (),
1699 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1700 if let Some(inner) = this {
1701 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1702 ::fidl_next::wire::Box::encode_present(out);
1703 } else {
1704 ::fidl_next::wire::Box::encode_absent(out);
1705 }
1706
1707 Ok(())
1708 }
1709 }
1710
1711 unsafe impl<'a, ___E>
1712 ::fidl_next::EncodeOption<
1713 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1714 ___E,
1715 > for &'a WlanPhyGetTxPowerScenarioResponse
1716 where
1717 ___E: ::fidl_next::Encoder + ?Sized,
1718 &'a WlanPhyGetTxPowerScenarioResponse:
1719 ::fidl_next::Encode<crate::wire::WlanPhyGetTxPowerScenarioResponse, ___E>,
1720 {
1721 #[inline]
1722 fn encode_option(
1723 this: ::core::option::Option<Self>,
1724 encoder: &mut ___E,
1725 out: &mut ::core::mem::MaybeUninit<
1726 ::fidl_next::wire::Box<'static, crate::wire::WlanPhyGetTxPowerScenarioResponse>,
1727 >,
1728 _: (),
1729 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1730 if let Some(inner) = this {
1731 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1732 ::fidl_next::wire::Box::encode_present(out);
1733 } else {
1734 ::fidl_next::wire::Box::encode_absent(out);
1735 }
1736
1737 Ok(())
1738 }
1739 }
1740
1741 impl ::fidl_next::FromWire<crate::wire::WlanPhyGetTxPowerScenarioResponse>
1742 for WlanPhyGetTxPowerScenarioResponse
1743 {
1744 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1745 crate::wire::WlanPhyGetTxPowerScenarioResponse,
1746 Self,
1747 > = unsafe {
1748 ::fidl_next::CopyOptimization::enable_if(
1749 true
1750
1751 && <
1752 ::fidl_next_common_fuchsia_wlan_internal::natural::TxPowerScenario as ::fidl_next::FromWire<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>
1753 >::COPY_OPTIMIZATION.is_enabled()
1754
1755 )
1756 };
1757
1758 #[inline]
1759 fn from_wire(wire: crate::wire::WlanPhyGetTxPowerScenarioResponse) -> Self {
1760 Self { scenario: ::fidl_next::FromWire::from_wire(wire.scenario) }
1761 }
1762 }
1763
1764 impl ::fidl_next::FromWireRef<crate::wire::WlanPhyGetTxPowerScenarioResponse>
1765 for WlanPhyGetTxPowerScenarioResponse
1766 {
1767 #[inline]
1768 fn from_wire_ref(wire: &crate::wire::WlanPhyGetTxPowerScenarioResponse) -> Self {
1769 Self { scenario: ::fidl_next::FromWireRef::from_wire_ref(&wire.scenario) }
1770 }
1771 }
1772
1773 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1774 pub struct WlanPhyNotifyOnCriticalErrorRequest {
1775 pub reason_code: ::core::option::Option<
1776 ::fidl_next_common_fuchsia_wlan_internal::natural::CriticalErrorReason,
1777 >,
1778 }
1779
1780 impl WlanPhyNotifyOnCriticalErrorRequest {
1781 fn __max_ordinal(&self) -> usize {
1782 if self.reason_code.is_some() {
1783 return 1;
1784 }
1785
1786 0
1787 }
1788 }
1789
1790 unsafe impl<___E>
1791 ::fidl_next::Encode<crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>, ___E>
1792 for WlanPhyNotifyOnCriticalErrorRequest
1793 where
1794 ___E: ::fidl_next::Encoder + ?Sized,
1795 {
1796 #[inline]
1797 fn encode(
1798 mut self,
1799 encoder: &mut ___E,
1800 out: &mut ::core::mem::MaybeUninit<
1801 crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>,
1802 >,
1803 _: (),
1804 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1805 ::fidl_next::munge!(let crate::wire::WlanPhyNotifyOnCriticalErrorRequest { table } = out);
1806
1807 let max_ord = self.__max_ordinal();
1808
1809 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1810 ::fidl_next::Wire::zero_padding(&mut out);
1811
1812 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1813 ::fidl_next::wire::Envelope,
1814 >(encoder, max_ord);
1815
1816 for i in 1..=max_ord {
1817 match i {
1818 1 => {
1819 if let Some(value) = self.reason_code.take() {
1820 ::fidl_next::wire::Envelope::encode_value::<
1821 ::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason,
1822 ___E,
1823 >(
1824 value, preallocated.encoder, &mut out, ()
1825 )?;
1826 } else {
1827 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1828 }
1829 }
1830
1831 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1832 }
1833 unsafe {
1834 preallocated.write_next(out.assume_init_ref());
1835 }
1836 }
1837
1838 ::fidl_next::wire::Table::encode_len(table, max_ord);
1839
1840 Ok(())
1841 }
1842 }
1843
1844 unsafe impl<'a, ___E>
1845 ::fidl_next::Encode<crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>, ___E>
1846 for &'a WlanPhyNotifyOnCriticalErrorRequest
1847 where
1848 ___E: ::fidl_next::Encoder + ?Sized,
1849 {
1850 #[inline]
1851 fn encode(
1852 self,
1853 encoder: &mut ___E,
1854 out: &mut ::core::mem::MaybeUninit<
1855 crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>,
1856 >,
1857 _: (),
1858 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1859 ::fidl_next::munge!(let crate::wire::WlanPhyNotifyOnCriticalErrorRequest { table } = out);
1860
1861 let max_ord = self.__max_ordinal();
1862
1863 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1864 ::fidl_next::Wire::zero_padding(&mut out);
1865
1866 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1867 ::fidl_next::wire::Envelope,
1868 >(encoder, max_ord);
1869
1870 for i in 1..=max_ord {
1871 match i {
1872 1 => {
1873 if let Some(value) = &self.reason_code {
1874 ::fidl_next::wire::Envelope::encode_value::<
1875 ::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason,
1876 ___E,
1877 >(
1878 value, preallocated.encoder, &mut out, ()
1879 )?;
1880 } else {
1881 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1882 }
1883 }
1884
1885 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1886 }
1887 unsafe {
1888 preallocated.write_next(out.assume_init_ref());
1889 }
1890 }
1891
1892 ::fidl_next::wire::Table::encode_len(table, max_ord);
1893
1894 Ok(())
1895 }
1896 }
1897
1898 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>>
1899 for WlanPhyNotifyOnCriticalErrorRequest
1900 {
1901 #[inline]
1902 fn from_wire(wire_: crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>) -> Self {
1903 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1904
1905 let reason_code = wire_.table.get(1);
1906
1907 Self {
1908
1909
1910 reason_code: reason_code.map(|envelope| ::fidl_next::FromWire::from_wire(
1911 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason>() }
1912 )),
1913
1914 }
1915 }
1916 }
1917
1918 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>>
1919 for WlanPhyNotifyOnCriticalErrorRequest
1920 {
1921 #[inline]
1922 fn from_wire_ref(wire: &crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>) -> Self {
1923 Self {
1924
1925
1926 reason_code: wire.table.get(1)
1927 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1928 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason>() }
1929 )),
1930
1931 }
1932 }
1933 }
1934
1935 pub type WlanPhyNotifyOnCriticalErrorResponse = ();
1936
1937 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1938 #[repr(u32)]
1939 pub enum WlanPhyNotifyError {
1940 Internal = 1,
1941 NotSupported = 2,
1942 ShouldWait = 3,
1943 InvalidArgs = 4,
1944 UnknownOrdinal_(u32) = 5,
1945 }
1946 impl ::std::convert::From<u32> for WlanPhyNotifyError {
1947 fn from(value: u32) -> Self {
1948 match value {
1949 1 => Self::Internal,
1950 2 => Self::NotSupported,
1951 3 => Self::ShouldWait,
1952 4 => Self::InvalidArgs,
1953
1954 _ => Self::UnknownOrdinal_(value),
1955 }
1956 }
1957 }
1958
1959 impl ::std::convert::From<WlanPhyNotifyError> for u32 {
1960 fn from(value: WlanPhyNotifyError) -> Self {
1961 match value {
1962 WlanPhyNotifyError::Internal => 1,
1963 WlanPhyNotifyError::NotSupported => 2,
1964 WlanPhyNotifyError::ShouldWait => 3,
1965 WlanPhyNotifyError::InvalidArgs => 4,
1966
1967 WlanPhyNotifyError::UnknownOrdinal_(value) => value,
1968 }
1969 }
1970 }
1971
1972 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WlanPhyNotifyError, ___E> for WlanPhyNotifyError
1973 where
1974 ___E: ?Sized,
1975 {
1976 #[inline]
1977 fn encode(
1978 self,
1979 encoder: &mut ___E,
1980 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyNotifyError>,
1981 _: (),
1982 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1983 ::fidl_next::Encode::encode(&self, encoder, out, ())
1984 }
1985 }
1986
1987 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WlanPhyNotifyError, ___E>
1988 for &'a WlanPhyNotifyError
1989 where
1990 ___E: ?Sized,
1991 {
1992 #[inline]
1993 fn encode(
1994 self,
1995 encoder: &mut ___E,
1996 out: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyNotifyError>,
1997 _: (),
1998 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1999 ::fidl_next::munge!(let crate::wire::WlanPhyNotifyError { value } = out);
2000 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2001 WlanPhyNotifyError::Internal => 1,
2002
2003 WlanPhyNotifyError::NotSupported => 2,
2004
2005 WlanPhyNotifyError::ShouldWait => 3,
2006
2007 WlanPhyNotifyError::InvalidArgs => 4,
2008
2009 WlanPhyNotifyError::UnknownOrdinal_(value) => value,
2010 }));
2011
2012 Ok(())
2013 }
2014 }
2015
2016 impl ::core::convert::From<crate::wire::WlanPhyNotifyError> for WlanPhyNotifyError {
2017 fn from(wire: crate::wire::WlanPhyNotifyError) -> Self {
2018 match u32::from(wire.value) {
2019 1 => Self::Internal,
2020
2021 2 => Self::NotSupported,
2022
2023 3 => Self::ShouldWait,
2024
2025 4 => Self::InvalidArgs,
2026
2027 value => Self::UnknownOrdinal_(value),
2028 }
2029 }
2030 }
2031
2032 impl ::fidl_next::FromWire<crate::wire::WlanPhyNotifyError> for WlanPhyNotifyError {
2033 #[inline]
2034 fn from_wire(wire: crate::wire::WlanPhyNotifyError) -> Self {
2035 Self::from(wire)
2036 }
2037 }
2038
2039 impl ::fidl_next::FromWireRef<crate::wire::WlanPhyNotifyError> for WlanPhyNotifyError {
2040 #[inline]
2041 fn from_wire_ref(wire: &crate::wire::WlanPhyNotifyError) -> Self {
2042 Self::from(*wire)
2043 }
2044 }
2045
2046 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2047 pub struct WlanPhyNotifyOnCountryCodeChangeRequest {
2048 pub phy_country: ::core::option::Option<[u8; 2]>,
2049 }
2050
2051 impl WlanPhyNotifyOnCountryCodeChangeRequest {
2052 fn __max_ordinal(&self) -> usize {
2053 if self.phy_country.is_some() {
2054 return 1;
2055 }
2056
2057 0
2058 }
2059 }
2060
2061 unsafe impl<___E>
2062 ::fidl_next::Encode<crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>, ___E>
2063 for WlanPhyNotifyOnCountryCodeChangeRequest
2064 where
2065 ___E: ::fidl_next::Encoder + ?Sized,
2066 {
2067 #[inline]
2068 fn encode(
2069 mut self,
2070 encoder: &mut ___E,
2071 out: &mut ::core::mem::MaybeUninit<
2072 crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>,
2073 >,
2074 _: (),
2075 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2076 ::fidl_next::munge!(let crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest { table } = out);
2077
2078 let max_ord = self.__max_ordinal();
2079
2080 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2081 ::fidl_next::Wire::zero_padding(&mut out);
2082
2083 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2084 ::fidl_next::wire::Envelope,
2085 >(encoder, max_ord);
2086
2087 for i in 1..=max_ord {
2088 match i {
2089 1 => {
2090 if let Some(value) = self.phy_country.take() {
2091 ::fidl_next::wire::Envelope::encode_value::<[u8; 2], ___E>(
2092 value,
2093 preallocated.encoder,
2094 &mut out,
2095 (),
2096 )?;
2097 } else {
2098 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2099 }
2100 }
2101
2102 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2103 }
2104 unsafe {
2105 preallocated.write_next(out.assume_init_ref());
2106 }
2107 }
2108
2109 ::fidl_next::wire::Table::encode_len(table, max_ord);
2110
2111 Ok(())
2112 }
2113 }
2114
2115 unsafe impl<'a, ___E>
2116 ::fidl_next::Encode<crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>, ___E>
2117 for &'a WlanPhyNotifyOnCountryCodeChangeRequest
2118 where
2119 ___E: ::fidl_next::Encoder + ?Sized,
2120 {
2121 #[inline]
2122 fn encode(
2123 self,
2124 encoder: &mut ___E,
2125 out: &mut ::core::mem::MaybeUninit<
2126 crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>,
2127 >,
2128 _: (),
2129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2130 ::fidl_next::munge!(let crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest { table } = out);
2131
2132 let max_ord = self.__max_ordinal();
2133
2134 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2135 ::fidl_next::Wire::zero_padding(&mut out);
2136
2137 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2138 ::fidl_next::wire::Envelope,
2139 >(encoder, max_ord);
2140
2141 for i in 1..=max_ord {
2142 match i {
2143 1 => {
2144 if let Some(value) = &self.phy_country {
2145 ::fidl_next::wire::Envelope::encode_value::<[u8; 2], ___E>(
2146 value,
2147 preallocated.encoder,
2148 &mut out,
2149 (),
2150 )?;
2151 } else {
2152 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2153 }
2154 }
2155
2156 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2157 }
2158 unsafe {
2159 preallocated.write_next(out.assume_init_ref());
2160 }
2161 }
2162
2163 ::fidl_next::wire::Table::encode_len(table, max_ord);
2164
2165 Ok(())
2166 }
2167 }
2168
2169 impl<'de> ::fidl_next::FromWire<crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>>
2170 for WlanPhyNotifyOnCountryCodeChangeRequest
2171 {
2172 #[inline]
2173 fn from_wire(wire_: crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>) -> Self {
2174 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2175
2176 let phy_country = wire_.table.get(1);
2177
2178 Self {
2179 phy_country: phy_country.map(|envelope| {
2180 ::fidl_next::FromWire::from_wire(unsafe {
2181 envelope.read_unchecked::<[u8; 2]>()
2182 })
2183 }),
2184 }
2185 }
2186 }
2187
2188 impl<'de> ::fidl_next::FromWireRef<crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>>
2189 for WlanPhyNotifyOnCountryCodeChangeRequest
2190 {
2191 #[inline]
2192 fn from_wire_ref(wire: &crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>) -> Self {
2193 Self {
2194 phy_country: wire.table.get(1).map(|envelope| {
2195 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2196 envelope.deref_unchecked::<[u8; 2]>()
2197 })
2198 }),
2199 }
2200 }
2201 }
2202
2203 pub type WlanPhyNotifyOnCountryCodeChangeResponse = ();
2204}
2205
2206pub mod wire {
2207
2208 pub type WlanPhyInitResponse = ::fidl_next::wire::Unit;
2210
2211 #[repr(C)]
2213 pub struct WlanPhyGetSupportedMacRolesResponse<'de> {
2214 pub(crate) table: ::fidl_next::wire::Table<'de>,
2215 }
2216
2217 impl<'de> Drop for WlanPhyGetSupportedMacRolesResponse<'de> {
2218 fn drop(&mut self) {
2219 let _ = self.table.get(1).map(|envelope| unsafe {
2220 envelope.read_unchecked::<::fidl_next::wire::Vector<
2221 'de,
2222 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
2223 >>()
2224 });
2225 }
2226 }
2227
2228 impl ::fidl_next::Constrained for WlanPhyGetSupportedMacRolesResponse<'_> {
2229 type Constraint = ();
2230
2231 fn validate(
2232 _: ::fidl_next::Slot<'_, Self>,
2233 _: Self::Constraint,
2234 ) -> Result<(), ::fidl_next::ValidationError> {
2235 Ok(())
2236 }
2237 }
2238
2239 unsafe impl ::fidl_next::Wire for WlanPhyGetSupportedMacRolesResponse<'static> {
2240 type Narrowed<'de> = WlanPhyGetSupportedMacRolesResponse<'de>;
2241
2242 #[inline]
2243 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2244 ::fidl_next::munge!(let Self { table } = out);
2245 ::fidl_next::wire::Table::zero_padding(table);
2246 }
2247 }
2248
2249 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyGetSupportedMacRolesResponse<'de>
2250 where
2251 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2252 {
2253 fn decode(
2254 slot: ::fidl_next::Slot<'_, Self>,
2255 decoder: &mut ___D,
2256 _: (),
2257 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2258 ::fidl_next::munge!(let Self { table } = slot);
2259
2260 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2261 match ordinal {
2262 0 => unsafe { ::core::hint::unreachable_unchecked() },
2263
2264 1 => {
2265 ::fidl_next::wire::Envelope::decode_as::<
2266 ___D,
2267 ::fidl_next::wire::Vector<
2268 'de,
2269 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
2270 >,
2271 >(slot.as_mut(), decoder, (16, ()))?;
2272
2273 let value = unsafe {
2274 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2275 '_,
2276 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
2277 >>()
2278 };
2279
2280 if value.len() > 16 {
2281 return Err(::fidl_next::DecodeError::VectorTooLong {
2282 size: value.len() as u64,
2283 limit: 16,
2284 });
2285 }
2286
2287 Ok(())
2288 }
2289
2290 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2291 }
2292 })
2293 }
2294 }
2295
2296 impl<'de> WlanPhyGetSupportedMacRolesResponse<'de> {
2297 pub fn supported_mac_roles(
2298 &self,
2299 ) -> ::core::option::Option<
2300 &::fidl_next::wire::Vector<
2301 'de,
2302 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
2303 >,
2304 > {
2305 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2306 }
2307
2308 pub fn take_supported_mac_roles(
2309 &mut self,
2310 ) -> ::core::option::Option<
2311 ::fidl_next::wire::Vector<
2312 'de,
2313 ::fidl_next_common_fuchsia_wlan_common::wire::WlanMacRole,
2314 >,
2315 > {
2316 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2317 }
2318 }
2319
2320 impl<'de> ::core::fmt::Debug for WlanPhyGetSupportedMacRolesResponse<'de> {
2321 fn fmt(
2322 &self,
2323 f: &mut ::core::fmt::Formatter<'_>,
2324 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2325 f.debug_struct("WlanPhyGetSupportedMacRolesResponse")
2326 .field("supported_mac_roles", &self.supported_mac_roles())
2327 .finish()
2328 }
2329 }
2330
2331 impl<'de> ::fidl_next::IntoNatural for WlanPhyGetSupportedMacRolesResponse<'de> {
2332 type Natural = crate::natural::WlanPhyGetSupportedMacRolesResponse;
2333 }
2334
2335 #[repr(C)]
2337 pub struct WlanPhyCreateIfaceResponse<'de> {
2338 pub(crate) table: ::fidl_next::wire::Table<'de>,
2339 }
2340
2341 impl<'de> Drop for WlanPhyCreateIfaceResponse<'de> {
2342 fn drop(&mut self) {
2343 let _ = self
2344 .table
2345 .get(1)
2346 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() });
2347 }
2348 }
2349
2350 impl ::fidl_next::Constrained for WlanPhyCreateIfaceResponse<'_> {
2351 type Constraint = ();
2352
2353 fn validate(
2354 _: ::fidl_next::Slot<'_, Self>,
2355 _: Self::Constraint,
2356 ) -> Result<(), ::fidl_next::ValidationError> {
2357 Ok(())
2358 }
2359 }
2360
2361 unsafe impl ::fidl_next::Wire for WlanPhyCreateIfaceResponse<'static> {
2362 type Narrowed<'de> = WlanPhyCreateIfaceResponse<'de>;
2363
2364 #[inline]
2365 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2366 ::fidl_next::munge!(let Self { table } = out);
2367 ::fidl_next::wire::Table::zero_padding(table);
2368 }
2369 }
2370
2371 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyCreateIfaceResponse<'de>
2372 where
2373 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2374 {
2375 fn decode(
2376 slot: ::fidl_next::Slot<'_, Self>,
2377 decoder: &mut ___D,
2378 _: (),
2379 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2380 ::fidl_next::munge!(let Self { table } = slot);
2381
2382 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2383 match ordinal {
2384 0 => unsafe { ::core::hint::unreachable_unchecked() },
2385
2386 1 => {
2387 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint16>(
2388 slot.as_mut(),
2389 decoder,
2390 (),
2391 )?;
2392
2393 Ok(())
2394 }
2395
2396 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2397 }
2398 })
2399 }
2400 }
2401
2402 impl<'de> WlanPhyCreateIfaceResponse<'de> {
2403 pub fn iface_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint16> {
2404 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2405 }
2406
2407 pub fn take_iface_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint16> {
2408 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2409 }
2410 }
2411
2412 impl<'de> ::core::fmt::Debug for WlanPhyCreateIfaceResponse<'de> {
2413 fn fmt(
2414 &self,
2415 f: &mut ::core::fmt::Formatter<'_>,
2416 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2417 f.debug_struct("WlanPhyCreateIfaceResponse")
2418 .field("iface_id", &self.iface_id())
2419 .finish()
2420 }
2421 }
2422
2423 impl<'de> ::fidl_next::IntoNatural for WlanPhyCreateIfaceResponse<'de> {
2424 type Natural = crate::natural::WlanPhyCreateIfaceResponse;
2425 }
2426
2427 #[repr(C)]
2429 pub struct WlanPhyDestroyIfaceRequest<'de> {
2430 pub(crate) table: ::fidl_next::wire::Table<'de>,
2431 }
2432
2433 impl<'de> Drop for WlanPhyDestroyIfaceRequest<'de> {
2434 fn drop(&mut self) {
2435 let _ = self
2436 .table
2437 .get(1)
2438 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() });
2439 }
2440 }
2441
2442 impl ::fidl_next::Constrained for WlanPhyDestroyIfaceRequest<'_> {
2443 type Constraint = ();
2444
2445 fn validate(
2446 _: ::fidl_next::Slot<'_, Self>,
2447 _: Self::Constraint,
2448 ) -> Result<(), ::fidl_next::ValidationError> {
2449 Ok(())
2450 }
2451 }
2452
2453 unsafe impl ::fidl_next::Wire for WlanPhyDestroyIfaceRequest<'static> {
2454 type Narrowed<'de> = WlanPhyDestroyIfaceRequest<'de>;
2455
2456 #[inline]
2457 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2458 ::fidl_next::munge!(let Self { table } = out);
2459 ::fidl_next::wire::Table::zero_padding(table);
2460 }
2461 }
2462
2463 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyDestroyIfaceRequest<'de>
2464 where
2465 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2466 {
2467 fn decode(
2468 slot: ::fidl_next::Slot<'_, Self>,
2469 decoder: &mut ___D,
2470 _: (),
2471 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2472 ::fidl_next::munge!(let Self { table } = slot);
2473
2474 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2475 match ordinal {
2476 0 => unsafe { ::core::hint::unreachable_unchecked() },
2477
2478 1 => {
2479 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint16>(
2480 slot.as_mut(),
2481 decoder,
2482 (),
2483 )?;
2484
2485 Ok(())
2486 }
2487
2488 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2489 }
2490 })
2491 }
2492 }
2493
2494 impl<'de> WlanPhyDestroyIfaceRequest<'de> {
2495 pub fn iface_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint16> {
2496 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2497 }
2498
2499 pub fn take_iface_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint16> {
2500 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2501 }
2502 }
2503
2504 impl<'de> ::core::fmt::Debug for WlanPhyDestroyIfaceRequest<'de> {
2505 fn fmt(
2506 &self,
2507 f: &mut ::core::fmt::Formatter<'_>,
2508 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2509 f.debug_struct("WlanPhyDestroyIfaceRequest")
2510 .field("iface_id", &self.iface_id())
2511 .finish()
2512 }
2513 }
2514
2515 impl<'de> ::fidl_next::IntoNatural for WlanPhyDestroyIfaceRequest<'de> {
2516 type Natural = crate::natural::WlanPhyDestroyIfaceRequest;
2517 }
2518
2519 pub type WlanPhyDestroyIfaceResponse = ::fidl_next::wire::Unit;
2521
2522 #[derive(Clone, Debug)]
2524 #[repr(C)]
2525 pub struct WlanPhySetCountryRequest {
2526 pub country: [u8; 2],
2527 }
2528
2529 static_assertions::const_assert_eq!(std::mem::size_of::<WlanPhySetCountryRequest>(), 2);
2530 static_assertions::const_assert_eq!(std::mem::align_of::<WlanPhySetCountryRequest>(), 1);
2531
2532 static_assertions::const_assert_eq!(std::mem::offset_of!(WlanPhySetCountryRequest, country), 0);
2533
2534 impl ::fidl_next::Constrained for WlanPhySetCountryRequest {
2535 type Constraint = ();
2536
2537 fn validate(
2538 _: ::fidl_next::Slot<'_, Self>,
2539 _: Self::Constraint,
2540 ) -> Result<(), ::fidl_next::ValidationError> {
2541 Ok(())
2542 }
2543 }
2544
2545 unsafe impl ::fidl_next::Wire for WlanPhySetCountryRequest {
2546 type Narrowed<'de> = WlanPhySetCountryRequest;
2547
2548 #[inline]
2549 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2550 ::fidl_next::munge! {
2551 let Self {
2552 country,
2553
2554 } = &mut *out_;
2555 }
2556
2557 ::fidl_next::Wire::zero_padding(country);
2558 }
2559 }
2560
2561 unsafe impl<___D> ::fidl_next::Decode<___D> for WlanPhySetCountryRequest
2562 where
2563 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2564 {
2565 fn decode(
2566 slot_: ::fidl_next::Slot<'_, Self>,
2567 decoder_: &mut ___D,
2568 _: (),
2569 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2570 ::fidl_next::munge! {
2571 let Self {
2572 mut country,
2573
2574 } = slot_;
2575 }
2576
2577 let _field = country.as_mut();
2578
2579 ::fidl_next::Decode::decode(country.as_mut(), decoder_, ())?;
2580
2581 Ok(())
2582 }
2583 }
2584
2585 impl ::fidl_next::IntoNatural for WlanPhySetCountryRequest {
2586 type Natural = crate::natural::WlanPhySetCountryRequest;
2587 }
2588
2589 pub type WlanPhySetCountryResponse = ::fidl_next::wire::Unit;
2591
2592 pub type WlanPhyClearCountryResponse = ::fidl_next::wire::Unit;
2594
2595 #[derive(Clone, Debug)]
2597 #[repr(C)]
2598 pub struct WlanPhyGetCountryResponse {
2599 pub country: [u8; 2],
2600 }
2601
2602 static_assertions::const_assert_eq!(std::mem::size_of::<WlanPhyGetCountryResponse>(), 2);
2603 static_assertions::const_assert_eq!(std::mem::align_of::<WlanPhyGetCountryResponse>(), 1);
2604
2605 static_assertions::const_assert_eq!(
2606 std::mem::offset_of!(WlanPhyGetCountryResponse, country),
2607 0
2608 );
2609
2610 impl ::fidl_next::Constrained for WlanPhyGetCountryResponse {
2611 type Constraint = ();
2612
2613 fn validate(
2614 _: ::fidl_next::Slot<'_, Self>,
2615 _: Self::Constraint,
2616 ) -> Result<(), ::fidl_next::ValidationError> {
2617 Ok(())
2618 }
2619 }
2620
2621 unsafe impl ::fidl_next::Wire for WlanPhyGetCountryResponse {
2622 type Narrowed<'de> = WlanPhyGetCountryResponse;
2623
2624 #[inline]
2625 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2626 ::fidl_next::munge! {
2627 let Self {
2628 country,
2629
2630 } = &mut *out_;
2631 }
2632
2633 ::fidl_next::Wire::zero_padding(country);
2634 }
2635 }
2636
2637 unsafe impl<___D> ::fidl_next::Decode<___D> for WlanPhyGetCountryResponse
2638 where
2639 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2640 {
2641 fn decode(
2642 slot_: ::fidl_next::Slot<'_, Self>,
2643 decoder_: &mut ___D,
2644 _: (),
2645 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2646 ::fidl_next::munge! {
2647 let Self {
2648 mut country,
2649
2650 } = slot_;
2651 }
2652
2653 let _field = country.as_mut();
2654
2655 ::fidl_next::Decode::decode(country.as_mut(), decoder_, ())?;
2656
2657 Ok(())
2658 }
2659 }
2660
2661 impl ::fidl_next::IntoNatural for WlanPhyGetCountryResponse {
2662 type Natural = crate::natural::WlanPhyGetCountryResponse;
2663 }
2664
2665 #[repr(C)]
2667 pub struct WlanPhySetPowerSaveModeRequest<'de> {
2668 pub(crate) table: ::fidl_next::wire::Table<'de>,
2669 }
2670
2671 impl<'de> Drop for WlanPhySetPowerSaveModeRequest<'de> {
2672 fn drop(&mut self) {
2673 let _ = self.table.get(1)
2674 .map(|envelope| unsafe {
2675 envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>()
2676 });
2677 }
2678 }
2679
2680 impl ::fidl_next::Constrained for WlanPhySetPowerSaveModeRequest<'_> {
2681 type Constraint = ();
2682
2683 fn validate(
2684 _: ::fidl_next::Slot<'_, Self>,
2685 _: Self::Constraint,
2686 ) -> Result<(), ::fidl_next::ValidationError> {
2687 Ok(())
2688 }
2689 }
2690
2691 unsafe impl ::fidl_next::Wire for WlanPhySetPowerSaveModeRequest<'static> {
2692 type Narrowed<'de> = WlanPhySetPowerSaveModeRequest<'de>;
2693
2694 #[inline]
2695 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2696 ::fidl_next::munge!(let Self { table } = out);
2697 ::fidl_next::wire::Table::zero_padding(table);
2698 }
2699 }
2700
2701 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhySetPowerSaveModeRequest<'de>
2702 where
2703 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2704 {
2705 fn decode(
2706 slot: ::fidl_next::Slot<'_, Self>,
2707 decoder: &mut ___D,
2708 _: (),
2709 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2710 ::fidl_next::munge!(let Self { table } = slot);
2711
2712 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2713 match ordinal {
2714 0 => unsafe { ::core::hint::unreachable_unchecked() },
2715
2716 1 => {
2717 ::fidl_next::wire::Envelope::decode_as::<
2718 ___D,
2719 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
2720 >(slot.as_mut(), decoder, ())?;
2721
2722 Ok(())
2723 }
2724
2725 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2726 }
2727 })
2728 }
2729 }
2730
2731 impl<'de> WlanPhySetPowerSaveModeRequest<'de> {
2732 pub fn ps_mode(
2733 &self,
2734 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>
2735 {
2736 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2737 }
2738
2739 pub fn take_ps_mode(
2740 &mut self,
2741 ) -> ::core::option::Option<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>
2742 {
2743 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2744 }
2745 }
2746
2747 impl<'de> ::core::fmt::Debug for WlanPhySetPowerSaveModeRequest<'de> {
2748 fn fmt(
2749 &self,
2750 f: &mut ::core::fmt::Formatter<'_>,
2751 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2752 f.debug_struct("WlanPhySetPowerSaveModeRequest")
2753 .field("ps_mode", &self.ps_mode())
2754 .finish()
2755 }
2756 }
2757
2758 impl<'de> ::fidl_next::IntoNatural for WlanPhySetPowerSaveModeRequest<'de> {
2759 type Natural = crate::natural::WlanPhySetPowerSaveModeRequest;
2760 }
2761
2762 pub type WlanPhySetPowerSaveModeResponse = ::fidl_next::wire::Unit;
2764
2765 #[repr(C)]
2767 pub struct WlanPhyGetPowerSaveModeResponse<'de> {
2768 pub(crate) table: ::fidl_next::wire::Table<'de>,
2769 }
2770
2771 impl<'de> Drop for WlanPhyGetPowerSaveModeResponse<'de> {
2772 fn drop(&mut self) {
2773 let _ = self.table.get(1)
2774 .map(|envelope| unsafe {
2775 envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>()
2776 });
2777 }
2778 }
2779
2780 impl ::fidl_next::Constrained for WlanPhyGetPowerSaveModeResponse<'_> {
2781 type Constraint = ();
2782
2783 fn validate(
2784 _: ::fidl_next::Slot<'_, Self>,
2785 _: Self::Constraint,
2786 ) -> Result<(), ::fidl_next::ValidationError> {
2787 Ok(())
2788 }
2789 }
2790
2791 unsafe impl ::fidl_next::Wire for WlanPhyGetPowerSaveModeResponse<'static> {
2792 type Narrowed<'de> = WlanPhyGetPowerSaveModeResponse<'de>;
2793
2794 #[inline]
2795 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2796 ::fidl_next::munge!(let Self { table } = out);
2797 ::fidl_next::wire::Table::zero_padding(table);
2798 }
2799 }
2800
2801 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyGetPowerSaveModeResponse<'de>
2802 where
2803 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2804 {
2805 fn decode(
2806 slot: ::fidl_next::Slot<'_, Self>,
2807 decoder: &mut ___D,
2808 _: (),
2809 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2810 ::fidl_next::munge!(let Self { table } = slot);
2811
2812 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2813 match ordinal {
2814 0 => unsafe { ::core::hint::unreachable_unchecked() },
2815
2816 1 => {
2817 ::fidl_next::wire::Envelope::decode_as::<
2818 ___D,
2819 ::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType,
2820 >(slot.as_mut(), decoder, ())?;
2821
2822 Ok(())
2823 }
2824
2825 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2826 }
2827 })
2828 }
2829 }
2830
2831 impl<'de> WlanPhyGetPowerSaveModeResponse<'de> {
2832 pub fn ps_mode(
2833 &self,
2834 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>
2835 {
2836 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2837 }
2838
2839 pub fn take_ps_mode(
2840 &mut self,
2841 ) -> ::core::option::Option<::fidl_next_common_fuchsia_wlan_common::wire::PowerSaveType>
2842 {
2843 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2844 }
2845 }
2846
2847 impl<'de> ::core::fmt::Debug for WlanPhyGetPowerSaveModeResponse<'de> {
2848 fn fmt(
2849 &self,
2850 f: &mut ::core::fmt::Formatter<'_>,
2851 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2852 f.debug_struct("WlanPhyGetPowerSaveModeResponse")
2853 .field("ps_mode", &self.ps_mode())
2854 .finish()
2855 }
2856 }
2857
2858 impl<'de> ::fidl_next::IntoNatural for WlanPhyGetPowerSaveModeResponse<'de> {
2859 type Natural = crate::natural::WlanPhyGetPowerSaveModeResponse;
2860 }
2861
2862 pub type WlanPhyPowerDownResponse = ::fidl_next::wire::Unit;
2864
2865 pub type WlanPhyPowerUpResponse = ::fidl_next::wire::Unit;
2867
2868 pub type WlanPhyResetResponse = ::fidl_next::wire::Unit;
2870
2871 #[repr(C)]
2873 pub struct WlanPhyGetPowerStateResponse<'de> {
2874 pub(crate) table: ::fidl_next::wire::Table<'de>,
2875 }
2876
2877 impl<'de> Drop for WlanPhyGetPowerStateResponse<'de> {
2878 fn drop(&mut self) {
2879 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
2880 }
2881 }
2882
2883 impl ::fidl_next::Constrained for WlanPhyGetPowerStateResponse<'_> {
2884 type Constraint = ();
2885
2886 fn validate(
2887 _: ::fidl_next::Slot<'_, Self>,
2888 _: Self::Constraint,
2889 ) -> Result<(), ::fidl_next::ValidationError> {
2890 Ok(())
2891 }
2892 }
2893
2894 unsafe impl ::fidl_next::Wire for WlanPhyGetPowerStateResponse<'static> {
2895 type Narrowed<'de> = WlanPhyGetPowerStateResponse<'de>;
2896
2897 #[inline]
2898 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2899 ::fidl_next::munge!(let Self { table } = out);
2900 ::fidl_next::wire::Table::zero_padding(table);
2901 }
2902 }
2903
2904 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyGetPowerStateResponse<'de>
2905 where
2906 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2907 {
2908 fn decode(
2909 slot: ::fidl_next::Slot<'_, Self>,
2910 decoder: &mut ___D,
2911 _: (),
2912 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2913 ::fidl_next::munge!(let Self { table } = slot);
2914
2915 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2916 match ordinal {
2917 0 => unsafe { ::core::hint::unreachable_unchecked() },
2918
2919 1 => {
2920 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
2921 slot.as_mut(),
2922 decoder,
2923 (),
2924 )?;
2925
2926 Ok(())
2927 }
2928
2929 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2930 }
2931 })
2932 }
2933 }
2934
2935 impl<'de> WlanPhyGetPowerStateResponse<'de> {
2936 pub fn power_on(&self) -> ::core::option::Option<&bool> {
2937 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2938 }
2939
2940 pub fn take_power_on(&mut self) -> ::core::option::Option<bool> {
2941 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2942 }
2943 }
2944
2945 impl<'de> ::core::fmt::Debug for WlanPhyGetPowerStateResponse<'de> {
2946 fn fmt(
2947 &self,
2948 f: &mut ::core::fmt::Formatter<'_>,
2949 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2950 f.debug_struct("WlanPhyGetPowerStateResponse")
2951 .field("power_on", &self.power_on())
2952 .finish()
2953 }
2954 }
2955
2956 impl<'de> ::fidl_next::IntoNatural for WlanPhyGetPowerStateResponse<'de> {
2957 type Natural = crate::natural::WlanPhyGetPowerStateResponse;
2958 }
2959
2960 #[repr(C)]
2962 pub struct WlanPhySetBtCoexistenceModeRequest<'de> {
2963 pub(crate) table: ::fidl_next::wire::Table<'de>,
2964 }
2965
2966 impl<'de> Drop for WlanPhySetBtCoexistenceModeRequest<'de> {
2967 fn drop(&mut self) {
2968 let _ = self.table.get(1)
2969 .map(|envelope| unsafe {
2970 envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode>()
2971 });
2972 }
2973 }
2974
2975 impl ::fidl_next::Constrained for WlanPhySetBtCoexistenceModeRequest<'_> {
2976 type Constraint = ();
2977
2978 fn validate(
2979 _: ::fidl_next::Slot<'_, Self>,
2980 _: Self::Constraint,
2981 ) -> Result<(), ::fidl_next::ValidationError> {
2982 Ok(())
2983 }
2984 }
2985
2986 unsafe impl ::fidl_next::Wire for WlanPhySetBtCoexistenceModeRequest<'static> {
2987 type Narrowed<'de> = WlanPhySetBtCoexistenceModeRequest<'de>;
2988
2989 #[inline]
2990 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2991 ::fidl_next::munge!(let Self { table } = out);
2992 ::fidl_next::wire::Table::zero_padding(table);
2993 }
2994 }
2995
2996 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhySetBtCoexistenceModeRequest<'de>
2997 where
2998 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2999 {
3000 fn decode(
3001 slot: ::fidl_next::Slot<'_, Self>,
3002 decoder: &mut ___D,
3003 _: (),
3004 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3005 ::fidl_next::munge!(let Self { table } = slot);
3006
3007 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3008 match ordinal {
3009 0 => unsafe { ::core::hint::unreachable_unchecked() },
3010
3011 1 => {
3012 ::fidl_next::wire::Envelope::decode_as::<
3013 ___D,
3014 ::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode,
3015 >(slot.as_mut(), decoder, ())?;
3016
3017 Ok(())
3018 }
3019
3020 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3021 }
3022 })
3023 }
3024 }
3025
3026 impl<'de> WlanPhySetBtCoexistenceModeRequest<'de> {
3027 pub fn mode(
3028 &self,
3029 ) -> ::core::option::Option<
3030 &::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode,
3031 > {
3032 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3033 }
3034
3035 pub fn take_mode(
3036 &mut self,
3037 ) -> ::core::option::Option<::fidl_next_common_fuchsia_wlan_internal::wire::BtCoexistenceMode>
3038 {
3039 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3040 }
3041 }
3042
3043 impl<'de> ::core::fmt::Debug for WlanPhySetBtCoexistenceModeRequest<'de> {
3044 fn fmt(
3045 &self,
3046 f: &mut ::core::fmt::Formatter<'_>,
3047 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3048 f.debug_struct("WlanPhySetBtCoexistenceModeRequest")
3049 .field("mode", &self.mode())
3050 .finish()
3051 }
3052 }
3053
3054 impl<'de> ::fidl_next::IntoNatural for WlanPhySetBtCoexistenceModeRequest<'de> {
3055 type Natural = crate::natural::WlanPhySetBtCoexistenceModeRequest;
3056 }
3057
3058 pub type WlanPhySetBtCoexistenceModeResponse = ::fidl_next::wire::Unit;
3060
3061 #[repr(C)]
3063 pub struct WlanPhySetTxPowerScenarioRequest<'de> {
3064 pub(crate) table: ::fidl_next::wire::Table<'de>,
3065 }
3066
3067 impl<'de> Drop for WlanPhySetTxPowerScenarioRequest<'de> {
3068 fn drop(&mut self) {
3069 let _ = self.table.get(1)
3070 .map(|envelope| unsafe {
3071 envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>()
3072 });
3073 }
3074 }
3075
3076 impl ::fidl_next::Constrained for WlanPhySetTxPowerScenarioRequest<'_> {
3077 type Constraint = ();
3078
3079 fn validate(
3080 _: ::fidl_next::Slot<'_, Self>,
3081 _: Self::Constraint,
3082 ) -> Result<(), ::fidl_next::ValidationError> {
3083 Ok(())
3084 }
3085 }
3086
3087 unsafe impl ::fidl_next::Wire for WlanPhySetTxPowerScenarioRequest<'static> {
3088 type Narrowed<'de> = WlanPhySetTxPowerScenarioRequest<'de>;
3089
3090 #[inline]
3091 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3092 ::fidl_next::munge!(let Self { table } = out);
3093 ::fidl_next::wire::Table::zero_padding(table);
3094 }
3095 }
3096
3097 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhySetTxPowerScenarioRequest<'de>
3098 where
3099 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3100 {
3101 fn decode(
3102 slot: ::fidl_next::Slot<'_, Self>,
3103 decoder: &mut ___D,
3104 _: (),
3105 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3106 ::fidl_next::munge!(let Self { table } = slot);
3107
3108 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3109 match ordinal {
3110 0 => unsafe { ::core::hint::unreachable_unchecked() },
3111
3112 1 => {
3113 ::fidl_next::wire::Envelope::decode_as::<
3114 ___D,
3115 ::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario,
3116 >(slot.as_mut(), decoder, ())?;
3117
3118 Ok(())
3119 }
3120
3121 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3122 }
3123 })
3124 }
3125 }
3126
3127 impl<'de> WlanPhySetTxPowerScenarioRequest<'de> {
3128 pub fn scenario(
3129 &self,
3130 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>
3131 {
3132 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3133 }
3134
3135 pub fn take_scenario(
3136 &mut self,
3137 ) -> ::core::option::Option<::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario>
3138 {
3139 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3140 }
3141 }
3142
3143 impl<'de> ::core::fmt::Debug for WlanPhySetTxPowerScenarioRequest<'de> {
3144 fn fmt(
3145 &self,
3146 f: &mut ::core::fmt::Formatter<'_>,
3147 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3148 f.debug_struct("WlanPhySetTxPowerScenarioRequest")
3149 .field("scenario", &self.scenario())
3150 .finish()
3151 }
3152 }
3153
3154 impl<'de> ::fidl_next::IntoNatural for WlanPhySetTxPowerScenarioRequest<'de> {
3155 type Natural = crate::natural::WlanPhySetTxPowerScenarioRequest;
3156 }
3157
3158 pub type WlanPhySetTxPowerScenarioResponse = ::fidl_next::wire::Unit;
3160
3161 pub type WlanPhyResetTxPowerScenarioResponse = ::fidl_next::wire::Unit;
3163
3164 #[derive(Clone, Debug)]
3166 #[repr(C)]
3167 pub struct WlanPhyGetTxPowerScenarioResponse {
3168 pub scenario: ::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario,
3169 }
3170
3171 static_assertions::const_assert_eq!(
3172 std::mem::size_of::<WlanPhyGetTxPowerScenarioResponse>(),
3173 4
3174 );
3175 static_assertions::const_assert_eq!(
3176 std::mem::align_of::<WlanPhyGetTxPowerScenarioResponse>(),
3177 4
3178 );
3179
3180 static_assertions::const_assert_eq!(
3181 std::mem::offset_of!(WlanPhyGetTxPowerScenarioResponse, scenario),
3182 0
3183 );
3184
3185 impl ::fidl_next::Constrained for WlanPhyGetTxPowerScenarioResponse {
3186 type Constraint = ();
3187
3188 fn validate(
3189 _: ::fidl_next::Slot<'_, Self>,
3190 _: Self::Constraint,
3191 ) -> Result<(), ::fidl_next::ValidationError> {
3192 Ok(())
3193 }
3194 }
3195
3196 unsafe impl ::fidl_next::Wire for WlanPhyGetTxPowerScenarioResponse {
3197 type Narrowed<'de> = WlanPhyGetTxPowerScenarioResponse;
3198
3199 #[inline]
3200 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3201 ::fidl_next::munge! {
3202 let Self {
3203 scenario,
3204
3205 } = &mut *out_;
3206 }
3207
3208 ::fidl_next::Wire::zero_padding(scenario);
3209 }
3210 }
3211
3212 unsafe impl<___D> ::fidl_next::Decode<___D> for WlanPhyGetTxPowerScenarioResponse
3213 where
3214 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3215 {
3216 fn decode(
3217 slot_: ::fidl_next::Slot<'_, Self>,
3218 decoder_: &mut ___D,
3219 _: (),
3220 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3221 ::fidl_next::munge! {
3222 let Self {
3223 mut scenario,
3224
3225 } = slot_;
3226 }
3227
3228 let _field = scenario.as_mut();
3229
3230 ::fidl_next::Decode::decode(scenario.as_mut(), decoder_, ())?;
3231
3232 Ok(())
3233 }
3234 }
3235
3236 impl ::fidl_next::IntoNatural for WlanPhyGetTxPowerScenarioResponse {
3237 type Natural = crate::natural::WlanPhyGetTxPowerScenarioResponse;
3238 }
3239
3240 #[repr(C)]
3242 pub struct WlanPhyNotifyOnCriticalErrorRequest<'de> {
3243 pub(crate) table: ::fidl_next::wire::Table<'de>,
3244 }
3245
3246 impl<'de> Drop for WlanPhyNotifyOnCriticalErrorRequest<'de> {
3247 fn drop(&mut self) {
3248 let _ = self.table.get(1)
3249 .map(|envelope| unsafe {
3250 envelope.read_unchecked::<::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason>()
3251 });
3252 }
3253 }
3254
3255 impl ::fidl_next::Constrained for WlanPhyNotifyOnCriticalErrorRequest<'_> {
3256 type Constraint = ();
3257
3258 fn validate(
3259 _: ::fidl_next::Slot<'_, Self>,
3260 _: Self::Constraint,
3261 ) -> Result<(), ::fidl_next::ValidationError> {
3262 Ok(())
3263 }
3264 }
3265
3266 unsafe impl ::fidl_next::Wire for WlanPhyNotifyOnCriticalErrorRequest<'static> {
3267 type Narrowed<'de> = WlanPhyNotifyOnCriticalErrorRequest<'de>;
3268
3269 #[inline]
3270 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3271 ::fidl_next::munge!(let Self { table } = out);
3272 ::fidl_next::wire::Table::zero_padding(table);
3273 }
3274 }
3275
3276 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyNotifyOnCriticalErrorRequest<'de>
3277 where
3278 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3279 {
3280 fn decode(
3281 slot: ::fidl_next::Slot<'_, Self>,
3282 decoder: &mut ___D,
3283 _: (),
3284 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3285 ::fidl_next::munge!(let Self { table } = slot);
3286
3287 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3288 match ordinal {
3289 0 => unsafe { ::core::hint::unreachable_unchecked() },
3290
3291 1 => {
3292 ::fidl_next::wire::Envelope::decode_as::<
3293 ___D,
3294 ::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason,
3295 >(slot.as_mut(), decoder, ())?;
3296
3297 Ok(())
3298 }
3299
3300 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3301 }
3302 })
3303 }
3304 }
3305
3306 impl<'de> WlanPhyNotifyOnCriticalErrorRequest<'de> {
3307 pub fn reason_code(
3308 &self,
3309 ) -> ::core::option::Option<
3310 &::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason,
3311 > {
3312 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3313 }
3314
3315 pub fn take_reason_code(
3316 &mut self,
3317 ) -> ::core::option::Option<
3318 ::fidl_next_common_fuchsia_wlan_internal::wire::CriticalErrorReason,
3319 > {
3320 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3321 }
3322 }
3323
3324 impl<'de> ::core::fmt::Debug for WlanPhyNotifyOnCriticalErrorRequest<'de> {
3325 fn fmt(
3326 &self,
3327 f: &mut ::core::fmt::Formatter<'_>,
3328 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3329 f.debug_struct("WlanPhyNotifyOnCriticalErrorRequest")
3330 .field("reason_code", &self.reason_code())
3331 .finish()
3332 }
3333 }
3334
3335 impl<'de> ::fidl_next::IntoNatural for WlanPhyNotifyOnCriticalErrorRequest<'de> {
3336 type Natural = crate::natural::WlanPhyNotifyOnCriticalErrorRequest;
3337 }
3338
3339 pub type WlanPhyNotifyOnCriticalErrorResponse = ::fidl_next::wire::Unit;
3341
3342 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3344 #[repr(transparent)]
3345 pub struct WlanPhyNotifyError {
3346 pub(crate) value: ::fidl_next::wire::Uint32,
3347 }
3348
3349 impl ::fidl_next::Constrained for WlanPhyNotifyError {
3350 type Constraint = ();
3351
3352 fn validate(
3353 _: ::fidl_next::Slot<'_, Self>,
3354 _: Self::Constraint,
3355 ) -> Result<(), ::fidl_next::ValidationError> {
3356 Ok(())
3357 }
3358 }
3359
3360 unsafe impl ::fidl_next::Wire for WlanPhyNotifyError {
3361 type Narrowed<'de> = Self;
3362
3363 #[inline]
3364 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3365 }
3367 }
3368
3369 impl WlanPhyNotifyError {
3370 pub const INTERNAL: WlanPhyNotifyError =
3371 WlanPhyNotifyError { value: ::fidl_next::wire::Uint32(1) };
3372
3373 pub const NOT_SUPPORTED: WlanPhyNotifyError =
3374 WlanPhyNotifyError { value: ::fidl_next::wire::Uint32(2) };
3375
3376 pub const SHOULD_WAIT: WlanPhyNotifyError =
3377 WlanPhyNotifyError { value: ::fidl_next::wire::Uint32(3) };
3378
3379 pub const INVALID_ARGS: WlanPhyNotifyError =
3380 WlanPhyNotifyError { value: ::fidl_next::wire::Uint32(4) };
3381 }
3382
3383 unsafe impl<___D> ::fidl_next::Decode<___D> for WlanPhyNotifyError
3384 where
3385 ___D: ?Sized,
3386 {
3387 fn decode(
3388 slot: ::fidl_next::Slot<'_, Self>,
3389 _: &mut ___D,
3390 _: (),
3391 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3392 Ok(())
3393 }
3394 }
3395
3396 impl ::core::convert::From<crate::natural::WlanPhyNotifyError> for WlanPhyNotifyError {
3397 fn from(natural: crate::natural::WlanPhyNotifyError) -> Self {
3398 match natural {
3399 crate::natural::WlanPhyNotifyError::Internal => WlanPhyNotifyError::INTERNAL,
3400
3401 crate::natural::WlanPhyNotifyError::NotSupported => {
3402 WlanPhyNotifyError::NOT_SUPPORTED
3403 }
3404
3405 crate::natural::WlanPhyNotifyError::ShouldWait => WlanPhyNotifyError::SHOULD_WAIT,
3406
3407 crate::natural::WlanPhyNotifyError::InvalidArgs => WlanPhyNotifyError::INVALID_ARGS,
3408
3409 crate::natural::WlanPhyNotifyError::UnknownOrdinal_(value) => {
3410 WlanPhyNotifyError { value: ::fidl_next::wire::Uint32::from(value) }
3411 }
3412 }
3413 }
3414 }
3415
3416 impl ::fidl_next::IntoNatural for WlanPhyNotifyError {
3417 type Natural = crate::natural::WlanPhyNotifyError;
3418 }
3419
3420 #[repr(C)]
3422 pub struct WlanPhyNotifyOnCountryCodeChangeRequest<'de> {
3423 pub(crate) table: ::fidl_next::wire::Table<'de>,
3424 }
3425
3426 impl<'de> Drop for WlanPhyNotifyOnCountryCodeChangeRequest<'de> {
3427 fn drop(&mut self) {
3428 let _ =
3429 self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<[u8; 2]>() });
3430 }
3431 }
3432
3433 impl ::fidl_next::Constrained for WlanPhyNotifyOnCountryCodeChangeRequest<'_> {
3434 type Constraint = ();
3435
3436 fn validate(
3437 _: ::fidl_next::Slot<'_, Self>,
3438 _: Self::Constraint,
3439 ) -> Result<(), ::fidl_next::ValidationError> {
3440 Ok(())
3441 }
3442 }
3443
3444 unsafe impl ::fidl_next::Wire for WlanPhyNotifyOnCountryCodeChangeRequest<'static> {
3445 type Narrowed<'de> = WlanPhyNotifyOnCountryCodeChangeRequest<'de>;
3446
3447 #[inline]
3448 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3449 ::fidl_next::munge!(let Self { table } = out);
3450 ::fidl_next::wire::Table::zero_padding(table);
3451 }
3452 }
3453
3454 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WlanPhyNotifyOnCountryCodeChangeRequest<'de>
3455 where
3456 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3457 {
3458 fn decode(
3459 slot: ::fidl_next::Slot<'_, Self>,
3460 decoder: &mut ___D,
3461 _: (),
3462 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3463 ::fidl_next::munge!(let Self { table } = slot);
3464
3465 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3466 match ordinal {
3467 0 => unsafe { ::core::hint::unreachable_unchecked() },
3468
3469 1 => {
3470 ::fidl_next::wire::Envelope::decode_as::<___D, [u8; 2]>(
3471 slot.as_mut(),
3472 decoder,
3473 (),
3474 )?;
3475
3476 Ok(())
3477 }
3478
3479 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3480 }
3481 })
3482 }
3483 }
3484
3485 impl<'de> WlanPhyNotifyOnCountryCodeChangeRequest<'de> {
3486 pub fn phy_country(&self) -> ::core::option::Option<&[u8; 2]> {
3487 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3488 }
3489
3490 pub fn take_phy_country(&mut self) -> ::core::option::Option<[u8; 2]> {
3491 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3492 }
3493 }
3494
3495 impl<'de> ::core::fmt::Debug for WlanPhyNotifyOnCountryCodeChangeRequest<'de> {
3496 fn fmt(
3497 &self,
3498 f: &mut ::core::fmt::Formatter<'_>,
3499 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3500 f.debug_struct("WlanPhyNotifyOnCountryCodeChangeRequest")
3501 .field("phy_country", &self.phy_country())
3502 .finish()
3503 }
3504 }
3505
3506 impl<'de> ::fidl_next::IntoNatural for WlanPhyNotifyOnCountryCodeChangeRequest<'de> {
3507 type Natural = crate::natural::WlanPhyNotifyOnCountryCodeChangeRequest;
3508 }
3509
3510 pub type WlanPhyNotifyOnCountryCodeChangeResponse = ::fidl_next::wire::Unit;
3512}
3513
3514pub mod wire_optional {}
3515
3516pub mod generic {
3517
3518 pub type WlanPhyInitResponse = ();
3520
3521 pub type WlanPhyDestroyIfaceResponse = ();
3523
3524 pub struct WlanPhySetCountryRequest<T0> {
3526 pub country: T0,
3527 }
3528
3529 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::WlanPhySetCountryRequest, ___E>
3530 for WlanPhySetCountryRequest<T0>
3531 where
3532 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3533 T0: ::fidl_next::Encode<[u8; 2], ___E>,
3534 {
3535 #[inline]
3536 fn encode(
3537 self,
3538 encoder_: &mut ___E,
3539 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhySetCountryRequest>,
3540 _: (),
3541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3542 ::fidl_next::munge! {
3543 let crate::wire::WlanPhySetCountryRequest {
3544 country,
3545
3546 } = out_;
3547 }
3548
3549 ::fidl_next::Encode::encode(self.country, encoder_, country, ())?;
3550
3551 Ok(())
3552 }
3553 }
3554
3555 pub type WlanPhySetCountryResponse = ();
3557
3558 pub type WlanPhyClearCountryResponse = ();
3560
3561 pub struct WlanPhyGetCountryResponse<T0> {
3563 pub country: T0,
3564 }
3565
3566 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::WlanPhyGetCountryResponse, ___E>
3567 for WlanPhyGetCountryResponse<T0>
3568 where
3569 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3570 T0: ::fidl_next::Encode<[u8; 2], ___E>,
3571 {
3572 #[inline]
3573 fn encode(
3574 self,
3575 encoder_: &mut ___E,
3576 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetCountryResponse>,
3577 _: (),
3578 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3579 ::fidl_next::munge! {
3580 let crate::wire::WlanPhyGetCountryResponse {
3581 country,
3582
3583 } = out_;
3584 }
3585
3586 ::fidl_next::Encode::encode(self.country, encoder_, country, ())?;
3587
3588 Ok(())
3589 }
3590 }
3591
3592 pub type WlanPhySetPowerSaveModeResponse = ();
3594
3595 pub type WlanPhyPowerDownResponse = ();
3597
3598 pub type WlanPhyPowerUpResponse = ();
3600
3601 pub type WlanPhyResetResponse = ();
3603
3604 pub type WlanPhySetBtCoexistenceModeResponse = ();
3606
3607 pub type WlanPhySetTxPowerScenarioResponse = ();
3609
3610 pub type WlanPhyResetTxPowerScenarioResponse = ();
3612
3613 pub struct WlanPhyGetTxPowerScenarioResponse<T0> {
3615 pub scenario: T0,
3616 }
3617
3618 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::WlanPhyGetTxPowerScenarioResponse, ___E>
3619 for WlanPhyGetTxPowerScenarioResponse<T0>
3620 where
3621 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3622 T0: ::fidl_next::Encode<
3623 ::fidl_next_common_fuchsia_wlan_internal::wire::TxPowerScenario,
3624 ___E,
3625 >,
3626 {
3627 #[inline]
3628 fn encode(
3629 self,
3630 encoder_: &mut ___E,
3631 out_: &mut ::core::mem::MaybeUninit<crate::wire::WlanPhyGetTxPowerScenarioResponse>,
3632 _: (),
3633 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3634 ::fidl_next::munge! {
3635 let crate::wire::WlanPhyGetTxPowerScenarioResponse {
3636 scenario,
3637
3638 } = out_;
3639 }
3640
3641 ::fidl_next::Encode::encode(self.scenario, encoder_, scenario, ())?;
3642
3643 Ok(())
3644 }
3645 }
3646
3647 pub type WlanPhyNotifyOnCriticalErrorResponse = ();
3649
3650 pub type WlanPhyNotifyOnCountryCodeChangeResponse = ();
3652}
3653
3654pub use self::natural::*;
3655
3656#[doc = " This protocol is specifically meant for passing events/notifications from the WlanPhy server\n to its client.\n"]
3658#[derive(PartialEq, Debug)]
3659pub struct WlanPhyNotify;
3660
3661impl ::fidl_next::Discoverable for WlanPhyNotify {
3662 const PROTOCOL_NAME: &'static str = "fuchsia.wlan.phy.WlanPhyNotify";
3663}
3664
3665#[cfg(target_os = "fuchsia")]
3666impl ::fidl_next::HasTransport for WlanPhyNotify {
3667 type Transport = ::fidl_next::fuchsia::zx::Channel;
3668}
3669
3670pub mod wlan_phy_notify {
3671 pub mod prelude {
3672 pub use crate::{
3673 WlanPhyNotify, WlanPhyNotifyClientHandler, WlanPhyNotifyLocalClientHandler,
3674 WlanPhyNotifyLocalServerHandler, WlanPhyNotifyServerHandler, wlan_phy_notify,
3675 };
3676
3677 pub use crate::natural::WlanPhyNotifyError;
3678
3679 pub use crate::natural::WlanPhyNotifyOnCountryCodeChangeRequest;
3680
3681 pub use crate::natural::WlanPhyNotifyOnCriticalErrorRequest;
3682
3683 pub use crate::natural::WlanPhyNotifyOnCountryCodeChangeResponse;
3684
3685 pub use crate::natural::WlanPhyNotifyOnCriticalErrorResponse;
3686 }
3687
3688 pub struct OnCriticalError;
3689
3690 impl ::fidl_next::Method for OnCriticalError {
3691 const ORDINAL: u64 = 441815377196023202;
3692 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3693 ::fidl_next::protocol::Flexibility::Flexible;
3694
3695 type Protocol = crate::WlanPhyNotify;
3696
3697 type Request = crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>;
3698 }
3699
3700 impl ::fidl_next::TwoWayMethod for OnCriticalError {
3701 type Response = ::fidl_next::wire::Result<
3702 'static,
3703 crate::wire::WlanPhyNotifyOnCriticalErrorResponse,
3704 crate::wire::WlanPhyNotifyError,
3705 >;
3706 }
3707
3708 impl<___R> ::fidl_next::Respond<___R> for OnCriticalError {
3709 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3710
3711 fn respond(response: ___R) -> Self::Output {
3712 ::core::result::Result::Ok(response)
3713 }
3714 }
3715
3716 impl<___R> ::fidl_next::RespondErr<___R> for OnCriticalError {
3717 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3718
3719 fn respond_err(response: ___R) -> Self::Output {
3720 ::core::result::Result::Err(response)
3721 }
3722 }
3723
3724 pub struct OnCountryCodeChange;
3725
3726 impl ::fidl_next::Method for OnCountryCodeChange {
3727 const ORDINAL: u64 = 710289863041065302;
3728 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3729 ::fidl_next::protocol::Flexibility::Flexible;
3730
3731 type Protocol = crate::WlanPhyNotify;
3732
3733 type Request = crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>;
3734 }
3735
3736 impl ::fidl_next::TwoWayMethod for OnCountryCodeChange {
3737 type Response = ::fidl_next::wire::Result<
3738 'static,
3739 crate::wire::WlanPhyNotifyOnCountryCodeChangeResponse,
3740 crate::wire::WlanPhyNotifyError,
3741 >;
3742 }
3743
3744 impl<___R> ::fidl_next::Respond<___R> for OnCountryCodeChange {
3745 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3746
3747 fn respond(response: ___R) -> Self::Output {
3748 ::core::result::Result::Ok(response)
3749 }
3750 }
3751
3752 impl<___R> ::fidl_next::RespondErr<___R> for OnCountryCodeChange {
3753 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3754
3755 fn respond_err(response: ___R) -> Self::Output {
3756 ::core::result::Result::Err(response)
3757 }
3758 }
3759
3760 mod ___detail {
3761 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::WlanPhyNotify
3762 where
3763 ___T: ::fidl_next::Transport,
3764 {
3765 type Client = WlanPhyNotifyClient<___T>;
3766 type Server = WlanPhyNotifyServer<___T>;
3767 }
3768
3769 #[repr(transparent)]
3771 pub struct WlanPhyNotifyClient<___T: ::fidl_next::Transport> {
3772 #[allow(dead_code)]
3773 client: ::fidl_next::protocol::Client<___T>,
3774 }
3775
3776 impl<___T> WlanPhyNotifyClient<___T>
3777 where
3778 ___T: ::fidl_next::Transport,
3779 {
3780 #[doc = " Indicate to the receiver that the PHY has encountered a critical\n error specifying a reason code.\n"]
3781 pub fn on_critical_error_with<___R>(
3782 &self,
3783 request: ___R,
3784 ) -> ::fidl_next::TwoWayFuture<'_, super::OnCriticalError, ___T>
3785 where
3786 ___R: ::fidl_next::Encode<
3787 crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'static>,
3788 <___T as ::fidl_next::Transport>::SendBuffer,
3789 >,
3790 {
3791 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3792 441815377196023202,
3793 <super::OnCriticalError as ::fidl_next::Method>::FLEXIBILITY,
3794 request,
3795 ))
3796 }
3797
3798 #[doc = " Indicate to the receiver that the firmware running on wlan hardware\n has detected a change in country code.\n"]
3799 pub fn on_country_code_change_with<___R>(
3800 &self,
3801 request: ___R,
3802 ) -> ::fidl_next::TwoWayFuture<'_, super::OnCountryCodeChange, ___T>
3803 where
3804 ___R: ::fidl_next::Encode<
3805 crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'static>,
3806 <___T as ::fidl_next::Transport>::SendBuffer,
3807 >,
3808 {
3809 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3810 710289863041065302,
3811 <super::OnCountryCodeChange as ::fidl_next::Method>::FLEXIBILITY,
3812 request,
3813 ))
3814 }
3815 }
3816
3817 #[repr(transparent)]
3819 pub struct WlanPhyNotifyServer<___T: ::fidl_next::Transport> {
3820 server: ::fidl_next::protocol::Server<___T>,
3821 }
3822
3823 impl<___T> WlanPhyNotifyServer<___T> where ___T: ::fidl_next::Transport {}
3824 }
3825}
3826
3827#[diagnostic::on_unimplemented(
3828 note = "If {Self} implements the non-local WlanPhyNotifyClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3829)]
3830
3831pub trait WlanPhyNotifyLocalClientHandler<
3835 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3836 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3837>
3838{
3839 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3840 ::core::future::ready(())
3841 }
3842}
3843
3844impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for WlanPhyNotify
3845where
3846 ___H: WlanPhyNotifyLocalClientHandler<___T>,
3847 ___T: ::fidl_next::Transport,
3848{
3849 async fn on_event(
3850 handler: &mut ___H,
3851 mut message: ::fidl_next::Message<___T>,
3852 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3853 match *message.header().ordinal {
3854 ordinal => {
3855 handler.on_unknown_interaction(ordinal).await;
3856 if ::core::matches!(
3857 message.header().flexibility(),
3858 ::fidl_next::protocol::Flexibility::Strict
3859 ) {
3860 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3861 } else {
3862 Ok(())
3863 }
3864 }
3865 }
3866 }
3867}
3868
3869#[diagnostic::on_unimplemented(
3870 note = "If {Self} implements the non-local WlanPhyNotifyServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3871)]
3872
3873pub trait WlanPhyNotifyLocalServerHandler<
3877 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3878 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3879>
3880{
3881 #[doc = " Indicate to the receiver that the PHY has encountered a critical\n error specifying a reason code.\n"]
3882 fn on_critical_error(
3883 &mut self,
3884
3885 request: ::fidl_next::Request<wlan_phy_notify::OnCriticalError, ___T>,
3886
3887 responder: ::fidl_next::Responder<wlan_phy_notify::OnCriticalError, ___T>,
3888 ) -> impl ::core::future::Future<Output = ()>;
3889
3890 #[doc = " Indicate to the receiver that the firmware running on wlan hardware\n has detected a change in country code.\n"]
3891 fn on_country_code_change(
3892 &mut self,
3893
3894 request: ::fidl_next::Request<wlan_phy_notify::OnCountryCodeChange, ___T>,
3895
3896 responder: ::fidl_next::Responder<wlan_phy_notify::OnCountryCodeChange, ___T>,
3897 ) -> impl ::core::future::Future<Output = ()>;
3898
3899 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3900 ::core::future::ready(())
3901 }
3902}
3903
3904impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for WlanPhyNotify
3905where
3906 ___H: WlanPhyNotifyLocalServerHandler<___T>,
3907 ___T: ::fidl_next::Transport,
3908 for<'de> crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>: ::fidl_next::Decode<
3909 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3910 Constraint = (),
3911 >,
3912 for<'de> crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>: ::fidl_next::Decode<
3913 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3914 Constraint = (),
3915 >,
3916{
3917 async fn on_one_way(
3918 handler: &mut ___H,
3919 mut message: ::fidl_next::Message<___T>,
3920 ) -> ::core::result::Result<
3921 (),
3922 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3923 > {
3924 match *message.header().ordinal {
3925 ordinal => {
3926 handler.on_unknown_interaction(ordinal).await;
3927 if ::core::matches!(
3928 message.header().flexibility(),
3929 ::fidl_next::protocol::Flexibility::Strict
3930 ) {
3931 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3932 } else {
3933 Ok(())
3934 }
3935 }
3936 }
3937 }
3938
3939 async fn on_two_way(
3940 handler: &mut ___H,
3941 mut message: ::fidl_next::Message<___T>,
3942 responder: ::fidl_next::protocol::Responder<___T>,
3943 ) -> ::core::result::Result<
3944 (),
3945 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3946 > {
3947 match *message.header().ordinal {
3948 441815377196023202 => {
3949 let responder = ::fidl_next::Responder::from_untyped(responder);
3950
3951 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3952 Ok(decoded) => {
3953 handler
3954 .on_critical_error(
3955 ::fidl_next::Request::from_decoded(decoded),
3956 responder,
3957 )
3958 .await;
3959 Ok(())
3960 }
3961 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3962 ordinal: 441815377196023202,
3963 error,
3964 }),
3965 }
3966 }
3967
3968 710289863041065302 => {
3969 let responder = ::fidl_next::Responder::from_untyped(responder);
3970
3971 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3972 Ok(decoded) => {
3973 handler
3974 .on_country_code_change(
3975 ::fidl_next::Request::from_decoded(decoded),
3976 responder,
3977 )
3978 .await;
3979 Ok(())
3980 }
3981 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3982 ordinal: 710289863041065302,
3983 error,
3984 }),
3985 }
3986 }
3987
3988 ordinal => {
3989 handler.on_unknown_interaction(ordinal).await;
3990 if ::core::matches!(
3991 message.header().flexibility(),
3992 ::fidl_next::protocol::Flexibility::Strict
3993 ) {
3994 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3995 } else {
3996 responder
3997 .respond_framework_error(
3998 ordinal,
3999 ::fidl_next::FrameworkError::UnknownMethod,
4000 )
4001 .expect("encoding a framework error should never fail")
4002 .await?;
4003 Ok(())
4004 }
4005 }
4006 }
4007 }
4008}
4009
4010pub trait WlanPhyNotifyClientHandler<
4014 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4015 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4016>
4017{
4018 fn on_unknown_interaction(
4019 &mut self,
4020 ordinal: u64,
4021 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4022 ::core::future::ready(())
4023 }
4024}
4025
4026impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for WlanPhyNotify
4027where
4028 ___H: WlanPhyNotifyClientHandler<___T> + ::core::marker::Send,
4029 ___T: ::fidl_next::Transport,
4030{
4031 async fn on_event(
4032 handler: &mut ___H,
4033 mut message: ::fidl_next::Message<___T>,
4034 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4035 match *message.header().ordinal {
4036 ordinal => {
4037 handler.on_unknown_interaction(ordinal).await;
4038 if ::core::matches!(
4039 message.header().flexibility(),
4040 ::fidl_next::protocol::Flexibility::Strict
4041 ) {
4042 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4043 } else {
4044 Ok(())
4045 }
4046 }
4047 }
4048 }
4049}
4050
4051pub trait WlanPhyNotifyServerHandler<
4055 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4056 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4057>
4058{
4059 #[doc = " Indicate to the receiver that the PHY has encountered a critical\n error specifying a reason code.\n"]
4060 fn on_critical_error(
4061 &mut self,
4062
4063 request: ::fidl_next::Request<wlan_phy_notify::OnCriticalError, ___T>,
4064
4065 responder: ::fidl_next::Responder<wlan_phy_notify::OnCriticalError, ___T>,
4066 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4067
4068 #[doc = " Indicate to the receiver that the firmware running on wlan hardware\n has detected a change in country code.\n"]
4069 fn on_country_code_change(
4070 &mut self,
4071
4072 request: ::fidl_next::Request<wlan_phy_notify::OnCountryCodeChange, ___T>,
4073
4074 responder: ::fidl_next::Responder<wlan_phy_notify::OnCountryCodeChange, ___T>,
4075 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4076
4077 fn on_unknown_interaction(
4078 &mut self,
4079 ordinal: u64,
4080 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4081 ::core::future::ready(())
4082 }
4083}
4084
4085impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for WlanPhyNotify
4086where
4087 ___H: WlanPhyNotifyServerHandler<___T> + ::core::marker::Send,
4088 ___T: ::fidl_next::Transport,
4089 for<'de> crate::wire::WlanPhyNotifyOnCriticalErrorRequest<'de>: ::fidl_next::Decode<
4090 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4091 Constraint = (),
4092 >,
4093 for<'de> crate::wire::WlanPhyNotifyOnCountryCodeChangeRequest<'de>: ::fidl_next::Decode<
4094 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4095 Constraint = (),
4096 >,
4097{
4098 async fn on_one_way(
4099 handler: &mut ___H,
4100 mut message: ::fidl_next::Message<___T>,
4101 ) -> ::core::result::Result<
4102 (),
4103 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4104 > {
4105 match *message.header().ordinal {
4106 ordinal => {
4107 handler.on_unknown_interaction(ordinal).await;
4108 if ::core::matches!(
4109 message.header().flexibility(),
4110 ::fidl_next::protocol::Flexibility::Strict
4111 ) {
4112 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4113 } else {
4114 Ok(())
4115 }
4116 }
4117 }
4118 }
4119
4120 async fn on_two_way(
4121 handler: &mut ___H,
4122 mut message: ::fidl_next::Message<___T>,
4123 responder: ::fidl_next::protocol::Responder<___T>,
4124 ) -> ::core::result::Result<
4125 (),
4126 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4127 > {
4128 match *message.header().ordinal {
4129 441815377196023202 => {
4130 let responder = ::fidl_next::Responder::from_untyped(responder);
4131
4132 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4133 Ok(decoded) => {
4134 handler
4135 .on_critical_error(
4136 ::fidl_next::Request::from_decoded(decoded),
4137 responder,
4138 )
4139 .await;
4140 Ok(())
4141 }
4142 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4143 ordinal: 441815377196023202,
4144 error,
4145 }),
4146 }
4147 }
4148
4149 710289863041065302 => {
4150 let responder = ::fidl_next::Responder::from_untyped(responder);
4151
4152 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4153 Ok(decoded) => {
4154 handler
4155 .on_country_code_change(
4156 ::fidl_next::Request::from_decoded(decoded),
4157 responder,
4158 )
4159 .await;
4160 Ok(())
4161 }
4162 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4163 ordinal: 710289863041065302,
4164 error,
4165 }),
4166 }
4167 }
4168
4169 ordinal => {
4170 handler.on_unknown_interaction(ordinal).await;
4171 if ::core::matches!(
4172 message.header().flexibility(),
4173 ::fidl_next::protocol::Flexibility::Strict
4174 ) {
4175 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4176 } else {
4177 responder
4178 .respond_framework_error(
4179 ordinal,
4180 ::fidl_next::FrameworkError::UnknownMethod,
4181 )
4182 .expect("encoding a framework error should never fail")
4183 .await?;
4184 Ok(())
4185 }
4186 }
4187 }
4188 }
4189}
4190
4191impl<___T> WlanPhyNotifyClientHandler<___T> for ::fidl_next::IgnoreEvents
4192where
4193 ___T: ::fidl_next::Transport,
4194{
4195 async fn on_unknown_interaction(&mut self, _: u64) {}
4196}
4197
4198impl<___H, ___T> WlanPhyNotifyLocalClientHandler<___T> for ::fidl_next::Local<___H>
4199where
4200 ___H: WlanPhyNotifyClientHandler<___T>,
4201 ___T: ::fidl_next::Transport,
4202{
4203 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4204 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4205 }
4206}
4207
4208impl<___H, ___T> WlanPhyNotifyLocalServerHandler<___T> for ::fidl_next::Local<___H>
4209where
4210 ___H: WlanPhyNotifyServerHandler<___T>,
4211 ___T: ::fidl_next::Transport,
4212{
4213 async fn on_critical_error(
4214 &mut self,
4215
4216 request: ::fidl_next::Request<wlan_phy_notify::OnCriticalError, ___T>,
4217
4218 responder: ::fidl_next::Responder<wlan_phy_notify::OnCriticalError, ___T>,
4219 ) {
4220 ___H::on_critical_error(&mut self.0, request, responder).await
4221 }
4222
4223 async fn on_country_code_change(
4224 &mut self,
4225
4226 request: ::fidl_next::Request<wlan_phy_notify::OnCountryCodeChange, ___T>,
4227
4228 responder: ::fidl_next::Responder<wlan_phy_notify::OnCountryCodeChange, ___T>,
4229 ) {
4230 ___H::on_country_code_change(&mut self.0, request, responder).await
4231 }
4232
4233 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4234 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4235 }
4236}