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