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