1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type CapabilityInfo = u16;
16
17pub type WlanSoftmacHardwareCapability = u32;
18
19pub const MAX_BANDS: u8 = 16;
22
23pub const MAX_SUPPORTED_MAC_ROLES: u8 = 16;
26
27pub const MAX_SUPPORTED_PHY_TYPES: u8 = 64;
30
31pub const WLAN_MAC_MAX_EXT_RATES: u32 = 255;
32
33pub const WLAN_MAC_MAX_SUPP_RATES: u32 = 8;
40
41pub const WLAN_TX_RESULT_MAX_ENTRY: u32 = 8;
42
43pub const WLAN_TX_VECTOR_IDX_INVALID: u16 = 0;
44
45#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub enum BssType {
47 Unknown,
48 Infrastructure,
49 Independent,
50 Mesh,
51 Personal,
52 #[doc(hidden)]
53 __SourceBreaking {
54 unknown_ordinal: u32,
55 },
56}
57
58#[macro_export]
60macro_rules! BssTypeUnknown {
61 () => {
62 _
63 };
64}
65
66impl BssType {
67 #[inline]
68 pub fn from_primitive(prim: u32) -> Option<Self> {
69 match prim {
70 0 => Some(Self::Unknown),
71 1 => Some(Self::Infrastructure),
72 2 => Some(Self::Independent),
73 3 => Some(Self::Mesh),
74 4 => Some(Self::Personal),
75 _ => None,
76 }
77 }
78
79 #[inline]
80 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
81 match prim {
82 0 => Self::Unknown,
83 1 => Self::Infrastructure,
84 2 => Self::Independent,
85 3 => Self::Mesh,
86 4 => Self::Personal,
87 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
88 }
89 }
90
91 #[inline]
92 pub fn unknown() -> Self {
93 Self::__SourceBreaking { unknown_ordinal: 0x0 }
94 }
95
96 #[inline]
97 pub const fn into_primitive(self) -> u32 {
98 match self {
99 Self::Unknown => 0,
100 Self::Infrastructure => 1,
101 Self::Independent => 2,
102 Self::Mesh => 3,
103 Self::Personal => 4,
104 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
105 }
106 }
107
108 #[inline]
109 pub fn is_unknown(&self) -> bool {
110 match self {
111 Self::__SourceBreaking { unknown_ordinal: _ } => true,
112 _ => false,
113 }
114 }
115}
116
117#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118pub enum ChannelBandwidth {
119 Cbw20,
120 Cbw40,
121 Cbw40Below,
122 Cbw80,
123 Cbw160,
124 Cbw80P80,
125 #[doc(hidden)]
126 __SourceBreaking {
127 unknown_ordinal: u32,
128 },
129}
130
131#[macro_export]
133macro_rules! ChannelBandwidthUnknown {
134 () => {
135 _
136 };
137}
138
139impl ChannelBandwidth {
140 #[inline]
141 pub fn from_primitive(prim: u32) -> Option<Self> {
142 match prim {
143 1 => Some(Self::Cbw20),
144 2 => Some(Self::Cbw40),
145 3 => Some(Self::Cbw40Below),
146 4 => Some(Self::Cbw80),
147 5 => Some(Self::Cbw160),
148 6 => Some(Self::Cbw80P80),
149 _ => None,
150 }
151 }
152
153 #[inline]
154 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
155 match prim {
156 1 => Self::Cbw20,
157 2 => Self::Cbw40,
158 3 => Self::Cbw40Below,
159 4 => Self::Cbw80,
160 5 => Self::Cbw160,
161 6 => Self::Cbw80P80,
162 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
163 }
164 }
165
166 #[inline]
167 pub fn unknown() -> Self {
168 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
169 }
170
171 #[inline]
172 pub const fn into_primitive(self) -> u32 {
173 match self {
174 Self::Cbw20 => 1,
175 Self::Cbw40 => 2,
176 Self::Cbw40Below => 3,
177 Self::Cbw80 => 4,
178 Self::Cbw160 => 5,
179 Self::Cbw80P80 => 6,
180 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
181 }
182 }
183
184 #[inline]
185 pub fn is_unknown(&self) -> bool {
186 match self {
187 Self::__SourceBreaking { unknown_ordinal: _ } => true,
188 _ => false,
189 }
190 }
191}
192
193#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
195#[repr(u8)]
196pub enum DataPlaneType {
197 EthernetDevice = 1,
198 GenericNetworkDevice = 2,
199}
200
201impl DataPlaneType {
202 #[inline]
203 pub fn from_primitive(prim: u8) -> Option<Self> {
204 match prim {
205 1 => Some(Self::EthernetDevice),
206 2 => Some(Self::GenericNetworkDevice),
207 _ => None,
208 }
209 }
210
211 #[inline]
212 pub const fn into_primitive(self) -> u8 {
213 self as u8
214 }
215
216 #[deprecated = "Strict enums should not use `is_unknown`"]
217 #[inline]
218 pub fn is_unknown(&self) -> bool {
219 false
220 }
221}
222
223#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
226#[repr(u8)]
227pub enum GuardInterval {
228 LongGi = 1,
229 ShortGi = 2,
230}
231
232impl GuardInterval {
233 #[inline]
234 pub fn from_primitive(prim: u8) -> Option<Self> {
235 match prim {
236 1 => Some(Self::LongGi),
237 2 => Some(Self::ShortGi),
238 _ => None,
239 }
240 }
241
242 #[inline]
243 pub const fn into_primitive(self) -> u8 {
244 self as u8
245 }
246
247 #[deprecated = "Strict enums should not use `is_unknown`"]
248 #[inline]
249 pub fn is_unknown(&self) -> bool {
250 false
251 }
252}
253
254#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
256#[repr(u8)]
257pub enum MacImplementationType {
258 Softmac = 1,
259 Fullmac = 2,
260}
261
262impl MacImplementationType {
263 #[inline]
264 pub fn from_primitive(prim: u8) -> Option<Self> {
265 match prim {
266 1 => Some(Self::Softmac),
267 2 => Some(Self::Fullmac),
268 _ => None,
269 }
270 }
271
272 #[inline]
273 pub const fn into_primitive(self) -> u8 {
274 self as u8
275 }
276
277 #[deprecated = "Strict enums should not use `is_unknown`"]
278 #[inline]
279 pub fn is_unknown(&self) -> bool {
280 false
281 }
282}
283
284#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
285#[repr(u32)]
286pub enum PowerSaveType {
287 PsModeUltraLowPower = 0,
288 PsModeLowPower = 1,
289 PsModeBalanced = 2,
290 PsModePerformance = 3,
291}
292
293impl PowerSaveType {
294 #[inline]
295 pub fn from_primitive(prim: u32) -> Option<Self> {
296 match prim {
297 0 => Some(Self::PsModeUltraLowPower),
298 1 => Some(Self::PsModeLowPower),
299 2 => Some(Self::PsModeBalanced),
300 3 => Some(Self::PsModePerformance),
301 _ => None,
302 }
303 }
304
305 #[inline]
306 pub const fn into_primitive(self) -> u32 {
307 self as u32
308 }
309
310 #[deprecated = "Strict enums should not use `is_unknown`"]
311 #[inline]
312 pub fn is_unknown(&self) -> bool {
313 false
314 }
315}
316
317#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
318#[repr(u32)]
319pub enum RequestStatus {
320 Acknowledged = 0,
321 RejectedNotSupported = 1,
322 RejectedIncompatibleMode = 2,
323 RejectedAlreadyInUse = 3,
324 RejectedDuplicateRequest = 4,
325}
326
327impl RequestStatus {
328 #[inline]
329 pub fn from_primitive(prim: u32) -> Option<Self> {
330 match prim {
331 0 => Some(Self::Acknowledged),
332 1 => Some(Self::RejectedNotSupported),
333 2 => Some(Self::RejectedIncompatibleMode),
334 3 => Some(Self::RejectedAlreadyInUse),
335 4 => Some(Self::RejectedDuplicateRequest),
336 _ => None,
337 }
338 }
339
340 #[inline]
341 pub const fn into_primitive(self) -> u32 {
342 self as u32
343 }
344
345 #[deprecated = "Strict enums should not use `is_unknown`"]
346 #[inline]
347 pub fn is_unknown(&self) -> bool {
348 false
349 }
350}
351
352#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
353#[repr(u32)]
354pub enum ScanType {
355 Active = 1,
356 Passive = 2,
357}
358
359impl ScanType {
360 #[inline]
361 pub fn from_primitive(prim: u32) -> Option<Self> {
362 match prim {
363 1 => Some(Self::Active),
364 2 => Some(Self::Passive),
365 _ => None,
366 }
367 }
368
369 #[inline]
370 pub const fn into_primitive(self) -> u32 {
371 self as u32
372 }
373
374 #[deprecated = "Strict enums should not use `is_unknown`"]
375 #[inline]
376 pub fn is_unknown(&self) -> bool {
377 false
378 }
379}
380
381#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
382pub enum WlanBand {
383 TwoGhz,
384 FiveGhz,
385 #[doc(hidden)]
386 __SourceBreaking {
387 unknown_ordinal: u8,
388 },
389}
390
391#[macro_export]
393macro_rules! WlanBandUnknown {
394 () => {
395 _
396 };
397}
398
399impl WlanBand {
400 #[inline]
401 pub fn from_primitive(prim: u8) -> Option<Self> {
402 match prim {
403 0 => Some(Self::TwoGhz),
404 1 => Some(Self::FiveGhz),
405 _ => None,
406 }
407 }
408
409 #[inline]
410 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
411 match prim {
412 0 => Self::TwoGhz,
413 1 => Self::FiveGhz,
414 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
415 }
416 }
417
418 #[inline]
419 pub fn unknown() -> Self {
420 Self::__SourceBreaking { unknown_ordinal: 0xff }
421 }
422
423 #[inline]
424 pub const fn into_primitive(self) -> u8 {
425 match self {
426 Self::TwoGhz => 0,
427 Self::FiveGhz => 1,
428 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
429 }
430 }
431
432 #[inline]
433 pub fn is_unknown(&self) -> bool {
434 match self {
435 Self::__SourceBreaking { unknown_ordinal: _ } => true,
436 _ => false,
437 }
438 }
439}
440
441#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
442pub enum WlanKeyType {
443 Pairwise,
444 Group,
445 Igtk,
446 Peer,
447 #[doc(hidden)]
448 __SourceBreaking {
449 unknown_ordinal: u8,
450 },
451}
452
453#[macro_export]
455macro_rules! WlanKeyTypeUnknown {
456 () => {
457 _
458 };
459}
460
461impl WlanKeyType {
462 #[inline]
463 pub fn from_primitive(prim: u8) -> Option<Self> {
464 match prim {
465 1 => Some(Self::Pairwise),
466 2 => Some(Self::Group),
467 3 => Some(Self::Igtk),
468 4 => Some(Self::Peer),
469 _ => None,
470 }
471 }
472
473 #[inline]
474 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
475 match prim {
476 1 => Self::Pairwise,
477 2 => Self::Group,
478 3 => Self::Igtk,
479 4 => Self::Peer,
480 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
481 }
482 }
483
484 #[inline]
485 pub fn unknown() -> Self {
486 Self::__SourceBreaking { unknown_ordinal: 0xff }
487 }
488
489 #[inline]
490 pub const fn into_primitive(self) -> u8 {
491 match self {
492 Self::Pairwise => 1,
493 Self::Group => 2,
494 Self::Igtk => 3,
495 Self::Peer => 4,
496 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
497 }
498 }
499
500 #[inline]
501 pub fn is_unknown(&self) -> bool {
502 match self {
503 Self::__SourceBreaking { unknown_ordinal: _ } => true,
504 _ => false,
505 }
506 }
507}
508
509#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
510pub enum WlanMacRole {
511 Client,
512 Ap,
513 Mesh,
514 #[doc(hidden)]
515 __SourceBreaking {
516 unknown_ordinal: u32,
517 },
518}
519
520#[macro_export]
522macro_rules! WlanMacRoleUnknown {
523 () => {
524 _
525 };
526}
527
528impl WlanMacRole {
529 #[inline]
530 pub fn from_primitive(prim: u32) -> Option<Self> {
531 match prim {
532 1 => Some(Self::Client),
533 2 => Some(Self::Ap),
534 3 => Some(Self::Mesh),
535 _ => None,
536 }
537 }
538
539 #[inline]
540 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
541 match prim {
542 1 => Self::Client,
543 2 => Self::Ap,
544 3 => Self::Mesh,
545 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
546 }
547 }
548
549 #[inline]
550 pub fn unknown() -> Self {
551 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
552 }
553
554 #[inline]
555 pub const fn into_primitive(self) -> u32 {
556 match self {
557 Self::Client => 1,
558 Self::Ap => 2,
559 Self::Mesh => 3,
560 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
561 }
562 }
563
564 #[inline]
565 pub fn is_unknown(&self) -> bool {
566 match self {
567 Self::__SourceBreaking { unknown_ordinal: _ } => true,
568 _ => false,
569 }
570 }
571}
572
573#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
576pub enum WlanPhyType {
577 Dsss,
581 Hr,
586 Ofdm,
590 Erp,
595 Ht,
599 Dmg,
602 Vht,
606 Tvht,
610 S1G,
613 Cdmg,
616 Cmmg,
619 He,
622 #[doc(hidden)]
623 __SourceBreaking { unknown_ordinal: u32 },
624}
625
626#[macro_export]
628macro_rules! WlanPhyTypeUnknown {
629 () => {
630 _
631 };
632}
633
634impl WlanPhyType {
635 #[inline]
636 pub fn from_primitive(prim: u32) -> Option<Self> {
637 match prim {
638 1 => Some(Self::Dsss),
639 2 => Some(Self::Hr),
640 3 => Some(Self::Ofdm),
641 4 => Some(Self::Erp),
642 5 => Some(Self::Ht),
643 6 => Some(Self::Dmg),
644 7 => Some(Self::Vht),
645 8 => Some(Self::Tvht),
646 9 => Some(Self::S1G),
647 10 => Some(Self::Cdmg),
648 11 => Some(Self::Cmmg),
649 12 => Some(Self::He),
650 _ => None,
651 }
652 }
653
654 #[inline]
655 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
656 match prim {
657 1 => Self::Dsss,
658 2 => Self::Hr,
659 3 => Self::Ofdm,
660 4 => Self::Erp,
661 5 => Self::Ht,
662 6 => Self::Dmg,
663 7 => Self::Vht,
664 8 => Self::Tvht,
665 9 => Self::S1G,
666 10 => Self::Cdmg,
667 11 => Self::Cmmg,
668 12 => Self::He,
669 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
670 }
671 }
672
673 #[inline]
674 pub fn unknown() -> Self {
675 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
676 }
677
678 #[inline]
679 pub const fn into_primitive(self) -> u32 {
680 match self {
681 Self::Dsss => 1,
682 Self::Hr => 2,
683 Self::Ofdm => 3,
684 Self::Erp => 4,
685 Self::Ht => 5,
686 Self::Dmg => 6,
687 Self::Vht => 7,
688 Self::Tvht => 8,
689 Self::S1G => 9,
690 Self::Cdmg => 10,
691 Self::Cmmg => 11,
692 Self::He => 12,
693 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
694 }
695 }
696
697 #[inline]
698 pub fn is_unknown(&self) -> bool {
699 match self {
700 Self::__SourceBreaking { unknown_ordinal: _ } => true,
701 _ => false,
702 }
703 }
704}
705
706#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
707#[repr(u8)]
708pub enum WlanProtection {
709 None = 0,
710 Rx = 1,
711 Tx = 2,
712 RxTx = 3,
713}
714
715impl WlanProtection {
716 #[inline]
717 pub fn from_primitive(prim: u8) -> Option<Self> {
718 match prim {
719 0 => Some(Self::None),
720 1 => Some(Self::Rx),
721 2 => Some(Self::Tx),
722 3 => Some(Self::RxTx),
723 _ => None,
724 }
725 }
726
727 #[inline]
728 pub const fn into_primitive(self) -> u8 {
729 self as u8
730 }
731
732 #[deprecated = "Strict enums should not use `is_unknown`"]
733 #[inline]
734 pub fn is_unknown(&self) -> bool {
735 false
736 }
737}
738
739#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
740#[repr(u32)]
741pub enum WlanSoftmacHardwareCapabilityBit {
742 ShortPreamble = 32,
744 SpectrumMgmt = 256,
746 Qos = 512,
747 ShortSlotTime = 1024,
749 RadioMsmt = 4096,
751 SimultaneousClientAp = 65536,
752}
753
754impl WlanSoftmacHardwareCapabilityBit {
755 #[inline]
756 pub fn from_primitive(prim: u32) -> Option<Self> {
757 match prim {
758 32 => Some(Self::ShortPreamble),
759 256 => Some(Self::SpectrumMgmt),
760 512 => Some(Self::Qos),
761 1024 => Some(Self::ShortSlotTime),
762 4096 => Some(Self::RadioMsmt),
763 65536 => Some(Self::SimultaneousClientAp),
764 _ => None,
765 }
766 }
767
768 #[inline]
769 pub const fn into_primitive(self) -> u32 {
770 self as u32
771 }
772
773 #[deprecated = "Strict enums should not use `is_unknown`"]
774 #[inline]
775 pub fn is_unknown(&self) -> bool {
776 false
777 }
778}
779
780#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
782pub enum WlanTxResultCode {
783 Failed,
785 Success,
787 #[doc(hidden)]
788 __SourceBreaking { unknown_ordinal: u8 },
789}
790
791#[macro_export]
793macro_rules! WlanTxResultCodeUnknown {
794 () => {
795 _
796 };
797}
798
799impl WlanTxResultCode {
800 #[inline]
801 pub fn from_primitive(prim: u8) -> Option<Self> {
802 match prim {
803 0 => Some(Self::Failed),
804 1 => Some(Self::Success),
805 _ => None,
806 }
807 }
808
809 #[inline]
810 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
811 match prim {
812 0 => Self::Failed,
813 1 => Self::Success,
814 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
815 }
816 }
817
818 #[inline]
819 pub fn unknown() -> Self {
820 Self::__SourceBreaking { unknown_ordinal: 0xff }
821 }
822
823 #[inline]
824 pub const fn into_primitive(self) -> u8 {
825 match self {
826 Self::Failed => 0,
827 Self::Success => 1,
828 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
829 }
830 }
831
832 #[inline]
833 pub fn is_unknown(&self) -> bool {
834 match self {
835 Self::__SourceBreaking { unknown_ordinal: _ } => true,
836 _ => false,
837 }
838 }
839}
840
841#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
852pub struct BssDescription {
853 pub bssid: [u8; 6],
854 pub bss_type: BssType,
855 pub beacon_period: u16,
856 pub capability_info: u16,
857 pub ies: Vec<u8>,
860 pub channel: WlanChannel,
862 pub rssi_dbm: i8,
864 pub snr_db: i8,
866}
867
868impl fidl::Persistable for BssDescription {}
869
870#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
874pub struct DataPlaneExtension {
875 pub data_plane_type: DataPlaneType,
876}
877
878impl fidl::Persistable for DataPlaneExtension {}
879
880#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
884pub struct DeviceExtension {
885 pub is_synthetic: bool,
889 pub mac_implementation_type: MacImplementationType,
891 pub tx_status_report_supported: bool,
893}
894
895impl fidl::Persistable for DeviceExtension {}
896
897#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
901pub struct DfsFeature {
902 pub supported: bool,
907}
908
909impl fidl::Persistable for DfsFeature {}
910
911#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
914pub struct DiscoverySupport {
915 pub scan_offload: ScanOffloadExtension,
916 pub probe_response_offload: ProbeResponseOffloadExtension,
917}
918
919impl fidl::Persistable for DiscoverySupport {}
920
921#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
924pub struct MacSublayerSupport {
925 pub rate_selection_offload: RateSelectionOffloadExtension,
926 pub data_plane: DataPlaneExtension,
927 pub device: DeviceExtension,
928}
929
930impl fidl::Persistable for MacSublayerSupport {}
931
932#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
936pub struct MfpFeature {
937 pub supported: bool,
938}
939
940impl fidl::Persistable for MfpFeature {}
941
942#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
946pub struct ProbeResponseOffloadExtension {
947 pub supported: bool,
949}
950
951impl fidl::Persistable for ProbeResponseOffloadExtension {}
952
953#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
957pub struct RateSelectionOffloadExtension {
958 pub supported: bool,
960}
961
962impl fidl::Persistable for RateSelectionOffloadExtension {}
963
964#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
968pub struct SaeFeature {
969 pub driver_handler_supported: bool,
971 pub sme_handler_supported: bool,
973}
974
975impl fidl::Persistable for SaeFeature {}
976
977#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
981pub struct ScanOffloadExtension {
982 pub supported: bool,
984 pub scan_cancel_supported: bool,
985}
986
987impl fidl::Persistable for ScanOffloadExtension {}
988
989#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
992pub struct SecuritySupport {
993 pub sae: SaeFeature,
994 pub mfp: MfpFeature,
995}
996
997impl fidl::Persistable for SecuritySupport {}
998
999#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1002pub struct SpectrumManagementSupport {
1003 pub dfs: DfsFeature,
1004}
1005
1006impl fidl::Persistable for SpectrumManagementSupport {}
1007
1008#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1009pub struct WlanChannel {
1010 pub primary: u8,
1011 pub cbw: ChannelBandwidth,
1012 pub secondary80: u8,
1013}
1014
1015impl fidl::Persistable for WlanChannel {}
1016
1017#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1020pub struct WlanTxResult {
1021 pub tx_result_entry: [WlanTxResultEntry; 8],
1024 pub peer_addr: [u8; 6],
1026 pub result_code: WlanTxResultCode,
1027}
1028
1029impl fidl::Persistable for WlanTxResult {}
1030
1031#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1034#[repr(C)]
1035pub struct WlanTxResultEntry {
1036 pub tx_vector_idx: u16,
1037 pub attempts: u8,
1040}
1041
1042impl fidl::Persistable for WlanTxResultEntry {}
1043
1044#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1046pub struct WlanWmmAccessCategoryParameters {
1047 pub ecw_min: u8,
1051 pub ecw_max: u8,
1055 pub aifsn: u8,
1057 pub txop_limit: u16,
1059 pub acm: bool,
1061}
1062
1063impl fidl::Persistable for WlanWmmAccessCategoryParameters {}
1064
1065#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1066pub struct WlanWmmParameters {
1067 pub apsd: bool,
1068 pub ac_be_params: WlanWmmAccessCategoryParameters,
1069 pub ac_bk_params: WlanWmmAccessCategoryParameters,
1070 pub ac_vi_params: WlanWmmAccessCategoryParameters,
1071 pub ac_vo_params: WlanWmmAccessCategoryParameters,
1072}
1073
1074impl fidl::Persistable for WlanWmmParameters {}
1075
1076#[derive(Clone, Debug, Default, PartialEq)]
1077pub struct JoinBssRequest {
1078 pub bssid: Option<[u8; 6]>,
1079 pub bss_type: Option<BssType>,
1080 pub remote: Option<bool>,
1081 pub beacon_period: Option<u16>,
1082 #[doc(hidden)]
1083 pub __source_breaking: fidl::marker::SourceBreaking,
1084}
1085
1086impl fidl::Persistable for JoinBssRequest {}
1087
1088#[derive(Clone, Debug, Default, PartialEq)]
1089pub struct WlanKeyConfig {
1090 pub protection: Option<WlanProtection>,
1092 pub cipher_oui: Option<[u8; 3]>,
1096 pub cipher_type: Option<fidl_fuchsia_wlan_ieee80211::CipherSuiteType>,
1099 pub key_type: Option<WlanKeyType>,
1102 pub peer_addr: Option<[u8; 6]>,
1106 pub key_idx: Option<u8>,
1114 pub key: Option<Vec<u8>>,
1117 pub rsc: Option<u64>,
1121 #[doc(hidden)]
1122 pub __source_breaking: fidl::marker::SourceBreaking,
1123}
1124
1125impl fidl::Persistable for WlanKeyConfig {}
1126
1127mod internal {
1128 use super::*;
1129 unsafe impl fidl::encoding::TypeMarker for BssType {
1130 type Owned = Self;
1131
1132 #[inline(always)]
1133 fn inline_align(_context: fidl::encoding::Context) -> usize {
1134 std::mem::align_of::<u32>()
1135 }
1136
1137 #[inline(always)]
1138 fn inline_size(_context: fidl::encoding::Context) -> usize {
1139 std::mem::size_of::<u32>()
1140 }
1141
1142 #[inline(always)]
1143 fn encode_is_copy() -> bool {
1144 false
1145 }
1146
1147 #[inline(always)]
1148 fn decode_is_copy() -> bool {
1149 false
1150 }
1151 }
1152
1153 impl fidl::encoding::ValueTypeMarker for BssType {
1154 type Borrowed<'a> = Self;
1155 #[inline(always)]
1156 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1157 *value
1158 }
1159 }
1160
1161 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BssType {
1162 #[inline]
1163 unsafe fn encode(
1164 self,
1165 encoder: &mut fidl::encoding::Encoder<'_, D>,
1166 offset: usize,
1167 _depth: fidl::encoding::Depth,
1168 ) -> fidl::Result<()> {
1169 encoder.debug_check_bounds::<Self>(offset);
1170 encoder.write_num(self.into_primitive(), offset);
1171 Ok(())
1172 }
1173 }
1174
1175 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssType {
1176 #[inline(always)]
1177 fn new_empty() -> Self {
1178 Self::unknown()
1179 }
1180
1181 #[inline]
1182 unsafe fn decode(
1183 &mut self,
1184 decoder: &mut fidl::encoding::Decoder<'_, D>,
1185 offset: usize,
1186 _depth: fidl::encoding::Depth,
1187 ) -> fidl::Result<()> {
1188 decoder.debug_check_bounds::<Self>(offset);
1189 let prim = decoder.read_num::<u32>(offset);
1190
1191 *self = Self::from_primitive_allow_unknown(prim);
1192 Ok(())
1193 }
1194 }
1195 unsafe impl fidl::encoding::TypeMarker for ChannelBandwidth {
1196 type Owned = Self;
1197
1198 #[inline(always)]
1199 fn inline_align(_context: fidl::encoding::Context) -> usize {
1200 std::mem::align_of::<u32>()
1201 }
1202
1203 #[inline(always)]
1204 fn inline_size(_context: fidl::encoding::Context) -> usize {
1205 std::mem::size_of::<u32>()
1206 }
1207
1208 #[inline(always)]
1209 fn encode_is_copy() -> bool {
1210 false
1211 }
1212
1213 #[inline(always)]
1214 fn decode_is_copy() -> bool {
1215 false
1216 }
1217 }
1218
1219 impl fidl::encoding::ValueTypeMarker for ChannelBandwidth {
1220 type Borrowed<'a> = Self;
1221 #[inline(always)]
1222 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1223 *value
1224 }
1225 }
1226
1227 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1228 for ChannelBandwidth
1229 {
1230 #[inline]
1231 unsafe fn encode(
1232 self,
1233 encoder: &mut fidl::encoding::Encoder<'_, D>,
1234 offset: usize,
1235 _depth: fidl::encoding::Depth,
1236 ) -> fidl::Result<()> {
1237 encoder.debug_check_bounds::<Self>(offset);
1238 encoder.write_num(self.into_primitive(), offset);
1239 Ok(())
1240 }
1241 }
1242
1243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelBandwidth {
1244 #[inline(always)]
1245 fn new_empty() -> Self {
1246 Self::unknown()
1247 }
1248
1249 #[inline]
1250 unsafe fn decode(
1251 &mut self,
1252 decoder: &mut fidl::encoding::Decoder<'_, D>,
1253 offset: usize,
1254 _depth: fidl::encoding::Depth,
1255 ) -> fidl::Result<()> {
1256 decoder.debug_check_bounds::<Self>(offset);
1257 let prim = decoder.read_num::<u32>(offset);
1258
1259 *self = Self::from_primitive_allow_unknown(prim);
1260 Ok(())
1261 }
1262 }
1263 unsafe impl fidl::encoding::TypeMarker for DataPlaneType {
1264 type Owned = Self;
1265
1266 #[inline(always)]
1267 fn inline_align(_context: fidl::encoding::Context) -> usize {
1268 std::mem::align_of::<u8>()
1269 }
1270
1271 #[inline(always)]
1272 fn inline_size(_context: fidl::encoding::Context) -> usize {
1273 std::mem::size_of::<u8>()
1274 }
1275
1276 #[inline(always)]
1277 fn encode_is_copy() -> bool {
1278 true
1279 }
1280
1281 #[inline(always)]
1282 fn decode_is_copy() -> bool {
1283 false
1284 }
1285 }
1286
1287 impl fidl::encoding::ValueTypeMarker for DataPlaneType {
1288 type Borrowed<'a> = Self;
1289 #[inline(always)]
1290 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1291 *value
1292 }
1293 }
1294
1295 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DataPlaneType {
1296 #[inline]
1297 unsafe fn encode(
1298 self,
1299 encoder: &mut fidl::encoding::Encoder<'_, D>,
1300 offset: usize,
1301 _depth: fidl::encoding::Depth,
1302 ) -> fidl::Result<()> {
1303 encoder.debug_check_bounds::<Self>(offset);
1304 encoder.write_num(self.into_primitive(), offset);
1305 Ok(())
1306 }
1307 }
1308
1309 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneType {
1310 #[inline(always)]
1311 fn new_empty() -> Self {
1312 Self::EthernetDevice
1313 }
1314
1315 #[inline]
1316 unsafe fn decode(
1317 &mut self,
1318 decoder: &mut fidl::encoding::Decoder<'_, D>,
1319 offset: usize,
1320 _depth: fidl::encoding::Depth,
1321 ) -> fidl::Result<()> {
1322 decoder.debug_check_bounds::<Self>(offset);
1323 let prim = decoder.read_num::<u8>(offset);
1324
1325 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1326 Ok(())
1327 }
1328 }
1329 unsafe impl fidl::encoding::TypeMarker for GuardInterval {
1330 type Owned = Self;
1331
1332 #[inline(always)]
1333 fn inline_align(_context: fidl::encoding::Context) -> usize {
1334 std::mem::align_of::<u8>()
1335 }
1336
1337 #[inline(always)]
1338 fn inline_size(_context: fidl::encoding::Context) -> usize {
1339 std::mem::size_of::<u8>()
1340 }
1341
1342 #[inline(always)]
1343 fn encode_is_copy() -> bool {
1344 true
1345 }
1346
1347 #[inline(always)]
1348 fn decode_is_copy() -> bool {
1349 false
1350 }
1351 }
1352
1353 impl fidl::encoding::ValueTypeMarker for GuardInterval {
1354 type Borrowed<'a> = Self;
1355 #[inline(always)]
1356 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1357 *value
1358 }
1359 }
1360
1361 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GuardInterval {
1362 #[inline]
1363 unsafe fn encode(
1364 self,
1365 encoder: &mut fidl::encoding::Encoder<'_, D>,
1366 offset: usize,
1367 _depth: fidl::encoding::Depth,
1368 ) -> fidl::Result<()> {
1369 encoder.debug_check_bounds::<Self>(offset);
1370 encoder.write_num(self.into_primitive(), offset);
1371 Ok(())
1372 }
1373 }
1374
1375 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GuardInterval {
1376 #[inline(always)]
1377 fn new_empty() -> Self {
1378 Self::LongGi
1379 }
1380
1381 #[inline]
1382 unsafe fn decode(
1383 &mut self,
1384 decoder: &mut fidl::encoding::Decoder<'_, D>,
1385 offset: usize,
1386 _depth: fidl::encoding::Depth,
1387 ) -> fidl::Result<()> {
1388 decoder.debug_check_bounds::<Self>(offset);
1389 let prim = decoder.read_num::<u8>(offset);
1390
1391 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1392 Ok(())
1393 }
1394 }
1395 unsafe impl fidl::encoding::TypeMarker for MacImplementationType {
1396 type Owned = Self;
1397
1398 #[inline(always)]
1399 fn inline_align(_context: fidl::encoding::Context) -> usize {
1400 std::mem::align_of::<u8>()
1401 }
1402
1403 #[inline(always)]
1404 fn inline_size(_context: fidl::encoding::Context) -> usize {
1405 std::mem::size_of::<u8>()
1406 }
1407
1408 #[inline(always)]
1409 fn encode_is_copy() -> bool {
1410 true
1411 }
1412
1413 #[inline(always)]
1414 fn decode_is_copy() -> bool {
1415 false
1416 }
1417 }
1418
1419 impl fidl::encoding::ValueTypeMarker for MacImplementationType {
1420 type Borrowed<'a> = Self;
1421 #[inline(always)]
1422 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1423 *value
1424 }
1425 }
1426
1427 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1428 for MacImplementationType
1429 {
1430 #[inline]
1431 unsafe fn encode(
1432 self,
1433 encoder: &mut fidl::encoding::Encoder<'_, D>,
1434 offset: usize,
1435 _depth: fidl::encoding::Depth,
1436 ) -> fidl::Result<()> {
1437 encoder.debug_check_bounds::<Self>(offset);
1438 encoder.write_num(self.into_primitive(), offset);
1439 Ok(())
1440 }
1441 }
1442
1443 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacImplementationType {
1444 #[inline(always)]
1445 fn new_empty() -> Self {
1446 Self::Softmac
1447 }
1448
1449 #[inline]
1450 unsafe fn decode(
1451 &mut self,
1452 decoder: &mut fidl::encoding::Decoder<'_, D>,
1453 offset: usize,
1454 _depth: fidl::encoding::Depth,
1455 ) -> fidl::Result<()> {
1456 decoder.debug_check_bounds::<Self>(offset);
1457 let prim = decoder.read_num::<u8>(offset);
1458
1459 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1460 Ok(())
1461 }
1462 }
1463 unsafe impl fidl::encoding::TypeMarker for PowerSaveType {
1464 type Owned = Self;
1465
1466 #[inline(always)]
1467 fn inline_align(_context: fidl::encoding::Context) -> usize {
1468 std::mem::align_of::<u32>()
1469 }
1470
1471 #[inline(always)]
1472 fn inline_size(_context: fidl::encoding::Context) -> usize {
1473 std::mem::size_of::<u32>()
1474 }
1475
1476 #[inline(always)]
1477 fn encode_is_copy() -> bool {
1478 true
1479 }
1480
1481 #[inline(always)]
1482 fn decode_is_copy() -> bool {
1483 false
1484 }
1485 }
1486
1487 impl fidl::encoding::ValueTypeMarker for PowerSaveType {
1488 type Borrowed<'a> = Self;
1489 #[inline(always)]
1490 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1491 *value
1492 }
1493 }
1494
1495 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PowerSaveType {
1496 #[inline]
1497 unsafe fn encode(
1498 self,
1499 encoder: &mut fidl::encoding::Encoder<'_, D>,
1500 offset: usize,
1501 _depth: fidl::encoding::Depth,
1502 ) -> fidl::Result<()> {
1503 encoder.debug_check_bounds::<Self>(offset);
1504 encoder.write_num(self.into_primitive(), offset);
1505 Ok(())
1506 }
1507 }
1508
1509 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PowerSaveType {
1510 #[inline(always)]
1511 fn new_empty() -> Self {
1512 Self::PsModeUltraLowPower
1513 }
1514
1515 #[inline]
1516 unsafe fn decode(
1517 &mut self,
1518 decoder: &mut fidl::encoding::Decoder<'_, D>,
1519 offset: usize,
1520 _depth: fidl::encoding::Depth,
1521 ) -> fidl::Result<()> {
1522 decoder.debug_check_bounds::<Self>(offset);
1523 let prim = decoder.read_num::<u32>(offset);
1524
1525 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1526 Ok(())
1527 }
1528 }
1529 unsafe impl fidl::encoding::TypeMarker for RequestStatus {
1530 type Owned = Self;
1531
1532 #[inline(always)]
1533 fn inline_align(_context: fidl::encoding::Context) -> usize {
1534 std::mem::align_of::<u32>()
1535 }
1536
1537 #[inline(always)]
1538 fn inline_size(_context: fidl::encoding::Context) -> usize {
1539 std::mem::size_of::<u32>()
1540 }
1541
1542 #[inline(always)]
1543 fn encode_is_copy() -> bool {
1544 true
1545 }
1546
1547 #[inline(always)]
1548 fn decode_is_copy() -> bool {
1549 false
1550 }
1551 }
1552
1553 impl fidl::encoding::ValueTypeMarker for RequestStatus {
1554 type Borrowed<'a> = Self;
1555 #[inline(always)]
1556 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1557 *value
1558 }
1559 }
1560
1561 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RequestStatus {
1562 #[inline]
1563 unsafe fn encode(
1564 self,
1565 encoder: &mut fidl::encoding::Encoder<'_, D>,
1566 offset: usize,
1567 _depth: fidl::encoding::Depth,
1568 ) -> fidl::Result<()> {
1569 encoder.debug_check_bounds::<Self>(offset);
1570 encoder.write_num(self.into_primitive(), offset);
1571 Ok(())
1572 }
1573 }
1574
1575 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RequestStatus {
1576 #[inline(always)]
1577 fn new_empty() -> Self {
1578 Self::Acknowledged
1579 }
1580
1581 #[inline]
1582 unsafe fn decode(
1583 &mut self,
1584 decoder: &mut fidl::encoding::Decoder<'_, D>,
1585 offset: usize,
1586 _depth: fidl::encoding::Depth,
1587 ) -> fidl::Result<()> {
1588 decoder.debug_check_bounds::<Self>(offset);
1589 let prim = decoder.read_num::<u32>(offset);
1590
1591 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1592 Ok(())
1593 }
1594 }
1595 unsafe impl fidl::encoding::TypeMarker for ScanType {
1596 type Owned = Self;
1597
1598 #[inline(always)]
1599 fn inline_align(_context: fidl::encoding::Context) -> usize {
1600 std::mem::align_of::<u32>()
1601 }
1602
1603 #[inline(always)]
1604 fn inline_size(_context: fidl::encoding::Context) -> usize {
1605 std::mem::size_of::<u32>()
1606 }
1607
1608 #[inline(always)]
1609 fn encode_is_copy() -> bool {
1610 true
1611 }
1612
1613 #[inline(always)]
1614 fn decode_is_copy() -> bool {
1615 false
1616 }
1617 }
1618
1619 impl fidl::encoding::ValueTypeMarker for ScanType {
1620 type Borrowed<'a> = Self;
1621 #[inline(always)]
1622 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1623 *value
1624 }
1625 }
1626
1627 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanType {
1628 #[inline]
1629 unsafe fn encode(
1630 self,
1631 encoder: &mut fidl::encoding::Encoder<'_, D>,
1632 offset: usize,
1633 _depth: fidl::encoding::Depth,
1634 ) -> fidl::Result<()> {
1635 encoder.debug_check_bounds::<Self>(offset);
1636 encoder.write_num(self.into_primitive(), offset);
1637 Ok(())
1638 }
1639 }
1640
1641 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanType {
1642 #[inline(always)]
1643 fn new_empty() -> Self {
1644 Self::Active
1645 }
1646
1647 #[inline]
1648 unsafe fn decode(
1649 &mut self,
1650 decoder: &mut fidl::encoding::Decoder<'_, D>,
1651 offset: usize,
1652 _depth: fidl::encoding::Depth,
1653 ) -> fidl::Result<()> {
1654 decoder.debug_check_bounds::<Self>(offset);
1655 let prim = decoder.read_num::<u32>(offset);
1656
1657 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1658 Ok(())
1659 }
1660 }
1661 unsafe impl fidl::encoding::TypeMarker for WlanBand {
1662 type Owned = Self;
1663
1664 #[inline(always)]
1665 fn inline_align(_context: fidl::encoding::Context) -> usize {
1666 std::mem::align_of::<u8>()
1667 }
1668
1669 #[inline(always)]
1670 fn inline_size(_context: fidl::encoding::Context) -> usize {
1671 std::mem::size_of::<u8>()
1672 }
1673
1674 #[inline(always)]
1675 fn encode_is_copy() -> bool {
1676 false
1677 }
1678
1679 #[inline(always)]
1680 fn decode_is_copy() -> bool {
1681 false
1682 }
1683 }
1684
1685 impl fidl::encoding::ValueTypeMarker for WlanBand {
1686 type Borrowed<'a> = Self;
1687 #[inline(always)]
1688 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1689 *value
1690 }
1691 }
1692
1693 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanBand {
1694 #[inline]
1695 unsafe fn encode(
1696 self,
1697 encoder: &mut fidl::encoding::Encoder<'_, D>,
1698 offset: usize,
1699 _depth: fidl::encoding::Depth,
1700 ) -> fidl::Result<()> {
1701 encoder.debug_check_bounds::<Self>(offset);
1702 encoder.write_num(self.into_primitive(), offset);
1703 Ok(())
1704 }
1705 }
1706
1707 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanBand {
1708 #[inline(always)]
1709 fn new_empty() -> Self {
1710 Self::unknown()
1711 }
1712
1713 #[inline]
1714 unsafe fn decode(
1715 &mut self,
1716 decoder: &mut fidl::encoding::Decoder<'_, D>,
1717 offset: usize,
1718 _depth: fidl::encoding::Depth,
1719 ) -> fidl::Result<()> {
1720 decoder.debug_check_bounds::<Self>(offset);
1721 let prim = decoder.read_num::<u8>(offset);
1722
1723 *self = Self::from_primitive_allow_unknown(prim);
1724 Ok(())
1725 }
1726 }
1727 unsafe impl fidl::encoding::TypeMarker for WlanKeyType {
1728 type Owned = Self;
1729
1730 #[inline(always)]
1731 fn inline_align(_context: fidl::encoding::Context) -> usize {
1732 std::mem::align_of::<u8>()
1733 }
1734
1735 #[inline(always)]
1736 fn inline_size(_context: fidl::encoding::Context) -> usize {
1737 std::mem::size_of::<u8>()
1738 }
1739
1740 #[inline(always)]
1741 fn encode_is_copy() -> bool {
1742 false
1743 }
1744
1745 #[inline(always)]
1746 fn decode_is_copy() -> bool {
1747 false
1748 }
1749 }
1750
1751 impl fidl::encoding::ValueTypeMarker for WlanKeyType {
1752 type Borrowed<'a> = Self;
1753 #[inline(always)]
1754 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1755 *value
1756 }
1757 }
1758
1759 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanKeyType {
1760 #[inline]
1761 unsafe fn encode(
1762 self,
1763 encoder: &mut fidl::encoding::Encoder<'_, D>,
1764 offset: usize,
1765 _depth: fidl::encoding::Depth,
1766 ) -> fidl::Result<()> {
1767 encoder.debug_check_bounds::<Self>(offset);
1768 encoder.write_num(self.into_primitive(), offset);
1769 Ok(())
1770 }
1771 }
1772
1773 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyType {
1774 #[inline(always)]
1775 fn new_empty() -> Self {
1776 Self::unknown()
1777 }
1778
1779 #[inline]
1780 unsafe fn decode(
1781 &mut self,
1782 decoder: &mut fidl::encoding::Decoder<'_, D>,
1783 offset: usize,
1784 _depth: fidl::encoding::Depth,
1785 ) -> fidl::Result<()> {
1786 decoder.debug_check_bounds::<Self>(offset);
1787 let prim = decoder.read_num::<u8>(offset);
1788
1789 *self = Self::from_primitive_allow_unknown(prim);
1790 Ok(())
1791 }
1792 }
1793 unsafe impl fidl::encoding::TypeMarker for WlanMacRole {
1794 type Owned = Self;
1795
1796 #[inline(always)]
1797 fn inline_align(_context: fidl::encoding::Context) -> usize {
1798 std::mem::align_of::<u32>()
1799 }
1800
1801 #[inline(always)]
1802 fn inline_size(_context: fidl::encoding::Context) -> usize {
1803 std::mem::size_of::<u32>()
1804 }
1805
1806 #[inline(always)]
1807 fn encode_is_copy() -> bool {
1808 false
1809 }
1810
1811 #[inline(always)]
1812 fn decode_is_copy() -> bool {
1813 false
1814 }
1815 }
1816
1817 impl fidl::encoding::ValueTypeMarker for WlanMacRole {
1818 type Borrowed<'a> = Self;
1819 #[inline(always)]
1820 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1821 *value
1822 }
1823 }
1824
1825 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanMacRole {
1826 #[inline]
1827 unsafe fn encode(
1828 self,
1829 encoder: &mut fidl::encoding::Encoder<'_, D>,
1830 offset: usize,
1831 _depth: fidl::encoding::Depth,
1832 ) -> fidl::Result<()> {
1833 encoder.debug_check_bounds::<Self>(offset);
1834 encoder.write_num(self.into_primitive(), offset);
1835 Ok(())
1836 }
1837 }
1838
1839 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanMacRole {
1840 #[inline(always)]
1841 fn new_empty() -> Self {
1842 Self::unknown()
1843 }
1844
1845 #[inline]
1846 unsafe fn decode(
1847 &mut self,
1848 decoder: &mut fidl::encoding::Decoder<'_, D>,
1849 offset: usize,
1850 _depth: fidl::encoding::Depth,
1851 ) -> fidl::Result<()> {
1852 decoder.debug_check_bounds::<Self>(offset);
1853 let prim = decoder.read_num::<u32>(offset);
1854
1855 *self = Self::from_primitive_allow_unknown(prim);
1856 Ok(())
1857 }
1858 }
1859 unsafe impl fidl::encoding::TypeMarker for WlanPhyType {
1860 type Owned = Self;
1861
1862 #[inline(always)]
1863 fn inline_align(_context: fidl::encoding::Context) -> usize {
1864 std::mem::align_of::<u32>()
1865 }
1866
1867 #[inline(always)]
1868 fn inline_size(_context: fidl::encoding::Context) -> usize {
1869 std::mem::size_of::<u32>()
1870 }
1871
1872 #[inline(always)]
1873 fn encode_is_copy() -> bool {
1874 false
1875 }
1876
1877 #[inline(always)]
1878 fn decode_is_copy() -> bool {
1879 false
1880 }
1881 }
1882
1883 impl fidl::encoding::ValueTypeMarker for WlanPhyType {
1884 type Borrowed<'a> = Self;
1885 #[inline(always)]
1886 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1887 *value
1888 }
1889 }
1890
1891 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanPhyType {
1892 #[inline]
1893 unsafe fn encode(
1894 self,
1895 encoder: &mut fidl::encoding::Encoder<'_, D>,
1896 offset: usize,
1897 _depth: fidl::encoding::Depth,
1898 ) -> fidl::Result<()> {
1899 encoder.debug_check_bounds::<Self>(offset);
1900 encoder.write_num(self.into_primitive(), offset);
1901 Ok(())
1902 }
1903 }
1904
1905 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanPhyType {
1906 #[inline(always)]
1907 fn new_empty() -> Self {
1908 Self::unknown()
1909 }
1910
1911 #[inline]
1912 unsafe fn decode(
1913 &mut self,
1914 decoder: &mut fidl::encoding::Decoder<'_, D>,
1915 offset: usize,
1916 _depth: fidl::encoding::Depth,
1917 ) -> fidl::Result<()> {
1918 decoder.debug_check_bounds::<Self>(offset);
1919 let prim = decoder.read_num::<u32>(offset);
1920
1921 *self = Self::from_primitive_allow_unknown(prim);
1922 Ok(())
1923 }
1924 }
1925 unsafe impl fidl::encoding::TypeMarker for WlanProtection {
1926 type Owned = Self;
1927
1928 #[inline(always)]
1929 fn inline_align(_context: fidl::encoding::Context) -> usize {
1930 std::mem::align_of::<u8>()
1931 }
1932
1933 #[inline(always)]
1934 fn inline_size(_context: fidl::encoding::Context) -> usize {
1935 std::mem::size_of::<u8>()
1936 }
1937
1938 #[inline(always)]
1939 fn encode_is_copy() -> bool {
1940 true
1941 }
1942
1943 #[inline(always)]
1944 fn decode_is_copy() -> bool {
1945 false
1946 }
1947 }
1948
1949 impl fidl::encoding::ValueTypeMarker for WlanProtection {
1950 type Borrowed<'a> = Self;
1951 #[inline(always)]
1952 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1953 *value
1954 }
1955 }
1956
1957 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
1958 #[inline]
1959 unsafe fn encode(
1960 self,
1961 encoder: &mut fidl::encoding::Encoder<'_, D>,
1962 offset: usize,
1963 _depth: fidl::encoding::Depth,
1964 ) -> fidl::Result<()> {
1965 encoder.debug_check_bounds::<Self>(offset);
1966 encoder.write_num(self.into_primitive(), offset);
1967 Ok(())
1968 }
1969 }
1970
1971 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
1972 #[inline(always)]
1973 fn new_empty() -> Self {
1974 Self::None
1975 }
1976
1977 #[inline]
1978 unsafe fn decode(
1979 &mut self,
1980 decoder: &mut fidl::encoding::Decoder<'_, D>,
1981 offset: usize,
1982 _depth: fidl::encoding::Depth,
1983 ) -> fidl::Result<()> {
1984 decoder.debug_check_bounds::<Self>(offset);
1985 let prim = decoder.read_num::<u8>(offset);
1986
1987 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1988 Ok(())
1989 }
1990 }
1991 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacHardwareCapabilityBit {
1992 type Owned = Self;
1993
1994 #[inline(always)]
1995 fn inline_align(_context: fidl::encoding::Context) -> usize {
1996 std::mem::align_of::<u32>()
1997 }
1998
1999 #[inline(always)]
2000 fn inline_size(_context: fidl::encoding::Context) -> usize {
2001 std::mem::size_of::<u32>()
2002 }
2003
2004 #[inline(always)]
2005 fn encode_is_copy() -> bool {
2006 true
2007 }
2008
2009 #[inline(always)]
2010 fn decode_is_copy() -> bool {
2011 false
2012 }
2013 }
2014
2015 impl fidl::encoding::ValueTypeMarker for WlanSoftmacHardwareCapabilityBit {
2016 type Borrowed<'a> = Self;
2017 #[inline(always)]
2018 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2019 *value
2020 }
2021 }
2022
2023 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2024 for WlanSoftmacHardwareCapabilityBit
2025 {
2026 #[inline]
2027 unsafe fn encode(
2028 self,
2029 encoder: &mut fidl::encoding::Encoder<'_, D>,
2030 offset: usize,
2031 _depth: fidl::encoding::Depth,
2032 ) -> fidl::Result<()> {
2033 encoder.debug_check_bounds::<Self>(offset);
2034 encoder.write_num(self.into_primitive(), offset);
2035 Ok(())
2036 }
2037 }
2038
2039 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2040 for WlanSoftmacHardwareCapabilityBit
2041 {
2042 #[inline(always)]
2043 fn new_empty() -> Self {
2044 Self::ShortPreamble
2045 }
2046
2047 #[inline]
2048 unsafe fn decode(
2049 &mut self,
2050 decoder: &mut fidl::encoding::Decoder<'_, D>,
2051 offset: usize,
2052 _depth: fidl::encoding::Depth,
2053 ) -> fidl::Result<()> {
2054 decoder.debug_check_bounds::<Self>(offset);
2055 let prim = decoder.read_num::<u32>(offset);
2056
2057 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2058 Ok(())
2059 }
2060 }
2061 unsafe impl fidl::encoding::TypeMarker for WlanTxResultCode {
2062 type Owned = Self;
2063
2064 #[inline(always)]
2065 fn inline_align(_context: fidl::encoding::Context) -> usize {
2066 std::mem::align_of::<u8>()
2067 }
2068
2069 #[inline(always)]
2070 fn inline_size(_context: fidl::encoding::Context) -> usize {
2071 std::mem::size_of::<u8>()
2072 }
2073
2074 #[inline(always)]
2075 fn encode_is_copy() -> bool {
2076 false
2077 }
2078
2079 #[inline(always)]
2080 fn decode_is_copy() -> bool {
2081 false
2082 }
2083 }
2084
2085 impl fidl::encoding::ValueTypeMarker for WlanTxResultCode {
2086 type Borrowed<'a> = Self;
2087 #[inline(always)]
2088 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2089 *value
2090 }
2091 }
2092
2093 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2094 for WlanTxResultCode
2095 {
2096 #[inline]
2097 unsafe fn encode(
2098 self,
2099 encoder: &mut fidl::encoding::Encoder<'_, D>,
2100 offset: usize,
2101 _depth: fidl::encoding::Depth,
2102 ) -> fidl::Result<()> {
2103 encoder.debug_check_bounds::<Self>(offset);
2104 encoder.write_num(self.into_primitive(), offset);
2105 Ok(())
2106 }
2107 }
2108
2109 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultCode {
2110 #[inline(always)]
2111 fn new_empty() -> Self {
2112 Self::unknown()
2113 }
2114
2115 #[inline]
2116 unsafe fn decode(
2117 &mut self,
2118 decoder: &mut fidl::encoding::Decoder<'_, D>,
2119 offset: usize,
2120 _depth: fidl::encoding::Depth,
2121 ) -> fidl::Result<()> {
2122 decoder.debug_check_bounds::<Self>(offset);
2123 let prim = decoder.read_num::<u8>(offset);
2124
2125 *self = Self::from_primitive_allow_unknown(prim);
2126 Ok(())
2127 }
2128 }
2129
2130 impl fidl::encoding::ValueTypeMarker for BssDescription {
2131 type Borrowed<'a> = &'a Self;
2132 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2133 value
2134 }
2135 }
2136
2137 unsafe impl fidl::encoding::TypeMarker for BssDescription {
2138 type Owned = Self;
2139
2140 #[inline(always)]
2141 fn inline_align(_context: fidl::encoding::Context) -> usize {
2142 8
2143 }
2144
2145 #[inline(always)]
2146 fn inline_size(_context: fidl::encoding::Context) -> usize {
2147 48
2148 }
2149 }
2150
2151 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BssDescription, D>
2152 for &BssDescription
2153 {
2154 #[inline]
2155 unsafe fn encode(
2156 self,
2157 encoder: &mut fidl::encoding::Encoder<'_, D>,
2158 offset: usize,
2159 _depth: fidl::encoding::Depth,
2160 ) -> fidl::Result<()> {
2161 encoder.debug_check_bounds::<BssDescription>(offset);
2162 fidl::encoding::Encode::<BssDescription, D>::encode(
2164 (
2165 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.bssid),
2166 <BssType as fidl::encoding::ValueTypeMarker>::borrow(&self.bss_type),
2167 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.beacon_period),
2168 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_info),
2169 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.ies),
2170 <WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
2171 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
2172 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_db),
2173 ),
2174 encoder, offset, _depth
2175 )
2176 }
2177 }
2178 unsafe impl<
2179 D: fidl::encoding::ResourceDialect,
2180 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
2181 T1: fidl::encoding::Encode<BssType, D>,
2182 T2: fidl::encoding::Encode<u16, D>,
2183 T3: fidl::encoding::Encode<u16, D>,
2184 T4: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2185 T5: fidl::encoding::Encode<WlanChannel, D>,
2186 T6: fidl::encoding::Encode<i8, D>,
2187 T7: fidl::encoding::Encode<i8, D>,
2188 > fidl::encoding::Encode<BssDescription, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
2189 {
2190 #[inline]
2191 unsafe fn encode(
2192 self,
2193 encoder: &mut fidl::encoding::Encoder<'_, D>,
2194 offset: usize,
2195 depth: fidl::encoding::Depth,
2196 ) -> fidl::Result<()> {
2197 encoder.debug_check_bounds::<BssDescription>(offset);
2198 unsafe {
2201 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2202 (ptr as *mut u64).write_unaligned(0);
2203 }
2204 unsafe {
2205 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2206 (ptr as *mut u64).write_unaligned(0);
2207 }
2208 self.0.encode(encoder, offset + 0, depth)?;
2210 self.1.encode(encoder, offset + 8, depth)?;
2211 self.2.encode(encoder, offset + 12, depth)?;
2212 self.3.encode(encoder, offset + 14, depth)?;
2213 self.4.encode(encoder, offset + 16, depth)?;
2214 self.5.encode(encoder, offset + 32, depth)?;
2215 self.6.encode(encoder, offset + 44, depth)?;
2216 self.7.encode(encoder, offset + 45, depth)?;
2217 Ok(())
2218 }
2219 }
2220
2221 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssDescription {
2222 #[inline(always)]
2223 fn new_empty() -> Self {
2224 Self {
2225 bssid: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
2226 bss_type: fidl::new_empty!(BssType, D),
2227 beacon_period: fidl::new_empty!(u16, D),
2228 capability_info: fidl::new_empty!(u16, D),
2229 ies: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2230 channel: fidl::new_empty!(WlanChannel, D),
2231 rssi_dbm: fidl::new_empty!(i8, D),
2232 snr_db: fidl::new_empty!(i8, D),
2233 }
2234 }
2235
2236 #[inline]
2237 unsafe fn decode(
2238 &mut self,
2239 decoder: &mut fidl::encoding::Decoder<'_, D>,
2240 offset: usize,
2241 _depth: fidl::encoding::Depth,
2242 ) -> fidl::Result<()> {
2243 decoder.debug_check_bounds::<Self>(offset);
2244 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2246 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2247 let mask = 0xffff000000000000u64;
2248 let maskedval = padval & mask;
2249 if maskedval != 0 {
2250 return Err(fidl::Error::NonZeroPadding {
2251 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2252 });
2253 }
2254 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2255 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2256 let mask = 0xffff000000000000u64;
2257 let maskedval = padval & mask;
2258 if maskedval != 0 {
2259 return Err(fidl::Error::NonZeroPadding {
2260 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2261 });
2262 }
2263 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.bssid, decoder, offset + 0, _depth)?;
2264 fidl::decode!(BssType, D, &mut self.bss_type, decoder, offset + 8, _depth)?;
2265 fidl::decode!(u16, D, &mut self.beacon_period, decoder, offset + 12, _depth)?;
2266 fidl::decode!(u16, D, &mut self.capability_info, decoder, offset + 14, _depth)?;
2267 fidl::decode!(
2268 fidl::encoding::UnboundedVector<u8>,
2269 D,
2270 &mut self.ies,
2271 decoder,
2272 offset + 16,
2273 _depth
2274 )?;
2275 fidl::decode!(WlanChannel, D, &mut self.channel, decoder, offset + 32, _depth)?;
2276 fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 44, _depth)?;
2277 fidl::decode!(i8, D, &mut self.snr_db, decoder, offset + 45, _depth)?;
2278 Ok(())
2279 }
2280 }
2281
2282 impl fidl::encoding::ValueTypeMarker for DataPlaneExtension {
2283 type Borrowed<'a> = &'a Self;
2284 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2285 value
2286 }
2287 }
2288
2289 unsafe impl fidl::encoding::TypeMarker for DataPlaneExtension {
2290 type Owned = Self;
2291
2292 #[inline(always)]
2293 fn inline_align(_context: fidl::encoding::Context) -> usize {
2294 1
2295 }
2296
2297 #[inline(always)]
2298 fn inline_size(_context: fidl::encoding::Context) -> usize {
2299 1
2300 }
2301 }
2302
2303 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataPlaneExtension, D>
2304 for &DataPlaneExtension
2305 {
2306 #[inline]
2307 unsafe fn encode(
2308 self,
2309 encoder: &mut fidl::encoding::Encoder<'_, D>,
2310 offset: usize,
2311 _depth: fidl::encoding::Depth,
2312 ) -> fidl::Result<()> {
2313 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2314 fidl::encoding::Encode::<DataPlaneExtension, D>::encode(
2316 (<DataPlaneType as fidl::encoding::ValueTypeMarker>::borrow(&self.data_plane_type),),
2317 encoder,
2318 offset,
2319 _depth,
2320 )
2321 }
2322 }
2323 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DataPlaneType, D>>
2324 fidl::encoding::Encode<DataPlaneExtension, D> for (T0,)
2325 {
2326 #[inline]
2327 unsafe fn encode(
2328 self,
2329 encoder: &mut fidl::encoding::Encoder<'_, D>,
2330 offset: usize,
2331 depth: fidl::encoding::Depth,
2332 ) -> fidl::Result<()> {
2333 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2334 self.0.encode(encoder, offset + 0, depth)?;
2338 Ok(())
2339 }
2340 }
2341
2342 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneExtension {
2343 #[inline(always)]
2344 fn new_empty() -> Self {
2345 Self { data_plane_type: fidl::new_empty!(DataPlaneType, D) }
2346 }
2347
2348 #[inline]
2349 unsafe fn decode(
2350 &mut self,
2351 decoder: &mut fidl::encoding::Decoder<'_, D>,
2352 offset: usize,
2353 _depth: fidl::encoding::Depth,
2354 ) -> fidl::Result<()> {
2355 decoder.debug_check_bounds::<Self>(offset);
2356 fidl::decode!(
2358 DataPlaneType,
2359 D,
2360 &mut self.data_plane_type,
2361 decoder,
2362 offset + 0,
2363 _depth
2364 )?;
2365 Ok(())
2366 }
2367 }
2368
2369 impl fidl::encoding::ValueTypeMarker for DeviceExtension {
2370 type Borrowed<'a> = &'a Self;
2371 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2372 value
2373 }
2374 }
2375
2376 unsafe impl fidl::encoding::TypeMarker for DeviceExtension {
2377 type Owned = Self;
2378
2379 #[inline(always)]
2380 fn inline_align(_context: fidl::encoding::Context) -> usize {
2381 1
2382 }
2383
2384 #[inline(always)]
2385 fn inline_size(_context: fidl::encoding::Context) -> usize {
2386 3
2387 }
2388 }
2389
2390 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceExtension, D>
2391 for &DeviceExtension
2392 {
2393 #[inline]
2394 unsafe fn encode(
2395 self,
2396 encoder: &mut fidl::encoding::Encoder<'_, D>,
2397 offset: usize,
2398 _depth: fidl::encoding::Depth,
2399 ) -> fidl::Result<()> {
2400 encoder.debug_check_bounds::<DeviceExtension>(offset);
2401 fidl::encoding::Encode::<DeviceExtension, D>::encode(
2403 (
2404 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_synthetic),
2405 <MacImplementationType as fidl::encoding::ValueTypeMarker>::borrow(
2406 &self.mac_implementation_type,
2407 ),
2408 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2409 &self.tx_status_report_supported,
2410 ),
2411 ),
2412 encoder,
2413 offset,
2414 _depth,
2415 )
2416 }
2417 }
2418 unsafe impl<
2419 D: fidl::encoding::ResourceDialect,
2420 T0: fidl::encoding::Encode<bool, D>,
2421 T1: fidl::encoding::Encode<MacImplementationType, D>,
2422 T2: fidl::encoding::Encode<bool, D>,
2423 > fidl::encoding::Encode<DeviceExtension, D> for (T0, T1, T2)
2424 {
2425 #[inline]
2426 unsafe fn encode(
2427 self,
2428 encoder: &mut fidl::encoding::Encoder<'_, D>,
2429 offset: usize,
2430 depth: fidl::encoding::Depth,
2431 ) -> fidl::Result<()> {
2432 encoder.debug_check_bounds::<DeviceExtension>(offset);
2433 self.0.encode(encoder, offset + 0, depth)?;
2437 self.1.encode(encoder, offset + 1, depth)?;
2438 self.2.encode(encoder, offset + 2, depth)?;
2439 Ok(())
2440 }
2441 }
2442
2443 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceExtension {
2444 #[inline(always)]
2445 fn new_empty() -> Self {
2446 Self {
2447 is_synthetic: fidl::new_empty!(bool, D),
2448 mac_implementation_type: fidl::new_empty!(MacImplementationType, D),
2449 tx_status_report_supported: fidl::new_empty!(bool, D),
2450 }
2451 }
2452
2453 #[inline]
2454 unsafe fn decode(
2455 &mut self,
2456 decoder: &mut fidl::encoding::Decoder<'_, D>,
2457 offset: usize,
2458 _depth: fidl::encoding::Depth,
2459 ) -> fidl::Result<()> {
2460 decoder.debug_check_bounds::<Self>(offset);
2461 fidl::decode!(bool, D, &mut self.is_synthetic, decoder, offset + 0, _depth)?;
2463 fidl::decode!(
2464 MacImplementationType,
2465 D,
2466 &mut self.mac_implementation_type,
2467 decoder,
2468 offset + 1,
2469 _depth
2470 )?;
2471 fidl::decode!(
2472 bool,
2473 D,
2474 &mut self.tx_status_report_supported,
2475 decoder,
2476 offset + 2,
2477 _depth
2478 )?;
2479 Ok(())
2480 }
2481 }
2482
2483 impl fidl::encoding::ValueTypeMarker for DfsFeature {
2484 type Borrowed<'a> = &'a Self;
2485 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2486 value
2487 }
2488 }
2489
2490 unsafe impl fidl::encoding::TypeMarker for DfsFeature {
2491 type Owned = Self;
2492
2493 #[inline(always)]
2494 fn inline_align(_context: fidl::encoding::Context) -> usize {
2495 1
2496 }
2497
2498 #[inline(always)]
2499 fn inline_size(_context: fidl::encoding::Context) -> usize {
2500 1
2501 }
2502 }
2503
2504 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DfsFeature, D>
2505 for &DfsFeature
2506 {
2507 #[inline]
2508 unsafe fn encode(
2509 self,
2510 encoder: &mut fidl::encoding::Encoder<'_, D>,
2511 offset: usize,
2512 _depth: fidl::encoding::Depth,
2513 ) -> fidl::Result<()> {
2514 encoder.debug_check_bounds::<DfsFeature>(offset);
2515 fidl::encoding::Encode::<DfsFeature, D>::encode(
2517 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2518 encoder,
2519 offset,
2520 _depth,
2521 )
2522 }
2523 }
2524 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2525 fidl::encoding::Encode<DfsFeature, D> for (T0,)
2526 {
2527 #[inline]
2528 unsafe fn encode(
2529 self,
2530 encoder: &mut fidl::encoding::Encoder<'_, D>,
2531 offset: usize,
2532 depth: fidl::encoding::Depth,
2533 ) -> fidl::Result<()> {
2534 encoder.debug_check_bounds::<DfsFeature>(offset);
2535 self.0.encode(encoder, offset + 0, depth)?;
2539 Ok(())
2540 }
2541 }
2542
2543 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DfsFeature {
2544 #[inline(always)]
2545 fn new_empty() -> Self {
2546 Self { supported: fidl::new_empty!(bool, D) }
2547 }
2548
2549 #[inline]
2550 unsafe fn decode(
2551 &mut self,
2552 decoder: &mut fidl::encoding::Decoder<'_, D>,
2553 offset: usize,
2554 _depth: fidl::encoding::Depth,
2555 ) -> fidl::Result<()> {
2556 decoder.debug_check_bounds::<Self>(offset);
2557 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2559 Ok(())
2560 }
2561 }
2562
2563 impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
2564 type Borrowed<'a> = &'a Self;
2565 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2566 value
2567 }
2568 }
2569
2570 unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
2571 type Owned = Self;
2572
2573 #[inline(always)]
2574 fn inline_align(_context: fidl::encoding::Context) -> usize {
2575 1
2576 }
2577
2578 #[inline(always)]
2579 fn inline_size(_context: fidl::encoding::Context) -> usize {
2580 3
2581 }
2582 }
2583
2584 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
2585 for &DiscoverySupport
2586 {
2587 #[inline]
2588 unsafe fn encode(
2589 self,
2590 encoder: &mut fidl::encoding::Encoder<'_, D>,
2591 offset: usize,
2592 _depth: fidl::encoding::Depth,
2593 ) -> fidl::Result<()> {
2594 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2595 fidl::encoding::Encode::<DiscoverySupport, D>::encode(
2597 (
2598 <ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2599 &self.scan_offload,
2600 ),
2601 <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2602 &self.probe_response_offload,
2603 ),
2604 ),
2605 encoder,
2606 offset,
2607 _depth,
2608 )
2609 }
2610 }
2611 unsafe impl<
2612 D: fidl::encoding::ResourceDialect,
2613 T0: fidl::encoding::Encode<ScanOffloadExtension, D>,
2614 T1: fidl::encoding::Encode<ProbeResponseOffloadExtension, D>,
2615 > fidl::encoding::Encode<DiscoverySupport, D> for (T0, T1)
2616 {
2617 #[inline]
2618 unsafe fn encode(
2619 self,
2620 encoder: &mut fidl::encoding::Encoder<'_, D>,
2621 offset: usize,
2622 depth: fidl::encoding::Depth,
2623 ) -> fidl::Result<()> {
2624 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2625 self.0.encode(encoder, offset + 0, depth)?;
2629 self.1.encode(encoder, offset + 2, depth)?;
2630 Ok(())
2631 }
2632 }
2633
2634 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
2635 #[inline(always)]
2636 fn new_empty() -> Self {
2637 Self {
2638 scan_offload: fidl::new_empty!(ScanOffloadExtension, D),
2639 probe_response_offload: fidl::new_empty!(ProbeResponseOffloadExtension, D),
2640 }
2641 }
2642
2643 #[inline]
2644 unsafe fn decode(
2645 &mut self,
2646 decoder: &mut fidl::encoding::Decoder<'_, D>,
2647 offset: usize,
2648 _depth: fidl::encoding::Depth,
2649 ) -> fidl::Result<()> {
2650 decoder.debug_check_bounds::<Self>(offset);
2651 fidl::decode!(
2653 ScanOffloadExtension,
2654 D,
2655 &mut self.scan_offload,
2656 decoder,
2657 offset + 0,
2658 _depth
2659 )?;
2660 fidl::decode!(
2661 ProbeResponseOffloadExtension,
2662 D,
2663 &mut self.probe_response_offload,
2664 decoder,
2665 offset + 2,
2666 _depth
2667 )?;
2668 Ok(())
2669 }
2670 }
2671
2672 impl fidl::encoding::ValueTypeMarker for MacSublayerSupport {
2673 type Borrowed<'a> = &'a Self;
2674 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2675 value
2676 }
2677 }
2678
2679 unsafe impl fidl::encoding::TypeMarker for MacSublayerSupport {
2680 type Owned = Self;
2681
2682 #[inline(always)]
2683 fn inline_align(_context: fidl::encoding::Context) -> usize {
2684 1
2685 }
2686
2687 #[inline(always)]
2688 fn inline_size(_context: fidl::encoding::Context) -> usize {
2689 5
2690 }
2691 }
2692
2693 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MacSublayerSupport, D>
2694 for &MacSublayerSupport
2695 {
2696 #[inline]
2697 unsafe fn encode(
2698 self,
2699 encoder: &mut fidl::encoding::Encoder<'_, D>,
2700 offset: usize,
2701 _depth: fidl::encoding::Depth,
2702 ) -> fidl::Result<()> {
2703 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2704 fidl::encoding::Encode::<MacSublayerSupport, D>::encode(
2706 (
2707 <RateSelectionOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2708 &self.rate_selection_offload,
2709 ),
2710 <DataPlaneExtension as fidl::encoding::ValueTypeMarker>::borrow(
2711 &self.data_plane,
2712 ),
2713 <DeviceExtension as fidl::encoding::ValueTypeMarker>::borrow(&self.device),
2714 ),
2715 encoder,
2716 offset,
2717 _depth,
2718 )
2719 }
2720 }
2721 unsafe impl<
2722 D: fidl::encoding::ResourceDialect,
2723 T0: fidl::encoding::Encode<RateSelectionOffloadExtension, D>,
2724 T1: fidl::encoding::Encode<DataPlaneExtension, D>,
2725 T2: fidl::encoding::Encode<DeviceExtension, D>,
2726 > fidl::encoding::Encode<MacSublayerSupport, D> for (T0, T1, T2)
2727 {
2728 #[inline]
2729 unsafe fn encode(
2730 self,
2731 encoder: &mut fidl::encoding::Encoder<'_, D>,
2732 offset: usize,
2733 depth: fidl::encoding::Depth,
2734 ) -> fidl::Result<()> {
2735 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2736 self.0.encode(encoder, offset + 0, depth)?;
2740 self.1.encode(encoder, offset + 1, depth)?;
2741 self.2.encode(encoder, offset + 2, depth)?;
2742 Ok(())
2743 }
2744 }
2745
2746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacSublayerSupport {
2747 #[inline(always)]
2748 fn new_empty() -> Self {
2749 Self {
2750 rate_selection_offload: fidl::new_empty!(RateSelectionOffloadExtension, D),
2751 data_plane: fidl::new_empty!(DataPlaneExtension, D),
2752 device: fidl::new_empty!(DeviceExtension, D),
2753 }
2754 }
2755
2756 #[inline]
2757 unsafe fn decode(
2758 &mut self,
2759 decoder: &mut fidl::encoding::Decoder<'_, D>,
2760 offset: usize,
2761 _depth: fidl::encoding::Depth,
2762 ) -> fidl::Result<()> {
2763 decoder.debug_check_bounds::<Self>(offset);
2764 fidl::decode!(
2766 RateSelectionOffloadExtension,
2767 D,
2768 &mut self.rate_selection_offload,
2769 decoder,
2770 offset + 0,
2771 _depth
2772 )?;
2773 fidl::decode!(
2774 DataPlaneExtension,
2775 D,
2776 &mut self.data_plane,
2777 decoder,
2778 offset + 1,
2779 _depth
2780 )?;
2781 fidl::decode!(DeviceExtension, D, &mut self.device, decoder, offset + 2, _depth)?;
2782 Ok(())
2783 }
2784 }
2785
2786 impl fidl::encoding::ValueTypeMarker for MfpFeature {
2787 type Borrowed<'a> = &'a Self;
2788 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2789 value
2790 }
2791 }
2792
2793 unsafe impl fidl::encoding::TypeMarker for MfpFeature {
2794 type Owned = Self;
2795
2796 #[inline(always)]
2797 fn inline_align(_context: fidl::encoding::Context) -> usize {
2798 1
2799 }
2800
2801 #[inline(always)]
2802 fn inline_size(_context: fidl::encoding::Context) -> usize {
2803 1
2804 }
2805 }
2806
2807 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MfpFeature, D>
2808 for &MfpFeature
2809 {
2810 #[inline]
2811 unsafe fn encode(
2812 self,
2813 encoder: &mut fidl::encoding::Encoder<'_, D>,
2814 offset: usize,
2815 _depth: fidl::encoding::Depth,
2816 ) -> fidl::Result<()> {
2817 encoder.debug_check_bounds::<MfpFeature>(offset);
2818 fidl::encoding::Encode::<MfpFeature, D>::encode(
2820 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2821 encoder,
2822 offset,
2823 _depth,
2824 )
2825 }
2826 }
2827 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2828 fidl::encoding::Encode<MfpFeature, D> for (T0,)
2829 {
2830 #[inline]
2831 unsafe fn encode(
2832 self,
2833 encoder: &mut fidl::encoding::Encoder<'_, D>,
2834 offset: usize,
2835 depth: fidl::encoding::Depth,
2836 ) -> fidl::Result<()> {
2837 encoder.debug_check_bounds::<MfpFeature>(offset);
2838 self.0.encode(encoder, offset + 0, depth)?;
2842 Ok(())
2843 }
2844 }
2845
2846 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MfpFeature {
2847 #[inline(always)]
2848 fn new_empty() -> Self {
2849 Self { supported: fidl::new_empty!(bool, D) }
2850 }
2851
2852 #[inline]
2853 unsafe fn decode(
2854 &mut self,
2855 decoder: &mut fidl::encoding::Decoder<'_, D>,
2856 offset: usize,
2857 _depth: fidl::encoding::Depth,
2858 ) -> fidl::Result<()> {
2859 decoder.debug_check_bounds::<Self>(offset);
2860 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2862 Ok(())
2863 }
2864 }
2865
2866 impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
2867 type Borrowed<'a> = &'a Self;
2868 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2869 value
2870 }
2871 }
2872
2873 unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
2874 type Owned = Self;
2875
2876 #[inline(always)]
2877 fn inline_align(_context: fidl::encoding::Context) -> usize {
2878 1
2879 }
2880
2881 #[inline(always)]
2882 fn inline_size(_context: fidl::encoding::Context) -> usize {
2883 1
2884 }
2885 }
2886
2887 unsafe impl<D: fidl::encoding::ResourceDialect>
2888 fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
2889 for &ProbeResponseOffloadExtension
2890 {
2891 #[inline]
2892 unsafe fn encode(
2893 self,
2894 encoder: &mut fidl::encoding::Encoder<'_, D>,
2895 offset: usize,
2896 _depth: fidl::encoding::Depth,
2897 ) -> fidl::Result<()> {
2898 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2899 fidl::encoding::Encode::<ProbeResponseOffloadExtension, D>::encode(
2901 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2902 encoder,
2903 offset,
2904 _depth,
2905 )
2906 }
2907 }
2908 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2909 fidl::encoding::Encode<ProbeResponseOffloadExtension, D> for (T0,)
2910 {
2911 #[inline]
2912 unsafe fn encode(
2913 self,
2914 encoder: &mut fidl::encoding::Encoder<'_, D>,
2915 offset: usize,
2916 depth: fidl::encoding::Depth,
2917 ) -> fidl::Result<()> {
2918 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2919 self.0.encode(encoder, offset + 0, depth)?;
2923 Ok(())
2924 }
2925 }
2926
2927 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2928 for ProbeResponseOffloadExtension
2929 {
2930 #[inline(always)]
2931 fn new_empty() -> Self {
2932 Self { supported: fidl::new_empty!(bool, D) }
2933 }
2934
2935 #[inline]
2936 unsafe fn decode(
2937 &mut self,
2938 decoder: &mut fidl::encoding::Decoder<'_, D>,
2939 offset: usize,
2940 _depth: fidl::encoding::Depth,
2941 ) -> fidl::Result<()> {
2942 decoder.debug_check_bounds::<Self>(offset);
2943 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2945 Ok(())
2946 }
2947 }
2948
2949 impl fidl::encoding::ValueTypeMarker for RateSelectionOffloadExtension {
2950 type Borrowed<'a> = &'a Self;
2951 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2952 value
2953 }
2954 }
2955
2956 unsafe impl fidl::encoding::TypeMarker for RateSelectionOffloadExtension {
2957 type Owned = Self;
2958
2959 #[inline(always)]
2960 fn inline_align(_context: fidl::encoding::Context) -> usize {
2961 1
2962 }
2963
2964 #[inline(always)]
2965 fn inline_size(_context: fidl::encoding::Context) -> usize {
2966 1
2967 }
2968 }
2969
2970 unsafe impl<D: fidl::encoding::ResourceDialect>
2971 fidl::encoding::Encode<RateSelectionOffloadExtension, D>
2972 for &RateSelectionOffloadExtension
2973 {
2974 #[inline]
2975 unsafe fn encode(
2976 self,
2977 encoder: &mut fidl::encoding::Encoder<'_, D>,
2978 offset: usize,
2979 _depth: fidl::encoding::Depth,
2980 ) -> fidl::Result<()> {
2981 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
2982 fidl::encoding::Encode::<RateSelectionOffloadExtension, D>::encode(
2984 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2985 encoder,
2986 offset,
2987 _depth,
2988 )
2989 }
2990 }
2991 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2992 fidl::encoding::Encode<RateSelectionOffloadExtension, D> for (T0,)
2993 {
2994 #[inline]
2995 unsafe fn encode(
2996 self,
2997 encoder: &mut fidl::encoding::Encoder<'_, D>,
2998 offset: usize,
2999 depth: fidl::encoding::Depth,
3000 ) -> fidl::Result<()> {
3001 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
3002 self.0.encode(encoder, offset + 0, depth)?;
3006 Ok(())
3007 }
3008 }
3009
3010 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3011 for RateSelectionOffloadExtension
3012 {
3013 #[inline(always)]
3014 fn new_empty() -> Self {
3015 Self { supported: fidl::new_empty!(bool, D) }
3016 }
3017
3018 #[inline]
3019 unsafe fn decode(
3020 &mut self,
3021 decoder: &mut fidl::encoding::Decoder<'_, D>,
3022 offset: usize,
3023 _depth: fidl::encoding::Depth,
3024 ) -> fidl::Result<()> {
3025 decoder.debug_check_bounds::<Self>(offset);
3026 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3028 Ok(())
3029 }
3030 }
3031
3032 impl fidl::encoding::ValueTypeMarker for SaeFeature {
3033 type Borrowed<'a> = &'a Self;
3034 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3035 value
3036 }
3037 }
3038
3039 unsafe impl fidl::encoding::TypeMarker for SaeFeature {
3040 type Owned = Self;
3041
3042 #[inline(always)]
3043 fn inline_align(_context: fidl::encoding::Context) -> usize {
3044 1
3045 }
3046
3047 #[inline(always)]
3048 fn inline_size(_context: fidl::encoding::Context) -> usize {
3049 2
3050 }
3051 }
3052
3053 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SaeFeature, D>
3054 for &SaeFeature
3055 {
3056 #[inline]
3057 unsafe fn encode(
3058 self,
3059 encoder: &mut fidl::encoding::Encoder<'_, D>,
3060 offset: usize,
3061 _depth: fidl::encoding::Depth,
3062 ) -> fidl::Result<()> {
3063 encoder.debug_check_bounds::<SaeFeature>(offset);
3064 fidl::encoding::Encode::<SaeFeature, D>::encode(
3066 (
3067 <bool as fidl::encoding::ValueTypeMarker>::borrow(
3068 &self.driver_handler_supported,
3069 ),
3070 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.sme_handler_supported),
3071 ),
3072 encoder,
3073 offset,
3074 _depth,
3075 )
3076 }
3077 }
3078 unsafe impl<
3079 D: fidl::encoding::ResourceDialect,
3080 T0: fidl::encoding::Encode<bool, D>,
3081 T1: fidl::encoding::Encode<bool, D>,
3082 > fidl::encoding::Encode<SaeFeature, D> for (T0, T1)
3083 {
3084 #[inline]
3085 unsafe fn encode(
3086 self,
3087 encoder: &mut fidl::encoding::Encoder<'_, D>,
3088 offset: usize,
3089 depth: fidl::encoding::Depth,
3090 ) -> fidl::Result<()> {
3091 encoder.debug_check_bounds::<SaeFeature>(offset);
3092 self.0.encode(encoder, offset + 0, depth)?;
3096 self.1.encode(encoder, offset + 1, depth)?;
3097 Ok(())
3098 }
3099 }
3100
3101 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SaeFeature {
3102 #[inline(always)]
3103 fn new_empty() -> Self {
3104 Self {
3105 driver_handler_supported: fidl::new_empty!(bool, D),
3106 sme_handler_supported: fidl::new_empty!(bool, D),
3107 }
3108 }
3109
3110 #[inline]
3111 unsafe fn decode(
3112 &mut self,
3113 decoder: &mut fidl::encoding::Decoder<'_, D>,
3114 offset: usize,
3115 _depth: fidl::encoding::Depth,
3116 ) -> fidl::Result<()> {
3117 decoder.debug_check_bounds::<Self>(offset);
3118 fidl::decode!(
3120 bool,
3121 D,
3122 &mut self.driver_handler_supported,
3123 decoder,
3124 offset + 0,
3125 _depth
3126 )?;
3127 fidl::decode!(bool, D, &mut self.sme_handler_supported, decoder, offset + 1, _depth)?;
3128 Ok(())
3129 }
3130 }
3131
3132 impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
3133 type Borrowed<'a> = &'a Self;
3134 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3135 value
3136 }
3137 }
3138
3139 unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
3140 type Owned = Self;
3141
3142 #[inline(always)]
3143 fn inline_align(_context: fidl::encoding::Context) -> usize {
3144 1
3145 }
3146
3147 #[inline(always)]
3148 fn inline_size(_context: fidl::encoding::Context) -> usize {
3149 2
3150 }
3151 }
3152
3153 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
3154 for &ScanOffloadExtension
3155 {
3156 #[inline]
3157 unsafe fn encode(
3158 self,
3159 encoder: &mut fidl::encoding::Encoder<'_, D>,
3160 offset: usize,
3161 _depth: fidl::encoding::Depth,
3162 ) -> fidl::Result<()> {
3163 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
3164 fidl::encoding::Encode::<ScanOffloadExtension, D>::encode(
3166 (
3167 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),
3168 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_cancel_supported),
3169 ),
3170 encoder,
3171 offset,
3172 _depth,
3173 )
3174 }
3175 }
3176 unsafe impl<
3177 D: fidl::encoding::ResourceDialect,
3178 T0: fidl::encoding::Encode<bool, D>,
3179 T1: fidl::encoding::Encode<bool, D>,
3180 > fidl::encoding::Encode<ScanOffloadExtension, D> for (T0, T1)
3181 {
3182 #[inline]
3183 unsafe fn encode(
3184 self,
3185 encoder: &mut fidl::encoding::Encoder<'_, D>,
3186 offset: usize,
3187 depth: fidl::encoding::Depth,
3188 ) -> fidl::Result<()> {
3189 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
3190 self.0.encode(encoder, offset + 0, depth)?;
3194 self.1.encode(encoder, offset + 1, depth)?;
3195 Ok(())
3196 }
3197 }
3198
3199 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
3200 #[inline(always)]
3201 fn new_empty() -> Self {
3202 Self {
3203 supported: fidl::new_empty!(bool, D),
3204 scan_cancel_supported: fidl::new_empty!(bool, D),
3205 }
3206 }
3207
3208 #[inline]
3209 unsafe fn decode(
3210 &mut self,
3211 decoder: &mut fidl::encoding::Decoder<'_, D>,
3212 offset: usize,
3213 _depth: fidl::encoding::Depth,
3214 ) -> fidl::Result<()> {
3215 decoder.debug_check_bounds::<Self>(offset);
3216 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3218 fidl::decode!(bool, D, &mut self.scan_cancel_supported, decoder, offset + 1, _depth)?;
3219 Ok(())
3220 }
3221 }
3222
3223 impl fidl::encoding::ValueTypeMarker for SecuritySupport {
3224 type Borrowed<'a> = &'a Self;
3225 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3226 value
3227 }
3228 }
3229
3230 unsafe impl fidl::encoding::TypeMarker for SecuritySupport {
3231 type Owned = Self;
3232
3233 #[inline(always)]
3234 fn inline_align(_context: fidl::encoding::Context) -> usize {
3235 1
3236 }
3237
3238 #[inline(always)]
3239 fn inline_size(_context: fidl::encoding::Context) -> usize {
3240 3
3241 }
3242 }
3243
3244 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecuritySupport, D>
3245 for &SecuritySupport
3246 {
3247 #[inline]
3248 unsafe fn encode(
3249 self,
3250 encoder: &mut fidl::encoding::Encoder<'_, D>,
3251 offset: usize,
3252 _depth: fidl::encoding::Depth,
3253 ) -> fidl::Result<()> {
3254 encoder.debug_check_bounds::<SecuritySupport>(offset);
3255 fidl::encoding::Encode::<SecuritySupport, D>::encode(
3257 (
3258 <SaeFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.sae),
3259 <MfpFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.mfp),
3260 ),
3261 encoder,
3262 offset,
3263 _depth,
3264 )
3265 }
3266 }
3267 unsafe impl<
3268 D: fidl::encoding::ResourceDialect,
3269 T0: fidl::encoding::Encode<SaeFeature, D>,
3270 T1: fidl::encoding::Encode<MfpFeature, D>,
3271 > fidl::encoding::Encode<SecuritySupport, D> for (T0, T1)
3272 {
3273 #[inline]
3274 unsafe fn encode(
3275 self,
3276 encoder: &mut fidl::encoding::Encoder<'_, D>,
3277 offset: usize,
3278 depth: fidl::encoding::Depth,
3279 ) -> fidl::Result<()> {
3280 encoder.debug_check_bounds::<SecuritySupport>(offset);
3281 self.0.encode(encoder, offset + 0, depth)?;
3285 self.1.encode(encoder, offset + 2, depth)?;
3286 Ok(())
3287 }
3288 }
3289
3290 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecuritySupport {
3291 #[inline(always)]
3292 fn new_empty() -> Self {
3293 Self { sae: fidl::new_empty!(SaeFeature, D), mfp: fidl::new_empty!(MfpFeature, D) }
3294 }
3295
3296 #[inline]
3297 unsafe fn decode(
3298 &mut self,
3299 decoder: &mut fidl::encoding::Decoder<'_, D>,
3300 offset: usize,
3301 _depth: fidl::encoding::Depth,
3302 ) -> fidl::Result<()> {
3303 decoder.debug_check_bounds::<Self>(offset);
3304 fidl::decode!(SaeFeature, D, &mut self.sae, decoder, offset + 0, _depth)?;
3306 fidl::decode!(MfpFeature, D, &mut self.mfp, decoder, offset + 2, _depth)?;
3307 Ok(())
3308 }
3309 }
3310
3311 impl fidl::encoding::ValueTypeMarker for SpectrumManagementSupport {
3312 type Borrowed<'a> = &'a Self;
3313 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3314 value
3315 }
3316 }
3317
3318 unsafe impl fidl::encoding::TypeMarker for SpectrumManagementSupport {
3319 type Owned = Self;
3320
3321 #[inline(always)]
3322 fn inline_align(_context: fidl::encoding::Context) -> usize {
3323 1
3324 }
3325
3326 #[inline(always)]
3327 fn inline_size(_context: fidl::encoding::Context) -> usize {
3328 1
3329 }
3330 }
3331
3332 unsafe impl<D: fidl::encoding::ResourceDialect>
3333 fidl::encoding::Encode<SpectrumManagementSupport, D> for &SpectrumManagementSupport
3334 {
3335 #[inline]
3336 unsafe fn encode(
3337 self,
3338 encoder: &mut fidl::encoding::Encoder<'_, D>,
3339 offset: usize,
3340 _depth: fidl::encoding::Depth,
3341 ) -> fidl::Result<()> {
3342 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3343 fidl::encoding::Encode::<SpectrumManagementSupport, D>::encode(
3345 (<DfsFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.dfs),),
3346 encoder,
3347 offset,
3348 _depth,
3349 )
3350 }
3351 }
3352 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DfsFeature, D>>
3353 fidl::encoding::Encode<SpectrumManagementSupport, D> for (T0,)
3354 {
3355 #[inline]
3356 unsafe fn encode(
3357 self,
3358 encoder: &mut fidl::encoding::Encoder<'_, D>,
3359 offset: usize,
3360 depth: fidl::encoding::Depth,
3361 ) -> fidl::Result<()> {
3362 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3363 self.0.encode(encoder, offset + 0, depth)?;
3367 Ok(())
3368 }
3369 }
3370
3371 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3372 for SpectrumManagementSupport
3373 {
3374 #[inline(always)]
3375 fn new_empty() -> Self {
3376 Self { dfs: fidl::new_empty!(DfsFeature, D) }
3377 }
3378
3379 #[inline]
3380 unsafe fn decode(
3381 &mut self,
3382 decoder: &mut fidl::encoding::Decoder<'_, D>,
3383 offset: usize,
3384 _depth: fidl::encoding::Depth,
3385 ) -> fidl::Result<()> {
3386 decoder.debug_check_bounds::<Self>(offset);
3387 fidl::decode!(DfsFeature, D, &mut self.dfs, decoder, offset + 0, _depth)?;
3389 Ok(())
3390 }
3391 }
3392
3393 impl fidl::encoding::ValueTypeMarker for WlanChannel {
3394 type Borrowed<'a> = &'a Self;
3395 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3396 value
3397 }
3398 }
3399
3400 unsafe impl fidl::encoding::TypeMarker for WlanChannel {
3401 type Owned = Self;
3402
3403 #[inline(always)]
3404 fn inline_align(_context: fidl::encoding::Context) -> usize {
3405 4
3406 }
3407
3408 #[inline(always)]
3409 fn inline_size(_context: fidl::encoding::Context) -> usize {
3410 12
3411 }
3412 }
3413
3414 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanChannel, D>
3415 for &WlanChannel
3416 {
3417 #[inline]
3418 unsafe fn encode(
3419 self,
3420 encoder: &mut fidl::encoding::Encoder<'_, D>,
3421 offset: usize,
3422 _depth: fidl::encoding::Depth,
3423 ) -> fidl::Result<()> {
3424 encoder.debug_check_bounds::<WlanChannel>(offset);
3425 fidl::encoding::Encode::<WlanChannel, D>::encode(
3427 (
3428 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary),
3429 <ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
3430 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary80),
3431 ),
3432 encoder,
3433 offset,
3434 _depth,
3435 )
3436 }
3437 }
3438 unsafe impl<
3439 D: fidl::encoding::ResourceDialect,
3440 T0: fidl::encoding::Encode<u8, D>,
3441 T1: fidl::encoding::Encode<ChannelBandwidth, D>,
3442 T2: fidl::encoding::Encode<u8, D>,
3443 > fidl::encoding::Encode<WlanChannel, D> for (T0, T1, T2)
3444 {
3445 #[inline]
3446 unsafe fn encode(
3447 self,
3448 encoder: &mut fidl::encoding::Encoder<'_, D>,
3449 offset: usize,
3450 depth: fidl::encoding::Depth,
3451 ) -> fidl::Result<()> {
3452 encoder.debug_check_bounds::<WlanChannel>(offset);
3453 unsafe {
3456 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3457 (ptr as *mut u32).write_unaligned(0);
3458 }
3459 unsafe {
3460 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3461 (ptr as *mut u32).write_unaligned(0);
3462 }
3463 self.0.encode(encoder, offset + 0, depth)?;
3465 self.1.encode(encoder, offset + 4, depth)?;
3466 self.2.encode(encoder, offset + 8, depth)?;
3467 Ok(())
3468 }
3469 }
3470
3471 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanChannel {
3472 #[inline(always)]
3473 fn new_empty() -> Self {
3474 Self {
3475 primary: fidl::new_empty!(u8, D),
3476 cbw: fidl::new_empty!(ChannelBandwidth, D),
3477 secondary80: fidl::new_empty!(u8, D),
3478 }
3479 }
3480
3481 #[inline]
3482 unsafe fn decode(
3483 &mut self,
3484 decoder: &mut fidl::encoding::Decoder<'_, D>,
3485 offset: usize,
3486 _depth: fidl::encoding::Depth,
3487 ) -> fidl::Result<()> {
3488 decoder.debug_check_bounds::<Self>(offset);
3489 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3491 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3492 let mask = 0xffffff00u32;
3493 let maskedval = padval & mask;
3494 if maskedval != 0 {
3495 return Err(fidl::Error::NonZeroPadding {
3496 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3497 });
3498 }
3499 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3500 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3501 let mask = 0xffffff00u32;
3502 let maskedval = padval & mask;
3503 if maskedval != 0 {
3504 return Err(fidl::Error::NonZeroPadding {
3505 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3506 });
3507 }
3508 fidl::decode!(u8, D, &mut self.primary, decoder, offset + 0, _depth)?;
3509 fidl::decode!(ChannelBandwidth, D, &mut self.cbw, decoder, offset + 4, _depth)?;
3510 fidl::decode!(u8, D, &mut self.secondary80, decoder, offset + 8, _depth)?;
3511 Ok(())
3512 }
3513 }
3514
3515 impl fidl::encoding::ValueTypeMarker for WlanTxResult {
3516 type Borrowed<'a> = &'a Self;
3517 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3518 value
3519 }
3520 }
3521
3522 unsafe impl fidl::encoding::TypeMarker for WlanTxResult {
3523 type Owned = Self;
3524
3525 #[inline(always)]
3526 fn inline_align(_context: fidl::encoding::Context) -> usize {
3527 2
3528 }
3529
3530 #[inline(always)]
3531 fn inline_size(_context: fidl::encoding::Context) -> usize {
3532 40
3533 }
3534 }
3535
3536 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResult, D>
3537 for &WlanTxResult
3538 {
3539 #[inline]
3540 unsafe fn encode(
3541 self,
3542 encoder: &mut fidl::encoding::Encoder<'_, D>,
3543 offset: usize,
3544 _depth: fidl::encoding::Depth,
3545 ) -> fidl::Result<()> {
3546 encoder.debug_check_bounds::<WlanTxResult>(offset);
3547 fidl::encoding::Encode::<WlanTxResult, D>::encode(
3549 (
3550 <fidl::encoding::Array<WlanTxResultEntry, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result_entry),
3551 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_addr),
3552 <WlanTxResultCode as fidl::encoding::ValueTypeMarker>::borrow(&self.result_code),
3553 ),
3554 encoder, offset, _depth
3555 )
3556 }
3557 }
3558 unsafe impl<
3559 D: fidl::encoding::ResourceDialect,
3560 T0: fidl::encoding::Encode<fidl::encoding::Array<WlanTxResultEntry, 8>, D>,
3561 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
3562 T2: fidl::encoding::Encode<WlanTxResultCode, D>,
3563 > fidl::encoding::Encode<WlanTxResult, D> for (T0, T1, T2)
3564 {
3565 #[inline]
3566 unsafe fn encode(
3567 self,
3568 encoder: &mut fidl::encoding::Encoder<'_, D>,
3569 offset: usize,
3570 depth: fidl::encoding::Depth,
3571 ) -> fidl::Result<()> {
3572 encoder.debug_check_bounds::<WlanTxResult>(offset);
3573 unsafe {
3576 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(38);
3577 (ptr as *mut u16).write_unaligned(0);
3578 }
3579 self.0.encode(encoder, offset + 0, depth)?;
3581 self.1.encode(encoder, offset + 32, depth)?;
3582 self.2.encode(encoder, offset + 38, depth)?;
3583 Ok(())
3584 }
3585 }
3586
3587 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResult {
3588 #[inline(always)]
3589 fn new_empty() -> Self {
3590 Self {
3591 tx_result_entry: fidl::new_empty!(fidl::encoding::Array<WlanTxResultEntry, 8>, D),
3592 peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
3593 result_code: fidl::new_empty!(WlanTxResultCode, D),
3594 }
3595 }
3596
3597 #[inline]
3598 unsafe fn decode(
3599 &mut self,
3600 decoder: &mut fidl::encoding::Decoder<'_, D>,
3601 offset: usize,
3602 _depth: fidl::encoding::Depth,
3603 ) -> fidl::Result<()> {
3604 decoder.debug_check_bounds::<Self>(offset);
3605 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(38) };
3607 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3608 let mask = 0xff00u16;
3609 let maskedval = padval & mask;
3610 if maskedval != 0 {
3611 return Err(fidl::Error::NonZeroPadding {
3612 padding_start: offset + 38 + ((mask as u64).trailing_zeros() / 8) as usize,
3613 });
3614 }
3615 fidl::decode!(fidl::encoding::Array<WlanTxResultEntry, 8>, D, &mut self.tx_result_entry, decoder, offset + 0, _depth)?;
3616 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 32, _depth)?;
3617 fidl::decode!(
3618 WlanTxResultCode,
3619 D,
3620 &mut self.result_code,
3621 decoder,
3622 offset + 38,
3623 _depth
3624 )?;
3625 Ok(())
3626 }
3627 }
3628
3629 impl fidl::encoding::ValueTypeMarker for WlanTxResultEntry {
3630 type Borrowed<'a> = &'a Self;
3631 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3632 value
3633 }
3634 }
3635
3636 unsafe impl fidl::encoding::TypeMarker for WlanTxResultEntry {
3637 type Owned = Self;
3638
3639 #[inline(always)]
3640 fn inline_align(_context: fidl::encoding::Context) -> usize {
3641 2
3642 }
3643
3644 #[inline(always)]
3645 fn inline_size(_context: fidl::encoding::Context) -> usize {
3646 4
3647 }
3648 }
3649
3650 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResultEntry, D>
3651 for &WlanTxResultEntry
3652 {
3653 #[inline]
3654 unsafe fn encode(
3655 self,
3656 encoder: &mut fidl::encoding::Encoder<'_, D>,
3657 offset: usize,
3658 _depth: fidl::encoding::Depth,
3659 ) -> fidl::Result<()> {
3660 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3661 unsafe {
3662 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3664 (buf_ptr as *mut WlanTxResultEntry)
3665 .write_unaligned((self as *const WlanTxResultEntry).read());
3666 let padding_ptr = buf_ptr.offset(2) as *mut u16;
3669 let padding_mask = 0xff00u16;
3670 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3671 }
3672 Ok(())
3673 }
3674 }
3675 unsafe impl<
3676 D: fidl::encoding::ResourceDialect,
3677 T0: fidl::encoding::Encode<u16, D>,
3678 T1: fidl::encoding::Encode<u8, D>,
3679 > fidl::encoding::Encode<WlanTxResultEntry, D> for (T0, T1)
3680 {
3681 #[inline]
3682 unsafe fn encode(
3683 self,
3684 encoder: &mut fidl::encoding::Encoder<'_, D>,
3685 offset: usize,
3686 depth: fidl::encoding::Depth,
3687 ) -> fidl::Result<()> {
3688 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3689 unsafe {
3692 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3693 (ptr as *mut u16).write_unaligned(0);
3694 }
3695 self.0.encode(encoder, offset + 0, depth)?;
3697 self.1.encode(encoder, offset + 2, depth)?;
3698 Ok(())
3699 }
3700 }
3701
3702 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultEntry {
3703 #[inline(always)]
3704 fn new_empty() -> Self {
3705 Self { tx_vector_idx: fidl::new_empty!(u16, D), attempts: fidl::new_empty!(u8, D) }
3706 }
3707
3708 #[inline]
3709 unsafe fn decode(
3710 &mut self,
3711 decoder: &mut fidl::encoding::Decoder<'_, D>,
3712 offset: usize,
3713 _depth: fidl::encoding::Depth,
3714 ) -> fidl::Result<()> {
3715 decoder.debug_check_bounds::<Self>(offset);
3716 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3717 let ptr = unsafe { buf_ptr.offset(2) };
3719 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3720 let mask = 0xff00u16;
3721 let maskedval = padval & mask;
3722 if maskedval != 0 {
3723 return Err(fidl::Error::NonZeroPadding {
3724 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3725 });
3726 }
3727 unsafe {
3729 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3730 }
3731 Ok(())
3732 }
3733 }
3734
3735 impl fidl::encoding::ValueTypeMarker for WlanWmmAccessCategoryParameters {
3736 type Borrowed<'a> = &'a Self;
3737 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3738 value
3739 }
3740 }
3741
3742 unsafe impl fidl::encoding::TypeMarker for WlanWmmAccessCategoryParameters {
3743 type Owned = Self;
3744
3745 #[inline(always)]
3746 fn inline_align(_context: fidl::encoding::Context) -> usize {
3747 2
3748 }
3749
3750 #[inline(always)]
3751 fn inline_size(_context: fidl::encoding::Context) -> usize {
3752 8
3753 }
3754 }
3755
3756 unsafe impl<D: fidl::encoding::ResourceDialect>
3757 fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>
3758 for &WlanWmmAccessCategoryParameters
3759 {
3760 #[inline]
3761 unsafe fn encode(
3762 self,
3763 encoder: &mut fidl::encoding::Encoder<'_, D>,
3764 offset: usize,
3765 _depth: fidl::encoding::Depth,
3766 ) -> fidl::Result<()> {
3767 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3768 fidl::encoding::Encode::<WlanWmmAccessCategoryParameters, D>::encode(
3770 (
3771 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_min),
3772 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_max),
3773 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.aifsn),
3774 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.txop_limit),
3775 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.acm),
3776 ),
3777 encoder,
3778 offset,
3779 _depth,
3780 )
3781 }
3782 }
3783 unsafe impl<
3784 D: fidl::encoding::ResourceDialect,
3785 T0: fidl::encoding::Encode<u8, D>,
3786 T1: fidl::encoding::Encode<u8, D>,
3787 T2: fidl::encoding::Encode<u8, D>,
3788 T3: fidl::encoding::Encode<u16, D>,
3789 T4: fidl::encoding::Encode<bool, D>,
3790 > fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D> for (T0, T1, T2, T3, T4)
3791 {
3792 #[inline]
3793 unsafe fn encode(
3794 self,
3795 encoder: &mut fidl::encoding::Encoder<'_, D>,
3796 offset: usize,
3797 depth: fidl::encoding::Depth,
3798 ) -> fidl::Result<()> {
3799 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3800 unsafe {
3803 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3804 (ptr as *mut u16).write_unaligned(0);
3805 }
3806 unsafe {
3807 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(6);
3808 (ptr as *mut u16).write_unaligned(0);
3809 }
3810 self.0.encode(encoder, offset + 0, depth)?;
3812 self.1.encode(encoder, offset + 1, depth)?;
3813 self.2.encode(encoder, offset + 2, depth)?;
3814 self.3.encode(encoder, offset + 4, depth)?;
3815 self.4.encode(encoder, offset + 6, depth)?;
3816 Ok(())
3817 }
3818 }
3819
3820 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3821 for WlanWmmAccessCategoryParameters
3822 {
3823 #[inline(always)]
3824 fn new_empty() -> Self {
3825 Self {
3826 ecw_min: fidl::new_empty!(u8, D),
3827 ecw_max: fidl::new_empty!(u8, D),
3828 aifsn: fidl::new_empty!(u8, D),
3829 txop_limit: fidl::new_empty!(u16, D),
3830 acm: fidl::new_empty!(bool, D),
3831 }
3832 }
3833
3834 #[inline]
3835 unsafe fn decode(
3836 &mut self,
3837 decoder: &mut fidl::encoding::Decoder<'_, D>,
3838 offset: usize,
3839 _depth: fidl::encoding::Depth,
3840 ) -> fidl::Result<()> {
3841 decoder.debug_check_bounds::<Self>(offset);
3842 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
3844 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3845 let mask = 0xff00u16;
3846 let maskedval = padval & mask;
3847 if maskedval != 0 {
3848 return Err(fidl::Error::NonZeroPadding {
3849 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3850 });
3851 }
3852 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(6) };
3853 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3854 let mask = 0xff00u16;
3855 let maskedval = padval & mask;
3856 if maskedval != 0 {
3857 return Err(fidl::Error::NonZeroPadding {
3858 padding_start: offset + 6 + ((mask as u64).trailing_zeros() / 8) as usize,
3859 });
3860 }
3861 fidl::decode!(u8, D, &mut self.ecw_min, decoder, offset + 0, _depth)?;
3862 fidl::decode!(u8, D, &mut self.ecw_max, decoder, offset + 1, _depth)?;
3863 fidl::decode!(u8, D, &mut self.aifsn, decoder, offset + 2, _depth)?;
3864 fidl::decode!(u16, D, &mut self.txop_limit, decoder, offset + 4, _depth)?;
3865 fidl::decode!(bool, D, &mut self.acm, decoder, offset + 6, _depth)?;
3866 Ok(())
3867 }
3868 }
3869
3870 impl fidl::encoding::ValueTypeMarker for WlanWmmParameters {
3871 type Borrowed<'a> = &'a Self;
3872 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3873 value
3874 }
3875 }
3876
3877 unsafe impl fidl::encoding::TypeMarker for WlanWmmParameters {
3878 type Owned = Self;
3879
3880 #[inline(always)]
3881 fn inline_align(_context: fidl::encoding::Context) -> usize {
3882 2
3883 }
3884
3885 #[inline(always)]
3886 fn inline_size(_context: fidl::encoding::Context) -> usize {
3887 34
3888 }
3889 }
3890
3891 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanWmmParameters, D>
3892 for &WlanWmmParameters
3893 {
3894 #[inline]
3895 unsafe fn encode(
3896 self,
3897 encoder: &mut fidl::encoding::Encoder<'_, D>,
3898 offset: usize,
3899 _depth: fidl::encoding::Depth,
3900 ) -> fidl::Result<()> {
3901 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3902 fidl::encoding::Encode::<WlanWmmParameters, D>::encode(
3904 (
3905 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.apsd),
3906 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3907 &self.ac_be_params,
3908 ),
3909 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3910 &self.ac_bk_params,
3911 ),
3912 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3913 &self.ac_vi_params,
3914 ),
3915 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3916 &self.ac_vo_params,
3917 ),
3918 ),
3919 encoder,
3920 offset,
3921 _depth,
3922 )
3923 }
3924 }
3925 unsafe impl<
3926 D: fidl::encoding::ResourceDialect,
3927 T0: fidl::encoding::Encode<bool, D>,
3928 T1: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3929 T2: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3930 T3: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3931 T4: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3932 > fidl::encoding::Encode<WlanWmmParameters, D> for (T0, T1, T2, T3, T4)
3933 {
3934 #[inline]
3935 unsafe fn encode(
3936 self,
3937 encoder: &mut fidl::encoding::Encoder<'_, D>,
3938 offset: usize,
3939 depth: fidl::encoding::Depth,
3940 ) -> fidl::Result<()> {
3941 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3942 unsafe {
3945 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3946 (ptr as *mut u16).write_unaligned(0);
3947 }
3948 self.0.encode(encoder, offset + 0, depth)?;
3950 self.1.encode(encoder, offset + 2, depth)?;
3951 self.2.encode(encoder, offset + 10, depth)?;
3952 self.3.encode(encoder, offset + 18, depth)?;
3953 self.4.encode(encoder, offset + 26, depth)?;
3954 Ok(())
3955 }
3956 }
3957
3958 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanWmmParameters {
3959 #[inline(always)]
3960 fn new_empty() -> Self {
3961 Self {
3962 apsd: fidl::new_empty!(bool, D),
3963 ac_be_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3964 ac_bk_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3965 ac_vi_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3966 ac_vo_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3967 }
3968 }
3969
3970 #[inline]
3971 unsafe fn decode(
3972 &mut self,
3973 decoder: &mut fidl::encoding::Decoder<'_, D>,
3974 offset: usize,
3975 _depth: fidl::encoding::Depth,
3976 ) -> fidl::Result<()> {
3977 decoder.debug_check_bounds::<Self>(offset);
3978 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3980 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3981 let mask = 0xff00u16;
3982 let maskedval = padval & mask;
3983 if maskedval != 0 {
3984 return Err(fidl::Error::NonZeroPadding {
3985 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3986 });
3987 }
3988 fidl::decode!(bool, D, &mut self.apsd, decoder, offset + 0, _depth)?;
3989 fidl::decode!(
3990 WlanWmmAccessCategoryParameters,
3991 D,
3992 &mut self.ac_be_params,
3993 decoder,
3994 offset + 2,
3995 _depth
3996 )?;
3997 fidl::decode!(
3998 WlanWmmAccessCategoryParameters,
3999 D,
4000 &mut self.ac_bk_params,
4001 decoder,
4002 offset + 10,
4003 _depth
4004 )?;
4005 fidl::decode!(
4006 WlanWmmAccessCategoryParameters,
4007 D,
4008 &mut self.ac_vi_params,
4009 decoder,
4010 offset + 18,
4011 _depth
4012 )?;
4013 fidl::decode!(
4014 WlanWmmAccessCategoryParameters,
4015 D,
4016 &mut self.ac_vo_params,
4017 decoder,
4018 offset + 26,
4019 _depth
4020 )?;
4021 Ok(())
4022 }
4023 }
4024
4025 impl JoinBssRequest {
4026 #[inline(always)]
4027 fn max_ordinal_present(&self) -> u64 {
4028 if let Some(_) = self.beacon_period {
4029 return 4;
4030 }
4031 if let Some(_) = self.remote {
4032 return 3;
4033 }
4034 if let Some(_) = self.bss_type {
4035 return 2;
4036 }
4037 if let Some(_) = self.bssid {
4038 return 1;
4039 }
4040 0
4041 }
4042 }
4043
4044 impl fidl::encoding::ValueTypeMarker for JoinBssRequest {
4045 type Borrowed<'a> = &'a Self;
4046 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4047 value
4048 }
4049 }
4050
4051 unsafe impl fidl::encoding::TypeMarker for JoinBssRequest {
4052 type Owned = Self;
4053
4054 #[inline(always)]
4055 fn inline_align(_context: fidl::encoding::Context) -> usize {
4056 8
4057 }
4058
4059 #[inline(always)]
4060 fn inline_size(_context: fidl::encoding::Context) -> usize {
4061 16
4062 }
4063 }
4064
4065 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssRequest, D>
4066 for &JoinBssRequest
4067 {
4068 unsafe fn encode(
4069 self,
4070 encoder: &mut fidl::encoding::Encoder<'_, D>,
4071 offset: usize,
4072 mut depth: fidl::encoding::Depth,
4073 ) -> fidl::Result<()> {
4074 encoder.debug_check_bounds::<JoinBssRequest>(offset);
4075 let max_ordinal: u64 = self.max_ordinal_present();
4077 encoder.write_num(max_ordinal, offset);
4078 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4079 if max_ordinal == 0 {
4081 return Ok(());
4082 }
4083 depth.increment()?;
4084 let envelope_size = 8;
4085 let bytes_len = max_ordinal as usize * envelope_size;
4086 #[allow(unused_variables)]
4087 let offset = encoder.out_of_line_offset(bytes_len);
4088 let mut _prev_end_offset: usize = 0;
4089 if 1 > max_ordinal {
4090 return Ok(());
4091 }
4092
4093 let cur_offset: usize = (1 - 1) * envelope_size;
4096
4097 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4099
4100 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4105 self.bssid
4106 .as_ref()
4107 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4108 encoder,
4109 offset + cur_offset,
4110 depth,
4111 )?;
4112
4113 _prev_end_offset = cur_offset + envelope_size;
4114 if 2 > max_ordinal {
4115 return Ok(());
4116 }
4117
4118 let cur_offset: usize = (2 - 1) * envelope_size;
4121
4122 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4124
4125 fidl::encoding::encode_in_envelope_optional::<BssType, D>(
4130 self.bss_type.as_ref().map(<BssType as fidl::encoding::ValueTypeMarker>::borrow),
4131 encoder,
4132 offset + cur_offset,
4133 depth,
4134 )?;
4135
4136 _prev_end_offset = cur_offset + envelope_size;
4137 if 3 > max_ordinal {
4138 return Ok(());
4139 }
4140
4141 let cur_offset: usize = (3 - 1) * envelope_size;
4144
4145 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4147
4148 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4153 self.remote.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4154 encoder,
4155 offset + cur_offset,
4156 depth,
4157 )?;
4158
4159 _prev_end_offset = cur_offset + envelope_size;
4160 if 4 > max_ordinal {
4161 return Ok(());
4162 }
4163
4164 let cur_offset: usize = (4 - 1) * envelope_size;
4167
4168 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4170
4171 fidl::encoding::encode_in_envelope_optional::<u16, D>(
4176 self.beacon_period.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
4177 encoder,
4178 offset + cur_offset,
4179 depth,
4180 )?;
4181
4182 _prev_end_offset = cur_offset + envelope_size;
4183
4184 Ok(())
4185 }
4186 }
4187
4188 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssRequest {
4189 #[inline(always)]
4190 fn new_empty() -> Self {
4191 Self::default()
4192 }
4193
4194 unsafe fn decode(
4195 &mut self,
4196 decoder: &mut fidl::encoding::Decoder<'_, D>,
4197 offset: usize,
4198 mut depth: fidl::encoding::Depth,
4199 ) -> fidl::Result<()> {
4200 decoder.debug_check_bounds::<Self>(offset);
4201 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4202 None => return Err(fidl::Error::NotNullable),
4203 Some(len) => len,
4204 };
4205 if len == 0 {
4207 return Ok(());
4208 };
4209 depth.increment()?;
4210 let envelope_size = 8;
4211 let bytes_len = len * envelope_size;
4212 let offset = decoder.out_of_line_offset(bytes_len)?;
4213 let mut _next_ordinal_to_read = 0;
4215 let mut next_offset = offset;
4216 let end_offset = offset + bytes_len;
4217 _next_ordinal_to_read += 1;
4218 if next_offset >= end_offset {
4219 return Ok(());
4220 }
4221
4222 while _next_ordinal_to_read < 1 {
4224 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4225 _next_ordinal_to_read += 1;
4226 next_offset += envelope_size;
4227 }
4228
4229 let next_out_of_line = decoder.next_out_of_line();
4230 let handles_before = decoder.remaining_handles();
4231 if let Some((inlined, num_bytes, num_handles)) =
4232 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4233 {
4234 let member_inline_size =
4235 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4236 decoder.context,
4237 );
4238 if inlined != (member_inline_size <= 4) {
4239 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4240 }
4241 let inner_offset;
4242 let mut inner_depth = depth.clone();
4243 if inlined {
4244 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4245 inner_offset = next_offset;
4246 } else {
4247 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4248 inner_depth.increment()?;
4249 }
4250 let val_ref = self
4251 .bssid
4252 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4253 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4254 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4255 {
4256 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4257 }
4258 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4259 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4260 }
4261 }
4262
4263 next_offset += envelope_size;
4264 _next_ordinal_to_read += 1;
4265 if next_offset >= end_offset {
4266 return Ok(());
4267 }
4268
4269 while _next_ordinal_to_read < 2 {
4271 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4272 _next_ordinal_to_read += 1;
4273 next_offset += envelope_size;
4274 }
4275
4276 let next_out_of_line = decoder.next_out_of_line();
4277 let handles_before = decoder.remaining_handles();
4278 if let Some((inlined, num_bytes, num_handles)) =
4279 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4280 {
4281 let member_inline_size =
4282 <BssType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4283 if inlined != (member_inline_size <= 4) {
4284 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4285 }
4286 let inner_offset;
4287 let mut inner_depth = depth.clone();
4288 if inlined {
4289 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4290 inner_offset = next_offset;
4291 } else {
4292 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4293 inner_depth.increment()?;
4294 }
4295 let val_ref = self.bss_type.get_or_insert_with(|| fidl::new_empty!(BssType, D));
4296 fidl::decode!(BssType, D, val_ref, decoder, inner_offset, inner_depth)?;
4297 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4298 {
4299 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4300 }
4301 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4302 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4303 }
4304 }
4305
4306 next_offset += envelope_size;
4307 _next_ordinal_to_read += 1;
4308 if next_offset >= end_offset {
4309 return Ok(());
4310 }
4311
4312 while _next_ordinal_to_read < 3 {
4314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4315 _next_ordinal_to_read += 1;
4316 next_offset += envelope_size;
4317 }
4318
4319 let next_out_of_line = decoder.next_out_of_line();
4320 let handles_before = decoder.remaining_handles();
4321 if let Some((inlined, num_bytes, num_handles)) =
4322 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4323 {
4324 let member_inline_size =
4325 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4326 if inlined != (member_inline_size <= 4) {
4327 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4328 }
4329 let inner_offset;
4330 let mut inner_depth = depth.clone();
4331 if inlined {
4332 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4333 inner_offset = next_offset;
4334 } else {
4335 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4336 inner_depth.increment()?;
4337 }
4338 let val_ref = self.remote.get_or_insert_with(|| fidl::new_empty!(bool, D));
4339 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4340 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4341 {
4342 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4343 }
4344 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4345 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4346 }
4347 }
4348
4349 next_offset += envelope_size;
4350 _next_ordinal_to_read += 1;
4351 if next_offset >= end_offset {
4352 return Ok(());
4353 }
4354
4355 while _next_ordinal_to_read < 4 {
4357 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4358 _next_ordinal_to_read += 1;
4359 next_offset += envelope_size;
4360 }
4361
4362 let next_out_of_line = decoder.next_out_of_line();
4363 let handles_before = decoder.remaining_handles();
4364 if let Some((inlined, num_bytes, num_handles)) =
4365 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4366 {
4367 let member_inline_size =
4368 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4369 if inlined != (member_inline_size <= 4) {
4370 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4371 }
4372 let inner_offset;
4373 let mut inner_depth = depth.clone();
4374 if inlined {
4375 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4376 inner_offset = next_offset;
4377 } else {
4378 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4379 inner_depth.increment()?;
4380 }
4381 let val_ref = self.beacon_period.get_or_insert_with(|| fidl::new_empty!(u16, D));
4382 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4383 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4384 {
4385 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4386 }
4387 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4388 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4389 }
4390 }
4391
4392 next_offset += envelope_size;
4393
4394 while next_offset < end_offset {
4396 _next_ordinal_to_read += 1;
4397 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4398 next_offset += envelope_size;
4399 }
4400
4401 Ok(())
4402 }
4403 }
4404
4405 impl WlanKeyConfig {
4406 #[inline(always)]
4407 fn max_ordinal_present(&self) -> u64 {
4408 if let Some(_) = self.rsc {
4409 return 8;
4410 }
4411 if let Some(_) = self.key {
4412 return 7;
4413 }
4414 if let Some(_) = self.key_idx {
4415 return 6;
4416 }
4417 if let Some(_) = self.peer_addr {
4418 return 5;
4419 }
4420 if let Some(_) = self.key_type {
4421 return 4;
4422 }
4423 if let Some(_) = self.cipher_type {
4424 return 3;
4425 }
4426 if let Some(_) = self.cipher_oui {
4427 return 2;
4428 }
4429 if let Some(_) = self.protection {
4430 return 1;
4431 }
4432 0
4433 }
4434 }
4435
4436 impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
4437 type Borrowed<'a> = &'a Self;
4438 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4439 value
4440 }
4441 }
4442
4443 unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
4444 type Owned = Self;
4445
4446 #[inline(always)]
4447 fn inline_align(_context: fidl::encoding::Context) -> usize {
4448 8
4449 }
4450
4451 #[inline(always)]
4452 fn inline_size(_context: fidl::encoding::Context) -> usize {
4453 16
4454 }
4455 }
4456
4457 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
4458 for &WlanKeyConfig
4459 {
4460 unsafe fn encode(
4461 self,
4462 encoder: &mut fidl::encoding::Encoder<'_, D>,
4463 offset: usize,
4464 mut depth: fidl::encoding::Depth,
4465 ) -> fidl::Result<()> {
4466 encoder.debug_check_bounds::<WlanKeyConfig>(offset);
4467 let max_ordinal: u64 = self.max_ordinal_present();
4469 encoder.write_num(max_ordinal, offset);
4470 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4471 if max_ordinal == 0 {
4473 return Ok(());
4474 }
4475 depth.increment()?;
4476 let envelope_size = 8;
4477 let bytes_len = max_ordinal as usize * envelope_size;
4478 #[allow(unused_variables)]
4479 let offset = encoder.out_of_line_offset(bytes_len);
4480 let mut _prev_end_offset: usize = 0;
4481 if 1 > max_ordinal {
4482 return Ok(());
4483 }
4484
4485 let cur_offset: usize = (1 - 1) * envelope_size;
4488
4489 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4491
4492 fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4497 self.protection
4498 .as_ref()
4499 .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4500 encoder,
4501 offset + cur_offset,
4502 depth,
4503 )?;
4504
4505 _prev_end_offset = cur_offset + envelope_size;
4506 if 2 > max_ordinal {
4507 return Ok(());
4508 }
4509
4510 let cur_offset: usize = (2 - 1) * envelope_size;
4513
4514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4516
4517 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4522 self.cipher_oui
4523 .as_ref()
4524 .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4525 encoder,
4526 offset + cur_offset,
4527 depth,
4528 )?;
4529
4530 _prev_end_offset = cur_offset + envelope_size;
4531 if 3 > max_ordinal {
4532 return Ok(());
4533 }
4534
4535 let cur_offset: usize = (3 - 1) * envelope_size;
4538
4539 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4541
4542 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::CipherSuiteType, D>(
4547 self.cipher_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211::CipherSuiteType as fidl::encoding::ValueTypeMarker>::borrow),
4548 encoder, offset + cur_offset, depth
4549 )?;
4550
4551 _prev_end_offset = cur_offset + envelope_size;
4552 if 4 > max_ordinal {
4553 return Ok(());
4554 }
4555
4556 let cur_offset: usize = (4 - 1) * envelope_size;
4559
4560 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4562
4563 fidl::encoding::encode_in_envelope_optional::<WlanKeyType, D>(
4568 self.key_type
4569 .as_ref()
4570 .map(<WlanKeyType as fidl::encoding::ValueTypeMarker>::borrow),
4571 encoder,
4572 offset + cur_offset,
4573 depth,
4574 )?;
4575
4576 _prev_end_offset = cur_offset + envelope_size;
4577 if 5 > max_ordinal {
4578 return Ok(());
4579 }
4580
4581 let cur_offset: usize = (5 - 1) * envelope_size;
4584
4585 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4587
4588 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4593 self.peer_addr
4594 .as_ref()
4595 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4596 encoder,
4597 offset + cur_offset,
4598 depth,
4599 )?;
4600
4601 _prev_end_offset = cur_offset + envelope_size;
4602 if 6 > max_ordinal {
4603 return Ok(());
4604 }
4605
4606 let cur_offset: usize = (6 - 1) * envelope_size;
4609
4610 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4612
4613 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4618 self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4619 encoder,
4620 offset + cur_offset,
4621 depth,
4622 )?;
4623
4624 _prev_end_offset = cur_offset + envelope_size;
4625 if 7 > max_ordinal {
4626 return Ok(());
4627 }
4628
4629 let cur_offset: usize = (7 - 1) * envelope_size;
4632
4633 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4635
4636 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4641 self.key.as_ref().map(
4642 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4643 ),
4644 encoder,
4645 offset + cur_offset,
4646 depth,
4647 )?;
4648
4649 _prev_end_offset = cur_offset + envelope_size;
4650 if 8 > max_ordinal {
4651 return Ok(());
4652 }
4653
4654 let cur_offset: usize = (8 - 1) * envelope_size;
4657
4658 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4660
4661 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4666 self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4667 encoder,
4668 offset + cur_offset,
4669 depth,
4670 )?;
4671
4672 _prev_end_offset = cur_offset + envelope_size;
4673
4674 Ok(())
4675 }
4676 }
4677
4678 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
4679 #[inline(always)]
4680 fn new_empty() -> Self {
4681 Self::default()
4682 }
4683
4684 unsafe fn decode(
4685 &mut self,
4686 decoder: &mut fidl::encoding::Decoder<'_, D>,
4687 offset: usize,
4688 mut depth: fidl::encoding::Depth,
4689 ) -> fidl::Result<()> {
4690 decoder.debug_check_bounds::<Self>(offset);
4691 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4692 None => return Err(fidl::Error::NotNullable),
4693 Some(len) => len,
4694 };
4695 if len == 0 {
4697 return Ok(());
4698 };
4699 depth.increment()?;
4700 let envelope_size = 8;
4701 let bytes_len = len * envelope_size;
4702 let offset = decoder.out_of_line_offset(bytes_len)?;
4703 let mut _next_ordinal_to_read = 0;
4705 let mut next_offset = offset;
4706 let end_offset = offset + bytes_len;
4707 _next_ordinal_to_read += 1;
4708 if next_offset >= end_offset {
4709 return Ok(());
4710 }
4711
4712 while _next_ordinal_to_read < 1 {
4714 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4715 _next_ordinal_to_read += 1;
4716 next_offset += envelope_size;
4717 }
4718
4719 let next_out_of_line = decoder.next_out_of_line();
4720 let handles_before = decoder.remaining_handles();
4721 if let Some((inlined, num_bytes, num_handles)) =
4722 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4723 {
4724 let member_inline_size =
4725 <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4726 if inlined != (member_inline_size <= 4) {
4727 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4728 }
4729 let inner_offset;
4730 let mut inner_depth = depth.clone();
4731 if inlined {
4732 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4733 inner_offset = next_offset;
4734 } else {
4735 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4736 inner_depth.increment()?;
4737 }
4738 let val_ref =
4739 self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4740 fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4741 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4742 {
4743 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4744 }
4745 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4746 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4747 }
4748 }
4749
4750 next_offset += envelope_size;
4751 _next_ordinal_to_read += 1;
4752 if next_offset >= end_offset {
4753 return Ok(());
4754 }
4755
4756 while _next_ordinal_to_read < 2 {
4758 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4759 _next_ordinal_to_read += 1;
4760 next_offset += envelope_size;
4761 }
4762
4763 let next_out_of_line = decoder.next_out_of_line();
4764 let handles_before = decoder.remaining_handles();
4765 if let Some((inlined, num_bytes, num_handles)) =
4766 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4767 {
4768 let member_inline_size =
4769 <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4770 decoder.context,
4771 );
4772 if inlined != (member_inline_size <= 4) {
4773 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4774 }
4775 let inner_offset;
4776 let mut inner_depth = depth.clone();
4777 if inlined {
4778 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4779 inner_offset = next_offset;
4780 } else {
4781 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4782 inner_depth.increment()?;
4783 }
4784 let val_ref = self
4785 .cipher_oui
4786 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4787 fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4788 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4789 {
4790 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4791 }
4792 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4793 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4794 }
4795 }
4796
4797 next_offset += envelope_size;
4798 _next_ordinal_to_read += 1;
4799 if next_offset >= end_offset {
4800 return Ok(());
4801 }
4802
4803 while _next_ordinal_to_read < 3 {
4805 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4806 _next_ordinal_to_read += 1;
4807 next_offset += envelope_size;
4808 }
4809
4810 let next_out_of_line = decoder.next_out_of_line();
4811 let handles_before = decoder.remaining_handles();
4812 if let Some((inlined, num_bytes, num_handles)) =
4813 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4814 {
4815 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::CipherSuiteType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4816 if inlined != (member_inline_size <= 4) {
4817 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4818 }
4819 let inner_offset;
4820 let mut inner_depth = depth.clone();
4821 if inlined {
4822 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4823 inner_offset = next_offset;
4824 } else {
4825 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4826 inner_depth.increment()?;
4827 }
4828 let val_ref = self.cipher_type.get_or_insert_with(|| {
4829 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::CipherSuiteType, D)
4830 });
4831 fidl::decode!(
4832 fidl_fuchsia_wlan_ieee80211::CipherSuiteType,
4833 D,
4834 val_ref,
4835 decoder,
4836 inner_offset,
4837 inner_depth
4838 )?;
4839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4840 {
4841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4842 }
4843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4845 }
4846 }
4847
4848 next_offset += envelope_size;
4849 _next_ordinal_to_read += 1;
4850 if next_offset >= end_offset {
4851 return Ok(());
4852 }
4853
4854 while _next_ordinal_to_read < 4 {
4856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4857 _next_ordinal_to_read += 1;
4858 next_offset += envelope_size;
4859 }
4860
4861 let next_out_of_line = decoder.next_out_of_line();
4862 let handles_before = decoder.remaining_handles();
4863 if let Some((inlined, num_bytes, num_handles)) =
4864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4865 {
4866 let member_inline_size =
4867 <WlanKeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4868 if inlined != (member_inline_size <= 4) {
4869 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4870 }
4871 let inner_offset;
4872 let mut inner_depth = depth.clone();
4873 if inlined {
4874 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4875 inner_offset = next_offset;
4876 } else {
4877 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4878 inner_depth.increment()?;
4879 }
4880 let val_ref = self.key_type.get_or_insert_with(|| fidl::new_empty!(WlanKeyType, D));
4881 fidl::decode!(WlanKeyType, D, val_ref, decoder, inner_offset, inner_depth)?;
4882 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4883 {
4884 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4885 }
4886 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4887 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4888 }
4889 }
4890
4891 next_offset += envelope_size;
4892 _next_ordinal_to_read += 1;
4893 if next_offset >= end_offset {
4894 return Ok(());
4895 }
4896
4897 while _next_ordinal_to_read < 5 {
4899 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4900 _next_ordinal_to_read += 1;
4901 next_offset += envelope_size;
4902 }
4903
4904 let next_out_of_line = decoder.next_out_of_line();
4905 let handles_before = decoder.remaining_handles();
4906 if let Some((inlined, num_bytes, num_handles)) =
4907 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4908 {
4909 let member_inline_size =
4910 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4911 decoder.context,
4912 );
4913 if inlined != (member_inline_size <= 4) {
4914 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4915 }
4916 let inner_offset;
4917 let mut inner_depth = depth.clone();
4918 if inlined {
4919 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4920 inner_offset = next_offset;
4921 } else {
4922 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4923 inner_depth.increment()?;
4924 }
4925 let val_ref = self
4926 .peer_addr
4927 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4928 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4929 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4930 {
4931 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4932 }
4933 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4934 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4935 }
4936 }
4937
4938 next_offset += envelope_size;
4939 _next_ordinal_to_read += 1;
4940 if next_offset >= end_offset {
4941 return Ok(());
4942 }
4943
4944 while _next_ordinal_to_read < 6 {
4946 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4947 _next_ordinal_to_read += 1;
4948 next_offset += envelope_size;
4949 }
4950
4951 let next_out_of_line = decoder.next_out_of_line();
4952 let handles_before = decoder.remaining_handles();
4953 if let Some((inlined, num_bytes, num_handles)) =
4954 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4955 {
4956 let member_inline_size =
4957 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4958 if inlined != (member_inline_size <= 4) {
4959 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4960 }
4961 let inner_offset;
4962 let mut inner_depth = depth.clone();
4963 if inlined {
4964 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4965 inner_offset = next_offset;
4966 } else {
4967 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4968 inner_depth.increment()?;
4969 }
4970 let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4971 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4972 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4973 {
4974 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4975 }
4976 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4977 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4978 }
4979 }
4980
4981 next_offset += envelope_size;
4982 _next_ordinal_to_read += 1;
4983 if next_offset >= end_offset {
4984 return Ok(());
4985 }
4986
4987 while _next_ordinal_to_read < 7 {
4989 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4990 _next_ordinal_to_read += 1;
4991 next_offset += envelope_size;
4992 }
4993
4994 let next_out_of_line = decoder.next_out_of_line();
4995 let handles_before = decoder.remaining_handles();
4996 if let Some((inlined, num_bytes, num_handles)) =
4997 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4998 {
4999 let member_inline_size =
5000 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
5001 decoder.context,
5002 );
5003 if inlined != (member_inline_size <= 4) {
5004 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5005 }
5006 let inner_offset;
5007 let mut inner_depth = depth.clone();
5008 if inlined {
5009 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5010 inner_offset = next_offset;
5011 } else {
5012 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5013 inner_depth.increment()?;
5014 }
5015 let val_ref = self
5016 .key
5017 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
5018 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
5019 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5020 {
5021 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5022 }
5023 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5024 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5025 }
5026 }
5027
5028 next_offset += envelope_size;
5029 _next_ordinal_to_read += 1;
5030 if next_offset >= end_offset {
5031 return Ok(());
5032 }
5033
5034 while _next_ordinal_to_read < 8 {
5036 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5037 _next_ordinal_to_read += 1;
5038 next_offset += envelope_size;
5039 }
5040
5041 let next_out_of_line = decoder.next_out_of_line();
5042 let handles_before = decoder.remaining_handles();
5043 if let Some((inlined, num_bytes, num_handles)) =
5044 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5045 {
5046 let member_inline_size =
5047 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5048 if inlined != (member_inline_size <= 4) {
5049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5050 }
5051 let inner_offset;
5052 let mut inner_depth = depth.clone();
5053 if inlined {
5054 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5055 inner_offset = next_offset;
5056 } else {
5057 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5058 inner_depth.increment()?;
5059 }
5060 let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
5061 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5062 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5063 {
5064 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5065 }
5066 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5067 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5068 }
5069 }
5070
5071 next_offset += envelope_size;
5072
5073 while next_offset < end_offset {
5075 _next_ordinal_to_read += 1;
5076 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5077 next_offset += envelope_size;
5078 }
5079
5080 Ok(())
5081 }
5082 }
5083}